summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/aqua11yfactory.h8
-rw-r--r--vcl/aqua/inc/aqua11yfocustracker.hxx26
-rw-r--r--vcl/aqua/inc/aqua11ylistener.hxx12
-rw-r--r--vcl/aqua/inc/aqua11ywrapper.h18
-rw-r--r--vcl/aqua/inc/aquaprintview.h8
-rw-r--r--vcl/aqua/inc/aquavclevents.hxx2
-rw-r--r--vcl/aqua/inc/aquavcltypes.h2
-rw-r--r--vcl/aqua/inc/keyboardfocuslistener.hxx2
-rw-r--r--vcl/aqua/inc/salatsuifontutils.hxx12
-rw-r--r--vcl/aqua/inc/salbmp.h62
-rw-r--r--vcl/aqua/inc/salcolorutils.hxx4
-rw-r--r--vcl/aqua/inc/salconst.h2
-rw-r--r--vcl/aqua/inc/saldata.hxx46
-rw-r--r--vcl/aqua/inc/salfontutils.hxx4
-rw-r--r--vcl/aqua/inc/salframe.h136
-rw-r--r--vcl/aqua/inc/salframeview.h48
-rw-r--r--vcl/aqua/inc/salgdi.h241
-rw-r--r--vcl/aqua/inc/salinst.h99
-rw-r--r--vcl/aqua/inc/salmathutils.hxx6
-rw-r--r--vcl/aqua/inc/salmenu.h30
-rw-r--r--vcl/aqua/inc/salnativewidgets.h6
-rw-r--r--vcl/aqua/inc/salnsmenu.h2
-rw-r--r--vcl/aqua/inc/salnstimer.h2
-rw-r--r--vcl/aqua/inc/salobj.h41
-rw-r--r--vcl/aqua/inc/salprn.h88
-rw-r--r--vcl/aqua/inc/salsys.h7
-rw-r--r--vcl/aqua/inc/saltimer.h6
-rw-r--r--vcl/aqua/inc/salvd.h12
-rw-r--r--vcl/aqua/inc/svsys.h2
-rw-r--r--vcl/aqua/inc/vclnsapp.h10
-rw-r--r--vcl/aqua/source/a11y/aqua11yactionwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.h4
-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/aqua11yfocuslistener.cxx22
-rw-r--r--vcl/aqua/source/a11y/aqua11yfocuslistener.hxx12
-rw-r--r--vcl/aqua/source/a11y/aqua11yfocustracker.cxx46
-rw-r--r--vcl/aqua/source/a11y/aqua11ylistener.cxx40
-rw-r--r--vcl/aqua/source/a11y/aqua11yrolehelper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.h4
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytablewrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm34
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.h4
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yutil.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.h4
-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/aqua11ywrapperbutton.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.h4
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.h4
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappergroup.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperlist.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h4
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiogroup.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperrow.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperscrollarea.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperscrollbar.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappersplitter.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperstatictext.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertabgroup.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertextarea.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappertoolbar.h2
-rw-r--r--vcl/aqua/source/a11y/documentfocuslistener.cxx62
-rw-r--r--vcl/aqua/source/a11y/documentfocuslistener.hxx10
-rw-r--r--vcl/aqua/source/app/saldata.cxx14
-rw-r--r--vcl/aqua/source/app/salinst.cxx84
-rw-r--r--vcl/aqua/source/app/salsys.cxx109
-rw-r--r--vcl/aqua/source/app/saltimer.cxx8
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm83
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.cxx59
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.hxx22
-rw-r--r--vcl/aqua/source/dtrans/DragActionConversion.cxx10
-rw-r--r--vcl/aqua/source/dtrans/DragActionConversion.hxx6
-rw-r--r--vcl/aqua/source/dtrans/DragSource.cxx75
-rw-r--r--vcl/aqua/source/dtrans/DragSource.hxx16
-rw-r--r--vcl/aqua/source/dtrans/DragSourceContext.cxx2
-rw-r--r--vcl/aqua/source/dtrans/DragSourceContext.hxx10
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.cxx140
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.hxx20
-rw-r--r--vcl/aqua/source/dtrans/HtmlFmtFlt.cxx64
-rw-r--r--vcl/aqua/source/dtrans/HtmlFmtFlt.hxx2
-rw-r--r--vcl/aqua/source/dtrans/OSXTransferable.cxx35
-rw-r--r--vcl/aqua/source/dtrans/OSXTransferable.hxx16
-rw-r--r--vcl/aqua/source/dtrans/PictToBmpFlt.cxx47
-rw-r--r--vcl/aqua/source/dtrans/PictToBmpFlt.hxx10
-rw-r--r--vcl/aqua/source/dtrans/aqua_clipboard.cxx82
-rw-r--r--vcl/aqua/source/dtrans/aqua_clipboard.hxx40
-rw-r--r--vcl/aqua/source/dtrans/aqua_service.cxx35
-rw-r--r--vcl/aqua/source/dtrans/service_entry.cxx26
-rw-r--r--vcl/aqua/source/dtrans/test_aquacb.cxx38
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm695
-rwxr-xr-xvcl/aqua/source/gdi/aquaprintview.mm2
-rw-r--r--vcl/aqua/source/gdi/salatslayout.cxx128
-rw-r--r--vcl/aqua/source/gdi/salatsuifontutils.cxx18
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx128
-rw-r--r--vcl/aqua/source/gdi/salcolorutils.cxx2
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx331
-rw-r--r--vcl/aqua/source/gdi/salgdiutils.cxx20
-rw-r--r--vcl/aqua/source/gdi/salmathutils.cxx26
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx350
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx208
-rw-r--r--vcl/aqua/source/gdi/salvd.cxx49
-rw-r--r--vcl/aqua/source/res/makefile.mk1
-rw-r--r--vcl/aqua/source/window/salframe.cxx405
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm117
-rw-r--r--vcl/aqua/source/window/salmenu.cxx121
-rwxr-xr-xvcl/aqua/source/window/salnsmenu.mm4
-rw-r--r--vcl/aqua/source/window/salobj.cxx26
-rw-r--r--vcl/inc/cupsmgr.hxx32
-rw-r--r--vcl/inc/list.h4
-rw-r--r--vcl/inc/pch/precompiled_vcl.cxx2
-rw-r--r--vcl/inc/pch/precompiled_vcl.hxx2
-rw-r--r--vcl/inc/sft.hxx52
-rw-r--r--vcl/inc/vcl/ImageListProvider.hxx2
-rw-r--r--vcl/inc/vcl/abstdlg.hxx20
-rw-r--r--vcl/inc/vcl/accel.h16
-rw-r--r--vcl/inc/vcl/accel.hxx116
-rw-r--r--vcl/inc/vcl/accmgr.hxx14
-rw-r--r--vcl/inc/vcl/alpha.hxx68
-rw-r--r--vcl/inc/vcl/animate.hxx212
-rw-r--r--vcl/inc/vcl/apptypes.hxx26
-rw-r--r--vcl/inc/vcl/arrange.hxx117
-rw-r--r--vcl/inc/vcl/bitmap.hxx342
-rw-r--r--vcl/inc/vcl/bitmapex.hxx162
-rw-r--r--vcl/inc/vcl/bmpacc.hxx126
-rw-r--r--vcl/inc/vcl/bmpfast.hxx2
-rw-r--r--vcl/inc/vcl/brdwin.hxx388
-rw-r--r--vcl/inc/vcl/btndlg.hxx93
-rw-r--r--vcl/inc/vcl/button.hxx162
-rw-r--r--vcl/inc/vcl/canvasbitmap.hxx8
-rw-r--r--vcl/inc/vcl/canvastools.hxx120
-rw-r--r--vcl/inc/vcl/cmdevt.h48
-rw-r--r--vcl/inc/vcl/cmdevt.hxx248
-rw-r--r--vcl/inc/vcl/combobox.h12
-rw-r--r--vcl/inc/vcl/combobox.hxx112
-rw-r--r--vcl/inc/vcl/configsettings.hxx10
-rw-r--r--vcl/inc/vcl/controldata.hxx2
-rw-r--r--vcl/inc/vcl/controllayout.hxx10
-rw-r--r--vcl/inc/vcl/ctrl.hxx42
-rw-r--r--vcl/inc/vcl/cursor.hxx88
-rw-r--r--vcl/inc/vcl/cvtgrf.hxx24
-rw-r--r--vcl/inc/vcl/cvtsvm.hxx108
-rw-r--r--vcl/inc/vcl/dbggui.hxx4
-rw-r--r--vcl/inc/vcl/decoview.hxx84
-rw-r--r--vcl/inc/vcl/dialog.hxx60
-rw-r--r--vcl/inc/vcl/displayconnectiondispatch.hxx52
-rw-r--r--vcl/inc/vcl/dllapi.h8
-rw-r--r--vcl/inc/vcl/dndevdis.hxx32
-rw-r--r--vcl/inc/vcl/dndhelp.hxx12
-rw-r--r--vcl/inc/vcl/dndlcon.hxx16
-rw-r--r--vcl/inc/vcl/dockingarea.hxx6
-rw-r--r--vcl/inc/vcl/dockwin.hxx342
-rw-r--r--vcl/inc/vcl/edit.hxx182
-rw-r--r--vcl/inc/vcl/event.hxx196
-rw-r--r--vcl/inc/vcl/evntpost.hxx6
-rw-r--r--vcl/inc/vcl/extoutdevdata.hxx2
-rw-r--r--vcl/inc/vcl/field.hxx208
-rw-r--r--vcl/inc/vcl/fixbrd.hxx40
-rw-r--r--vcl/inc/vcl/fixed.hxx38
-rw-r--r--vcl/inc/vcl/fldunit.hxx36
-rw-r--r--vcl/inc/vcl/floatwin.hxx154
-rw-r--r--vcl/inc/vcl/fntstyle.hxx10
-rw-r--r--vcl/inc/vcl/font.hxx148
-rw-r--r--vcl/inc/vcl/fontcache.hxx26
-rw-r--r--vcl/inc/vcl/fontcapabilities.hxx221
-rw-r--r--vcl/inc/vcl/fontmanager.hxx182
-rw-r--r--vcl/inc/vcl/fontsubset.hxx72
-rw-r--r--vcl/inc/vcl/gdimtf.hxx124
-rw-r--r--vcl/inc/vcl/gfxlink.hxx124
-rw-r--r--vcl/inc/vcl/glyphcache.hxx65
-rw-r--r--vcl/inc/vcl/gradient.hxx61
-rw-r--r--vcl/inc/vcl/graph.h10
-rw-r--r--vcl/inc/vcl/graph.hxx46
-rw-r--r--vcl/inc/vcl/graphictools.hxx226
-rw-r--r--vcl/inc/vcl/graphite_adaptors.hxx147
-rw-r--r--vcl/inc/vcl/graphite_cache.hxx290
-rw-r--r--vcl/inc/vcl/graphite_features.hxx51
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx124
-rw-r--r--vcl/inc/vcl/graphite_serverfont.hxx33
-rw-r--r--vcl/inc/vcl/group.hxx10
-rw-r--r--vcl/inc/vcl/hatch.hxx42
-rw-r--r--vcl/inc/vcl/help.hxx107
-rw-r--r--vcl/inc/vcl/helper.hxx2
-rw-r--r--vcl/inc/vcl/helpwin.hxx55
-rw-r--r--vcl/inc/vcl/i18nhelp.hxx12
-rw-r--r--vcl/inc/vcl/idlemgr.hxx8
-rw-r--r--vcl/inc/vcl/ilstbox.hxx675
-rw-r--r--vcl/inc/vcl/image.h82
-rw-r--r--vcl/inc/vcl/image.hxx92
-rw-r--r--vcl/inc/vcl/imagerepository.hxx9
-rw-r--r--vcl/inc/vcl/imgctrl.hxx21
-rw-r--r--vcl/inc/vcl/impbmp.hxx64
-rw-r--r--vcl/inc/vcl/impbmpconv.hxx (renamed from vcl/inc/vcl/wpropset.hxx)39
-rw-r--r--vcl/inc/vcl/impdel.hxx28
-rw-r--r--vcl/inc/vcl/impfont.hxx125
-rw-r--r--vcl/inc/vcl/impgraph.hxx146
-rw-r--r--vcl/inc/vcl/impimagetree.hxx18
-rw-r--r--vcl/inc/vcl/impoct.hxx74
-rw-r--r--vcl/inc/vcl/inputctx.hxx40
-rw-r--r--vcl/inc/vcl/introwin.hxx2
-rw-r--r--vcl/inc/vcl/javachild.hxx6
-rw-r--r--vcl/inc/vcl/jobdata.hxx8
-rw-r--r--vcl/inc/vcl/jobset.h40
-rw-r--r--vcl/inc/vcl/jobset.hxx36
-rw-r--r--vcl/inc/vcl/keycod.hxx52
-rw-r--r--vcl/inc/vcl/keycodes.hxx266
-rw-r--r--vcl/inc/vcl/lazydelete.hxx93
-rw-r--r--vcl/inc/vcl/lineinfo.hxx70
-rw-r--r--vcl/inc/vcl/longcurr.hxx116
-rw-r--r--vcl/inc/vcl/lstbox.h16
-rw-r--r--vcl/inc/vcl/lstbox.hxx200
-rw-r--r--vcl/inc/vcl/mapmod.hxx50
-rw-r--r--vcl/inc/vcl/mapunit.hxx36
-rw-r--r--vcl/inc/vcl/menu.hxx458
-rw-r--r--vcl/inc/vcl/menubtn.hxx48
-rw-r--r--vcl/inc/vcl/metaact.hxx988
-rw-r--r--vcl/inc/vcl/metric.hxx74
-rw-r--r--vcl/inc/vcl/mnemonic.hxx36
-rw-r--r--vcl/inc/vcl/mnemonicengine.hxx8
-rw-r--r--vcl/inc/vcl/morebtn.hxx18
-rw-r--r--vcl/inc/vcl/msgbox.hxx89
-rw-r--r--vcl/inc/vcl/octree.hxx96
-rw-r--r--vcl/inc/vcl/oldprintadaptor.hxx6
-rw-r--r--vcl/inc/vcl/outdata.hxx2
-rw-r--r--vcl/inc/vcl/outdev.h52
-rw-r--r--vcl/inc/vcl/outdev.hxx564
-rw-r--r--vcl/inc/vcl/outfont.hxx45
-rw-r--r--vcl/inc/vcl/pdfextoutdevdata.hxx82
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx317
-rw-r--r--vcl/inc/vcl/pngread.hxx12
-rw-r--r--vcl/inc/vcl/pngwrite.hxx8
-rw-r--r--vcl/inc/vcl/pointr.hxx10
-rw-r--r--vcl/inc/vcl/polyscan.hxx100
-rw-r--r--vcl/inc/vcl/popupmenuwindow.hxx2
-rw-r--r--vcl/inc/vcl/ppdparser.hxx96
-rw-r--r--vcl/inc/vcl/print.h14
-rw-r--r--vcl/inc/vcl/print.hxx403
-rw-r--r--vcl/inc/vcl/printergfx.hxx144
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx49
-rw-r--r--vcl/inc/vcl/printerjob.hxx20
-rw-r--r--vcl/inc/vcl/prndlg.hxx119
-rw-r--r--vcl/inc/vcl/prntypes.hxx79
-rw-r--r--vcl/inc/vcl/ptrstyle.hxx180
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx95
-rw-r--r--vcl/inc/vcl/regband.hxx70
-rw-r--r--vcl/inc/vcl/region.h56
-rw-r--r--vcl/inc/vcl/region.hxx101
-rw-r--r--vcl/inc/vcl/salatype.hxx50
-rw-r--r--vcl/inc/vcl/salbmp.hxx28
-rw-r--r--vcl/inc/vcl/salbtype.hxx492
-rw-r--r--vcl/inc/vcl/salctrlhandle.hxx51
-rw-r--r--vcl/inc/vcl/salctype.hxx50
-rw-r--r--vcl/inc/vcl/saldatabasic.hxx14
-rw-r--r--vcl/inc/vcl/salframe.hxx178
-rw-r--r--vcl/inc/vcl/salgdi.hxx192
-rw-r--r--vcl/inc/vcl/salgeom.hxx4
-rw-r--r--vcl/inc/vcl/salgtype.hxx50
-rw-r--r--vcl/inc/vcl/salimestatus.hxx4
-rw-r--r--vcl/inc/vcl/salinst.hxx110
-rw-r--r--vcl/inc/vcl/sallayout.hxx22
-rw-r--r--vcl/inc/vcl/salmenu.hxx38
-rw-r--r--vcl/inc/vcl/salnativewidgets.hxx216
-rw-r--r--vcl/inc/vcl/salobj.hxx58
-rw-r--r--vcl/inc/vcl/salprn.hxx70
-rw-r--r--vcl/inc/vcl/salptype.hxx14
-rw-r--r--vcl/inc/vcl/salsession.hxx32
-rw-r--r--vcl/inc/vcl/salsys.hxx42
-rw-r--r--vcl/inc/vcl/saltimer.hxx16
-rw-r--r--vcl/inc/vcl/salvd.hxx12
-rw-r--r--vcl/inc/vcl/salwtype.hxx242
-rw-r--r--vcl/inc/vcl/scrbar.hxx42
-rw-r--r--vcl/inc/vcl/seleng.hxx116
-rw-r--r--vcl/inc/vcl/settings.hxx636
-rw-r--r--vcl/inc/vcl/slider.hxx144
-rw-r--r--vcl/inc/vcl/smartid.hxx90
-rw-r--r--vcl/inc/vcl/sndstyle.hxx4
-rw-r--r--vcl/inc/vcl/sound.hxx2
-rw-r--r--vcl/inc/vcl/spin.h10
-rw-r--r--vcl/inc/vcl/spin.hxx28
-rw-r--r--vcl/inc/vcl/spinfld.hxx84
-rw-r--r--vcl/inc/vcl/split.hxx18
-rw-r--r--vcl/inc/vcl/splitwin.hxx312
-rw-r--r--vcl/inc/vcl/status.hxx226
-rw-r--r--vcl/inc/vcl/stdtext.hxx14
-rw-r--r--vcl/inc/vcl/strhelper.hxx10
-rw-r--r--vcl/inc/vcl/subedit.hxx2
-rw-r--r--vcl/inc/vcl/sv.h2
-rw-r--r--vcl/inc/vcl/svapp.hxx211
-rw-r--r--vcl/inc/vcl/svcompat.hxx24
-rw-r--r--vcl/inc/vcl/svdata.hxx177
-rw-r--r--vcl/inc/vcl/svids.hrc143
-rw-r--r--vcl/inc/vcl/symbol.hxx81
-rw-r--r--vcl/inc/vcl/syschild.hxx19
-rw-r--r--vcl/inc/vcl/sysdata.hxx76
-rw-r--r--vcl/inc/vcl/syswin.hxx116
-rw-r--r--vcl/inc/vcl/tabctrl.hxx120
-rw-r--r--vcl/inc/vcl/tabdlg.hxx32
-rw-r--r--vcl/inc/vcl/tabpage.hxx20
-rw-r--r--vcl/inc/vcl/taskpanelist.hxx12
-rw-r--r--vcl/inc/vcl/textlayout.hxx4
-rw-r--r--vcl/inc/vcl/threadex.hxx12
-rw-r--r--vcl/inc/vcl/throbber.hxx101
-rw-r--r--vcl/inc/vcl/timer.hxx16
-rw-r--r--vcl/inc/vcl/toolbox.h86
-rw-r--r--vcl/inc/vcl/toolbox.hxx406
-rw-r--r--vcl/inc/vcl/unobrok.hxx4
-rw-r--r--vcl/inc/vcl/unohelp.hxx27
-rw-r--r--vcl/inc/vcl/unohelp2.hxx16
-rw-r--r--vcl/inc/vcl/unowrap.hxx26
-rw-r--r--vcl/inc/vcl/vclenum.hxx62
-rw-r--r--vcl/inc/vcl/vclevent.hxx64
-rw-r--r--vcl/inc/vcl/virdev.hxx40
-rw-r--r--vcl/inc/vcl/waitobj.hxx2
-rw-r--r--vcl/inc/vcl/wall.hxx94
-rw-r--r--vcl/inc/vcl/wall2.hxx24
-rw-r--r--vcl/inc/vcl/windata.hxx52
-rw-r--r--vcl/inc/vcl/window.h131
-rw-r--r--vcl/inc/vcl/window.hxx781
-rw-r--r--vcl/inc/vcl/wintypes.hxx35
-rw-r--r--vcl/inc/vcl/wrkwin.hxx36
-rw-r--r--vcl/inc/vcl/xconnection.hxx21
-rw-r--r--vcl/os2/inc/salbmp.h20
-rw-r--r--vcl/os2/inc/saldata.hxx148
-rw-r--r--vcl/os2/inc/salframe.h124
-rw-r--r--vcl/os2/inc/salgdi.h166
-rw-r--r--vcl/os2/inc/salids.hrc138
-rw-r--r--vcl/os2/inc/salinst.h75
-rw-r--r--vcl/os2/inc/sallang.hxx40
-rw-r--r--vcl/os2/inc/sallayout.h2
-rw-r--r--vcl/os2/inc/salmenu.h2
-rw-r--r--vcl/os2/inc/salobj.h47
-rw-r--r--vcl/os2/inc/salprn.h116
-rw-r--r--vcl/os2/inc/salsound.h66
-rw-r--r--vcl/os2/inc/salsound.hxx50
-rw-r--r--vcl/os2/inc/salsys.h2
-rw-r--r--vcl/os2/inc/saltimer.h6
-rw-r--r--vcl/os2/inc/salvd.h22
-rw-r--r--vcl/os2/inc/svsys.h2
-rw-r--r--vcl/os2/inc/wingdi.h10
-rw-r--r--vcl/os2/source/app/makefile.mk3
-rw-r--r--vcl/os2/source/app/salinfo.cxx4
-rw-r--r--vcl/os2/source/app/salinst.cxx80
-rw-r--r--vcl/os2/source/app/sallang.cxx2
-rw-r--r--vcl/os2/source/app/salshl.cxx18
-rw-r--r--vcl/os2/source/app/saltimer.cxx10
-rw-r--r--vcl/os2/source/gdi/os2layout.cxx44
-rw-r--r--vcl/os2/source/gdi/salbmp.cxx24
-rw-r--r--vcl/os2/source/gdi/salgdi.cxx148
-rw-r--r--vcl/os2/source/gdi/salgdi2.cxx210
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx175
-rw-r--r--vcl/os2/source/gdi/salprn.cxx328
-rw-r--r--vcl/os2/source/gdi/salvd.cxx48
-rw-r--r--vcl/os2/source/window/makefile.mk2
-rw-r--r--vcl/os2/source/window/salframe.cxx414
-rw-r--r--vcl/os2/source/window/salmenu.cxx134
-rw-r--r--vcl/os2/source/window/salobj.cxx65
-rw-r--r--vcl/prj/build.lst9
-rw-r--r--vcl/prj/d.lst15
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java636
-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
-rw-r--r--vcl/qa/complex/persistent_window_states/DocumentHandle.java13
-rw-r--r--vcl/qa/complex/persistent_window_states/PersistentWindowTest.java422
-rw-r--r--vcl/qa/complex/persistent_window_states/makefile.mk62
-rwxr-xr-x[-rw-r--r--]vcl/qa/testdocuments/CalcDoc.sxc (renamed from vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc)bin9547 -> 9547 bytes
-rwxr-xr-x[-rw-r--r--]vcl/qa/testdocuments/ImpressDoc.sxi (renamed from vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi)bin35135 -> 35135 bytes
-rwxr-xr-x[-rw-r--r--]vcl/qa/testdocuments/WriterDoc.sxw (renamed from vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw)bin5754 -> 5754 bytes
-rw-r--r--vcl/source/app/brand.cxx6
-rw-r--r--vcl/source/app/dbggui.cxx263
-rw-r--r--vcl/source/app/dndhelp.cxx4
-rw-r--r--vcl/source/app/help.cxx217
-rw-r--r--vcl/source/app/i18nhelp.cxx24
-rw-r--r--vcl/source/app/idlemgr.cxx101
-rw-r--r--vcl/source/app/salvtables.cxx39
-rw-r--r--vcl/source/app/session.cxx85
-rw-r--r--vcl/source/app/settings.cxx381
-rw-r--r--vcl/source/app/sound.cxx7
-rw-r--r--vcl/source/app/stdtext.cxx6
-rw-r--r--vcl/source/app/svapp.cxx345
-rw-r--r--vcl/source/app/svdata.cxx207
-rw-r--r--vcl/source/app/svmain.cxx125
-rw-r--r--vcl/source/app/svmainhook.cxx18
-rw-r--r--vcl/source/app/timer.cxx112
-rw-r--r--vcl/source/app/unohelp.cxx39
-rw-r--r--vcl/source/app/unohelp2.cxx10
-rw-r--r--vcl/source/app/vclevent.cxx34
-rw-r--r--vcl/source/components/display.cxx6
-rw-r--r--vcl/source/components/dtranscomp.cxx78
-rw-r--r--vcl/source/components/factory.cxx68
-rw-r--r--vcl/source/components/fontident.cxx6
-rw-r--r--vcl/source/components/makefile.mk7
-rw-r--r--vcl/source/components/stringmirror.cxx123
-rw-r--r--vcl/source/control/button.cxx818
-rw-r--r--vcl/source/control/combobox.cxx286
-rw-r--r--vcl/source/control/ctrl.cxx40
-rw-r--r--vcl/source/control/edit.cxx441
-rw-r--r--vcl/source/control/field.cxx350
-rw-r--r--vcl/source/control/field2.cxx594
-rw-r--r--vcl/source/control/fixbrd.cxx38
-rw-r--r--vcl/source/control/fixed.cxx281
-rw-r--r--vcl/source/control/group.cxx61
-rw-r--r--vcl/source/control/ilstbox.cxx1048
-rw-r--r--vcl/source/control/imgctrl.cxx197
-rw-r--r--vcl/source/control/longcurr.cxx188
-rw-r--r--vcl/source/control/lstbox.cxx260
-rw-r--r--vcl/source/control/makefile.mk37
-rw-r--r--vcl/source/control/menubtn.cxx41
-rw-r--r--vcl/source/control/morebtn.cxx59
-rw-r--r--vcl/source/control/quickselectionengine.cxx183
-rw-r--r--vcl/source/control/scrbar.cxx271
-rw-r--r--vcl/source/control/slider.cxx295
-rw-r--r--vcl/source/control/spinbtn.cxx74
-rw-r--r--vcl/source/control/spinfld.cxx126
-rw-r--r--vcl/source/control/tabctrl.cxx521
-rw-r--r--vcl/source/control/throbber.cxx325
-rw-r--r--vcl/source/fontsubset/cff.cxx904
-rw-r--r--vcl/source/fontsubset/fontsubset.cxx32
-rw-r--r--vcl/source/fontsubset/gsub.cxx142
-rw-r--r--vcl/source/fontsubset/gsub.h4
-rw-r--r--vcl/source/fontsubset/list.c274
-rw-r--r--vcl/source/fontsubset/sft.cxx671
-rw-r--r--vcl/source/fontsubset/ttcr.cxx98
-rw-r--r--vcl/source/fontsubset/ttcr.hxx8
-rw-r--r--vcl/source/fontsubset/xlat.cxx20
-rw-r--r--vcl/source/fontsubset/xlat.hxx2
-rw-r--r--vcl/source/gdi/alpha.cxx128
-rw-r--r--vcl/source/gdi/animate.cxx272
-rw-r--r--vcl/source/gdi/base14.cxx8
-rw-r--r--vcl/source/gdi/bitmap.cxx676
-rw-r--r--vcl/source/gdi/bitmap2.cxx403
-rw-r--r--vcl/source/gdi/bitmap3.cxx825
-rw-r--r--vcl/source/gdi/bitmap4.cxx410
-rw-r--r--vcl/source/gdi/bitmapex.cxx235
-rw-r--r--vcl/source/gdi/bmpacc.cxx98
-rw-r--r--vcl/source/gdi/bmpacc2.cxx18
-rw-r--r--vcl/source/gdi/bmpacc3.cxx134
-rw-r--r--vcl/source/gdi/bmpconv.cxx45
-rw-r--r--vcl/source/gdi/bmpfast.cxx38
-rw-r--r--vcl/source/gdi/configsettings.cxx22
-rw-r--r--vcl/source/gdi/cvtgrf.cxx56
-rw-r--r--vcl/source/gdi/cvtsvm.cxx890
-rw-r--r--vcl/source/gdi/extoutdevdata.cxx2
-rw-r--r--vcl/source/gdi/font.cxx214
-rw-r--r--vcl/source/gdi/gdimtf.cxx774
-rw-r--r--vcl/source/gdi/gfxlink.cxx86
-rw-r--r--vcl/source/gdi/gradient.cxx123
-rw-r--r--vcl/source/gdi/graph.cxx84
-rw-r--r--vcl/source/gdi/graphictools.cxx118
-rw-r--r--vcl/source/gdi/hatch.cxx36
-rw-r--r--vcl/source/gdi/image.cxx218
-rw-r--r--vcl/source/gdi/imagerepository.cxx13
-rw-r--r--vcl/source/gdi/impanmvw.cxx96
-rw-r--r--vcl/source/gdi/impanmvw.hxx76
-rw-r--r--vcl/source/gdi/impbmp.cxx26
-rw-r--r--vcl/source/gdi/impgraph.cxx364
-rw-r--r--vcl/source/gdi/impimage.cxx118
-rw-r--r--vcl/source/gdi/impimagetree.cxx43
-rw-r--r--vcl/source/gdi/impvect.cxx376
-rw-r--r--vcl/source/gdi/impvect.hxx28
-rw-r--r--vcl/source/gdi/jobset.cxx178
-rw-r--r--vcl/source/gdi/lineinfo.cxx80
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/makefile.mk4
-rw-r--r--vcl/source/gdi/mapmod.cxx30
-rw-r--r--vcl/source/gdi/metaact.cxx618
-rw-r--r--vcl/source/gdi/metric.cxx130
-rw-r--r--vcl/source/gdi/octree.cxx86
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx4
-rw-r--r--vcl/source/gdi/outdev.cxx1311
-rw-r--r--vcl/source/gdi/outdev2.cxx536
-rw-r--r--vcl/source/gdi/outdev3.cxx1043
-rw-r--r--vcl/source/gdi/outdev4.cxx461
-rw-r--r--vcl/source/gdi/outdev5.cxx36
-rw-r--r--vcl/source/gdi/outdev6.cxx276
-rw-r--r--vcl/source/gdi/outdevnative.cxx77
-rw-r--r--vcl/source/gdi/outmap.cxx451
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx96
-rw-r--r--vcl/source/gdi/pdffontcache.cxx2
-rw-r--r--vcl/source/gdi/pdffontcache.hxx12
-rw-r--r--vcl/source/gdi/pdfwriter.cxx50
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2158
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx673
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2037
-rw-r--r--vcl/source/gdi/pngread.cxx429
-rw-r--r--vcl/source/gdi/pngwrite.cxx254
-rw-r--r--vcl/source/gdi/polyscan.cxx78
-rw-r--r--vcl/source/gdi/print.cxx555
-rw-r--r--vcl/source/gdi/print2.cxx297
-rw-r--r--vcl/source/gdi/print3.cxx465
-rw-r--r--vcl/source/gdi/regband.cxx254
-rw-r--r--vcl/source/gdi/region.cxx621
-rw-r--r--vcl/source/gdi/salgdilayout.cxx200
-rw-r--r--vcl/source/gdi/sallayout.cxx20
-rw-r--r--vcl/source/gdi/salmisc.cxx132
-rw-r--r--vcl/source/gdi/salnativewidgets-none.cxx52
-rw-r--r--vcl/source/gdi/svcompat.cxx8
-rw-r--r--vcl/source/gdi/textlayout.cxx12
-rw-r--r--vcl/source/gdi/virdev.cxx116
-rw-r--r--vcl/source/gdi/wall.cxx118
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx419
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx50
-rw-r--r--vcl/source/glyphs/gcach_layout.cxx60
-rw-r--r--vcl/source/glyphs/gcach_rbmp.cxx10
-rw-r--r--vcl/source/glyphs/gcach_vdev.cxx132
-rw-r--r--vcl/source/glyphs/gcach_vdev.hxx24
-rw-r--r--vcl/source/glyphs/glyphcache.cxx33
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx339
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx203
-rw-r--r--vcl/source/glyphs/graphite_features.cxx238
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx981
-rw-r--r--vcl/source/glyphs/graphite_serverfont.cxx102
-rw-r--r--vcl/source/glyphs/graphite_textsrc.cxx12
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx14
-rw-r--r--vcl/source/glyphs/makefile.mk14
-rw-r--r--vcl/source/helper/canvasbitmap.cxx60
-rw-r--r--vcl/source/helper/canvastools.cxx84
-rw-r--r--vcl/source/helper/evntpost.cxx2
-rw-r--r--vcl/source/helper/lazydelete.cxx8
-rw-r--r--vcl/source/helper/makefile.mk1
-rw-r--r--vcl/source/helper/smartid.cxx267
-rw-r--r--vcl/source/helper/strhelper.cxx50
-rw-r--r--vcl/source/helper/threadex.cxx6
-rw-r--r--vcl/source/helper/xconnection.cxx81
-rw-r--r--vcl/source/salmain/makefile.mk5
-rw-r--r--vcl/source/salmain/salmain.cxx4
-rw-r--r--vcl/source/src/btntext.src67
-rw-r--r--vcl/source/src/helptext.src25
-rw-r--r--vcl/source/src/images.src283
-rw-r--r--vcl/source/src/makefile.mk2
-rw-r--r--vcl/source/src/menu.src24
-rw-r--r--vcl/source/src/print.src156
-rw-r--r--vcl/source/src/stdtext.src7
-rw-r--r--vcl/source/src/throbber.src114
-rw-r--r--vcl/source/src/units.src2
-rw-r--r--vcl/source/window/abstdlg.cxx4
-rw-r--r--vcl/source/window/accel.cxx285
-rw-r--r--vcl/source/window/accmgr.cxx118
-rw-r--r--vcl/source/window/arrange.cxx347
-rw-r--r--vcl/source/window/brdwin.cxx520
-rw-r--r--vcl/source/window/btndlg.cxx321
-rw-r--r--vcl/source/window/cmdevt.cxx48
-rw-r--r--vcl/source/window/cursor.cxx146
-rw-r--r--vcl/source/window/decoview.cxx304
-rw-r--r--vcl/source/window/dialog.cxx128
-rw-r--r--vcl/source/window/dlgctrl.cxx343
-rw-r--r--vcl/source/window/dndevdis.cxx2
-rw-r--r--vcl/source/window/dndlcon.cxx74
-rw-r--r--vcl/source/window/dockingarea.cxx28
-rw-r--r--vcl/source/window/dockmgr.cxx292
-rw-r--r--vcl/source/window/dockwin.cxx170
-rw-r--r--vcl/source/window/floatwin.cxx166
-rw-r--r--vcl/source/window/introwin.cxx2
-rw-r--r--vcl/source/window/javachild.cxx154
-rw-r--r--vcl/source/window/keycod.cxx32
-rw-r--r--vcl/source/window/keyevent.cxx14
-rw-r--r--vcl/source/window/makefile.mk2
-rw-r--r--vcl/source/window/menu.cxx1712
-rw-r--r--vcl/source/window/mnemonic.cxx60
-rw-r--r--vcl/source/window/mnemonicengine.cxx4
-rw-r--r--vcl/source/window/mouseevent.cxx4
-rw-r--r--vcl/source/window/msgbox.cxx202
-rw-r--r--vcl/source/window/popupmenuwindow.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx1009
-rw-r--r--vcl/source/window/scrwnd.cxx42
-rw-r--r--vcl/source/window/scrwnd.hxx80
-rw-r--r--vcl/source/window/seleng.cxx148
-rw-r--r--vcl/source/window/split.cxx80
-rw-r--r--vcl/source/window/splitwin.cxx1314
-rw-r--r--vcl/source/window/status.cxx661
-rw-r--r--vcl/source/window/syschild.cxx198
-rw-r--r--vcl/source/window/syswin.cxx128
-rw-r--r--vcl/source/window/tabdlg.cxx80
-rw-r--r--vcl/source/window/tabpage.cxx25
-rw-r--r--vcl/source/window/taskpanelist.cxx74
-rw-r--r--vcl/source/window/toolbox.cxx1233
-rw-r--r--vcl/source/window/toolbox2.cxx815
-rw-r--r--vcl/source/window/window.cxx1678
-rw-r--r--vcl/source/window/window2.cxx654
-rw-r--r--vcl/source/window/window3.cxx2
-rw-r--r--vcl/source/window/window4.cxx224
-rw-r--r--vcl/source/window/winproc.cxx317
-rw-r--r--vcl/source/window/wpropset.cxx346
-rw-r--r--vcl/source/window/wrkwin.cxx74
-rw-r--r--vcl/test/canvasbitmaptest.cxx116
-rw-r--r--vcl/test/dndtest.cxx64
-rw-r--r--vcl/unx/gtk/a11y/atkaction.cxx36
-rw-r--r--vcl/unx/gtk/a11y/atkbridge.cxx14
-rw-r--r--vcl/unx/gtk/a11y/atkcomponent.cxx46
-rw-r--r--vcl/unx/gtk/a11y/atkeditabletext.cxx8
-rw-r--r--vcl/unx/gtk/a11y/atkfactory.cxx26
-rw-r--r--vcl/unx/gtk/a11y/atkfactory.hxx4
-rw-r--r--vcl/unx/gtk/a11y/atkhypertext.cxx18
-rw-r--r--vcl/unx/gtk/a11y/atkimage.cxx10
-rw-r--r--vcl/unx/gtk/a11y/atklistener.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atklistener.hxx18
-rw-r--r--vcl/unx/gtk/a11y/atkregistry.cxx6
-rw-r--r--vcl/unx/gtk/a11y/atkregistry.hxx2
-rw-r--r--vcl/unx/gtk/a11y/atkselection.cxx18
-rw-r--r--vcl/unx/gtk/a11y/atktable.cxx100
-rw-r--r--vcl/unx/gtk/a11y/atktext.cxx14
-rw-r--r--vcl/unx/gtk/a11y/atktextattributes.cxx96
-rw-r--r--vcl/unx/gtk/a11y/atktextattributes.hxx3
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx70
-rw-r--r--vcl/unx/gtk/a11y/atkutil.hxx4
-rw-r--r--vcl/unx/gtk/a11y/atkvalue.cxx6
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx66
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.hxx4
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx64
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.hxx8
-rw-r--r--vcl/unx/gtk/a11y/makefile.mk4
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx55
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx49
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx17
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx934
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx794
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx57
-rw-r--r--vcl/unx/headless/svpbmp.cxx30
-rw-r--r--vcl/unx/headless/svpbmp.hxx32
-rw-r--r--vcl/unx/headless/svpdummies.cxx31
-rw-r--r--vcl/unx/headless/svpdummies.hxx30
-rw-r--r--vcl/unx/headless/svpelement.cxx23
-rw-r--r--vcl/unx/headless/svpelement.hxx4
-rw-r--r--vcl/unx/headless/svpframe.cxx84
-rw-r--r--vcl/unx/headless/svpframe.hxx98
-rw-r--r--vcl/unx/headless/svpgdi.cxx98
-rw-r--r--vcl/unx/headless/svpgdi.hxx126
-rw-r--r--vcl/unx/headless/svpinst.cxx78
-rw-r--r--vcl/unx/headless/svpinst.hxx107
-rw-r--r--vcl/unx/headless/svpprn.cxx798
-rw-r--r--vcl/unx/headless/svpprn.hxx79
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx268
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx148
-rw-r--r--vcl/unx/headless/svptext.cxx54
-rw-r--r--vcl/unx/headless/svpvd.cxx8
-rw-r--r--vcl/unx/headless/svpvd.hxx16
-rw-r--r--vcl/unx/inc/XIM.h26
-rw-r--r--vcl/unx/inc/Xproto.h2
-rw-r--r--vcl/unx/inc/cdeint.hxx2
-rw-r--r--vcl/unx/inc/dtint.hxx31
-rw-r--r--vcl/unx/inc/i18n_cb.hxx20
-rw-r--r--vcl/unx/inc/i18n_ic.hxx24
-rw-r--r--vcl/unx/inc/i18n_im.hxx30
-rw-r--r--vcl/unx/inc/i18n_keysym.hxx52
-rw-r--r--vcl/unx/inc/i18n_status.hxx14
-rw-r--r--vcl/unx/inc/i18n_xkb.hxx80
-rw-r--r--vcl/unx/inc/kde_headers.h98
-rw-r--r--vcl/unx/inc/plugins/gtk/atkbridge.hxx2
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkdata.hxx14
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx166
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx91
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkinst.hxx30
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkobject.hxx45
-rw-r--r--vcl/unx/inc/plugins/kde/kdedata.hxx20
-rw-r--r--vcl/unx/inc/pspgraphics.h150
-rw-r--r--vcl/unx/inc/salbmp.h130
-rw-r--r--vcl/unx/inc/saldata.hxx56
-rw-r--r--vcl/unx/inc/saldisp.hxx414
-rw-r--r--vcl/unx/inc/salfont.h182
-rw-r--r--vcl/unx/inc/salframe.h315
-rw-r--r--vcl/unx/inc/salgdi.h276
-rw-r--r--vcl/unx/inc/salinst.h76
-rw-r--r--vcl/unx/inc/salmenu.h2
-rw-r--r--vcl/unx/inc/salobj.h71
-rw-r--r--vcl/unx/inc/salprn.h94
-rw-r--r--vcl/unx/inc/salstd.hxx60
-rw-r--r--vcl/unx/inc/saltimer.h6
-rw-r--r--vcl/unx/inc/salunx.h14
-rw-r--r--vcl/unx/inc/salvd.h58
-rw-r--r--vcl/unx/inc/sm.hxx22
-rw-r--r--vcl/unx/inc/soicon.hxx6
-rw-r--r--vcl/unx/inc/strhelper.hxx2
-rw-r--r--vcl/unx/inc/svsys.h2
-rw-r--r--vcl/unx/inc/svunx.h2
-rw-r--r--vcl/unx/inc/wmadaptor.hxx60
-rw-r--r--vcl/unx/inc/xfont.hxx165
-rw-r--r--vcl/unx/kde/kdedata.cxx16
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx280
-rw-r--r--vcl/unx/kde4/KDEData.cxx4
-rw-r--r--vcl/unx/kde4/KDEData.hxx4
-rw-r--r--vcl/unx/kde4/KDESalDisplay.cxx2
-rw-r--r--vcl/unx/kde4/KDESalDisplay.hxx2
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx80
-rw-r--r--vcl/unx/kde4/KDESalFrame.hxx10
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx507
-rw-r--r--vcl/unx/kde4/KDESalGraphics.hxx37
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx4
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx4
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx74
-rw-r--r--vcl/unx/kde4/KDEXLib.hxx10
-rw-r--r--vcl/unx/kde4/VCLKDEApplication.cxx6
-rw-r--r--vcl/unx/kde4/VCLKDEApplication.hxx6
-rw-r--r--vcl/unx/kde4/main.cxx8
-rw-r--r--vcl/unx/source/app/i18n_cb.cxx45
-rw-r--r--vcl/unx/source/app/i18n_ic.cxx42
-rw-r--r--vcl/unx/source/app/i18n_im.cxx26
-rw-r--r--vcl/unx/source/app/i18n_keysym.cxx136
-rw-r--r--vcl/unx/source/app/i18n_status.cxx39
-rw-r--r--vcl/unx/source/app/i18n_wrp.cxx34
-rw-r--r--vcl/unx/source/app/i18n_xkb.cxx8
-rw-r--r--vcl/unx/source/app/keysymnames.cxx42
-rw-r--r--vcl/unx/source/app/randrwrapper.cxx30
-rw-r--r--vcl/unx/source/app/saldata.cxx102
-rw-r--r--vcl/unx/source/app/saldisp.cxx386
-rw-r--r--vcl/unx/source/app/salinst.cxx77
-rw-r--r--vcl/unx/source/app/salsys.cxx12
-rw-r--r--vcl/unx/source/app/saltimer.cxx12
-rw-r--r--vcl/unx/source/app/sm.cxx162
-rw-r--r--vcl/unx/source/app/soicon.cxx26
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx358
-rw-r--r--vcl/unx/source/desktopdetect/desktopdetector.cxx90
-rw-r--r--vcl/unx/source/dtrans/X11_clipboard.cxx19
-rw-r--r--vcl/unx/source/dtrans/X11_clipboard.hxx54
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.cxx8
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.hxx16
-rw-r--r--vcl/unx/source/dtrans/X11_droptarget.cxx9
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx872
-rw-r--r--vcl/unx/source/dtrans/X11_selection.hxx265
-rw-r--r--vcl/unx/source/dtrans/X11_service.cxx51
-rw-r--r--vcl/unx/source/dtrans/X11_transferable.cxx14
-rw-r--r--vcl/unx/source/dtrans/X11_transferable.hxx22
-rw-r--r--vcl/unx/source/dtrans/bmp.cxx89
-rw-r--r--vcl/unx/source/dtrans/bmp.hxx26
-rw-r--r--vcl/unx/source/dtrans/config.cxx11
-rw-r--r--vcl/unx/source/dtrans/copydata_curs.h4
-rw-r--r--vcl/unx/source/dtrans/copydata_mask.h4
-rw-r--r--vcl/unx/source/dtrans/linkdata_curs.h4
-rw-r--r--vcl/unx/source/dtrans/linkdata_mask.h4
-rw-r--r--vcl/unx/source/dtrans/movedata_curs.h4
-rw-r--r--vcl/unx/source/dtrans/movedata_mask.h4
-rw-r--r--vcl/unx/source/dtrans/nodrop_curs.h4
-rw-r--r--vcl/unx/source/dtrans/nodrop_mask.h4
-rw-r--r--vcl/unx/source/fontmanager/adobeenc.tab8
-rw-r--r--vcl/unx/source/fontmanager/fontcache.cxx123
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx591
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx382
-rw-r--r--vcl/unx/source/fontmanager/helper.cxx23
-rw-r--r--vcl/unx/source/fontmanager/parseAFM.cxx405
-rw-r--r--vcl/unx/source/fontmanager/parseAFM.hxx122
-rw-r--r--vcl/unx/source/gdi/cdeint.cxx42
-rw-r--r--vcl/unx/source/gdi/dtint.cxx5
-rw-r--r--vcl/unx/source/gdi/dtsetenum.hxx2
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.cxx14
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.hxx2
-rw-r--r--vcl/unx/source/gdi/makefile.mk37
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx314
-rw-r--r--vcl/unx/source/gdi/salbmp.cxx188
-rw-r--r--vcl/unx/source/gdi/salcvt.cxx186
-rw-r--r--vcl/unx/source/gdi/salcvt.hxx32
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx495
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx312
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx824
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx564
-rw-r--r--vcl/unx/source/gdi/salvd.cxx48
-rw-r--r--vcl/unx/source/gdi/xfont.cxx767
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.cxx688
-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/gdi/xrender_peer.cxx8
-rw-r--r--vcl/unx/source/gdi/xrender_peer.hxx6
-rw-r--r--vcl/unx/source/inc/airbrush_curs.h4
-rw-r--r--vcl/unx/source/inc/airbrush_mask.h4
-rw-r--r--vcl/unx/source/inc/ase_curs.h4
-rw-r--r--vcl/unx/source/inc/ase_mask.h6
-rw-r--r--vcl/unx/source/inc/asn_curs.h4
-rw-r--r--vcl/unx/source/inc/asn_mask.h4
-rw-r--r--vcl/unx/source/inc/asne_curs.h4
-rw-r--r--vcl/unx/source/inc/asne_mask.h4
-rw-r--r--vcl/unx/source/inc/asns_curs.h4
-rw-r--r--vcl/unx/source/inc/asns_mask.h4
-rw-r--r--vcl/unx/source/inc/asnswe_curs.h4
-rw-r--r--vcl/unx/source/inc/asnswe_mask.h4
-rw-r--r--vcl/unx/source/inc/asnw_curs.h4
-rw-r--r--vcl/unx/source/inc/asnw_mask.h4
-rw-r--r--vcl/unx/source/inc/ass_curs.h4
-rw-r--r--vcl/unx/source/inc/ass_mask.h4
-rw-r--r--vcl/unx/source/inc/asse_curs.h4
-rw-r--r--vcl/unx/source/inc/asse_mask.h4
-rw-r--r--vcl/unx/source/inc/assw_curs.h4
-rw-r--r--vcl/unx/source/inc/assw_mask.h4
-rw-r--r--vcl/unx/source/inc/asw_curs.h4
-rw-r--r--vcl/unx/source/inc/asw_mask.h4
-rw-r--r--vcl/unx/source/inc/aswe_curs.h4
-rw-r--r--vcl/unx/source/inc/aswe_mask.h4
-rw-r--r--vcl/unx/source/inc/chain_curs.h4
-rw-r--r--vcl/unx/source/inc/chain_mask.h4
-rw-r--r--vcl/unx/source/inc/chainnot_curs.h4
-rw-r--r--vcl/unx/source/inc/chainnot_mask.h4
-rw-r--r--vcl/unx/source/inc/chart_curs.h4
-rw-r--r--vcl/unx/source/inc/chart_mask.h4
-rw-r--r--vcl/unx/source/inc/copydata_curs.h4
-rw-r--r--vcl/unx/source/inc/copydata_mask.h4
-rw-r--r--vcl/unx/source/inc/copydlnk_curs.h4
-rw-r--r--vcl/unx/source/inc/copydlnk_mask.h4
-rw-r--r--vcl/unx/source/inc/copyfile_curs.h4
-rw-r--r--vcl/unx/source/inc/copyfile_mask.h4
-rw-r--r--vcl/unx/source/inc/copyfiles_curs.h4
-rw-r--r--vcl/unx/source/inc/copyfiles_mask.h4
-rw-r--r--vcl/unx/source/inc/copyflnk_curs.h4
-rw-r--r--vcl/unx/source/inc/copyflnk_mask.h4
-rw-r--r--vcl/unx/source/inc/crook_curs.h4
-rw-r--r--vcl/unx/source/inc/crook_mask.h4
-rw-r--r--vcl/unx/source/inc/crop_curs.h4
-rw-r--r--vcl/unx/source/inc/crop_mask.h4
-rw-r--r--vcl/unx/source/inc/detective_curs.h4
-rw-r--r--vcl/unx/source/inc/detective_mask.h4
-rw-r--r--vcl/unx/source/inc/drawarc_curs.h4
-rw-r--r--vcl/unx/source/inc/drawarc_mask.h4
-rw-r--r--vcl/unx/source/inc/drawbezier_curs.h4
-rw-r--r--vcl/unx/source/inc/drawbezier_mask.h4
-rw-r--r--vcl/unx/source/inc/drawcaption_curs.h4
-rw-r--r--vcl/unx/source/inc/drawcaption_mask.h4
-rw-r--r--vcl/unx/source/inc/drawcirclecut_curs.h4
-rw-r--r--vcl/unx/source/inc/drawcirclecut_mask.h4
-rw-r--r--vcl/unx/source/inc/drawconnect_curs.h4
-rw-r--r--vcl/unx/source/inc/drawconnect_mask.h4
-rw-r--r--vcl/unx/source/inc/drawcrook_curs.h4
-rw-r--r--vcl/unx/source/inc/drawcrook_mask.h4
-rw-r--r--vcl/unx/source/inc/drawcrop_curs.h4
-rw-r--r--vcl/unx/source/inc/drawcrop_mask.h4
-rw-r--r--vcl/unx/source/inc/drawellipse_curs.h4
-rw-r--r--vcl/unx/source/inc/drawellipse_mask.h4
-rw-r--r--vcl/unx/source/inc/drawfreehand_curs.h4
-rw-r--r--vcl/unx/source/inc/drawfreehand_mask.h4
-rw-r--r--vcl/unx/source/inc/drawline_curs.h4
-rw-r--r--vcl/unx/source/inc/drawline_mask.h4
-rw-r--r--vcl/unx/source/inc/drawmirror_curs.h4
-rw-r--r--vcl/unx/source/inc/drawmirror_mask.h4
-rw-r--r--vcl/unx/source/inc/drawpie_curs.h4
-rw-r--r--vcl/unx/source/inc/drawpie_mask.h4
-rw-r--r--vcl/unx/source/inc/drawpolygon_curs.h4
-rw-r--r--vcl/unx/source/inc/drawpolygon_mask.h4
-rw-r--r--vcl/unx/source/inc/drawrect_curs.h4
-rw-r--r--vcl/unx/source/inc/drawrect_mask.h4
-rw-r--r--vcl/unx/source/inc/drawtext_curs.h4
-rw-r--r--vcl/unx/source/inc/drawtext_mask.h4
-rw-r--r--vcl/unx/source/inc/fill_curs.h4
-rw-r--r--vcl/unx/source/inc/fill_mask.h4
-rw-r--r--vcl/unx/source/inc/hshear_curs.h4
-rw-r--r--vcl/unx/source/inc/hshear_mask.h4
-rw-r--r--vcl/unx/source/inc/invert50.h4
-rw-r--r--vcl/unx/source/inc/linkdata_curs.h4
-rw-r--r--vcl/unx/source/inc/linkdata_mask.h4
-rw-r--r--vcl/unx/source/inc/linkfile_curs.h4
-rw-r--r--vcl/unx/source/inc/linkfile_mask.h4
-rw-r--r--vcl/unx/source/inc/magnify_curs.h4
-rw-r--r--vcl/unx/source/inc/magnify_mask.h4
-rw-r--r--vcl/unx/source/inc/mirror_curs.h4
-rw-r--r--vcl/unx/source/inc/mirror_mask.h4
-rw-r--r--vcl/unx/source/inc/movebezierweight_curs.h4
-rw-r--r--vcl/unx/source/inc/movebezierweight_mask.h4
-rw-r--r--vcl/unx/source/inc/movedata_curs.h4
-rw-r--r--vcl/unx/source/inc/movedata_mask.h4
-rw-r--r--vcl/unx/source/inc/movedlnk_curs.h4
-rw-r--r--vcl/unx/source/inc/movedlnk_mask.h4
-rw-r--r--vcl/unx/source/inc/movefile_curs.h4
-rw-r--r--vcl/unx/source/inc/movefile_mask.h4
-rw-r--r--vcl/unx/source/inc/movefiles_curs.h4
-rw-r--r--vcl/unx/source/inc/movefiles_mask.h4
-rw-r--r--vcl/unx/source/inc/moveflnk_curs.h4
-rw-r--r--vcl/unx/source/inc/moveflnk_mask.h4
-rw-r--r--vcl/unx/source/inc/movepoint_curs.h4
-rw-r--r--vcl/unx/source/inc/movepoint_mask.h4
-rw-r--r--vcl/unx/source/inc/nodrop_curs.h4
-rw-r--r--vcl/unx/source/inc/nodrop_mask.h4
-rw-r--r--vcl/unx/source/inc/null_curs.h6
-rw-r--r--vcl/unx/source/inc/null_mask.h4
-rw-r--r--vcl/unx/source/inc/paintbrush_curs.h2
-rw-r--r--vcl/unx/source/inc/paintbrush_mask.h2
-rw-r--r--vcl/unx/source/inc/pivotcol_curs.h4
-rw-r--r--vcl/unx/source/inc/pivotcol_mask.h4
-rw-r--r--vcl/unx/source/inc/pivotdel_curs.h4
-rw-r--r--vcl/unx/source/inc/pivotdel_mask.h4
-rw-r--r--vcl/unx/source/inc/pivotfld_curs.h4
-rw-r--r--vcl/unx/source/inc/pivotfld_mask.h4
-rw-r--r--vcl/unx/source/inc/pivotrow_curs.h4
-rw-r--r--vcl/unx/source/inc/pivotrow_mask.h4
-rw-r--r--vcl/unx/source/inc/rotate_curs.h4
-rw-r--r--vcl/unx/source/inc/rotate_mask.h4
-rw-r--r--vcl/unx/source/inc/salcursors.h2
-rw-r--r--vcl/unx/source/inc/tblsele_curs.h2
-rw-r--r--vcl/unx/source/inc/tblsele_mask.h2
-rw-r--r--vcl/unx/source/inc/tblsels_curs.h2
-rw-r--r--vcl/unx/source/inc/tblsels_mask.h2
-rw-r--r--vcl/unx/source/inc/tblselse_curs.h2
-rw-r--r--vcl/unx/source/inc/tblselse_mask.h2
-rw-r--r--vcl/unx/source/inc/tblselsw_curs.h2
-rw-r--r--vcl/unx/source/inc/tblselsw_mask.h2
-rw-r--r--vcl/unx/source/inc/tblselw_curs.h2
-rw-r--r--vcl/unx/source/inc/tblselw_mask.h2
-rw-r--r--vcl/unx/source/inc/timemove_curs.h4
-rw-r--r--vcl/unx/source/inc/timemove_mask.h4
-rw-r--r--vcl/unx/source/inc/timesize_curs.h4
-rw-r--r--vcl/unx/source/inc/timesize_mask.h4
-rw-r--r--vcl/unx/source/inc/vertcurs_curs.h4
-rw-r--r--vcl/unx/source/inc/vertcurs_mask.h4
-rw-r--r--vcl/unx/source/inc/vshear_curs.h4
-rw-r--r--vcl/unx/source/inc/vshear_mask.h4
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx58
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx273
-rw-r--r--vcl/unx/source/printer/jobdata.cxx70
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx259
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx332
-rw-r--r--vcl/unx/source/printergfx/bitmap_gfx.cxx60
-rw-r--r--vcl/unx/source/printergfx/common_gfx.cxx174
-rw-r--r--vcl/unx/source/printergfx/glyphset.cxx212
-rw-r--r--vcl/unx/source/printergfx/glyphset.hxx62
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx151
-rw-r--r--vcl/unx/source/printergfx/psputil.cxx38
-rw-r--r--vcl/unx/source/printergfx/psputil.hxx14
-rw-r--r--vcl/unx/source/printergfx/text_gfx.cxx148
-rw-r--r--vcl/unx/source/window/FWS.cxx4
-rw-r--r--vcl/unx/source/window/FWS.hxx8
-rw-r--r--vcl/unx/source/window/makefile.mk2
-rw-r--r--vcl/unx/source/window/salframe.cxx1095
-rw-r--r--vcl/unx/source/window/salmenu.cxx134
-rw-r--r--vcl/unx/source/window/salobj.cxx136
-rw-r--r--vcl/util/hidother.src4
-rw-r--r--vcl/util/linksvp/makefile.mk5
-rw-r--r--[-rwxr-xr-x]vcl/util/makefile.mk37
-rw-r--r--vcl/util/makefile2.pmk7
-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.h42
-rw-r--r--vcl/win/inc/saldata.hxx89
-rw-r--r--vcl/win/inc/salframe.h134
-rw-r--r--vcl/win/inc/salgdi.h271
-rw-r--r--vcl/win/inc/salids.hrc144
-rw-r--r--vcl/win/inc/salinst.h76
-rw-r--r--vcl/win/inc/salmenu.h10
-rw-r--r--vcl/win/inc/salnativewidgets.h6
-rw-r--r--vcl/win/inc/salobj.h46
-rw-r--r--vcl/win/inc/salprn.h80
-rw-r--r--vcl/win/inc/salsys.h8
-rw-r--r--vcl/win/inc/saltimer.h6
-rw-r--r--vcl/win/inc/salvd.h26
-rw-r--r--vcl/win/inc/svsys.h7
-rw-r--r--vcl/win/inc/wincomp.hxx46
-rw-r--r--vcl/win/source/app/saldata.cxx68
-rw-r--r--vcl/win/source/app/salinfo.cxx144
-rw-r--r--vcl/win/source/app/salinst.cxx252
-rw-r--r--vcl/win/source/app/salshl.cxx12
-rw-r--r--vcl/win/source/app/saltimer.cxx16
-rw-r--r--vcl/win/source/gdi/MAKEFILE.MK (renamed from vcl/win/source/gdi/makefile.mk)10
-rw-r--r--vcl/win/source/gdi/salbmp.cxx122
-rw-r--r--vcl/win/source/gdi/salgdi.cxx591
-rw-r--r--vcl/win/source/gdi/salgdi2.cxx195
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx1259
-rw-r--r--vcl/win/source/gdi/salgdi_gdiplus.cxx14
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx260
-rw-r--r--vcl/win/source/gdi/salprn.cxx411
-rw-r--r--vcl/win/source/gdi/salvd.cxx54
-rw-r--r--vcl/win/source/gdi/winlayout.cxx307
-rw-r--r--vcl/win/source/gdi/wntgdi.cxx2
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/ase.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asn.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asne.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asns.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asnswe.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asnw.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/ass.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asse.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/assw.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/asw.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/aswe.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/chain.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/chainnot.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/timemove.curbin326 -> 326 bytes
-rwxr-xr-x[-rw-r--r--]vcl/win/source/src/timesize.curbin326 -> 326 bytes
-rw-r--r--vcl/win/source/window/salframe.cxx807
-rw-r--r--vcl/win/source/window/salmenu.cxx20
-rw-r--r--vcl/win/source/window/salobj.cxx231
-rw-r--r--vcl/workben/makefile.mk24
-rw-r--r--vcl/workben/outdevgrind.cxx99
-rw-r--r--vcl/workben/svdem.cxx18
-rw-r--r--vcl/workben/svpclient.cxx56
-rw-r--r--vcl/workben/svptest.cxx24
-rw-r--r--vcl/workben/vcldemo.cxx20
988 files changed, 56520 insertions, 53228 deletions
diff --git a/vcl/aqua/inc/aqua11yfactory.h b/vcl/aqua/inc/aqua11yfactory.h
index 2fa38d9901db..9b8e599fb262 100644
--- a/vcl/aqua/inc/aqua11yfactory.h
+++ b/vcl/aqua/inc/aqua11yfactory.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,11 +39,11 @@
+(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:(BOOL) bCreate;
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup;
++(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;
+(void)removeFromWrapperRepositoryFor: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
+(void)registerView: (NSView *) theView;
-+(void)revokeView: (NSView *) theViewt;
++(void)revokeView: (NSView *) theViewt;
@end
#endif // _SV_AQUA11FACTORY_H
diff --git a/vcl/aqua/inc/aqua11yfocustracker.hxx b/vcl/aqua/inc/aqua11yfocustracker.hxx
index b9721619b8ac..5e4611852703 100644
--- a/vcl/aqua/inc/aqua11yfocustracker.hxx
+++ b/vcl/aqua/inc/aqua11yfocustracker.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,7 +52,7 @@ class AquaA11yFocusTracker : public rtl::Static< AquaA11yFocusTracker, AquaA11yF
public:
AquaA11yFocusTracker();
-
+
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getFocusedObject() { return m_xFocusedObject; };
// sets the currently focus object and notifies the FocusEventListener (if any)
@@ -60,24 +60,24 @@ public:
// may evolve to add/remove later
void setFocusListener(const rtl::Reference< KeyboardFocusListener >& aFocusListener) { m_aFocusListener = aFocusListener; };
-
+
protected:
// received a WINDOW_GETFOCUS event for this window
virtual void window_got_focus(Window *pWindow);
-
+
// received a TOOLBOX_HIGHLIGHT event for this window
virtual void toolbox_highlight_on(Window *pWindow);
// received a TOOLBOX_HIGHLIGHTOFF event for this window
virtual void toolbox_highlight_off(Window *pWindow);
-
+
// received a TABPAGE_ACTIVATE event for this window
virtual void tabpage_activated(Window *pWindow);
-
+
// received a MENU_HIGHLIGHT event for this window
virtual void menu_highlighted(const ::VclMenuEvent *pEvent);
-
+
// toolbox items are widgets in gtk+ and Cocoa
virtual void notify_toolbox_item_focus(ToolBox *pToolBox);
@@ -87,23 +87,23 @@ protected:
// callback function for Application::addEventListener
static long WindowEventHandler(AquaA11yFocusTracker *pFocusTracker, ::VclSimpleEvent const *pEvent);
-private:
+private:
// the accessible object that has the keyboard focus (if any)
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xFocusedObject;
-
+
// the listener for focus events
rtl::Reference< KeyboardFocusListener > m_aFocusListener;
-
+
// the list of Windows that need deeper (focus) investigation
std::set< Window *> m_aDocumentWindowList;
-
+
// the link object needed for Application::addEventListener
Link m_aWindowEventLink;
-
+
// the UNO XAccessibilityEventListener for Documents and other non VCL objects
const ::com::sun::star::uno::Reference< DocumentFocusListener > m_xDocumentFocusListener;
};
-#endif // _AQUA11YFOCUSTRACKER_HXX_
+#endif // _AQUA11YFOCUSTRACKER_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/aqua11ylistener.hxx b/vcl/aqua/inc/aqua11ylistener.hxx
index cab8d8c89d58..ca8d0639e321 100644
--- a/vcl/aqua/inc/aqua11ylistener.hxx
+++ b/vcl/aqua/inc/aqua11ylistener.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _AQUA11YLISTENER_HXX_
#define _AQUA11YLISTENER_HXX_
@@ -41,7 +41,7 @@
// - AquaA11yEventListener -
// -------------------------
-class AquaA11yEventListener :
+class AquaA11yEventListener :
public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
{
@@ -50,13 +50,13 @@ public:
virtual ~AquaA11yEventListener();
// XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
throw (::com::sun::star::uno::RuntimeException);
// XAccessibleEventListener
- virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
throw( ::com::sun::star::uno::RuntimeException );
-
+
private:
const id m_wrapperObject;
const sal_Int16 m_role;
diff --git a/vcl/aqua/inc/aqua11ywrapper.h b/vcl/aqua/inc/aqua11ywrapper.h
index aebea78f0394..b3fea12125ec 100644
--- a/vcl/aqua/inc/aqua11ywrapper.h
+++ b/vcl/aqua/inc/aqua11ywrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,16 +63,16 @@ struct ReferenceWrapper
ReferenceWrapper * mpReferenceWrapper;
NSString * mpDefaultFontname;
float mDefaultFontsize;
- BOOL mActsAsRadioGroup;
- BOOL mIsTableCell;
+ MacOSBOOL mActsAsRadioGroup;
+ MacOSBOOL mIsTableCell;
}
// NSAccessibility Protocol
-(id)accessibilityAttributeValue:(NSString *)attribute;
--(BOOL)accessibilityIsIgnored;
+-(MacOSBOOL)accessibilityIsIgnored;
-(NSArray *)accessibilityAttributeNames;
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityParameterizedAttributeNames;
--(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
+-(MacOSBOOL)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:(BOOL)actsAsRadioGroup;
--(BOOL)actsAsRadioGroup;
+-(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup;
+-(MacOSBOOL)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:(BOOL)popupMenuOpen;
++(void)setPopupMenuOpen:(MacOSBOOL)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 2c5849f10e65..d8a9ec6330f9 100644
--- a/vcl/aqua/inc/aquaprintview.h
+++ b/vcl/aqua/inc/aquaprintview.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@ struct PrintAccessoryViewState
{
bool bNeedRestart;
sal_Int32 nLastPage;
-
+
PrintAccessoryViewState()
: bNeedRestart( false ), nLastPage( 0 ) {}
};
@@ -52,7 +52,7 @@ struct PrintAccessoryViewState
AquaSalInfoPrinter* mpInfoPrinter;
}
-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
--(BOOL)knowsPageRange: (NSRangePointer)range;
+-(MacOSBOOL)knowsPageRange: (NSRangePointer)range;
-(NSRect)rectForPage: (int)page;
-(NSPoint)locationOfPrintRect: (NSRect)aRect;
-(void)drawRect: (NSRect)rect;
@@ -61,7 +61,7 @@ struct PrintAccessoryViewState
@interface AquaPrintAccessoryView : NSObject
{
}
-+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
@end
diff --git a/vcl/aqua/inc/aquavclevents.hxx b/vcl/aqua/inc/aquavclevents.hxx
index 034edd3882b5..907e1ea7d547 100644
--- a/vcl/aqua/inc/aquavclevents.hxx
+++ b/vcl/aqua/inc/aquavclevents.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/aquavcltypes.h b/vcl/aqua/inc/aquavcltypes.h
index 93003faecad7..81dd543e7b68 100644
--- a/vcl/aqua/inc/aquavcltypes.h
+++ b/vcl/aqua/inc/aquavcltypes.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/keyboardfocuslistener.hxx b/vcl/aqua/inc/keyboardfocuslistener.hxx
index bf9c70250005..b66b7e483c33 100644
--- a/vcl/aqua/inc/keyboardfocuslistener.hxx
+++ b/vcl/aqua/inc/keyboardfocuslistener.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/salatsuifontutils.hxx b/vcl/aqua/inc/salatsuifontutils.hxx
index 51079b8ec5d2..5a11e6a29f7a 100644
--- a/vcl/aqua/inc/salatsuifontutils.hxx
+++ b/vcl/aqua/inc/salatsuifontutils.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,19 +47,19 @@ class SystemFontList
public:
SystemFontList();
~SystemFontList();
-
+
void AnnounceFonts( ImplDevFontList& ) const;
ImplMacFontData* GetFontDataFromId( ATSUFontID ) const;
ATSUFontFallbacks maFontFallbacks;
private:
- typedef boost::unordered_map<ATSUFontID,ImplMacFontData*> MacFontContainer;
+ typedef std::hash_map<ATSUFontID,ImplMacFontData*> MacFontContainer;
MacFontContainer maFontContainer;
- void InitGlyphFallbacks();
+ void InitGlyphFallbacks();
};
-
-#endif // _SV_SALATSUIFONTUTILS_HXX
+
+#endif // _SV_SALATSUIFONTUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salbmp.h b/vcl/aqua/inc/salbmp.h
index 33e671b05735..c438ea929c38 100644
--- a/vcl/aqua/inc/salbmp.h
+++ b/vcl/aqua/inc/salbmp.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,48 +42,48 @@
#include "basebmp/bitmapdevice.hxx"
// --------------
-// - SalBitmap -
+// - SalBitmap -
// --------------
-struct BitmapBuffer;
-class BitmapColor;
-class BitmapPalette;
-class AquaSalVirtualDevice;
-class AquaSalGraphics;
+struct BitmapBuffer;
+class BitmapColor;
+class BitmapPalette;
+class AquaSalVirtualDevice;
+class AquaSalGraphics;
class AquaSalBitmap : public SalBitmap
{
public:
- CGContextRef mxGraphicContext;
- mutable CGImageRef mxCachedImage;
- BitmapPalette maPalette;
- basebmp::RawMemorySharedArray maUserBuffer;
- basebmp::RawMemorySharedArray maContextBuffer;
- sal_uInt16 mnBits;
- int mnWidth;
- int mnHeight;
- sal_uInt32 mnBytesPerRow;
+ CGContextRef mxGraphicContext;
+ mutable CGImageRef mxCachedImage;
+ BitmapPalette maPalette;
+ basebmp::RawMemorySharedArray maUserBuffer;
+ basebmp::RawMemorySharedArray maContextBuffer;
+ sal_uInt16 mnBits;
+ int mnWidth;
+ int mnHeight;
+ sal_uInt32 mnBytesPerRow;
public:
AquaSalBitmap();
virtual ~AquaSalBitmap();
-
+
public:
-
+
// SalBitmap methods
- bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+ bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
bool Create( const SalBitmap& rSalBmp );
bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics );
- bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount );
+ bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
-
+
void Destroy();
-
+
Size GetSize() const;
- sal_uInt16 GetBitCount() const;
-
+ USHORT GetBitCount() const;
+
BitmapBuffer *AcquireBuffer( bool bReadOnly );
void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
@@ -91,21 +91,21 @@ public:
private:
// quartz helper
- bool CreateContext();
+ bool CreateContext();
void DestroyContext();
- bool AllocateUserData();
+ bool AllocateUserData();
- void ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight,
+ void ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight,
sal_uInt16 nDestBits, sal_uInt32 nDestBytesPerRow, const BitmapPalette& rDestPalette, sal_uInt8* pDestData,
sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData );
public:
- bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bMirrorVert = true );
+ bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bMirrorVert = true );
public:
- CGImageRef CreateWithMask( const AquaSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
- CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const;
- CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const;
+ CGImageRef CreateWithMask( const AquaSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
+ CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const;
+ CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const;
};
#endif // _SV_SALBMP_HXX
diff --git a/vcl/aqua/inc/salcolorutils.hxx b/vcl/aqua/inc/salcolorutils.hxx
index ae6afdabb9ff..ca5e93e16c43 100644
--- a/vcl/aqua/inc/salcolorutils.hxx
+++ b/vcl/aqua/inc/salcolorutils.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,6 +50,6 @@ void SetSalColor( const SalColor& rColor, float* pQuartzColor );
// ------------------------------------------------------------------
-#endif // _SV_SALCOLORUTILS_HXX
+#endif // _SV_SALCOLORUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salconst.h b/vcl/aqua/inc/salconst.h
index 50971a819c09..8d0a5aa1fdd9 100644
--- a/vcl/aqua/inc/salconst.h
+++ b/vcl/aqua/inc/salconst.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/saldata.hxx b/vcl/aqua/inc/saldata.hxx
index d87938bd4474..5915ec8a3c86 100644
--- a/vcl/aqua/inc/saldata.hxx
+++ b/vcl/aqua/inc/saldata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@
#include <list>
#include <vector>
#include <map>
-#include <boost/unordered_set.hpp>
+#include <hash_set>
#include <cstdio>
#include <cstdarg>
@@ -71,58 +71,58 @@ class SystemFontList;
// -----------
class AquaSalFrame;
-struct FrameHash : public boost::hash<sal_IntPtr>
+struct FrameHash : public std::hash<sal_IntPtr>
{
size_t operator()(const AquaSalFrame* frame) const
- { return boost::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
+ { return std::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
};
#define INVALID_CURSOR_PTR (NSCursor*)0xdeadbeef
struct SalData
{
-
- SALTIMERPROC mpTimerProc; // timer callback proc
- AquaSalInstance *mpFirstInstance; // pointer of first instance
- std::list<AquaSalFrame*> maFrames; // pointer of first frame
- boost::unordered_set<const AquaSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
- SalObject *mpFirstObject; // pointer of first object window
- SalVirtualDevice *mpFirstVD; // first VirDev
- SalPrinter *mpFirstPrinter; // first printing printer
+
+ SALTIMERPROC mpTimerProc; // timer callback proc
+ AquaSalInstance *mpFirstInstance; // pointer of first instance
+ std::list<AquaSalFrame*> maFrames; // pointer of first frame
+ std::hash_set<const AquaSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
+ SalObject *mpFirstObject; // pointer of first object window
+ SalVirtualDevice *mpFirstVD; // first VirDev
+ SalPrinter *mpFirstPrinter; // first printing printer
SystemFontList *mpFontList;
NSStatusItem* mpStatusItem; // one status item that draws all our stati
// at the moment this is only one add menu button
-
+
CGColorSpaceRef mxRGBSpace;
CGColorSpaceRef mxGraySpace;
CGColorSpaceRef mxP50Space;
CGPatternRef mxP50Pattern;
-
+
std::vector< NSCursor* > maCursors;
std::vector< NSMenuItem* > maFallbackMenu;
std::map< NSEvent*, bool > maKeyEventAnswer;
-
+
static oslThreadKey s_aAutoReleaseKey;
- bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
+ bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
SInt32 mnSystemVersion; // Store System Version
MainController* mpMainController; // Apple Remote
-
+
NSObject* mpDockIconClickHandler;
long mnDPIX; // #i100617# read DPI only once per office life
long mnDPIY; // #i100617# read DPI only once per office life
-
+
com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
mxClipboard;
SalData();
~SalData();
-
+
NSCursor* getCursor( PointerStyle i_eStyle );
-
+
static void ensureThreadAutoreleasePool();
static void drainThreadAutoreleasePool();
-
+
static NSStatusItem* getStatusItem();
};
@@ -132,10 +132,10 @@ inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData
// --- Prototypes ---
-sal_Bool ImplSalYieldMutexTryToAcquire();
+BOOL ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
-#endif // _SV_SALDATA_HXX
+#endif // _SV_SALDATA_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salfontutils.hxx b/vcl/aqua/inc/salfontutils.hxx
index 8394d874bf10..8c070da4ba08 100644
--- a/vcl/aqua/inc/salfontutils.hxx
+++ b/vcl/aqua/inc/salfontutils.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,6 +63,6 @@ static const char *kFontWeightRegular1 = "Regular";
static const char *kFontWeightRegular2 = "regular";
-#endif // _SV_SALFONTUTILS_HXX
+#endif // _SV_SALFONTUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h
index 4025b0aea70a..64f56cfae2cf 100644
--- a/vcl/aqua/inc/salframe.h
+++ b/vcl/aqua/inc/salframe.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,47 +61,47 @@ class AquaSalFrame : public SalFrame
{
public:
NSWindow* mpWindow; // Cocoa window
- NSView* mpView; // Cocoa view (actually a custom view, see below
+ NSView* mpView; // Cocoa view (actually a custom view, see below
NSMenuItem* mpDockMenuEntry; // entry in the dynamic dock menu
NSRect maScreenRect; // for mirroring purposes
- AquaSalGraphics* mpGraphics; // current frame graphics
- AquaSalFrame* mpParent; // pointer to parent frame
- SystemEnvData maSysData; // system data
+ AquaSalGraphics* mpGraphics; // current frame graphics
+ AquaSalFrame* mpParent; // pointer to parent frame
+ SystemEnvData maSysData; // system data
int mnMinWidth; // min. client width in pixels
int mnMinHeight; // min. client height in pixels
int mnMaxWidth; // max. client width in pixels
int mnMaxHeight; // max. client height in pixels
NSRect maFullScreenRect; // old window size when in FullScreen
- bool mbGraphics:1; // is Graphics used?
+ bool mbGraphics:1; // is Graphics used?
bool mbFullScreen:1; // is Window in FullScreen?
bool mbShown:1;
bool mbInitShow:1;
bool mbPositioned:1;
bool mbSized:1;
bool mbPresentation:1;
-
- sal_uLong mnStyle;
+
+ ULONG mnStyle;
unsigned int mnStyleMask; // our style mask from NSWindow creation
-
- sal_uLong mnLastEventTime;
+
+ ULONG mnLastEventTime;
unsigned int mnLastModifierFlags;
AquaSalMenu* mpMenu;
-
+
SalExtStyle mnExtStyle; // currently document frames are marked this way
-
+
PointerStyle mePointerStyle; // currently active pointer style
-
+
NSTrackingRectTag mnTrackingRectTag; // used to get enter/leave messages
CGMutablePathRef mrClippingPath; // used for "shaping"
std::vector< CGRect > maClippingRects;
-
+
std::list<AquaBlinker*> maBlinkers;
-
+
Rectangle maInvalidRect;
-
- sal_uLong mnICOptions;
-
+
+ ULONG mnICOptions;
+
boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation
public:
/** Constructor
@@ -110,53 +110,53 @@ public:
@throws std::runtime_error in case window creation fails
*/
- AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle );
+ AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle );
virtual ~AquaSalFrame();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool PostEvent( void* pData );
- virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( sal_uInt16 nIcon );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual BOOL PostEvent( void* pData );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT nIcon );
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
- virtual void Enable( sal_Bool bEnable );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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, 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 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( 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( 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 );
- virtual void Beep( SoundType eSoundType );
- virtual const SystemEnvData* GetSystemData() const;
- virtual SalPointerState GetPointerState();
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT 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 void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( 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 LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
+ virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
- virtual void SetParent( SalFrame* pNewParent );
- virtual bool SetPluginParent( SystemParentData* pNewParent );
+ virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SetParent( SalFrame* pNewParent );
+ virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetExtendedFrameStyle( SalExtStyle );
virtual void SetBackgroundBitmap( SalBitmap* );
virtual void SetScreenNumber(unsigned int);
@@ -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( sal_uLong nRects );
+ virtual void BeginSetClipRegion( 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
@@ -175,21 +175,21 @@ public:
virtual void SetClientSize( long nWidth, long nHeight );
void UpdateFrameGeometry();
-
+
// trigger painting of the window
void SendPaintEvent( const Rectangle* pRect = NULL );
static bool isAlive( const AquaSalFrame* pFrame )
{ return GetSalData()->maFrameCheck.find( pFrame ) != GetSalData()->maFrameCheck.end(); }
-
+
static AquaSalFrame* GetCaptureFrame() { return s_pCaptureFrame; }
-
+
NSWindow* getWindow() const { return mpWindow; }
NSView* getView() const { return mpView; }
unsigned int getStyleMask() const { return mnStyleMask; }
-
+
void getResolution( long& o_rDPIX, long& o_rDPIY );
-
+
// actually the follwing methods do the same thing: flipping y coordinates
// but having two of them makes clearer what the coordinate system
// is supposed to be before and after
@@ -198,11 +198,11 @@ public:
void VCLToCocoa( NSPoint& io_rPoint, bool bRelativeToScreen = true );
void CocoaToVCL( NSPoint& io_Point, bool bRelativeToScreen = true );
-
+
NSCursor* getCurrentCursor() const;
-
+
CGMutablePathRef getClipPath() const { return mrClippingPath; }
-
+
// called by VCL_NSApplication to indicate screen settings have changed
void screenParametersChanged();
@@ -210,12 +210,12 @@ public:
/** do things on initial show (like centering on parent or on screen)
*/
void initShow();
-
+
void initWindowAndView();
- private: // data
+ private: // data
static AquaSalFrame* s_pCaptureFrame;
-
+
// make AquaSalFrame non copyable
AquaSalFrame( const AquaSalFrame& );
AquaSalFrame& operator=(const AquaSalFrame&);
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index f28eb17f4e10..e073af25d240 100644
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,8 +37,7 @@
id mDraggingDestinationHandler;
}
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(BOOL)canBecomeKeyWindow;
--(void)displayIfNeeded;
+-(MacOSBOOL)canBecomeKeyWindow;
-(void)windowDidBecomeKey: (NSNotification*)pNotification;
-(void)windowDidResignKey: (NSNotification*)pNotification;
-(void)windowDidChangeScreen: (NSNotification*)pNotification;
@@ -46,10 +45,10 @@
-(void)windowDidResize: (NSNotification*)pNotification;
-(void)windowDidMiniaturize: (NSNotification*)pNotification;
-(void)windowDidDeminiaturize: (NSNotification*)pNotification;
--(BOOL)windowShouldClose: (NSNotification*)pNotification;
+-(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification;
-(void)dockMenuItemTriggered: (id)sender;
-(AquaSalFrame*)getSalFrame;
--(BOOL)containsMouse;
+-(MacOSBOOL)containsMouse;
-(::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >)accessibleContext;
/* NSDraggingDestination protocol methods
@@ -57,8 +56,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
-(void)registerDraggingDestinationHandler:(id)theHandler;
@@ -81,15 +80,14 @@
NSEvent* mpLastSuperEvent;
// #i102807# used by magnify event handler
- NSTimeInterval mfLastMagnifyTime;
- float mfMagnifyDeltaSum;
+ NSTimeInterval mfLastMagnifyTime;
+ float mfMagnifyDeltaSum;
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(AquaSalFrame*)getSalFrame;
--(BOOL)acceptsFirstResponder;
--(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
--(BOOL)isOpaque;
+-(MacOSBOOL)acceptsFirstResponder;
+-(MacOSBOOL)acceptsFirstMouse: (NSEvent *)pEvent;
+-(MacOSBOOL)isOpaque;
-(void)drawRect: (NSRect)aRect;
-(void)mouseDown: (NSEvent*)pEvent;
-(void)mouseDragged: (NSEvent*)pEvent;
@@ -109,12 +107,12 @@
-(void)swipeWithEvent: (NSEvent*)pEvent;
-(void)keyDown: (NSEvent*)pEvent;
-(void)flagsChanged: (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)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)clearLastEvent;
/*
text action methods
@@ -189,10 +187,10 @@
actual mouse event initiating this drag operation.
Mouse events can only be received by subclassing
NSView and overriding methods like 'mouseDown' etc.
- hence we implement a event hook here so that the
- D&D service can register as listener for mouse
- messages and use the last 'mouseDown' or
- 'mouseDragged' message to initiate the drag
+ hence we implement a event hook here so that the
+ D&D service can register as listener for mouse
+ messages and use the last 'mouseDown' or
+ 'mouseDragged' message to initiate the drag
operation.
*/
-(void)registerMouseEventListener: (id)theListener;
@@ -203,8 +201,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)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 c69f5d70bf96..eb203863ed95 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,7 +36,6 @@
#include "vcl/sv.h"
#include "vcl/outfont.hxx"
#include "vcl/salgdi.hxx"
-#include <vcl/fontcapabilities.hxx>
#include "aquavcltypes.h"
#include "basegfx/polygon/b2dpolypolygon.hxx"
@@ -60,24 +59,21 @@ public:
virtual ImplFontData* Clone() const;
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
virtual sal_IntPtr GetFontId() const;
+
+ ImplFontCharMap* GetImplFontCharMap() const;
+ bool HasChar( sal_uInt32 cChar ) const;
- const ImplFontCharMap* GetImplFontCharMap() const;
- bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
- bool HasChar( sal_uInt32 cChar ) const;
-
- void ReadOs2Table() const;
- void ReadMacCmapEncoding() const;
- bool HasCJKSupport() const;
+ void ReadOs2Table() const;
+ void ReadMacCmapEncoding() const;
+ bool HasCJKSupport() const;
private:
- const ATSUFontID mnFontId;
- mutable const ImplFontCharMap* mpCharMap;
- mutable vcl::FontCapabilities maFontCapabilities;
- mutable bool mbOs2Read; // true if OS2-table related info is valid
- mutable bool mbHasOs2Table;
- mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
- mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
- mutable bool mbFontCapabilitiesRead;
+ const ATSUFontID mnFontId;
+ mutable ImplFontCharMap* mpCharMap;
+ mutable bool mbOs2Read; // true if OS2-table related info is valid
+ mutable bool mbHasOs2Table;
+ mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
+ mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
};
// abstracting quartz color instead of having to use an CGFloat[] array
@@ -86,9 +82,9 @@ class RGBAColor
public:
RGBAColor( SalColor );
RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET
- const float* AsArray() const { return &mfRed; }
- bool IsVisible() const { return (mfAlpha > 0); }
- void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; }
+ const float* AsArray() const { return &mfRed; }
+ bool IsVisible() const { return (mfAlpha > 0); }
+ void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; }
private:
float mfRed, mfGreen, mfBlue, mfAlpha;
};
@@ -101,13 +97,13 @@ class AquaSalGraphics : public SalGraphics
friend class ATSLayout;
protected:
AquaSalFrame* mpFrame;
- CGLayerRef mxLayer; // Quartz graphics layer
- CGContextRef mrContext; // Quartz drawing context
- class XorEmulation* mpXorEmulation;
+ CGLayerRef mxLayer; // Quartz graphics layer
+ CGContextRef mrContext; // Quartz drawing context
+ class XorEmulation* mpXorEmulation;
int mnXorMode; // 0: off 1: on 2: invert only
- int mnWidth;
- int mnHeight;
- int mnBitmapDepth; // zero unless bitmap
+ int mnWidth;
+ int mnHeight;
+ int mnBitmapDepth; // zero unless bitmap
/// device resolution of this graphics
long mnRealDPIX;
long mnRealDPIY;
@@ -119,7 +115,7 @@ protected:
/// path representing current clip region
CGMutablePathRef mxClipPath;
- /// Drawing colors
+ /// Drawing colors
/// pen color RGBA
RGBAColor maLineColor;
/// brush color RGBA
@@ -128,7 +124,7 @@ protected:
// Device Font settings
const ImplMacFontData* mpMacFontData;
/// ATSU style object which carries all font attributes
- ATSUStyle maATSUStyle;
+ ATSUStyle maATSUStyle;
/// text rotation as ATSU angle
Fixed mnATSUIRotation;
/// workaround to prevent ATSU overflows for huge font sizes
@@ -139,7 +135,7 @@ protected:
bool mbNonAntialiasedText;
// Graphics types
-
+
/// is this a printer graphics
bool mbPrinter;
/// is this a virtual device graphics
@@ -148,12 +144,12 @@ protected:
bool mbWindow;
public:
- AquaSalGraphics();
+ AquaSalGraphics();
virtual ~AquaSalGraphics();
- bool IsPenVisible() const { return maLineColor.IsVisible(); }
- bool IsBrushVisible() const { return maFillColor.IsVisible(); }
-
+ bool IsPenVisible() const { return maLineColor.IsVisible(); }
+ bool IsBrushVisible() const { return maFillColor.IsVisible(); }
+
void SetWindowGraphics( AquaSalFrame* pFrame );
void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
@@ -161,7 +157,7 @@ public:
void initResolution( NSWindow* );
void copyResolution( AquaSalGraphics& );
void updateResolution();
-
+
bool IsWindowGraphics() const { return mbWindow; }
bool IsPrinterGraphics() const { return mbPrinter; }
bool IsVirDevGraphics() const { return mbVirDev; }
@@ -169,125 +165,130 @@ public:
void setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
-
+
bool CheckContext();
void UpdateWindow( NSRect& ); // delivered in NSView coordinates
- void RefreshRect( const CGRect& );
- void RefreshRect( const NSRect& );
- void RefreshRect(float lX, float lY, float lWidth, float lHeight);
+ void RefreshRect( const CGRect& );
+ void RefreshRect( const NSRect& );
+ void RefreshRect(float lX, float lY, float lWidth, float lHeight);
void SetState();
void UnsetState();
// InvalidateContext does an UnsetState and sets mrContext to 0
void InvalidateContext();
- virtual bool setClipRegion( const Region& );
+ 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 );
- 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( 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 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 bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
- 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 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 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, sal_uInt16 nFlags );
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ long nSrcHeight, USHORT nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
- virtual SalColor getPixel( long nX, long nY );
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
+ virtual SalColor getPixel( long nX, long nY );
// invert --> ClipRegion (only Windows or VirDevs)
- virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
+ virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
- virtual bool drawAlphaBitmap( const SalTwoRect&,
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
- virtual bool drawAlphaRect( long nX, long nY, long nWidth,
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
- CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry);
+ CGPoint* makeCGptArray(ULONG nPoints, const SalPoint* pPtAry);
// native widget rendering methods that require mirroring
- 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,
+ 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,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual 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 );
+ virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual sal_uInt16 GetBitCount() const;
+ virtual USHORT GetBitCount();
// get the width of the device
- virtual long GetGraphicsWidth() const;
+ virtual long GetGraphicsWidth() const;
// set the clip region to empty
- virtual void ResetClipRegion();
+ 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();
+ virtual void SetLineColor();
// set the line color to a specific color
- virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetLineColor( SalColor nSalColor );
// set the fill color to transparent (= don't fill)
- virtual void SetFillColor();
+ virtual void SetFillColor();
// set the fill color to a specific color, shapes will be
// filled accordingly
- virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetFillColor( SalColor nSalColor );
// enable/disable XOR drawing
- virtual void SetXORMode( bool bSet, bool bInvertOnly );
+ virtual void SetXORMode( bool bSet, bool bInvertOnly );
// set line color for raster operations
- virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPLineColor( SalROPColor nROPColor );
// set fill color for raster operations
- virtual void SetROPFillColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
// set the text color to a specific color
- virtual void SetTextColor( SalColor nSalColor );
+ virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual const ImplFontCharMap* GetImplFontCharMap() const;
- virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
// graphics must fill supplied font list
- virtual void GetDevFontList( ImplDevFontList* );
+ virtual void GetDevFontList( ImplDevFontList* );
// graphics should call ImplAddDevFontSubstitute on supplied
// OutputDevice for all its device specific preferred font substitutions
- virtual void GetDevFontSubstList( OutputDevice* );
- virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
+ virtual void GetDevFontSubstList( OutputDevice* );
+ virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
// 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
@@ -300,7 +301,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -325,28 +326,28 @@ public:
// pWidths MUST support at least 256 members;
// rInfo: additional outgoing information
// pDataLen: out parameter, contains the byte length of the returned buffer
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
// frees the font data again
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
+ virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
- virtual void DrawServerFontLayout( const ServerFontLayout& );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
@@ -366,25 +367,25 @@ class XorEmulation
{
public:
XorEmulation();
- /*final*/ ~XorEmulation();
+ /*final*/ ~XorEmulation();
- void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef );
- bool UpdateTarget();
- void Enable() { mbIsEnabled = true; }
- void Disable() { mbIsEnabled = false; }
- bool IsEnabled() const { return mbIsEnabled; }
- CGContextRef GetTargetContext() const { return mxTargetContext; }
- CGContextRef GetMaskContext() const { return (mbIsEnabled ? mxMaskContext : NULL); }
+ void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef );
+ bool UpdateTarget();
+ void Enable() { mbIsEnabled = true; }
+ void Disable() { mbIsEnabled = false; }
+ bool IsEnabled() const { return mbIsEnabled; }
+ CGContextRef GetTargetContext() const { return mxTargetContext; }
+ CGContextRef GetMaskContext() const { return (mbIsEnabled ? mxMaskContext : NULL); }
private:
- CGLayerRef mxTargetLayer;
- CGContextRef mxTargetContext;
- CGContextRef mxMaskContext;
- CGContextRef mxTempContext;
- sal_uLong* mpMaskBuffer;
- sal_uLong* mpTempBuffer;
- int mnBufferLongs;
- bool mbIsEnabled;
+ CGLayerRef mxTargetLayer;
+ CGContextRef mxTargetContext;
+ CGContextRef mxMaskContext;
+ CGContextRef mxTempContext;
+ ULONG* mpMaskBuffer;
+ ULONG* mpTempBuffer;
+ int mnBufferLongs;
+ bool mbIsEnabled;
};
@@ -401,17 +402,17 @@ inline void AquaSalGraphics::RefreshRect( const NSRect& rRect )
}
inline RGBAColor::RGBAColor( SalColor nSalColor )
-: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255))
-, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255))
-, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255))
-, mfAlpha( 1.0 ) // opaque
+: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255))
+, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255))
+, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255))
+, mfAlpha( 1.0 ) // opaque
{}
inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha )
-: mfRed( fRed )
-, mfGreen( fGreen )
-, mfBlue( fBlue )
-, mfAlpha( fAlpha )
+: mfRed( fRed )
+, mfGreen( fGreen )
+, mfBlue( fBlue )
+, mfAlpha( fAlpha )
{}
#endif // _SV_SALGDI_H
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index 9bd65be14ac8..3861c0387e93 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,15 +50,15 @@ class Image;
class SalYieldMutex : public vcl::SolarMutexObject
{
- sal_uLong mnCount;
+ ULONG mnCount;
oslThreadIdentifier mnThreadId;
public:
SalYieldMutex();
- virtual void acquire();
- virtual void release();
- virtual sal_Bool tryToAcquire();
- sal_uLong GetAcquireCount() const { return mnCount; }
+ virtual void acquire();
+ virtual void release();
+ virtual sal_Bool tryToAcquire();
+ ULONG GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -84,15 +84,15 @@ class AquaSalInstance : public SalInstance
{
AquaSalFrame* mpFrame;
void* mpData;
- sal_uInt16 mnType;
-
- SalUserEvent( AquaSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
+ USHORT mnType;
+
+ SalUserEvent( AquaSalFrame* pFrame, void* pData, USHORT nType ) :
mpFrame( pFrame ), mpData( pData ), mnType( nType )
{}
};
-
+
public:
- SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
+ SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
rtl::OUString maDefaultPrinter;
oslThreadIdentifier maMainThread;
bool mbWaitingYield;
@@ -103,48 +103,47 @@ public:
typedef std::list<const ApplicationEvent*> AppEventList;
static AppEventList aAppEventList;
-
+
public:
AquaSalInstance();
virtual ~AquaSalInstance();
virtual SalSystem* CreateSystem();
virtual void DestroySystem(SalSystem*);
- 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, sal_Bool bShow = sal_True );
- virtual void DestroyObject( SalObject* pObject );
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual void DestroyObject( SalObject* pObject );
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData );
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+ USHORT nBitCount, const SystemGraphicsData *pData );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
virtual String GetDefaultPrinter();
- virtual SalTimer* CreateSalTimer();
- virtual SalI18NImeStatus* CreateI18NImeStatus();
- virtual SalSystem* CreateSalSystem();
- virtual SalBitmap* CreateSalBitmap();
+ virtual SalTimer* CreateSalTimer();
+ virtual SalI18NImeStatus* CreateI18NImeStatus();
+ virtual SalSystem* CreateSalSystem();
+ virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual sal_uLong ReleaseYieldMutex();
- virtual void AcquireYieldMutex( sal_uLong nCount );
- virtual bool CheckYieldMutex();
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- 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* );
+ virtual ULONG ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( ULONG nCount );
+ virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
+ 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* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
virtual void SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
virtual void SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) );
@@ -156,38 +155,38 @@ public:
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
static void handleAppDefinedEvent( NSEvent* pEvent );
-
+
// check whether a particular string is passed on the command line
// this is needed to avoid duplicate open events through a) command line and b) NSApp's openFile
static bool isOnCommandLine( const rtl::OUString& );
-
+
void wakeupYield();
public:
friend class AquaSalFrame;
-
- void PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData );
+
+ void PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData );
void delayedSettingsChanged( bool bInvalidate );
-
+
bool isNSAppThread() const;
-
+
void startedPrintJob() { mnActivePrintJobs++; }
void endedPrintJob() { mnActivePrintJobs--; }
-
+
// event subtypes for NSApplicationDefined events
static const short AppExecuteSVMain = 0x7fff;
static const short AppEndLoopEvent = 1;
static const short AppStartTimerEvent = 10;
static const short AppleRemoteEvent = 15;
static const short YieldWakeupEvent = 20;
-
+
static NSMenu* GetDynamicDockMenu();
};
// helper class: inverted solar guard
class YieldMutexReleaser
{
- sal_uLong mnCount;
+ ULONG mnCount;
public:
YieldMutexReleaser();
~YieldMutexReleaser();
diff --git a/vcl/aqua/inc/salmathutils.hxx b/vcl/aqua/inc/salmathutils.hxx
index e81f68e46b0b..e70735a04758 100644
--- a/vcl/aqua/inc/salmathutils.hxx
+++ b/vcl/aqua/inc/salmathutils.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,7 @@ struct LRectCoor
//
// ------------------------------------------------------------------
-// LRectCoorVec is an abreviation for vectors in rectangular
+// LRectCoorVec is an abreviation for vectors in rectangular
// coordinates represented as long integers
typedef struct LRectCoor LRectCoor;
@@ -85,6 +85,6 @@ unsigned long Euclidian2Norm ( const LRectCoorVector pVec );
}
#endif
-#endif // _SV_SALMATHUTILS_HXX
+#endif // _SV_SALMATHUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salmenu.h b/vcl/aqua/inc/salmenu.h
index 71081ad48b77..812399128c50 100644
--- a/vcl/aqua/inc/salmenu.h
+++ b/vcl/aqua/inc/salmenu.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -58,42 +58,42 @@ public: // for OOStatusView
};
private:
std::vector< MenuBarButtonEntry > maButtons;
-
- MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId );
+
+ MenuBarButtonEntry* findButtonItem( USHORT i_nItemId );
void releaseButtonEntry( MenuBarButtonEntry& i_rEntry );
static void statusLayout();
public:
AquaSalMenu( bool bMenuBar );
virtual ~AquaSalMenu();
- virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual 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, sal_Bool bCheck );
- virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
+ virtual void CheckItem( unsigned nPos, BOOL bCheck );
+ virtual void EnableItem( unsigned nPos, 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, sal_uLong nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& );
- virtual void RemoveMenuBarButton( sal_uInt16 nId );
- virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual void RemoveMenuBarButton( USHORT nId );
+ virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
- int getItemIndexByPos( sal_uInt16 nPos ) const;
+ int getItemIndexByPos( USHORT nPos ) const;
const AquaSalFrame* getFrame() const;
-
+
void setMainMenu();
static void unsetMainMenu();
static void setDefaultMenu();
static void enableMainMenu( bool bEnable );
static void addFallbackMenuItem( NSMenuItem* NewItem );
static void removeFallbackMenuItem( NSMenuItem* pOldItem );
-
+
const std::vector< MenuBarButtonEntry >& getButtons() const { return maButtons; }
bool mbMenuBar; // true - Menubar, false - Menu
@@ -101,9 +101,9 @@ public:
Menu* mpVCLMenu; // the corresponding vcl Menu object
const AquaSalFrame* mpFrame; // the frame to dispatch the menu events to
AquaSalMenu* mpParentSalMenu; // the parent menu that contains us (and perhaps has a frame)
-
+
static const AquaSalMenu* pCurrentMenuBar;
-
+
};
class AquaSalMenuItem : public SalMenuItem
@@ -112,7 +112,7 @@ public:
AquaSalMenuItem( const SalItemParams* );
virtual ~AquaSalMenuItem();
- sal_uInt16 mnId; // Item ID
+ USHORT 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/salnativewidgets.h b/vcl/aqua/inc/salnativewidgets.h
index fd6226c8030b..86db06d1180e 100644
--- a/vcl/aqua/inc/salnativewidgets.h
+++ b/vcl/aqua/inc/salnativewidgets.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,7 @@
//tabs
#define TAB_HEIGHT_NORMAL 20
#define TAB_HEIGHT_SMALL 17
-#define TAB_HEIGHT_MINI 15
+#define TAB_HEIGHT_MINI 15
#define TAB_TEXT_OFFSET 12
#define VCL_TAB_TEXT_OFFSET 2
@@ -69,6 +69,6 @@
#define CLIP_FUZZ 1
-#endif // _SV_NATIVEWIDGETS_H
+#endif // _SV_NATIVEWIDGETS_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/inc/salnsmenu.h b/vcl/aqua/inc/salnsmenu.h
index fac4aec75792..eb29c3d6a47b 100644
--- a/vcl/aqua/inc/salnsmenu.h
+++ b/vcl/aqua/inc/salnsmenu.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/salnstimer.h b/vcl/aqua/inc/salnstimer.h
index 5c4ba0eea430..8e3f8dfc6cad 100644
--- a/vcl/aqua/inc/salnstimer.h
+++ b/vcl/aqua/inc/salnstimer.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h
index 63f5fecb7279..d48d807f11fb 100644
--- a/vcl/aqua/inc/salobj.h
+++ b/vcl/aqua/inc/salobj.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,41 +48,40 @@ struct SalObjectData
class AquaSalObject : public SalObject
{
public:
- AquaSalFrame* mpFrame; // parent frame
+ AquaSalFrame* mpFrame; // parent frame
NSClipView* mpClipView;
SystemEnvData maSysData;
-
+
long mnClipX;
long mnClipY;
long mnClipWidth;
long mnClipHeight;
bool mbClip;
-
+
long mnX;
long mnY;
long mnWidth;
long mnHeight;
-
-
+
+
void setClippedPosSize();
-
+
AquaSalObject( AquaSalFrame* pFrame );
virtual ~AquaSalObject();
-
- virtual void ResetClipRegion();
- 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( 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 );
+
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( 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 GrabFocus();
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
+ virtual const SystemEnvData* GetSystemData() const;
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/aqua/inc/salprn.h b/vcl/aqua/inc/salprn.h
index 86d456907a67..bcae1cb8ffc1 100644
--- a/vcl/aqua/inc/salprn.h
+++ b/vcl/aqua/inc/salprn.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,81 +45,81 @@ class AquaSalGraphics;
class AquaSalInfoPrinter : public SalInfoPrinter
{
/// Printer graphics
- AquaSalGraphics* mpGraphics;
+ AquaSalGraphics* mpGraphics;
/// is Graphics used
- bool mbGraphics;
+ bool mbGraphics;
/// job active ?
bool mbJob;
-
+
/// cocoa printer object
NSPrinter* mpPrinter;
/// cocoa print info object
NSPrintInfo* mpPrintInfo;
-
+
/// FIXME: get real printer context for infoprinter if possible
/// fake context for info printer
/// graphics context for Quartz 2D
- CGContextRef mrContext;
+ CGContextRef mrContext;
/// memory for graphics bitmap context for querying metrics
boost::shared_array< sal_uInt8 > maContextMemory;
-
+
// since changes to NSPrintInfo during a job are ignored
// we have to care for some settings ourselves
// currently we do this for orientation;
// really needed however is a solution for paper formats
Orientation mePageOrientation;
-
+
int mnStartPageOffsetX;
int mnStartPageOffsetY;
sal_Int32 mnCurPageRangeStart;
sal_Int32 mnCurPageRangeCount;
-
+
public:
AquaSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
virtual ~AquaSalInfoPrinter();
-
+
void SetupPrinterGraphics( CGContextRef i_xContext ) const;
-
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* i_pGraphics );
- 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,
+
+ 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 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 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 );
-
+ 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 void InitPaperFormats( const ImplJobSetup* i_pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
+
// the artificial separation between InfoPrinter and Printer
// is not really useful for us
// so let's make AquaSalPrinter just a forwarder to AquaSalInfoPrinter
// and concentrate the real work in one class
// implement pull model print system
- sal_Bool StartJob( const String* i_pFileName,
+ BOOL StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController );
- sal_Bool EndJob();
- sal_Bool AbortJob();
- SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
- sal_Bool EndPage();
- sal_uLong GetErrorCode() const;
-
+ BOOL EndJob();
+ BOOL AbortJob();
+ SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
+ BOOL EndPage();
+ ULONG GetErrorCode() const;
+
NSPrintInfo* getPrintInfo() const { return mpPrintInfo; }
void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; }
sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; }
-
+
// match width/height against known paper formats, possibly switching orientation
const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const;
void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation );
-
+
private:
AquaSalInfoPrinter( const AquaSalInfoPrinter& );
AquaSalInfoPrinter& operator=(const AquaSalInfoPrinter&);
@@ -131,31 +131,31 @@ class AquaSalInfoPrinter : public SalInfoPrinter
class AquaSalPrinter : public SalPrinter
{
- AquaSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
+ AquaSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
public:
AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
virtual ~AquaSalPrinter();
-
- virtual sal_Bool StartJob( const XubString* i_pFileName,
+
+ virtual BOOL StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- sal_uLong i_nCopies,
+ ULONG i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData );
// implement pull model print system
- virtual sal_Bool StartJob( const String* i_pFileName,
+ virtual BOOL StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rListener );
-
- 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();
-
+
+ virtual BOOL EndJob();
+ virtual BOOL AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
+ virtual BOOL EndPage();
+ virtual ULONG GetErrorCode();
+
private:
AquaSalPrinter( const AquaSalPrinter& );
AquaSalPrinter& operator=(const AquaSalPrinter&);
diff --git a/vcl/aqua/inc/salsys.h b/vcl/aqua/inc/salsys.h
index 64e1791668b1..b0919c0c55a4 100644
--- a/vcl/aqua/inc/salsys.h
+++ b/vcl/aqua/inc/salsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,6 +56,11 @@ 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 03772a2dfc2c..929d16981c9b 100644
--- a/vcl/aqua/inc/saltimer.h
+++ b/vcl/aqua/inc/saltimer.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,9 +42,9 @@ class AquaSalTimer : public SalTimer
AquaSalTimer();
virtual ~AquaSalTimer();
- void Start( sal_uLong nMS );
+ void Start( ULONG nMS );
void Stop();
-
+
static void handleStartTimerEvent( NSEvent* pEvent );
diff --git a/vcl/aqua/inc/salvd.h b/vcl/aqua/inc/salvd.h
index 6333fd31e460..117c42c0af88 100644
--- a/vcl/aqua/inc/salvd.h
+++ b/vcl/aqua/inc/salvd.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -81,12 +81,12 @@ private:
void Destroy();
public:
- AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
+ AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData );
virtual ~AquaSalVirtualDevice();
-
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool SetSize( long nNewDX, long nNewDY );
+
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual BOOL SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/aqua/inc/svsys.h b/vcl/aqua/inc/svsys.h
index 291e7801db75..4856908a3852 100644
--- a/vcl/aqua/inc/svsys.h
+++ b/vcl/aqua/inc/svsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/inc/vclnsapp.h b/vcl/aqua/inc/vclnsapp.h
index bdbe15840e0f..c8fbf12afffb 100644
--- a/vcl/aqua/inc/vclnsapp.h
+++ b/vcl/aqua/inc/vclnsapp.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,10 +48,10 @@ class AquaSalFrame;
-(void)sendEvent:(NSEvent*)pEvent;
-(void)sendSuperEvent:(NSEvent*)pEvent;
-(NSMenu*)applicationDockMenu:(NSApplication *)sender;
--(BOOL)application: (NSApplication*) app openFile: (NSString*)file;
+-(MacOSBOOL)application: (NSApplication*) app openFile: (NSString*)file;
-(void)application: (NSApplication*) app openFiles: (NSArray*)files;
--(BOOL)application: (NSApplication*) app printFile: (NSString*)file;
--(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels;
+-(MacOSBOOL)application: (NSApplication*) app printFile: (NSString*)file;
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)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;
--(BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL)bWinVisible;
+-(MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL)bWinVisible;
-(void)setDockIconClickHandler: (NSObject*)pHandler;
-(void)cycleFrameForward: (AquaSalFrame*)pCurFrame;
-(void)cycleFrameBackward: (AquaSalFrame*)pCurFrame;
diff --git a/vcl/aqua/source/a11y/aqua11yactionwrapper.h b/vcl/aqua/source/a11y/aqua11yactionwrapper.h
index 0fd2fa1e25ff..749a9bda98ac 100644
--- a/vcl/aqua/source/a11y/aqua11yactionwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yactionwrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
index f7ec6e513fa7..8f83e650d0d3 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,7 +39,7 @@
+(id)positionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)descriptionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(MacOSBOOL)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 c66e7c3d8515..a700b0b89ae9 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 ];
}
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- BOOL isSettable = NO;
++(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ MacOSBOOL 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 5dcdf4bb9f61..7732ce202cd2 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:(BOOL) bCreate {
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate {
return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: bCreate asRadioGroup: NO ];
}
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup{
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup{
NSMutableDictionary * dAllWrapper = [ AquaA11yFactory allWrapper ];
NSValue * nKey = nil;
if ( asRadioGroup ) {
diff --git a/vcl/aqua/source/a11y/aqua11yfocuslistener.cxx b/vcl/aqua/source/a11y/aqua11yfocuslistener.cxx
index 8e93bd450bf8..7ed4b9bccc66 100644
--- a/vcl/aqua/source/a11y/aqua11yfocuslistener.cxx
+++ b/vcl/aqua/source/a11y/aqua11yfocuslistener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,7 +47,7 @@ rtl::Reference< AquaA11yFocusListener > AquaA11yFocusListener::get()
{
if ( ! theListener.is() )
theListener = new AquaA11yFocusListener();
-
+
return theListener;
}
@@ -73,20 +73,20 @@ id AquaA11yFocusListener::getFocusedUIElement()
// intentionally do nothing ..
}
}
-
+
return m_focusedObject;
}
//------------------------------------------------------------------------------
-void SAL_CALL
+void SAL_CALL
AquaA11yFocusListener::focusedObjectChanged(const Reference< XAccessible >& xAccessible)
{
if ( nil != m_focusedObject ) {
[ m_focusedObject release ];
m_focusedObject = nil;
}
-
+
try {
if( xAccessible.is() ) {
Reference< XAccessibleContext > xContext(xAccessible->getAccessibleContext());
@@ -103,18 +103,18 @@ AquaA11yFocusListener::focusedObjectChanged(const Reference< XAccessible >& xAcc
//------------------------------------------------------------------------------
-oslInterlockedCount SAL_CALL
+oslInterlockedCount SAL_CALL
AquaA11yFocusListener::acquire() SAL_THROW(())
-{
- return ReferenceObject::acquire();
+{
+ return ReferenceObject::acquire();
}
//------------------------------------------------------------------------------
-oslInterlockedCount SAL_CALL
+oslInterlockedCount SAL_CALL
AquaA11yFocusListener::release() SAL_THROW(())
-{
- return ReferenceObject::release();
+{
+ return ReferenceObject::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx b/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
index 192a1f04e278..0fbbc896f1b3 100644
--- a/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
+++ b/vcl/aqua/source/a11y/aqua11yfocuslistener.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,12 +34,12 @@
#include "keyboardfocuslistener.hxx"
#include "aquavcltypes.h"
-class AquaA11yFocusListener :
+class AquaA11yFocusListener :
public KeyboardFocusListener,
public salhelper::ReferenceObject
{
id m_focusedObject;
-
+
static rtl::Reference< AquaA11yFocusListener > theListener;
AquaA11yFocusListener::AquaA11yFocusListener();
@@ -47,15 +47,15 @@ class AquaA11yFocusListener :
public:
static rtl::Reference< AquaA11yFocusListener > get();
-
+
id getFocusedUIElement();
// KeyboardFocusListener
virtual void SAL_CALL focusedObjectChanged(const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& xAccessible);
-
+
// rtl::IReference
virtual oslInterlockedCount SAL_CALL acquire() SAL_THROW(());
- virtual oslInterlockedCount SAL_CALL release() SAL_THROW(());
+ virtual oslInterlockedCount SAL_CALL release() SAL_THROW(());
};
#endif // _AQUA11YFOCUSLISTENER_HXX_
diff --git a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx
index f4b5393c7e8f..53e12b516aed 100644
--- a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx
+++ b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ using namespace ::com::sun::star::uno;
//------------------------------------------------------------------------------
-static inline Window *
+static inline Window *
getWindow(const ::VclSimpleEvent *pEvent)
{
return static_cast< const ::VclWindowEvent *> (pEvent)->GetWindow();
@@ -87,13 +87,13 @@ long AquaA11yFocusTracker::WindowEventHandler(AquaA11yFocusTracker *pFocusTracke
default:
break;
};
-
+
return 0;
}
//------------------------------------------------------------------------------
-AquaA11yFocusTracker::AquaA11yFocusTracker() :
+AquaA11yFocusTracker::AquaA11yFocusTracker() :
m_aWindowEventLink(this, (PSTUB) WindowEventHandler),
m_xDocumentFocusListener(new DocumentFocusListener(*this))
{
@@ -106,9 +106,9 @@ AquaA11yFocusTracker::AquaA11yFocusTracker() :
void AquaA11yFocusTracker::setFocusedObject(const Reference< XAccessible >& xAccessible)
{
if( xAccessible != m_xFocusedObject )
- {
+ {
m_xFocusedObject = xAccessible;
-
+
if( m_aFocusListener.is() )
m_aFocusListener->focusedObjectChanged(xAccessible);
}
@@ -119,7 +119,7 @@ void AquaA11yFocusTracker::setFocusedObject(const Reference< XAccessible >& xAcc
void AquaA11yFocusTracker::notify_toolbox_item_focus(ToolBox *pToolBox)
{
Reference< XAccessible > xAccessible( pToolBox->GetAccessible() );
-
+
if( xAccessible.is() )
{
Reference< XAccessibleContext > xContext(xAccessible->getAccessibleContext());
@@ -179,7 +179,7 @@ void AquaA11yFocusTracker::toolbox_highlight_on(Window *pWindow)
if ( ! pToolBoxParent || ! pToolBoxParent->HasFocus() )
return;
}
-
+
notify_toolbox_item_focus(static_cast <ToolBox *> (pWindow));
}
@@ -188,7 +188,7 @@ void AquaA11yFocusTracker::toolbox_highlight_on(Window *pWindow)
void AquaA11yFocusTracker::toolbox_highlight_off(Window *pWindow)
{
ToolBox* pToolBoxParent = dynamic_cast< ToolBox * >( pWindow->GetParent() );
-
+
// Notify when leaving sub toolboxes
if( pToolBoxParent && pToolBoxParent->HasFocus() )
notify_toolbox_item_focus( pToolBoxParent );
@@ -199,14 +199,14 @@ void AquaA11yFocusTracker::toolbox_highlight_off(Window *pWindow)
void AquaA11yFocusTracker::tabpage_activated(Window *pWindow)
{
Reference< XAccessible > xAccessible( pWindow->GetAccessible() );
-
+
if( xAccessible.is() )
{
Reference< XAccessibleSelection > xSelection(xAccessible->getAccessibleContext(), UNO_QUERY);
-
+
if( xSelection.is() )
setFocusedObject( xSelection->getSelectedAccessibleChild(0) );
- }
+ }
}
//------------------------------------------------------------------------------
@@ -214,7 +214,7 @@ void AquaA11yFocusTracker::tabpage_activated(Window *pWindow)
void AquaA11yFocusTracker::menu_highlighted(const VclMenuEvent *pEvent)
{
Menu * pMenu = pEvent->GetMenu();
-
+
if( pMenu )
{
Reference< XAccessible > xAccessible( pMenu->GetAccessible() );
@@ -231,34 +231,34 @@ void AquaA11yFocusTracker::window_got_focus(Window *pWindow)
// The menu bar is handled through VCLEVENT_MENU_HIGHLIGHTED
if( ! pWindow || !pWindow->IsReallyVisible() || pWindow->GetType() == WINDOW_MENUBARWINDOW )
return;
-
+
// ToolBoxes are handled through VCLEVENT_TOOLBOX_HIGHLIGHT
if( pWindow->GetType() == WINDOW_TOOLBOX )
return;
-
+
if( pWindow->GetType() == WINDOW_TABCONTROL )
{
tabpage_activated( pWindow );
return;
}
-
+
Reference< XAccessible > xAccessible(pWindow->GetAccessible());
-
+
if( ! xAccessible.is() )
return;
-
+
Reference< XAccessibleContext > xContext = xAccessible->getAccessibleContext();
-
+
if( ! xContext.is() )
return;
-
+
Reference< XAccessibleStateSet > xStateSet = xContext->getAccessibleStateSet();
-
+
if( ! xStateSet.is() )
return;
-
+
/* the UNO ToolBox wrapper does not (yet?) support XAccessibleSelection, so we
- * need to add listeners to the children instead of re-using the tabpage stuff
+ * need to add listeners to the children instead of re-using the tabpage stuff
*/
if( xStateSet->contains(AccessibleStateType::FOCUSED) && (pWindow->GetType() != WINDOW_TREELISTBOX) )
{
diff --git a/vcl/aqua/source/a11y/aqua11ylistener.cxx b/vcl/aqua/source/a11y/aqua11ylistener.cxx
index 3b77f054a0ac..782580ff87ae 100644
--- a/vcl/aqua/source/a11y/aqua11ylistener.cxx
+++ b/vcl/aqua/source/a11y/aqua11ylistener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "aqua11ylistener.hxx"
#include "aqua11yfactory.h"
#include "aqua11yfocustracker.hxx"
@@ -47,16 +47,16 @@ NSString * getTableNotification( const AccessibleEventObject& aEvent )
{
AccessibleTableModelChange aChange;
NSString * notification = nil;
-
+
if( (aEvent.NewValue >>= aChange) &&
( AccessibleTableModelChangeType::INSERT == aChange.Type || AccessibleTableModelChangeType::DELETE == aChange.Type ) &&
aChange.FirstRow != aChange.LastRow )
{
notification = NSAccessibilityRowCountChangedNotification;
}
-
+
return notification;
-}
+}
//------------------------------------------------------------------------------
@@ -67,14 +67,14 @@ AquaA11yEventListener::AquaA11yEventListener(id wrapperObject, sal_Int16 role) :
//------------------------------------------------------------------------------
-AquaA11yEventListener::~AquaA11yEventListener()
+AquaA11yEventListener::~AquaA11yEventListener()
{
[ m_wrapperObject release ];
}
//------------------------------------------------------------------------------
-void SAL_CALL
+void SAL_CALL
AquaA11yEventListener::disposing( const EventObject& Source ) throw( RuntimeException )
{
[ AquaA11yFactory removeFromWrapperRepositoryFor: [ (AquaA11yWrapper *) m_wrapperObject accessibleContext ] ];
@@ -82,13 +82,13 @@ AquaA11yEventListener::disposing( const EventObject& Source ) throw( RuntimeExce
//------------------------------------------------------------------------------
-void SAL_CALL
+void SAL_CALL
AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw( RuntimeException )
{
NSString * notification = nil;
id element = m_wrapperObject;
Rectangle bounds;
-
+
// TODO: NSAccessibilityValueChanged, NSAccessibilitySelectedRowsChangedNotification
switch( aEvent.EventId )
{
@@ -99,11 +99,11 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw(
AquaA11yFocusTracker::get().setFocusedObject( xAccessible );
}
break;
-
+
case AccessibleEventId::NAME_CHANGED:
notification = NSAccessibilityTitleChangedNotification;
break;
-
+
case AccessibleEventId::CHILD:
// only needed for tooltips (says Apple)
if ( m_role == AccessibleRole::TOOL_TIP ) {
@@ -114,11 +114,11 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw(
}
}
break;
-
+
case AccessibleEventId::INVALIDATE_ALL_CHILDREN:
- // TODO: depricate or remember all children
+ // TODO: depricate or remember all children
break;
-
+
case AccessibleEventId::BOUNDRECT_CHANGED:
bounds = [ element accessibleComponent ] -> getBounds();
if ( m_oldBounds.X != 0 && ( bounds.X != m_oldBounds.X || bounds.Y != m_oldBounds.Y ) ) {
@@ -129,23 +129,23 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw(
}
m_oldBounds = bounds;
break;
-
+
case AccessibleEventId::SELECTION_CHANGED:
notification = NSAccessibilitySelectedChildrenChangedNotification;
break;
-
+
case AccessibleEventId::TEXT_SELECTION_CHANGED:
notification = NSAccessibilitySelectedTextChangedNotification;
break;
-
+
case AccessibleEventId::TABLE_MODEL_CHANGED:
notification = getTableNotification(aEvent);
break;
-
+
case AccessibleEventId::CARET_CHANGED:
notification = NSAccessibilitySelectedTextChangedNotification;
break;
-
+
case AccessibleEventId::TEXT_CHANGED:
notification = NSAccessibilityValueChangedNotification;
break;
@@ -153,7 +153,7 @@ AquaA11yEventListener::notifyEvent( const AccessibleEventObject& aEvent ) throw(
default:
break;
}
-
+
if( nil != notification )
NSAccessibilityPostNotification(element, notification);
}
diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.h b/vcl/aqua/source/a11y/aqua11yrolehelper.h
index 38328c6a3d46..66e6e91b75d7 100644
--- a/vcl/aqua/source/a11y/aqua11yrolehelper.h
+++ b/vcl/aqua/source/a11y/aqua11yrolehelper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
index 0585f01c9360..ade4cf14a1b0 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,7 @@
}
+(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(MacOSBOOL)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 66f19b80a9f9..81f203da5d68 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 ];
}
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
++(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
{
if ( [ attribute isEqualToString: NSAccessibilitySelectedChildrenAttribute ] )
{
diff --git a/vcl/aqua/source/a11y/aqua11ytablewrapper.h b/vcl/aqua/source/a11y/aqua11ytablewrapper.h
index 8f3e48364257..acaa50bd43ee 100644
--- a/vcl/aqua/source/a11y/aqua11ytablewrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ytablewrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.h b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.h
index d7159de9f526..c54cbc360a9f 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index f0d0e46a517e..6577cebf295e 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -77,8 +77,8 @@ using namespace ::rtl;
return italicStyle;
}
-+(BOOL)isStrikethrough:(PropertyValue)property {
- BOOL strikethrough = NO;
++(MacOSBOOL)isStrikethrough:(PropertyValue)property {
+ MacOSBOOL strikethrough = NO;
sal_Int16 value = 0;
property.Value >>= value;
if ( value != FontStrikeout::NONE
@@ -88,8 +88,8 @@ using namespace ::rtl;
return strikethrough;
}
-+(BOOL)convertBoolean:(PropertyValue)property {
- BOOL myBoolean = NO;
++(MacOSBOOL)convertBoolean:(PropertyValue)property {
+ MacOSBOOL myBoolean = NO;
bool value = sal_False;
property.Value >>= value;
if ( value ) {
@@ -132,24 +132,24 @@ using namespace ::rtl;
+(void)applyAttributesFrom:(Sequence < PropertyValue >)attributes toString:(NSMutableAttributedString *)string forRange:(NSRange)range storeDefaultsTo:(AquaA11yWrapper *)wrapperStore getDefaultsFrom:(AquaA11yWrapper *)wrapper {
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
// constants
- static const OUString attrUnderline(RTL_CONSTASCII_USTRINGPARAM("CharUnderline"));
- static const OUString attrBold(RTL_CONSTASCII_USTRINGPARAM("CharWeight"));
- static const OUString attrFontname(RTL_CONSTASCII_USTRINGPARAM("CharFontName"));
- static const OUString attrItalic(RTL_CONSTASCII_USTRINGPARAM("CharPosture"));
- static const OUString attrHeight(RTL_CONSTASCII_USTRINGPARAM("CharHeight"));
- static const OUString attrStrikethrough(RTL_CONSTASCII_USTRINGPARAM("CharStrikeout"));
- static const OUString attrShadow(RTL_CONSTASCII_USTRINGPARAM("CharShadowed"));
- static const OUString attrUnderlineColor(RTL_CONSTASCII_USTRINGPARAM("CharUnderlineColor"));
- static const OUString attrUnderlineHasColor(RTL_CONSTASCII_USTRINGPARAM("CharUnderlineHasColor"));
- static const OUString attrForegroundColor(RTL_CONSTASCII_USTRINGPARAM("CharColor"));
- static const OUString attrBackgroundColor(RTL_CONSTASCII_USTRINGPARAM("CharBackColor"));
- static const OUString attrSuperscript(RTL_CONSTASCII_USTRINGPARAM("CharEscapement"));
+ static const OUString attrUnderline = OUString::createFromAscii("CharUnderline");
+ static const OUString attrBold = OUString::createFromAscii("CharWeight");
+ static const OUString attrFontname = OUString::createFromAscii("CharFontName");
+ static const OUString attrItalic = OUString::createFromAscii("CharPosture");
+ static const OUString attrHeight = OUString::createFromAscii("CharHeight");
+ static const OUString attrStrikethrough = OUString::createFromAscii("CharStrikeout");
+ static const OUString attrShadow = OUString::createFromAscii("CharShadowed");
+ static const OUString attrUnderlineColor = OUString::createFromAscii("CharUnderlineColor");
+ static const OUString attrUnderlineHasColor = OUString::createFromAscii("CharUnderlineHasColor");
+ static const OUString attrForegroundColor = OUString::createFromAscii("CharColor");
+ static const OUString attrBackgroundColor = OUString::createFromAscii("CharBackColor");
+ static const OUString attrSuperscript = OUString::createFromAscii("CharEscapement");
// vars
OUString fontname;
int fonttraits = 0;
float fontsize = 0.0;
sal_Int32 underlineColor = 0;
- BOOL underlineHasColor = NO;
+ MacOSBOOL 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 ceb9bcbe393d..b4bc25cb0a4c 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,7 @@
+(void)addParameterizedAttributeNamesTo:(NSMutableArray *)attributeNames;
+(NSArray *)specialAttributeNames;
+(NSArray *)specialParameterizedAttributeNames;
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(MacOSBOOL)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 89c164e5e0b9..2033135564d8 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
@@ -273,8 +273,8 @@ using namespace ::rtl;
return rtfData;
}
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- BOOL isSettable = NO;
++(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ MacOSBOOL isSettable = NO;
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11yutil.h b/vcl/aqua/source/a11y/aqua11yutil.h
index 5007def0487b..7939685e8c34 100644
--- a/vcl/aqua/source/a11y/aqua11yutil.h
+++ b/vcl/aqua/source/a11y/aqua11yutil.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
index 1292ef5ab77b..dbe8671f9948 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@
+(id)minValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)maxValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(MacOSBOOL)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 fb257921b13e..85ef0041da95 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 ];
}
-+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- BOOL isSettable = NO;
++(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ MacOSBOOL 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 c2724a372f9f..e86676e725f2 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 BOOL isPopupMenuOpen = NO;
+static MacOSBOOL isPopupMenuOpen = NO;
@implementation AquaA11yWrapper : NSView
@@ -154,7 +154,7 @@ static BOOL isPopupMenuOpen = NO;
// (getter without parameter) attributeNameHereAttribute
// (getter with parameter) attributeNameHereAttributeForParameter:
// (setter) setAttributeNameHereAttributeForElement:to:
--(SEL)selectorForAttribute:(NSString *)attribute asGetter:(BOOL)asGetter withGetterParameter:(BOOL)withGetterParameter {
+-(SEL)selectorForAttribute:(NSString *)attribute asGetter:(MacOSBOOL)asGetter withGetterParameter:(MacOSBOOL)withGetterParameter {
SEL selector = nil;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
@try {
@@ -197,7 +197,7 @@ static BOOL isPopupMenuOpen = NO;
return Reference < XAccessible > ();
}
--(BOOL)isFirstRadioButtonInGroup {
+-(MacOSBOOL)isFirstRadioButtonInGroup {
Reference < XAccessible > rFirstMateAccessible = [ self getFirstRadioButtonInGroup ];
if ( rFirstMateAccessible.is() && rFirstMateAccessible -> getAccessibleContext().get() == [ self accessibleContext ] ) {
return YES;
@@ -693,12 +693,12 @@ static BOOL isPopupMenuOpen = NO;
return value;
}
--(BOOL)accessibilityIsIgnored {
+-(MacOSBOOL)accessibilityIsIgnored {
// #i90575# guard NSAccessibility protocol against unwanted access
if ( isPopupMenuOpen ) {
return nil;
}
- BOOL ignored = NO;
+ MacOSBOOL ignored = NO;
sal_Int16 nRole = [ self accessibleContext ] -> getAccessibleRole();
switch ( nRole ) {
case AccessibleRole::PANEL:
@@ -796,8 +796,8 @@ static BOOL isPopupMenuOpen = NO;
}
}
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
- BOOL isSettable = NO;
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+ MacOSBOOL isSettable = NO;
if ( [ self accessibleText ] != nil ) {
isSettable = [ AquaA11yTextWrapper isAttributeSettable: attribute forElement: self ];
}
@@ -830,7 +830,7 @@ static BOOL isPopupMenuOpen = NO;
return nil; // TODO: to be completed
}
--(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
+-(MacOSBOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
return NO; // TODO
}
@@ -904,7 +904,7 @@ static BOOL isPopupMenuOpen = NO;
// get some information
NSString * role = (NSString *) [ self accessibilityAttributeValue: NSAccessibilityRoleAttribute ];
id enabledAttr = [ self enabledAttribute ];
- BOOL enabled = [ enabledAttr boolValue ];
+ MacOSBOOL enabled = [ enabledAttr boolValue ];
NSView * parent = (NSView *) [ self accessibilityAttributeValue: NSAccessibilityParentAttribute ];
AquaA11yWrapper * parentAsWrapper = nil;
if ( [ parent isKindOfClass: [ AquaA11yWrapper class ] ] ) {
@@ -947,8 +947,8 @@ static BOOL isPopupMenuOpen = NO;
#pragma mark -
#pragma mark Hit Test
--(BOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
- BOOL hit = NO;
+-(MacOSBOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
+ MacOSBOOL 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:(BOOL)actsAsRadioGroup {
+-(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup {
mActsAsRadioGroup = actsAsRadioGroup;
}
--(BOOL)actsAsRadioGroup {
+-(MacOSBOOL)actsAsRadioGroup {
return mActsAsRadioGroup;
}
-+(void)setPopupMenuOpen:(BOOL)popupMenuOpen {
++(void)setPopupMenuOpen:(MacOSBOOL)popupMenuOpen {
isPopupMenuOpen = popupMenuOpen;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperbutton.h b/vcl/aqua/source/a11y/aqua11ywrapperbutton.h
index d232e111865e..b4ab2b19eed5 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperbutton.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperbutton.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
index 192e528e930d..d855d8e485ca 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
index 25f012e1163f..c4ac34dc5bce 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(MacOSBOOL)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 5ca5c967234f..bc52420300f6 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@
-(id)selectedTextRangeAttribute;
-(id)visibleCharacterRangeAttribute;
// Accessibility Protocol
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(MacOSBOOL)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 16fa1372fe4e..85aed320e470 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
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ self textArea ] != nil && (
[ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11ywrappergroup.h b/vcl/aqua/source/a11y/aqua11ywrappergroup.h
index 0e6deae658d1..622e9d51b038 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappergroup.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappergroup.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperlist.h b/vcl/aqua/source/a11y/aqua11ywrapperlist.h
index d0b0b17d3769..f6ddb58c3dd3 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperlist.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperlist.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
index ac9e0e7022ff..6df01c0147a5 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
index 930f940c4971..54d6edac619a 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ] ) {
return NO;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.h b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.h
index f73a746046ad..a37c89ba194e 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperrow.h b/vcl/aqua/source/a11y/aqua11ywrapperrow.h
index b4956ec466af..d4f4eca1e0ed 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperrow.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperrow.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.h b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.h
index b92d9ac4a1cb..31ce6be739b3 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.h b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.h
index 8fc87d02b0fe..81ba622c9549 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrappersplitter.h b/vcl/aqua/source/a11y/aqua11ywrappersplitter.h
index dfe39d88949e..535b79bed0ac 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappersplitter.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappersplitter.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.h b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.h
index a87f238b6027..024368f8fa58 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.h b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.h
index 9c448c057eff..cfad97feacc3 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertextarea.h b/vcl/aqua/source/a11y/aqua11ywrappertextarea.h
index 3e11797bb383..9a73adc18509 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertextarea.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappertextarea.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.h b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.h
index e7163fd8b373..6467abe643ed 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/a11y/documentfocuslistener.cxx b/vcl/aqua/source/a11y/documentfocuslistener.cxx
index 964f629bff51..a9f526f4b28a 100644
--- a/vcl/aqua/source/a11y/documentfocuslistener.cxx
+++ b/vcl/aqua/source/a11y/documentfocuslistener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "documentfocuslistener.hxx"
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
@@ -33,16 +33,16 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-
+
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
-
+
//------------------------------------------------------------------------------
DocumentFocusListener::DocumentFocusListener(AquaA11yFocusTracker& rTracker) :
- m_aFocusTracker(rTracker)
+ m_aFocusTracker(rTracker)
{
}
@@ -52,7 +52,7 @@ void SAL_CALL
DocumentFocusListener::disposing( const EventObject& aEvent )
throw (RuntimeException)
{
- // Unref the object here, but do not remove as listener since the object
+ // Unref the object here, but do not remove as listener since the object
// might no longer be in a state that safely allows this.
if( aEvent.Source.is() )
m_aRefList.erase(aEvent.Source);
@@ -60,18 +60,18 @@ DocumentFocusListener::disposing( const EventObject& aEvent )
//------------------------------------------------------------------------------
-void SAL_CALL
-DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
+void SAL_CALL
+DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
throw( RuntimeException )
{
switch( aEvent.EventId )
{
case AccessibleEventId::STATE_CHANGED:
- try
+ try
{
sal_Int16 nState = AccessibleStateType::INVALID;
aEvent.NewValue >>= nState;
-
+
if( AccessibleStateType::FOCUSED == nState )
m_aFocusTracker.setFocusedObject( getAccessible(aEvent) );
}
@@ -80,18 +80,18 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
OSL_TRACE("Focused object has invalid index in parent");
}
break;
-
+
case AccessibleEventId::CHILD:
{
Reference< XAccessible > xChild;
if( (aEvent.OldValue >>= xChild) && xChild.is() )
detachRecursive(xChild);
-
+
if( (aEvent.NewValue >>= xChild) && xChild.is() )
attachRecursive(xChild);
}
break;
-
+
case AccessibleEventId::INVALIDATE_ALL_CHILDREN:
{
Reference< XAccessible > xAccessible( getAccessible(aEvent) );
@@ -112,10 +112,10 @@ Reference< XAccessible > DocumentFocusListener::getAccessible(const EventObject&
throw (IndexOutOfBoundsException, RuntimeException)
{
Reference< XAccessible > xAccessible(aEvent.Source, UNO_QUERY);
-
+
if( xAccessible.is() )
return xAccessible;
-
+
Reference< XAccessibleContext > xContext(aEvent.Source, UNO_QUERY);
if( xContext.is() )
@@ -130,13 +130,13 @@ Reference< XAccessible > DocumentFocusListener::getAccessible(const EventObject&
}
}
}
-
+
return Reference< XAccessible >();
}
//------------------------------------------------------------------------------
-void DocumentFocusListener::attachRecursive(const Reference< XAccessible >& xAccessible)
+void DocumentFocusListener::attachRecursive(const Reference< XAccessible >& xAccessible)
throw (IndexOutOfBoundsException, RuntimeException)
{
Reference< XAccessibleContext > xContext = xAccessible->getAccessibleContext();
@@ -148,8 +148,8 @@ void DocumentFocusListener::attachRecursive(const Reference< XAccessible >& xAcc
//------------------------------------------------------------------------------
void DocumentFocusListener::attachRecursive(
- const Reference< XAccessible >& xAccessible,
- const Reference< XAccessibleContext >& xContext
+ const Reference< XAccessible >& xAccessible,
+ const Reference< XAccessibleContext >& xContext
) throw (IndexOutOfBoundsException, RuntimeException)
{
if( xContext.is() )
@@ -164,13 +164,13 @@ void DocumentFocusListener::attachRecursive(
//------------------------------------------------------------------------------
void DocumentFocusListener::attachRecursive(
- const Reference< XAccessible >& xAccessible,
+ const Reference< XAccessible >& xAccessible,
const Reference< XAccessibleContext >& xContext,
- const Reference< XAccessibleStateSet >& xStateSet
+ const Reference< XAccessibleStateSet >& xStateSet
) throw (IndexOutOfBoundsException,RuntimeException)
{
if( xStateSet->contains(AccessibleStateType::FOCUSED ) )
- m_aFocusTracker.setFocusedObject( xAccessible );
+ m_aFocusTracker.setFocusedObject( xAccessible );
Reference< XAccessibleEventBroadcaster > xBroadcaster =
Reference< XAccessibleEventBroadcaster >(xContext, UNO_QUERY);
@@ -186,7 +186,7 @@ void DocumentFocusListener::attachRecursive(
for( n = 0; n < nmax; n++ )
{
Reference< XAccessible > xChild( xContext->getAccessibleChild( n ) );
-
+
if( xChild.is() )
attachRecursive(xChild);
}
@@ -196,7 +196,7 @@ void DocumentFocusListener::attachRecursive(
//------------------------------------------------------------------------------
-void DocumentFocusListener::detachRecursive(const Reference< XAccessible >& xAccessible)
+void DocumentFocusListener::detachRecursive(const Reference< XAccessible >& xAccessible)
throw (IndexOutOfBoundsException, RuntimeException)
{
Reference< XAccessibleContext > xContext = xAccessible->getAccessibleContext();
@@ -208,8 +208,8 @@ void DocumentFocusListener::detachRecursive(const Reference< XAccessible >& xAcc
//------------------------------------------------------------------------------
void DocumentFocusListener::detachRecursive(
- const Reference< XAccessible >& xAccessible,
- const Reference< XAccessibleContext >& xContext
+ const Reference< XAccessible >& xAccessible,
+ const Reference< XAccessibleContext >& xContext
) throw (IndexOutOfBoundsException, RuntimeException)
{
Reference< XAccessibleStateSet > xStateSet = xContext->getAccessibleStateSet();
@@ -221,9 +221,9 @@ void DocumentFocusListener::detachRecursive(
//------------------------------------------------------------------------------
void DocumentFocusListener::detachRecursive(
- const Reference< XAccessible >&,
+ const Reference< XAccessible >&,
const Reference< XAccessibleContext >& xContext,
- const Reference< XAccessibleStateSet >& xStateSet
+ const Reference< XAccessibleStateSet >& xStateSet
) throw (IndexOutOfBoundsException, RuntimeException)
{
Reference< XAccessibleEventBroadcaster > xBroadcaster =
@@ -232,19 +232,19 @@ void DocumentFocusListener::detachRecursive(
if( xBroadcaster.is() && 0 < m_aRefList.erase(xBroadcaster) )
{
xBroadcaster->removeEventListener(static_cast< XAccessibleEventListener *>(this));
-
+
if( ! xStateSet->contains(AccessibleStateType::MANAGES_DESCENDANTS ) )
{
sal_Int32 n, nmax = xContext->getAccessibleChildCount();
for( n = 0; n < nmax; n++ )
{
Reference< XAccessible > xChild( xContext->getAccessibleChild( n ) );
-
+
if( xChild.is() )
detachRecursive(xChild);
}
}
- }
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/a11y/documentfocuslistener.hxx b/vcl/aqua/source/a11y/documentfocuslistener.hxx
index 6e3f3bd511ac..5b8ae53c2c68 100644
--- a/vcl/aqua/source/a11y/documentfocuslistener.hxx
+++ b/vcl/aqua/source/a11y/documentfocuslistener.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@
// - DocumentFocusListener -
// -------------------------
-class DocumentFocusListener :
+class DocumentFocusListener :
public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
{
@@ -82,16 +82,16 @@ public:
throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
// XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
throw (::com::sun::star::uno::RuntimeException);
// XAccessibleEventListener
- virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
throw( ::com::sun::star::uno::RuntimeException );
private:
std::set< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > m_aRefList;
-
+
AquaA11yFocusTracker& m_aFocusTracker;
};
diff --git a/vcl/aqua/source/app/saldata.cxx b/vcl/aqua/source/app/saldata.cxx
index 925dfa8c00b0..96ae9829ddcb 100644
--- a/vcl/aqua/source/app/saldata.cxx
+++ b/vcl/aqua/source/app/saldata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -66,7 +66,7 @@ SalData::SalData()
if( s_aAutoReleaseKey == 0 )
s_aAutoReleaseKey = osl_createThreadKey( releasePool );
}
-
+
SalData::~SalData()
{
CGPatternRelease( mxP50Pattern );
@@ -89,7 +89,7 @@ SalData::~SalData()
osl_setThreadKeyData( s_aAutoReleaseKey, NULL );
[pPool release];
}
-
+
osl_destroyThreadKey( s_aAutoReleaseKey );
s_aAutoReleaseKey = 0;
}
@@ -111,7 +111,7 @@ void SalData::ensureThreadAutoreleasePool()
}
else
{
- OSL_FAIL( "no autorelease key" );
+ DBG_ERROR( "no autorelease key" );
}
}
@@ -135,7 +135,7 @@ void SalData::drainThreadAutoreleasePool()
}
else
{
- OSL_FAIL( "no autorelease key" );
+ DBG_ERROR( "no autorelease key" );
}
}
@@ -247,11 +247,11 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
{
if( i_eStyle >= POINTER_COUNT )
return nil;
-
+
NSCursor* pCurs = maCursors[ i_eStyle ];
if( pCurs == INVALID_CURSOR_PTR )
{
- pCurs = nil;
+ pCurs = nil;
if( aCursorTab[ i_eStyle ].pBaseName )
{
NSPoint aHotSpot = aCursorTab[ i_eStyle ].aHotSpot;
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 20ac4e2251d6..c6f573d99fa4 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -73,9 +73,9 @@
using namespace std;
using namespace ::com::sun::star;
-extern sal_Bool ImplSVMain();
+extern BOOL ImplSVMain();
-static int* gpnInit = 0;
+static BOOL* gpbInit = 0;
static NSMenu* pDockMenu = nil;
static bool bNoSVMain = true;
static bool bLeftMain = false;
@@ -209,9 +209,9 @@ static void initNSApp()
[NSApp activateIgnoringOtherApps: YES];
}
-sal_Bool ImplSVMainHook( int * pnInit )
+BOOL ImplSVMainHook( BOOL * pbInit )
{
- gpnInit = pnInit;
+ gpbInit = pbInit;
bNoSVMain = false;
initNSApp();
@@ -246,7 +246,7 @@ sal_Bool ImplSVMainHook( int * pnInit )
}
else
{
- OSL_FAIL( "NSApplication initialization could not be done" );
+ DBG_ERROR( "NSApplication initialization could not be done" );
}
return TRUE; // indicate that ImplSVMainHook is implemented
@@ -306,7 +306,7 @@ void InitSalMain()
{
rtl::OUString urlWorkDir;
rtl_uString *sysWorkDir = NULL;
- if (tools::getProcessWorkingDir(urlWorkDir))
+ if (tools::getProcessWorkingDir(&urlWorkDir))
{
oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir);
if (err2 == osl_File_E_None)
@@ -366,7 +366,7 @@ void DeInitSalMain()
SalYieldMutex::SalYieldMutex()
{
- mnCount = 0;
+ mnCount = 0;
mnThreadId = 0;
}
@@ -404,7 +404,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
// some convenience functions regarding the yield mutex, aka solar mutex
-sal_Bool ImplSalYieldMutexTryToAcquire()
+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()->maNWFData.mnStatusBarLowerRightOffset = 10;
+ ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
@@ -515,7 +515,7 @@ void AquaSalInstance::wakeupYield()
// -----------------------------------------------------------------------
-void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData )
+void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData )
{
osl_acquireMutex( maUserEventListMutex );
maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) );
@@ -534,14 +534,14 @@ osl::SolarMutex* AquaSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-sal_uLong AquaSalInstance::ReleaseYieldMutex()
+ULONG AquaSalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- sal_uLong nCount = pYieldMutex->GetAcquireCount();
- sal_uLong n = nCount;
+ ULONG nCount = pYieldMutex->GetAcquireCount();
+ ULONG n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -556,7 +556,7 @@ sal_uLong AquaSalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void AquaSalInstance::AcquireYieldMutex( sal_uLong nCount )
+void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -568,21 +568,6 @@ void AquaSalInstance::AcquireYieldMutex( sal_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;
@@ -602,9 +587,9 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
break;
case AppExecuteSVMain:
{
- int nResult = ImplSVMain();
- if( gpnInit )
- *gpnInit = nResult;
+ BOOL bResult = ImplSVMain();
+ if( gpbInit )
+ *gpbInit = bResult;
[NSApp stop: NSApp];
bLeftMain = true;
if( pDockMenu )
@@ -625,7 +610,7 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
{
if ( ((*it)->mbFullScreen == true) )
bIsFullScreenMode = true;
- ++it;
+ it++;
}
switch ([pEvent data1])
@@ -637,7 +622,7 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
// kept for experimentation purpose (scheduled for future implementation)
// case kRemoteButtonMenu: nCommand = MEDIA_COMMAND_MENU; break;
- case kRemoteButtonPlus: nCommand = MEDIA_COMMAND_VOLUME_UP; break;
+ case kRemoteButtonPlus: nCommand = MEDIA_COMMAND_VOLUME_UP; break;
case kRemoteButtonMinus: nCommand = MEDIA_COMMAND_VOLUME_DOWN; break;
@@ -682,7 +667,7 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
break;
default:
- OSL_FAIL( "unhandled NSApplicationDefined event" );
+ DBG_ERROR( "unhandled NSApplicationDefined event" );
break;
};
}
@@ -712,7 +697,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bDispatchUser = true;
while( bDispatchUser )
{
- sal_uLong nCount = ReleaseYieldMutex();
+ ULONG nCount = ReleaseYieldMutex();
// get one user event
osl_acquireMutex( maUserEventListMutex );
@@ -753,7 +738,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bHadEvent = false;
do
{
- sal_uLong nCount = ReleaseYieldMutex();
+ ULONG nCount = ReleaseYieldMutex();
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil
inMode: NSDefaultRunLoopMode dequeue: YES];
@@ -770,7 +755,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// if we had no event yet, wait for one if requested
if( bWait && ! bHadEvent )
{
- sal_uLong nCount = ReleaseYieldMutex();
+ ULONG nCount = ReleaseYieldMutex();
NSDate* pDt = AquaSalTimer::pRunningTimer ? [AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture];
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: pDt
@@ -814,7 +799,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// has dispatched an event, cop out at 200 ms
osl_resetCondition( maWaitingYieldCond );
TimeValue aVal = { 0, 200000000 };
- sal_uLong nCount = ReleaseYieldMutex();
+ ULONG nCount = ReleaseYieldMutex();
osl_waitCondition( maWaitingYieldCond, &aVal );
AcquireYieldMutex( nCount );
}
@@ -845,7 +830,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// -----------------------------------------------------------------------
-bool AquaSalInstance::AnyInput( sal_uInt16 nType )
+bool AquaSalInstance::AnyInput( USHORT nType )
{
if( nType & INPUT_APPEVENT )
{
@@ -891,14 +876,14 @@ bool AquaSalInstance::AnyInput( sal_uInt16 nType )
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
{
return NULL;
}
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
{
SalData::ensureThreadAutoreleasePool();
@@ -915,7 +900,7 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame )
// -----------------------------------------------------------------------
-SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ )
+SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, BOOL /* bShow */ )
{
// SystemWindowData is meaningless on Mac OS X
AquaSalObject *pObject = NULL;
@@ -992,9 +977,6 @@ 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];
@@ -1019,9 +1001,6 @@ 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 )
{
@@ -1037,9 +1016,6 @@ 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;
}
@@ -1073,8 +1049,8 @@ void AquaSalInstance::SetErrorEventCallback( void* pInstance, bool(*pCallback)(v
void* AquaSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
{
- rReturnedBytes = 1;
- rReturnedType = AsciiCString;
+ rReturnedBytes = 1;
+ rReturnedType = AsciiCString;
return (void*)"";
}
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index ea588c9de132..c279c1c7f88f 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,14 +31,12 @@
#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;
+using namespace rtl;
// =======================================================================
@@ -71,7 +69,7 @@ Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
pScreen = [pScreens objectAtIndex: nScreen];
else
pScreen = [NSScreen mainScreen];
-
+
if( pScreen )
{
NSRect aFrame = [pScreen frame];
@@ -90,7 +88,7 @@ Rectangle AquaSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen )
pScreen = [pScreens objectAtIndex: nScreen];
else
pScreen = [NSScreen mainScreen];
-
+
if( pScreen )
{
NSRect aFrame = [pScreen visibleFrame];
@@ -117,22 +115,12 @@ rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen )
return aRet;
}
-static NSString* getStandardString( int nButtonId )
+int AquaSalSystem::ShowNativeDialog( const String& rTitle,
+ const String& rMessage,
+ const std::list< String >& rButtons,
+ int nDefButton )
{
- 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;
+ return 0;
}
int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
@@ -140,84 +128,7 @@ int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
int nButtonCombination,
int nDefaultButton)
{
- 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;
+ return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/saltimer.cxx b/vcl/aqua/source/app/saltimer.cxx
index e0c406a6a589..cb3033e4e496 100644
--- a/vcl/aqua/source/app/saltimer.cxx
+++ b/vcl/aqua/source/app/saltimer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@ NSTimer* AquaSalTimer::pRunningTimer = nil;
bool AquaSalTimer::bDispatchTimer = false;
-void ImplSalStartTimer( sal_uLong nMS )
+void ImplSalStartTimer( 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( sal_uLong( [pEvent data1] ) );
+ ImplSalStartTimer( ULONG( [pEvent data1] ) );
}
}
@@ -123,7 +123,7 @@ AquaSalTimer::~AquaSalTimer()
ImplSalStopTimer();
}
-void AquaSalTimer::Start( sal_uLong nMS )
+void AquaSalTimer::Start( ULONG nMS )
{
ImplSalStartTimer( nMS );
}
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 455e7c64c6a4..4264f8802126 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -287,7 +287,7 @@
return AquaSalInstance::GetDynamicDockMenu();
}
--(BOOL)application: (NSApplication*)app openFile: (NSString*)pFile
+-(MacOSBOOL)application: (NSApplication*)app openFile: (NSString*)pFile
{
const rtl::OUString aFile( GetOUString( pFile ) );
if( ! AquaSalInstance::isOnCommandLine( aFile ) )
@@ -328,7 +328,7 @@
}
}
--(BOOL)application: (NSApplication*)app printFile: (NSString*)pFile
+-(MacOSBOOL)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:(BOOL)bShowPrintPanels
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)bShowPrintPanels
{
// currently ignores print settings an bShowPrintPanels
rtl::OUStringBuffer aFileList( 256 );
@@ -360,35 +360,70 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
- NSApplicationTerminateReply aReply = NSTerminateNow;
+ SalData* pSalData = GetSalData();
+ #if 1 // currently do some really bad hack
+ if( ! pSalData->maFrames.empty() )
{
- YIELD_GUARD;
-
- SalData* pSalData = GetSalData();
- if( ! pSalData->maFrames.empty() )
+ /* #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 ) )
{
- // the following QueryExit will likely present a message box, activate application
- [NSApp activateIgnoringOtherApps: YES];
- aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
+ 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;
}
-
- if( aReply == NSTerminateNow )
+ #if OSL_DEBUG_LEVEL > 1
+ for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
+ it != pSalData->maFrames.end(); ++it )
{
- 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
+ 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()
+ );
}
+ #endif
}
-
- return aReply;
+ #else // the clean version follows
+ return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
+ #endif
+ ImplImageTreeSingletonRef()->shutDown();
+ return NSTerminateNow;
}
-(void)systemColorsChanged: (NSNotification*) pNotification
{
- YIELD_GUARD;
-
const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() )
pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
@@ -396,8 +431,6 @@
-(void)screenParametersChanged: (NSNotification*) pNotification
{
- YIELD_GUARD;
-
SalData* pSalData = GetSalData();
std::list< AquaSalFrame* >::iterator it;
for( it = pSalData->maFrames.begin(); it != pSalData->maFrames.end(); ++it )
@@ -468,7 +501,7 @@
}
}
-- (BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL) bWinVisible
+- (MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL) 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 c660dbc0616d..1c9ae096efd4 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,21 +47,18 @@
#include <postmac.h>
using namespace ::com::sun::star::datatransfer;
+using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace cppu;
using namespace std;
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
-using ::rtl::OString;
-
namespace // private
{
const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0);
const Type CPPUTYPE_OUSTRING = getCppuType( (OUString*)0 );
- /* Determine whether or not a DataFlavor is valid.
+ /* Determine whether or not a DataFlavor is valid.
*/
bool isValidFlavor(const DataFlavor& aFlavor)
{
@@ -115,7 +112,7 @@ namespace // private
const char* FLAVOR_GDIMF = "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"";
const char* FLAVOR_WMF = "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
const char* FLAVOR_EMF = "application/x-openoffice-emf;windows_formatname=\"Image EMF\"";
-
+
const char* FLAVOR_DUMMY_INTERNAL = "application/x-openoffice-internal";
@@ -127,7 +124,7 @@ namespace // private
Type DataType;
};
- /* At the moment it appears as if only MS Office pastes "public.html" to the clipboard.
+ /* At the moment it appears as if only MS Office pastes "public.html" to the clipboard.
*/
FlavorMap flavorMap[] =
{
@@ -136,7 +133,7 @@ namespace // private
{ NSTIFFPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
{ NSPICTPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
{ NSHTMLPboardType, "text/html", "Plain Html", CPPUTYPE_SEQINT8 },
- { NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", CPPUTYPE_SEQINT8 },
+ { NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", CPPUTYPE_SEQINT8 },
{ PBTYPE_SESX, FLAVOR_SESX, "Star Embed Source (XML)", CPPUTYPE_SEQINT8 },
{ PBTYPE_SLSDX, FLAVOR_SLSDX, "Star Link Source Descriptor (XML)", CPPUTYPE_SEQINT8 },
{ PBTYPE_ESX, FLAVOR_ESX, "Star Embed Source (XML)", CPPUTYPE_SEQINT8 },
@@ -169,7 +166,7 @@ namespace // private
//###########################
-/* A base class for other data provider.
+/* A base class for other data provider.
*/
class DataProviderBaseImpl : public DataProvider
{
@@ -190,7 +187,7 @@ DataProviderBaseImpl::DataProviderBaseImpl(const Any& data) :
{
}
-DataProviderBaseImpl::DataProviderBaseImpl(id data) :
+DataProviderBaseImpl::DataProviderBaseImpl(id data) :
mSystemData(data)
{
[mSystemData retain];
@@ -211,7 +208,7 @@ class UniDataProvider : public DataProviderBaseImpl
{
public:
UniDataProvider(const Any& data);
-
+
UniDataProvider(NSData* data);
virtual NSData* getSystemData();
@@ -246,8 +243,8 @@ Any UniDataProvider::getOOoData()
if (mSystemData)
{
- oOOData = makeAny(OUString(reinterpret_cast<const sal_Char*>([mSystemData bytes]),
- [mSystemData length],
+ oOOData = makeAny(OUString(reinterpret_cast<const sal_Char*>([mSystemData bytes]),
+ [mSystemData length],
RTL_TEXTENCODING_UTF8));
}
else
@@ -288,7 +285,7 @@ NSData* ByteSequenceDataProvider::getSystemData()
Sequence<sal_Int8> rawData;
mData >>= rawData;
- return [NSData dataWithBytes: rawData.getArray() length: rawData.getLength()];
+ return [NSData dataWithBytes: rawData.getArray() length: rawData.getLength()];
}
Any ByteSequenceDataProvider::getOOoData()
@@ -307,7 +304,7 @@ Any ByteSequenceDataProvider::getOOoData()
{
oOOData = mData;
}
-
+
return oOOData;
}
@@ -366,14 +363,14 @@ Any HTMLFormatDataProvider::getOOoData()
plainHtml = HTMLFormatToTextHtml(unkHtmlData);
pPlainHtml = &plainHtml;
}
-
+
oOOData = makeAny(*pPlainHtml);
}
else
{
oOOData = mData;
}
-
+
return oOOData;
}
@@ -423,7 +420,7 @@ NSData* BMPDataProvider::getSystemData()
/* At the moment the OOo 'PCT' filter is not good enough to be used
and there is no flavor defined for exchanging 'PCT' with OOo so
we will at the moment convert 'PCT' to a Windows BMP and provide
- this to OOo
+ this to OOo
*/
Any BMPDataProvider::getOOoData()
{
@@ -437,7 +434,7 @@ Any BMPDataProvider::getOOoData()
memcpy(pictData.getArray(), [mSystemData bytes], flavorDataLength);
Sequence<sal_Int8> bmpData;
-
+
if (ImageToBMP(pictData, bmpData, meImageType))
{
oOOData = makeAny(bmpData);
@@ -447,7 +444,7 @@ Any BMPDataProvider::getOOoData()
{
oOOData = mData;
}
-
+
return oOOData;
}
@@ -496,7 +493,7 @@ Any FileListDataProvider::getOOoData()
Sequence<sal_Int8> oOOFileList(lenSeqRequired);
unichar* pBuffer = reinterpret_cast<unichar*>(oOOFileList.getArray());
rtl_zeroMemory(pBuffer, lenSeqRequired);
-
+
for (size_t i = 0; i < length; i++)
{
NSString* fname = [mSystemData objectAtIndex: i];
@@ -511,7 +508,7 @@ Any FileListDataProvider::getOOoData()
{
oOOData = mData;
}
-
+
return oOOData;
}
@@ -576,22 +573,14 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Refe
DataFlavor oOOFlavor = systemToOpenOfficeFlavor(systemFlavor);
Any data = rTransferable->getTransferData(oOOFlavor);
-
+
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));
}
@@ -691,7 +680,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno:
else
{
NSString* str = openOfficeToSystemFlavor(flavors[i]);
-
+
if (str != NULL)
{
[array addObject: str];
@@ -701,7 +690,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const com::sun::star::uno:
// #i89462# #i90747#
// in case no system flavor was found to report
- // report at least one so D&D between OOo targets works
+ // report at least one so D&D between OOo targets works
if( [array count] == 0 )
{
[array addObject: PBTYPE_DUMMY_INTERNAL];
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
index 51e29efed530..3d8cee3f39de 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,14 +42,14 @@
#include <boost/shared_ptr.hpp>
-/* An interface to get the clipboard data in either
+/* An interface to get the clipboard data in either
system or OOo format.
*/
class DataProvider
{
public:
virtual ~DataProvider() {};
-
+
/* Get the clipboard data in the system format.
The caller has to retain/release the returned
CFDataRef on demand.
@@ -76,8 +76,8 @@ public:
DataFlavorMapper();
- /* Map a system data flavor to an OpenOffice data flavor.
- Return an empty string if there is not suiteable
+ /* Map a system data flavor to an OpenOffice data flavor.
+ Return an empty string if there is not suiteable
mapping from a system data flavor to a OpenOffice data
flavor.
*/
@@ -99,11 +99,11 @@ public:
/* Get a data provider which is able to provide the data 'rTransferable' offers in a format that can
be put on to the system clipboard.
*/
- DataProviderPtr_t getDataProvider(NSString* systemFlavor,
+ DataProviderPtr_t getDataProvider(NSString* systemFlavor,
const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > rTransferable) const;
-
-
+
+
/* Get a data provider which is able to provide 'systemData' in the OOo expected format.
*/
DataProviderPtr_t getDataProvider(const NSString* systemFlavor, NSArray* systemData) const;
@@ -115,12 +115,12 @@ public:
/* Translate a sequence of DataFlavors into a NSArray of system types.
- Only those DataFlavors for which a suitable mapping to a system
+ Only those DataFlavors for which a suitable mapping to a system
type exist will be contained in the returned types array.
*/
NSArray* flavorSequenceToTypesArray(const com::sun::star::uno::Sequence<com::sun::star::datatransfer::DataFlavor>& flavors) const;
- /* Translate a NSArray of system types into a sequence of DataFlavors.
+ /* Translate a NSArray of system types into a sequence of DataFlavors.
Only those types for which a suitable mapping to a DataFlavor
exist will be contained in the new DataFlavor Sequence.
*/
@@ -141,6 +141,6 @@ private:
typedef boost::shared_ptr<DataFlavorMapper> DataFlavorMapperPtr_t;
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/dtrans/DragActionConversion.cxx b/vcl/aqua/source/dtrans/DragActionConversion.cxx
index 1e6880566c24..fbcc02c68dea 100644
--- a/vcl/aqua/source/dtrans/DragActionConversion.cxx
+++ b/vcl/aqua/source/dtrans/DragActionConversion.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,7 +33,7 @@
using namespace com::sun::star::datatransfer::dnd;
-/* Convert office drag actions as defined in
+/* Convert office drag actions as defined in
<type>com::sun::star::datatransfer::dnd::DNDConstants</type>
into system conform drag actions.
*/
@@ -41,12 +41,12 @@ unsigned int OfficeToSystemDragActions(sal_Int8 dragActions)
{
unsigned int actions = NSDragOperationNone;
- if (dragActions & DNDConstants::ACTION_COPY)
+ if (dragActions & DNDConstants::ACTION_COPY)
{
actions |= NSDragOperationCopy;
}
- if (dragActions & DNDConstants::ACTION_MOVE)
+ if (dragActions & DNDConstants::ACTION_MOVE)
{
actions |= NSDragOperationMove;
}
@@ -60,7 +60,7 @@ unsigned int OfficeToSystemDragActions(sal_Int8 dragActions)
}
/* Convert system conform drag actions into office conform
- drag actions as defined in
+ drag actions as defined in
<type>com::sun::star::datatransfer::dnd::DNDConstants</type>.
*/
sal_Int8 SystemToOfficeDragActions(unsigned int dragActions)
diff --git a/vcl/aqua/source/dtrans/DragActionConversion.hxx b/vcl/aqua/source/dtrans/DragActionConversion.hxx
index d4b12ae8dce8..13f36e815ef8 100644
--- a/vcl/aqua/source/dtrans/DragActionConversion.hxx
+++ b/vcl/aqua/source/dtrans/DragActionConversion.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,14 +34,14 @@
#include <postmac.h>
-/* Convert office drag actions as defined in
+/* Convert office drag actions as defined in
<type>com::sun::star::datatransfer::dnd::DNDConstants</type>
into system conform drag actions.
*/
unsigned int OfficeToSystemDragActions(sal_Int8 dragActions);
/* Convert system conform drag actions into office conform
- drag actions as defined in
+ drag actions as defined in
<type>com::sun::star::datatransfer::dnd::DNDConstants</type>.
*/
sal_Int8 SystemToOfficeDragActions(unsigned int dragActions);
diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx
index bef1e639caf9..1b5d651b0f8e 100644
--- a/vcl/aqua/source/dtrans/DragSource.cxx
+++ b/vcl/aqua/source/dtrans/DragSource.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,15 +39,14 @@
#include "DragSourceContext.hxx"
#include "aqua_clipboard.hxx"
#include "DragActionConversion.hxx"
-#include "salframe.h"
#include <rtl/ustring.h>
#include <memory>
+using namespace rtl;
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;
@@ -59,11 +58,10 @@ using namespace com::sun::star::lang;
using namespace comphelper;
using namespace std;
-using ::rtl::OUString;
// For OOo internal D&D we provide the Transferable without NSDragPboard
// interference as a shortcut
-uno::Reference<XTransferable> DragSource::g_XTransferable;
+Reference<XTransferable> DragSource::g_XTransferable = Reference<XTransferable>();
NSView* DragSource::g_DragSourceView = nil;
bool DragSource::g_DropSuccessSet = false;
bool DragSource::g_DropSuccess = false;
@@ -107,7 +105,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
}
--(unsigned int)draggingSourceOperationMaskForLocal: (BOOL)isLocal
+-(unsigned int)draggingSourceOperationMaskForLocal: (MacOSBOOL)isLocal
{
return mDragSource->getSupportedDragOperations(isLocal);
}
@@ -115,13 +113,13 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
-(void)draggedImage:(NSImage*)anImage beganAt:(NSPoint)aPoint
{
- DragSourceDragEvent dsde(static_cast<OWeakObject*>(mDragSource),
- new DragSourceContext(mDragSource),
- mDragSource,
- DNDConstants::ACTION_COPY,
+ DragSourceDragEvent dsde(static_cast<OWeakObject*>(mDragSource),
+ new DragSourceContext(mDragSource),
+ mDragSource,
+ DNDConstants::ACTION_COPY,
DNDConstants::ACTION_COPY);
- mDragSource->mXDragSrcListener->dragEnter(dsde);
+ mDragSource->mXDragSrcListener->dragEnter(dsde);
}
@@ -132,7 +130,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
bool bDropSuccess = operation != NSDragOperationNone;
if( DragSource::g_DropSuccessSet )
bDropSuccess = DragSource::g_DropSuccess;
-
+
DragSourceDropEvent dsde(static_cast<OWeakObject*>(mDragSource),
new DragSourceContext(mDragSource),
static_cast< XDragSource* >(mDragSource),
@@ -140,7 +138,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
bDropSuccess );
mDragSource->mXDragSrcListener->dragDropEnd(dsde);
- mDragSource->mXDragSrcListener = uno::Reference<XDragSourceListener>();
+ mDragSource->mXDragSrcListener = Reference<XDragSourceListener>();
}
@@ -161,7 +159,6 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
DragSource::DragSource():
WeakComponentImplHelper3<XDragSource, XInitialization, XServiceInfo>(m_aMutex),
mView(NULL),
- mpFrame(NULL),
mLastMouseEventBeforeStartDrag(nil),
m_MouseButton(0)
{
@@ -170,11 +167,10 @@ DragSource::DragSource():
DragSource::~DragSource()
{
- if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
- [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
- [mDragSourceHelper release];
+ [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
+ [mDragSourceHelper release];
}
-
+
void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments)
throw(Exception)
@@ -192,7 +188,7 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments)
/* All SalFrameView the base class for all VCL system views inherits from
NSView in order to get mouse and other events. This is the only way to
- get these events. In order to start a drag operation we need to provide
+ get these events. In order to start a drag operation we need to provide
the mouse event which was the trigger. SalFrameView therefor implements
a hook mechanism so that we can get mouse events for our purpose.
*/
@@ -202,14 +198,7 @@ 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];
if (mDragSourceHelper == nil)
@@ -244,22 +233,22 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
sal_Int8 sourceActions,
sal_Int32 cursor,
sal_Int32 image,
- const uno::Reference<XTransferable >& transferable,
- const uno::Reference<XDragSourceListener >& listener )
+ const Reference<XTransferable >& transferable,
+ const Reference<XDragSourceListener >& listener )
throw( RuntimeException)
{
MutexGuard guard(m_aMutex);
-
+
OSL_ASSERT(listener.is() && "DragSource::startDrag: No XDragSourceListener provided\n");
OSL_ASSERT(transferable.is() && "DragSource::startDrag: No transferable provided\n");
-
- trigger.Event >>= mMouseEvent;
- m_MouseButton= mMouseEvent.Buttons;
+
+ trigger.Event >>= mMouseEvent;
+ m_MouseButton= mMouseEvent.Buttons;
mXDragSrcListener = listener;
mXCurrentContext = static_cast<XDragSourceContext*>(new DragSourceContext(this));
auto_ptr<AquaClipboard> clipb(new AquaClipboard(NULL, false));
g_XTransferable = transferable;
- clipb->setContents(g_XTransferable, uno::Reference<XClipboardOwner>());
+ clipb->setContents(g_XTransferable, Reference<XClipboardOwner>());
mDragSourceActions = sourceActions;
g_DragSourceView = mView;
@@ -269,11 +258,11 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
NSImage* dragImage;
dragImage = [[NSImage alloc] initWithSize: sz];
-
+
NSRect bounds;
bounds.origin = NSMakePoint(0,0);
bounds.size = sz;
-
+
[dragImage lockFocus];
[[NSColor blackColor] set];
[NSBezierPath fillRect: bounds];
@@ -289,9 +278,9 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
g_DropSuccessSet = false;
g_DropSuccess = false;
- [mView dragImage: dragImage
- at: p
- offset: NSMakeSize(0,0)
+ [mView dragImage: dragImage
+ at: p
+ offset: NSMakeSize(0,0)
event: mLastMouseEventBeforeStartDrag
pasteboard: clipb->getPasteboard()
source: mDragSourceHelper
@@ -299,7 +288,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
[dragImage release];
- g_XTransferable = uno::Reference<XTransferable>();
+ g_XTransferable = Reference<XTransferable>();
g_DragSourceView = nil;
// reset drop success flags
@@ -310,7 +299,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
// In order to initiate a D&D operation we need to
// provide the triggering mouse event which we get
-// from the SalFrameView that is associated with
+// from the SalFrameView that is associated with
// this DragSource
void DragSource::saveMouseEvent(NSEvent* theEvent)
{
@@ -333,9 +322,9 @@ unsigned int DragSource::getSupportedDragOperations(bool isLocal) const
if (isLocal)
{
// Support NSDragOperation generic which means we can
- // decide which D&D operation to choose. We map
+ // decide which D&D operation to choose. We map
// NSDragOperationGenric to DNDConstants::ACTION_DEFAULT
- // in SystemToOfficeDragActions to signal this and
+ // in SystemToOfficeDragActions to signal this and
// use it in DropTarget::determineDropAction
srcActions |= NSDragOperationGeneric;
}
diff --git a/vcl/aqua/source/dtrans/DragSource.hxx b/vcl/aqua/source/dtrans/DragSource.hxx
index 943c84c5036e..dcdaac4cff63 100644
--- a/vcl/aqua/source/dtrans/DragSource.hxx
+++ b/vcl/aqua/source/dtrans/DragSource.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,9 +47,8 @@
class DragSource;
-class AquaSalFrame;
-/* The functions declared in this protocol are actually
+/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
to avoid importing VCL headers in UNO services and
on the other hand want to avoid warnings caused by
@@ -73,7 +72,7 @@ class AquaSalFrame;
-(void)mouseDown: (NSEvent*)theEvent;
-(void)mouseDragged: (NSEvent*)theEvent;
--(unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
+-(unsigned int)draggingSourceOperationMaskForLocal:(MacOSBOOL)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;
@@ -82,8 +81,8 @@ class AquaSalFrame;
class DragSource : public ::cppu::BaseMutex,
- public ::cppu::WeakComponentImplHelper3< com::sun::star::datatransfer::dnd::XDragSource,
- com::sun::star::lang::XInitialization,
+ public ::cppu::WeakComponentImplHelper3< com::sun::star::datatransfer::dnd::XDragSource,
+ com::sun::star::lang::XInitialization,
com::sun::star::lang::XServiceInfo >,
private ::boost::noncopyable
{
@@ -100,7 +99,7 @@ public:
virtual sal_Int32 SAL_CALL getDefaultCursor(sal_Int8 dragAction)
throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException);
-
+
virtual void SAL_CALL startDrag( const com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions,
sal_Int32 cursor,
@@ -122,7 +121,6 @@ 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;
@@ -131,7 +129,7 @@ public:
// The mouse button that set off the drag and drop operation
short m_MouseButton;
sal_Int8 mDragSourceActions;
-
+
static com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > g_XTransferable;
static NSView* g_DragSourceView;
static bool g_DropSuccessSet;
diff --git a/vcl/aqua/source/dtrans/DragSourceContext.cxx b/vcl/aqua/source/dtrans/DragSourceContext.cxx
index 4d18379e90af..c613c17b0bb8 100644
--- a/vcl/aqua/source/dtrans/DragSourceContext.cxx
+++ b/vcl/aqua/source/dtrans/DragSourceContext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/dtrans/DragSourceContext.hxx b/vcl/aqua/source/dtrans/DragSourceContext.hxx
index 276567af3f99..b8d357e41baf 100644
--- a/vcl/aqua/source/dtrans/DragSourceContext.hxx
+++ b/vcl/aqua/source/dtrans/DragSourceContext.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,16 +52,16 @@ public:
DragSourceContext(DragSource* pSource);
~DragSourceContext();
- virtual sal_Int32 SAL_CALL getCurrentCursor( )
+ virtual sal_Int32 SAL_CALL getCurrentCursor( )
throw( com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setCursor( sal_Int32 cursorId )
+ virtual void SAL_CALL setCursor( sal_Int32 cursorId )
throw( com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setImage( sal_Int32 imageId )
+ virtual void SAL_CALL setImage( sal_Int32 imageId )
throw( com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL transferablesFlavorsChanged( )
+ virtual void SAL_CALL transferablesFlavorsChanged( )
throw( com::sun::star::uno::RuntimeException);
private:
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx
index e0318b405163..5404dc1186b4 100644
--- a/vcl/aqua/source/dtrans/DropTarget.cxx
+++ b/vcl/aqua/source/dtrans/DropTarget.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,9 +49,8 @@
#include <Carbon/Carbon.h>
#include <postmac.h>
-#include <salframe.h>
-#include <salframeview.h>
+using namespace rtl;
using namespace cppu;
using namespace osl;
using namespace com::sun::star::datatransfer;
@@ -60,11 +59,8 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
-using namespace com::sun::star;
using namespace comphelper;
-using ::rtl::OUString;
-
OUString dropTarget_getImplementationName()
{
return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"));
@@ -102,7 +98,7 @@ namespace /* private */
{
self = [super init];
- if (self)
+ if (self)
{
mDropTarget = pdt;
}
@@ -129,13 +125,13 @@ namespace /* private */
}
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->prepareForDragOperation(sender);
}
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->performDragOperation(sender);
}
@@ -152,8 +148,6 @@ namespace /* private */
DropTarget::DropTarget() :
WeakComponentImplHelper5<XInitialization, XDropTarget, XDropTargetDragContext, XDropTargetDropContext, XServiceInfo>(m_aMutex),
- mView(nil),
- mpFrame(NULL),
mDropTargetHelper(nil),
mbActive(false),
mDragSourceSupportedActions(DNDConstants::ACTION_NONE),
@@ -166,9 +160,8 @@ DropTarget::DropTarget() :
DropTarget::~DropTarget()
{
- if( AquaSalFrame::isAlive( mpFrame ) )
- [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
- [mDropTargetHelper release];
+ [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper];
+ [mDropTargetHelper release];
}
@@ -176,8 +169,8 @@ sal_Int8 DropTarget::determineDropAction(sal_Int8 dropActions, id sender) const
{
sal_Int8 dropAct = dropActions;
bool srcAndDestEqual = false;
-
- if ([sender draggingSource] != nil)
+
+ if ([sender draggingSource] != nil)
{
// Internal DnD
NSView* destView = [[sender draggingDestinationWindow] contentView];
@@ -185,8 +178,8 @@ sal_Int8 DropTarget::determineDropAction(sal_Int8 dropActions, id sender) const
}
// If ACTION_DEFAULT is set this means NSDragOperationGeneric
- // has been set and we map this to ACTION_MOVE or ACTION_COPY
- // depending on whether or not source and dest are equal,
+ // has been set and we map this to ACTION_MOVE or ACTION_COPY
+ // depending on whether or not source and dest are equal,
// this hopefully satisfies all parties
if( (dropActions == DNDConstants::ACTION_DEFAULT)
|| ((dropActions == mDragSourceSupportedActions)
@@ -195,8 +188,8 @@ sal_Int8 DropTarget::determineDropAction(sal_Int8 dropActions, id sender) const
dropAct = srcAndDestEqual ? DNDConstants::ACTION_MOVE :
DNDConstants::ACTION_COPY;
}
- // if more than one drop actions have been specified
- // set ACTION_DEFAULT in order to let the drop target
+ // if more than one drop actions have been specified
+ // set ACTION_DEFAULT in order to let the drop target
// decide which one to use
else if (dropActions != DNDConstants::ACTION_NONE &&
dropActions != DNDConstants::ACTION_MOVE &&
@@ -214,7 +207,7 @@ sal_Int8 DropTarget::determineDropAction(sal_Int8 dropActions, id sender) const
else if (dropActions & DNDConstants::ACTION_MOVE)
dropAct = DNDConstants::ACTION_MOVE;
else if (dropActions & DNDConstants::ACTION_LINK)
- dropAct = DNDConstants::ACTION_LINK;
+ dropAct = DNDConstants::ACTION_LINK;
}
dropAct |= DNDConstants::ACTION_DEFAULT;
@@ -227,56 +220,56 @@ sal_Int8 DropTarget::determineDropAction(sal_Int8 dropActions, id sender) const
NSDragOperation DropTarget::draggingEntered(id sender)
{
// Initially when DnD will be started no modifier key can be pressed yet
- // thus we are getting all actions that the drag source supports, we save
+ // thus we are getting all actions that the drag source supports, we save
// this value because later the system masks the drag source actions if
// a modifier key will be pressed
mDragSourceSupportedActions = SystemToOfficeDragActions([sender draggingSourceOperationMask]);
-
+
// Only if the drop target is really interessted in the drag actions
// supported by the source
if (mDragSourceSupportedActions & mDefaultActions)
{
- sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender);
+ sal_Int8 currentAction = determineDropAction(mDragSourceSupportedActions, sender);
NSRect bounds = [mView bounds];
NSPoint dragLocation = [sender draggedImageLocation];
-
+
CocoaToVCL(dragLocation, bounds);
-
+
sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
NSPasteboard* dragPboard = [sender draggingPasteboard];
mXCurrentDragClipboard = new AquaClipboard(dragPboard, false);
-
- uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
+
+ Reference<XTransferable> xTransferable = DragSource::g_XTransferable.is() ?
DragSource::g_XTransferable : mXCurrentDragClipboard->getContents();
- DropTargetDragEnterEvent dtdee(static_cast<OWeakObject*>(this),
- 0,
- this,
- currentAction,
- posX,
- posY,
- mDragSourceSupportedActions,
+ DropTargetDragEnterEvent dtdee(static_cast<OWeakObject*>(this),
+ 0,
+ this,
+ currentAction,
+ posX,
+ posY,
+ mDragSourceSupportedActions,
xTransferable->getTransferDataFlavors());
- fire_dragEnter(dtdee);
+ fire_dragEnter(dtdee);
}
- return OfficeToSystemDragActions(mSelectedDropAction);
+ return OfficeToSystemDragActions(mSelectedDropAction);
}
NSDragOperation DropTarget::draggingUpdated(id sender)
{
- sal_Int8 currentDragSourceActions =
+ sal_Int8 currentDragSourceActions =
SystemToOfficeDragActions([sender draggingSourceOperationMask]);
NSDragOperation dragOp = NSDragOperationNone;
if (currentDragSourceActions & mDefaultActions)
{
- sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender);
+ sal_Int8 currentAction = determineDropAction(currentDragSourceActions, sender);
NSRect bounds = [mView bounds];
NSPoint dragLocation = [sender draggedImageLocation];
@@ -285,24 +278,24 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
sal_Int32 posY = static_cast<sal_Int32>(dragLocation.y);
- DropTargetDragEvent dtde(static_cast<OWeakObject*>(this),
- 0,
- this,
+ DropTargetDragEvent dtde(static_cast<OWeakObject*>(this),
+ 0,
+ this,
currentAction,
posX,
- posY,
+ posY,
mDragSourceSupportedActions);
fire_dragOver(dtde);
- // drag over callbacks likely have rendered something
+ // drag over callbacks likely have rendered something
[mView setNeedsDisplay: TRUE];
-
+
dragOp = OfficeToSystemDragActions(mSelectedDropAction);
//NSLog(@"Drag update: Source actions: %x proposed action %x selected action %x", mDragSourceSupportedActions, currentAction, mSelectedDropAction);
}
-
+
// Weird but it appears as if there is no method in Cocoa
// to create a kThemeCopyArrowCursor hence we have to use
// Carbon to do it
@@ -310,7 +303,7 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
SetThemeCursor(kThemeNotAllowedCursor);
else if (dragOp == NSDragOperationCopy)
SetThemeCursor(kThemeCopyArrowCursor);
- else
+ else
SetThemeCursor(kThemeArrowCursor);
return dragOp;
@@ -327,25 +320,25 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
}
- BOOL DropTarget::prepareForDragOperation(id sender)
+ MacOSBOOL DropTarget::prepareForDragOperation(id sender)
{
return 1;
}
-BOOL DropTarget::performDragOperation(id sender)
+MacOSBOOL DropTarget::performDragOperation(id sender)
{
bool bSuccess = false;
if (mSelectedDropAction != DNDConstants::ACTION_NONE)
{
- uno::Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
+ Reference<XTransferable> xTransferable = DragSource::g_XTransferable;
- if (!DragSource::g_XTransferable.is())
+ if (!DragSource::g_XTransferable.is())
{
xTransferable = mXCurrentDragClipboard->getContents();
}
-
+
NSRect bounds = [mView bounds];
NSPoint dragLocation = [sender draggedImageLocation];
@@ -359,10 +352,10 @@ BOOL DropTarget::performDragOperation(id sender)
this,
mSelectedDropAction,
posX,
- posY,
+ posY,
mDragSourceSupportedActions,
xTransferable);
-
+
fire_drop(dtde);
bSuccess = true;
@@ -376,7 +369,7 @@ BOOL DropTarget::performDragOperation(id sender)
{
mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE;
- mXCurrentDragClipboard = uno::Reference<XClipboard>();
+ mXCurrentDragClipboard = Reference<XClipboard>();
SetThemeCursor(kThemeArrowCursor);
}
@@ -402,13 +395,12 @@ BOOL DropTarget::performDragOperation(id sender)
sal_uInt64 tmp = 0;
pNSView >>= tmp;
mView = (id)tmp;
- mpFrame = [(SalFrameView*)mView getSalFrame];
mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this];
-
+
[(id <DraggingDestinationHandler>)mView registerDraggingDestinationHandler:mDropTargetHelper];
[mView registerForDraggedTypes: mDataFlavorMapper->getAllSupportedPboardTypes()];
-
+
id wnd = [mView window];
NSWindow* parentWnd = [wnd parentWindow];
unsigned int topWndStyle = (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask);
@@ -422,14 +414,14 @@ BOOL DropTarget::performDragOperation(id sender)
}
- void SAL_CALL DropTarget::addDropTargetListener(const uno::Reference<XDropTargetListener>& dtl)
+ void SAL_CALL DropTarget::addDropTargetListener(const Reference<XDropTargetListener>& dtl)
throw(RuntimeException)
{
rBHelper.addListener(::getCppuType(&dtl), dtl);
}
- void SAL_CALL DropTarget::removeDropTargetListener(const uno::Reference<XDropTargetListener>& dtl)
+ void SAL_CALL DropTarget::removeDropTargetListener(const Reference<XDropTargetListener>& dtl)
throw(RuntimeException)
{
rBHelper.removeListener(::getCppuType(&dtl), dtl);
@@ -491,9 +483,9 @@ BOOL DropTarget::performDragOperation(id sender)
void SAL_CALL DropTarget::dropComplete(sal_Bool success) throw (RuntimeException)
{
- // Reset the internal transferable used as shortcut in case this is
+ // Reset the internal transferable used as shortcut in case this is
// an internal D&D operation
- DragSource::g_XTransferable = uno::Reference<XTransferable>();
+ DragSource::g_XTransferable = Reference<XTransferable>();
DragSource::g_DropSuccessSet = true;
DragSource::g_DropSuccess = success;
}
@@ -501,13 +493,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_drop( const DropTargetDropEvent& dte)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->drop( dte); }
catch(RuntimeException&) {}
@@ -518,13 +510,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragEnter(const DropTargetDragEnterEvent& e)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dragEnter( e); }
catch (RuntimeException&) {}
@@ -535,15 +527,15 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragExit(const DropTargetEvent& dte)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
-
+ Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+
try { listener->dragExit( dte); }
catch (RuntimeException&) {}
}
@@ -553,13 +545,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dragOver(const DropTargetDragEvent& dtde)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer );
while( iter.hasMoreElements())
{
- uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dragOver( dtde); }
catch (RuntimeException&) {}
@@ -570,13 +562,13 @@ BOOL DropTarget::performDragOperation(id sender)
void DropTarget::fire_dropActionChanged(const DropTargetDragEvent& dtde)
{
- OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (uno::Reference<XDropTargetListener>* )0 ) );
+ OInterfaceContainerHelper* pContainer= rBHelper.getContainer( getCppuType( (Reference<XDropTargetListener>* )0 ) );
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
while( iter.hasMoreElements())
{
- uno::Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
+ Reference<XDropTargetListener> listener( static_cast<XDropTargetListener*>( iter.next()));
try { listener->dropActionChanged( dtde); }
catch (RuntimeException&) {}
@@ -589,7 +581,7 @@ BOOL DropTarget::performDragOperation(id sender)
OUString SAL_CALL DropTarget::getImplementationName() throw (RuntimeException)
{
- return dropTarget_getImplementationName();
+ return dropTarget_getImplementationName();
}
diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx
index 2ec1674a13df..d0fc443017ba 100644
--- a/vcl/aqua/source/dtrans/DropTarget.hxx
+++ b/vcl/aqua/source/dtrans/DropTarget.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,9 +50,8 @@
#include <postmac.h>
class DropTarget;
-class AquaSalFrame;
-/* The functions declared in this protocol are actually
+/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
to avoid importing VCL headers in UNO services and
on the other hand want to avoid warnings caused by
@@ -76,16 +75,16 @@ class AquaSalFrame;
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
@end
class DropTarget: public cppu::BaseMutex,
- public cppu::WeakComponentImplHelper5< com::sun::star::lang::XInitialization,
- com::sun::star::datatransfer::dnd::XDropTarget,
+ public cppu::WeakComponentImplHelper5< com::sun::star::lang::XInitialization,
+ com::sun::star::datatransfer::dnd::XDropTarget,
com::sun::star::datatransfer::dnd::XDropTargetDragContext,
com::sun::star::datatransfer::dnd::XDropTargetDropContext,
com::sun::star::lang::XServiceInfo >,
@@ -121,7 +120,7 @@ public:
virtual void SAL_CALL acceptDrag(sal_Int8 dragOperation) throw(com::sun::star::uno::RuntimeException);
virtual void SAL_CALL rejectDrag() throw(com::sun::star::uno::RuntimeException);
- // XDropTargetDragContext
+ // XDropTargetDragContext
virtual void SAL_CALL acceptDrop(sal_Int8 dropOperation) throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL rejectDrop() throw (com::sun::star::uno::RuntimeException);
virtual void SAL_CALL dropComplete(sal_Bool success) throw (com::sun::star::uno::RuntimeException);
@@ -135,8 +134,8 @@ public:
virtual NSDragOperation draggingEntered(id sender);
virtual NSDragOperation draggingUpdated(id sender);
virtual void draggingExited(id sender);
- virtual BOOL prepareForDragOperation(id sender);
- virtual BOOL performDragOperation(id sender);
+ virtual MacOSBOOL prepareForDragOperation(id sender);
+ virtual MacOSBOOL performDragOperation(id sender);
virtual void concludeDragOperation(id sender);
/* If multiple actions are supported by the drag source and
@@ -159,7 +158,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboard > mXCurrentDragClipboard;
DataFlavorMapperPtr_t mDataFlavorMapper;
id mView;
- AquaSalFrame* mpFrame;
DropTargetHelper* mDropTargetHelper;
bool mbActive;
sal_Int8 mDragSourceSupportedActions;
diff --git a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
index 0bd461d81096..9f5bf7483616 100644
--- a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
+++ b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
@@ -17,23 +17,23 @@ using namespace com::sun::star::uno;
// well known under MS Windows
// the MS HTML Format has a header before the real html data
//
-// Version:1.0 Version number of the clipboard. Staring is 0.9
-// StartHTML: Byte count from the beginning of the clipboard to the start
-// of the context, or -1 if no context
-// EndHTML: Byte count from the beginning of the clipboard to the end
-// of the context, or -1 if no context
-// StartFragment: Byte count from the beginning of the clipboard to the
-// start of the fragment
-// EndFragment: Byte count from the beginning of the clipboard to the
-// end of the fragment
-// StartSelection: Byte count from the beginning of the clipboard to the
-// start of the selection
-// EndSelection: Byte count from the beginning of the clipboard to the
-// end of the selection
+// Version:1.0 Version number of the clipboard. Staring is 0.9
+// StartHTML: Byte count from the beginning of the clipboard to the start
+// of the context, or -1 if no context
+// EndHTML: Byte count from the beginning of the clipboard to the end
+// of the context, or -1 if no context
+// StartFragment: Byte count from the beginning of the clipboard to the
+// start of the fragment
+// EndFragment: Byte count from the beginning of the clipboard to the
+// end of the fragment
+// StartSelection: Byte count from the beginning of the clipboard to the
+// start of the selection
+// EndSelection: Byte count from the beginning of the clipboard to the
+// end of the selection
//
// StartSelection and EndSelection are optional
// The fragment should be preceded and followed by the HTML comments
-// <!--StartFragment--> and <!--EndFragment--> (no space between !-- and the
+// <!--StartFragment--> and <!--EndFragment--> (no space between !-- and the
// text
//------------------------------------------------------------------------------
@@ -66,37 +66,37 @@ const std::string TAG_END_BODY = std::string("</BODY");
Sequence<sal_Int8> SAL_CALL TextHtmlToHTMLFormat(Sequence<sal_Int8>& aTextHtml)
{
OSL_ASSERT(aTextHtml.getLength() > 0);
-
+
if (!(aTextHtml.getLength() > 0))
return Sequence<sal_Int8>();
-
+
// fill the buffer with dummy values to calc the exact length
- std::string dummyHtmlHeader = GetHtmlFormatHeader(0, 0, 0, 0);
+ std::string dummyHtmlHeader = GetHtmlFormatHeader(0, 0, 0, 0);
size_t lHtmlFormatHeader = dummyHtmlHeader.length();
-
+
std::string textHtml(
- reinterpret_cast<const sal_Char*>(aTextHtml.getConstArray()),
+ reinterpret_cast<const sal_Char*>(aTextHtml.getConstArray()),
reinterpret_cast<const sal_Char*>(aTextHtml.getConstArray()) + aTextHtml.getLength());
-
+
std::string::size_type nStartHtml = textHtml.find(TAG_HTML) + lHtmlFormatHeader - 1; // we start one before '<HTML>' Word 2000 does also so
std::string::size_type nEndHtml = textHtml.find(TAG_END_HTML) + lHtmlFormatHeader + TAG_END_HTML.length() + 1; // our SOffice 5.2 wants 2 behind </HTML>?
-
+
// The body tag may have parameters so we need to search for the
// closing '>' manually e.g. <BODY param> #92840#
- std::string::size_type nStartFragment = textHtml.find(">", textHtml.find(TAG_BODY)) + lHtmlFormatHeader + 1;
+ std::string::size_type nStartFragment = textHtml.find(">", textHtml.find(TAG_BODY)) + lHtmlFormatHeader + 1;
std::string::size_type nEndFragment = textHtml.find(TAG_END_BODY) + lHtmlFormatHeader;
- std::string htmlFormat = GetHtmlFormatHeader(nStartHtml, nEndHtml, nStartFragment, nEndFragment);
+ std::string htmlFormat = GetHtmlFormatHeader(nStartHtml, nEndHtml, nStartFragment, nEndFragment);
htmlFormat += textHtml;
-
+
Sequence<sal_Int8> byteSequence(htmlFormat.length() + 1); // space the trailing '\0'
- rtl_zeroMemory(byteSequence.getArray(), byteSequence.getLength());
-
+ rtl_zeroMemory(byteSequence.getArray(), byteSequence.getLength());
+
rtl_copyMemory(
static_cast<void*>(byteSequence.getArray()),
static_cast<const void*>(htmlFormat.c_str()),
htmlFormat.length());
-
+
return byteSequence;
}
@@ -113,7 +113,7 @@ Sequence<sal_Int8> HTMLFormatToTextHtml(const Sequence<sal_Int8>& aHTMLFormat)
BOOST_ASSERT(htmlStartTag && "Seems to be no HTML at all");
- // It doesn't seem to be HTML? Well then simply return what has been
+ // It doesn't seem to be HTML? Well then simply return what has been
// provided in non-debug builds
if (htmlStartTag == NULL)
{
@@ -131,7 +131,7 @@ Sequence<sal_Int8> HTMLFormatToTextHtml(const Sequence<sal_Int8>& aHTMLFormat)
/* A simple format detection. We are just comparing the first few bytes
of the provided byte sequence to see whether or not it is the MS
Office Html format. If it shows that this is not reliable enough we
- can improve this
+ can improve this
*/
const char HtmlFormatStart[] = "Version:";
int HtmlFormatStartLen = (sizeof(HtmlFormatStart) - 1);
@@ -141,9 +141,9 @@ bool isHTMLFormat(const Sequence<sal_Int8>& aHtmlSequence)
if (aHtmlSequence.getLength() < HtmlFormatStartLen)
return false;
- return rtl_str_compareIgnoreAsciiCase_WithLength(HtmlFormatStart,
- HtmlFormatStartLen,
- reinterpret_cast<const sal_Char*>(aHtmlSequence.getConstArray()),
+ return rtl_str_compareIgnoreAsciiCase_WithLength(HtmlFormatStart,
+ HtmlFormatStartLen,
+ reinterpret_cast<const sal_Char*>(aHtmlSequence.getConstArray()),
HtmlFormatStartLen) == 0;
}
diff --git a/vcl/aqua/source/dtrans/HtmlFmtFlt.hxx b/vcl/aqua/source/dtrans/HtmlFmtFlt.hxx
index bbf2fc5164eb..cfcaaab558ec 100644
--- a/vcl/aqua/source/dtrans/HtmlFmtFlt.hxx
+++ b/vcl/aqua/source/dtrans/HtmlFmtFlt.hxx
@@ -4,7 +4,7 @@
#include <com/sun/star/uno/Sequence.hxx>
-/* Transform plain HTML into the format expected by MS Office.
+/* Transform plain HTML into the format expected by MS Office.
*/
com::sun::star::uno::Sequence<sal_Int8> TextHtmlToHTMLFormat(com::sun::star::uno::Sequence<sal_Int8>& aTextHtml);
diff --git a/vcl/aqua/source/dtrans/OSXTransferable.cxx b/vcl/aqua/source/dtrans/OSXTransferable.cxx
index 040c452ec6c8..a65a66f4b2c2 100644
--- a/vcl/aqua/source/dtrans/OSXTransferable.cxx
+++ b/vcl/aqua/source/dtrans/OSXTransferable.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,6 +34,7 @@
#include "DataFlavorMapping.hxx"
+using namespace rtl;
using namespace std;
using namespace osl;
using namespace cppu;
@@ -43,12 +44,10 @@ using namespace com::sun::star::io;
using namespace com::sun::star::lang;
using namespace com::sun::star::container;
-using ::rtl::OUString;
-
const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0);
const Type CPPUTYPE_OUSTRING = getCppuType((OUString*)0);
-namespace // private
+namespace // private
{
bool isValidFlavor( const DataFlavor& aFlavor )
{
@@ -61,12 +60,12 @@ namespace // private
OSXTransferable::OSXTransferable(const Reference<XMimeContentTypeFactory> rXMimeCntFactory,
- DataFlavorMapperPtr_t pDataFlavorMapper,
+ DataFlavorMapperPtr_t pDataFlavorMapper,
NSPasteboard* pasteboard) :
mrXMimeCntFactory(rXMimeCntFactory),
mDataFlavorMapper(pDataFlavorMapper),
mPasteboard(pasteboard)
-{
+{
[mPasteboard retain];
initClipboardItemList();
@@ -79,7 +78,7 @@ OSXTransferable::~OSXTransferable()
}
-Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor )
+Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor )
throw( UnsupportedFlavorException, IOException, RuntimeException )
{
if (!isValidFlavor(aFlavor) || !isDataFlavorSupported(aFlavor))
@@ -88,7 +87,7 @@ Any SAL_CALL OSXTransferable::getTransferData( const DataFlavor& aFlavor )
static_cast<XTransferable*>(this));
}
- NSString* sysFormat =
+ NSString* sysFormat =
(aFlavor.MimeType.compareToAscii( "image/bmp", 9 ) == 0)
? mDataFlavorMapper->openOfficeImageToSystemFlavor( mPasteboard )
: mDataFlavorMapper->openOfficeToSystemFlavor(aFlavor);
@@ -121,14 +120,14 @@ bool OSXTransferable::isUnicodeText(const DataFlavor& flavor)
}
-Sequence< DataFlavor > SAL_CALL OSXTransferable::getTransferDataFlavors( )
+Sequence< DataFlavor > SAL_CALL OSXTransferable::getTransferDataFlavors( )
throw( RuntimeException )
-{
+{
return mFlavorList;
}
-sal_Bool SAL_CALL OSXTransferable::isDataFlavorSupported(const DataFlavor& aFlavor)
+sal_Bool SAL_CALL OSXTransferable::isDataFlavorSupported(const DataFlavor& aFlavor)
throw( RuntimeException )
{
for (sal_Int32 i = 0; i < mFlavorList.getLength(); i++)
@@ -142,13 +141,13 @@ sal_Bool SAL_CALL OSXTransferable::isDataFlavorSupported(const DataFlavor& aFlav
void OSXTransferable::initClipboardItemList()
{
NSArray* pboardFormats = [mPasteboard types];
-
+
if (pboardFormats == NULL)
{
- throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot get clipboard data")),
+ throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot get clipboard data")),
static_cast<XTransferable*>(this));
}
-
+
mFlavorList = mDataFlavorMapper->typesArrayToFlavorSequence(pboardFormats);
}
@@ -172,7 +171,7 @@ bool OSXTransferable::compareDataFlavors(const DataFlavor& lhs, const DataFlavor
}
catch( IllegalArgumentException& )
{
- OSL_FAIL( "Invalid content type detected" );
+ OSL_ENSURE( sal_False, "Invalid content type detected" );
return false;
}
@@ -180,7 +179,7 @@ bool OSXTransferable::compareDataFlavors(const DataFlavor& lhs, const DataFlavor
}
-bool OSXTransferable::cmpAllContentTypeParameter(const Reference<XMimeContentType> xLhs,
+bool OSXTransferable::cmpAllContentTypeParameter(const Reference<XMimeContentType> xLhs,
const Reference<XMimeContentType> xRhs) const
{
Sequence<OUString> xLhsFlavors = xLhs->getParameters();
@@ -191,12 +190,12 @@ bool OSXTransferable::cmpAllContentTypeParameter(const Reference<XMimeContentTyp
return false;
try
- {
+ {
OUString pLhs;
OUString pRhs;
for (sal_Int32 i = 0; i < xLhsFlavors.getLength(); i++)
- {
+ {
pLhs = xLhs->getParameterValue(xLhsFlavors[i]);
pRhs = xRhs->getParameterValue(xLhsFlavors[i]);
diff --git a/vcl/aqua/source/dtrans/OSXTransferable.hxx b/vcl/aqua/source/dtrans/OSXTransferable.hxx
index 82e8fea57e20..531a1005d8c9 100644
--- a/vcl/aqua/source/dtrans/OSXTransferable.hxx
+++ b/vcl/aqua/source/dtrans/OSXTransferable.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -58,7 +58,7 @@ public:
explicit OSXTransferable(com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XMimeContentTypeFactory> rXMimeCntFactory,
DataFlavorMapperPtr_t pDataFlavorMapper,
- NSPasteboard* pasteboard);
+ NSPasteboard* pasteboard);
virtual ~OSXTransferable();
@@ -66,13 +66,13 @@ public:
// XTransferable
//------------------------------------------------------------------------
- virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
throw( ::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
throw( ::com::sun::star::uno::RuntimeException );
-
- virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
+
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
throw( ::com::sun::star::uno::RuntimeException );
//------------------------------------------------------------------------
@@ -88,11 +88,11 @@ public:
bool compareDataFlavors( const com::sun::star::datatransfer::DataFlavor& lhs,
const com::sun::star::datatransfer::DataFlavor& rhs );
- bool cmpAllContentTypeParameter( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType > xLhs,
+ bool cmpAllContentTypeParameter( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType > xLhs,
const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType > xRhs ) const;
private:
- com::sun::star::uno::Sequence< com::sun::star::datatransfer::DataFlavor > mFlavorList;
+ com::sun::star::uno::Sequence< com::sun::star::datatransfer::DataFlavor > mFlavorList;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XMimeContentTypeFactory> mrXMimeCntFactory;
DataFlavorMapperPtr_t mDataFlavorMapper;
NSPasteboard* mPasteboard;
diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
index 3eb4fb8d49fc..07da1fe77f99 100644
--- a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
+++ b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
@@ -2,11 +2,14 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: OSXTransferable.hxx,v $
+ * $Revision: 1.4 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -26,14 +29,14 @@
*
************************************************************************/
-/* This is a work-around to prevent 'deprecated' warning for 'KillPicture' API
+/* This is a work-around to prevent 'deprecated' warning for 'KillPicture' API
Hopefully we can get rid of this whole code again when the OOo PICT filter
are good enough to be used see #i78953 thus this hack would vanish to again.
*/
#include <premac.h>
#include <AvailabilityMacros.h>
#undef DEPRECATED_ATTRIBUTE
-#define DEPRECATED_ATTRIBUTE
+#define DEPRECATED_ATTRIBUTE
#include <Carbon/Carbon.h>
#include <QuickTime/QuickTime.h>
@@ -41,10 +44,10 @@
#include "PictToBmpFlt.hxx"
-bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
+bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
com::sun::star::uno::Sequence<sal_Int8>& aBmp)
{
-
+
bool result = false;
ComponentInstance bmpExporter;
@@ -62,7 +65,7 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
}
Handle hBmp;
- if ((GraphicsExportSetInputPicture(bmpExporter, (PicHandle)hPict) != noErr) ||
+ if ((GraphicsExportSetInputPicture(bmpExporter, (PicHandle)hPict) != noErr) ||
((hBmp = NewHandleClear(0)) == NULL))
{
CloseComponent(bmpExporter);
@@ -81,7 +84,7 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
HUnlock(hBmp);
result = true;
- }
+ }
DisposeHandle(hPict);
DisposeHandle(hBmp);
@@ -90,14 +93,14 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
return result;
}
-bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
com::sun::star::uno::Sequence<sal_Int8>& aPict)
{
bool result = false;
Handle hBmp;
ComponentInstance pictExporter;
- if ((PtrToHand(aBmp.getArray(), &hBmp, aBmp.getLength()) != noErr))
+ if ((PtrToHand(aBmp.getArray(), &hBmp, aBmp.getLength()) != noErr))
{
return result;
}
@@ -109,7 +112,7 @@ bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
DisposeHandle(hBmp);
return result;
}
-
+
if (GraphicsImportSetDataHandle(pictExporter, hBmp) != noErr)
{
DisposeHandle(hBmp);
@@ -128,28 +131,28 @@ bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
HUnlock((Handle)hPict);
// Release the data associated with the picture
- // Note: This function is deprecated in Mac OS X
+ // Note: This function is deprecated in Mac OS X
// 10.4.
- KillPicture(hPict);
+ KillPicture(hPict);
result = true;
}
-
+
DisposeHandle(hBmp);
CloseComponent(pictExporter);
-
+
return result;
}
-bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
+bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
com::sun::star::uno::Sequence<sal_Int8>& aBmp,
NSBitmapImageFileType eInFormat)
{
if( eInFormat == PICTImageFileType )
return PICTtoBMP( aPict, aBmp );
-
+
bool bResult = false;
-
+
NSData* pData = [NSData dataWithBytesNoCopy: (void*)aPict.getConstArray() length: aPict.getLength() freeWhenDone: 0];
if( pData )
{
@@ -165,20 +168,20 @@ bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
}
}
}
-
+
return bResult;
}
-bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
com::sun::star::uno::Sequence<sal_Int8>& aPict,
NSBitmapImageFileType eOutFormat
)
{
if( eOutFormat == PICTImageFileType )
return BMPtoPICT( aBmp, aPict );
-
+
bool bResult = false;
-
+
NSData* pData = [NSData dataWithBytesNoCopy: const_cast<sal_Int8*>(aBmp.getConstArray()) length: aBmp.getLength() freeWhenDone: 0];
if( pData )
{
@@ -194,7 +197,7 @@ bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
}
}
}
-
+
return bResult;
}
diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.hxx b/vcl/aqua/source/dtrans/PictToBmpFlt.hxx
index cdd0c41d5f4b..4673c4d73798 100644
--- a/vcl/aqua/source/dtrans/PictToBmpFlt.hxx
+++ b/vcl/aqua/source/dtrans/PictToBmpFlt.hxx
@@ -10,10 +10,10 @@
/* Transform PICT into the a Window BMP.
- Returns true if the conversion was successful false
+ Returns true if the conversion was successful false
otherwise.
*/
-bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
+bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
com::sun::star::uno::Sequence<sal_Int8>& aBmp);
/* Transform a Windows BMP to a PICT.
@@ -21,16 +21,16 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict,
Returns true if the conversion was successful false
otherwise.
*/
-bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp,
com::sun::star::uno::Sequence<sal_Int8>& aPict);
#define PICTImageFileType ((NSBitmapImageFileType)~0)
-bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
+bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
com::sun::star::uno::Sequence<sal_Int8>& aBmp,
NSBitmapImageFileType eInFormat);
-bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
com::sun::star::uno::Sequence<sal_Int8>& aPict,
NSBitmapImageFileType eOutFormat
);
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
index 82440811a7fb..4a95fc7a8734 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,20 +45,20 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
using namespace cppu;
using namespace osl;
+using namespace rtl;
using namespace std;
using namespace comphelper;
-using ::rtl::OUString;
@implementation EventListener;
-(EventListener*)initWithAquaClipboard: (AquaClipboard*) pcb
-{
+{
self = [super init];
-
+
if (self)
pAquaClipboard = pcb;
-
+
return self;
}
@@ -103,9 +103,9 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY);
if (!mrXMimeCntFactory.is())
- {
+ {
throw RuntimeException(OUString(
- RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create com.sun.star.datatransfer.MimeContentTypeFactory")),
+ RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create com.sun.star.datatransfer.MimeContentTypeFactory")),
static_cast<XClipboardEx*>(this));
}
@@ -118,13 +118,13 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
}
else
{
- mPasteboard = bUseSystemPasteboard ? [NSPasteboard generalPasteboard] :
+ mPasteboard = bUseSystemPasteboard ? [NSPasteboard generalPasteboard] :
[NSPasteboard pasteboardWithName: NSDragPboard];
if (mPasteboard == nil)
- {
+ {
throw RuntimeException(OUString(
- RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create Cocoa pasteboard")),
+ RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create Cocoa pasteboard")),
static_cast<XClipboardEx*>(this));
}
}
@@ -138,7 +138,7 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
[mPasteboard release];
throw RuntimeException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create pasteboard change listener")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("AquaClipboard: Cannot create pasteboard change listener")),
static_cast<XClipboardEx*>(this));
}
@@ -146,10 +146,10 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
{
NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
- [notificationCenter addObserver: mEventListener
- selector: @selector(applicationDidBecomeActive:)
- name: @"NSApplicationDidBecomeActiveNotification"
- object: [NSApplication sharedApplication]];
+ [notificationCenter addObserver: mEventListener
+ selector: @selector(applicationDidBecomeActive:)
+ name: @"NSApplicationDidBecomeActiveNotification"
+ object: [NSApplication sharedApplication]];
}
mPasteboardChangeCount = [mPasteboard changeCount];
@@ -158,7 +158,7 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
AquaClipboard::~AquaClipboard()
{
- if (mIsSystemPasteboard)
+ if (mIsSystemPasteboard)
{
[[NSNotificationCenter defaultCenter] removeObserver: mEventListener];
}
@@ -172,22 +172,22 @@ AquaClipboard::~AquaClipboard()
Reference<XTransferable> SAL_CALL AquaClipboard::getContents() throw(RuntimeException)
{
MutexGuard aGuard(m_aMutex);
-
- // Shortcut: If we are clipboard owner already we don't need
+
+ // Shortcut: If we are clipboard owner already we don't need
// to drag the data through the system clipboard
if (mXClipboardContent.is())
{
return mXClipboardContent;
}
- return Reference<XTransferable>(new OSXTransferable(mrXMimeCntFactory,
- mpDataFlavorMapper,
+ return Reference<XTransferable>(new OSXTransferable(mrXMimeCntFactory,
+ mpDataFlavorMapper,
mPasteboard));
}
-void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransferable,
- const Reference<XClipboardOwner>& xClipboardOwner)
+void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransferable,
+ const Reference<XClipboardOwner>& xClipboardOwner)
throw( RuntimeException )
{
NSArray* types = xTransferable.is() ?
@@ -195,24 +195,24 @@ void SAL_CALL AquaClipboard::setContents(const Reference<XTransferable>& xTransf
[NSArray array];
ClearableMutexGuard aGuard(m_aMutex);
-
+
Reference<XClipboardOwner> oldOwner(mXClipboardOwner);
mXClipboardOwner = xClipboardOwner;
-
+
Reference<XTransferable> oldContent(mXClipboardContent);
mXClipboardContent = xTransferable;
-
+
mPasteboardChangeCount = [mPasteboard declareTypes: types owner: mEventListener];
aGuard.clear();
-
+
// if we are already the owner of the clipboard
// then fire lost ownership event
if (oldOwner.is())
{
fireLostClipboardOwnershipEvent(oldOwner, oldContent);
}
-
+
fireClipboardChangedEvent();
}
@@ -229,26 +229,26 @@ sal_Int8 SAL_CALL AquaClipboard::getRenderingCapabilities() throw( RuntimeExcept
}
-void SAL_CALL AquaClipboard::addClipboardListener(const Reference< XClipboardListener >& listener)
+void SAL_CALL AquaClipboard::addClipboardListener(const Reference< XClipboardListener >& listener)
throw( RuntimeException )
{
MutexGuard aGuard(m_aMutex);
-
+
if (!listener.is())
- throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")),
+ throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")),
static_cast<XClipboardEx*>(this), 1);
-
+
mClipboardListeners.push_back(listener);
}
-void SAL_CALL AquaClipboard::removeClipboardListener(const Reference< XClipboardListener >& listener)
+void SAL_CALL AquaClipboard::removeClipboardListener(const Reference< XClipboardListener >& listener)
throw( RuntimeException )
{
MutexGuard aGuard(m_aMutex);
if (!listener.is())
- throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")),
+ throw IllegalArgumentException(OUString(RTL_CONSTASCII_USTRINGPARAM("empty reference")),
static_cast<XClipboardEx*>(this), 1);
mClipboardListeners.remove(listener);
@@ -317,7 +317,7 @@ void AquaClipboard::fireLostClipboardOwnershipEvent(Reference<XClipboardOwner> o
BOOST_ASSERT(oldOwner.is());
try { oldOwner->lostOwnership(static_cast<XClipboardEx*>(this), oldContent); }
- catch(RuntimeException&) { }
+ catch(RuntimeException&) { }
}
@@ -327,10 +327,10 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
{
DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent);
NSData* pBoardData = NULL;
-
+
if (dp.get() != NULL)
{
- pBoardData = (NSData*)dp->getSystemData();
+ pBoardData = (NSData*)dp->getSystemData();
[sender setData: pBoardData forType: type];
}
}
@@ -340,19 +340,19 @@ void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
//------------------------------------------------
// XFlushableClipboard
//------------------------------------------------
-
-void SAL_CALL AquaClipboard::flushClipboard()
+
+void SAL_CALL AquaClipboard::flushClipboard()
throw(RuntimeException)
{
if (mXClipboardContent.is())
{
- Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors();
+ Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors();
sal_uInt32 nFlavors = flavorList.getLength();
-
+
for (sal_uInt32 i = 0; i < nFlavors; i++)
{
NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i]);
-
+
if (sysType != NULL)
{
provideDataForType(mPasteboard, sysType);
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.hxx b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
index e495ee3c239e..ce6f463499e9 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.hxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -72,22 +72,22 @@ class AquaClipboard;
class AquaClipboard : public ::cppu::BaseMutex,
- public ::cppu::WeakComponentImplHelper4< com::sun::star::datatransfer::clipboard::XClipboardEx,
- com::sun::star::datatransfer::clipboard::XClipboardNotifier,
+ public ::cppu::WeakComponentImplHelper4< com::sun::star::datatransfer::clipboard::XClipboardEx,
+ com::sun::star::datatransfer::clipboard::XClipboardNotifier,
com::sun::star::datatransfer::clipboard::XFlushableClipboard,
com::sun::star::lang::XServiceInfo >,
private ::boost::noncopyable
{
public:
- /* Create a clipboard instance.
-
- @param pasteboard
+ /* Create a clipboard instance.
+
+ @param pasteboard
If not equal NULL the instance will be instantiated with the provided
pasteboard reference and 'bUseSystemClipboard' will be ignored
@param bUseSystemClipboard
If 'pasteboard' is NULL 'bUseSystemClipboard' determines whether the
- system clipboard will be created (bUseSystemClipboard == true) or if
+ system clipboard will be created (bUseSystemClipboard == true) or if
the DragPasteboard if bUseSystemClipboard == false
*/
AquaClipboard(NSPasteboard* pasteboard = NULL,
@@ -98,51 +98,51 @@ public:
//------------------------------------------------
// XClipboard
//------------------------------------------------
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL setContents( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ virtual void SAL_CALL setContents( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw( ::com::sun::star::uno::RuntimeException );
- virtual ::rtl::OUString SAL_CALL getName()
+ virtual ::rtl::OUString SAL_CALL getName()
throw( ::com::sun::star::uno::RuntimeException );
//------------------------------------------------
- // XClipboardEx
+ // XClipboardEx
//------------------------------------------------
virtual sal_Int8 SAL_CALL getRenderingCapabilities()
throw( ::com::sun::star::uno::RuntimeException );
//------------------------------------------------
- // XClipboardNotifier
+ // XClipboardNotifier
//------------------------------------------------
- virtual void SAL_CALL addClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ virtual void SAL_CALL addClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw( ::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ virtual void SAL_CALL removeClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw( ::com::sun::star::uno::RuntimeException );
//------------------------------------------------
// XFlushableClipboard
//------------------------------------------------
-
+
virtual void SAL_CALL flushClipboard( ) throw( com::sun::star::uno::RuntimeException );
//------------------------------------------------
// XServiceInfo
- //------------------------------------------------
+ //------------------------------------------------
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException);
/* Get a reference to the used pastboard.
diff --git a/vcl/aqua/source/dtrans/aqua_service.cxx b/vcl/aqua/source/dtrans/aqua_service.cxx
index aa46713bce1f..4fa1a2c2a1ef 100644
--- a/vcl/aqua/source/dtrans/aqua_service.cxx
+++ b/vcl/aqua/source/dtrans/aqua_service.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,6 +33,7 @@
#include <com/sun/star/container/XSet.hpp>
#include <osl/diagnose.h>
+using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::registry;
using namespace cppu;
@@ -40,8 +41,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::datatransfer::clipboard;
using namespace aqua;
-using ::rtl::OUString;
-
namespace aqua {
Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
@@ -51,7 +50,7 @@ Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceF
} // namespace aqua
-extern "C"
+extern "C"
{
void SAL_CALL component_getImplementationEnvironment(
@@ -60,6 +59,28 @@ 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;
@@ -67,8 +88,8 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* p
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, AQUA_CLIPBOARD_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
- aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_SERVICE_NAME ) );
-
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_SERVICE_NAME ) );
+
//OUString( RTL_CONSTASCII_USTRINGPARAM( FPS_IMPL_NAME ) )
Reference< XSingleServiceFactory > xFactory ( createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -79,7 +100,7 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* p
{
xFactory->acquire();
pRet = xFactory.get();
- }
+ }
}
return pRet;
diff --git a/vcl/aqua/source/dtrans/service_entry.cxx b/vcl/aqua/source/dtrans/service_entry.cxx
index 661d87576fa8..1e683b413ec0 100644
--- a/vcl/aqua/source/dtrans/service_entry.cxx
+++ b/vcl/aqua/source/dtrans/service_entry.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,42 +35,32 @@
#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;
-uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
+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 = uno::Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
+ pSalData->mxClipboard = Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
return pSalData->mxClipboard;
}
-uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
-{
- if ( Application::IsHeadlessModeEnabled() )
- return SalInstance::CreateDragSource();
- return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
+Reference<XInterface> AquaSalInstance::CreateDragSource()
+{
+ return Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
}
-uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
+Reference<XInterface> AquaSalInstance::CreateDropTarget()
{
- if ( Application::IsHeadlessModeEnabled() )
- return SalInstance::CreateDropTarget();
-
- return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
+ return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/dtrans/test_aquacb.cxx b/vcl/aqua/source/dtrans/test_aquacb.cxx
index 1803f786c8a9..9a0ec9af4187 100644
--- a/vcl/aqua/source/dtrans/test_aquacb.cxx
+++ b/vcl/aqua/source/dtrans/test_aquacb.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,26 +44,26 @@
#include <stdio.h>
-using namespace ::rtl;
+using namespace ::rtl;
using namespace ::std;
using namespace ::cppu;
using namespace ::com::sun::star::datatransfer;
using namespace ::com::sun::star::datatransfer::clipboard;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::lang;
Reference< XTransferable > rXTransfRead;
class TestTransferable : public WeakImplHelper2< XClipboardOwner, XTransferable >
{
-public:
+public:
TestTransferable();
virtual Any SAL_CALL getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException);
virtual Sequence< DataFlavor > SAL_CALL getTransferDataFlavors() throw(RuntimeException);
virtual sal_Bool SAL_CALL isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException);
virtual void SAL_CALL lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans ) throw(RuntimeException);
-
+
private:
Sequence< DataFlavor > m_seqDFlv;
OUString m_Data;
@@ -74,16 +74,16 @@ TestTransferable::TestTransferable() :
m_Data( RTL_CONSTASCII_USTRINGPARAM( "This is a test string" ) )
{
DataFlavor df;
-
- df.MimeType = OUString(RTL_CONSTASCII_USTRINGPARAM("text/html"));
+
+ df.MimeType = OUString::createFromAscii( "text/html" );
df.DataType = getCppuType( ( Sequence< sal_Int8 >* )0 );
- m_seqDFlv[0] = df;
+ m_seqDFlv[0] = df;
}
-Any SAL_CALL TestTransferable::getTransferData( const DataFlavor& aFlavor )
+Any SAL_CALL TestTransferable::getTransferData( const DataFlavor& aFlavor )
throw(UnsupportedFlavorException, IOException, RuntimeException)
-{
+{
Any anyData;
if ( aFlavor.MimeType == m_seqDFlv[0].MimeType )
@@ -101,13 +101,13 @@ Any SAL_CALL TestTransferable::getTransferData( const DataFlavor& aFlavor )
return anyData;
}
-Sequence< DataFlavor > SAL_CALL TestTransferable::getTransferDataFlavors()
+Sequence< DataFlavor > SAL_CALL TestTransferable::getTransferDataFlavors()
throw(RuntimeException)
{
return m_seqDFlv;
}
-sal_Bool SAL_CALL TestTransferable::isDataFlavorSupported( const DataFlavor& aFlavor )
+sal_Bool SAL_CALL TestTransferable::isDataFlavorSupported( const DataFlavor& aFlavor )
throw(RuntimeException)
{
sal_Int32 nLength = m_seqDFlv.getLength();
@@ -125,7 +125,7 @@ sal_Bool SAL_CALL TestTransferable::isDataFlavorSupported( const DataFlavor& aFl
return bRet;
}
-void SAL_CALL TestTransferable::lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans )
+void SAL_CALL TestTransferable::lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans )
throw(RuntimeException)
{
}
@@ -144,10 +144,10 @@ int SAL_CALL main( int argc, char** argv )
OUString rdbName = OUString::createFromAscii( argv[1] );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
- // Print a message if an error occurred.
+ // Print a message if an error occured.
if ( !g_xFactory.is() )
{
- OSL_FAIL("Can't create RegistryServiceFactory");
+ OSL_ENSURE(sal_False, "Can't create RegistryServiceFactory");
return(-1);
}
@@ -160,7 +160,7 @@ int SAL_CALL main( int argc, char** argv )
Reference< XClipboard > xClipboard( g_xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_SERVICE_NAME ) ) ), UNO_QUERY );
if ( !xClipboard.is() )
{
- OSL_FAIL( "Error creating FolderPicker Service" );
+ OSL_ENSURE( sal_False, "Error creating FolderPicker Service" );
return(-1);
}
@@ -196,14 +196,14 @@ int SAL_CALL main( int argc, char** argv )
Reference< XComponent > xComponent( g_xFactory, UNO_QUERY );
if ( !xComponent.is() )
- OSL_FAIL("Error shuting down");
-
+ OSL_ENSURE(sal_False, "Error shuting down");
+
// Dispose and clear factory
xComponent->dispose();
g_xFactory.clear();
g_xFactory = Reference< XMultiServiceFactory >();
- return 0;
+ return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index e62a950129e4..d00fc9a6cd0e 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() >= 5, "resources not found !" );
+ DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" );
}
rtl::OUString getMoreString()
@@ -122,13 +122,6 @@ 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
@@ -253,11 +246,7 @@ class ControllerProperties
PropertyValue* pVal = mpController->getValue( name_it->second );
if( pVal )
{
- // ugly
- if( name_it->second.equalsAscii( "PrintContent" ) )
- pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
- else
- pVal->Value <<= i_bValue;
+ pVal->Value <<= i_bValue;
updatePrintJob();
}
}
@@ -294,9 +283,9 @@ class ControllerProperties
-1;
std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
- if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAscii( "PrintContent" ) )
+ if( name_it != maTagToPropertyName.end() )
{
- BOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
+ MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
if( pCtrl )
{
[pCtrl setEnabled: bEnabled];
@@ -322,9 +311,6 @@ 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 );
@@ -522,7 +508,7 @@ static void filterAccelerator( rtl::OUString& io_rText )
}
else
{
- OSL_FAIL( "unsupported class" );
+ DBG_ERROR( "unsupported class" );
}
mpController->updateEnableState();
}
@@ -554,7 +540,7 @@ static void filterAccelerator( rtl::OUString& io_rText )
}
else
{
- OSL_FAIL( "unsupported class" );
+ DBG_ERROR( "unsupported class" );
}
mpController->updateEnableState();
}
@@ -782,325 +768,6 @@ 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;
@@ -1125,54 +792,6 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
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++ )
{
@@ -1184,7 +803,6 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
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;
@@ -1234,10 +852,6 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
{
rEntry.Value >>= bIgnore;
}
- else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
- {
- rEntry.Value >>= aGroupHint;
- }
}
if( aCtrlType.equalsAscii( "Group" ) ||
@@ -1280,15 +894,6 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
// 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.equalsAscii( "Subgroup" ) && pCurParent )
@@ -1297,64 +902,310 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
if( bIgnore )
continue;
- addSubgroup( pCurParent, nCurY, aText );
+ 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;
}
else if( bIgnoreSubgroup || bIgnore )
- {
continue;
- }
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;
- addBool( pCurParent, nCurX, nCurY, nAttachOffset,
- aText, true, aPropertyName, bVal,
- aRightColumn, pControllerProperties, pCtrlTarget );
+ [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;
}
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];
- addRadio( pCurParent, nCurX, nCurY, nAttachOffset,
- aText, aPropertyName, aChoices, nSelectVal,
- aLeftColumn, aRightColumn,
- pControllerProperties, pCtrlTarget );
+ // 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];
}
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];
- addList( pCurParent, nCurX, nCurY, nAttachOffset,
- aText, aPropertyName, aChoices, aSelectVal,
- aLeftColumn, aRightColumn,
- pControllerProperties, pCtrlTarget );
+ // update nCurY
+ nCurY = aBtnRect.origin.y - 5;
}
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 );
- addEdit( pCurParent, nCurX, nCurY, nAttachOffset,
- aCtrlType, aText, aPropertyName, pVal,
- nMinValue, nMaxValue,
- aLeftColumn, aRightColumn,
- pControllerProperties, pCtrlTarget );
+ if( aCtrlType.equalsAscii( "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;
+
}
}
else
{
- OSL_FAIL( "Unsupported UI option" );
+ DBG_ERROR( "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 11b4b9088591..ae42c5c09e8d 100755
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -44,7 +44,7 @@
return self;
}
--(BOOL)knowsPageRange: (NSRangePointer)range
+-(MacOSBOOL)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 3a88422a2160..d6abb0cf93dd 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,11 +43,11 @@ public:
ATSLayout( ATSUStyle&, float fFontScale );
virtual ~ATSLayout();
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
- virtual void DrawText( SalGraphics& ) const;
+ virtual bool LayoutText( ImplLayoutArgs& );
+ virtual void AdjustLayout( ImplLayoutArgs& );
+ virtual void DrawText( SalGraphics& ) const;
- virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
+ virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const;
virtual long GetTextWidth() const;
@@ -65,49 +65,49 @@ public:
virtual void Simplify( bool bIsBase );
private:
- ATSUStyle& mrATSUStyle;
- ATSUTextLayout maATSULayout;
- int mnCharCount; // ==mnEndCharPos-mnMinCharPos
+ ATSUStyle& mrATSUStyle;
+ ATSUTextLayout maATSULayout;
+ int mnCharCount; // ==mnEndCharPos-mnMinCharPos
// to prevent ATS overflowing the Fixed16.16 values
// ATS font requests get size limited by downscaling huge fonts
// in these cases the font scale becomes something bigger than 1.0
- float mfFontScale;
+ float mfFontScale;
private:
- bool InitGIA( ImplLayoutArgs* pArgs = NULL ) const;
- bool GetIdealX() const;
- bool GetDeltaY() const;
- void InvalidateMeasurements();
+ bool InitGIA( ImplLayoutArgs* pArgs = NULL ) const;
+ bool GetIdealX() const;
+ bool GetDeltaY() const;
+ void InvalidateMeasurements();
- int Fixed2Vcl( Fixed ) const; // convert ATSU-Fixed units to VCL units
- int AtsuPix2Vcl( int ) const; // convert ATSU-Pixel units to VCL units
- Fixed Vcl2Fixed( int ) const; // convert VCL units to ATSU-Fixed units
+ int Fixed2Vcl( Fixed ) const; // convert ATSU-Fixed units to VCL units
+ int AtsuPix2Vcl( int ) const; // convert ATSU-Pixel units to VCL units
+ Fixed Vcl2Fixed( int ) const; // convert VCL units to ATSU-Fixed units
// cached details about the resulting layout
// mutable members since these details are all lazy initialized
- mutable int mnGlyphCount; // glyph count
- mutable Fixed mnCachedWidth; // cached value of resulting typographical width
- int mnTrailingSpaceWidth; // in Pixels
-
- mutable ATSGlyphRef* mpGlyphIds; // ATSU glyph ids
- mutable Fixed* mpCharWidths; // map relative charpos to charwidth
- mutable int* mpChars2Glyphs; // map relative charpos to absolute glyphpos
- mutable int* mpGlyphs2Chars; // map absolute glyphpos to absolute charpos
- mutable bool* mpGlyphRTLFlags; // BiDi status for glyphs: true if RTL
- mutable Fixed* mpGlyphAdvances; // contains glyph widths for the justified layout
- mutable Fixed* mpGlyphOrigAdvs; // contains glyph widths for the unjustified layout
- mutable Fixed* mpDeltaY; // vertical offset from the baseline
+ mutable int mnGlyphCount; // glyph count
+ mutable Fixed mnCachedWidth; // cached value of resulting typographical width
+ int mnTrailingSpaceWidth; // in Pixels
+
+ mutable ATSGlyphRef* mpGlyphIds; // ATSU glyph ids
+ mutable Fixed* mpCharWidths; // map relative charpos to charwidth
+ mutable int* mpChars2Glyphs; // map relative charpos to absolute glyphpos
+ mutable int* mpGlyphs2Chars; // map absolute glyphpos to absolute charpos
+ mutable bool* mpGlyphRTLFlags; // BiDi status for glyphs: true if RTL
+ mutable Fixed* mpGlyphAdvances; // contains glyph widths for the justified layout
+ mutable Fixed* mpGlyphOrigAdvs; // contains glyph widths for the unjustified layout
+ mutable Fixed* mpDeltaY; // vertical offset from the baseline
struct SubPortion { int mnMinCharPos, mnEndCharPos; Fixed mnXOffset; };
typedef std::vector<SubPortion> SubPortionVector;
- mutable SubPortionVector maSubPortions; // Writer&ATSUI layouts can differ quite a bit...
+ mutable SubPortionVector maSubPortions; // Writer&ATSUI layouts can differ quite a bit...
// storing details about fonts used in glyph-fallback for this layout
- mutable class FallbackInfo* mpFallbackInfo;
+ mutable class FallbackInfo* mpFallbackInfo;
// x-offset relative to layout origin
// currently only used in RTL-layouts
- mutable Fixed mnBaseAdv;
+ mutable Fixed mnBaseAdv;
};
class FallbackInfo
@@ -155,7 +155,7 @@ ATSLayout::~ATSLayout()
if( maATSULayout )
ATSUDisposeTextLayout( maATSULayout );
-
+
delete[] mpGlyphRTLFlags;
delete[] mpGlyphs2Chars;
delete[] mpChars2Glyphs;
@@ -181,7 +181,7 @@ inline int ATSLayout::Fixed2Vcl( Fixed nFixed ) const
inline int ATSLayout::AtsuPix2Vcl( int nAtsuPixel) const
{
float fVclPixel = mfFontScale * nAtsuPixel;
- fVclPixel += (fVclPixel>=0) ? +0.5 : -0.5; // prepare rounding to int
+ fVclPixel += (fVclPixel>=0) ? +0.5 : -0.5; // prepare rounding to int
int nVclPixel = static_cast<int>( fVclPixel);
return nVclPixel;
}
@@ -200,8 +200,8 @@ inline Fixed ATSLayout::Vcl2Fixed( int nPixel ) const
* @param rArgs: contains array of char to be layouted, starting and ending position of the text to layout
*
* Typographic layout of text by using the style maATSUStyle
- *
- * @return : true if everything is ok
+ *
+ * @return : true if everything is ok
**/
bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
{
@@ -211,7 +211,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
maATSULayout = NULL;
// Layout text
- // set up our locals, verify parameters...
+ // set up our locals, verify parameters...
DBG_ASSERT( (rArgs.mpStr!=NULL), "ATSLayout::LayoutText() with rArgs.mpStr==NULL !!!");
DBG_ASSERT( (mrATSUStyle!=NULL), "ATSLayout::LayoutText() with ATSUStyle==NULL !!!");
@@ -267,7 +267,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_STRONG) != 0 )
{
// control BiDi defaults
- BOOL nLineDirTag = kATSULeftToRightBaseDirection;
+ MacOSBOOL nLineDirTag = kATSULeftToRightBaseDirection;
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) != 0 )
nLineDirTag = kATSURightToLeftBaseDirection;
aTagAttrs[0] = kATSULineDirectionTag;
@@ -287,8 +287,8 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
* @param rArgs: contains attributes relevant to do a text specific layout
*
* Adjust text layout by moving glyphs to match the requested logical widths
- *
- * @return : none
+ *
+ * @return : none
**/
void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
{
@@ -330,7 +330,7 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
// changing the layout will make all previous measurements invalid
InvalidateMeasurements();
-
+
ATSUAttributeTag nTags[3];
ATSUAttributeValuePtr nVals[3];
ByteCount nBytes[3];
@@ -367,17 +367,17 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
*
* Draw the layouted text to the CGContext
*
- * @return : none
+ * @return : none
**/
void ATSLayout::DrawText( SalGraphics& rGraphics ) const
{
AquaSalGraphics& rAquaGraphics = static_cast<AquaSalGraphics&>(rGraphics);
-
- // short circuit if there is nothing to do
+
+ // short circuit if there is nothing to do
if( (mnCharCount <= 0)
|| !rAquaGraphics.CheckContext() )
return;
-
+
// the view is vertically flipped => flipped glyphs
// so apply a temporary transformation that it flips back
// also compensate if the font was size limited
@@ -469,7 +469,7 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const
* ATSLayout::GetNextGlyphs : Get info about next glyphs in the layout
*
* @param nLen: max number of char
- * @param pGlyphs: returned array of glyph ids
+ * @param pGlyphs: returned array of glyph ids
* @param rPos: returned x starting position
* @param nStart: index of the first requested glyph
* @param pGlyphAdvances: returned array of glyphs advances
@@ -576,14 +576,14 @@ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int
nCharPos = nStart + mnMinCharPos;
*(pCharIndexes++) = nCharPos;
}
-
+
// stop at last glyph
if( ++nStart >= mnGlyphCount )
break;
// stop when next the x-position is unexpected
if( !maSubPortions.empty() )
- break; // TODO: finish the complete sub-portion
+ break; // TODO: finish the complete sub-portion
if( !pGlyphAdvances && mpGlyphOrigAdvs )
if( mpGlyphAdvances[nStart-1] != mpGlyphOrigAdvs[nStart-1] )
break;
@@ -603,7 +603,7 @@ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int
*
* Get typographic bounds of the text
*
- * @return : text width
+ * @return : text width
**/
long ATSLayout::GetTextWidth() const
{
@@ -680,7 +680,7 @@ long ATSLayout::FillDXArray( long* pDXArray ) const
DBG_ASSERT( !mnTrailingSpaceWidth, "ATSLayout::FillDXArray() with nTSW!=0" );
// initialize details about the resulting layout
- InitGIA();
+ InitGIA();
// distribute the widths among the string elements
int nPixWidth = 0;
@@ -708,7 +708,7 @@ long ATSLayout::FillDXArray( long* pDXArray ) const
* Measure the layouted text to find the typographical line break
* the result is needed by the language specific line breaking
*
- * @return : string index corresponding to the suggested line break
+ * @return : string index corresponding to the suggested line break
**/
int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const
{
@@ -750,7 +750,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
// initial measurement of text break position
UniCharArrayOffset nBreakPos = mnMinCharPos;
- const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth );
+ const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth );
if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
return mnMinCharPos; // or do ATSUMaxWidth=0x10000;
OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
@@ -794,7 +794,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
*
* Fill the array of positions of carets (for cursors and selections)
*
- * @return : none
+ * @return : none
**/
void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
{
@@ -817,7 +817,7 @@ void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
&aCaret0, &aCaret1, &bIsSplit );
if( eStatus != noErr )
continue;
- const Fixed nFixedPos = mnBaseAdv + aCaret0.fX;
+ const Fixed nFixedPos = mnBaseAdv + aCaret0.fX;
// convert the measurement to pixel units
const int nPixelPos = Fixed2Vcl( nFixedPos );
// update previous trailing position
@@ -838,7 +838,7 @@ void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
*
* Get ink bounds of the text
*
- * @return : measurement valid
+ * @return : measurement valid
**/
bool ATSLayout::GetBoundRect( SalGraphics&, Rectangle& rVCLRect ) const
{
@@ -865,7 +865,7 @@ bool ATSLayout::GetBoundRect( SalGraphics&, Rectangle& rVCLRect ) const
* ATSLayout::InitGIA() : get many informations about layouted text
*
* Fills arrays of information about the gylph layout previously done
- * in ASTLayout::LayoutText() : glyph advance (width), glyph delta Y (from baseline),
+ * in ASTLayout::LayoutText() : glyph advance (width), glyph delta Y (from baseline),
* mapping between glyph index and character index, chars widths
*
* @return : true if everything could be computed, otherwise false
@@ -876,14 +876,14 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const
if( mnGlyphCount >= 0 )
return true;
mnGlyphCount = 0;
-
+
// Workaround a bug in ATSUI with empty string
if( mnCharCount <= 0 )
return false;
// initialize character details
- mpCharWidths = new Fixed[ mnCharCount ];
- mpChars2Glyphs = new int[ mnCharCount ];
+ mpCharWidths = new Fixed[ mnCharCount ];
+ mpChars2Glyphs = new int[ mnCharCount ];
for( int n = 0; n < mnCharCount; ++n )
{
mpCharWidths[ n ] = 0;
@@ -903,8 +903,8 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const
// initialize glyph details
mpGlyphIds = new ATSGlyphRef[ iLayoutDataCount ];
- mpGlyphAdvances = new Fixed[ iLayoutDataCount ];
- mpGlyphs2Chars = new int[ iLayoutDataCount ];
+ mpGlyphAdvances = new Fixed[ iLayoutDataCount ];
+ mpGlyphs2Chars = new int[ iLayoutDataCount ];
// measure details of the glyph layout
Fixed nLeftPos = 0;
@@ -916,7 +916,7 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const
const int nRelativeIdx = (rALR.originalOffset / 2);
if( i+1 < iLayoutDataCount )
mpCharWidths[ nRelativeIdx ] += pALR[i+1].realPos - rALR.realPos;
-
+
// new glyph is available => finish measurement of old glyph
if( mnGlyphCount > 0 )
mpGlyphAdvances[ mnGlyphCount-1 ] = rALR.realPos - nLeftPos;
@@ -1058,17 +1058,17 @@ bool ATSLayout::GetDeltaY() const
if( mpDeltaY == NULL )
return true;
-
+
if( nDeltaCount != (ItemCount)mnGlyphCount )
{
DBG_WARNING( "ATSLayout::GetDeltaY() : wrong deltaY count!" );
ATSUDirectReleaseLayoutDataArrayPtr( NULL,
- kATSUDirectDataBaselineDeltaFixedArray, (void**)&mpDeltaY );
+ kATSUDirectDataBaselineDeltaFixedArray, (void**)&mpDeltaY );
mpDeltaY = NULL;
return false;
}
#endif
-
+
return true;
}
diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx
index c11ca9764400..9884c4fb6486 100644
--- a/vcl/aqua/source/gdi/salatsuifontutils.cxx
+++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -216,10 +216,10 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
return false;
// all scalable fonts on this platform are subsettable
- rDFA.mbSubsettable = true;
- rDFA.mbEmbeddable = false;
+ rDFA.mbSubsettable = true;
+ rDFA.mbEmbeddable = false;
- // prepare iterating over all name strings of the font
+ // prepare iterating over all name strings of the font
ItemCount nFontNameCount = 0;
rc = ATSUCountFontNames( nFontID, &nFontNameCount );
if( rc != noErr )
@@ -236,9 +236,9 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
{
ByteCount nNameLength = 0;
- FontNameCode eFontNameCode;
- FontPlatformCode eFontNamePlatform;
- FontScriptCode eFontNameScript;
+ FontNameCode eFontNameCode;
+ FontPlatformCode eFontNamePlatform;
+ FontScriptCode eFontNameScript;
FontLanguageCode eFontNameLanguage;
rc = ATSUGetIndFontName( nFontID, nNameIndex, 0, NULL,
&nNameLength, &eFontNameCode, &eFontNamePlatform, &eFontNameScript, &eFontNameLanguage );
@@ -267,13 +267,13 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
case 0x30A: nNameValue += 0; // Win-UCS-4
eEncoding = RTL_TEXTENCODING_UCS4;
break;
- case 0x100: nNameValue += 21; // Mac Roman
+ case 0x100: nNameValue += 21; // Mac Roman
eEncoding = RTL_TEXTENCODING_APPLE_ROMAN;
break;
case 0x300: nNameValue = 0; // Win Symbol encoded name!
rDFA.mbSymbolFlag = true; // (often seen for symbol fonts)
break;
- default: nNameValue = 0; // ignore other encodings
+ default: nNameValue = 0; // ignore other encodings
break;
}
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 7fc5ff74ed2e..9d14d686472f 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -105,7 +105,7 @@ bool AquaSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette )
+bool AquaSalBitmap::Create( const Size& rSize, USHORT nBits, const BitmapPalette& rBitmapPalette )
{
if( !isValidBitCount( nBits ) )
return false;
@@ -132,11 +132,11 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics )
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount )
+bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount )
{
const AquaSalBitmap& rSourceBitmap = static_cast<const AquaSalBitmap&>(rSalBmp);
- if( isValidBitCount( nNewBitCount ) && rSourceBitmap.maUserBuffer.get() )
+ if( isValidBitCount( nNewBitCount ) && rSourceBitmap.maUserBuffer.get() )
{
mnBits = nNewBitCount;
mnWidth = rSourceBitmap.mnWidth;
@@ -258,17 +258,17 @@ bool AquaSalBitmap::AllocateUserData()
switch( mnBits )
{
- case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break;
- case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break;
- case 8: mnBytesPerRow = mnWidth; break;
- case 16: mnBytesPerRow = mnWidth << 1; break;
- case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break;
- case 32: mnBytesPerRow = mnWidth << 2; break;
+ case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break;
+ case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break;
+ case 8: mnBytesPerRow = mnWidth; break;
+ case 16: mnBytesPerRow = mnWidth << 1; break;
+ case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break;
+ case 32: mnBytesPerRow = mnWidth << 2; break;
default:
- OSL_FAIL("vcl::AquaSalBitmap::AllocateUserData(), illegal bitcount!");
+ DBG_ERROR("vcl::AquaSalBitmap::AllocateUserData(), illegal bitcount!");
}
}
-
+
try
{
if( mnBytesPerRow )
@@ -276,11 +276,11 @@ bool AquaSalBitmap::AllocateUserData()
}
catch( const std::bad_alloc& )
{
- OSL_FAIL( "vcl::AquaSalBitmap::AllocateUserData: bad alloc" );
+ DBG_ERROR( "vcl::AquaSalBitmap::AllocateUserData: bad alloc" );
maUserBuffer.reset( NULL );
mnBytesPerRow = 0;
}
-
+
return maUserBuffer.get() != 0;
}
@@ -292,7 +292,7 @@ protected:
sal_uInt8* pData;
public:
static ImplPixelFormat* GetFormat( sal_uInt16 nBits, const BitmapPalette& rPalette );
-
+
virtual void StartLine( sal_uInt8* pLine ) { pData = pLine; }
virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
virtual ColorData ReadPixel() = 0;
@@ -350,7 +350,7 @@ class ImplPixelFormat16 : public ImplPixelFormat
protected:
sal_uInt16* pData16;
public:
-
+
virtual void StartLine( sal_uInt8* pLine )
{
pData16 = (sal_uInt16*)pLine;
@@ -367,7 +367,7 @@ public:
}
virtual void WritePixel( ColorData nColor )
{
- *pData++ = ((COLORDATA_RED( nColor ) & 0xf8 ) << 7 ) ||
+ *pData++ = ((COLORDATA_RED( nColor ) & 0xf8 ) << 7 ) ||
((COLORDATA_GREEN( nColor ) & 0xf8 ) << 2 ) ||
((COLORDATA_BLUE( nColor ) & 0xf8 ) >> 3 );
}
@@ -424,14 +424,14 @@ public:
}
virtual ColorData ReadPixel()
{
- const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f];
+ const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f];
mnX++;
mnShift ^= 4;
return rColor.operator Color().GetColor();
}
virtual void WritePixel( ColorData nColor )
{
- const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) );
+ const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) );
pData[mnX>>1] &= (0xf0 >> mnShift);
pData[mnX>>1] |= (static_cast< sal_uInt8 >( mrPalette.GetBestIndex( aColor ) ) & 0x0f);
mnX++;
@@ -461,13 +461,13 @@ public:
}
virtual ColorData ReadPixel()
{
- const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1];
+ const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1];
mnX++;
return rColor.operator Color().GetColor();
}
virtual void WritePixel( ColorData nColor )
{
- const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) );
+ const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) );
if( mrPalette.GetBestIndex( aColor ) & 1 )
pData[ mnX >> 3 ] |= 1 << ( 7 - ( mnX & 7 ) );
else
@@ -487,7 +487,7 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet
case 24: return new ImplPixelFormat24;
case 32: return new ImplPixelFormat32;
}
-
+
return 0;
}
@@ -549,7 +549,7 @@ void AquaSalBitmap::ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight,
sal_uInt32 nX = nWidth;
while( nX-- )
pD->WritePixel( pS->ReadPixel() );
-
+
pSrcData += nSrcBytesPerRow;
pDestData += nDestBytesPerRow;
}
@@ -568,7 +568,7 @@ Size AquaSalBitmap::GetSize() const
// ------------------------------------------------------------------
-sal_uInt16 AquaSalBitmap::GetBitCount() const
+USHORT AquaSalBitmap::GetBitCount() const
{
return mnBits;
}
@@ -577,27 +577,27 @@ sal_uInt16 AquaSalBitmap::GetBitCount() const
static struct pal_entry
{
- sal_uInt8 mnRed;
- sal_uInt8 mnGreen;
- sal_uInt8 mnBlue;
+ BYTE mnRed;
+ BYTE mnGreen;
+ BYTE mnBlue;
}
const aImplSalSysPalEntryAry[ 16 ] =
{
-{ 0, 0, 0 },
-{ 0, 0, 0x80 },
-{ 0, 0x80, 0 },
-{ 0, 0x80, 0x80 },
-{ 0x80, 0, 0 },
+{ 0, 0, 0 },
+{ 0, 0, 0x80 },
+{ 0, 0x80, 0 },
+{ 0, 0x80, 0x80 },
+{ 0x80, 0, 0 },
{ 0x80, 0, 0x80 },
-{ 0x80, 0x80, 0 },
+{ 0x80, 0x80, 0 },
{ 0x80, 0x80, 0x80 },
{ 0xC0, 0xC0, 0xC0 },
-{ 0, 0, 0xFF },
-{ 0, 0xFF, 0 },
-{ 0, 0xFF, 0xFF },
-{ 0xFF, 0, 0 },
+{ 0, 0, 0xFF },
+{ 0, 0xFF, 0 },
+{ 0, 0xFF, 0xFF },
+{ 0xFF, 0, 0 },
{ 0xFF, 0, 0xFF },
-{ 0xFF, 0xFF, 0 },
+{ 0xFF, 0xFF, 0 },
{ 0xFF, 0xFF, 0xFF }
};
@@ -618,7 +618,7 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome )
aDefPalette256.SetEntryCount( 256 );
aDefPalette16.SetEntryCount( 16 );
aDefPalette2.SetEntryCount( 2 );
-
+
// Standard colors
unsigned int i;
for( i = 0; i < 16; i++ )
@@ -634,9 +634,9 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome )
// own palette (6/6/6)
const int DITHER_PAL_STEPS = 6;
- const sal_uInt8 DITHER_PAL_DELTA = 51;
+ const BYTE DITHER_PAL_DELTA = 51;
int nB, nG, nR;
- sal_uInt8 nRed, nGreen, nBlue;
+ BYTE 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 )
@@ -666,7 +666,7 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome )
BitmapBuffer* AquaSalBitmap::AcquireBuffer( bool bReadOnly )
{
if( !maUserBuffer.get() )
-// || maContextBuffer.get() && (maUserBuffer.get() != maContextBuffer.get()) )
+// || maContextBuffer.get() && (maUserBuffer.get() != maContextBuffer.get()) )
{
fprintf(stderr,"ASB::Acq(%dx%d,d=%d)\n",mnWidth,mnHeight,mnBits);
// TODO: AllocateUserData();
@@ -682,14 +682,14 @@ BitmapBuffer* AquaSalBitmap::AcquireBuffer( bool bReadOnly )
pBuffer->mnBitCount = mnBits;
switch( mnBits )
{
- case 1: pBuffer->mnFormat = BMP_FORMAT_1BIT_MSB_PAL; break;
- case 4: pBuffer->mnFormat = BMP_FORMAT_4BIT_MSN_PAL; break;
- case 8: pBuffer->mnFormat = BMP_FORMAT_8BIT_PAL; break;
- case 16: pBuffer->mnFormat = BMP_FORMAT_16BIT_TC_MSB_MASK;
+ case 1: pBuffer->mnFormat = BMP_FORMAT_1BIT_MSB_PAL; break;
+ case 4: pBuffer->mnFormat = BMP_FORMAT_4BIT_MSN_PAL; break;
+ case 8: pBuffer->mnFormat = BMP_FORMAT_8BIT_PAL; break;
+ case 16: pBuffer->mnFormat = BMP_FORMAT_16BIT_TC_MSB_MASK;
pBuffer->maColorMask = ColorMask( k16BitRedColorMask, k16BitGreenColorMask, k16BitBlueColorMask );
break;
- case 24: pBuffer->mnFormat = BMP_FORMAT_24BIT_TC_BGR; break;
- case 32: pBuffer->mnFormat = BMP_FORMAT_32BIT_TC_ARGB;
+ case 24: pBuffer->mnFormat = BMP_FORMAT_24BIT_TC_BGR; break;
+ case 32: pBuffer->mnFormat = BMP_FORMAT_32BIT_TC_ARGB;
pBuffer->maColorMask = ColorMask( k32BitRedColorMask, k32BitGreenColorMask, k32BitBlueColorMask );
break;
}
@@ -713,7 +713,7 @@ void AquaSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
if( mxGraphicContext )
DestroyContext();
}
-
+
delete pBuffer;
}
@@ -770,7 +770,7 @@ CGImageRef AquaSalBitmap::CreateWithMask( const AquaSalBitmap& rMask,
if( !CGImageIsMask(xMask) || (CGImageGetColorSpace(xMask) != GetSalData()->mxGraySpace) )
{
const CGRect xImageRect=CGRectMake( 0, 0, nWidth, nHeight );//the rect has no offset
-
+
// create the alpha mask image fitting our image
// TODO: is caching the full mask or the subimage mask worth it?
int nMaskBytesPerRow = ((nWidth + 3) & ~3);
@@ -785,13 +785,13 @@ CGImageRef AquaSalBitmap::CreateWithMask( const AquaSalBitmap& rMask,
xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false );
CFRelease( xDataProvider );
CFRelease( xMaskContext );
- }
-
+ }
+
if( !xMask )
return xImage;
// combine image and alpha mask
- CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask );
+ CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask );
CFRelease( xMask );
CFRelease( xImage );
return xMaskedImage;
@@ -822,7 +822,7 @@ CGImageRef AquaSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHeig
sal_uInt8* pSource = maUserBuffer.get();
if( nY )
pSource += nY * mnBytesPerRow;
-
+
int y = nHeight;
while( y-- )
{
@@ -853,7 +853,7 @@ CGImageRef AquaSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHeig
// =======================================================================
/** AquaSalBitmap::GetSystemData Get platform native image data from existing image
- *
+ *
* @param rData struct BitmapSystemData, defined in vcl/inc/bitmap.hxx
* @return true if successful
**/
@@ -863,7 +863,7 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData )
if( !mxGraphicContext )
CreateContext();
-
+
if ( mxGraphicContext )
{
bRet = true;
@@ -875,9 +875,9 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData )
* We need to hack things because VCL does not use kCGBitmapByteOrder32Host, while Cairo requires it.
*/
OSL_TRACE("AquaSalBitmap::%s(): kCGBitmapByteOrder32Host not found => inserting it.",__func__);
-
+
CGImageRef xImage = CGBitmapContextCreateImage (mxGraphicContext);
-
+
// re-create the context with single change: include kCGBitmapByteOrder32Host flag.
CGContextRef mxGraphicContextNew = CGBitmapContextCreate( CGBitmapContextGetData(mxGraphicContext),
CGBitmapContextGetWidth(mxGraphicContext),
@@ -887,27 +887,27 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData )
CGBitmapContextGetColorSpace(mxGraphicContext),
CGBitmapContextGetBitmapInfo(mxGraphicContext) | kCGBitmapByteOrder32Host);
CFRelease(mxGraphicContext);
-
+
// Needs to be flipped
CGContextSaveGState( mxGraphicContextNew );
CGContextTranslateCTM (mxGraphicContextNew, 0, CGBitmapContextGetHeight(mxGraphicContextNew));
CGContextScaleCTM (mxGraphicContextNew, 1.0, -1.0);
-
+
CGContextDrawImage(mxGraphicContextNew, CGRectMake( 0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage);
-
+
// Flip back
CGContextRestoreGState( mxGraphicContextNew );
-
+
CGImageRelease( xImage );
mxGraphicContext = mxGraphicContextNew;
- }
+ }
#endif
rData.rImageContext = (void *) mxGraphicContext;
rData.mnWidth = mnWidth;
rData.mnHeight = mnHeight;
}
-
+
return bRet;
}
diff --git a/vcl/aqua/source/gdi/salcolorutils.cxx b/vcl/aqua/source/gdi/salcolorutils.cxx
index 664011b2684d..1c5408e7a981 100644
--- a/vcl/aqua/source/gdi/salcolorutils.cxx
+++ b/vcl/aqua/source/gdi/salcolorutils.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 4eadc86ff15d..4585699d12ee 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -42,7 +42,6 @@
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/svapp.hxx"
-#include "vcl/region.h"
#include "osl/file.hxx"
#include "osl/process.h"
@@ -60,7 +59,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;
@@ -69,12 +68,11 @@ typedef std::vector<unsigned char> ByteVector;
ImplMacFontData::ImplMacFontData( const ImplDevFontAttributes& rDFA, ATSUFontID nFontId )
: ImplFontData( rDFA, 0 )
, mnFontId( nFontId )
-, mpCharMap( NULL )
-, mbOs2Read( false )
-, mbHasOs2Table( false )
-, mbCmapEncodingRead( false )
-, mbHasCJKSupport( false )
-, mbFontCapabilitiesRead( false )
+, mpCharMap( NULL )
+, mbOs2Read( false )
+, mbHasOs2Table( false )
+, mbCmapEncodingRead( false )
+, mbHasCJKSupport( false )
{}
// -----------------------------------------------------------------------
@@ -119,15 +117,17 @@ 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]);}
-const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() 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 );
@@ -157,55 +157,6 @@ const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
return mpCharMap;
}
-bool ImplMacFontData::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- // read this only once per font
- if( mbFontCapabilitiesRead )
- {
- rFontCapabilities = maFontCapabilities;
- return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
- }
- mbFontCapabilitiesRead = true;
-
- // prepare to get the GSUB table raw data
- ATSFontRef rFont = FMGetATSFontRefFromFont( mnFontId );
- ByteCount nBufSize = 0;
- OSStatus eStatus;
- eStatus = ATSFontGetTable( rFont, GetTag("GSUB"), 0, 0, NULL, &nBufSize );
- if( eStatus == noErr )
- {
- // allocate a buffer for the GSUB raw data
- ByteVector aBuffer( nBufSize );
- // get the GSUB raw data
- ByteCount nRawLength = 0;
- eStatus = ATSFontGetTable( rFont, GetTag("GSUB"), 0, nBufSize, (void*)&aBuffer[0], &nRawLength );
- if( eStatus == noErr )
- {
- const unsigned char* pGSUBTable = &aBuffer[0];
- vcl::getTTScripts(maFontCapabilities.maGSUBScriptTags, pGSUBTable, nRawLength);
- }
- }
- eStatus = ATSFontGetTable( rFont, GetTag("OS/2"), 0, 0, NULL, &nBufSize );
- if( eStatus == noErr )
- {
- // allocate a buffer for the GSUB raw data
- ByteVector aBuffer( nBufSize );
- // get the OS/2 raw data
- ByteCount nRawLength = 0;
- eStatus = ATSFontGetTable( rFont, GetTag("OS/2"), 0, nBufSize, (void*)&aBuffer[0], &nRawLength );
- if( eStatus == noErr )
- {
- const unsigned char* pOS2Table = &aBuffer[0];
- vcl::getTTCoverage(
- maFontCapabilities.maUnicodeRange,
- maFontCapabilities.maCodePageRange,
- pOS2Table, nRawLength);
- }
- }
- rFontCapabilities = maFontCapabilities;
- return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
-}
-
// -----------------------------------------------------------------------
void ImplMacFontData::ReadOs2Table( void ) const
@@ -442,17 +393,17 @@ void AquaSalGraphics::initResolution( NSWindow* pWin )
}
else
{
- OSL_FAIL( "no resolution found in device description" );
+ DBG_ERROR( "no resolution found in device description" );
}
}
else
{
- OSL_FAIL( "no device description" );
+ DBG_ERROR( "no device description" );
}
}
else
{
- OSL_FAIL( "no screen found" );
+ DBG_ERROR( "no screen found" );
}
// #i107076# maintaining size-WYSIWYG-ness causes many problems for
@@ -501,9 +452,9 @@ void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics )
// -----------------------------------------------------------------------
-sal_uInt16 AquaSalGraphics::GetBitCount() const
+USHORT AquaSalGraphics::GetBitCount()
{
- sal_uInt16 nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
+ USHORT nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
return nBits;
}
@@ -559,9 +510,9 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
bPendingCurve |= rPolygon.isPrevControlPointUsed( nClosedIdx );
}
- if( !bPendingCurve ) // line segment
+ if( !bPendingCurve ) // line segment
CGPathAddLineToPoint( xPath, pTransform, aPoint.getX(), aPoint.getY() );
- else // cubic bezier segment
+ else // cubic bezier segment
{
basegfx::B2DPoint aCP1 = rPolygon.getNextControlPoint( nPrevIdx );
basegfx::B2DPoint aCP2 = rPolygon.getPrevControlPoint( nClosedIdx );
@@ -610,7 +561,7 @@ void AquaSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
+void AquaSalGraphics::BeginSetClipRegion( ULONG nRectCount )
{
// release old clip path
if( mxClipPath )
@@ -618,33 +569,41 @@ bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
CGPathRelease( mxClipPath );
mxClipPath = NULL;
}
- mxClipPath = CGPathCreateMutable();
+}
- // 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
+// -----------------------------------------------------------------------
+
+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;
+}
+
+// -----------------------------------------------------------------------
+
+void AquaSalGraphics::EndSetClipRegion()
+{
if( CheckContext() )
SetState();
- return true;
}
// -----------------------------------------------------------------------
@@ -787,13 +746,13 @@ void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-static void getBoundRect( sal_uLong nPoints, const SalPoint *pPtAry, long &rX, long& rY, long& rWidth, long& rHeight )
+static void getBoundRect( 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( sal_uLong n = 1; n < nPoints; n++ )
+ for( ULONG n = 1; n < nPoints; n++ )
{
if( pPtAry[n].mnX < nX1 )
nX1 = pPtAry[n].mnX;
@@ -817,7 +776,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( sal_uLong nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
{
if( nPoints < 1 )
return;
@@ -833,7 +792,7 @@ void AquaSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -845,7 +804,7 @@ void AquaSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
{
if( nPoints <= 1 )
return;
@@ -873,7 +832,7 @@ void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -883,7 +842,7 @@ void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
{
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
}
@@ -893,7 +852,7 @@ void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry )
+void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, PCONSTSALPOINT *ppPtAry )
{
if( nPolyCount <= 0 )
return;
@@ -903,7 +862,7 @@ void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pP
// find bound rect
long leftX = 0, topY = 0, maxWidth = 0, maxHeight = 0;
getBoundRect( pPoints[0], ppPtAry[0], leftX, topY, maxWidth, maxHeight );
- for( sal_uLong n = 1; n < nPolyCount; n++ )
+ for( ULONG n = 1; n < nPolyCount; n++ )
{
long nX = leftX, nY = topY, nW = maxWidth, nH = maxHeight;
getBoundRect( pPoints[n], ppPtAry[n], nX, nY, nW, nH );
@@ -938,9 +897,9 @@ void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pP
CGContextBeginPath( mrContext );
if( IsPenVisible() )
{
- for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const sal_uLong nPoints = pPoints[nPoly];
+ const ULONG nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
@@ -948,7 +907,7 @@ void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pP
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -959,15 +918,15 @@ void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pP
}
else
{
- for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const sal_uLong nPoints = pPoints[nPoly];
+ const ULONG nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
CGContextClosePath(mrContext);
}
@@ -1053,11 +1012,11 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
// setup line attributes
CGLineJoin aCGLineJoin = kCGLineJoinMiter;
switch( eLineJoin ) {
- case ::basegfx::B2DLINEJOIN_NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
- case ::basegfx::B2DLINEJOIN_MIDDLE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
- case ::basegfx::B2DLINEJOIN_BEVEL: aCGLineJoin = kCGLineJoinBevel; break;
- case ::basegfx::B2DLINEJOIN_MITER: aCGLineJoin = kCGLineJoinMiter; break;
- case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break;
+ case ::basegfx::B2DLINEJOIN_NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
+ case ::basegfx::B2DLINEJOIN_MIDDLE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
+ case ::basegfx::B2DLINEJOIN_BEVEL: aCGLineJoin = kCGLineJoinBevel; break;
+ case ::basegfx::B2DLINEJOIN_MITER: aCGLineJoin = kCGLineJoinMiter; break;
+ case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break;
}
// setup poly-polygon path
@@ -1092,22 +1051,22 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints,
- const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
+ const SalPoint* const* pPtAry, const BYTE* const* pFlgAry )
{
return sal_False;
}
@@ -1193,7 +1152,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGrap
// -----------------------------------------------------------------------
-void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, sal_uInt16 nFlags )
+void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, USHORT nFlags )
{
ApplyXorContext();
@@ -1208,7 +1167,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, l
// drawing a layer onto its own context causes trouble on OSX => copy it first
// TODO: is it possible to get rid of this unneeded copy more often?
// e.g. on OSX>=10.5 only this situation causes problems:
- // mnBitmapDepth && (aDstPoint.x + pSrc->mnWidth) > mnWidth
+ // mnBitmapDepth && (aDstPoint.x + pSrc->mnWidth) > mnWidth
CGLayerRef xSrcLayer = mxLayer;
// TODO: if( mnBitmapDepth > 0 )
{
@@ -1260,7 +1219,7 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rS
void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,SalColor nTransparentColor )
{
- OSL_FAIL("not implemented for color masking!");
+ DBG_ERROR("not implemented for color masking!");
drawBitmap( pPosAry, rSalBitmap );
}
@@ -1420,7 +1379,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn
// -----------------------------------------------------------------------
-void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
CGPoint* CGpoints ;
if ( CheckContext() )
@@ -1457,8 +1416,8 @@ void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInv
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
- void* pEpsData, sal_uLong nByteCount )
+BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
+ void* pEpsData, ULONG nByteCount )
{
// convert the raw data to an NSImageRef
NSData* xNSData = [NSData dataWithBytes:(void*)pEpsData length:(int)nByteCount];
@@ -1472,7 +1431,7 @@ sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
// NOTE: flip drawing, else the nsimage would be drawn upside down
CGContextSaveGState( mrContext );
-// CGContextTranslateCTM( mrContext, 0, +mnHeight );
+// CGContextTranslateCTM( mrContext, 0, +mnHeight );
CGContextScaleCTM( mrContext, +1, -1 );
nY = /*mnHeight*/ - (nY + nHeight);
@@ -1627,7 +1586,7 @@ void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackL
// -----------------------------------------------------------------------
-sal_uLong AquaSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
+ULONG AquaSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
{
return 0;
}
@@ -1748,7 +1707,7 @@ bool AquaSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
#else
FSSpec aFontFSSpec;
eStatus = ::FSGetCatalogInfo( &aNewRef, kFSCatInfoNone,
- NULL, NULL, &aFontFSSpec, NULL );
+ NULL, NULL, &aFontFSSpec, NULL );
if( eStatus != noErr )
return false;
@@ -1808,13 +1767,13 @@ static OSStatus GgoMoveToProc( const Float32Point* pPoint, void* pData )
return eStatus;
}
-sal_Bool AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
+BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
{
GgoData aGgoData;
aGgoData.mpPolyPoly = &rPolyPoly;
rPolyPoly.clear();
- ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback when CWS pdffix02 is integrated
+ ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback when CWS pdffix02 is integrated
OSStatus eGgoStatus = noErr;
OSStatus eStatus = ATSUGlyphGetCubicPaths( rATSUStyle, nGlyphId,
GgoMoveToProc, GgoLineToProc, GgoCurveToProc, GgoClosePathProc,
@@ -1850,9 +1809,9 @@ long AquaSalGraphics::GetGraphicsWidth() const
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
+BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
{
- ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
+ ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
GlyphID aGlyphId = nGlyphId;
ATSGlyphScreenMetrics aGlyphMetrics;
OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle,
@@ -1883,7 +1842,7 @@ void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
// -----------------------------------------------------------------------
-sal_uInt16 AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
+USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
{
if( !pReqFont )
{
@@ -2017,7 +1976,7 @@ sal_uInt16 AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallback
// -----------------------------------------------------------------------
-const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
+ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
{
if( !mpMacFontData )
return ImplFontCharMap::GetDefaultMap();
@@ -2025,14 +1984,6 @@ const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
return mpMacFontData->GetImplFontCharMap();
}
-bool AquaSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if( !mpMacFontData )
- return false;
-
- return mpMacFontData->GetImplFontCapabilities(rFontCapabilities);
-}
-
// -----------------------------------------------------------------------
// fake a SFNT font directory entry for a font table
@@ -2046,8 +1997,8 @@ static void FakeDirEntry( FourCharCode eFCC, ByteCount nOfs, ByteCount nLen,
rpDest[ 2] = (char)(eFCC >> 8);
rpDest[ 3] = (char)(eFCC >> 0);
// TODO: get entry checksum and write it
- // not too important since the subsetter doesn't care currently
- // for( pData+nOfs ... pData+nOfs+nLen )
+ // not too important since the subsetter doesn't care currently
+ // for( pData+nOfs ... pData+nOfs+nLen )
// write entry offset
rpDest[ 8] = (char)(nOfs >> 24);
rpDest[ 9] = (char)(nOfs >> 16);
@@ -2085,34 +2036,34 @@ static bool GetRawFontData( const ImplFontData* pFontData,
}
// get font table availability and size in bytes
- ByteCount nHeadLen = 0;
+ ByteCount nHeadLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("head"), 0, 0, NULL, &nHeadLen);
if( (eStatus != noErr) || (nHeadLen <= 0) )
return false;
- ByteCount nMaxpLen = 0;
+ ByteCount nMaxpLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("maxp"), 0, 0, NULL, &nMaxpLen);
if( (eStatus != noErr) || (nMaxpLen <= 0) )
return false;
- ByteCount nCmapLen = 0;
+ ByteCount nCmapLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("cmap"), 0, 0, NULL, &nCmapLen);
if( (eStatus != noErr) || (nCmapLen <= 0) )
return false;
- ByteCount nNameLen = 0;
+ ByteCount nNameLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("name"), 0, 0, NULL, &nNameLen);
if( (eStatus != noErr) || (nNameLen <= 0) )
return false;
- ByteCount nHheaLen = 0;
+ ByteCount nHheaLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("hhea"), 0, 0, NULL, &nHheaLen);
if( (eStatus != noErr) || (nHheaLen <= 0) )
return false;
- ByteCount nHmtxLen = 0;
+ ByteCount nHmtxLen = 0;
eStatus = ATSFontGetTable( rFont, GetTag("hmtx"), 0, 0, NULL, &nHmtxLen);
if( (eStatus != noErr) || (nHmtxLen <= 0) )
return false;
// get the glyph outline tables
- ByteCount nLocaLen = 0;
- ByteCount nGlyfLen = 0;
+ ByteCount nLocaLen = 0;
+ ByteCount nGlyfLen = 0;
if( (eStatus != noErr) || (nCffLen <= 0) )
{
eStatus = ATSFontGetTable( rFont, GetTag("loca"), 0, 0, NULL, &nLocaLen);
@@ -2124,7 +2075,7 @@ static bool GetRawFontData( const ImplFontData* pFontData,
}
ByteCount nPrepLen=0, nCvtLen=0, nFpgmLen=0;
- if( nGlyfLen ) // TODO: reduce PDF size by making hint subsetting optional
+ if( nGlyfLen ) // TODO: reduce PDF size by making hint subsetting optional
{
eStatus = ATSFontGetTable( rFont, GetTag("prep"), 0, 0, NULL, &nPrepLen);
eStatus = ATSFontGetTable( rFont, GetTag("cvt "), 0, 0, NULL, &nCvtLen);
@@ -2150,11 +2101,11 @@ static bool GetRawFontData( const ImplFontData* pFontData,
{
int nLog2 = 0;
while( (nTableCount >> nLog2) > 1 ) ++nLog2;
- rBuffer[ 1] = 1; // Win-TTF style scaler
- rBuffer[ 5] = nTableCount; // table count
- rBuffer[ 7] = nLog2*16; // searchRange
- rBuffer[ 9] = nLog2; // entrySelector
- rBuffer[11] = (nTableCount-nLog2)*16; // rangeShift
+ rBuffer[ 1] = 1; // Win-TTF style scaler
+ rBuffer[ 5] = nTableCount; // table count
+ rBuffer[ 7] = nLog2*16; // searchRange
+ rBuffer[ 9] = nLog2; // entrySelector
+ rBuffer[11] = (nTableCount-nLog2)*16; // rangeShift
}
// get font table raw data and update the fake directory entries
@@ -2208,10 +2159,10 @@ static bool GetRawFontData( const ImplFontData* pFontData,
DBG_ASSERT( (nOfs==nTotalLen), "AquaSalGraphics::CreateFontSubset (nOfs!=nTotalLen)");
- return sal_True;
+ return true;
}
-sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFontData, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2220,7 +2171,7 @@ sal_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 sal_False;
+ return FALSE;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
@@ -2262,17 +2213,17 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
::GetTTGlobalFontInfo( pSftFont, &aTTInfo );
rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF;
rInfo.m_aPSName = String( aTTInfo.psname, RTL_TEXTENCODING_UTF8 );
- rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
+ rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
Point( aTTInfo.xMax, aTTInfo.yMax ) );
- rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
- rInfo.m_nAscent = +aTTInfo.winAscent;
+ rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
+ rInfo.m_nAscent = +aTTInfo.winAscent;
rInfo.m_nDescent = -aTTInfo.winDescent;
// mac fonts usually do not have an OS2-table
// => get valid ascent/descent values from other tables
if( !rInfo.m_nAscent )
- rInfo.m_nAscent = +aTTInfo.typoAscender;
+ rInfo.m_nAscent = +aTTInfo.typoAscender;
if( !rInfo.m_nAscent )
- rInfo.m_nAscent = +aTTInfo.ascender;
+ rInfo.m_nAscent = +aTTInfo.ascender;
if( !rInfo.m_nDescent )
rInfo.m_nDescent = +aTTInfo.typoDescender;
if( !rInfo.m_nDescent )
@@ -2281,7 +2232,7 @@ sal_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;
- sal_uInt16 aShortIDs[ 256 ];
+ USHORT aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef = -1;
@@ -2301,7 +2252,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical );
}
}
- aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
+ aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2329,10 +2280,10 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
TTSimpleGlyphMetrics* pGlyphMetrics =
::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical );
if( !pGlyphMetrics )
- return sal_False;
- sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv;
- pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv;
- pGlyphMetrics[nNotDef].adv = nNotDefAdv;
+ return FALSE;
+ sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv;
+ pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv;
+ pGlyphMetrics[nNotDef].adv = nNotDefAdv;
for( int i = 0; i < nOrigCount; ++i )
pGlyphWidths[i] = pGlyphMetrics[i].adv;
free( pGlyphMetrics );
@@ -2387,10 +2338,8 @@ 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 ) )
@@ -2402,8 +2351,6 @@ 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 );
@@ -2411,7 +2358,7 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
else if( pFontData->IsEmbeddable() )
{
// get individual character widths
- OSL_FAIL("not implemented for non-subsettable fonts!\n");
+ DBG_ERROR("not implemented for non-subsettable fonts!\n");
}
}
@@ -2425,7 +2372,7 @@ const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector(
// -----------------------------------------------------------------------
-const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData,
+const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
@@ -2439,7 +2386,7 @@ const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData,
void AquaSalGraphics::FreeEmbedFontData( const void* pData, long nDataLen )
{
// TODO: implementing this only makes sense when the implementation of
- // AquaSalGraphics::GetEmbedFontData() returns non-NULL
+ // AquaSalGraphics::GetEmbedFontData() returns non-NULL
DBG_ASSERT( (pData!=NULL), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
}
@@ -2555,14 +2502,14 @@ void AquaSalGraphics::ApplyXorContext()
// ======================================================================
XorEmulation::XorEmulation()
-: mxTargetLayer( NULL )
-, mxTargetContext( NULL )
-, mxMaskContext( NULL )
-, mxTempContext( NULL )
-, mpMaskBuffer( NULL )
-, mpTempBuffer( NULL )
-, mnBufferLongs( 0 )
-, mbIsEnabled( false )
+: mxTargetLayer( NULL )
+, mxTargetContext( NULL )
+, mxMaskContext( NULL )
+, mxTempContext( NULL )
+, mpMaskBuffer( NULL )
+, mpTempBuffer( NULL )
+, mnBufferLongs( 0 )
+, mbIsEnabled( false )
{}
// ----------------------------------------------------------------------
@@ -2620,24 +2567,24 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
nBytesPerRow = 1;
}
nBytesPerRow *= nWidth;
- mnBufferLongs = (nHeight * nBytesPerRow + sizeof(sal_uLong)-1) / sizeof(sal_uLong);
+ mnBufferLongs = (nHeight * nBytesPerRow + sizeof(ULONG)-1) / sizeof(ULONG);
// create a XorMask context
- mpMaskBuffer = new sal_uLong[ mnBufferLongs ];
+ mpMaskBuffer = new ULONG[ mnBufferLongs ];
mxMaskContext = ::CGBitmapContextCreate( mpMaskBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
// reset the XOR mask to black
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(ULONG) );
// a bitmap context will be needed for manual XORing
// create one unless the target context is a bitmap context
if( nTargetDepth )
- mpTempBuffer = (sal_uLong*)CGBitmapContextGetData( mxTargetContext );
+ mpTempBuffer = (ULONG*)CGBitmapContextGetData( mxTargetContext );
if( !mpTempBuffer )
{
// create a bitmap context matching to the target context
- mpTempBuffer = new sal_uLong[ mnBufferLongs ];
+ mpTempBuffer = new ULONG[ mnBufferLongs ];
mxTempContext = ::CGBitmapContextCreate( mpTempBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
@@ -2677,8 +2624,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 sal_uLong* pSrc = mpMaskBuffer;
- sal_uLong* pDst = mpTempBuffer;
+ const ULONG* pSrc = mpMaskBuffer;
+ ULONG* pDst = mpTempBuffer;
for( int i = mnBufferLongs; --i >= 0;)
*(pDst++) ^= *(pSrc++);
@@ -2696,7 +2643,7 @@ bool XorEmulation::UpdateTarget()
// reset the XorMask to black again
// TODO: not needed for last update
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(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 22316a50da8d..6dd8317b8827 100644
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -60,7 +60,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon
mbWindow = false;
mbPrinter = true;
mbVirDev = false;
-
+
mrContext = xContext;
mfFakeDPIScale = fScale;
mnRealDPIX = nDPIX;
@@ -90,7 +90,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex
mbVirDev = true;
// set graphics properties
- mxLayer = xLayer;
+ mxLayer = xLayer;
mrContext = xContext;
mnBitmapDepth = nBitmapDepth;
@@ -248,23 +248,23 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh
// this helps with antialiased rendering
const Rectangle aVclRect(Point(static_cast<long int>(lX-1),
static_cast<long int>(lY-1) ),
- Size( static_cast<long int>(lWidth+2),
+ Size( static_cast<long int>(lWidth+2),
static_cast<long int>(lHeight+2) ) );
mpFrame->maInvalidRect.Union( aVclRect );
}
}
-CGPoint* AquaSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry)
+CGPoint* AquaSalGraphics::makeCGptArray(ULONG nPoints, const SalPoint* pPtAry)
{
CGPoint *CGpoints = new (CGPoint[nPoints]);
- if ( CGpoints )
+ if ( CGpoints )
{
- for(sal_uLong i=0;i<nPoints;i++)
+ for(ULONG i=0;i<nPoints;i++)
{
- CGpoints[i].x = (float)(pPtAry[i].mnX);
- CGpoints[i].y = (float)(pPtAry[i].mnY);
+ CGpoints[i].x = (float)(pPtAry[i].mnX);
+ CGpoints[i].y = (float)(pPtAry[i].mnY);
}
- }
+ }
return CGpoints;
}
diff --git a/vcl/aqua/source/gdi/salmathutils.cxx b/vcl/aqua/source/gdi/salmathutils.cxx
index 26516902c5c1..8a5612788429 100644
--- a/vcl/aqua/source/gdi/salmathutils.cxx
+++ b/vcl/aqua/source/gdi/salmathutils.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -102,7 +102,7 @@ void ULSwap ( unsigned long &rX, unsigned long &rY )
// -----------------------------------------------------------------------
//
// This way of measuring distance is also called the "Manhattan distance."
-// Manhattan distance takes advantage of the fact that the sum of the
+// Manhattan distance takes advantage of the fact that the sum of the
// lengths of the three components of a 3D vector is a rough approxima-
// tion of the vector's length.
//
@@ -111,7 +111,7 @@ void ULSwap ( unsigned long &rX, unsigned long &rY )
unsigned long Euclidian2Norm ( const LRectCoorVector pVec )
{
unsigned long ndist = 0;
-
+
if ( pVec )
{
long nDX = 0;
@@ -120,29 +120,29 @@ unsigned long Euclidian2Norm ( const LRectCoorVector pVec )
unsigned long nMax = 0;
unsigned long nMed = 0;
unsigned long nMin = 0;
-
+
// Find |x'-x|, |y'-y|, and |z'-z| from (x,y,z) and (x',y',z')
-
+
nDX = pVec[1].x - pVec[0].x;
nDY = pVec[1].y - pVec[0].y;
nDZ = pVec[1].z - pVec[0].z;
-
+
nMax = (unsigned long)abs( nDX );
nMed = (unsigned long)abs( nDY );
nMin = (unsigned long)abs( nDZ );
-
+
// Sort them (3 compares, 0-3 swaps)
-
+
if ( nMax < nMed )
{
Swap( nMax, nMed );
} // if
-
+
if ( nMax < nMin )
{
Swap( nMax, nMin );
} // if
-
+
// Approximate Euclidian distance:
//
// d = max + (11/32)*med + (1/4)*min
@@ -150,11 +150,11 @@ unsigned long Euclidian2Norm ( const LRectCoorVector pVec )
// with +/- 8% error, where the exact formulae for d is
//
// || (x',y',z') - (x,y,z) || = { |x'-x|^2 + |y'-y|^2 + |z'-z|^2 }^(1/2)
-
- ndist = nMax + ( nMin >> 2UL )
+
+ ndist = nMax + ( nMin >> 2UL )
+ ( ( ( nMed << 3UL ) + ( nMed << 1UL ) + nMed ) >> 5UL );
} // if
-
+
return ndist;
} // RGBDistance
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 1ad5f5d3919c..9d62a87dfdd5 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,11 +51,11 @@ class AquaBlinker : public Timer
{
mpFrame->maBlinkers.push_back( this );
}
-
+
public:
-
+
static void Blink( AquaSalFrame*, const Rectangle&, int nTimeout = 80 );
-
+
virtual void Timeout()
{
Stop();
@@ -219,7 +219,7 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Bottom() += 8;
else
- rResultRect.Bottom() += 4;
+ rResultRect.Bottom() += 4;
break;
case PART_TRACK_VERT_LOWER:
if( GetSalData()->mbIsScrollbarDoubleMax )
@@ -237,13 +237,13 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
/*
* IsNativeControlSupported()
* --------------------------
- * Returns sal_True if the platform supports native
+ * Returns TRUE if the platform supports native
* drawing of the control defined by nPart.
*
*/
-sal_Bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
- bool bOk = sal_False;
+ bool bOk = FALSE;
// Native controls are now defaults
// If you want to disable experimental native controls code,
@@ -267,25 +267,25 @@ sal_Bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPa
nPart == HAS_THREE_BUTTONS )
return true;
break;
-
+
case CTRL_SLIDER:
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
return true;
break;
- case CTRL_EDITBOX:
+ case CTRL_EDITBOX:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_MULTILINE_EDITBOX:
+ case CTRL_MULTILINE_EDITBOX:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_SPINBOX:
+ case CTRL_SPINBOX:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_ALL_BUTTONS ||
nPart == HAS_BACKGROUND_TEXTURE )
@@ -372,18 +372,18 @@ sal_Bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPa
/*
* HitTestNativeControl()
*
- * If the return value is sal_True, bIsInside contains information whether
+ * If the return value is TRUE, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& rPos, sal_Bool& rIsInside )
+BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& rPos, BOOL& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
Rectangle aRect;
bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
- rIsInside = bValid ? aRect.IsInside( rPos ) : sal_False;
+ rIsInside = bValid ? aRect.IsInside( rPos ) : FALSE;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
// in double max mode the actual trough is a little smaller than the track
@@ -394,20 +394,20 @@ sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart n
{
// the left 4 pixels are not hit sensitive
if( rPos.X() - aRect.Left() < 4 )
- rIsInside = sal_False;
+ rIsInside = FALSE;
}
else if( nPart == PART_TRACK_VERT_AREA )
{
// the top 4 pixels are not hit sensitive
if( rPos.Y() - aRect.Top() < 4 )
- rIsInside = sal_False;
+ rIsInside = FALSE;
}
}
}
return bValid;
} // CTRL_SCROLLBAR
- return sal_False;
+ return FALSE;
}
/*
@@ -420,14 +420,14 @@ sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart n
kThemeStatePressedUp = 2,
kThemeStatePressedDown = 3
-#define CTRL_STATE_ENABLED 0x0001
-#define CTRL_STATE_FOCUSED 0x0002
-#define CTRL_STATE_PRESSED 0x0004
-#define CTRL_STATE_ROLLOVER 0x0008
-#define CTRL_STATE_HIDDEN 0x0010
-#define CTRL_STATE_DEFAULT 0x0020
-#define CTRL_STATE_SELECTED 0x0040
-#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
+#define CTRL_STATE_ENABLED 0x0001
+#define CTRL_STATE_FOCUSED 0x0002
+#define CTRL_STATE_PRESSED 0x0004
+#define CTRL_STATE_ROLLOVER 0x0008
+#define CTRL_STATE_HIDDEN 0x0010
+#define CTRL_STATE_DEFAULT 0x0020
+#define CTRL_STATE_SELECTED 0x0040
+#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
*/
UInt32 AquaSalGraphics::getState( ControlState nState )
{
@@ -463,18 +463,18 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState )
*
* Draws the requested control described by nPart/nState.
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
+BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- sal_Bool bOK = sal_False;
+ BOOL bOK = FALSE;
if( ! CheckContext() )
return false;
@@ -584,22 +584,22 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
if( nState & CTRL_STATE_PRESSED ) {//checked, else it is not displayed (see vcl/source/window/menu.cxx)
HIThemeTextInfo aTextInfo;
aTextInfo.version = 0;
- aTextInfo.state = ((nState & CTRL_STATE_ENABLED)==0) ? kThemeStateInactive: kThemeStateActive;
+ aTextInfo.state = ((nState & CTRL_STATE_ENABLED)==0) ? kThemeStateInactive: kThemeStateActive;
aTextInfo.fontID = kThemeMenuItemMarkFont;
aTextInfo.horizontalFlushness=kHIThemeTextHorizontalFlushCenter;
aTextInfo.verticalFlushness=kHIThemeTextVerticalFlushTop;
aTextInfo.options=kHIThemeTextBoxOptionNone;
aTextInfo.truncationPosition=kHIThemeTextTruncationNone;
//aTextInfo.truncationMaxLines unused because of kHIThemeTextTruncationNone
-
+
if( nState & CTRL_STATE_SELECTED) aTextInfo.state = kThemeStatePressed; //item highlighted
-
+
UniChar mark=( nPart == PART_MENU_ITEM_CHECK_MARK ) ? kCheckUnicode: kBulletUnicode;//0x2713;
CFStringRef cfString = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, &mark, 1, kCFAllocatorNull);
- HIThemeDrawTextBox(cfString, &rc, &aTextInfo, mrContext, kHIThemeOrientationNormal);
+ HIThemeDrawTextBox(cfString, &rc, &aTextInfo, mrContext, kHIThemeOrientationNormal);
if (cfString)
CFRelease(cfString);
-
+
bOK = true;
}
}
@@ -620,7 +620,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aPushInfo.animation.time.current = 0;
PushButtonValue* pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? (PushButtonValue*)&aValue : NULL;
int nPaintHeight = static_cast<int>(rc.size.height);
-
+
if( pPBVal && pPBVal->mbBevelButton )
{
aPushInfo.kind = kThemeRoundedBevelButton;
@@ -634,7 +634,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
{
aPushInfo.kind = kThemePushButtonNormal;
nPaintHeight = PB_Norm_Height;
-
+
// avoid clipping when focused
rc.origin.x += FOCUS_RING_WIDTH/2;
rc.size.width -= FOCUS_RING_WIDTH;
@@ -697,11 +697,11 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
bOK = true;
}
break;
-
+
case CTRL_LISTNODE:
{
ButtonValue aButtonValue = aValue.getTristateVal();
-
+
if( Application::GetSettings().GetLayoutRTL() && aButtonValue == BUTTONVALUE_OFF )
{
// FIXME: a value of kThemeDisclosureLeft
@@ -709,7 +709,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
// sadly this does not seem to work, so we'll draw a left
// grey equilateral triangle here ourselves.
// Perhaps some other HIThemeButtonDrawInfo setting would do the trick ?
-
+
CGContextSetShouldAntialias( mrContext, true );
float aGrey[] = { 0.45, 0.45, 0.45, 1.0 };
CGContextSetFillColor( mrContext, aGrey );
@@ -731,9 +731,9 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aInfo.kind = kThemeDisclosureTriangle;
aInfo.value = kThemeDisclosureRight;
aInfo.state = getState( nState );
-
+
aInfo.adornment = kThemeAdornmentNone;
-
+
switch( aButtonValue ) {
case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded
break;
@@ -749,13 +749,13 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
default:
break;
}
-
+
HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL );
}
bOK = true;
}
break;
-
+
case CTRL_PROGRESS:
case CTRL_INTROPROGRESS:
{
@@ -779,12 +779,12 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTrackInfo.enableState = kThemeTrackActive;
aTrackInfo.filler1 = 0;
aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0);
-
+
HIThemeDrawTrack( &aTrackInfo, NULL, mrContext, kHIThemeOrientationNormal );
bOK = true;
}
break;
-
+
case CTRL_SLIDER:
{
SliderValue* pSLVal = (SliderValue*)&aValue;
@@ -869,8 +869,8 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
}
break;
-
-//#define OLD_TAB_STYLE
+
+//#define OLD_TAB_STYLE
#ifdef OLD_TAB_STYLE
case CTRL_TAB_PANE:
{
@@ -879,17 +879,17 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTabPaneDrawInfo.state = kThemeStateActive;
aTabPaneDrawInfo.direction=kThemeTabNorth;
aTabPaneDrawInfo.size=kHIThemeTabSizeNormal;
-
+
//the border is outside the rect rc for Carbon
//but for VCL it should be inside
rc.origin.x+=1;
rc.size.width-=2;
-
+
HIThemeDrawTabPane(&rc, &aTabPaneDrawInfo, mrContext, kHIThemeOrientationNormal);
bOK = true;
}
break;
-
+
case CTRL_TAB_ITEM:
{
HIThemeTabDrawInfo aTabItemDrawInfo;
@@ -898,25 +898,25 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTabItemDrawInfo.direction=kThemeTabNorth;
aTabItemDrawInfo.size=kHIThemeTabSizeNormal;
aTabItemDrawInfo.adornment=kHIThemeTabAdornmentNone;
-
+
if(nState & CTRL_STATE_SELECTED) {
aTabItemDrawInfo.style=kThemeTabFront;
}
if(nState & CTRL_STATE_FOCUSED) {
aTabItemDrawInfo.adornment=kHIThemeTabAdornmentFocus;
}
-
+
/*if(rc.size.height>=TAB_HEIGHT_NORMAL) rc.size.height=TAB_HEIGHT_NORMAL;
else if(rc.size.height>=TAB_HEIGHT_SMALL) rc.size.height=TAB_HEIGHT_SMALL;
else rc.size.height=TAB_HEIGHT_MINI;*/
//now we only use the default size
rc.size.height=TAB_HEIGHT_NORMAL;
-
+
HIThemeDrawTab(&rc, &aTabItemDrawInfo, mrContext, kHIThemeOrientationNormal, &rc );
-
+
bOK=true;
}
- break;
+ break;
#else
case CTRL_TAB_PANE:
{
@@ -926,20 +926,20 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTabPaneDrawInfo.direction=kThemeTabNorth;
aTabPaneDrawInfo.size=kHIThemeTabSizeNormal;
aTabPaneDrawInfo.kind=kHIThemeTabKindNormal;
-
+
//the border is outside the rect rc for Carbon
//but for VCL it should be inside
rc.origin.x+=1;
rc.origin.y-=TAB_HEIGHT_NORMAL/2;
rc.size.height+=TAB_HEIGHT_NORMAL/2;
rc.size.width-=2;
-
+
HIThemeDrawTabPane(&rc, &aTabPaneDrawInfo, mrContext, kHIThemeOrientationNormal);
-
+
bOK = true;
}
break;
-
+
case CTRL_TAB_ITEM:
{
HIThemeTabDrawInfo aTabItemDrawInfo;
@@ -948,22 +948,22 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTabItemDrawInfo.direction=kThemeTabNorth;
aTabItemDrawInfo.size=kHIThemeTabSizeNormal;
aTabItemDrawInfo.adornment=kHIThemeTabAdornmentTrailingSeparator;
- //State
+ //State
if(nState & CTRL_STATE_SELECTED) {
aTabItemDrawInfo.style=kThemeTabFront;
}
if(nState & CTRL_STATE_FOCUSED) {
aTabItemDrawInfo.adornment|=kHIThemeTabAdornmentFocus;
}
-
+
//first, last or middle tab
aTabItemDrawInfo.position=kHIThemeTabPositionMiddle;
-
+
TabitemValue* pTabValue = (TabitemValue *) &aValue;
unsigned int nAlignment = pTabValue->mnAlignment;
//TABITEM_LEFTALIGNED (and TABITEM_RIGHTALIGNED) for the leftmost (or rightmost) tab
- //when there are several lines of tabs because there is only one first tab and one
- //last tab and TABITEM_FIRST_IN_GROUP (and TABITEM_LAST_IN_GROUP) because when the
+ //when there are several lines of tabs because there is only one first tab and one
+ //last tab and TABITEM_FIRST_IN_GROUP (and TABITEM_LAST_IN_GROUP) because when the
//line width is different from window width, there may not be TABITEM_RIGHTALIGNED
if( ( (nAlignment & TABITEM_LEFTALIGNED)&&(nAlignment & TABITEM_RIGHTALIGNED) ) ||
( (nAlignment & TABITEM_FIRST_IN_GROUP)&&(nAlignment & TABITEM_LAST_IN_GROUP) )
@@ -971,26 +971,26 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTabItemDrawInfo.position=kHIThemeTabPositionOnly;
else if((nAlignment & TABITEM_LEFTALIGNED)||(nAlignment & TABITEM_FIRST_IN_GROUP))
aTabItemDrawInfo.position=kHIThemeTabPositionFirst;
- else if((nAlignment & TABITEM_RIGHTALIGNED)||(nAlignment & TABITEM_LAST_IN_GROUP))
+ else if((nAlignment & TABITEM_RIGHTALIGNED)||(nAlignment & TABITEM_LAST_IN_GROUP))
aTabItemDrawInfo.position=kHIThemeTabPositionLast;
-
+
//support for RTL
//see issue 79748
if( Application::GetSettings().GetLayoutRTL() ) {
- if( aTabItemDrawInfo.position == kHIThemeTabPositionFirst )
+ if( aTabItemDrawInfo.position == kHIThemeTabPositionFirst )
aTabItemDrawInfo.position = kHIThemeTabPositionLast;
- else if( aTabItemDrawInfo.position == kHIThemeTabPositionLast )
+ else if( aTabItemDrawInfo.position == kHIThemeTabPositionLast )
aTabItemDrawInfo.position = kHIThemeTabPositionFirst;
}
-
+
rc.size.width+=2;//because VCL has 2 empty pixels between 2 tabs
rc.origin.x-=1;
-
+
HIThemeDrawTab(&rc, &aTabItemDrawInfo, mrContext, kHIThemeOrientationNormal, &rc );
-
+
bOK=true;
}
- break;
+ break;
#endif
case CTRL_LISTBOX:
@@ -1008,7 +1008,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aListInfo.adornment = kThemeAdornmentDefault;
if( (nState & CTRL_STATE_FOCUSED) != 0 )
aListInfo.adornment |= kThemeAdornmentFocus;
-
+
HIThemeDrawButton(&rc, &aListInfo, mrContext, kHIThemeOrientationNormal,&rc);
bOK = true;
break;
@@ -1020,19 +1020,19 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare;
aTextDrawInfo.state=getState( nState );
aTextDrawInfo.isFocused=false;
-
+
rc.size.width+=1;//else there's a white space because aqua theme hasn't a 3D border
rc.size.height+=1;
HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal);
-
+
if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
-
+
bOK=true;
break;
}
}
break;
-
+
case CTRL_EDITBOX:
case CTRL_MULTILINE_EDITBOX:
{
@@ -1041,11 +1041,11 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare;
aTextDrawInfo.state=getState( nState );
aTextDrawInfo.isFocused=false;
-
+
rc.size.width += 1; // else there may be a white space because aqua theme hasn't a 3D border
// change rc so that the frame will encompass only the content region
// see counterpart in GetNativeControlRegion
- rc.size.width += 2;
+ rc.size.width += 2;
rc.size.height += 2;
//CGContextSetFillColorWithColor
@@ -1053,13 +1053,13 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
//fill a white background, because drawFrame only draws the border
HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal);
-
+
if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
-
+
bOK=true;
}
break;
-
+
case CTRL_SPINBOX:
{
if(nPart == PART_ENTIRE_CONTROL)
@@ -1070,7 +1070,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare;
aTextDrawInfo.state=getState( nState );
aTextDrawInfo.isFocused=false;
-
+
//rc.size.width contains the full size of the spinbox ie textfield + button
//so we remove the button width and the space between the button and the textfield
rc.size.width -= SPIN_BUTTON_SPACE + SPIN_BUTTON_WIDTH + 2*FOCUS_RING_WIDTH;
@@ -1082,9 +1082,9 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
//fill a white background, because drawFrame only draws the border
HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal);
-
+
if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
-
+
//buttons:
SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)&aValue;
ControlState nUpperState = CTRL_STATE_ENABLED;//state of the upper button
@@ -1107,17 +1107,17 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
aSpinInfo.state = kThemeStateInactive;
else if((nUpperState & CTRL_STATE_ROLLOVER)||(nLowerState & CTRL_STATE_ROLLOVER))
aSpinInfo.state = kThemeStateRollover;
-
+
Rectangle aSpinRect( pSpinButtonVal->maUpperRect );
aSpinRect.Union( pSpinButtonVal->maLowerRect );
HIRect buttonRc = ImplGetHIRectFromRectangle(aSpinRect);
-
+
// FIXME: without this fuzz factor there is some unwanted clipping
if( Application::GetSettings().GetLayoutRTL() )
buttonRc.origin.x -= FOCUS_RING_WIDTH - CLIP_FUZZ;
else
buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ;
-
+
switch( aValue.getTristateVal() )
{
case BUTTONVALUE_ON: aSpinInfo.value = kThemeButtonOn;
@@ -1125,30 +1125,30 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
case BUTTONVALUE_OFF: aSpinInfo.value = kThemeButtonOff;
break;
case BUTTONVALUE_MIXED:
- case BUTTONVALUE_DONTKNOW:
+ case BUTTONVALUE_DONTKNOW:
default: aSpinInfo.value = kThemeButtonMixed;
break;
}
-
+
aSpinInfo.adornment = ( ((nUpperState & CTRL_STATE_DEFAULT) != 0 ) ||
((nLowerState & CTRL_STATE_DEFAULT) != 0 )) ?
- kThemeAdornmentDefault :
+ kThemeAdornmentDefault :
kThemeAdornmentNone;
if( ((nUpperState & CTRL_STATE_FOCUSED) != 0 ) || ((nLowerState & CTRL_STATE_FOCUSED) != 0 ))
aSpinInfo.adornment |= kThemeAdornmentFocus;
-
+
HIThemeDrawButton( &buttonRc, &aSpinInfo, mrContext, kHIThemeOrientationNormal, NULL );
}
-
+
bOK=true;
}
-
+
}
break;
-
+
case CTRL_FRAME:
{
- sal_uInt16 nStyle = aValue.getNumericVal();
+ USHORT nStyle = aValue.getNumericVal();
if( nPart == PART_BORDER ) {
if(!( nStyle & FRAME_DRAW_MENU ) && !(nStyle & FRAME_DRAW_WINDOWBORDER) )
{
@@ -1159,38 +1159,38 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
{
CGMutablePathRef rPath = CGPathCreateMutable();
CGPathAddRect( rPath, NULL, CGRectMake( 0, 0, mpFrame->maGeometry.nWidth-1, mpFrame->maGeometry.nHeight-1 ) );
-
+
CGContextBeginPath( mrContext );
CGContextAddPath( mrContext, rPath );
- CGContextClip( mrContext );
+ CGContextClip( mrContext );
CGPathRelease( rPath );
}
-
+
HIThemeFrameDrawInfo aTextDrawInfo;
aTextDrawInfo.version=0;
aTextDrawInfo.kind=kHIThemeFrameListBox;
aTextDrawInfo.state=kThemeStateActive;
aTextDrawInfo.isFocused=false;
-
+
HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal);
-
+
bOK=true;
}
}
}
break;
-
+
case CTRL_LISTNET:
{
//do nothing as there isn't net for listviews on macos
bOK=true;
}
break;
-
+
}
CGContextRestoreGState( mrContext );
-
+
/* #i90291# in most cases invalidating the whole control region instead
of just the unclipped part of it is sufficient (and probably faster).
However for the window background we should not unnecessarily enlarge
@@ -1206,10 +1206,10 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
if( aRect.size.width != 0 && aRect.size.height != 0 )
buttonRect.Intersection( Rectangle( Point( static_cast<long int>(aRect.origin.x),
static_cast<long int>(aRect.origin.y) ),
- Size( static_cast<long int>(aRect.size.width),
+ Size( static_cast<long int>(aRect.size.width),
static_cast<long int>(aRect.size.height) ) ) );
}
-
+
RefreshRect( buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight() );
return bOK;
@@ -1221,43 +1221,43 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
* OPTIONAL. Draws the requested text for the control described by nPart/nState.
* Used if text not drawn by DrawNativeControl().
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- return( sal_False );
+ return( FALSE );
}
/*
* GetNativeControlRegion()
*
- * If the return value is sal_True, rNativeBoundingRegion
+ * If the return value is 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.
*
- * rControlRegion: The bounding region of the control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- sal_Bool toReturn = sal_False;
+ BOOL toReturn = FALSE;
Rectangle aCtrlBoundRect( rControlRegion );
short x = aCtrlBoundRect.Left();
short y = aCtrlBoundRect.Top();
short w, h;
-
+
sal_uInt8 nBorderCleanup = 0;
switch (nType)
@@ -1280,13 +1280,13 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
}
}
break;
-
+
case CTRL_SCROLLBAR:
{
Rectangle aRect;
if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) )
{
- toReturn = sal_True;
+ toReturn = TRUE;
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
}
@@ -1306,17 +1306,17 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
{
// checkbox and radio borders need cleanup after unchecking them
nBorderCleanup = 4;
-
+
// TEXT_SEPARATOR to respect Aqua HIG
w = BUTTON_WIDTH + TEXT_SEPARATOR;
h = BUTTON_HEIGHT;
-
+
}
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
-
- toReturn = sal_True;
+
+ toReturn = TRUE;
}
break;
case CTRL_PROGRESS:
@@ -1328,24 +1328,24 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
aRect.Bottom() = aRect.Top() + 15; // values taken from HIG for large progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = sal_True;
+ toReturn = TRUE;
}
break;
-
+
case CTRL_INTROPROGRESS:
{
Rectangle aRect( aCtrlBoundRect );
aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = sal_True;
+ toReturn = TRUE;
}
break;
-
+
case CTRL_TAB_ITEM:
-
+
w = aCtrlBoundRect.GetWidth() + 2*TAB_TEXT_OFFSET - 2*VCL_TAB_TEXT_OFFSET;
-
+
#ifdef OLD_TAB_STYLE
h = TAB_HEIGHT_NORMAL;
#else
@@ -1354,10 +1354,10 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = sal_True;
-
+ toReturn = TRUE;
+
break;
-
+
case CTRL_EDITBOX:
{
w = aCtrlBoundRect.GetWidth();
@@ -1369,8 +1369,8 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
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 = sal_True;
+
+ toReturn = TRUE;
}
break;
case CTRL_LISTBOX:
@@ -1380,11 +1380,11 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
{
w = aCtrlBoundRect.GetWidth();
h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
-
+
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 = sal_True;
+
+ toReturn = TRUE;
}
else if( nPart == PART_BUTTON_DOWN )
{
@@ -1392,14 +1392,14 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
if( w < 3+2*FOCUS_RING_WIDTH )
w = 3+2*FOCUS_RING_WIDTH;
h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
-
+
x += w-DROPDOWN_BUTTON_WIDTH - FOCUS_RING_WIDTH;
y += FOCUS_RING_WIDTH;
w = DROPDOWN_BUTTON_WIDTH;
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) );
-
+
toReturn = true;
}
else if( nPart == PART_SUB_EDIT )
@@ -1415,10 +1415,10 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
if( nType == CTRL_LISTBOX )
w -= 9; // HIG specifies 9 units distance between dropdown button area and content
h -= 4; // don't draw into lower border
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) );
-
+
toReturn = true;
}
}
@@ -1429,11 +1429,11 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
if( w < 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH )
w = 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH;
h = TEXT_EDIT_HEIGHT_NORMAL;
-
+
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 = sal_True;
+
+ toReturn = TRUE;
}
else if( nPart == PART_SUB_EDIT ) {
w = aCtrlBoundRect.GetWidth() - SPIN_BUTTON_SPACE - SPIN_BUTTON_WIDTH;
@@ -1442,11 +1442,11 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
y += 2; // don't draw into upper border
w -= 8; // offset for left and right rounded border
h -= 4; // don't draw into upper or ower border
-
+
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 = sal_True;
+
+ toReturn = TRUE;
}
else if( nPart == PART_BUTTON_UP ) {
//aCtrlBoundRect.GetWidth() contains the width of the full control
@@ -1456,66 +1456,66 @@ sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart
y += FOCUS_RING_WIDTH - CLIP_FUZZ;
w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ;
h = SPIN_UPPER_BUTTON_HEIGHT + 2*CLIP_FUZZ;
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
-
- toReturn = sal_True;
+
+ toReturn = TRUE;
}
else if( nPart == PART_BUTTON_DOWN ) {
x += aCtrlBoundRect.GetWidth() - SPIN_BUTTON_WIDTH - SPIN_BUTTON_SPACE - CLIP_FUZZ;
y += SPIN_UPPER_BUTTON_HEIGHT + FOCUS_RING_WIDTH - CLIP_FUZZ;
w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ;
h = SPIN_LOWER_BUTTON_HEIGHT + 2*CLIP_FUZZ;
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
-
- toReturn = sal_True;
+
+ toReturn = TRUE;
}
break;
case CTRL_FRAME:
{
- sal_uInt16 nStyle = aValue.getNumericVal();
+ USHORT nStyle = aValue.getNumericVal();
if( ( nPart == PART_BORDER ) &&
!( nStyle & (FRAME_DRAW_MENU | FRAME_DRAW_WINDOWBORDER | FRAME_DRAW_BORDERWINDOWBORDER) ) )
{
Rectangle aRect(aCtrlBoundRect);
if( nStyle & FRAME_DRAW_DOUBLEIN )
{
- aRect.Left() += 1;
- aRect.Top() += 1;
- //rRect.Right() -= 1;
- //rRect.Bottom() -= 1;
+ aRect.Left() += 1;
+ aRect.Top() += 1;
+ //rRect.Right() -= 1;
+ //rRect.Bottom() -= 1;
}
else
{
- aRect.Left() += 1;
- aRect.Top() += 1;
- aRect.Right() -= 1;
- aRect.Bottom() -= 1;
+ aRect.Left() += 1;
+ aRect.Top() += 1;
+ aRect.Right() -= 1;
+ aRect.Bottom() -= 1;
}
rNativeContentRegion = aRect;
rNativeBoundingRegion = aRect;
-
- toReturn = sal_True;
+
+ toReturn = TRUE;
}
}
break;
-
+
case CTRL_MENUBAR:
case CTRL_MENU_POPUP:
{
if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) {
-
+
w=10;
h=10;//dimensions of the mark (10px font)
-
+
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
-
- toReturn = sal_True;
+
+ toReturn = TRUE;
}
}
break;
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index 18377308c91d..686fdb2cba3b 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,6 +49,7 @@
#include <algorithm>
+using namespace rtl;
using namespace vcl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -56,9 +57,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
-using ::rtl::OUString;
-using ::rtl::OStringToOUString;
-
// =======================================================================
AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
@@ -76,7 +74,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
NSString* pStr = CreateNSString( i_rQueue.maPrinterName );
mpPrinter = [NSPrinter printerWithName: pStr];
[pStr release];
-
+
NSPrintInfo* pShared = [NSPrintInfo sharedPrintInfo];
if( pShared )
{
@@ -85,13 +83,13 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
mePageOrientation = ([mpPrintInfo orientation] == NSLandscapeOrientation) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT;
[mpPrintInfo setOrientation: NSPortraitOrientation];
}
-
+
mpGraphics = new AquaSalGraphics();
-
+
const int nWidth = 100, nHeight = 100;
maContextMemory.reset( reinterpret_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ),
boost::bind( rtl_freeMemory, _1 ) );
-
+
if( maContextMemory )
{
mrContext = CGBitmapContextCreate( maContextMemory.get(), nWidth, nHeight, 8, nWidth * 4, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
@@ -122,7 +120,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const
// FIXME: get printer resolution
long nDPIX = 720, nDPIY = 720;
NSSize aPaperSize = [mpPrintInfo paperSize];
-
+
NSRect aImageRect = [mpPrintInfo imageablePageBounds];
if( mePageOrientation == ORIENTATION_PORTRAIT )
{
@@ -152,7 +150,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const
mpGraphics->SetPrinterGraphics( i_rContext, nDPIX, nDPIY, 1.0 );
}
else
- OSL_FAIL( "no print info in SetupPrinterGraphics" );
+ DBG_ERROR( "no print info in SetupPrinterGraphics" );
}
}
@@ -174,9 +172,9 @@ void AquaSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-sal_Bool AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
+BOOL AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -230,7 +228,7 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight )
aPaper = PAPER_USER;
break;
}
-
+
if( aPaper == PAPER_USER )
{
// search with fuzz factor
@@ -245,19 +243,19 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight )
}
}
}
-
+
return aPaper;
}
-sal_Bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
+BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
{
// FIXME: implement driver data
if( io_pSetupData && io_pSetupData->mpDriverData )
return SetData( ~0, io_pSetupData );
-
- sal_Bool bSuccess = sal_True;
-
+
+ BOOL bSuccess = TRUE;
+
// set system type
io_pSetupData->mnSystem = JOBSETUP_SYSTEM_MAC;
@@ -279,17 +277,17 @@ sal_Bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
io_pSetupData->mnPaperHeight = 0;
}
- // set orientation
+ // set orientation
io_pSetupData->meOrientation = mePageOrientation;
-
+
io_pSetupData->mnPaperBin = 0;
- io_pSetupData->mpDriverData = reinterpret_cast<sal_uInt8*>(rtl_allocateMemory( 4 ));
+ io_pSetupData->mpDriverData = reinterpret_cast<BYTE*>(rtl_allocateMemory( 4 ));
io_pSetupData->mnDriverDataLen = 4;
}
else
- bSuccess = sal_False;
-
-
+ bSuccess = FALSE;
+
+
return bSuccess;
}
@@ -297,10 +295,10 @@ sal_Bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation )
{
-
+
Orientation ePaperOrientation = ORIENTATION_PORTRAIT;
const PaperInfo* pPaper = matchPaper( i_nWidth, i_nHeight, ePaperOrientation );
-
+
if( pPaper )
{
NSString* pPaperName = [CreateNSString( rtl::OStringToOUString(PaperInfo::toPSName(pPaper->getPaper()), RTL_TEXTENCODING_ASCII_US) ) autorelease];
@@ -317,12 +315,12 @@ void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientatio
// -----------------------------------------------------------------------
-sal_Bool AquaSalInfoPrinter::SetData( sal_uLong i_nFlags, ImplJobSetup* io_pSetupData )
+BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
{
if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC )
- return sal_False;
-
+ return FALSE;
+
if( mpPrintInfo )
{
if( (i_nFlags & SAL_JOBSET_ORIENTATION) != 0 )
@@ -348,24 +346,24 @@ sal_Bool AquaSalInfoPrinter::SetData( sal_uLong i_nFlags, ImplJobSetup* io_pSetu
width = static_cast<long>(PtTo10Mu( w ));
height = static_cast<long>(PtTo10Mu( h ));
}
-
+
setPaperSize( width, height, mePageOrientation );
- }
+ }
}
-
+
return mpPrintInfo != nil;
}
// -----------------------------------------------------------------------
-sal_uLong AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
+ULONG AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
{
return 0;
}
// -----------------------------------------------------------------------
-XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin )
+XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin )
{
return XubString();
}
@@ -378,14 +376,14 @@ static bool getUseNativeDialog()
try
{
// get service provider
- uno::Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
// create configuration hierachical access name
if( xSMgr.is() )
{
try
{
- uno::Reference< XMultiServiceFactory > xConfigProvider(
- uno::Reference< XMultiServiceFactory >(
+ Reference< XMultiServiceFactory > xConfigProvider(
+ Reference< XMultiServiceFactory >(
xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationProvider" ))),
UNO_QUERY )
@@ -397,8 +395,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;
- uno::Reference< XNameAccess > xConfigAccess(
- uno::Reference< XNameAccess >(
+ Reference< XNameAccess > xConfigAccess(
+ Reference< XNameAccess >(
xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess" )),
aArgs ),
@@ -434,7 +432,7 @@ static bool getUseNativeDialog()
return bNative;
}
-sal_uLong AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType )
+ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USHORT i_nType )
{
switch( i_nType )
{
@@ -458,8 +456,6 @@ sal_uLong AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData,
return getUseNativeDialog() ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
return 1;
- case PRINTER_CAPABILITIES_USEPULLMODEL:
- return 1;
default: break;
};
return 0;
@@ -488,7 +484,7 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
o_rPageOffY = static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling );
o_rOutWidth = static_cast<long>( aImageRect.size.width * fXScaling );
o_rOutHeight = static_cast<long>( aImageRect.size.height * fYScaling );
-
+
if( mePageOrientation == ORIENTATION_LANDSCAPE )
{
std::swap( o_rOutWidth, o_rOutHeight );
@@ -504,7 +500,7 @@ static Size getPageSize( vcl::PrinterController& i_rController, sal_Int32 i_nPag
Sequence< PropertyValue > aPageParms( i_rController.getPageParameters( i_nPage ) );
for( sal_Int32 nProperty = 0, nPropertyCount = aPageParms.getLength(); nProperty < nPropertyCount; ++nProperty )
{
- if( aPageParms[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageSize" ) ) )
+ if( aPageParms[ nProperty ].Name.equalsAscii( "PageSize" ) )
{
awt::Size aSize;
aPageParms[ nProperty].Value >>= aSize;
@@ -516,7 +512,7 @@ static Size getPageSize( vcl::PrinterController& i_rController, sal_Int32 i_nPag
return aPageSize;
}
-sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
+BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -524,21 +520,21 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
)
{
if( mbJob )
- return sal_False;
-
- sal_Bool bSuccess = sal_False;
+ return FALSE;
+
+ BOOL bSuccess = FALSE;
bool bWasAborted = false;
AquaSalInstance* pInst = GetSalData()->mpFirstInstance;
PrintAccessoryViewState aAccViewState;
sal_Int32 nAllPages = 0;
-
+
// reset IsLastPage
i_rController.setLastPage( sal_False );
// update job data
if( i_pSetupData )
SetData( ~0, i_pSetupData );
-
+
// do we want a progress panel ?
sal_Bool bShowProgressPanel = sal_True;
beans::PropertyValue* pMonitor = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MonitorVisible" ) ) );
@@ -579,21 +575,21 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
mnCurPageRangeCount = 0;
nAllPages = i_rController.getFilteredPageCount();
}
-
+
aAccViewState.bNeedRestart = false;
-
+
Size aCurSize( 21000, 29700 );
if( nAllPages > 0 )
{
mnCurPageRangeCount = 1;
aCurSize = getPageSize( i_rController, mnCurPageRangeStart );
Size aNextSize( aCurSize );
-
+
// print pages up to a different size
while( mnCurPageRangeCount + mnCurPageRangeStart < nAllPages )
{
aNextSize = getPageSize( i_rController, mnCurPageRangeStart + mnCurPageRangeCount );
- if( aCurSize == aNextSize // same page size
+ if( aCurSize == aNextSize // same page size
||
(aCurSize.Width() == aNextSize.Height() && aCurSize.Height() == aNextSize.Width()) // same size, but different orientation
)
@@ -606,7 +602,7 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
}
else
mnCurPageRangeCount = 0;
-
+
// now for the current run
mnStartPageOffsetX = mnStartPageOffsetY = 0;
// setup the paper size and orientation
@@ -618,12 +614,12 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
pPrinter->SetPaperSizeUser( aCurSize, true );
-
+
// create view
NSView* pPrintView = [[AquaPrintView alloc] initWithController: &i_rController withInfoPrinter: this];
-
+
NSMutableDictionary* pPrintDict = [mpPrintInfo dictionary];
-
+
// set filename
if( i_pFileName )
{
@@ -632,7 +628,7 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
[pPrintDict setObject: pPath forKey: NSPrintSavePath];
[pPath release];
}
-
+
[pPrintDict setObject: [[NSNumber numberWithInt: nCopies] autorelease] forKey: NSPrintCopies];
if( nCopies > 1 )
[pPrintDict setObject: [[NSNumber numberWithBool: pPrinter->IsCollateCopy()] autorelease] forKey: NSPrintMustCollate];
@@ -642,26 +638,26 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// leads do a double free malloc error. Why this value should behave differently from all the others
// is a mystery.
[pPrintDict setObject: [NSNumber numberWithInt: mnCurPageRangeCount] forKey: NSPrintLastPage];
-
-
+
+
// create print operation
NSPrintOperation* pPrintOperation = [NSPrintOperation printOperationWithView: pPrintView printInfo: mpPrintInfo];
-
+
if( pPrintOperation )
{
NSObject* pReleaseAfterUse = nil;
bool bShowPanel = (! i_rController.isDirectPrint() && getUseNativeDialog() && i_rController.isShowDialogs() );
[pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ];
[pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO];
-
+
// set job title (since MacOSX 10.5)
if( [pPrintOperation respondsToSelector: @selector(setJobTitle:)] )
[pPrintOperation performSelector: @selector(setJobTitle:) withObject: [CreateNSString( i_rJobName ) autorelease]];
-
+
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 = sal_True;
+
+ bSuccess = TRUE;
mbJob = true;
pInst->startedPrintJob();
[pPrintOperation runOperation];
@@ -671,25 +667,25 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
if( pReleaseAfterUse )
[pReleaseAfterUse release];
}
-
+
mnCurPageRangeStart += mnCurPageRangeCount;
mnCurPageRangeCount = 1;
} while( aAccViewState.bNeedRestart || mnCurPageRangeStart + mnCurPageRangeCount < nAllPages );
}
-
+
// 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 = sal_True
+ // so we need to call XRenderadble::render one last time with IsLastPage = TRUE
i_rController.setLastPage( sal_True );
GDIMetaFile aPageFile;
if( mrContext )
SetupPrinterGraphics( mrContext );
i_rController.getFilteredPageFile( 0, aPageFile );
-
+
i_rController.setJobState( bWasAborted
? view::PrintableState_JOB_ABORTED
: view::PrintableState_JOB_SPOOLED );
-
+
mnCurPageRangeStart = mnCurPageRangeCount = 0;
return bSuccess;
@@ -697,48 +693,48 @@ sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-sal_Bool AquaSalInfoPrinter::EndJob()
+BOOL AquaSalInfoPrinter::EndJob()
{
mnStartPageOffsetX = mnStartPageOffsetY = 0;
mbJob = false;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalInfoPrinter::AbortJob()
+BOOL AquaSalInfoPrinter::AbortJob()
{
mbJob = false;
-
+
// FIXME: implementation
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
+SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
{
if( i_bNewJobData && i_pSetupData )
SetPrinterData( i_pSetupData );
-
+
CGContextRef rContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
-
+
SetupPrinterGraphics( rContext );
-
+
return mpGraphics;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalInfoPrinter::EndPage()
+BOOL AquaSalInfoPrinter::EndPage()
{
mpGraphics->InvalidateContext();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_uLong AquaSalInfoPrinter::GetErrorCode() const
+ULONG AquaSalInfoPrinter::GetErrorCode() const
{
return 0;
}
@@ -758,7 +754,7 @@ AquaSalPrinter::~AquaSalPrinter()
// -----------------------------------------------------------------------
-sal_Bool AquaSalPrinter::StartJob( const String* i_pFileName,
+BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -769,49 +765,49 @@ sal_Bool AquaSalPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-sal_Bool AquaSalPrinter::StartJob( const XubString* i_pFileName,
+BOOL AquaSalPrinter::StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- sal_uLong i_nCopies,
+ ULONG i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData )
{
- OSL_FAIL( "should never be called" );
- return sal_False;
+ DBG_ERROR( "should never be called" );
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalPrinter::EndJob()
+BOOL AquaSalPrinter::EndJob()
{
return mpInfoPrinter->EndJob();
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalPrinter::AbortJob()
+BOOL AquaSalPrinter::AbortJob()
{
return mpInfoPrinter->AbortJob();
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
+SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
{
return mpInfoPrinter->StartPage( i_pSetupData, i_bNewJobData );
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalPrinter::EndPage()
+BOOL AquaSalPrinter::EndPage()
{
return mpInfoPrinter->EndPage();
}
// -----------------------------------------------------------------------
-sal_uLong AquaSalPrinter::GetErrorCode()
+ULONG AquaSalPrinter::GetErrorCode()
{
return mpInfoPrinter->GetErrorCode();
}
@@ -820,7 +816,7 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData )
{
m_aPaperFormats.clear();
m_bPapersInit = true;
-
+
if( mpPrinter )
{
if( [mpPrinter statusForTable: @"PPD"] == NSPrinterTableOK )
@@ -832,24 +828,12 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData )
for( unsigned int i = 0; i < nPapers; i++ )
{
NSString* pPaper = [pPaperNames objectAtIndex: i];
- // first try to match the name
- rtl::OString aPaperName( [pPaper UTF8String] );
- Paper ePaper = PaperInfo::fromPSName( aPaperName );
- if( ePaper != PAPER_USER )
+ NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper];
+ if( aPaperSize.width > 0 && aPaperSize.height > 0 )
{
- m_aPaperFormats.push_back( PaperInfo( ePaper ) );
- }
- else
- {
- NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper];
- if( aPaperSize.width > 0 && aPaperSize.height > 0 )
- {
- PaperInfo aInfo( PtTo10Mu( aPaperSize.width ),
- PtTo10Mu( aPaperSize.height ) );
- if( aInfo.getPaper() == PAPER_USER )
- aInfo.doSloppyFit();
- m_aPaperFormats.push_back( aInfo );
- }
+ PaperInfo aInfo( PtTo10Mu( aPaperSize.width ),
+ PtTo10Mu( aPaperSize.height ) );
+ m_aPaperFormats.push_back( aInfo );
}
}
}
@@ -861,7 +845,7 @@ const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight,
{
if( ! m_bPapersInit )
const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( NULL );
-
+
const PaperInfo* pMatch = NULL;
o_rOrientation = ORIENTATION_PORTRAIT;
for( int n = 0; n < 2 ; n++ )
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index 2aa8357b28f6..d67aea8d3657 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,18 +34,17 @@
#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, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
{
// #i92075# can be called first in a thread
SalData::ensureThreadAutoreleasePool();
-
+
return new AquaSalVirtualDevice( static_cast< AquaSalGraphics* >( pGraphics ), nDX, nDY, nBitCount, pData );
}
@@ -58,11 +57,11 @@ void AquaSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
// =======================================================================
-AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
-: mbGraphicsUsed( false )
-, mxBitmapContext( NULL )
-, mnBitmapDepth( 0 )
-, mxLayer( NULL )
+AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+: mbGraphicsUsed( false )
+, mxBitmapContext( NULL )
+, mnBitmapDepth( 0 )
+, mxLayer( NULL )
{
if( pGraphic && pData && pData->rCGContext )
{
@@ -92,7 +91,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX,
if( nDX && nDY )
SetSize( nDX, nDY );
-
+
// NOTE: if SetSize does not succeed, we just ignore the nDX and nDY
}
}
@@ -157,7 +156,7 @@ void AquaSalVirtualDevice::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
+BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY )
{
if( mbForeignContext )
{
@@ -199,32 +198,14 @@ sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
pSalFrame = *GetSalData()->maFrames.begin();
if( pSalFrame )
{
- // #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;
- }
+ NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pSalFrame->getWindow()];
+ if( pNSContext )
+ xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
}
}
-
+
DBG_ASSERT( xCGContext, "no context" );
-
+
const CGSize aNewSize = { nDX, nDY };
mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL );
diff --git a/vcl/aqua/source/res/makefile.mk b/vcl/aqua/source/res/makefile.mk
index 8cc46caf443b..2043504450e7 100644
--- a/vcl/aqua/source/res/makefile.mk
+++ b/vcl/aqua/source/res/makefile.mk
@@ -43,6 +43,7 @@ dummy:
ZIPFLAGS = -r
ZIP1TARGET = osxres
+#ZIP1DIR =
ZIP1LIST = MainMenu.nib/*.nib cursors/*.png
# --- Targets --------------------------------------------------
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 9c136fba262e..745152fd2e28 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -2,7 +2,7 @@
/************************************************************************
*
* 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
@@ -62,7 +62,7 @@ AquaSalFrame* AquaSalFrame::s_pCaptureFrame = NULL;
// =======================================================================
-AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) :
+AquaSalFrame::AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle ) :
mpWindow(nil),
mpView(nil),
mpDockMenuEntry(nil),
@@ -93,7 +93,7 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) :
maSysData.nSize = sizeof( SystemEnvData );
mpParent = dynamic_cast<AquaSalFrame*>(pParent);
-
+
initWindowAndView();
SalData* pSalData = GetSalData();
@@ -112,20 +112,20 @@ AquaSalFrame::~AquaSalFrame()
// cleanup clipping stuff
ResetClipRegion();
-
+
[SalFrameView unsetMouseFrame: this];
-
+
SalData* pSalData = GetSalData();
pSalData->maFrames.remove( this );
pSalData->maFrameCheck.erase( this );
-
+
DBG_ASSERT( this != s_pCaptureFrame, "capture frame destroyed" );
if( this == s_pCaptureFrame )
s_pCaptureFrame = NULL;
if ( mpGraphics )
delete mpGraphics;
-
+
if( mpDockMenuEntry )
// life cycle comment: the menu has ownership of the item, so no release
[AquaSalInstance::GetDynamicDockMenu() removeItem: mpDockMenuEntry];
@@ -151,12 +151,12 @@ void AquaSalFrame::initWindowAndView()
// calculate some default geometry
NSRect aVisibleRect = [pScreen visibleFrame];
CocoaToVCL( aVisibleRect );
-
+
maGeometry.nX = static_cast<int>(aVisibleRect.origin.x + aVisibleRect.size.width / 10);
maGeometry.nY = static_cast<int>(aVisibleRect.origin.y + aVisibleRect.size.height / 10);
maGeometry.nWidth = static_cast<unsigned int>(aVisibleRect.size.width * 0.8);
maGeometry.nHeight = static_cast<unsigned int>(aVisibleRect.size.height * 0.8);
-
+
// calculate style mask
if( (mnStyle & SAL_FRAME_STYLE_FLOAT) ||
(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
@@ -191,32 +191,25 @@ void AquaSalFrame::initWindowAndView()
if( mnStyleMask != 0 )
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
[mpWindow setAcceptsMouseMovedEvents: YES];
[mpWindow setHasShadow: YES];
[mpWindow setDelegate: mpWindow];
-
+
NSRect aRect = { { 0,0 }, { maGeometry.nWidth, maGeometry.nHeight } };
mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO];
-
+
maSysData.pView = mpView;
-
+
UpdateFrameGeometry();
-
+
+ // setContentView causes a display; in multithreaded use this can deadlock
+ //YieldMutexReleaser aRel;
[mpWindow setContentView: mpView];
}
@@ -259,7 +252,7 @@ void AquaSalFrame::VCLToCocoa( NSPoint& io_rPoint, bool bRelativeToScreen )
void AquaSalFrame::screenParametersChanged()
{
UpdateFrameGeometry();
-
+
if( mpGraphics )
mpGraphics->updateResolution();
CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
@@ -292,7 +285,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-sal_Bool AquaSalFrame::PostEvent( void *pData )
+BOOL AquaSalFrame::PostEvent( void *pData )
{
GetSalData()->mpFirstInstance->PostUserEvent( this, SALEVENT_USEREVENT, pData );
return TRUE;
@@ -301,17 +294,11 @@ sal_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 sal_uLong nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
+ const ULONG nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
if( mpParent == NULL &&
(mnStyle & nAppWindowStyle) == nAppWindowStyle )
{
@@ -323,21 +310,21 @@ void AquaSalFrame::SetTitle(const XubString& rTitle)
keyEquivalent: @""
atIndex: 0];
[mpDockMenuEntry setTarget: mpWindow];
-
+
// TODO: image (either the generic window image or an icon
// check mark (for "main" window ?)
}
else
[mpDockMenuEntry setTitle: pTitle];
}
-
+
if (pTitle)
[pTitle release];
}
// -----------------------------------------------------------------------
-void AquaSalFrame::SetIcon( sal_uInt16 )
+void AquaSalFrame::SetIcon( USHORT )
{
}
@@ -345,9 +332,6 @@ void AquaSalFrame::SetIcon( sal_uInt16 )
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;
@@ -373,12 +357,12 @@ void AquaSalFrame::initShow()
if( mpParent ) // center relative to parent
{
// center on parent
- long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2;
+ long nNewX = mpParent->maGeometry.nX + (mpParent->maGeometry.nWidth - 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 + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2;
+ long nNewY = mpParent->maGeometry.nY + (mpParent->maGeometry.nHeight - maGeometry.nHeight)/2;
if( nNewY < aScreenRect.Top() )
nNewY = aScreenRect.Top();
if( nNewY > aScreenRect.Bottom() )
@@ -395,7 +379,7 @@ void AquaSalFrame::initShow()
SetPosSize( nNewX, nNewY, 0, 0, SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y );
}
}
-
+
// make sure the view is present in the wrapper list before any children receive focus
[AquaA11yFactory registerView: mpView];
}
@@ -410,40 +394,36 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect )
aPaintEvt.mnBoundWidth = pRect->GetWidth();
aPaintEvt.mnBoundHeight = pRect->GetHeight();
}
-
+
CallCallback(SALEVENT_PAINT, &aPaintEvt);
}
// -----------------------------------------------------------------------
-void AquaSalFrame::Show(sal_Bool bVisible, sal_Bool bNoActivate)
+void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
{
- if ( !mpWindow )
- return;
-
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
mbShown = bVisible;
if(bVisible)
{
if( mbInitShow )
initShow();
-
+
CallCallback(SALEVENT_RESIZE, 0);
// trigger filling our backbuffer
SendPaintEvent();
+
+ //YieldMutexReleaser aRel;
if( bNoActivate || [mpWindow canBecomeKeyWindow] == NO )
[mpWindow orderFront: NSApp];
else
[mpWindow makeKeyAndOrderFront: NSApp];
-
+
if( mpParent )
{
/* #i92674# #i96433# we do not want an invisible parent to show up (which adding a visible
child implicitly does). However we also do not want a parentless toolbar.
-
+
HACK: try to decide when we should not insert a child to its parent
floaters and ownerdraw windows have not yet shown up in cases where
we don't want the parent to become visible
@@ -453,7 +433,7 @@ void AquaSalFrame::Show(sal_Bool bVisible, sal_Bool bNoActivate)
[mpParent->mpWindow addChildWindow: mpWindow ordered: NSWindowAbove];
}
}
-
+
if( mbPresentation )
[mpWindow makeMainWindow];
}
@@ -464,22 +444,24 @@ void AquaSalFrame::Show(sal_Bool bVisible, sal_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] )
[mpParent->mpWindow makeKeyAndOrderFront: NSApp];
-
+
[SalFrameView unsetMouseFrame: this];
if( mpParent && [mpWindow parentWindow] == mpParent->mpWindow )
[mpParent->mpWindow removeChildWindow: mpWindow];
-
+
[mpWindow orderOut: NSApp];
}
}
// -----------------------------------------------------------------------
-void AquaSalFrame::Enable( sal_Bool bEnable )
+void AquaSalFrame::Enable( BOOL bEnable )
{
}
@@ -487,9 +469,6 @@ void AquaSalFrame::Enable( sal_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;
@@ -512,9 +491,6 @@ 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;
@@ -541,13 +517,10 @@ 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 };
-
+
[mpWindow setContentSize: aSize];
UpdateFrameGeometry();
if( mbShown )
@@ -576,11 +549,6 @@ 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];
@@ -595,34 +563,19 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
aStateRect.size.height = float(pState->mnHeight);
VCLToCocoa( aStateRect );
aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
-
- [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 )
+
+ // relase and acquire mutex again since this call can block waiting for an internal lock
{
- if(! [mpWindow isZoomed])
- [mpWindow zoom: NSApp];
- }
- else
- {
- if( [mpWindow isZoomed] )
- [mpWindow zoom: NSApp];
- }
+ //YieldMutexReleaser aRel;
+ [mpWindow setFrame: aStateRect display: NO];
}
+ // FIXME: HTH maximized state ?
+
// get new geometry
UpdateFrameGeometry();
-
- sal_uInt16 nEvent = 0;
+
+ USHORT nEvent = 0;
if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_X) )
{
mbPositioned = true;
@@ -638,26 +591,22 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
if( nEvent )
CallCallback( nEvent, NULL );
- if( mbShown && mpWindow )
+ if( mbShown )
{
// trigger filling our backbuffer
SendPaintEvent();
// tell the system the views need to be updated
+ //YieldMutexReleaser aRel;
+
[mpWindow display];
}
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalFrame::GetWindowState( SalFrameState* pState )
+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 |
@@ -671,7 +620,9 @@ sal_Bool AquaSalFrame::GetWindowState( SalFrameState* pState )
pState->mnY = long(aStateRect.origin.y);
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] )
@@ -686,12 +637,6 @@ sal_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;
@@ -700,7 +645,7 @@ void AquaSalFrame::SetScreenNumber(unsigned int nScreen)
// get new screen frame
pScreen = [pScreens objectAtIndex: nScreen];
NSRect aNewScreen = [pScreen frame];
-
+
// get current screen frame
pScreen = [mpWindow screen];
if( pScreen )
@@ -725,24 +670,18 @@ void AquaSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
+void AquaSalFrame::ShowFullScreen( 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;
-
+
mbFullScreen = bFullScreen;
if( bFullScreen )
{
// hide the dock and the menubar if we are on the menu screen
// which is always on index 0 according to documentation
bool bHideMenu = (nDisplay == 0);
-
+
NSRect aNewContentRect = { { 0, 0 }, { 0, 0 } };
// get correct screen
NSScreen* pScreen = nil;
@@ -782,7 +721,7 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
pScreen = [mpWindow screen];
if( pScreen == nil )
pScreen = [NSScreen mainScreen];
-
+
aNewContentRect = [pScreen frame];
}
@@ -791,6 +730,7 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
maFullScreenRect = [mpWindow frame];
{
+ //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aNewContentRect styleMask: mnStyleMask] display: mbShown ? YES : NO];
}
@@ -802,6 +742,7 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
else
{
{
+ //YieldMutexReleaser aRel;
[mpWindow setFrame: maFullScreenRect display: mbShown ? YES : NO];
}
UpdateFrameGeometry();
@@ -827,25 +768,19 @@ public:
SetTimeout( 30000 );
Start();
}
-
+
virtual ~PreventSleepTimer()
{
}
-
+
virtual void Timeout()
{
UpdateSystemActivity(OverallAct);
}
};
-void AquaSalFrame::StartPresentation( sal_Bool bStart )
+void AquaSalFrame::StartPresentation( 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() );
@@ -862,23 +797,14 @@ void AquaSalFrame::StartPresentation( sal_Bool bStart )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
+void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop )
{
}
// -----------------------------------------------------------------------
-void AquaSalFrame::ToTop(sal_uInt16 nFlags)
+void AquaSalFrame::ToTop(USHORT 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] )
@@ -917,12 +843,12 @@ NSCursor* AquaSalFrame::getCurrentCursor() const
case POINTER_WINDOW_WSIZE:
pCursor = [NSCursor resizeLeftRightCursor]; break;
case POINTER_REFHAND: pCursor = [NSCursor pointingHandCursor]; break;
-
+
default:
pCursor = GetSalData()->getCursor( mePointerStyle );
if( pCursor == nil )
{
- OSL_FAIL( "unmapped cursor" );
+ DBG_ERROR( "unmapped cursor" );
pCursor = [NSCursor arrowCursor];
}
break;
@@ -932,16 +858,10 @@ 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;
-
+
[mpWindow invalidateCursorRectsForView: mpView];
}
@@ -950,7 +870,7 @@ void AquaSalFrame::SetPointer( PointerStyle ePointerStyle )
void AquaSalFrame::SetPointerPos( long nX, long nY )
{
// FIXME: use Cocoa functions
-
+
// FIXME: multiscreen support
CGPoint aPoint = { nX + maGeometry.nX, nY + maGeometry.nY };
CGDirectDisplayID mainDisplayID = CGMainDisplayID();
@@ -964,10 +884,6 @@ 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)
@@ -986,9 +902,6 @@ 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];
@@ -1008,9 +921,8 @@ void AquaSalFrame::Sync()
{
if( mbGraphics && mpGraphics && mpView && mbShown )
{
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
+ //YieldMutexReleaser aRel;
+
[mpView setNeedsDisplay: YES];
[mpView display];
}
@@ -1025,7 +937,7 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext )
mnICOptions = 0;
return;
}
-
+
mnICOptions = pContext->mnOptions;
if(!(pContext->mnOptions & SAL_INPUTCONTEXT_TEXT))
@@ -1034,18 +946,18 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void AquaSalFrame::EndExtTextInput( sal_uInt16 nFlags )
+void AquaSalFrame::EndExtTextInput( USHORT nFlags )
{
}
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
+XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
{
- static std::map< sal_uInt16, rtl::OUString > aKeyMap;
+ static std::map< USHORT, rtl::OUString > aKeyMap;
if( aKeyMap.empty() )
{
- sal_uInt16 i;
+ USHORT 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++ )
@@ -1057,7 +969,7 @@ XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
aKey.append( sal_Int32( i - KEY_F1 + 1 ) );
aKeyMap[ i ] = aKey.makeStringAndClear();
}
-
+
aKeyMap[ KEY_DOWN ] = rtl::OUString( sal_Unicode( 0x21e3 ) );
aKeyMap[ KEY_UP ] = rtl::OUString( sal_Unicode( 0x21e1 ) );
aKeyMap[ KEY_LEFT ] = rtl::OUString( sal_Unicode( 0x21e0 ) );
@@ -1079,7 +991,7 @@ XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
aKeyMap[ KEY_POINT ] = rtl::OUString( sal_Unicode( '.' ) );
aKeyMap[ KEY_COMMA ] = rtl::OUString( sal_Unicode( ',' ) );
aKeyMap[ KEY_LESS ] = rtl::OUString( sal_Unicode( '<' ) );
- aKeyMap[ KEY_GREATER ] = rtl::OUString( sal_Unicode( '>' ) );
+ aKeyMap[ KEY_GREATER ] = rtl::OUString( sal_Unicode( '>' ) );
aKeyMap[ KEY_EQUAL ] = rtl::OUString( sal_Unicode( '=' ) );
aKeyMap[ KEY_OPEN ] = rtl::OUString( sal_Unicode( 0x23cf ) );
@@ -1103,11 +1015,11 @@ XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
*/
}
-
+
rtl::OUStringBuffer aResult( 16 );
-
- sal_uInt16 nUnmodifiedCode = (nKeyCode & KEY_CODE);
- std::map< sal_uInt16, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
+
+ USHORT nUnmodifiedCode = (nKeyCode & KEY_CODE);
+ std::map< USHORT, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
if( it != aKeyMap.end() )
{
if( (nKeyCode & KEY_SHIFT) != 0 )
@@ -1118,16 +1030,16 @@ XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
// we map it to MOD3, whichis actually Command
if( (nKeyCode & (KEY_MOD2|KEY_MOD3)) != 0 )
aResult.append( sal_Unicode( 0x2303 ) );
-
+
aResult.append( it->second );
}
-
+
return aResult.makeStringAndClear();
}
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
+XubString AquaSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -1141,7 +1053,7 @@ static void getAppleScrollBarVariant(void)
CFStringRef AppleScrollBarType = CFSTR("AppleScrollBarVariant");
if( AppleScrollBarType )
{
- CFStringRef ScrollBarVariant = ((CFStringRef)CFPreferencesCopyAppValue( AppleScrollBarType, kCFPreferencesCurrentApplication ));
+ CFStringRef ScrollBarVariant = ((CFStringRef)CFPreferencesCopyAppValue( AppleScrollBarType, kCFPreferencesCurrentApplication ));
if( ScrollBarVariant )
{
if( CFGetTypeID( ScrollBarVariant ) == CFStringGetTypeID() )
@@ -1167,7 +1079,7 @@ static void getAppleScrollBarVariant(void)
CFStringRef jumpScroll = CFSTR("AppleScrollerPagingBehavior");
if( jumpScroll )
{
- CFBooleanRef jumpStr = ((CFBooleanRef)CFPreferencesCopyAppValue( jumpScroll, kCFPreferencesCurrentApplication ));
+ CFBooleanRef jumpStr = ((CFBooleanRef)CFPreferencesCopyAppValue( jumpScroll, kCFPreferencesCurrentApplication ));
if( jumpStr )
{
if( CFGetTypeID( jumpStr ) == CFBooleanGetTypeID() )
@@ -1211,7 +1123,7 @@ static Font getFont( NSFont* pFont, long nDPIY, const Font& rDefault )
aResult.SetItalic( ([pFont italicAngle] != 0.0) ? ITALIC_NORMAL : ITALIC_NONE );
// FIMXE: bold ?
}
-
+
return aResult;
}
@@ -1233,14 +1145,8 @@ 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();
// Background Color
@@ -1250,7 +1156,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
Color aInactiveTabColor( aBackgroundColor );
aInactiveTabColor.DecreaseLuminance( 32 );
aStyleSettings.SetInactiveTabColor( aInactiveTabColor );
-
+
aStyleSettings.SetDialogColor( aBackgroundColor );
aStyleSettings.SetLightBorderColor( aBackgroundColor );
Color aShadowColor( aStyleSettings.GetShadowColor() );
@@ -1270,7 +1176,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetAppFont( aAppFont );
aStyleSettings.SetHelpFont( aAppFont );
aStyleSettings.SetPushButtonFont( aAppFont );
-
+
Font aTitleFont( getFont( [NSFont titleBarFontOfSize: 0], nDPIY, aAppFont ) );
aStyleSettings.SetTitleFont( aTitleFont );
aStyleSettings.SetFloatTitleFont( aTitleFont );
@@ -1294,14 +1200,14 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
Color aHighlightTextColor( getColor( [NSColor selectedTextColor],
aStyleSettings.GetHighlightTextColor(), mpWindow ) );
aStyleSettings.SetHighlightTextColor( aHighlightTextColor );
-
+
Color aMenuHighlightColor( getColor( [NSColor selectedMenuItemColor],
aStyleSettings.GetMenuHighlightColor(), mpWindow ) );
aStyleSettings.SetMenuHighlightColor( aMenuHighlightColor );
Color aMenuHighlightTextColor( getColor( [NSColor selectedMenuItemTextColor],
aStyleSettings.GetMenuHighlightTextColor(), mpWindow ) );
aStyleSettings.SetMenuHighlightTextColor( aMenuHighlightTextColor );
-
+
aStyleSettings.SetMenuColor( aBackgroundColor );
Color aMenuTextColor( getColor( [NSColor textColor],
aStyleSettings.GetMenuTextColor(), mpWindow ) );
@@ -1309,18 +1215,18 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetMenuBarTextColor( aMenuTextColor );
aStyleSettings.SetCursorBlinkTime( 500 );
-
+
// no mnemonics on aqua
aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_NOMNEMONICS );
-
+
getAppleScrollBarVariant();
-
+
// set scrollbar size
aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidth]) );
// images in menus false for MacOSX
aStyleSettings.SetPreferredUseImagesInMenus( false );
-
+
rSettings.SetStyleSettings( aStyleSettings );
[mpView unlockFocus];
@@ -1350,15 +1256,9 @@ void AquaSalFrame::Beep( SoundType eSoundType )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags)
{
- if ( !mpWindow )
- return;
-
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
- sal_uInt16 nEvent = 0;
+ USHORT nEvent = 0;
if( [mpWindow isMiniaturized] )
[mpWindow deminiaturize: NSApp]; // expand the window
@@ -1377,7 +1277,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
NSRect aFrameRect = [mpWindow frame];
NSRect aContentRect = [NSWindow contentRectForFrameRect: aFrameRect styleMask: mnStyleMask];
-
+
// position is always relative to parent frame
NSRect aParentContentRect;
@@ -1395,10 +1295,10 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
}
else
aParentContentRect = maScreenRect; // use screen if no parent
-
+
CocoaToVCL( aContentRect );
CocoaToVCL( aParentContentRect );
-
+
bool bPaint = false;
if( (nFlags & (SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT)) != 0 )
{
@@ -1417,14 +1317,15 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
aContentRect.size.width = nWidth;
if( (nFlags & SAL_FRAME_POSSIZE_HEIGHT) != 0)
aContentRect.size.height = nHeight;
-
+
VCLToCocoa( aContentRect );
// do not display yet, we need to update our backbuffer
{
+ //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aContentRect styleMask: mnStyleMask] display: NO];
}
-
+
UpdateFrameGeometry();
if (nEvent)
@@ -1436,18 +1337,13 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
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];
@@ -1459,14 +1355,11 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect )
rRect.nBottom = static_cast<long>(aRect.origin.y + aRect.size.height - 1);
}
-SalPointerState AquaSalFrame::GetPointerState()
+SalPointerState AquaSalFrame::GetPointerState()
{
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
SalPointerState state;
state.mnState = 0;
-
+
// get position
NSPoint aPt = [mpWindow mouseLocationOutsideOfEventStream];
CocoaToVCL( aPt, false );
@@ -1506,7 +1399,7 @@ SalPointerState AquaSalFrame::GetPointerState()
state.mnState |= KEY_MOD2;
if( (nMask & NSCommandKeyMask) != 0 )
state.mnState |= KEY_MOD1;
-
+
}
else
{
@@ -1517,7 +1410,7 @@ SalPointerState AquaSalFrame::GetPointerState()
// and all mouse events for button state in VCL_NSApllication::sendEvent,
// but it is unclear whether this will get us the same result.
// leave in GetCurrentEventButtonState and GetCurrentEventKeyModifiers for now
-
+
// fill in button state
UInt32 nState = GetCurrentEventButtonState();
state.mnState = 0;
@@ -1527,7 +1420,7 @@ SalPointerState AquaSalFrame::GetPointerState()
state.mnState |= MOUSE_RIGHT; // secondary button
if( nState & 4 )
state.mnState |= MOUSE_MIDDLE; // tertiary button
-
+
// fill in modifier state
nState = GetCurrentEventKeyModifiers();
if( nState & shiftKey )
@@ -1539,8 +1432,8 @@ SalPointerState AquaSalFrame::GetPointerState()
if( nState & cmdKey )
state.mnState |= KEY_MOD1;
}
-
-
+
+
return state;
}
@@ -1551,7 +1444,7 @@ SalFrame::SalIndicatorState AquaSalFrame::GetIndicatorState()
return aState;
}
-void AquaSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
+void AquaSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
{
}
@@ -1564,7 +1457,7 @@ bool AquaSalFrame::SetPluginParent( SystemParentData* pNewParent )
return sal_False;
}
-sal_Bool AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+BOOL AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
return FALSE;
@@ -1582,9 +1475,6 @@ 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;
@@ -1594,15 +1484,8 @@ 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;
}
@@ -1629,18 +1512,13 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
mpParent = (AquaSalFrame*)pNewParent;
// insert to correct parent and paint
Show( bShown );
-}
+}
void AquaSalFrame::UpdateFrameGeometry()
{
- if ( !mpWindow )
- {
- return;
- }
-
// keep in mind that view and window coordinates are lower left
// whereas vcl's are upper left
-
+
// update screen rect
NSScreen * pScreen = [mpWindow screen];
if( pScreen )
@@ -1650,7 +1528,7 @@ void AquaSalFrame::UpdateFrameGeometry()
if( pScreens )
maGeometry.nScreenNumber = [pScreens indexOfObject: pScreen];
}
-
+
NSRect aFrameRect = [mpWindow frame];
NSRect aContentRect = [NSWindow contentRectForFrameRect: aFrameRect styleMask: mnStyleMask];
@@ -1670,7 +1548,7 @@ void AquaSalFrame::UpdateFrameGeometry()
maGeometry.nLeftDecoration = static_cast<unsigned int>(aContentRect.origin.x - aFrameRect.origin.x);
maGeometry.nRightDecoration = static_cast<unsigned int>((aFrameRect.origin.x + aFrameRect.size.width) -
(aContentRect.origin.x + aContentRect.size.width));
-
+
maGeometry.nTopDecoration = static_cast<unsigned int>(aContentRect.origin.y - aFrameRect.origin.y);
maGeometry.nBottomDecoration = static_cast<unsigned int>((aFrameRect.origin.y + aFrameRect.size.height) -
(aContentRect.origin.y + aContentRect.size.height));
@@ -1681,22 +1559,22 @@ void AquaSalFrame::UpdateFrameGeometry()
// -----------------------------------------------------------------------
-void AquaSalFrame::CaptureMouse( sal_Bool bCapture )
+void AquaSalFrame::CaptureMouse( BOOL bCapture )
{
/* Remark:
we'll try to use a pidgin version of capture mouse
on MacOSX (neither carbon nor cocoa) there is a
CaptureMouse equivalent (in Carbon there is TrackMouseLocation
but this is useless to use since it is blocking)
-
+
However on cocoa the active frame seems to get mouse events
also outside the window, so we'll try to forward mouse events
to the capture frame in the hope that one of our frames
gets a mouse event.
-
+
This will break as soon as the user activates another app, but
a mouse click will normally lead to a release of the mouse anyway.
-
+
Let's see how far we get this way. Alternatively we could use one
large overlay window like we did for the carbon implementation,
however that is resource intensive.
@@ -1710,18 +1588,10 @@ void AquaSalFrame::CaptureMouse( sal_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;
-
+
if( mpView && mbShown )
[mpView setNeedsDisplay: YES];
if( mpWindow )
@@ -1731,23 +1601,15 @@ void AquaSalFrame::ResetClipRegion()
}
}
-void AquaSalFrame::BeginSetClipRegion( sal_uLong nRects )
+void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
{
- if ( !mpWindow )
- {
- return;
- }
-
- // #i113170# may not be the main thread if called from UNO API
- SalData::ensureThreadAutoreleasePool();
-
// release old path
if( mrClippingPath )
{
CGPathRelease( mrClippingPath );
mrClippingPath = NULL;
}
-
+
if( maClippingRects.size() > SAL_CLIPRECT_COUNT && nRects < maClippingRects.size() )
{
std::vector<CGRect> aEmptyVec;
@@ -1759,9 +1621,6 @@ void AquaSalFrame::BeginSetClipRegion( sal_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 } };
@@ -1772,14 +1631,6 @@ 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 57d605bed1ce..8da1bf9f3085 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 sal_uInt16 ImplGetModifierMask( unsigned int nMask )
+static USHORT ImplGetModifierMask( unsigned int nMask )
{
- sal_uInt16 nRet = 0;
+ USHORT nRet = 0;
if( (nMask & NSShiftKeyMask) != 0 )
nRet |= KEY_SHIFT;
if( (nMask & NSControlKeyMask) != 0 )
@@ -55,9 +55,9 @@ static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
return nRet;
}
-static sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
+static USHORT ImplMapCharCode( sal_Unicode aCode )
{
- static sal_uInt16 aKeyCodeMap[ 128 ] =
+ static USHORT 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 sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
// tab alone is reported as 0x09 (as expected) but shift-tab is
// reported as 0x19 (end of medium)
- static sal_uInt16 aFunctionKeyCodeMap[ 128 ] =
+ static USHORT 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 sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
0, 0, 0, 0, 0, 0, 0, 0
};
- sal_uInt16 nKeyCode = 0;
+ USHORT nKeyCode = 0;
if( aCode < SAL_N_ELEMENTS( aKeyCodeMap) )
nKeyCode = aKeyCodeMap[ aCode ];
else if( aCode >= 0xf700 && aCode < 0xf780 )
@@ -117,12 +117,12 @@ static sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
static AquaSalFrame* s_pMouseFrame = NULL;
// store the last pressed button for enter/exit events
// which lack that information
-static sal_uInt16 s_nLastButton = 0;
+static USHORT s_nLastButton = 0;
// combinations of keys we need to handle ourselves
static const struct ExceptionalKey
{
- const sal_uInt16 nKeyCode;
+ const USHORT nKeyCode;
const unsigned int nModifierMask;
} aExceptionalKeys[] =
{
@@ -155,9 +155,7 @@ static AquaSalFrame* getMouseContainerFrame()
NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
{ pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
pFrame->VCLToCocoa( aRect );
- 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;
+ return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
}
-(AquaSalFrame*)getSalFrame
@@ -165,30 +163,16 @@ static AquaSalFrame* getMouseContainerFrame()
return mpFrame;
}
--(void)displayIfNeeded
-{
- if( GetSalData() && GetSalData()->mpFirstInstance )
- {
- osl::SolarMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
- if( pMutex )
- {
- pMutex->acquire();
- [super displayIfNeeded];
- pMutex->release();
- }
- }
-}
-
--(BOOL)containsMouse
+-(MacOSBOOL)containsMouse
{
// is this event actually inside that NSWindow ?
NSPoint aPt = [NSEvent mouseLocation];
NSRect aFrameRect = [self frame];
- BOOL bInRect = NSPointInRect( aPt, aFrameRect );
+ MacOSBOOL bInRect = NSPointInRect( aPt, aFrameRect );
return bInRect;
}
--(BOOL)canBecomeKeyWindow
+-(MacOSBOOL)canBecomeKeyWindow
{
if( (mpFrame->mnStyle &
( SAL_FRAME_STYLE_FLOAT |
@@ -211,7 +195,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
- static const sal_uLong nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
+ static const ULONG nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
SAL_FRAME_STYLE_SIZEABLE|
SAL_FRAME_STYLE_CLOSEABLE;
@@ -301,11 +285,11 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(BOOL)windowShouldClose: (NSNotification*)pNotification
+-(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification
{
YIELD_GUARD;
- BOOL bRet = YES;
+ MacOSBOOL bRet = YES;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
// #i84461# end possible input
@@ -348,12 +332,12 @@ static AquaSalFrame* getMouseContainerFrame()
[mDraggingDestinationHandler draggingExited: sender];
}
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler performDragOperation: sender];
}
@@ -399,11 +383,6 @@ static AquaSalFrame* getMouseContainerFrame()
return self;
}
--(AquaSalFrame*)getSalFrame
-{
- return mpFrame;
-}
-
-(void)resetCursorRects
{
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
@@ -414,17 +393,17 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(BOOL)acceptsFirstResponder
+-(MacOSBOOL)acceptsFirstResponder
{
return YES;
}
--(BOOL)acceptsFirstMouse: (NSEvent*)pEvent
+-(MacOSBOOL)acceptsFirstMouse: (NSEvent*)pEvent
{
return YES;
}
--(BOOL)isOpaque
+-(MacOSBOOL)isOpaque
{
return mpFrame ? (mpFrame->getClipPath() != 0 ? NO : YES) : YES;
}
@@ -472,7 +451,7 @@ private:
}
}
--(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent
+-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent
{
YIELD_GUARD;
@@ -528,13 +507,13 @@ private:
if( pDispatchFrame && AquaSalFrame::isAlive( pDispatchFrame ) )
{
- pDispatchFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
+ pDispatchFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
pDispatchFrame->mnLastModifierFlags = [pEvent modifierFlags];
NSPoint aPt = [NSEvent mouseLocation];
pDispatchFrame->CocoaToVCL( aPt );
- sal_uInt16 nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
+ USHORT nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
// #i82284# emulate ctrl left
if( nModMask == KEY_MOD3 && nButton == MOUSE_LEFT )
{
@@ -595,11 +574,8 @@ private:
-(void)mouseEntered: (NSEvent*)pEvent
{
s_pMouseFrame = mpFrame;
-
- // #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];
+
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
}
-(void)mouseExited: (NSEvent*)pEvent
@@ -607,10 +583,7 @@ private:
if( s_pMouseFrame == mpFrame )
s_pMouseFrame = NULL;
- // #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];
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
}
-(void)rightMouseDown: (NSEvent*)pEvent
@@ -668,7 +641,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
const NSTimeInterval fMagnifyTime = [pEvent timestamp];
- mpFrame->mnLastEventTime = static_cast<sal_uLong>( fMagnifyTime * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<ULONG>( fMagnifyTime * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// check if this is a new series of magnify events
@@ -739,7 +712,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -799,7 +772,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -871,7 +844,7 @@ private:
mbNeedSpecialKeyHandle = false;
mbKeyHandled = false;
- mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
if( ! [self handleKeyDownException: pEvent] )
@@ -884,7 +857,7 @@ private:
}
}
--(BOOL)handleKeyDownException:(NSEvent*)pEvent
+-(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent
{
// check for a very special set of modified characters
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
@@ -902,7 +875,7 @@ private:
return YES;
}
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
+ USHORT 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
@@ -928,7 +901,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
}
}
@@ -958,7 +931,7 @@ private:
! [self hasMarkedText ]
)
{
- sal_uInt16 nKeyCode = ImplMapCharCode( aCharCode );
+ USHORT nKeyCode = ImplMapCharCode( aCharCode );
unsigned int nLastModifiers = mpFrame->mnLastModifierFlags;
// #i99567#
@@ -1334,18 +1307,18 @@ private:
}
}
--(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar
+-(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar
{
return [self sendKeyInputAndReleaseToFrame: nKeyCode character: aChar modifiers: mpFrame->mnLastModifierFlags];
}
--(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
return [self sendKeyToFrameDirect: nKeyCode character: aChar modifiers: nMod] ||
[self sendSingleCharacter: mpLastEvent];
}
--(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
YIELD_GUARD;
@@ -1368,20 +1341,20 @@ private:
}
--(BOOL)sendSingleCharacter: (NSEvent *)pEvent
+-(MacOSBOOL)sendSingleCharacter: (NSEvent *)pEvent
{
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
if( pUnmodifiedString && [pUnmodifiedString length] == 1 )
{
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
+ USHORT nKeyCode = ImplMapCharCode( keyChar );
if( nKeyCode != 0 )
{
// don't send unicodes in the private use area
if( keyChar >= 0xf700 && keyChar < 0xf780 )
keyChar = 0;
- BOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
+ MacOSBOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
mbInKeyInput = false;
return bRet;
@@ -1397,9 +1370,9 @@ private:
return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil];
}
-- (BOOL)hasMarkedText
+- (MacOSBOOL)hasMarkedText
{
- BOOL bHasMarkedText;
+ MacOSBOOL bHasMarkedText;
bHasMarkedText = ( mMarkedRange.location != NSNotFound ) &&
( mMarkedRange.length != 0 );
@@ -1466,7 +1439,7 @@ private:
if( len > 0 ) {
NSString *pString = [aString string];
OUString aInsertString( GetOUString( pString ) );
- std::vector<sal_uInt16> aInputFlags = std::vector<sal_uInt16>( std::max( 1, len ), 0 );
+ std::vector<USHORT> aInputFlags = std::vector<USHORT>( std::max( 1, len ), 0 );
for ( int i = 0; i < len; i++ )
{
unsigned int nUnderlineValue;
@@ -1625,12 +1598,12 @@ private:
[mDraggingDestinationHandler draggingExited: sender];
}
--(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(MacOSBOOL)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 0b4f41651aa0..4423a1e6f964 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -80,14 +80,10 @@ 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
@@ -112,7 +108,7 @@ static void initAppMenu()
{
// create the action selector
pMainMenuSelector = [[MainMenuSelector alloc] init];
-
+
// get the proper submenu
NSMenu* pAppMenu = [[pMainMenu itemAtIndex: 0] submenu];
if( pAppMenu )
@@ -131,7 +127,7 @@ static void initAppMenu()
[pNewItem setTarget: pMainMenuSelector];
[pAppMenu insertItem: [NSMenuItem separatorItem] atIndex: 1];
}
-
+
// insert preferences entry
String aPref( ResId( SV_STDTEXT_PREFERENCES, *pMgr ) );
pString = CreateNSString( aPref );
@@ -147,9 +143,9 @@ static void initAppMenu()
[pNewItem setTarget: pMainMenuSelector];
[pAppMenu insertItem: [NSMenuItem separatorItem] atIndex: 3];
}
-
+
// WARNING: ultra ugly code ahead
-
+
// rename standard entries
// rename "Services"
pNewItem = [pAppMenu itemAtIndex: 4];
@@ -208,12 +204,11 @@ static void initAppMenu()
// =======================================================================
-SalMenu* AquaSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
+SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
{
initAppMenu();
-
+
AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar );
- pAquaSalMenu->mpVCLMenu = pVCLMenu;
return pAquaSalMenu;
}
@@ -272,11 +267,11 @@ AquaSalMenu::~AquaSalMenu()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) && mpFrame->mpMenu == this )
const_cast<AquaSalFrame*>(mpFrame)->mpMenu = NULL;
- // this should normally be empty already, but be careful...
+ // this should normally be empty already, but be careful...
for( size_t i = 0; i < maButtons.size(); i++ )
releaseButtonEntry( maButtons[i] );
maButtons.clear();
-
+
// is this leaking in some cases ? the release often leads to a duplicate release
// it seems the parent item gets ownership of the menu
if( mpMenu )
@@ -284,7 +279,7 @@ AquaSalMenu::~AquaSalMenu()
if( mbMenuBar )
{
if( pCurrentMenuBar == this )
- {
+ {
// if the current menubar gets destroyed, set the default menubar
setDefaultMenu();
}
@@ -294,7 +289,7 @@ AquaSalMenu::~AquaSalMenu()
{
// so set the pointer to this AquaSalMenu to NULL
// to protect from calling a dead object
-
+
// in ! mbMenuBar case our mpMenu is actually a SalNSMenu*
// so we can safely cast here
[static_cast<SalNSMenu*>(mpMenu) setSalMenu: NULL];
@@ -340,9 +335,9 @@ sal_Int32 removeUnusedItemsRunner(NSMenu * pMenu)
return drawnItems;
}
-bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags)
+bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags)
{
- // do not use native popup menu when AQUA_NATIVE_MENUS is set to sal_False
+ // do not use native popup menu when AQUA_NATIVE_MENUS is set to FALSE
if( ! VisibleMenuBar() ) {
return false;
}
@@ -356,7 +351,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
NSView * pParentNSView = [pParentNSWindow contentView];
NSView * pPopupNSView = ((AquaSalFrame *) pWin->ImplGetWindow()->ImplGetFrame())->mpView;
NSRect popupFrame = [pPopupNSView frame];
-
+
// since we manipulate the menu below (removing entries)
// let's rather make a copy here and work with that
NSMenu* pCopyMenu = [mpMenu copy];
@@ -370,16 +365,16 @@ 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
- sal_uInt16 nArrangeIndex;
+ USHORT 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;
pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false);
-
+
// #i111992# if this menu was opened due to a key event, prevent dispatching that yet again
if( [pParentNSView respondsToSelector: @selector(clearLastEvent)] )
[pParentNSView performSelector:@selector(clearLastEvent)];
-
+
// open popup menu
NSPopUpButtonCell * pPopUpButtonCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO];
[pPopUpButtonCell setMenu: pCopyMenu];
@@ -388,13 +383,13 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
[pPopUpButtonCell performClickWithFrame:displayPopupFrame inView:pParentNSView];
[pPopUpButtonCell release];
[AquaA11yWrapper setPopupMenuOpen: NO];
-
+
// clean up the copy
[pCopyMenu release];
return true;
}
-int AquaSalMenu::getItemIndexByPos( sal_uInt16 nPos ) const
+int AquaSalMenu::getItemIndexByPos( USHORT nPos ) const
{
int nIndex = 0;
if( nPos == MENU_APPEND )
@@ -419,7 +414,7 @@ void AquaSalMenu::unsetMainMenu()
// remove items from main menu
NSMenu* pMenu = [NSApp mainMenu];
for( int nItems = [pMenu numberOfItems]; nItems > 1; nItems-- )
- [pMenu removeItemAtIndex: 1];
+ [pMenu removeItemAtIndex: 1];
}
void AquaSalMenu::setMainMenu()
@@ -437,7 +432,7 @@ void AquaSalMenu::setMainMenu()
[mpMenu insertItem: pItem atIndex: i+1];
}
pCurrentMenuBar = this;
-
+
// change status item
statusLayout();
}
@@ -493,7 +488,7 @@ void AquaSalMenu::addFallbackMenuItem( NSMenuItem* pNewItem )
// push the item to the back and retain it
[pNewItem retain];
rFallbackMenu.push_back( pNewItem );
-
+
if( pCurrentMenuBar == NULL )
setDefaultMenu();
}
@@ -520,7 +515,7 @@ void AquaSalMenu::removeFallbackMenuItem( NSMenuItem* pOldItem )
}
}
-sal_Bool AquaSalMenu::VisibleMenuBar()
+BOOL AquaSalMenu::VisibleMenuBar()
{
// Enable/disable experimental native menus code?
//
@@ -529,11 +524,11 @@ sal_Bool AquaSalMenu::VisibleMenuBar()
static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
if ( ImplGetSVData()->mbIsTestTool || (pExperimental && !strcasecmp(pExperimental, "FALSE")) )
- return sal_False;
+ return FALSE;
// End of experimental code enable/disable part
- return sal_True;
+ return TRUE;
}
void AquaSalMenu::SetFrame( const SalFrame *pFrame )
@@ -559,7 +554,7 @@ void AquaSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
maItems.insert( maItems.begin() + nPos, pAquaSalMenuItem );
else
{
- OSL_FAIL( "invalid item index in insert" );
+ DBG_ERROR( "invalid item index in insert" );
return;
}
@@ -582,12 +577,12 @@ void AquaSalMenu::RemoveItem( unsigned nPos )
}
else
{
- OSL_FAIL( "invalid item index in remove" );
+ DBG_ERROR( "invalid item index in remove" );
return;
}
-
+
pRemoveItem->mpParentMenu = NULL;
-
+
if( ! mbMenuBar || pCurrentMenuBar == this )
[mpMenu removeItemAtIndex: getItemIndexByPos(nPos)];
}
@@ -604,7 +599,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi
{
subAquaSalMenu->mpParentSalMenu = this;
[pAquaSalMenuItem->mpMenuItem setSubmenu: subAquaSalMenu->mpMenu];
-
+
// set title of submenu
[subAquaSalMenu->mpMenu setTitle: [pAquaSalMenuItem->mpMenuItem title]];
}
@@ -615,7 +610,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi
// let's hope that NSMenu copy does the right thing
NSMenu* pCopy = [subAquaSalMenu->mpMenu copy];
[pAquaSalMenuItem->mpMenuItem setSubmenu: pCopy];
-
+
// set title of submenu
[pCopy setTitle: [pAquaSalMenuItem->mpMenuItem title]];
}
@@ -632,7 +627,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi
}
}
-void AquaSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
+void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
{
if( nPos < maItems.size() )
{
@@ -641,7 +636,7 @@ void AquaSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
}
}
-void AquaSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
+void AquaSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
{
if( nPos < maItems.size() )
{
@@ -657,7 +652,7 @@ void AquaSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSMI, const Image& r
return;
NSImage* pImage = CreateNSImage( rImage );
-
+
[pSalMenuItem->mpMenuItem setImage: pImage];
if( pImage )
[pImage release];
@@ -674,7 +669,7 @@ void AquaSalMenu::SetItemText( unsigned i_nPos, SalMenuItem* i_pSalMenuItem, con
// Delete mnemonics
aText.EraseAllChars( '~' );
-
+
/* #i90015# until there is a correct solution
strip out any appended (.*) in menubar entries
*/
@@ -688,7 +683,7 @@ void AquaSalMenu::SetItemText( unsigned i_nPos, SalMenuItem* i_pSalMenuItem, con
aText.Erase( nPos, nPos2-nPos+1 );
}
}
-
+
NSString* pString = CreateNSString( aText );
if (pString)
{
@@ -702,10 +697,10 @@ void AquaSalMenu::SetItemText( unsigned i_nPos, SalMenuItem* i_pSalMenuItem, con
void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
{
- sal_uInt16 nModifier;
+ USHORT nModifier;
sal_Unicode nCommandKey = 0;
- sal_uInt16 nKeyCode=rKeyCode.GetCode();
+ USHORT nKeyCode=rKeyCode.GetCode();
if( nKeyCode )
{
if ((nKeyCode>=KEY_A) && (nKeyCode<=KEY_Z)) // letter A..Z
@@ -751,7 +746,7 @@ void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, cons
}
else // not even a code ? nonsense -> ignore
return;
-
+
DBG_ASSERT( nCommandKey, "unmapped accelerator key" );
nModifier=rKeyCode.GetAllModifier();
@@ -771,7 +766,7 @@ void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, cons
if(nModifier & KEY_MOD2)
nItemModifier |= NSAlternateKeyMask;
-
+
if(nModifier & KEY_MOD3)
nItemModifier |= NSControlKeyMask;
@@ -787,7 +782,7 @@ void AquaSalMenu::GetSystemMenuData( SystemMenuData* pData )
{
}
-AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( sal_uInt16 i_nItemId )
+AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( USHORT i_nItemId )
{
for( size_t i = 0; i < maButtons.size(); ++i )
{
@@ -805,7 +800,7 @@ void AquaSalMenu::statusLayout()
if( [pView isMemberOfClass: [OOStatusItemView class]] ) // well of course it is
[(OOStatusItemView*)pView layout];
else
- OSL_FAIL( "someone stole our status view" );
+ DBG_ERROR( "someone stole our status view" );
}
}
@@ -827,7 +822,7 @@ bool AquaSalMenu::AddMenuBarButton( const SalMenuButtonItem& i_rNewItem )
{
if( ! mbMenuBar || ! VisibleMenuBar() )
return false;
-
+
MenuBarButtonEntry* pEntry = findButtonItem( i_rNewItem.mnId );
if( pEntry )
{
@@ -843,17 +838,17 @@ bool AquaSalMenu::AddMenuBarButton( const SalMenuButtonItem& i_rNewItem )
maButtons.back().mpNSImage = CreateNSImage( i_rNewItem.maImage );
maButtons.back().mpToolTipString = CreateNSString( i_rNewItem.maToolTipText );
}
-
+
// lazy create status item
SalData::getStatusItem();
-
+
if( pCurrentMenuBar == this )
statusLayout();
-
+
return true;
}
-void AquaSalMenu::RemoveMenuBarButton( sal_uInt16 i_nId )
+void AquaSalMenu::RemoveMenuBarButton( USHORT i_nId )
{
MenuBarButtonEntry* pEntry = findButtonItem( i_nId );
if( pEntry )
@@ -867,23 +862,23 @@ void AquaSalMenu::RemoveMenuBarButton( sal_uInt16 i_nId )
statusLayout();
}
-Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame )
+Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame )
{
if( GetSalData()->mnSystemVersion < VER_LEOPARD )
return Rectangle( Point( -1, -1 ), Size( 1, 1 ) );
-
+
if( ! i_pReferenceFrame || ! AquaSalFrame::isAlive( static_cast<AquaSalFrame*>(i_pReferenceFrame) ) )
return Rectangle();
-
+
MenuBarButtonEntry* pEntry = findButtonItem( i_nItemId );
-
+
if( ! pEntry )
return Rectangle();
-
+
NSStatusItem* pItem = SalData::getStatusItem();
if( ! pItem )
return Rectangle();
-
+
NSView* pView = [pItem view];
if( ! pView )
return Rectangle();
@@ -893,18 +888,18 @@ Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame
NSRect aRect = [pWin frame];
aRect.origin = [pWin convertBaseToScreen: NSMakePoint( 0, 0 )];
-
+
// make coordinates relative to reference frame
static_cast<AquaSalFrame*>(i_pReferenceFrame)->CocoaToVCL( aRect.origin );
aRect.origin.x -= i_pReferenceFrame->maGeometry.nX;
aRect.origin.y -= i_pReferenceFrame->maGeometry.nY + aRect.size.height;
-
- return Rectangle( Point(static_cast<long int>(aRect.origin.x),
+
+ return Rectangle( Point(static_cast<long int>(aRect.origin.x),
static_cast<long int>(aRect.origin.y)
- ),
+ ),
Size( static_cast<long int>(aRect.size.width),
static_cast<long int>(aRect.size.height)
- )
+ )
);
}
diff --git a/vcl/aqua/source/window/salnsmenu.mm b/vcl/aqua/source/window/salnsmenu.mm
index 5c32d880e81f..015c43aed70f 100755
--- a/vcl/aqua/source/window/salnsmenu.mm
+++ b/vcl/aqua/source/window/salnsmenu.mm
@@ -61,7 +61,7 @@
pFrame->CallCallback(SALEVENT_MENUDEACTIVATE, &aMenuEvt);
}
else
- OSL_FAIL( "unconnected menu" );
+ DBG_ERROR( "unconnected menu" );
}
}
}
@@ -121,7 +121,7 @@
pPopupMenu->ImplSelectWithStart( pCurMenu );
}
else
- OSL_FAIL( "menubar item without frame !" );
+ DBG_ERROR( "menubar item without frame !" );
}
}
@end
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 5bc239e26f29..ef8d59f391a3 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,7 +51,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
{
maSysData.nSize = sizeof( maSysData );
maSysData.pView = NULL;
-
+
NSRect aInitFrame = { { 0, 0 }, { 20, 20 } };
mpClipView = [[NSClipView alloc] initWithFrame: aInitFrame ];
if( mpClipView )
@@ -91,7 +91,7 @@ AquaSalObject::~AquaSalObject()
similar effect to non-rectangular windows is achieved by using a
non-opaque window and not painting where one wants the background
to shine through.
-
+
With respect to SalObject this leaves us to having an NSClipView
containing the child view. Even a QTMovieView respects the boundaries of
that, which gives us a clip "region" consisting of one rectangle.
@@ -108,14 +108,14 @@ void AquaSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-sal_uInt16 AquaSalObject::GetClipRegionType()
+USHORT AquaSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void AquaSalObject::BeginSetClipRegion( sal_uLong nRectCount )
+void AquaSalObject::BeginSetClipRegion( ULONG nRectCount )
{
mbClip = false;
}
@@ -179,7 +179,7 @@ void AquaSalObject::setClippedPosSize()
NSView *pView = maSysData.pView;
[pView setFrame: aViewRect];
}
-
+
NSRect aClipViewRect = { { mnX, mnY }, { mnWidth, mnHeight } };
NSPoint aClipPt = { 0, 0 };
if( mbClip )
@@ -192,16 +192,16 @@ void AquaSalObject::setClippedPosSize()
if( mnClipY == 0 )
aClipPt.y = mnHeight - mnClipHeight;;
}
-
+
mpFrame->VCLToCocoa( aClipViewRect, false );
[mpClipView setFrame: aClipViewRect];
-
+
[mpClipView scrollToPoint: aClipPt];
}
// -----------------------------------------------------------------------
-void AquaSalObject::Show( sal_Bool bVisible )
+void AquaSalObject::Show( BOOL bVisible )
{
if( mpClipView )
[mpClipView setHidden: (bVisible ? NO : YES)];
@@ -209,7 +209,7 @@ void AquaSalObject::Show( sal_Bool bVisible )
// -----------------------------------------------------------------------
-void AquaSalObject::Enable( sal_Bool bEnable )
+void AquaSalObject::Enable( BOOL bEnable )
{
}
@@ -238,10 +238,4 @@ 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 b76e8ef99289..e7b835e9870e 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,35 +48,35 @@ struct FPtrHash
class CUPSManager : public PrinterInfoManager
{
- CUPSWrapper* m_pCUPSWrapper;
- boost::unordered_map< FILE*, rtl::OString, FPtrHash > m_aSpoolFiles;
- int m_nDests;
- void* m_pDests;
- bool m_bNewDests;
- boost::unordered_map< rtl::OUString, int, rtl::OUStringHash > m_aCUPSDestMap;
+ CUPSWrapper* m_pCUPSWrapper;
+ std::hash_map< FILE*, rtl::OString, FPtrHash > m_aSpoolFiles;
+ int m_nDests;
+ void* m_pDests;
+ bool m_bNewDests;
+ std::hash_map< rtl::OUString, int, rtl::OUStringHash > m_aCUPSDestMap;
- boost::unordered_map< rtl::OUString, PPDContext, rtl::OUStringHash > m_aDefaultContexts;
+ std::hash_map< rtl::OUString, PPDContext, rtl::OUStringHash > m_aDefaultContexts;
- rtl::OString m_aUser;
+ rtl::OString m_aUser;
// this is a security risk, but the CUPS API demands
// to deliver a pointer to a static buffer containing
// the password, so this cannot be helped
- rtl::OString m_aPassword;
+ rtl::OString m_aPassword;
- osl::Mutex m_aCUPSMutex;
- oslThread m_aDestThread;
+ osl::Mutex m_aCUPSMutex;
+ oslThread m_aDestThread;
CUPSManager( CUPSWrapper* );
virtual ~CUPSManager();
virtual void initialize();
- void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
+ void getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const;
void runDests();
public:
// public for stub
static void runDestThread(void* pMgr);
-
+
static CUPSManager* tryLoadCUPS();
const PPDParser* createCUPSParser( const rtl::OUString& rPrinter );
@@ -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, bool bBanner );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
virtual void setupJobContextData( JobData& rData );
// changes the info about a named printer
@@ -100,7 +100,7 @@ public:
virtual bool removePrinter( const rtl::OUString& rPrinterName, bool bCheckOnly = false );
virtual bool writePrinterConfig();
virtual bool setDefaultPrinter( const rtl::OUString& rPrinterName );
-
+
virtual bool addOrRemovePossible() const;
};
diff --git a/vcl/inc/list.h b/vcl/inc/list.h
index 78c7edce2839..224bfe784514 100644
--- a/vcl/inc/list.h
+++ b/vcl/inc/list.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ extern "C"
typedef struct _list *list;
typedef void (*list_destructor)(void *);
-
+
/*- constructors and a destructor */
list listNewEmpty(void);
#ifdef TEST
diff --git a/vcl/inc/pch/precompiled_vcl.cxx b/vcl/inc/pch/precompiled_vcl.cxx
index 66c95bc3b2e1..dfebb860dd7f 100644
--- a/vcl/inc/pch/precompiled_vcl.cxx
+++ b/vcl/inc/pch/precompiled_vcl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index c07523757071..7b713cdbf9e8 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 0ba501e976b1..85e6faf0e87b 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,7 +56,7 @@
* C3 - CRC-32 of the array of encoding numbers used to generate the subset
*
*/
-
+
#ifndef __SUBFONT_H
#define __SUBFONT_H
@@ -71,11 +71,9 @@
#include <vector>
-#include "vcl/fontcapabilities.hxx"
-
namespace vcl
{
-
+
/*@{*/
typedef sal_Int16 F2Dot14; /**< fixed: 2.14 */
typedef sal_Int32 F16Dot16; /**< fixed: 16.16 */
@@ -168,8 +166,8 @@ namespace vcl
};
#endif
-
-
+
+
/** Structure used by GetTTSimpleGlyphMetrics() and GetTTSimpleCharMetrics() functions */
typedef struct {
@@ -210,11 +208,11 @@ namespace vcl
typedef struct {
char *family; /**< family name */
- sal_uInt16 *ufamily; /**< family name UCS2 */
+ sal_uInt16 *ufamily; /**< family name UCS2 */
char *subfamily; /**< subfamily name */
sal_uInt16 *usubfamily; /**< subfamily name UCS2 */
char *psname; /**< PostScript name */
- sal_uInt16 macStyle; /**< macstyle bits from 'HEAD' table */
+ sal_uInt16 macStyle; /**< macstyle bits from 'HEAD' table */
int weight; /**< value of WeightClass or 0 if can't be determined */
int width; /**< value of WidthClass or 0 if can't be determined */
int pitch; /**< 0: proportianal font, otherwise: monospaced */
@@ -282,7 +280,7 @@ namespace vcl
/**
- * TrueTypeFont constructor.
+ * TrueTypeFont constructor.
* The font file has to be provided as a memory buffer and length
* @param facenum - logical font number within a TTC file. This value is ignored
* for TrueType fonts
@@ -292,7 +290,7 @@ namespace vcl
int OpenTTFontBuffer(void* pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont** ttf); /*FOLD01*/
#if !defined(WIN32) && !defined(OS2)
/**
- * TrueTypeFont constructor.
+ * TrueTypeFont constructor.
* Reads the font file and allocates the memory for the structure.
* on WIN32 the font has to be provided as a memory buffer and length
* @param facenum - logical font number within a TTC file. This value is ignored
@@ -303,12 +301,6 @@ namespace vcl
int OpenTTFontFile(const char *fname, sal_uInt32 facenum, TrueTypeFont** ttf);
#endif
- void getTTScripts(std::vector< sal_uInt32 > &rScriptTags, const unsigned char* pTable, size_t nLength);
- bool getTTCoverage(
- boost::dynamic_bitset<sal_uInt32> &rUnicodeCoverage,
- boost::dynamic_bitset<sal_uInt32> &rCodePageCoverage,
- const unsigned char* pTable, size_t nLength);
-
/**
* TrueTypeFont destructor. Deallocates the memory.
* @ingroup sft
@@ -547,27 +539,45 @@ namespace vcl
*/
void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info);
+#ifdef TEST5
+/**
+ * Returns kerning information for an array of glyphs.
+ * Kerning is not cumulative.
+ * kern[i] contains kerning information for a pair of glyphs at positions i and i+1
+ *
+ * @param ttf pointer to a TrueTypeFont structure
+ * @param glyphs array of source glyphs
+ * @param nglyphs number of glyphs in the array
+ * @param wmode writing mode: 0 - horizontal, 1 - vertical
+ * @param kern array of KernData structures. It should contain nglyphs-1 elements
+ * @see KernData
+ * @ingroup sft
+ *
+ */
+ void KernGlyphs(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern);
+#endif
+
/**
* Returns nonzero if font is a symbol encoded font
*/
int CheckSymbolEncoding(TrueTypeFont* ttf);
-
+
/**
* returns the number of glyphs in a font
*/
int GetTTGlyphCount( TrueTypeFont* ttf );
-
+
/**
* provide access to the raw data of a SFNT-container's subtable
*/
bool GetSfntTable( TrueTypeFont* ttf, int nSubtableIndex,
const sal_uInt8** ppRawBytes, int* pRawLength );
-
+
/*- private definitions */ /*FOLD00*/
struct _TrueTypeFont {
sal_uInt32 tag;
-
+
char *fname;
sal_Int32 fsize;
sal_uInt8 *ptr;
diff --git a/vcl/inc/vcl/ImageListProvider.hxx b/vcl/inc/vcl/ImageListProvider.hxx
index 7fc678b485fd..79f90659ebaa 100644
--- a/vcl/inc/vcl/ImageListProvider.hxx
+++ b/vcl/inc/vcl/ImageListProvider.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx
index 012981fba7cf..ab5ee9f44d88 100644
--- a/vcl/inc/vcl/abstdlg.hxx
+++ b/vcl/inc/vcl/abstdlg.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,9 @@ class Link;
class VCL_DLLPUBLIC VclAbstractDialog
{
public:
- virtual short Execute() = 0;
- //virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ) = 0;
- virtual ~VclAbstractDialog();
+ virtual short Execute() = 0;
+ //virtual void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ) = 0;
+ virtual ~VclAbstractDialog();
};
class VCL_DLLPUBLIC VclAbstractDialog2
@@ -57,7 +57,7 @@ public:
class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog
{
public:
- virtual void EndDialog(long nResult =0) = 0;
+ virtual void EndDialog(long nResult =0) = 0;
};
class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog
@@ -80,13 +80,13 @@ public:
class VCL_DLLPUBLIC VclAbstractDialogFactory
{
public:
- virtual ~VclAbstractDialogFactory(); // needed for export of vtable
- static VclAbstractDialogFactory* Create();
+ virtual ~VclAbstractDialogFactory(); // needed for export of vtable
+ static VclAbstractDialogFactory* Create();
// nDialogId was previously a ResId without ResMgr; the ResourceId is now
// an implementation detail of the factory
- virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId ) = 0;
-
- // creates instance of PasswordToOpenModifyDialog from cui
+ virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId ) = 0;
+
+ // creates instance of PasswordToOpenModifyDialog from cui
virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog( Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
};
diff --git a/vcl/inc/vcl/accel.h b/vcl/inc/vcl/accel.h
index bf3006c9ca7b..86ce9835c5e1 100644
--- a/vcl/inc/vcl/accel.h
+++ b/vcl/inc/vcl/accel.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,11 +43,11 @@ class Accelerator;
class ImplAccelEntry
{
public:
- sal_uInt16 mnId;
- KeyCode maKeyCode;
- Accelerator* mpAccel;
- Accelerator* mpAutoAccel;
- sal_Bool mbEnabled;
+ USHORT mnId;
+ KeyCode maKeyCode;
+ Accelerator* mpAccel;
+ Accelerator* mpAutoAccel;
+ BOOL mbEnabled;
};
// -----------------
@@ -55,8 +55,8 @@ public:
// -----------------
// in KEYCOD.CXX
-void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 );
+void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 );
-#endif // _SV_ACCEL_H
+#endif // _SV_ACCEL_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx
index a7bf623cb20a..7973bb0608f1 100644
--- a/vcl/inc/vcl/accel.hxx
+++ b/vcl/inc/vcl/accel.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,24 +47,24 @@ class VCL_DLLPUBLIC Accelerator : public Resource
friend class ImplAccelManager;
private:
- ImplAccelData* mpData;
- XubString maHelpStr;
- Link maActivateHdl;
- Link maDeactivateHdl;
- Link maSelectHdl;
+ ImplAccelData* mpData;
+ XubString maHelpStr;
+ Link maActivateHdl;
+ Link maDeactivateHdl;
+ Link maSelectHdl;
// Werden vom AcceleratorManager gesetzt
- KeyCode maCurKeyCode;
- sal_uInt16 mnCurId;
- sal_uInt16 mnCurRepeat;
- sal_Bool mbIsCancel;
- sal_Bool* mpDel;
+ KeyCode maCurKeyCode;
+ USHORT mnCurId;
+ USHORT mnCurRepeat;
+ BOOL mbIsCancel;
+ BOOL* mpDel;
SAL_DLLPRIVATE void ImplInit();
SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData );
SAL_DLLPRIVATE void ImplDeleteData();
- SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
- sal_Bool bEnable, Accelerator* pAutoAccel );
+ SAL_DLLPRIVATE void ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
+ BOOL bEnable, Accelerator* pAutoAccel );
SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const;
@@ -75,55 +75,55 @@ public:
Accelerator();
Accelerator( const Accelerator& rAccel );
Accelerator( const ResId& rResId );
- virtual ~Accelerator();
-
- virtual void Activate();
- virtual void Deactivate();
- virtual void Select();
-
- void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode );
- void InsertItem( const ResId& rResId );
- void RemoveItem( sal_uInt16 nItemId );
- void RemoveItem( const KeyCode rKeyCode );
- void Clear();
-
- sal_uInt16 GetCurItemId() const { return mnCurId; }
- const KeyCode& GetCurKeyCode() const { return maCurKeyCode; }
- 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( 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; }
+ virtual ~Accelerator();
+
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Select();
+
+ void InsertItem( USHORT nItemId, const KeyCode& rKeyCode );
+ void InsertItem( const ResId& rResId );
+ void RemoveItem( USHORT nItemId );
+ void RemoveItem( const KeyCode rKeyCode );
+ void Clear();
+
+ USHORT 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;
+ 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 SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; }
const XubString& GetHelpText() const { return maHelpStr; }
- void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
- const Link& GetActivateHdl() const { return maActivateHdl; }
- void SetDeactivateHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
- const Link& GetDeactivateHdl() const { return maDeactivateHdl; }
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return maActivateHdl; }
+ void SetDeactivateHdl( const Link& rLink ) { maDeactivateHdl = rLink; }
+ const Link& GetDeactivateHdl() const { return maDeactivateHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
- Accelerator& operator=( const Accelerator& rAccel );
+ Accelerator& operator=( const Accelerator& rAccel );
};
-#endif // _SV_ACCEL_HXX
+#endif // _SV_ACCEL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/accmgr.hxx b/vcl/inc/vcl/accmgr.hxx
index 2ffa2b366920..e36201420589 100644
--- a/vcl/inc/vcl/accmgr.hxx
+++ b/vcl/inc/vcl/accmgr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,13 +30,11 @@
#define _SV_ACCMGR_HXX
#include <vcl/sv.h>
-#include <vector>
+class ImplAccelList;
class Accelerator;
class KeyCode;
-typedef ::std::vector< Accelerator* > ImplAccelList;
-
// --------------------
// - ImplAccelManager -
// --------------------
@@ -55,13 +53,13 @@ public:
}
~ImplAccelManager();
- sal_Bool InsertAccel( Accelerator* pAccel );
+ BOOL InsertAccel( Accelerator* pAccel );
void RemoveAccel( Accelerator* pAccel );
- void EndSequence( sal_Bool bCancel = sal_False );
- void FlushAccel() { EndSequence( sal_True ); }
+ void EndSequence( BOOL bCancel = FALSE );
+ void FlushAccel() { EndSequence( TRUE ); }
- sal_Bool IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat );
+ BOOL IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat );
};
#endif // _SV_ACCMGR_HXX
diff --git a/vcl/inc/vcl/alpha.hxx b/vcl/inc/vcl/alpha.hxx
index 8bcaf3789528..9d4647fee9dd 100644
--- a/vcl/inc/vcl/alpha.hxx
+++ b/vcl/inc/vcl/alpha.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,55 +55,55 @@ public:
AlphaMask();
AlphaMask( const Bitmap& rBitmap );
AlphaMask( const AlphaMask& rAlphaMask );
- AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = NULL );
+ AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency = NULL );
~AlphaMask();
- AlphaMask& operator=( const Bitmap& rBitmap );
- AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return (AlphaMask&) 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 ); }
+ 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 ); }
- const MapMode& GetPrefMapMode() const { return Bitmap::GetPrefMapMode(); }
- void SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); }
+ const MapMode& GetPrefMapMode() const { return Bitmap::GetPrefMapMode(); }
+ void SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); }
- const Size& GetPrefSize() const { return Bitmap::GetPrefSize(); }
- void SetPrefSize( const Size& rSize ) { Bitmap::SetPrefSize( rSize ); }
+ const Size& GetPrefSize() const { return Bitmap::GetPrefSize(); }
+ void SetPrefSize( const Size& rSize ) { Bitmap::SetPrefSize( rSize ); }
- Size GetSizePixel() const { return Bitmap::GetSizePixel(); }
- void SetSizePixel( const Size& rNewSize ) { Bitmap::SetSizePixel( rNewSize ); }
+ Size GetSizePixel() const { return Bitmap::GetSizePixel(); }
+ void SetSizePixel( const Size& rNewSize ) { Bitmap::SetSizePixel( rNewSize ); }
- sal_uLong GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
- sal_uLong GetChecksum() const { return Bitmap::GetChecksum(); }
+ ULONG GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
+ ULONG GetChecksum() const { return Bitmap::GetChecksum(); }
- Bitmap GetBitmap() const;
+ Bitmap GetBitmap() const;
public:
- 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 );
+ 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 );
public:
- BitmapReadAccess* AcquireReadAccess() { return Bitmap::AcquireReadAccess(); }
- BitmapWriteAccess* AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
- void ReleaseAccess( BitmapReadAccess* pAccess );
+ BitmapReadAccess* AcquireReadAccess() { return Bitmap::AcquireReadAccess(); }
+ BitmapWriteAccess* AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
+ void ReleaseAccess( BitmapReadAccess* pAccess );
public:
- 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 ); }
+ 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 ); }
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 e53a51e0e932..b7b816c2b822 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ enum Disposal
DISPOSE_NOT,
DISPOSE_BACK,
DISPOSE_FULL,
- DISPOSE_PREVIOUS
+ DISPOSE_PREVIOUS
};
enum CycleMode
@@ -66,25 +66,25 @@ enum CycleMode
struct VCL_DLLPUBLIC AnimationBitmap
{
- BitmapEx aBmpEx;
- Point aPosPix;
- Size aSizePix;
- long nWait;
- Disposal eDisposal;
- sal_Bool bUserInput;
+ BitmapEx aBmpEx;
+ Point aPosPix;
+ Size aSizePix;
+ long nWait;
+ Disposal eDisposal;
+ BOOL bUserInput;
AnimationBitmap() {}
AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix,
const Size& rSizePix, long _nWait = 0L,
Disposal _eDisposal = DISPOSE_NOT ) :
- aBmpEx ( rBmpEx ),
- aPosPix ( rPosPix ),
- aSizePix ( rSizePix ),
- nWait ( _nWait ),
- eDisposal ( _eDisposal ),
- bUserInput ( sal_False ) {}
-
- sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
+ aBmpEx ( rBmpEx ),
+ aPosPix ( rPosPix ),
+ aSizePix ( rSizePix ),
+ nWait ( _nWait ),
+ eDisposal ( _eDisposal ),
+ bUserInput ( FALSE ) {}
+
+ BOOL operator==( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aBmpEx == aBmpEx &&
rAnimBmp.aPosPix == aPosPix &&
@@ -94,9 +94,9 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.bUserInput == bUserInput );
}
- sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
+ BOOL operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
- sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
+ 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 ) );
}
- sal_uLong GetChecksum() const;
+ ULONG GetChecksum() const;
};
// -------------------
@@ -115,24 +115,24 @@ struct VCL_DLLPUBLIC AnimationBitmap
struct AInfo
{
- Bitmap aLastSaveBitmap;
- Bitmap aBackBitmap;
- Rectangle aClipRect;
- Size aLastSaveSize;
- Point aLastSavePoint;
- Point aStartOrg;
- Size aStartSize;
- OutputDevice* pOutDev;
- void* pViewData;
- long nExtraData;
- sal_Bool bWithSize;
- sal_Bool bPause;
-
- AInfo() : pOutDev( NULL ),
- pViewData( NULL ),
+ Bitmap aLastSaveBitmap;
+ Bitmap aBackBitmap;
+ Rectangle aClipRect;
+ Size aLastSaveSize;
+ Point aLastSavePoint;
+ Point aStartOrg;
+ Size aStartSize;
+ OutputDevice* pOutDev;
+ void* pViewData;
+ long nExtraData;
+ BOOL bWithSize;
+ BOOL bPause;
+
+ AInfo() : pOutDev( NULL ),
+ pViewData( NULL ),
nExtraData( 0L ),
- bWithSize( sal_False ),
- bPause( sal_False ) {}
+ bWithSize( FALSE ),
+ bPause( FALSE ) {}
};
// -------------------
@@ -141,113 +141,113 @@ struct AInfo
class VCL_DLLPUBLIC Animation
{
- SAL_DLLPRIVATE static sal_uLong mnAnimCount;
-
- List maList;
- List maAInfoList;
- Link maNotifyLink;
- BitmapEx maBitmapEx;
- Timer maTimer;
- Size maGlobalSize;
- List* mpViewList;
- void* mpExtraData;
- long mnLoopCount;
- long mnLoops;
- long mnPos;
- Disposal meLastDisposal;
- CycleMode meCycleMode;
- sal_Bool mbFirst;
- sal_Bool mbIsInAnimation;
- sal_Bool mbWithSize;
- sal_Bool mbLoopTerminated;
- sal_Bool mbIsWaiting;
-
-
- SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout );
+ SAL_DLLPRIVATE static ULONG mnAnimCount;
+
+ List maList;
+ List maAInfoList;
+ Link maNotifyLink;
+ BitmapEx maBitmapEx;
+ Timer maTimer;
+ Size maGlobalSize;
+ List* mpViewList;
+ void* mpExtraData;
+ long mnLoopCount;
+ long mnLoops;
+ long mnPos;
+ Disposal meLastDisposal;
+ CycleMode meCycleMode;
+ BOOL mbFirst;
+ BOOL mbIsInAnimation;
+ BOOL mbWithSize;
+ BOOL mbLoopTerminated;
+ BOOL mbIsWaiting;
+
+
+ SAL_DLLPRIVATE void ImplRestartTimer( ULONG nTimeout );
DECL_DLLPRIVATE_LINK( ImplTimeoutHdl, Timer* );
public:
SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
- SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
+ SAL_DLLPRIVATE ULONG ImplGetCurPos() const { return mnPos; }
-public:
+public:
Animation();
Animation( const Animation& rAnimation );
~Animation();
- Animation& operator=( const Animation& rAnimation );
- sal_Bool operator==( const Animation& rAnimation ) const;
- sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
+ Animation& operator=( const Animation& rAnimation );
+ BOOL operator==( const Animation& rAnimation ) const;
+ BOOL operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
- sal_Bool IsEqual( const Animation& rAnimation ) const;
+ BOOL IsEqual( const Animation& rAnimation ) const;
- sal_Bool IsEmpty() const;
- void SetEmpty();
+ BOOL IsEmpty() const;
+ void SetEmpty();
- void Clear();
+ void Clear();
- sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
+ BOOL Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
- sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
+ 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 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;
+ void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const;
+ void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const;
- sal_Bool IsInAnimation() const { return mbIsInAnimation; }
- sal_Bool IsTransparent() const;
- sal_Bool IsTerminated() const { return mbLoopTerminated; }
+ BOOL IsInAnimation() const { return mbIsInAnimation; }
+ BOOL IsTransparent() const;
+ BOOL IsTerminated() const { return mbLoopTerminated; }
- const Size& GetDisplaySizePixel() const { return maGlobalSize; }
- void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
+ const Size& GetDisplaySizePixel() const { return maGlobalSize; }
+ void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
- const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
- void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
+ const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
+ void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
- sal_uLong GetLoopCount() const { return mnLoopCount; }
- void SetLoopCount( const sal_uLong nLoopCount );
- void ResetLoopCount();
+ ULONG GetLoopCount() const { return mnLoopCount; }
+ void SetLoopCount( const ULONG nLoopCount );
+ void ResetLoopCount();
- void SetCycleMode( CycleMode eMode );
- CycleMode GetCycleMode() const { return meCycleMode; }
+ void SetCycleMode( CycleMode eMode );
+ CycleMode GetCycleMode() const { return meCycleMode; }
- void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
- const Link& GetNotifyHdl() const { return maNotifyLink; }
+ void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
+ const Link& GetNotifyHdl() const { return maNotifyLink; }
- 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 );
+ 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 );
- List* GetAInfoList() { return &maAInfoList; }
- sal_uLong GetSizeBytes() const;
- sal_uLong GetChecksum() const;
+ List* GetAInfoList() { return &maAInfoList; }
+ ULONG GetSizeBytes() const;
+ ULONG GetChecksum() const;
public:
- sal_Bool Convert( BmpConversion eConversion );
- sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
+ BOOL Convert( BmpConversion eConversion );
+ BOOL ReduceColors( USHORT nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
- sal_Bool Invert();
- sal_Bool Mirror( sal_uLong nMirrorFlags );
- sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
- sal_Bool Adjust( short nLuminancePercent = 0,
+ BOOL Invert();
+ BOOL Mirror( ULONG nMirrorFlags );
+ BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
+ BOOL Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
- short nChannelRPercent = 0,
- short nChannelGPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
- sal_Bool Filter( BmpFilter eFilter,
+ BOOL bInvert = FALSE );
+ BOOL Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation );
};
#endif // _SV_ANIMATE_HXX
diff --git a/vcl/inc/vcl/apptypes.hxx b/vcl/inc/vcl/apptypes.hxx
index 42273f6a292c..b2f17a34e8f1 100644
--- a/vcl/inc/vcl/apptypes.hxx
+++ b/vcl/inc/vcl/apptypes.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,14 +37,14 @@
// - Application-Types -
// ---------------------
-#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 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 UNIQUEID_SV_BEGIN 64000
@@ -72,10 +72,10 @@ public:
// - UserActive -
// --------------
-#define USERACTIVE_MOUSEDRAG ((sal_uInt16)0x0001)
-#define USERACTIVE_INPUT ((sal_uInt16)0x0002)
-#define USERACTIVE_MODALDIALOG ((sal_uInt16)0x0004)
-#define USERACTIVE_ALL ((sal_uInt16)0xFFFF)
+#define USERACTIVE_MOUSEDRAG ((USHORT)0x0001)
+#define USERACTIVE_INPUT ((USHORT)0x0002)
+#define USERACTIVE_MODALDIALOG ((USHORT)0x0004)
+#define USERACTIVE_ALL ((USHORT)0xFFFF)
#endif // _VCL_APPTYPES_HXX
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
index 5568cc3b05d8..8cb5af4a77c3 100644
--- a/vcl/inc/vcl/arrange.hxx
+++ b/vcl/inc/vcl/arrange.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,7 +49,7 @@ namespace vcl
or a child WindowArranger (a node in the hierarchy), but never both
*/
- class VCL_DLLPUBLIC WindowArranger
+ class WindowArranger
{
protected:
struct Element
@@ -77,13 +77,11 @@ namespace vcl
Element( Window* i_pWin,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0,
- const Size& i_rMinSize = Size()
+ sal_Int32 i_nExpandPriority = 0
)
: 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 )
@@ -92,7 +90,7 @@ namespace vcl
{}
void deleteChild() { m_pChild.reset(); }
-
+
sal_Int32 getExpandPriority() const;
Size getOptimalSize( WindowSizeType ) const;
bool isVisible() const;
@@ -103,20 +101,13 @@ namespace vcl
WindowArranger* m_pParentArranger;
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 )
@@ -134,7 +125,7 @@ namespace vcl
// be direct children of that window
// violating that condition will result in undefined behavior
virtual void setParentWindow( Window* );
-
+
virtual void setParent( WindowArranger* );
virtual size_t countElements() const = 0;
@@ -148,24 +139,21 @@ namespace vcl
const Element* pEle = getConstElement( i_nIndex );
return pEle ? pEle->m_pElement : NULL;
}
-
+
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 );
return pEle ? pEle->getExpandPriority() : 0;
}
-
+
Size getMinimumSize( size_t i_nIndex ) const
{
const Element* pEle = getConstElement( i_nIndex );
return pEle ? pEle->m_aMinSize : Size();
}
-
+
bool setMinimumSize( size_t i_nIndex, const Size& i_rMinSize )
{
Element* pEle = getElement( i_nIndex );
@@ -185,20 +173,7 @@ namespace vcl
pEle->m_nBottomBorder = i_nBottom;
}
}
-
- 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 )
@@ -213,15 +188,9 @@ 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 VCL_DLLPUBLIC RowOrColumn : public WindowArranger
+ class RowOrColumn : public WindowArranger
{
long m_nBorderWidth;
bool m_bColumn;
@@ -236,7 +205,7 @@ namespace vcl
public:
RowOrColumn( WindowArranger* i_pParent = NULL,
- bool bColumn = true, long i_nBorderWidth = -1 )
+ bool bColumn = true, long i_nBorderWidth = 5 )
: WindowArranger( i_pParent )
, m_nBorderWidth( i_nBorderWidth )
, m_bColumn( bColumn )
@@ -250,7 +219,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, const Size& i_rMinSize = Size(), size_t i_nIndex = ~0 );
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, 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 );
@@ -258,11 +227,11 @@ namespace vcl
size_t addChild( WindowArranger* i_pNewChild, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 )
{ return addChild( boost::shared_ptr<WindowArranger>( i_pNewChild ), i_nExpandPrio, i_nIndex ); }
void remove( boost::shared_ptr<WindowArranger> const & );
-
+
long getBorderWidth() const { return m_nBorderWidth; }
};
- class VCL_DLLPUBLIC LabeledElement : public WindowArranger
+ class LabeledElement : public WindowArranger
{
WindowArranger::Element m_aLabel;
WindowArranger::Element m_aElement;
@@ -280,7 +249,7 @@ namespace vcl
}
public:
- LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = -1 )
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
: WindowArranger( i_pParent )
, m_nDistance( i_nDistance )
, m_nLabelColumnWidth( 0 )
@@ -299,31 +268,31 @@ namespace vcl
void setElement( boost::shared_ptr<WindowArranger> const & );
void setLabelColumnWidth( long i_nWidth )
{ m_nLabelColumnWidth = i_nWidth; }
-
+
Size getLabelSize( WindowSizeType i_eType ) const
{ return m_aLabel.getOptimalSize( i_eType ); }
Size getElementSize( WindowSizeType i_eType ) const
{ return m_aElement.getOptimalSize( i_eType ); }
};
-
- class VCL_DLLPUBLIC LabelColumn : public RowOrColumn
+
+ class LabelColumn : public RowOrColumn
{
long getLabelWidth() const;
public:
- LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = -1 )
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
: RowOrColumn( i_pParent, true, i_nBorderWidth )
{}
virtual ~LabelColumn();
-
+
virtual Size getOptimalSize( WindowSizeType ) const;
virtual void resize();
-
+
// 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, const Size& i_rElementMinSize = Size() );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
};
- class VCL_DLLPUBLIC Indenter : public WindowArranger
+ class Indenter : public WindowArranger
{
long m_nIndent;
WindowArranger::Element m_aElement;
@@ -333,7 +302,7 @@ namespace vcl
{ return i_nIndex == 0 ? &m_aElement : NULL; }
public:
- Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 3*getDefaultBorder() )
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
: WindowArranger( i_pParent )
, m_nIndent( i_nIndent )
{}
@@ -356,8 +325,8 @@ namespace vcl
void setChild( WindowArranger* i_pChild, sal_Int32 i_nExpandPrio = 0 )
{ setChild( boost::shared_ptr<WindowArranger>( i_pChild ), i_nExpandPrio ); }
};
-
- class VCL_DLLPUBLIC Spacer : public WindowArranger
+
+ class Spacer : public WindowArranger
{
WindowArranger::Element m_aElement;
Size m_aSize;
@@ -383,29 +352,28 @@ namespace vcl
virtual bool isVisible() const { return true; }
};
- class VCL_DLLPUBLIC MatrixArranger : public WindowArranger
+ class MatrixArranger : public WindowArranger
{
long m_nBorderX;
long m_nBorderY;
-
+
struct MatrixElement : public WindowArranger::Element
{
sal_uInt32 m_nX;
sal_uInt32 m_nY;
-
+
MatrixElement()
: WindowArranger::Element()
, m_nX( 0 )
, m_nY( 0 )
{}
-
+
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,
- const Size& i_rMinSize = Size()
+ sal_Int32 i_nExpandPriority = 0
)
- : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority, i_rMinSize )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
, m_nX( i_nX )
, m_nY( i_nY )
{
@@ -414,24 +382,19 @@ namespace vcl
std::vector< MatrixElement > m_aElements;
std::map< sal_uInt64, size_t > m_aMatrixMap; // maps (x | (y << 32)) to index in m_aElements
-
+
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 ); }
- 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;
+ Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) 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 = -1,
- long i_nBorderY = -1 )
+ long i_nBorderX = 5,
+ long i_nBorderY = 5 )
: WindowArranger( i_pParent )
, m_nBorderX( i_nBorderX )
, m_nBorderY( i_nBorderY )
@@ -444,7 +407,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, const Size& i_rMinSize = Size() );
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
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 d514977fda38..58195e9ae7dd 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,35 +39,35 @@
// - Defines -
// -----------
-#define BMP_MIRROR_NONE 0x00000000UL
-#define BMP_MIRROR_HORZ 0x00000001UL
-#define BMP_MIRROR_VERT 0x00000002UL
+#define BMP_MIRROR_NONE 0x00000000UL
+#define BMP_MIRROR_HORZ 0x00000001UL
+#define BMP_MIRROR_VERT 0x00000002UL
// -----------------------------------------------------------------------------
-#define BMP_SCALE_NONE 0x00000000UL
-#define BMP_SCALE_FAST 0x00000001UL
-#define BMP_SCALE_INTERPOLATE 0x00000002UL
+#define BMP_SCALE_NONE 0x00000000UL
+#define BMP_SCALE_FAST 0x00000001UL
+#define BMP_SCALE_INTERPOLATE 0x00000002UL
// -----------------------------------------------------------------------------
-#define BMP_DITHER_NONE 0x00000000UL
-#define BMP_DITHER_MATRIX 0x00000001UL
-#define BMP_DITHER_FLOYD 0x00000002UL
-#define BMP_DITHER_FLOYD_16 0x00000004UL
+#define BMP_DITHER_NONE 0x00000000UL
+#define BMP_DITHER_MATRIX 0x00000001UL
+#define BMP_DITHER_FLOYD 0x00000002UL
+#define BMP_DITHER_FLOYD_16 0x00000004UL
// -----------------------------------------------------------------------------
-#define BMP_VECTORIZE_NONE BMP_VECTORIZE_OUTER
-#define BMP_VECTORIZE_INNER 0x00000001UL
-#define BMP_VECTORIZE_OUTER 0x00000002UL
-#define BMP_VECTORIZE_BOUND_ONLY 0x00000004UL
-#define BMP_VECTORIZE_REDUCE_EDGES 0x00000008UL
+#define BMP_VECTORIZE_NONE BMP_VECTORIZE_OUTER
+#define BMP_VECTORIZE_INNER 0x00000001UL
+#define BMP_VECTORIZE_OUTER 0x00000002UL
+#define BMP_VECTORIZE_BOUND_ONLY 0x00000004UL
+#define BMP_VECTORIZE_REDUCE_EDGES 0x00000008UL
// -----------------------------------------------------------------------------
-#define BMP_COL_TRANS Color( 252, 3, 251 )
-#define BMP_COLOR_MONOCHROME_THRESHOLD 128
+#define BMP_COL_TRANS Color( 252, 3, 251 )
+#define BMP_COLOR_MONOCHROME_THRESHOLD 128
// ---------
// - Enums -
@@ -145,6 +145,14 @@ enum BmpFilter
// ------------------------------------------------------------------------
+enum BmpColorMode
+{
+ BMP_COLOR_NORMAL = 0,
+ BMP_COLOR_HIGHCONTRAST = 1,
+ BMP_COLOR_MONOCHROME_BLACK = 2,
+ BMP_COLOR_MONOCHROME_WHITE = 3
+};
+
// --------------------
// - FilterParameters -
// --------------------
@@ -156,28 +164,28 @@ class VCL_DLLPUBLIC BmpFilterParam
friend class Animation;
private:
- BmpFilter meFilter;
- sal_uLong mnProgressStart;
- sal_uLong mnProgressEnd;
+ BmpFilter meFilter;
+ ULONG mnProgressStart;
+ ULONG mnProgressEnd;
public:
struct MosaicTileSize
{
- sal_uLong mnTileWidth;
- sal_uLong mnTileHeight;
+ ULONG mnTileWidth;
+ ULONG mnTileHeight;
};
struct EmbossAngles
{
- sal_uInt16 mnAzimuthAngle100;
- sal_uInt16 mnElevationAngle100;
+ USHORT mnAzimuthAngle100;
+ USHORT mnElevationAngle100;
};
private:
union
{
- sal_uInt16 mnSepiaPercent;
- sal_uInt8 mcSolarGreyThreshold;
+ USHORT mnSepiaPercent;
+ BYTE mcSolarGreyThreshold;
MosaicTileSize maMosaicTileSize;
EmbossAngles maEmbossAngles;
@@ -185,25 +193,25 @@ private:
public:
- BmpFilterParam( sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ BmpFilterParam( ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
meFilter( BMP_FILTER_UNKNOWN ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
- BmpFilterParam( sal_uInt8 cSolarGreyThreshold, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ BmpFilterParam( BYTE cSolarGreyThreshold, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SOLARIZE ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mcSolarGreyThreshold( cSolarGreyThreshold ) {}
- BmpFilterParam( sal_uInt16 nSepiaPercent, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ BmpFilterParam( USHORT nSepiaPercent, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SEPIA ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mnSepiaPercent( nSepiaPercent ) {}
- BmpFilterParam( const Size& rMosaicTileSize, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ BmpFilterParam( const Size& rMosaicTileSize, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
meFilter( BMP_FILTER_MOSAIC ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maMosaicTileSize.mnTileWidth = rMosaicTileSize.Width();
maMosaicTileSize.mnTileHeight= rMosaicTileSize.Height();
}
- BmpFilterParam( sal_uInt16 nEmbossAzimuthAngle100, sal_uInt16 nEmbossElevationAngle100,
- sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
+ BmpFilterParam( USHORT nEmbossAzimuthAngle100, USHORT nEmbossElevationAngle100,
+ ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
meFilter( BMP_FILTER_EMBOSS_GREY ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maEmbossAngles.mnAzimuthAngle100 = nEmbossAzimuthAngle100;
@@ -223,8 +231,8 @@ class Color;
class SvStream;
struct DIBInfoHeader;
class ResId;
-class GDIMetaFile;
-class AlphaMask;
+class GDIMetaFile;
+class AlphaMask;
class OutputDevice;
class SalBitmap;
@@ -259,66 +267,66 @@ public:
SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
- 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,
+ 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,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex );
- SAL_DLLPRIVATE sal_Bool ImplConvolute3( const long* pMatrix, long nDivisor,
+ SAL_DLLPRIVATE BOOL ImplConvolute3( const long* pMatrix, long nDivisor,
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 );
+ 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 );
public:
Bitmap();
Bitmap( const Bitmap& rBitmap );
- Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal = NULL );
+ Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal = NULL );
Bitmap( const ResId& rResId );
Bitmap( SalBitmap* pSalBitmap );
~Bitmap();
Bitmap& operator=( const Bitmap& rBitmap );
- inline sal_Bool operator!() const;
- inline sal_Bool operator==( const Bitmap& rBitmap ) const;
- inline sal_Bool operator!=( const Bitmap& rBitmap ) const;
+ inline BOOL operator!() const;
+ inline BOOL operator==( const Bitmap& rBitmap ) const;
+ inline BOOL operator!=( const Bitmap& rBitmap ) const;
- inline sal_Bool IsSameInstance( const Bitmap& rBmp ) const;
- sal_Bool IsEqual( const Bitmap& rBmp ) const;
+ inline BOOL IsSameInstance( const Bitmap& rBmp ) const;
+ BOOL IsEqual( const Bitmap& rBmp ) const;
- inline sal_Bool IsEmpty() const;
- void SetEmpty();
+ inline BOOL IsEmpty() const;
+ void SetEmpty();
inline const MapMode& GetPrefMapMode() const;
inline void SetPrefMapMode( const MapMode& rMapMode );
@@ -327,7 +335,7 @@ public:
inline void SetPrefSize( const Size& rSize );
Size GetSizePixel() const;
- void SetSizePixel( const Size& rNewSize );
+ void SetSizePixel( const Size& rNewSize );
/**
* The pixel size of a bitmap's source (e.g. an image file)
@@ -338,29 +346,29 @@ public:
void SetSourceSizePixel( const Size& );
- sal_uInt16 GetBitCount() const;
- inline sal_uLong GetColorCount() const;
- inline sal_uLong GetSizeBytes() const;
- sal_Bool HasGreyPalette() const;
+ USHORT GetBitCount() const;
+ inline ULONG GetColorCount() const;
+ inline ULONG GetSizeBytes() const;
+ BOOL HasGreyPalette() const;
/** get system dependent bitmap data
-
+
@param rData
The system dependent BitmapSystemData structure to be filled
-
- @return sal_True if the bitmap has a valid system object (e.g. not empty)
+
+ @return TRUE if the bitmap has a valid system object (e.g. not empty)
*/
bool GetSystemData( BitmapSystemData& rData ) const;
- sal_uLong GetChecksum() const;
+ ULONG GetChecksum() const;
Bitmap CreateDisplayBitmap( OutputDevice* pDisplay );
- Bitmap GetColorTransformedBitmap() const;
+ Bitmap GetColorTransformedBitmap( BmpColorMode eColorMode ) const;
static const BitmapPalette& GetGreyPalette( int nEntries );
public:
- sal_Bool MakeMono( sal_uInt8 cThreshold );
+ BOOL MakeMono( BYTE cThreshold );
/** Convert bitmap format
@@ -368,9 +376,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return sal_True, if the conversion was completed successfully.
+ @return TRUE, if the conversion was completed successfully.
*/
- sal_Bool Convert( BmpConversion eConversion );
+ BOOL Convert( BmpConversion eConversion );
/** Reduce number of colors for the bitmap
@@ -380,9 +388,9 @@ public:
@param eReduce
Algorithm to use for color reduction
- @return sal_True, if the color reduction operation was completed successfully.
+ @return TRUE, if the color reduction operation was completed successfully.
*/
- sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
+ BOOL ReduceColors( USHORT nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
/** Apply a dither algorithm to the bitmap
@@ -397,7 +405,7 @@ public:
@param pDitherPal
A custom palette to be used when dithering (not yet implemented, leave NULL)
*/
- sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+ BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -409,15 +417,15 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return sal_True, if cropping was performed successfully. If
+ @return TRUE, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, sal_False is returned, too!
+ included the bitmap, FALSE is returned, too!
*/
- sal_Bool Crop( const Rectangle& rRectPixel );
+ BOOL Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
- @param nDX
+ @param nDX
Number of pixel to pad at the right border of the bitmap
@param nDY
@@ -426,11 +434,11 @@ public:
@param pInitColor
Color to use for padded pixel
- @return sal_True, if padding was performed successfully. sal_False is
+ @return TRUE, if padding was performed successfully. 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.
*/
- sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
+ BOOL Expand( ULONG nDX, ULONG nDY,
const Color* pInitColor = NULL );
/** Copy a rectangular area from another bitmap
@@ -450,12 +458,12 @@ public:
equal to the object this method is called on, copying takes
place within the same bitmap.
- @return sal_True, if the operation completed successfully. sal_False
+ @return TRUE, if the operation completed successfully. 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.
*/
- sal_Bool CopyPixel( const Rectangle& rRectDst,
+ BOOL CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc,
const Bitmap* pBmpSrc = NULL );
@@ -463,13 +471,13 @@ public:
@param rMask
The mask bitmap in the selected combine operation
-
+
@param eCombine
The combine operation to perform on the bitmap
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool CombineSimple( const Bitmap& rMask,
+ BOOL CombineSimple( const Bitmap& rMask,
BmpCombine eCombine );
/** Alpha-blend the given bitmap against a specified uniform
@@ -486,34 +494,34 @@ public:
@param rBackgroundColor
Background color to use for every pixel during alpha blending
- @return sal_True, if blending was successful, sal_False otherwise
+ @return TRUE, if blending was successful, FALSE otherwise
*/
- sal_Bool Blend( const AlphaMask& rAlpha,
- const Color& rBackgroundColor );
+ BOOL Blend( const AlphaMask& rAlpha,
+ const Color& rBackgroundColor );
/** Fill the entire bitmap with the given color
@param rFillColor
Color value to use for filling
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Erase( const Color& rFillColor );
+ BOOL Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Invert();
-
+ BOOL Invert();
+
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Mirror( sal_uLong nMirrorFlags );
+ BOOL Mirror( ULONG nMirrorFlags );
/** Scale the bitmap
@@ -523,10 +531,10 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Scale( const Size& rNewSize,
- sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ BOOL Scale( const Size& rNewSize,
+ ULONG nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -536,10 +544,10 @@ public:
@param rScaleY
The scale factor in y direction.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Scale( const double& rScaleX, const double& rScaleY,
- sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ BOOL Scale( const double& rScaleX, const double& rScaleY,
+ ULONG nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -552,9 +560,9 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Rotate( long nAngle10, const Color& rFillColor );
+ BOOL Rotate( long nAngle10, const Color& rFillColor );
/** Create on-off mask from bitmap
@@ -572,7 +580,7 @@ public:
@return the resulting bitmask.
*/
- Bitmap CreateMask( const Color& rTransColor, sal_uLong nTol = 0UL ) const;
+ Bitmap CreateMask( const Color& rTransColor, ULONG nTol = 0UL ) const;
/** Create region of similar colors in a given rectangle
@@ -585,37 +593,37 @@ public:
@return the generated region.
*/
- Region CreateRegion( const Color& rColor, const Rectangle& rRect ) const;
+ Region CreateRegion( const Color& rColor, const Rectangle& rRect ) const;
/** Replace all pixel where the given mask is on with the specified color
@param rMask
Mask specifying which pixel should be replaced
-
+
@param rReplaceColor
Color to be placed in all changed pixel
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const Bitmap& rMask, const Color& rReplaceColor );
+ BOOL Replace( const Bitmap& rMask, const Color& rReplaceColor );
/** Merge bitmap with given background color according to specified alpha mask
@param rAlpha
Alpha mask specifying the amount of background color to merge in
-
+
@param rMergeColor
Background color to be used for merging
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
+ BOOL Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
/** Replace all pixel having the search color with the specified color
@param rSearchColor
Color specifying which pixel should be replaced
-
+
@param rReplaceColor
Color to be placed in all changed pixel
@@ -624,15 +632,15 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
+ BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@param pSearchColor
Array of colors specifying which pixel should be replaced
-
+
@param pReplaceColor
Array of colors to be placed in all changed pixel
@@ -644,12 +652,12 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const Color* pSearchColors, const Color* rReplaceColors,
- sal_uLong nColorCount, sal_uLong* pTols = NULL );
+ BOOL Replace( const Color* pSearchColors, const Color* rReplaceColors,
+ ULONG nColorCount, ULONG* pTols = NULL );
- /** Convert the bitmap to a PolyPolygon
+ /** Convert the bitmap to a PolyPolygon
This works by putting continuous areas of the same color into
a polygon, by tracing its bounding line.
@@ -664,10 +672,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Vectorize( PolyPolygon& rPolyPoly,
- sal_uLong nFlags = BMP_VECTORIZE_OUTER,
+ BOOL Vectorize( PolyPolygon& rPolyPoly,
+ ULONG nFlags = BMP_VECTORIZE_OUTER,
const Link* pProgress = NULL );
/** Convert the bitmap to a meta file
@@ -689,10 +697,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce = 0,
- sal_uLong nFlags = BMP_VECTORIZE_INNER,
+ BOOL Vectorize( GDIMetaFile& rMtf, BYTE cReduce = 0,
+ ULONG nFlags = BMP_VECTORIZE_INNER,
const Link* pProgress = NULL );
/** Change various global color characteristics
@@ -718,17 +726,17 @@ public:
(0.0,10.0]. Values outside this range are regarded as 1.0.
@param bInvert
- If sal_True, invert the channel values with the logical 'not' operator
+ If TRUE, invert the channel values with the logical 'not' operator
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Adjust( short nLuminancePercent = 0,
+ BOOL Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
- short nChannelRPercent = 0,
- short nChannelGPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
+ BOOL bInvert = FALSE );
/** Apply specified filter to the bitmap
@@ -740,10 +748,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
-
- @return sal_True, if the operation was completed successfully.
+
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Filter( BmpFilter eFilter,
+ BOOL Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
@@ -754,8 +762,8 @@ public:
public:
- 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;
+ BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE, BOOL bMSOFormat = FALSE );
+ BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap );
@@ -765,35 +773,35 @@ public:
// - Inlines -
// -----------
-inline sal_Bool Bitmap::operator!() const
+inline BOOL Bitmap::operator!() const
{
return( mpImpBmp == NULL );
}
// ------------------------------------------------------------------
-inline sal_Bool Bitmap::operator==( const Bitmap& rBitmap ) const
+inline BOOL Bitmap::operator==( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline sal_Bool Bitmap::operator!=( const Bitmap& rBitmap ) const
+inline BOOL Bitmap::operator!=( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp != mpImpBmp );
}
// ------------------------------------------------------------------
-inline sal_Bool Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
+inline BOOL Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline sal_Bool Bitmap::IsEmpty() const
+inline BOOL Bitmap::IsEmpty() const
{
return( mpImpBmp == NULL );
}
@@ -828,17 +836,17 @@ inline void Bitmap::SetPrefSize( const Size& rSize )
// ------------------------------------------------------------------
-inline sal_uLong Bitmap::GetColorCount() const
+inline ULONG Bitmap::GetColorCount() const
{
- return( 1UL << (sal_uLong) GetBitCount() );
+ return( 1UL << (ULONG) GetBitCount() );
}
// ------------------------------------------------------------------
-inline sal_uLong Bitmap::GetSizeBytes() const
+inline ULONG Bitmap::GetSizeBytes() const
{
const Size aSizePix( GetSizePixel() );
- return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
+ return( ( (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 9a6259fa61eb..79cee2120378 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@
enum TransparentType
{
- TRANSPARENT_NONE,
+ TRANSPARENT_NONE,
TRANSPARENT_COLOR,
TRANSPARENT_BITMAP
};
@@ -55,12 +55,12 @@ class VCL_DLLPUBLIC BitmapEx
private:
- Bitmap aBitmap;
- Bitmap aMask;
- Size aBitmapSize;
- Color aTransparentColor;
- TransparentType eTransparent;
- sal_Bool bAlpha;
+ Bitmap aBitmap;
+ Bitmap aMask;
+ Size aBitmapSize;
+ Color aTransparentColor;
+ TransparentType eTransparent;
+ BOOL bAlpha;
public:
@@ -80,51 +80,51 @@ public:
BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor );
~BitmapEx();
- BitmapEx& operator=( const BitmapEx& rBitmapEx );
- sal_Bool operator==( const BitmapEx& rBitmapEx ) const;
- sal_Bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
- sal_Bool operator!() const { return !aBitmap; }
+ 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 IsEqual( const BitmapEx& rBmpEx ) const;
+ BOOL IsEqual( const BitmapEx& rBmpEx ) const;
- sal_Bool IsEmpty() const;
- void SetEmpty();
- void Clear();
+ BOOL IsEmpty() const;
+ void SetEmpty();
+ void Clear();
- void Draw( OutputDevice* pOutDev,
+ void Draw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
- void Draw( OutputDevice* pOutDev,
+ void Draw( OutputDevice* pOutDev,
const Point& rDestPt, const Size& rDestSize ) const;
- void Draw( OutputDevice* pOutDev,
+ void Draw( OutputDevice* pOutDev,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel ) const;
- sal_Bool IsTransparent() const;
- TransparentType GetTransparentType() const { return eTransparent; }
+ BOOL IsTransparent() const;
+ TransparentType GetTransparentType() const { return eTransparent; }
- Bitmap GetBitmap( const Color* pTransReplaceColor = NULL ) const;
- Bitmap GetMask() const;
+ Bitmap GetBitmap( const Color* pTransReplaceColor = NULL ) const;
+ Bitmap GetMask() const;
- BitmapEx GetColorTransformedBitmapEx() const;
+ BitmapEx GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const;
- sal_Bool IsAlpha() const;
- AlphaMask GetAlpha() const;
+ BOOL IsAlpha() const;
+ AlphaMask GetAlpha() const;
const Size& GetSizePixel() const { return aBitmapSize; }
- void SetSizePixel( const Size& rNewSize );
+ void SetSizePixel( const Size& rNewSize );
- const Size& GetPrefSize() const { return aBitmap.GetPrefSize(); }
- void SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); }
+ const Size& GetPrefSize() const { return aBitmap.GetPrefSize(); }
+ void SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); }
- const MapMode& GetPrefMapMode() const { return aBitmap.GetPrefMapMode(); }
- void SetPrefMapMode( const MapMode& rPrefMapMode ) { aBitmap.SetPrefMapMode( rPrefMapMode ); }
+ const MapMode& GetPrefMapMode() const { return aBitmap.GetPrefMapMode(); }
+ void SetPrefMapMode( const MapMode& rPrefMapMode ) { aBitmap.SetPrefMapMode( rPrefMapMode ); }
- const Color& GetTransparentColor() const { return aTransparentColor; }
- void SetTransparentColor( const Color& rColor ) { aTransparentColor = rColor; }
+ const Color& GetTransparentColor() const { return aTransparentColor; }
+ void SetTransparentColor( const Color& rColor ) { aTransparentColor = rColor; }
- sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); }
- sal_uLong GetSizeBytes() const;
- sal_uLong GetChecksum() const;
+ USHORT GetBitCount() const { return aBitmap.GetBitCount(); }
+ ULONG GetSizeBytes() const;
+ ULONG GetChecksum() const;
public:
@@ -133,9 +133,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return sal_True, if the conversion was completed successfully.
+ @return TRUE, if the conversion was completed successfully.
*/
- sal_Bool Convert( BmpConversion eConversion );
+ 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 sal_True, if the color reduction operation was completed successfully.
+ @return TRUE, if the color reduction operation was completed successfully.
*/
- sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
+ BOOL ReduceColors( USHORT 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
*/
- sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+ BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -171,15 +171,15 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return sal_True, if cropping was performed successfully. If
+ @return TRUE, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, sal_False is returned, too!
+ included the bitmap, FALSE is returned, too!
*/
- sal_Bool Crop( const Rectangle& rRectPixel );
+ BOOL Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
- @param nDX
+ @param nDX
Number of pixel to pad at the right border of the bitmap
@param nDY
@@ -188,13 +188,13 @@ public:
@param pInitColor
Color to use for padded pixel
- @return sal_True, if padding was performed successfully. sal_False is
+ @return TRUE, if padding was performed successfully. 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.
*/
- sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
- const Color* pInitColor = NULL,
- sal_Bool bExpandTransparent = sal_False );
+ BOOL Expand( ULONG nDX, ULONG nDY,
+ const Color* pInitColor = NULL,
+ BOOL bExpandTransparent = 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 sal_True, if the operation completed successfully. sal_False
+ @return TRUE, if the operation completed successfully. 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.
*/
- sal_Bool CopyPixel( const Rectangle& rRectDst,
+ 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 sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Erase( const Color& rFillColor );
+ BOOL Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Invert();
+ BOOL Invert();
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Mirror( sal_uLong nMirrorFlags );
+ BOOL Mirror( ULONG nMirrorFlags );
/** Scale the bitmap
@@ -255,9 +255,9 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ BOOL Scale( const Size& rNewSize, ULONG nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -267,9 +267,9 @@ public:
@param rScaleY
The scale factor in y direction.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ BOOL Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -282,15 +282,15 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Rotate( long nAngle10, const Color& rFillColor );
+ BOOL Rotate( long nAngle10, const Color& rFillColor );
/** Replace all pixel having the search color with the specified color
@param rSearchColor
Color specifying which pixel should be replaced
-
+
@param rReplaceColor
Color to be placed in all changed pixel
@@ -299,15 +299,15 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
+ BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@param pSearchColor
Array of colors specifying which pixel should be replaced
-
+
@param pReplaceColor
Array of colors to be placed in all changed pixel
@@ -319,10 +319,10 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Replace( const Color* pSearchColors, const Color* pReplaceColors,
- sal_uLong nColorCount, const sal_uLong* pTols = NULL );
+ BOOL Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ ULONG nColorCount, const 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 sal_True, invert the channel values with the logical 'not' operator
+ If TRUE, invert the channel values with the logical 'not' operator
- @return sal_True, if the operation was completed successfully.
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Adjust( short nLuminancePercent = 0,
+ BOOL Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
- short nChannelRPercent = 0,
- short nChannelGPercent = 0,
+ short nChannelRPercent = 0,
+ short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- sal_Bool bInvert = sal_False );
+ BOOL bInvert = FALSE );
/** Apply specified filter to the bitmap
@@ -369,10 +369,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
-
- @return sal_True, if the operation was completed successfully.
+
+ @return TRUE, if the operation was completed successfully.
*/
- sal_Bool Filter( BmpFilter eFilter,
+ BOOL Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
@@ -391,8 +391,8 @@ public:
public:
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
static BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);
};
diff --git a/vcl/inc/vcl/bmpacc.hxx b/vcl/inc/vcl/bmpacc.hxx
index 650a60a69077..3c1801b6b798 100644
--- a/vcl/inc/vcl/bmpacc.hxx
+++ b/vcl/inc/vcl/bmpacc.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -89,7 +89,7 @@ private:
BitmapReadAccess() {}
BitmapReadAccess( const BitmapReadAccess& ) {}
- BitmapReadAccess& operator=( const BitmapReadAccess& ) { return *this; }
+ BitmapReadAccess& operator=( const BitmapReadAccess& ) { return *this; }
protected:
Bitmap maBitmap;
@@ -98,12 +98,12 @@ protected:
ColorMask maColorMask;
FncGetPixel mFncGetPixel;
FncSetPixel mFncSetPixel;
- sal_Bool mbModify;
+ BOOL mbModify;
SAL_DLLPRIVATE void ImplCreate( Bitmap& rBitmap );
SAL_DLLPRIVATE void ImplDestroy();
-SAL_DLLPRIVATE sal_Bool ImplSetAccessPointers( sal_uLong nFormat );
+SAL_DLLPRIVATE BOOL ImplSetAccessPointers( 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, sal_Bool bModify );
+ BitmapReadAccess( Bitmap& rBitmap, BOOL bModify );
void Flush();
- void ReAccess( sal_Bool bModify );
+ void ReAccess( BOOL bModify );
public:
BitmapReadAccess( Bitmap& rBitmap );
virtual ~BitmapReadAccess();
- inline sal_Bool operator!() const;
+ inline BOOL operator!() const;
inline long Width() const;
inline long Height() const;
inline Point TopLeft() const;
inline Point BottomRight() const;
- inline sal_Bool IsTopDown() const;
- inline sal_Bool IsBottomUp() const;
+ inline BOOL IsTopDown() const;
+ inline BOOL IsBottomUp() const;
- inline sal_uLong GetScanlineFormat() const;
- inline sal_uLong GetScanlineSize() const;
+ inline ULONG GetScanlineFormat() const;
+ inline ULONG GetScanlineSize() const;
- inline sal_uInt16 GetBitCount() const;
+ inline USHORT GetBitCount() const;
inline BitmapColor GetBestMatchingColor( const BitmapColor& rBitmapColor );
inline Scanline GetBuffer() const;
inline Scanline GetScanline( long nY ) const;
- inline sal_Bool HasPalette() const;
+ inline BOOL HasPalette() const;
inline const BitmapPalette& GetPalette() const;
- inline sal_uInt16 GetPaletteEntryCount() const;
- inline const BitmapColor& GetPaletteColor( sal_uInt16 nColor ) const;
+ inline USHORT GetPaletteEntryCount() const;
+ inline const BitmapColor& GetPaletteColor( USHORT nColor ) const;
inline const BitmapColor& GetBestPaletteColor( const BitmapColor& rBitmapColor ) const;
- sal_uInt16 GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
+ USHORT GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
- inline sal_Bool HasColorMask() const;
+ inline BOOL HasColorMask() const;
inline ColorMask& GetColorMask() const;
- inline BitmapColor GetPixelFromData( const sal_uInt8* pData, long nX ) const;
- inline void SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor );
+ inline BitmapColor GetPixelFromData( const BYTE* pData, long nX ) const;
+ inline void SetPixelOnData( BYTE* pData, long nX, const BitmapColor& rBitmapColor );
inline BitmapColor GetPixel( long nY, long nX ) const;
- inline BitmapColor GetColor( long nY, long nX ) const;
- inline sal_uInt8 GetLuminance( long nY, long nX ) const;
+ inline BitmapColor GetColor( long nY, long nX ) const;
+ inline BYTE GetLuminance( long nY, long nX ) const;
};
// ---------------------
@@ -184,26 +184,26 @@ public:
virtual ~BitmapWriteAccess();
void CopyScanline( long nY, const BitmapReadAccess& rReadAcc );
- void CopyScanline( long nY, ConstScanline aSrcScanline,
- sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize );
+ void CopyScanline( long nY, ConstScanline aSrcScanline,
+ ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize );
void CopyBuffer( const BitmapReadAccess& rReadAcc );
inline void SetPalette( const BitmapPalette& rPalette );
- inline void SetPaletteEntryCount( sal_uInt16 nCount );
- inline void SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor );
+ inline void SetPaletteEntryCount( USHORT nCount );
+ inline void SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor );
inline void SetPixel( long nY, long nX, const BitmapColor& rBitmapColor );
- void SetLineColor();
- void SetLineColor( const Color& rColor );
- Color GetLineColor() const;
+ void SetLineColor();
+ void SetLineColor( const Color& rColor );
+ Color GetLineColor() const;
- void SetFillColor();
- void SetFillColor( const Color& rColor );
- Color GetFillColor() const;
+ void SetFillColor();
+ void SetFillColor( const Color& rColor );
+ Color GetFillColor() const;
- void Erase( const Color& rColor );
+ void Erase( const Color& rColor );
void DrawLine( const Point& rStart, const Point& rEnd );
@@ -219,18 +219,18 @@ public:
private:
BitmapColor* mpLineColor;
- BitmapColor* mpFillColor;
+ BitmapColor* mpFillColor;
BitmapWriteAccess() {}
BitmapWriteAccess( const BitmapWriteAccess& ) : BitmapReadAccess() {}
- BitmapWriteAccess& operator=( const BitmapWriteAccess& ) { return *this; }
+ BitmapWriteAccess& operator=( const BitmapWriteAccess& ) { return *this; }
};
// -------------------
// - Accessor Helper -
// -------------------
-/** This template handles BitmapAccess the RAII way.
+/** This template handles BitmapAccess the RAII way.
Please don't use directly, but the ready-made typedefs for
BitmapReadAccess and BitmapWriteAccess below.
@@ -250,23 +250,23 @@ public:
mrBitmap.ReleaseAccess( mpAccess );
}
- Access* get() { return mpAccess; }
- const Access* get() const { return mpAccess; }
+ Access* get() { return mpAccess; }
+ const Access* get() const { return mpAccess; }
- Access* operator->() { return mpAccess; }
- const Access* operator->() const { return mpAccess; }
+ Access* operator->() { return mpAccess; }
+ const Access* operator->() const { return mpAccess; }
- Access& operator*() { return *mpAccess; }
- const Access& operator*() const { return *mpAccess; }
+ Access& operator*() { return *mpAccess; }
+ const Access& operator*() const { return *mpAccess; }
private:
- Access* mpAccess;
- Bitmap& mrBitmap;
+ Access* mpAccess;
+ Bitmap& mrBitmap;
};
/** This wrapper handles BitmapReadAccess the RAII way.
- Use as follows:
+ Use as follows:
Bitmap aBitmap
ScopedBitmapReadAccess pReadAccess( aBitmap.AcquireReadAccess(), aBitmap );
pReadAccess->SetPixel()...
@@ -280,7 +280,7 @@ typedef ScopedBitmapAccess< BitmapReadAccess > ScopedBitmapReadAccess;
/** This wrapper handles BitmapWriteAccess the RAII way.
- Use as follows:
+ Use as follows:
Bitmap aBitmap
ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap );
pWriteAccess->SetPixel()...
@@ -296,7 +296,7 @@ typedef ScopedBitmapAccess< BitmapWriteAccess > ScopedBitmapWriteAccess;
// - Inlines -
// -----------
-inline sal_Bool BitmapReadAccess::operator!() const
+inline BOOL BitmapReadAccess::operator!() const
{
return( mpBuffer == NULL );
}
@@ -331,22 +331,22 @@ inline Point BitmapReadAccess::BottomRight() const
// ------------------------------------------------------------------
-inline sal_Bool BitmapReadAccess::IsTopDown() const
+inline BOOL BitmapReadAccess::IsTopDown() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- return( mpBuffer ? sal::static_int_cast<sal_Bool>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : sal_False );
+ return( mpBuffer ? sal::static_int_cast<BOOL>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : FALSE );
}
// ------------------------------------------------------------------
-inline sal_Bool BitmapReadAccess::IsBottomUp() const
+inline BOOL BitmapReadAccess::IsBottomUp() const
{
return !IsTopDown();
}
// ------------------------------------------------------------------
-inline sal_uLong BitmapReadAccess::GetScanlineFormat() const
+inline ULONG BitmapReadAccess::GetScanlineFormat() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? BMP_SCANLINE_FORMAT( mpBuffer->mnFormat ) : 0UL );
@@ -354,7 +354,7 @@ inline sal_uLong BitmapReadAccess::GetScanlineFormat() const
// ------------------------------------------------------------------
-inline sal_uLong BitmapReadAccess::GetScanlineSize() const
+inline ULONG BitmapReadAccess::GetScanlineSize() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnScanlineSize : 0UL );
@@ -362,7 +362,7 @@ inline sal_uLong BitmapReadAccess::GetScanlineSize() const
// ------------------------------------------------------------------
-inline sal_uInt16 BitmapReadAccess::GetBitCount() const
+inline USHORT BitmapReadAccess::GetBitCount() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnBitCount : 0 );
@@ -373,7 +373,7 @@ inline sal_uInt16 BitmapReadAccess::GetBitCount() const
inline BitmapColor BitmapReadAccess::GetBestMatchingColor( const BitmapColor& rBitmapColor )
{
if( HasPalette() )
- return BitmapColor( (sal_uInt8) GetBestPaletteIndex( rBitmapColor ) );
+ return BitmapColor( (BYTE) GetBestPaletteIndex( rBitmapColor ) );
else
return rBitmapColor;
}
@@ -397,7 +397,7 @@ inline Scanline BitmapReadAccess::GetScanline( long nY ) const
// ------------------------------------------------------------------
-inline sal_Bool BitmapReadAccess::HasPalette() const
+inline 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 sal_uInt16 BitmapReadAccess::GetPaletteEntryCount() const
+inline USHORT BitmapReadAccess::GetPaletteEntryCount() const
{
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
return( HasPalette() ? mpBuffer->maPalette.GetEntryCount() : 0 );
@@ -421,7 +421,7 @@ inline sal_uInt16 BitmapReadAccess::GetPaletteEntryCount() const
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapReadAccess::GetPaletteColor( sal_uInt16 nColor ) const
+inline const BitmapColor& BitmapReadAccess::GetPaletteColor( USHORT 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 sal_Bool BitmapReadAccess::HasColorMask() const
+inline BOOL BitmapReadAccess::HasColorMask() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- const sal_uLong nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
+ const 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 sal_uInt8* pData, long nX ) const
+inline BitmapColor BitmapReadAccess::GetPixelFromData( const BYTE* 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 sal_uInt8* pData, l
// ------------------------------------------------------------------
-inline void BitmapReadAccess::SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor )
+inline void BitmapReadAccess::SetPixelOnData( BYTE* 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 sal_uInt8 BitmapReadAccess::GetLuminance( long nY, long nX ) const
+inline BYTE 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( sal_uInt16 nCount )
+inline void BitmapWriteAccess::SetPaletteEntryCount( USHORT nCount )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
mpBuffer->maPalette.SetEntryCount( nCount );
@@ -521,7 +521,7 @@ inline void BitmapWriteAccess::SetPaletteEntryCount( sal_uInt16 nCount )
// ------------------------------------------------------------------
-inline void BitmapWriteAccess::SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor )
+inline void BitmapWriteAccess::SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
diff --git a/vcl/inc/vcl/bmpfast.hxx b/vcl/inc/vcl/bmpfast.hxx
index b43df0e115b2..ae4fe0b033af 100644
--- a/vcl/inc/vcl/bmpfast.hxx
+++ b/vcl/inc/vcl/bmpfast.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/brdwin.hxx b/vcl/inc/vcl/brdwin.hxx
index e6374ea032f5..219cbb84bba6 100644
--- a/vcl/inc/vcl/brdwin.hxx
+++ b/vcl/inc/vcl/brdwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,55 +38,55 @@ class ImplBorderWindowView;
// - ImplBorderWindow-Types -
// --------------------------
-#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 | \
- BORDERWINDOW_DRAW_CLOSE | \
- BORDERWINDOW_DRAW_ROLL | \
- BORDERWINDOW_DRAW_DOCK | \
- BORDERWINDOW_DRAW_HIDE | \
- BORDERWINDOW_DRAW_HELP | \
- BORDERWINDOW_DRAW_PIN | \
+#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_DRAW_ALL (BORDERWINDOW_DRAW_TITLE | \
+ BORDERWINDOW_DRAW_BORDER | \
+ BORDERWINDOW_DRAW_FRAME | \
+ BORDERWINDOW_DRAW_CLOSE | \
+ BORDERWINDOW_DRAW_ROLL | \
+ BORDERWINDOW_DRAW_DOCK | \
+ BORDERWINDOW_DRAW_HIDE | \
+ BORDERWINDOW_DRAW_HELP | \
+ BORDERWINDOW_DRAW_PIN | \
BORDERWINDOW_DRAW_MENU)
-#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)
+#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)
// --------------------
// - ImplBorderWindow -
@@ -100,34 +100,34 @@ class ImplBorderWindow : public Window
friend class ImplStdBorderWindowView;
private:
- ImplBorderWindowView* mpBorderView;
- Window* mpMenuBarWindow;
- long mnMinWidth;
- long mnMinHeight;
- long mnMaxWidth;
- long mnMaxHeight;
- long mnRollHeight;
- long mnOrgMenuHeight;
- 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;
+ ImplBorderWindowView* mpBorderView;
+ Window* mpMenuBarWindow;
+ long mnMinWidth;
+ long mnMinHeight;
+ long mnMaxWidth;
+ 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;
using Window::ImplInit;
- void ImplInit( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ void ImplInit( Window* pParent,
+ WinBits nStyle, USHORT nTypeStyle,
SystemParentData* pParentData );
- void ImplInit( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ void ImplInit( Window* pParent,
+ WinBits nStyle, USHORT nTypeStyle,
const ::com::sun::star::uno::Any& );
// Copy assignment is forbidden and not implemented.
@@ -138,57 +138,57 @@ public:
ImplBorderWindow( Window* pParent,
SystemParentData* pParentData,
WinBits nStyle = 0,
- sal_uInt16 nTypeStyle = 0 );
+ USHORT nTypeStyle = 0 );
ImplBorderWindow( Window* pParent, WinBits nStyle = 0,
- sal_uInt16 nTypeStyle = 0 );
+ USHORT nTypeStyle = 0 );
ImplBorderWindow( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ WinBits nStyle, USHORT nTypeStyle,
const ::com::sun::star::uno::Any& );
~ImplBorderWindow();
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Activate();
- virtual void Deactivate();
- virtual void Resize();
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
- void InitView();
- void UpdateView( sal_Bool bNewView, const Size& rNewOutSize );
- void InvalidateBorder();
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void InitView();
+ void UpdateView( BOOL bNewView, const Size& rNewOutSize );
+ void InvalidateBorder();
using Window::Draw;
- void Draw( const Rectangle& rRect, OutputDevice* pDev, const Point& rPos );
-
- 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( 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( sal_Bool bHide );
-
- void SetMinOutputSize( long nWidth, long nHeight )
+ 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 SetCloser();
+ void SetDockButton( BOOL bDockButton );
+ void SetHideButton( BOOL bHideButton );
+ void SetHelpButton( BOOL bHelpButton );
+ void SetMenuButton( BOOL bMenuButton );
+
+ void UpdateMenuHeight();
+ void SetMenuBarWindow( Window* pWindow );
+ void SetMenuBarMode( BOOL bHide );
+
+ void SetMinOutputSize( long nWidth, long nHeight )
{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
- void SetMaxOutputSize( long nWidth, long nHeight )
+ void SetMaxOutputSize( long nWidth, long nHeight )
{ mnMaxWidth = nWidth; mnMaxHeight = nHeight; }
- void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- long CalcTitleWidth() const;
+ long CalcTitleWidth() const;
Rectangle GetMenuRect() const;
};
@@ -201,43 +201,43 @@ public:
struct ImplBorderFrameData
{
- ImplBorderWindow* mpBorderWindow;
- OutputDevice* mpOutDev;
- Rectangle maTitleRect;
- Rectangle maPinRect;
- Rectangle maCloseRect;
- Rectangle maRollRect;
- Rectangle maDockRect;
- Rectangle maMenuRect;
- Rectangle maHideRect;
- Rectangle maHelpRect;
- Point maMouseOff;
- long mnWidth;
- long mnHeight;
- long mnTrackX;
- long mnTrackY;
- long mnTrackWidth;
- long mnTrackHeight;
- sal_Int32 mnLeftBorder;
- sal_Int32 mnTopBorder;
- sal_Int32 mnRightBorder;
- sal_Int32 mnBottomBorder;
- long mnNoTitleTop;
- long mnBorderSize;
- long mnTitleHeight;
- long mnTitleOff;
- 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;
+ ImplBorderWindow* mpBorderWindow;
+ OutputDevice* mpOutDev;
+ Rectangle maTitleRect;
+ Rectangle maPinRect;
+ Rectangle maCloseRect;
+ Rectangle maRollRect;
+ Rectangle maDockRect;
+ Rectangle maMenuRect;
+ Rectangle maHideRect;
+ Rectangle maHelpRect;
+ Point maMouseOff;
+ long mnWidth;
+ long mnHeight;
+ long mnTrackX;
+ long mnTrackY;
+ long mnTrackWidth;
+ long mnTrackHeight;
+ sal_Int32 mnLeftBorder;
+ sal_Int32 mnTopBorder;
+ sal_Int32 mnRightBorder;
+ sal_Int32 mnBottomBorder;
+ long mnNoTitleTop;
+ 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;
};
// =======================================================================
@@ -249,27 +249,27 @@ struct ImplBorderFrameData
class ImplBorderWindowView
{
public:
- virtual ~ImplBorderWindowView();
+ virtual ~ImplBorderWindowView();
- 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 BOOL MouseMove( const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
+ virtual 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,
+ 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( sal_uInt16 nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
+ virtual long CalcTitleWidth() const = 0;
+ virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
virtual Rectangle GetMenuRect() const;
- void ImplInitTitle( ImplBorderFrameData* pData );
- 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;
+ 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 );
+ String ImplRequestHelp( ImplBorderFrameData* pData, const Point& rPos, Rectangle& rHelpRect );
+ long ImplCalcTitleWidth( const ImplBorderFrameData* pData ) const;
};
// =======================================================================
@@ -283,11 +283,11 @@ class ImplNoBorderWindowView : public ImplBorderWindowView
public:
ImplNoBorderWindowView( ImplBorderWindow* pBorderWindow );
- virtual void Init( OutputDevice* pDev, long nWidth, long nHeight );
- virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ virtual void Init( OutputDevice* pDev, long nWidth, long nHeight );
+ virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- virtual long CalcTitleWidth() const;
- virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual long CalcTitleWidth() const;
+ virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -299,24 +299,24 @@ public:
class ImplSmallBorderWindowView : public ImplBorderWindowView
{
- ImplBorderWindow* mpBorderWindow;
- OutputDevice* mpOutDev;
- long mnWidth;
- long mnHeight;
- sal_Int32 mnLeftBorder;
- sal_Int32 mnTopBorder;
- sal_Int32 mnRightBorder;
- sal_Int32 mnBottomBorder;
+ ImplBorderWindow* mpBorderWindow;
+ OutputDevice* mpOutDev;
+ long mnWidth;
+ long mnHeight;
+ sal_Int32 mnLeftBorder;
+ sal_Int32 mnTopBorder;
+ sal_Int32 mnRightBorder;
+ sal_Int32 mnBottomBorder;
bool mbNWFBorder;
public:
ImplSmallBorderWindowView( ImplBorderWindow* pBorderWindow );
- virtual void Init( OutputDevice* pOutDev, long nWidth, long nHeight );
- virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ virtual void Init( OutputDevice* pOutDev, long nWidth, long nHeight );
+ virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- virtual long CalcTitleWidth() const;
- virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual long CalcTitleWidth() const;
+ virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -329,28 +329,28 @@ public:
class ImplStdBorderWindowView : public ImplBorderWindowView
{
- ImplBorderFrameData maFrameData;
- VirtualDevice* mpATitleVirDev;
- VirtualDevice* mpDTitleVirDev;
+ ImplBorderFrameData maFrameData;
+ VirtualDevice* mpATitleVirDev;
+ VirtualDevice* mpDTitleVirDev;
public:
ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow );
~ImplStdBorderWindowView();
- 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 BOOL MouseMove( const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
+ virtual BOOL Tracking( const TrackingEvent& rTEvt );
+ virtual String RequestHelp( const Point& rPos, Rectangle& rHelpRect );
virtual Rectangle GetMenuRect() const;
- virtual void Init( OutputDevice* pDev, long nWidth, long nHeight );
- virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
+ virtual void Init( OutputDevice* pDev, long nWidth, long nHeight );
+ virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- virtual long CalcTitleWidth() const;
- virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual long CalcTitleWidth() const;
+ virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
-#endif // _SV_BRDWIN_HXX
+#endif // _SV_BRDWIN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index ec537f517374..71f962538e76 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,26 +29,25 @@
#ifndef _SV_BTNDLG_HXX
#define _SV_BTNDLG_HXX
-#include <boost/ptr_container/ptr_vector.hpp>
-
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <vcl/dialog.hxx>
struct ImplBtnDlgItem;
+class ImplBtnDlgItemList;
class PushButton;
// ----------------------
// - ButtonDialog-Types -
// ----------------------
-#define BUTTONDIALOG_BUTTON_NOTFOUND ((sal_uInt16)0xFFFF)
+#define BUTTONDIALOG_BUTTON_NOTFOUND ((USHORT)0xFFFF)
-#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)
+#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)
// ----------------
// - ButtonDialog -
@@ -57,20 +56,20 @@ class PushButton;
class VCL_DLLPUBLIC ButtonDialog : public Dialog
{
private:
- boost::ptr_vector<ImplBtnDlgItem> maItemList;
- Size maPageSize;
- Size maCtrlSize;
- long mnButtonSize;
- sal_uInt16 mnCurButtonId;
- sal_uInt16 mnFocusButtonId;
- sal_Bool mbFormat;
- Link maClickHdl;
-
- SAL_DLLPRIVATE void ImplInitButtonDialogData();
- SAL_DLLPRIVATE PushButton* ImplCreatePushButton( sal_uInt16 nBtnFlags );
- SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
+ ImplBtnDlgItemList* mpItemList;
+ Size maPageSize;
+ Size maCtrlSize;
+ long mnButtonSize;
+ USHORT mnCurButtonId;
+ USHORT mnFocusButtonId;
+ BOOL mbFormat;
+ Link maClickHdl;
+
+ SAL_DLLPRIVATE void ImplInitButtonDialogData();
+ SAL_DLLPRIVATE PushButton* ImplCreatePushButton( USHORT nBtnFlags );
+ SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( USHORT nId ) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
- SAL_DLLPRIVATE void ImplPosControls();
+ SAL_DLLPRIVATE void ImplPosControls();
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE ButtonDialog( const ButtonDialog & );
@@ -84,38 +83,38 @@ public:
ButtonDialog( Window* pParent, const ResId& rResId );
~ButtonDialog();
- virtual void Resize();
- virtual void StateChanged( StateChangedType nStateChange );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
- virtual void Click();
+ virtual void Click();
- void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
- const Size& GetPageSizePixel() const { return maPageSize; }
+ void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
+ const Size& GetPageSizePixel() const { return maPageSize; }
- sal_uInt16 GetCurButtonId() const { return mnCurButtonId; }
+ USHORT GetCurButtonId() const { return mnCurButtonId; }
- 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();
- 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 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 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( sal_uInt16 nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
- sal_uInt16 GetFocusButton() const { return mnFocusButtonId; }
+ void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
+ USHORT GetFocusButton() const { return mnFocusButtonId; }
- void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
- const Link& GetClickHdl() const { return maClickHdl; }
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
};
-#endif // _SV_BTNDLG_HXX
+#endif // _SV_BTNDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 9205f9df7661..81da43294217 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,17 +56,17 @@ private:
SAL_DLLPRIVATE Button (const Button &);
SAL_DLLPRIVATE Button & operator= (const Button &);
public:
- 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 USHORT ImplGetButtonState() const;
+ SAL_DLLPRIVATE USHORT& ImplGetButtonState();
+ SAL_DLLPRIVATE USHORT ImplGetTextStyle( XubString& rText, WinBits nWinStyle, ULONG nDrawFlags );
SAL_DLLPRIVATE void ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size& rSize,
- sal_Bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
- sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
+ BOOL bLayout, ULONG nImageSep, ULONG nDrawFlags,
+ USHORT 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( sal_Bool bSmall = sal_True );
+ SAL_DLLPRIVATE void ImplSetSmallSymbol( BOOL bSmall = TRUE );
SAL_DLLPRIVATE const Rectangle& ImplGetSymbolRect() const;
SAL_DLLPRIVATE void ImplSetSymbolRect(const Rectangle&);
@@ -79,6 +79,7 @@ public:
~Button();
virtual void Click();
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
@@ -86,19 +87,19 @@ public:
static XubString GetStandardText( StandardButtonType eButton );
static XubString GetStandardHelpText( StandardButtonType eButton );
- sal_Bool SetModeImage( const Image& rImage );
- const Image GetModeImage( ) const;
- sal_Bool HasImage() const;
+ BOOL SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Image GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
+ BOOL HasImage() const;
void SetImageAlign( ImageAlign eAlign );
ImageAlign GetImageAlign() const;
- sal_Bool SetModeBitmap( const BitmapEx& rBitmap );
- BitmapEx GetModeBitmap( ) const;
+ BOOL SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ BitmapEx GetModeBitmap( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
- void EnableImageDisplay( sal_Bool bEnable );
- sal_Bool IsImageDisplayEnabled();
- void EnableTextDisplay( sal_Bool bEnable );
- sal_Bool IsTextDisplayEnabled();
+ void EnableImageDisplay( BOOL bEnable );
+ BOOL IsImageDisplayEnabled();
+ void EnableTextDisplay( BOOL bEnable );
+ BOOL IsTextDisplayEnabled();
void SetFocusRect( const Rectangle& rFocusRect );
const Rectangle& GetFocusRect() const;
@@ -110,8 +111,8 @@ public:
// - PushButton-Types -
// --------------------
-#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
-#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
+#define PUSHBUTTON_DROPDOWN_TOOLBOX ((USHORT)0x0001)
+#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((USHORT)0x0002)
// --------------
// - PushButton -
@@ -123,21 +124,21 @@ protected:
SymbolType meSymbol;
TriState meState;
TriState meSaveValue;
- sal_uInt16 mnDDStyle;
- sal_Bool mbPressed;
- sal_Bool mbInUserDraw;
+ USHORT mnDDStyle;
+ BOOL mbPressed;
+ BOOL mbInUserDraw;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitPushButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- 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 ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
+ const Rectangle& rRect, bool bLayout );
SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false );
using Button::ImplGetTextStyle;
- 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(); }
+ 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(); }
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE PushButton( const PushButton & );
@@ -148,10 +149,10 @@ protected:
using Control::ImplInitSettings;
using Window::ImplInit;
public:
- 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;
+ 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;
protected:
PushButton( WindowType nType );
@@ -171,7 +172,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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -187,17 +188,17 @@ public:
void SetSymbolAlign( SymbolAlign eAlign );
SymbolAlign GetSymbolAlign() const;
- void SetDropDown( sal_uInt16 nStyle );
- sal_uInt16 GetDropDown() const { return mnDDStyle; }
+ void SetDropDown( USHORT nStyle );
+ USHORT GetDropDown() const { return mnDDStyle; }
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( sal_Bool bCheck = sal_True );
- sal_Bool IsChecked() const;
+ void Check( BOOL bCheck = TRUE );
+ BOOL IsChecked() const;
- void SetPressed( sal_Bool bPressed );
- sal_Bool IsPressed() const { return mbPressed; }
+ void SetPressed( BOOL bPressed );
+ BOOL IsPressed() const { return mbPressed; }
void EndSelection();
@@ -211,12 +212,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void PushButton::Check( sal_Bool bCheck )
+inline void PushButton::Check( BOOL bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline sal_Bool PushButton::IsChecked() const
+inline BOOL PushButton::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
@@ -297,17 +298,18 @@ private:
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
- sal_Bool mbChecked;
- sal_Bool mbSaveValue;
- sal_Bool mbRadioCheck;
- sal_Bool mbStateChanged;
+ Image maImageHC;
+ BOOL mbChecked;
+ BOOL mbSaveValue;
+ BOOL mbRadioCheck;
+ BOOL mbStateChanged;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitRadioButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplDrawRadioButtonState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout = false );
@@ -328,7 +330,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE void ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
+ SAL_DLLPRIVATE void ImplCallClick( BOOL bGrabFocus = FALSE, USHORT nFocusFlags = 0 );
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
@@ -338,14 +340,14 @@ protected:
virtual const Color&
GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
- inline void SetMouseRect( const Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; }
- inline const Rectangle& GetMouseRect( ) const { return maMouseRect; }
- inline void SetStateRect( const Rectangle& _rStateRect ) { maStateRect = _rStateRect; }
- inline const Rectangle& GetStateRect( ) const { return maStateRect; }
+ inline void SetMouseRect( const Rectangle& _rMouseRect ) { maMouseRect = _rMouseRect; }
+ inline const Rectangle& GetMouseRect( ) const { return maMouseRect; }
+ inline void SetStateRect( const Rectangle& _rStateRect ) { maStateRect = _rStateRect; }
+ inline const Rectangle& GetStateRect( ) const { return maStateRect; }
// draws the radio button (the knob image), in it's current state (pressed/checked)
// at the usual location, which can be overridden with SetStateRect
- void DrawRadioButtonState( );
+ void DrawRadioButtonState( );
public:
RadioButton( Window* pParent, WinBits nWinStyle = 0 );
@@ -357,7 +359,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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -367,39 +369,39 @@ public:
virtual void Toggle();
- sal_Bool IsStateChanged() const { return mbStateChanged; }
+ BOOL IsStateChanged() const { return mbStateChanged; }
- void EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
- sal_Bool IsRadioCheckEnabled() const { return mbRadioCheck; }
+ void EnableRadioCheck( BOOL bRadioCheck = TRUE ) { mbRadioCheck = bRadioCheck; }
+ BOOL IsRadioCheckEnabled() const { return mbRadioCheck; }
- sal_Bool SetModeRadioImage( const Image& rImage );
- const Image& GetModeRadioImage( ) const;
+ BOOL SetModeRadioImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Image& GetModeRadioImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
- void SetState( sal_Bool bCheck );
- void Check( sal_Bool bCheck = sal_True );
- sal_Bool IsChecked() const { return mbChecked; }
+ void SetState( BOOL bCheck );
+ void Check( BOOL bCheck = TRUE );
+ BOOL IsChecked() const { return mbChecked; }
void SaveValue() { mbSaveValue = IsChecked(); }
- sal_Bool GetSavedValue() const { return mbSaveValue; }
+ BOOL GetSavedValue() const { return mbSaveValue; }
- static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
+ static Image GetRadioImage( const AllSettings& rSettings, USHORT nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
const Link& GetToggleHdl() const { return maToggleHdl; }
-
+
/** GetRadioButtonGroup returns a list of pointers to <code>RadioButton</code>s in the same group.
-
+
The pointers in the returned list are valid at the time call returns. However rescheduling
or giving up the SolarMutex may mean events get executed that lead to the pointers getting
invalid.
-
+
@param io_rGroup
gets cleared on entering the function. on return contains the <code>RadioButton</code>s
in the same group as this <code>RadioButton</code>.
-
+
@param bIncludeThis
defines whether <code>this</code> is contained in the returned list
*/
@@ -417,14 +419,14 @@ private:
Rectangle maMouseRect;
TriState meState;
TriState meSaveValue;
- sal_Bool mbTriState;
+ BOOL mbTriState;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitCheckBoxData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout );
@@ -449,9 +451,9 @@ protected:
SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; }
- SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
+ SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
public:
- SAL_DLLPRIVATE void ImplCheck();
+ SAL_DLLPRIVATE void ImplCheck();
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
public:
CheckBox( Window* pParent, WinBits nStyle = 0 );
@@ -462,7 +464,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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -475,16 +477,16 @@ public:
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( sal_Bool bCheck = sal_True );
- sal_Bool IsChecked() const;
+ void Check( BOOL bCheck = TRUE );
+ BOOL IsChecked() const;
- void EnableTriState( sal_Bool bTriState = sal_True );
- sal_Bool IsTriStateEnabled() const { return mbTriState; }
+ void EnableTriState( BOOL bTriState = TRUE );
+ BOOL IsTriStateEnabled() const { return mbTriState; }
void SaveValue() { meSaveValue = GetState(); }
TriState GetSavedValue() const { return meSaveValue; }
- static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
+ static Image GetCheckImage( const AllSettings& rSettings, USHORT nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -493,12 +495,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void CheckBox::Check( sal_Bool bCheck )
+inline void CheckBox::Check( BOOL bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline sal_Bool CheckBox::IsChecked() const
+inline BOOL CheckBox::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
diff --git a/vcl/inc/vcl/canvasbitmap.hxx b/vcl/inc/vcl/canvasbitmap.hxx
index e0773257b029..0ad9249fb6f0 100644
--- a/vcl/inc/vcl/canvasbitmap.hxx
+++ b/vcl/inc/vcl/canvasbitmap.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,7 +42,7 @@ namespace vcl
{
namespace unotools
{
- class VCL_DLLPUBLIC VclCanvasBitmap :
+ class VCL_DLLPUBLIC VclCanvasBitmap :
public cppu::WeakImplHelper3< com::sun::star::rendering::XIntegerReadOnlyBitmap,
com::sun::star::rendering::XBitmapPalette,
com::sun::star::rendering::XIntegerBitmapColorSpace >
@@ -67,7 +67,7 @@ namespace unotools
bool m_bSwap;
bool m_bPalette;
- SAL_DLLPRIVATE void setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift );
+ SAL_DLLPRIVATE void setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift );
virtual ~VclCanvasBitmap();
@@ -120,7 +120,7 @@ namespace unotools
are not reflected in this object (copy on write).
*/
explicit VclCanvasBitmap( const BitmapEx& rBitmap );
-
+
/// Retrieve contained bitmap. Call me with locked Solar mutex!
BitmapEx getBitmapEx() const;
};
diff --git a/vcl/inc/vcl/canvastools.hxx b/vcl/inc/vcl/canvastools.hxx
index e82d397a92f0..556af319b871 100644
--- a/vcl/inc/vcl/canvastools.hxx
+++ b/vcl/inc/vcl/canvastools.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,7 +57,7 @@ namespace basegfx
class B2DPolyPolygon;
}
-namespace com { namespace sun { namespace star { namespace geometry
+namespace com { namespace sun { namespace star { namespace geometry
{
struct RealPoint2D;
struct RealSize2D;
@@ -68,7 +68,7 @@ namespace com { namespace sun { namespace star { namespace geometry
struct RealBezierSegment2D;
} } } }
-namespace com { namespace sun { namespace star { namespace rendering
+namespace com { namespace sun { namespace star { namespace rendering
{
class XGraphicDevice;
class XBitmap;
@@ -86,40 +86,40 @@ namespace vcl
/** Create an XPolyPolygon from VCL/Tools polygon
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
- VCL_DLLPUBLIC xPolyPolygonFromPolygon( const ::com::sun::star::uno::Reference<
- ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
- const ::Polygon& inputPolygon );
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
+ VCL_DLLPUBLIC xPolyPolygonFromPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::Polygon& inputPolygon );
/** Create an XPolyPolygon from VCL/Tools polyPolygon
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
- VCL_DLLPUBLIC xPolyPolygonFromPolyPolygon( const ::com::sun::star::uno::Reference<
- ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
- const ::PolyPolygon& inputPolyPolygon );
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >
+ VCL_DLLPUBLIC xPolyPolygonFromPolyPolygon( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::PolyPolygon& inputPolyPolygon );
/** Create an VCL/Tools polygon from a point sequence
*/
- ::Polygon VCL_DLLPUBLIC polygonFromPoint2DSequence(
- const ::com::sun::star::uno::Sequence<
+ ::Polygon VCL_DLLPUBLIC polygonFromPoint2DSequence(
+ const ::com::sun::star::uno::Sequence<
::com::sun::star::geometry::RealPoint2D >& rPoints );
/** Create an VCL/Tools polyPolygon from a point sequence sequence
*/
- ::PolyPolygon VCL_DLLPUBLIC polyPolygonFromPoint2DSequenceSequence(
- const ::com::sun::star::uno::Sequence<
+ ::PolyPolygon VCL_DLLPUBLIC polyPolygonFromPoint2DSequenceSequence(
+ const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& rPoints );
/** Create an VCL/Tools polygon from a bezier segment sequence
*/
- ::Polygon VCL_DLLPUBLIC polygonFromBezier2DSequence(
- const ::com::sun::star::uno::Sequence<
+ ::Polygon VCL_DLLPUBLIC polygonFromBezier2DSequence(
+ const ::com::sun::star::uno::Sequence<
::com::sun::star::geometry::RealBezierSegment2D >& rPoints );
/** Create an VCL/Tools polyPolygon from a bezier segment sequence sequence
*/
- ::PolyPolygon VCL_DLLPUBLIC polyPolygonFromBezier2DSequenceSequence(
- const ::com::sun::star::uno::Sequence<
+ ::PolyPolygon VCL_DLLPUBLIC polyPolygonFromBezier2DSequenceSequence(
+ const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& rPoints );
// Bitmap conversions
@@ -127,21 +127,21 @@ namespace vcl
/** Create an XBitmap from VCL Bitmap
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
- VCL_DLLPUBLIC xBitmapFromBitmap( const ::com::sun::star::uno::Reference<
- ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
- const ::Bitmap& inputBitmap );
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
+ VCL_DLLPUBLIC xBitmapFromBitmap( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::Bitmap& inputBitmap );
/** Create an XBitmap from VCL BitmapEx
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
- VCL_DLLPUBLIC xBitmapFromBitmapEx( const ::com::sun::star::uno::Reference<
- ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
- const ::BitmapEx& inputBitmap );
+ ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap >
+ VCL_DLLPUBLIC xBitmapFromBitmapEx( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice,
+ const ::BitmapEx& inputBitmap );
/** Create a BitmapEx from an XBitmap
*/
- ::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference<
+ ::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XIntegerReadOnlyBitmap >& xInputBitmap );
/** get a unique identifier for identification in XUnoTunnel interface
@@ -157,7 +157,7 @@ namespace vcl
Note that this method assumes a color space equivalent to
the one returned from createStandardColorSpace()
*/
- ::com::sun::star::uno::Sequence< double >
+ ::com::sun::star::uno::Sequence< double >
VCL_DLLPUBLIC colorToStdColorSpaceSequence( const Color& rColor );
/** Convert color to device color sequence
@@ -168,9 +168,9 @@ namespace vcl
@param xColorSpace
Color space to convert into
*/
- ::com::sun::star::uno::Sequence< double >
+ ::com::sun::star::uno::Sequence< double >
VCL_DLLPUBLIC colorToDoubleSequence( const Color& rColor,
- const ::com::sun::star::uno::Reference<
+ const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XColorSpace >& xColorSpace );
/** Convert from standard device color space to VCL/Tools color
@@ -178,7 +178,7 @@ namespace vcl
Note that this method assumes a color space equivalent to
the one returned from createStandardColorSpace()
*/
- Color VCL_DLLPUBLIC stdColorSpaceSequenceToColor(
+ Color VCL_DLLPUBLIC stdColorSpaceSequenceToColor(
const ::com::sun::star::uno::Sequence< double >& rColor );
/** Convert color to device color sequence
@@ -190,7 +190,7 @@ namespace vcl
Color space to convert from
*/
Color VCL_DLLPUBLIC doubleSequenceToColor( const ::com::sun::star::uno::Sequence< double > rColor,
- const ::com::sun::star::uno::Reference<
+ const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XColorSpace >& xColorSpace );
/// Convert [0,1] double value to [0,255] int
@@ -213,41 +213,41 @@ namespace vcl
// Geometry conversions (vcl/tools <-> x)
// ===================================================================
- // geometry::Real
- ::com::sun::star::geometry::RealSize2D VCL_DLLPUBLIC size2DFromSize( const Size& );
- ::com::sun::star::geometry::RealPoint2D VCL_DLLPUBLIC point2DFromPoint( const Point& );
- ::com::sun::star::geometry::RealRectangle2D VCL_DLLPUBLIC rectangle2DFromRectangle( const Rectangle& );
+ // geometry::Real
+ ::com::sun::star::geometry::RealSize2D VCL_DLLPUBLIC size2DFromSize( const Size& );
+ ::com::sun::star::geometry::RealPoint2D VCL_DLLPUBLIC point2DFromPoint( const Point& );
+ ::com::sun::star::geometry::RealRectangle2D VCL_DLLPUBLIC rectangle2DFromRectangle( const Rectangle& );
- Size VCL_DLLPUBLIC sizeFromRealSize2D( const ::com::sun::star::geometry::RealSize2D& );
- Point VCL_DLLPUBLIC pointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& );
- Rectangle VCL_DLLPUBLIC rectangleFromRealRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& );
+ Size VCL_DLLPUBLIC sizeFromRealSize2D( const ::com::sun::star::geometry::RealSize2D& );
+ Point VCL_DLLPUBLIC pointFromRealPoint2D( const ::com::sun::star::geometry::RealPoint2D& );
+ Rectangle VCL_DLLPUBLIC rectangleFromRealRectangle2D( const ::com::sun::star::geometry::RealRectangle2D& );
- // geometry::Integer
- ::com::sun::star::geometry::IntegerSize2D VCL_DLLPUBLIC integerSize2DFromSize( const Size& );
- ::com::sun::star::geometry::IntegerPoint2D VCL_DLLPUBLIC integerPoint2DFromPoint( const Point& );
- ::com::sun::star::geometry::IntegerRectangle2D VCL_DLLPUBLIC integerRectangle2DFromRectangle( const Rectangle& );
+ // geometry::Integer
+ ::com::sun::star::geometry::IntegerSize2D VCL_DLLPUBLIC integerSize2DFromSize( const Size& );
+ ::com::sun::star::geometry::IntegerPoint2D VCL_DLLPUBLIC integerPoint2DFromPoint( const Point& );
+ ::com::sun::star::geometry::IntegerRectangle2D VCL_DLLPUBLIC integerRectangle2DFromRectangle( const Rectangle& );
- Size VCL_DLLPUBLIC sizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& );
- Point VCL_DLLPUBLIC pointFromIntegerPoint2D( const ::com::sun::star::geometry::IntegerPoint2D& );
- Rectangle VCL_DLLPUBLIC rectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& );
+ Size VCL_DLLPUBLIC sizeFromIntegerSize2D( const ::com::sun::star::geometry::IntegerSize2D& );
+ Point VCL_DLLPUBLIC pointFromIntegerPoint2D( const ::com::sun::star::geometry::IntegerPoint2D& );
+ Rectangle VCL_DLLPUBLIC rectangleFromIntegerRectangle2D( const ::com::sun::star::geometry::IntegerRectangle2D& );
- // basegfx::B2D
- Size VCL_DLLPUBLIC sizeFromB2DSize( const ::basegfx::B2DVector& );
- Point VCL_DLLPUBLIC pointFromB2DPoint( const ::basegfx::B2DPoint& );
- Rectangle VCL_DLLPUBLIC rectangleFromB2DRectangle( const ::basegfx::B2DRange& );
+ // basegfx::B2D
+ Size VCL_DLLPUBLIC sizeFromB2DSize( const ::basegfx::B2DVector& );
+ Point VCL_DLLPUBLIC pointFromB2DPoint( const ::basegfx::B2DPoint& );
+ Rectangle VCL_DLLPUBLIC rectangleFromB2DRectangle( const ::basegfx::B2DRange& );
- basegfx::B2DVector VCL_DLLPUBLIC b2DSizeFromSize( const Size& );
- basegfx::B2DPoint VCL_DLLPUBLIC b2DPointFromPoint( const Point& );
- basegfx::B2DRange VCL_DLLPUBLIC b2DRectangleFromRectangle( const Rectangle& );
+ basegfx::B2DVector VCL_DLLPUBLIC b2DSizeFromSize( const Size& );
+ basegfx::B2DPoint VCL_DLLPUBLIC b2DPointFromPoint( const Point& );
+ basegfx::B2DRange VCL_DLLPUBLIC b2DRectangleFromRectangle( const Rectangle& );
// basegfx::B2I
- Size VCL_DLLPUBLIC sizeFromB2ISize( const ::basegfx::B2IVector& );
- Point VCL_DLLPUBLIC pointFromB2IPoint( const ::basegfx::B2IPoint& );
- Rectangle VCL_DLLPUBLIC rectangleFromB2IRectangle( const ::basegfx::B2IRange& );
+ Size VCL_DLLPUBLIC sizeFromB2ISize( const ::basegfx::B2IVector& );
+ Point VCL_DLLPUBLIC pointFromB2IPoint( const ::basegfx::B2IPoint& );
+ Rectangle VCL_DLLPUBLIC rectangleFromB2IRectangle( const ::basegfx::B2IRange& );
- basegfx::B2IVector VCL_DLLPUBLIC b2ISizeFromSize( const Size& );
- basegfx::B2IPoint VCL_DLLPUBLIC b2IPointFromPoint( const Point& );
- basegfx::B2IRange VCL_DLLPUBLIC b2IRectangleFromRectangle( const Rectangle& );
+ basegfx::B2IVector VCL_DLLPUBLIC b2ISizeFromSize( const Size& );
+ basegfx::B2IPoint VCL_DLLPUBLIC b2IPointFromPoint( const Point& );
+ basegfx::B2IRange VCL_DLLPUBLIC b2IRectangleFromRectangle( const Rectangle& );
}
}
diff --git a/vcl/inc/vcl/cmdevt.h b/vcl/inc/vcl/cmdevt.h
index 0ecf03ca22bb..2143d40b398a 100644
--- a/vcl/inc/vcl/cmdevt.h
+++ b/vcl/inc/vcl/cmdevt.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,31 +33,31 @@
// - CommandVoiceData -
// --------------------
-#define DICTATIONCOMMAND_SYSTEM 0x1000
-#define DICTATIONCOMMAND_USER 0x2000
+#define DICTATIONCOMMAND_SYSTEM 0x1000
+#define DICTATIONCOMMAND_USER 0x2000
-#define DICTATIONCOMMAND_UNKNOWN 0x0001
-#define DICTATIONCOMMAND_NEWPARAGRAPH 0x0002
-#define DICTATIONCOMMAND_NEWLINE 0x0003
-#define DICTATIONCOMMAND_BOLD_ON 0x0004
-#define DICTATIONCOMMAND_BOLD_OFF 0x0005
-#define DICTATIONCOMMAND_ITALIC_ON 0x0006
-#define DICTATIONCOMMAND_ITALIC_OFF 0x0007
-#define DICTATIONCOMMAND_UNDERLINE_ON 0x0008
-#define DICTATIONCOMMAND_UNDERLINE_OFF 0x0009
-#define DICTATIONCOMMAND_NUMBERING_ON 0x0010
-#define DICTATIONCOMMAND_NUMBERING_OFF 0x0011
-#define DICTATIONCOMMAND_TAB 0x0012
-#define DICTATIONCOMMAND_LEFT 0x0013
-#define DICTATIONCOMMAND_RIGHT 0x0014
-#define DICTATIONCOMMAND_UP 0x0015
-#define DICTATIONCOMMAND_DOWN 0x0016
-#define DICTATIONCOMMAND_UNDO 0x0017
-#define DICTATIONCOMMAND_REPEAT 0x0018
-#define DICTATIONCOMMAND_DEL 0x0019
+#define DICTATIONCOMMAND_UNKNOWN 0x0001
+#define DICTATIONCOMMAND_NEWPARAGRAPH 0x0002
+#define DICTATIONCOMMAND_NEWLINE 0x0003
+#define DICTATIONCOMMAND_BOLD_ON 0x0004
+#define DICTATIONCOMMAND_BOLD_OFF 0x0005
+#define DICTATIONCOMMAND_ITALIC_ON 0x0006
+#define DICTATIONCOMMAND_ITALIC_OFF 0x0007
+#define DICTATIONCOMMAND_UNDERLINE_ON 0x0008
+#define DICTATIONCOMMAND_UNDERLINE_OFF 0x0009
+#define DICTATIONCOMMAND_NUMBERING_ON 0x0010
+#define DICTATIONCOMMAND_NUMBERING_OFF 0x0011
+#define DICTATIONCOMMAND_TAB 0x0012
+#define DICTATIONCOMMAND_LEFT 0x0013
+#define DICTATIONCOMMAND_RIGHT 0x0014
+#define DICTATIONCOMMAND_UP 0x0015
+#define DICTATIONCOMMAND_DOWN 0x0016
+#define DICTATIONCOMMAND_UNDO 0x0017
+#define DICTATIONCOMMAND_REPEAT 0x0018
+#define DICTATIONCOMMAND_DEL 0x0019
-#define DICTATIONCOMMAND_COMMANDMODE (DICTATIONCOMMAND_SYSTEM + 1)
-#define DICTATIONCOMMAND_DICTATIONMODE (DICTATIONCOMMAND_SYSTEM + 2)
+#define DICTATIONCOMMAND_COMMANDMODE (DICTATIONCOMMAND_SYSTEM + 1)
+#define DICTATIONCOMMAND_DICTATIONMODE (DICTATIONCOMMAND_SYSTEM + 2)
#endif // _VCL_CMDEVT_H
diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx
index c71160b3fce1..02ffb79bd3f4 100644
--- a/vcl/inc/vcl/cmdevt.hxx
+++ b/vcl/inc/vcl/cmdevt.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,54 +39,54 @@
// - CommandExtTextInputData -
// ---------------------------
-#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_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 ((sal_uInt16)0x0001)
-#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
+#define EXTTEXTINPUT_CURSOR_INVISIBLE ((USHORT)0x0001)
+#define EXTTEXTINPUT_CURSOR_OVERWRITE ((USHORT)0x0002)
class VCL_DLLPUBLIC CommandExtTextInputData
{
private:
XubString maText;
- sal_uInt16* mpTextAttr;
+ USHORT* mpTextAttr;
xub_StrLen mnCursorPos;
xub_StrLen mnDeltaStart;
xub_StrLen mnOldTextLen;
- sal_uInt16 mnCursorFlags;
- sal_Bool mbOnlyCursor;
+ USHORT mnCursorFlags;
+ BOOL mbOnlyCursor;
public:
CommandExtTextInputData();
CommandExtTextInputData( const XubString& rText,
- const sal_uInt16* pTextAttr,
+ const USHORT* pTextAttr,
xub_StrLen nCursorPos,
- sal_uInt16 nCursorFlags,
+ USHORT nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- sal_Bool bOnlyCursor );
+ BOOL bOnlyCursor );
CommandExtTextInputData( const CommandExtTextInputData& rData );
~CommandExtTextInputData();
const XubString& GetText() const { return maText; }
- const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
- sal_uInt16 GetCharTextAttr( sal_uInt16 nIndex ) const;
+ const USHORT* GetTextAttr() const { return mpTextAttr; }
+ USHORT GetCharTextAttr( USHORT nIndex ) const;
xub_StrLen GetCursorPos() const { return mnCursorPos; }
- 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; }
+ BOOL IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
+ BOOL IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
+ USHORT GetCursorFlags() const { return mnCursorFlags; }
xub_StrLen GetDeltaStart() const { return mnDeltaStart; }
xub_StrLen GetOldTextLen() const { return mnOldTextLen; }
- sal_Bool IsOnlyCursorChanged() const { return mbOnlyCursor; }
+ BOOL IsOnlyCursorChanged() const { return mbOnlyCursor; }
};
-inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
+inline USHORT CommandExtTextInputData::GetCharTextAttr( USHORT nIndex ) const
{
if ( mpTextAttr && (nIndex < maText.Len()) )
return mpTextAttr[nIndex];
@@ -124,47 +124,47 @@ inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
// - CommandWheelData -
// --------------------
-#define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
-#define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
-#define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
+#define COMMAND_WHEEL_SCROLL ((USHORT)0x0001)
+#define COMMAND_WHEEL_ZOOM ((USHORT)0x0002)
+#define COMMAND_WHEEL_DATAZOOM ((USHORT)0x0004)
-#define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
+#define COMMAND_WHEEL_PAGESCROLL ((ULONG)0xFFFFFFFF)
class VCL_DLLPUBLIC CommandWheelData
{
private:
long mnDelta;
long mnNotchDelta;
- sal_uLong mnLines;
- sal_uInt16 mnMode;
- sal_uInt16 mnCode;
- sal_Bool mbHorz;
- sal_Bool mbDeltaIsPixel;
+ ULONG mnLines;
+ USHORT mnMode;
+ USHORT mnCode;
+ BOOL mbHorz;
+ BOOL mbDeltaIsPixel;
public:
CommandWheelData();
CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- sal_uLong nScrollLines,
- sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
- sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
+ ULONG nScrollLines,
+ USHORT nWheelMode, USHORT nKeyModifier,
+ BOOL bHorz = FALSE, BOOL bDeltaIsPixel = FALSE );
long GetDelta() const { return mnDelta; }
long GetNotchDelta() const { return mnNotchDelta; }
- sal_uLong GetScrollLines() const { return mnLines; }
- sal_Bool IsHorz() const { return mbHorz; }
- sal_Bool IsDeltaPixel() const { return mbDeltaIsPixel; }
+ ULONG GetScrollLines() const { return mnLines; }
+ BOOL IsHorz() const { return mbHorz; }
+ BOOL IsDeltaPixel() const { return mbDeltaIsPixel; }
- sal_uInt16 GetMode() const { return mnMode; }
+ USHORT GetMode() const { return mnMode; }
- sal_uInt16 GetModifier() const
+ USHORT GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
- bool IsShift() const
+ BOOL IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- sal_Bool IsMod1() const
+ BOOL IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- sal_Bool IsMod2() const
+ BOOL IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- sal_Bool IsMod3() const
+ BOOL IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -175,14 +175,14 @@ inline CommandWheelData::CommandWheelData()
mnLines = 0;
mnMode = 0;
mnCode = 0;
- mbHorz = sal_False;
- mbDeltaIsPixel = sal_False;
+ mbHorz = FALSE;
+ mbDeltaIsPixel = FALSE;
}
inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- sal_uLong nScrollLines,
- sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
- sal_Bool bHorz, sal_Bool bDeltaIsPixel )
+ ULONG nScrollLines,
+ USHORT nWheelMode, USHORT nKeyModifier,
+ BOOL bHorz, BOOL bDeltaIsPixel )
{
mnDelta = nWheelDelta;
mnNotchDelta = nWheelNotchDelta;
@@ -237,17 +237,17 @@ class VCL_DLLPUBLIC CommandVoiceData
{
private:
XubString maText;
- sal_uInt16 mnCommand;
+ USHORT mnCommand;
DictationCommandType meType;
public:
CommandVoiceData();
CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- sal_uInt16 nCommand );
+ USHORT nCommand );
const XubString& GetText() const { return maText; }
- sal_uInt16 GetCommand() const { return mnCommand; }
+ USHORT GetCommand() const { return mnCommand; }
DictationCommandType GetType() const { return meType; }
};
@@ -259,7 +259,7 @@ inline CommandVoiceData::CommandVoiceData()
inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- sal_uInt16 nCommand ) :
+ USHORT nCommand ) :
maText( rStr ),
mnCommand( nCommand ),
meType( eType )
@@ -273,26 +273,26 @@ inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
class VCL_DLLPUBLIC CommandModKeyData
{
private:
- sal_uInt16 mnCode;
+ USHORT mnCode;
public:
CommandModKeyData();
- CommandModKeyData( sal_uInt16 nCode );
-
- bool IsShift() const { return (mnCode & MODKEY_SHIFT) ? 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; }
+ CommandModKeyData( USHORT 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; }
};
inline CommandModKeyData::CommandModKeyData()
@@ -300,7 +300,7 @@ inline CommandModKeyData::CommandModKeyData()
mnCode = 0L;
}
-inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
+inline CommandModKeyData::CommandModKeyData( USHORT nCode )
{
mnCode = nCode;
}
@@ -319,7 +319,7 @@ class VCL_DLLPUBLIC CommandDialogData
CommandDialogData( int nDialogId = SHOWDIALOG_ID_PREFERENCES )
: m_nDialogId( nDialogId )
{}
-
+
int GetDialogId() const { return m_nDialogId; }
};
@@ -327,23 +327,23 @@ class VCL_DLLPUBLIC CommandDialogData
// Media Commands
// --------------
-#define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
-#define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
-#define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide.
-#define MEDIA_COMMAND_PAUSE ((sal_Int16)4) // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state.
-#define MEDIA_COMMAND_PLAY ((sal_Int16)5) // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state.
-#define MEDIA_COMMAND_PLAY_PAUSE ((sal_Int16)6) // Play or pause playback.
-#define MEDIA_COMMAND_PREVIOUSTRACK ((sal_Int16)7) // Go to previous media track/slide.
-#define MEDIA_COMMAND_RECORD ((sal_Int16)8) // Begin recording the current stream.
-#define MEDIA_COMMAND_REWIND ((sal_Int16)9)// Go backward in a stream at a higher rate of speed.
-#define MEDIA_COMMAND_STOP ((sal_Int16)10)// Stop playback.
-#define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE ((sal_Int16)11)// Toggle the microphone.
+#define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
+#define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
+#define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide.
+#define MEDIA_COMMAND_PAUSE ((sal_Int16)4) // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state.
+#define MEDIA_COMMAND_PLAY ((sal_Int16)5) // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state.
+#define MEDIA_COMMAND_PLAY_PAUSE ((sal_Int16)6) // Play or pause playback.
+#define MEDIA_COMMAND_PREVIOUSTRACK ((sal_Int16)7) // Go to previous media track/slide.
+#define MEDIA_COMMAND_RECORD ((sal_Int16)8) // Begin recording the current stream.
+#define MEDIA_COMMAND_REWIND ((sal_Int16)9)// Go backward in a stream at a higher rate of speed.
+#define MEDIA_COMMAND_STOP ((sal_Int16)10)// Stop playback.
+#define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE ((sal_Int16)11)// Toggle the microphone.
#define MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN ((sal_Int16)12)// Increase microphone volume.
#define MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE ((sal_Int16)13)// Mute the microphone.
#define MEDIA_COMMAND_MICROPHONE_VOLUME_UP ((sal_Int16)14)// Decrease microphone volume.
-#define MEDIA_COMMAND_VOLUME_DOWN ((sal_Int16)15)// Lower the volume.
-#define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume.
-#define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume.
+#define MEDIA_COMMAND_VOLUME_DOWN ((sal_Int16)15)// Lower the volume.
+#define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume.
+#define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume.
#define MEDIA_COMMAND_MENU ((sal_Int16)18)// Button Menu pressed.
#define MEDIA_COMMAND_MENU_HOLD ((sal_Int16)19)// Button Menu (long) pressed.
#define MEDIA_COMMAND_PLAY_HOLD ((sal_Int16)20)// Button Play (long) pressed.
@@ -358,15 +358,15 @@ class VCL_DLLPUBLIC CommandDialogData
class VCL_DLLPUBLIC CommandSelectionChangeData
{
private:
- sal_uLong mnStart;
- sal_uLong mnEnd;
+ ULONG mnStart;
+ ULONG mnEnd;
public:
CommandSelectionChangeData();
- CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
+ CommandSelectionChangeData( ULONG nStart, ULONG nEnd );
- sal_uLong GetStart() const { return mnStart; }
- sal_uLong GetEnd() const { return mnEnd; }
+ ULONG GetStart() const { return mnStart; }
+ ULONG GetEnd() const { return mnEnd; }
};
inline CommandSelectionChangeData::CommandSelectionChangeData()
@@ -374,8 +374,8 @@ inline CommandSelectionChangeData::CommandSelectionChangeData()
mnStart = mnEnd = 0;
}
-inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
- sal_uLong nEnd )
+inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
+ ULONG nEnd )
{
mnStart = nStart;
mnEnd = nEnd;
@@ -385,43 +385,43 @@ inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
// - CommandEvent -
// ----------------
-#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)
+#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)
class VCL_DLLPUBLIC CommandEvent
{
private:
Point maPos;
void* mpData;
- sal_uInt16 mnCommand;
- sal_Bool mbMouseEvent;
+ USHORT mnCommand;
+ BOOL mbMouseEvent;
public:
CommandEvent();
- CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
- sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
+ CommandEvent( const Point& rMousePos, USHORT nCmd,
+ BOOL bMEvt = FALSE, const void* pCmdData = NULL );
- sal_uInt16 GetCommand() const { return mnCommand; }
+ USHORT GetCommand() const { return mnCommand; }
const Point& GetMousePosPixel() const { return maPos; }
- sal_Bool IsMouseEvent() const { return mbMouseEvent; }
+ BOOL IsMouseEvent() const { return mbMouseEvent; }
void* GetData() const { return mpData; }
const CommandExtTextInputData* GetExtTextInputData() const;
@@ -429,9 +429,9 @@ public:
const CommandWheelData* GetWheelData() const;
const CommandScrollData* GetAutoScrollData() const;
const CommandVoiceData* GetVoiceData() const;
- const CommandModKeyData* GetModKeyData() const;
+ const CommandModKeyData* GetModKeyData() const;
const CommandDialogData* GetDialogData() const;
- sal_Int16 GetMediaCommand() const;
+ sal_Int16 GetMediaCommand() const;
const CommandSelectionChangeData* GetSelectionChangeData() const;
};
@@ -439,11 +439,11 @@ inline CommandEvent::CommandEvent()
{
mpData = NULL;
mnCommand = 0;
- mbMouseEvent = sal_False;
+ mbMouseEvent = FALSE;
}
inline CommandEvent::CommandEvent( const Point& rMousePos,
- sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
+ USHORT nCmd, 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 387c20d544be..14057dfcce0d 100644
--- a/vcl/inc/vcl/combobox.h
+++ b/vcl/inc/vcl/combobox.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,12 +29,12 @@
#ifndef _SV_COMBOBOX_H
#define _SV_COMBOBOX_H
-#define COMBOBOX_APPEND ((sal_uInt16)0xFFFF)
-#define COMBOBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
-#define COMBOBOX_ERROR ((sal_uInt16)0xFFFF)
+#define COMBOBOX_APPEND ((USHORT)0xFFFF)
+#define COMBOBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
+#define COMBOBOX_ERROR ((USHORT)0xFFFF)
-#define COMBOBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
+#define COMBOBOX_USERDRAW_SELECTED ((USHORT)0x0001)
-#endif // _SV_COMBOBOX_H
+#endif // _SV_COMBOBOX_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index 12385c9bd9e2..b232de1bc54c 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,11 +51,11 @@ private:
ImplListBox* mpImplLB;
ImplBtn* mpBtn;
ImplListBoxFloatingWindow* mpFloatWin;
- sal_uInt16 mnDDHeight;
+ USHORT mnDDHeight;
xub_Unicode mcMultiSep;
- sal_Bool mbDDAutoSize : 1;
- sal_Bool mbSyntheticModify : 1;
- sal_Bool mbMatchCase : 1;
+ BOOL mbDDAutoSize : 1;
+ BOOL mbSyntheticModify : 1;
+ BOOL mbMatchCase : 1;
Link maSelectHdl;
Link maDoubleClickHdl;
@@ -81,7 +81,7 @@ protected:
protected:
ComboBox( WindowType nType );
- sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
+ BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : 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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
virtual long Notify( NotifyEvent& rNEvt );
@@ -104,67 +104,67 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
- virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Edit::SetPosSizePixel( rNewPos, rNewSize ); }
- void SetDropDownSizePixel( const Size& rNewSize )
+ void SetDropDownSizePixel( const Size& rNewSize )
{ if( IsDropDownBox() ) SetPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
- Rectangle GetDropDownPosSizePixel() const;
- Rectangle GetListPosSizePixel() const;
+ Rectangle GetDropDownPosSizePixel() const;
+ Rectangle GetListPosSizePixel() const;
// returns empty rectangle in DropDown mode,
// else it returns the PosSize of the ListBox
- void SetDropDownLineCount( sal_uInt16 nLines );
- sal_uInt16 GetDropDownLineCount() const;
+ void SetDropDownLineCount( USHORT nLines );
+ USHORT GetDropDownLineCount() const;
- void EnableAutoSize( sal_Bool bAuto );
- sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( BOOL bAuto );
+ BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( sal_Bool b );
- sal_Bool IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( BOOL b );
+ BOOL IsDDAutoWidthEnabled() const;
void SetText( const XubString& rStr );
void SetText( const XubString& rStr, const Selection& rNewSelection );
- 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 );
+ USHORT InsertEntry( const XubString& rStr, USHORT nPos = COMBOBOX_APPEND );
+ USHORT InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos = COMBOBOX_APPEND );
void RemoveEntry( const XubString& rStr );
- void RemoveEntry( sal_uInt16 nPos );
+ void RemoveEntry( USHORT nPos );
void Clear();
- 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;
+ 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_Bool IsTravelSelect() const;
- sal_Bool IsInDropDown() const;
- void ToggleDropDown();
+ BOOL IsTravelSelect() const;
+ BOOL IsInDropDown() const;
+ void ToggleDropDown();
- long CalcWindowSizePixel( sal_uInt16 nLines ) const;
+ long CalcWindowSizePixel( USHORT nLines ) const;
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const;
- void EnableUserDraw( sal_Bool bUserDraw );
- sal_Bool IsUserDrawEnabled() const;
+ void EnableUserDraw( BOOL bUserDraw );
+ BOOL IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
- void SetBorderStyle( sal_uInt16 nBorderStyle );
+ void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
+ void SetBorderStyle( USHORT nBorderStyle );
- void SetSeparatorPos( sal_uInt16 n );
+ void SetSeparatorPos( USHORT n );
void SetSeparatorPos();
- sal_uInt16 GetSeparatorPos() const;
+ USHORT GetSeparatorPos() const;
- void EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase = sal_False );
- sal_Bool IsAutocompleteEnabled() const;
+ void EnableAutocomplete( BOOL bEnable, BOOL bMatchCase = FALSE );
+ BOOL IsAutocompleteEnabled() const;
- void EnableMultiSelection( sal_Bool bMulti );
- sal_Bool IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( BOOL bMulti );
+ 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( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
- void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
+ Size CalcSize( USHORT nColumns, USHORT nLines ) const;
+ void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( sal_uInt16 n );
- sal_uInt16 GetMaxMRUCount() const;
+ void SetMaxMRUCount( USHORT n );
+ USHORT GetMaxMRUCount() const;
- void SetEntryData( sal_uInt16 nPos, void* pNewData );
- void* GetEntryData( sal_uInt16 nPos ) const;
+ void SetEntryData( USHORT nPos, void* pNewData );
+ void* GetEntryData( USHORT nPos ) const;
- void SetTopEntry( sal_uInt16 nPos );
- void ShowProminentEntry( sal_uInt16 nPos );
- sal_uInt16 GetTopEntry() const;
+ void SetTopEntry( USHORT nPos );
+ void ShowProminentEntry( USHORT nPos );
+ USHORT GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
- sal_uInt16 GetDisplayLineCount() const;
+ USHORT GetDisplayLineCount() const;
- 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( sal_uInt16 nItem ) const;
+ USHORT GetSelectEntryCount() const;
+ USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
+ BOOL IsEntryPosSelected( USHORT nPos ) const;
+ void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
+ void SetNoSelection();
+ Rectangle GetBoundingRectangle( USHORT 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, sal_uInt16& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
};
#endif // _COMBOBOX_HXX
diff --git a/vcl/inc/vcl/configsettings.hxx b/vcl/inc/vcl/configsettings.hxx
index e9b85d30728e..e33e76d4520f 100644
--- a/vcl/inc/vcl/configsettings.hxx
+++ b/vcl/inc/vcl/configsettings.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,14 +33,14 @@
#include <unotools/configitem.hxx>
#include <vcl/dllapi.h>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
//........................................................................
namespace vcl
{
//........................................................................
- typedef boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > OUStrMap;
+ typedef std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > OUStrMap;
class SmallOUStrMap : public OUStrMap { public: SmallOUStrMap() : OUStrMap(1) {} };
//====================================================================
@@ -49,7 +49,7 @@ namespace vcl
class VCL_DLLPUBLIC SettingsConfigItem : public ::utl::ConfigItem
{
- boost::unordered_map< rtl::OUString, SmallOUStrMap, rtl::OUStringHash > m_aSettings;
+ std::hash_map< rtl::OUString, SmallOUStrMap, rtl::OUStringHash > m_aSettings;
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
@@ -62,7 +62,7 @@ namespace vcl
const rtl::OUString& getValue( const rtl::OUString& rGroup, const rtl::OUString& rKey ) const;
void setValue( const rtl::OUString& rGroup, const rtl::OUString& rKey, const rtl::OUString& rValue );
-
+
virtual void Commit();
};
diff --git a/vcl/inc/vcl/controldata.hxx b/vcl/inc/vcl/controldata.hxx
index b30184be2481..0306a8d395f6 100644
--- a/vcl/inc/vcl/controldata.hxx
+++ b/vcl/inc/vcl/controldata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/controllayout.hxx b/vcl/inc/vcl/controllayout.hxx
index 0cad923c6b33..3d43f0177061 100644
--- a/vcl/inc/vcl/controllayout.hxx
+++ b/vcl/inc/vcl/controllayout.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,14 +44,14 @@ struct VCL_DLLPUBLIC ControlLayoutData
// contains the string really displayed
// there must be exactly one bounding rectangle in m_aUnicodeBoundRects
// for every character in m_aDisplayText
- String m_aDisplayText;
+ String m_aDisplayText;
// the bounding rectangle of every character
// where one character may consist of many glyphs
- std::vector< Rectangle > m_aUnicodeBoundRects;
+ std::vector< Rectangle > m_aUnicodeBoundRects;
// start indices of lines
- std::vector< long > m_aLineIndices;
+ std::vector< long > m_aLineIndices;
// notify parent control on destruction
- const Control* m_pParent;
+ const Control* m_pParent;
ControlLayoutData() : m_pParent( NULL ) {}
~ControlLayoutData();
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 71d7d88d6003..f9d423a7b6d4 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,9 +48,9 @@ protected:
::vcl::ImplControlData* mpControlData;
private:
- sal_Bool mbHasFocus;
- Link maGetFocusHdl;
- Link maLoseFocusHdl;
+ BOOL mbHasFocus;
+ Link maGetFocusHdl;
+ Link maLoseFocusHdl;
SAL_DLLPRIVATE void ImplInitControlData();
@@ -60,10 +60,10 @@ private:
protected:
Control( WindowType nType );
- virtual void FillLayoutData() const;
+ virtual void FillLayoutData() const;
// helper method for composite controls
- void AppendLayoutData( const Control& rSubControl ) const;
+ void AppendLayoutData( const Control& rSubControl ) const;
/// creates the mpData->mpLayoutData structure
void CreateLayoutData() const;
@@ -87,8 +87,8 @@ protected:
@return
if the Control instance has been destroyed in any of the call
*/
- sal_Bool ImplCallEventListenersAndHandler(
- sal_uLong nEvent, const Link& rHandler, void* pCaller
+ BOOL ImplCallEventListenersAndHandler(
+ 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, sal_uInt16 _nStyle,
+ const XubString& _rStr, USHORT _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 sal_Bool _bFont, const sal_Bool _bForeground );
+ void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground );
public:
SAL_DLLPRIVATE void ImplClearLayoutData() const;
@@ -137,15 +137,15 @@ public:
Control( Window* pParent, const ResId& rResId );
~Control();
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void StateChanged( StateChangedType nStateChange );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& rDCEvt );
// invalidates layout data
- virtual void SetText( const String& rStr );
+ virtual void SetText( const String& rStr );
// gets the displayed text
virtual String GetDisplayText() const;
// returns the bounding box for the character at index nIndex (in control coordinates)
@@ -173,12 +173,12 @@ public:
*/
long ToRelativeLineIndex( long nIndex ) const;
- void SetGetFocusHdl( const Link& rLink ) { maGetFocusHdl = rLink; }
- const Link& GetGetFocusHdl() const { return maGetFocusHdl; }
- void SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; }
- const Link& GetLoseFocusHdl() const { return maLoseFocusHdl; }
+ void SetGetFocusHdl( const Link& rLink ) { maGetFocusHdl = rLink; }
+ const Link& GetGetFocusHdl() const { return maGetFocusHdl; }
+ void SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; }
+ const Link& GetLoseFocusHdl() const { return maLoseFocusHdl; }
- void SetLayoutDataParent( const Control* pParent ) const;
+ void SetLayoutDataParent( const Control* pParent ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -197,6 +197,6 @@ public:
}
};
-#endif // _SV_CTRL_HXX
+#endif // _SV_CTRL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx
index 46f17b367412..afa8c9324705 100644
--- a/vcl/inc/vcl/cursor.hxx
+++ b/vcl/inc/vcl/cursor.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,7 +42,7 @@ class Window;
// - Cursor-Styles -
// -----------------
-#define CURSOR_SHADOW ((sal_uInt16)0x0001)
+#define CURSOR_SHADOW ((USHORT)0x0001)
#define CURSOR_DIRECTION_NONE ((unsigned char)0x00)
#define CURSOR_DIRECTION_LTR ((unsigned char)0x01)
#define CURSOR_DIRECTION_RTL ((unsigned char)0x02)
@@ -54,67 +54,67 @@ class Window;
class VCL_DLLPUBLIC Cursor
{
private:
- ImplCursorData* mpData; // Interne Daten
- Window* mpWindow; // Window (only for shadow cursor)
- long mnSlant; // Schraegstellung
- long mnOffsetY; // Offset fuer Rotation
- Size maSize; // Groesse
- Point maPos; // Position
- short mnOrientation; // Rotation
- sal_uInt16 mnStyle; // Style
- sal_Bool mbVisible; // Ist Cursor sichtbar
- unsigned char mnDirection; // indicates direction
+ ImplCursorData* mpData; // Interne Daten
+ Window* mpWindow; // Window (only for shadow cursor)
+ long mnSlant; // Schraegstellung
+ long mnOffsetY; // Offset fuer Rotation
+ Size maSize; // Groesse
+ Point maPos; // Position
+ short mnOrientation; // Rotation
+ USHORT mnStyle; // Style
+ BOOL mbVisible; // Ist Cursor sichtbar
+ unsigned char mnDirection; // indicates direction
public:
- SAL_DLLPRIVATE void ImplDraw();
- SAL_DLLPRIVATE void ImplRestore();
+ SAL_DLLPRIVATE void ImplDraw();
+ SAL_DLLPRIVATE void ImplRestore();
DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* );
- SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true, bool bRestore = false );
- SAL_DLLPRIVATE bool ImplHide();
- SAL_DLLPRIVATE void ImplNew();
+ SAL_DLLPRIVATE void ImplShow( BOOL bDrawDirect = TRUE );
+ SAL_DLLPRIVATE void ImplHide();
+ SAL_DLLPRIVATE void ImplNew();
public:
Cursor();
Cursor( const Cursor& rCursor );
~Cursor();
- void SetStyle( sal_uInt16 nStyle );
- sal_uInt16 GetStyle() const { return mnStyle; }
+ void SetStyle( USHORT nStyle );
+ USHORT GetStyle() const { return mnStyle; }
- void Show();
- void Hide();
- sal_Bool IsVisible() const { return mbVisible; }
+ void Show();
+ void Hide();
+ BOOL IsVisible() const { return mbVisible; }
- void SetWindow( Window* pWindow );
- Window* GetWindow() const { return mpWindow; }
+ void SetWindow( Window* pWindow );
+ Window* GetWindow() const { return mpWindow; }
- void SetPos( const Point& rNewPos );
- const Point& GetPos() const { return maPos; }
- void SetOffsetY( long mnOffsetY = 0 );
- long GetOffsetY() const { return mnOffsetY; }
+ void SetPos( const Point& rNewPos );
+ const Point& GetPos() const { return maPos; }
+ void SetOffsetY( long mnOffsetY = 0 );
+ long GetOffsetY() const { return mnOffsetY; }
- void SetSize( const Size& rNewSize );
- const Size& GetSize() const { return maSize; }
- void SetWidth( long nNewWidth );
- long GetWidth() const { return maSize.Width(); }
- void SetHeight( long nNewHeight );
- long GetHeight() const { return maSize.Height(); }
+ void SetSize( const Size& rNewSize );
+ const Size& GetSize() const { return maSize; }
+ void SetWidth( long nNewWidth );
+ long GetWidth() const { return maSize.Width(); }
+ void SetHeight( long nNewHeight );
+ long GetHeight() const { return maSize.Height(); }
- void SetSlant( long nSlant = 0 );
- long GetSlant() const { return mnSlant; }
+ void SetSlant( long nSlant = 0 );
+ long GetSlant() const { return mnSlant; }
- void SetOrientation( short nOrientation = 0 );
- short GetOrientation() const { return mnOrientation; }
+ void SetOrientation( short nOrientation = 0 );
+ short GetOrientation() const { return mnOrientation; }
- void SetDirection( unsigned char nDirection = 0 );
- unsigned char GetDirection() const { return mnDirection; }
+ void SetDirection( unsigned char nDirection = 0 );
+ unsigned char GetDirection() const { return mnDirection; }
- Cursor& operator=( const Cursor& rCursor );
- sal_Bool operator==( const Cursor& rCursor ) const;
- sal_Bool operator!=( const Cursor& rCursor ) const
+ Cursor& operator=( const Cursor& rCursor );
+ BOOL operator==( const Cursor& rCursor ) const;
+ BOOL operator!=( const Cursor& rCursor ) const
{ return !(Cursor::operator==( rCursor )); }
};
-#endif // _SV_CURSOR_HXX
+#endif // _SV_CURSOR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/cvtgrf.hxx b/vcl/inc/vcl/cvtgrf.hxx
index 50d766f5565c..259f28c84b40 100644
--- a/vcl/inc/vcl/cvtgrf.hxx
+++ b/vcl/inc/vcl/cvtgrf.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,32 +37,32 @@
// - GraphicConverter -
// --------------------
-struct ConvertData;
-class Graphic;
+struct ConvertData;
+class Graphic;
class VCL_DLLPUBLIC GraphicConverter
{
private:
- Link maFilterHdl;
- ConvertData* mpConvertData;
+ Link maFilterHdl;
+ ConvertData* mpConvertData;
public:
- SAL_DLLPRIVATE sal_uLong ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
- void** ppOutBuffer, sal_uLong nOutFormat );
+ SAL_DLLPRIVATE ULONG ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
+ void** ppOutBuffer, ULONG nOutFormat );
public:
GraphicConverter();
~GraphicConverter();
- 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 );
+ static ULONG Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat = CVT_UNKNOWN );
+ static ULONG Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat );
- ConvertData* GetConvertData() { return mpConvertData; }
+ ConvertData* GetConvertData() { return mpConvertData; }
- void SetFilterHdl( const Link& rLink ) { maFilterHdl = rLink; }
- const Link& GetFilterHdl() const { return maFilterHdl; }
+ void SetFilterHdl( const Link& rLink ) { maFilterHdl = rLink; }
+ const Link& GetFilterHdl() const { return maFilterHdl; }
};
#endif // _SV_CVTGRF_HXX
diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index de4158e08efc..0b41f6f64338 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,55 +37,55 @@
// - Defines -
// -----------
-#define CONVERT_TO_SVM1 0x00000001UL
-#define CONVERT_FROM_SVM1 0x00000002UL
+#define CONVERT_TO_SVM1 0x00000001UL
+#define CONVERT_FROM_SVM1 0x00000002UL
-#define GDI_PIXEL_ACTION 1
-#define GDI_POINT_ACTION 2
-#define GDI_LINE_ACTION 3
-#define GDI_RECT_ACTION 4
-#define GDI_ELLIPSE_ACTION 5
-#define GDI_ARC_ACTION 6
-#define GDI_PIE_ACTION 7
-#define GDI_INVERTRECT_ACTION 8
-#define GDI_HIGHLIGHTRECT_ACTION 9
-#define GDI_POLYLINE_ACTION 10
-#define GDI_POLYGON_ACTION 11
-#define GDI_POLYPOLYGON_ACTION 12
-#define GDI_TEXT_ACTION 13
-#define GDI_TEXTARRAY_ACTION 14
-#define GDI_STRETCHTEXT_ACTION 15
-#define GDI_ICON_ACTION 16
-#define GDI_BITMAP_ACTION 17
-#define GDI_BITMAPSCALE_ACTION 18
-#define GDI_PEN_ACTION 19
-#define GDI_FONT_ACTION 20
-#define GDI_BACKBRUSH_ACTION 21
-#define GDI_FILLBRUSH_ACTION 22
-#define GDI_MAPMODE_ACTION 23
-#define GDI_CLIPREGION_ACTION 24
-#define GDI_RASTEROP_ACTION 25
-#define GDI_PUSH_ACTION 26
-#define GDI_POP_ACTION 27
-#define GDI_MOVECLIPREGION_ACTION 28
-#define GDI_ISECTCLIPREGION_ACTION 29
-#define GDI_MTF_ACTION 30
-#define GDI_BITMAPSCALEPART_ACTION 32
-#define GDI_GRADIENT_ACTION 33
+#define GDI_PIXEL_ACTION 1
+#define GDI_POINT_ACTION 2
+#define GDI_LINE_ACTION 3
+#define GDI_RECT_ACTION 4
+#define GDI_ELLIPSE_ACTION 5
+#define GDI_ARC_ACTION 6
+#define GDI_PIE_ACTION 7
+#define GDI_INVERTRECT_ACTION 8
+#define GDI_HIGHLIGHTRECT_ACTION 9
+#define GDI_POLYLINE_ACTION 10
+#define GDI_POLYGON_ACTION 11
+#define GDI_POLYPOLYGON_ACTION 12
+#define GDI_TEXT_ACTION 13
+#define GDI_TEXTARRAY_ACTION 14
+#define GDI_STRETCHTEXT_ACTION 15
+#define GDI_ICON_ACTION 16
+#define GDI_BITMAP_ACTION 17
+#define GDI_BITMAPSCALE_ACTION 18
+#define GDI_PEN_ACTION 19
+#define GDI_FONT_ACTION 20
+#define GDI_BACKBRUSH_ACTION 21
+#define GDI_FILLBRUSH_ACTION 22
+#define GDI_MAPMODE_ACTION 23
+#define GDI_CLIPREGION_ACTION 24
+#define GDI_RASTEROP_ACTION 25
+#define GDI_PUSH_ACTION 26
+#define GDI_POP_ACTION 27
+#define GDI_MOVECLIPREGION_ACTION 28
+#define GDI_ISECTCLIPREGION_ACTION 29
+#define GDI_MTF_ACTION 30
+#define GDI_BITMAPSCALEPART_ACTION 32
+#define GDI_GRADIENT_ACTION 33
-#define GDI_TRANSPARENT_COMMENT 1024
-#define GDI_HATCH_COMMENT 1025
-#define GDI_REFPOINT_COMMENT 1026
-#define GDI_TEXTLINECOLOR_COMMENT 1027
-#define GDI_TEXTLINE_COMMENT 1028
-#define GDI_FLOATTRANSPARENT_COMMENT 1029
-#define GDI_GRADIENTEX_COMMENT 1030
-#define GDI_COMMENT_COMMENT 1031
-#define GDI_UNICODE_COMMENT 1032
+#define GDI_TRANSPARENT_COMMENT 1024
+#define GDI_HATCH_COMMENT 1025
+#define GDI_REFPOINT_COMMENT 1026
+#define GDI_TEXTLINECOLOR_COMMENT 1027
+#define GDI_TEXTLINE_COMMENT 1028
+#define GDI_FLOATTRANSPARENT_COMMENT 1029
+#define GDI_GRADIENTEX_COMMENT 1030
+#define GDI_COMMENT_COMMENT 1031
+#define GDI_UNICODE_COMMENT 1032
-#define GDI_LINEJOIN_ACTION 1033
-#define GDI_EXTENDEDPOLYGON_ACTION 1034
-#define GDI_LINEDASHDOT_ACTION 1035
+#define GDI_LINEJOIN_ACTION 1033
+#define GDI_EXTENDEDPOLYGON_ACTION 1034
+#define GDI_LINEDASHDOT_ACTION 1035
// ----------------
// - SVMConverter -
@@ -93,24 +93,24 @@
class Stack;
-class VCL_PLUGIN_PUBLIC SVMConverter
+class VCL_DLLPUBLIC SVMConverter
{
private:
- SAL_DLLPRIVATE void ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf );
- SAL_DLLPRIVATE void ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
- SAL_DLLPRIVATE sal_uLong ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
+ 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,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet );
public:
- SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, sal_uLong nConvertMode );
+ SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, ULONG nConvertMode );
~SVMConverter() {}
private:
// Not implemented
SVMConverter( const SVMConverter& );
- SVMConverter& operator=( const SVMConverter& );
+ SVMConverter& operator=( const SVMConverter& );
};
#endif // _SV_CVTMTF_HXX
diff --git a/vcl/inc/vcl/dbggui.hxx b/vcl/inc/vcl/dbggui.hxx
index 61d878de3451..55777f7b06e3 100644
--- a/vcl/inc/vcl/dbggui.hxx
+++ b/vcl/inc/vcl/dbggui.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,7 +51,7 @@ void DbgDialogTest( Window* pWindow );
->DbgData::nWarningOut and ->DbgData::nTraceOut
@see DBG_OUT_USER_CHANNEL_0
*/
-sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc );
+USHORT 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 63434bea2830..1b81be0bbbfe 100644
--- a/vcl/inc/vcl/decoview.hxx
+++ b/vcl/inc/vcl/decoview.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,45 +43,45 @@ class OutputDevice;
// ------------------------
// Flags for DrawSymbol()
-#define SYMBOL_DRAW_MONO ((sal_uInt16)0x0001)
-#define SYMBOL_DRAW_DISABLE ((sal_uInt16)0x0002)
+#define SYMBOL_DRAW_MONO ((USHORT)0x0001)
+#define SYMBOL_DRAW_DISABLE ((USHORT)0x0002)
// Flags for DrawFrame()
-#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)
+#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)
// Flags for DrawHighlightFrame()
-#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)
+#define FRAME_HIGHLIGHT_IN ((USHORT)0x0001)
+#define FRAME_HIGHLIGHT_OUT ((USHORT)0x0002)
+#define FRAME_HIGHLIGHT_TESTBACKGROUND ((USHORT)0x4000)
+#define FRAME_HIGHLIGHT_STYLE ((USHORT)0x000F)
// Flags for DrawButton()
-#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)
+#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)
// ------------------
// - DecorationView -
@@ -90,21 +90,21 @@ class OutputDevice;
class VCL_DLLPUBLIC DecorationView
{
private:
- OutputDevice* mpOutDev;
+ OutputDevice* mpOutDev;
public:
DecorationView( OutputDevice* pOutDev )
{ mpOutDev = pOutDev; }
- void DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, sal_uInt16 nStyle = 0 );
- void DrawFrame( const Rectangle& rRect,
+ void DrawSymbol( const Rectangle& rRect, SymbolType eType,
+ const Color& rColor, USHORT nStyle = 0 );
+ void DrawFrame( const Rectangle& rRect,
const Color& rLeftTopColor,
const Color& rRightBottomColor );
- void DrawHighlightFrame( const Rectangle& rRect,
- 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 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 );
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 7b8c3ac032f2..0f7dbfd0082a 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,15 +46,15 @@ struct DialogImpl;
class VCL_DLLPUBLIC Dialog : public SystemWindow
{
private:
- Window* mpDialogParent;
- Dialog* mpPrevExecuteDlg;
+ Window* mpDialogParent;
+ Dialog* mpPrevExecuteDlg;
DialogImpl* mpDialogImpl;
- long mnMousePositioned;
- 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
+ long mnMousePositioned;
+ BOOL mbInExecute;
+ BOOL mbOldSaveBack;
+ BOOL mbInClose;
+ BOOL mbModalMode;
+ sal_Int8 mnCancelClose; //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
@@ -71,55 +71,55 @@ protected:
SAL_DLLPRIVATE void ImplCenterDialog();
public:
- SAL_DLLPRIVATE sal_Bool IsInClose() const { return mbInClose; }
+ SAL_DLLPRIVATE BOOL IsInClose() const { return mbInClose; }
protected:
Dialog( WindowType nType );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
public:
Dialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
Dialog( Window* pParent, const ResId& rResId );
virtual ~Dialog();
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual sal_Bool Close();
+ virtual BOOL Close();
- virtual short Execute();
- sal_Bool IsInExecute() const { return mbInExecute; }
+ virtual short Execute();
+ 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
+ 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
////////////////////////////////////////
// Dialog::Execute replacement API
public:
// Link impl: DECL_LINK( MyEndDialogHdl, Dialog* ); <= param is dialog just ended
virtual void StartExecuteModal( const Link& rEndDialogHdl );
- sal_Bool IsStartedModal() const;
+ BOOL IsStartedModal() const;
long GetResult() const;
private:
- sal_Bool ImplStartExecuteModal();
+ BOOL ImplStartExecuteModal();
void ImplEndExecuteModal();
public:
// Dialog::Execute replacement API
////////////////////////////////////////
- void EndDialog( long nResult = 0 );
- static void EndAllDialogs( Window* pParent=NULL );
+ void EndDialog( long nResult = 0 );
+ static void EndAllDialogs( Window* pParent=NULL );
void GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- void SetModalInputMode( sal_Bool bModal );
- void SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs );
- sal_Bool IsModalInputMode() const { return mbModalMode; }
+ void SetModalInputMode( BOOL bModal );
+ void SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs );
+ BOOL IsModalInputMode() const { return mbModalMode; }
- void GrabFocusToFirstControl();
+ void GrabFocusToFirstControl();
};
// ------------------
@@ -149,15 +149,15 @@ public:
private:
using Window::Show;
- void Show( sal_Bool bVisible = sal_True );
+ void Show( BOOL bVisible = TRUE );
using Window::Hide;
- void Hide();
+ void Hide();
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE ModalDialog (const ModalDialog &);
SAL_DLLPRIVATE ModalDialog & operator= (const ModalDialog &);
};
-#endif // _SV_DIALOG_HXX
+#endif // _SV_DIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx
deleted file mode 100644
index fea1d0b7cba9..000000000000
--- a/vcl/inc/vcl/displayconnectiondispatch.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-************************************************************************/
-
-#ifndef 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 3ec80dd0ec7d..3be73d34f0e5 100644
--- a/vcl/inc/vcl/dllapi.h
+++ b/vcl/inc/vcl/dllapi.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,12 +38,6 @@
#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/dndevdis.hxx b/vcl/inc/vcl/dndevdis.hxx
index 41be5ba3fc38..e568cb582b5e 100644
--- a/vcl/inc/vcl/dndevdis.hxx
+++ b/vcl/inc/vcl/dndevdis.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,10 +36,10 @@
#include <cppuhelper/implbase3.hxx>
#include <vcl/window.hxx>
-class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
+class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
::com::sun::star::datatransfer::dnd::XDropTargetListener,
::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
- ::com::sun::star::datatransfer::dnd::XDragGestureListener >
+ ::com::sun::star::datatransfer::dnd::XDragGestureListener >
{
Window * m_pTopWindow;
Window * m_pCurrentWindow;
@@ -51,24 +51,24 @@ class DNDEventDispatcher: public ::cppu::WeakImplHelper3<
/*
* fire the events on the dnd listener container of the specified window
*/
-
- sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
- const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
+
+ sal_Int32 fireDragEnterEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
+ const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& aFlavorList ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
- const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 fireDragOverEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
+ const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
sal_Int32 fireDragExitEvent( Window *pWindow ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
- const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Int32 fireDropActionChangedEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& xContext,
+ const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext,
- const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
+ sal_Int32 fireDropEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& xContext,
+ const sal_Int8 nDropAction, const Point& rLocation, const sal_Int8 nSourceAction,
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable ) throw(::com::sun::star::uno::RuntimeException);
- sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource,
+ sal_Int32 fireDragGestureEvent( Window *pWindow, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xSource,
const ::com::sun::star::uno::Any event, const Point& rOrigin, const sal_Int8 nDragAction )throw(::com::sun::star::uno::RuntimeException);
public:
@@ -96,7 +96,7 @@ public:
/*
* XDragGestureListener
*/
-
+
virtual void SAL_CALL dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw(::com::sun::star::uno::RuntimeException);
@@ -104,11 +104,11 @@ public:
* XEventListener
*/
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& eo ) throw(::com::sun::star::uno::RuntimeException);
};
//==================================================================================================
-//
+//
//==================================================================================================
#endif
diff --git a/vcl/inc/vcl/dndhelp.hxx b/vcl/inc/vcl/dndhelp.hxx
index 73adc8a4508a..b8d7749b1707 100644
--- a/vcl/inc/vcl/dndhelp.hxx
+++ b/vcl/inc/vcl/dndhelp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -91,14 +91,14 @@ class VCL_DLLPUBLIC DragAndDropWrapper :
private:
DragAndDropClient* mpClient;
-public:
+public:
DragAndDropWrapper( DragAndDropClient* pClient );
~DragAndDropWrapper();
// ::com::sun::star::uno::XInterface
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
- void SAL_CALL release() throw() { OWeakObject::release(); }
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
// ::com::sun::star::lang::XEventListener
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
@@ -121,7 +121,7 @@ public:
void SAL_CALL dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
};
-}} // namespace vcl::unohelper
+}} // namespace vcl::unohelper
#endif // _VCL_DNDHELP_HXX
diff --git a/vcl/inc/vcl/dndlcon.hxx b/vcl/inc/vcl/dndlcon.hxx
index 1c3654c1a9ea..62ddbecafa1f 100644
--- a/vcl/inc/vcl/dndlcon.hxx
+++ b/vcl/inc/vcl/dndlcon.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,8 +38,8 @@
#include <vcl/unohelp2.hxx>
-class DNDListenerContainer : public ::vcl::unohelper::MutexHelper,
- public ::cppu::WeakComponentImplHelper4<
+class DNDListenerContainer : public ::vcl::unohelper::MutexHelper,
+ public ::cppu::WeakComponentImplHelper4<
::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \
::com::sun::star::datatransfer::dnd::XDropTargetDragContext,
::com::sun::star::datatransfer::dnd::XDropTargetDropContext,
@@ -56,7 +56,7 @@ public:
DNDListenerContainer( sal_Int8 nDefaultActions );
virtual ~DNDListenerContainer();
- sal_uInt32 fireDropEvent(
+ sal_uInt32 fireDropEvent(
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context,
sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable );
@@ -77,14 +77,14 @@ public:
sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions );
sal_uInt32 fireDragGestureEvent(
- sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY,
+ sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY,
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource,
const ::com::sun::star::uno::Any& triggerEvent );
/*
* XDragGestureRecognizer
*/
-
+
virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL resetRecognizer( ) throw(::com::sun::star::uno::RuntimeException);
@@ -108,7 +108,7 @@ public:
/*
* XDropTarget
*/
-
+
virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isActive( ) throw(::com::sun::star::uno::RuntimeException);
@@ -119,7 +119,7 @@ public:
//==================================================================================================
-//
+//
//==================================================================================================
#endif
diff --git a/vcl/inc/vcl/dockingarea.hxx b/vcl/inc/vcl/dockingarea.hxx
index 7ba82d380f58..3cda9021551b 100644
--- a/vcl/inc/vcl/dockingarea.hxx
+++ b/vcl/inc/vcl/dockingarea.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,7 +33,7 @@
#include <vcl/window.hxx>
// ------------------------------------------
-// A simple container for docked toolbars
+// A simple container for docked toolbars
// - its main purpose is theming support
// ------------------------------------------
@@ -54,7 +54,7 @@ public:
void SetAlign( WindowAlign eNewAlign );
WindowAlign GetAlign() const;
- sal_Bool IsHorizontal() const;
+ 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 5721d979b188..33e5a4b201c5 100644
--- a/vcl/inc/vcl/dockwin.hxx
+++ b/vcl/inc/vcl/dockwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,24 +39,24 @@ struct DockingData
{
Point maMousePos; // in
Rectangle maTrackRect; // in/out
- sal_Bool mbFloating; // out
- sal_Bool mbLivemode; // in
- sal_Bool mbInteractive; // in
+ BOOL mbFloating; // out
+ BOOL mbLivemode; // in
+ BOOL mbInteractive; // in
DockingData() {};
- DockingData( const Point& rPt, const Rectangle& rRect, sal_Bool b) :
- maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( sal_False ), mbInteractive( sal_True )
+ DockingData( const Point& rPt, const Rectangle& rRect, BOOL b) :
+ maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( FALSE ), mbInteractive( TRUE )
{};
};
struct EndDockingData
{
Rectangle maWindowRect; // in
- sal_Bool mbFloating; // in
- sal_Bool mbCancelled; // in
+ BOOL mbFloating; // in
+ BOOL mbCancelled; // in
EndDockingData() {};
- EndDockingData( const Rectangle& rRect, sal_Bool b, sal_Bool bCancelled ) :
+ EndDockingData( const Rectangle& rRect, BOOL b, BOOL bCancelled ) :
maWindowRect( rRect ), mbFloating( b ), mbCancelled( bCancelled )
{};
};
@@ -64,10 +64,10 @@ struct EndDockingData
struct EndPopupModeData
{
Point maFloatingPos; // in
- sal_Bool mbTearoff; // in
+ BOOL mbTearoff; // in
EndPopupModeData() {};
- EndPopupModeData( const Point& rPos, sal_Bool bTearoff ) :
+ EndPopupModeData( const Point& rPos, BOOL bTearoff ) :
maFloatingPos( rPos ), mbTearoff( bTearoff )
{};
};
@@ -88,30 +88,30 @@ class ImplDockingWindowWrapper
private:
// the original 'Docking'window
- Window *mpDockingWindow;
+ Window *mpDockingWindow;
// the original DockingWindow members
FloatingWindow* mpFloatWin;
- Window* mpOldBorderWin;
- Window* mpParent;
- Point maFloatPos;
- Point maDockPos;
- Point maMouseOff;
- Point maMouseStart;
- Size maRollUpOutSize;
- Size maMinOutSize;
- Size maMaxOutSize;
+ Window* mpOldBorderWin;
+ Window* mpParent;
+ Point maFloatPos;
+ Point maDockPos;
+ Point maMouseOff;
+ Point maMouseStart;
+ Size maRollUpOutSize;
+ Size maMinOutSize;
+ Size maMaxOutSize;
Rectangle maDragArea;
- long mnTrackX;
- long mnTrackY;
- long mnTrackWidth;
- long mnTrackHeight;
- sal_Int32 mnDockLeft;
- sal_Int32 mnDockTop;
- sal_Int32 mnDockRight;
- sal_Int32 mnDockBottom;
- WinBits mnFloatBits;
- sal_Bool mbDockCanceled:1,
+ long mnTrackX;
+ long mnTrackY;
+ long mnTrackWidth;
+ long mnTrackHeight;
+ sal_Int32 mnDockLeft;
+ sal_Int32 mnDockTop;
+ sal_Int32 mnDockRight;
+ sal_Int32 mnDockBottom;
+ WinBits mnFloatBits;
+ BOOL mbDockCanceled:1,
mbFloatPrevented:1,
mbDockable:1,
mbDocking:1,
@@ -126,90 +126,90 @@ private:
mbStartDockingEnabled:1,
mbLocked:1;
- void ImplInitData();
+ void ImplInitData();
DECL_LINK( PopupModeEnd, void* );
- void ImplEnableStartDocking( sal_Bool bEnable = sal_True ) { mbStartDockingEnabled = bEnable; }
- sal_Bool ImplStartDockingEnabled() { return mbStartDockingEnabled; }
+ void ImplEnableStartDocking( BOOL bEnable = TRUE ) { mbStartDockingEnabled = bEnable; }
+ BOOL ImplStartDockingEnabled() { return mbStartDockingEnabled; }
public:
ImplDockingWindowWrapper( const Window *pWindow );
virtual ~ImplDockingWindowWrapper();
Window* GetWindow() { return mpDockingWindow; }
- sal_Bool ImplStartDocking( const Point& rPos );
+ BOOL ImplStartDocking( const Point& rPos );
// those methods actually call the corresponding handlers
- void StartDocking( const Point& rPos, Rectangle& rRect );
- sal_Bool Docking( const Point& rPos, Rectangle& rRect );
- void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
- sal_Bool PrepareToggleFloatingMode();
- void ToggleFloatingMode();
+ void StartDocking( const Point& rPos, Rectangle& rRect );
+ BOOL Docking( const Point& rPos, Rectangle& rRect );
+ void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+ BOOL PrepareToggleFloatingMode();
+ void ToggleFloatingMode();
void SetDragArea( const Rectangle& rRect );
Rectangle GetDragArea() const;
void Lock();
void Unlock();
- sal_Bool IsLocked() const;
+ BOOL IsLocked() const;
- void StartPopupMode( ToolBox* pParentToolBox, sal_uLong nPopupModeFlags );
- sal_Bool IsInPopupMode() const;
+ void StartPopupMode( ToolBox* pParentToolBox, ULONG nPopupModeFlags );
+ BOOL IsInPopupMode() const;
- void TitleButtonClick( sal_uInt16 nButton );
- void Pin();
- void Roll();
- void PopupModeEnd();
- void Resizing( Size& rSize );
- sal_Bool Close();
- void Tracking( const TrackingEvent& rTEvt );
- long Notify( NotifyEvent& rNEvt );
+ void TitleButtonClick( USHORT nButton );
+ void Pin();
+ void Roll();
+ void PopupModeEnd();
+ void Resizing( Size& rSize );
+ BOOL Close();
+ void Tracking( const TrackingEvent& rTEvt );
+ long Notify( NotifyEvent& rNEvt );
- void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
- sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
+ void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
+ BOOL IsTitleButtonVisible( USHORT nButton ) const;
- void SetPin( sal_Bool bPin );
- sal_Bool IsPined() const;
+ void SetPin( BOOL bPin );
+ BOOL IsPined() const;
- void RollUp();
- void RollDown();
- sal_Bool IsRollUp() const;
+ void RollUp();
+ void RollDown();
+ BOOL IsRollUp() const;
- void SetRollUpOutputSizePixel( const Size& rSize );
- Size GetRollUpOutputSizePixel() const;
+ void SetRollUpOutputSizePixel( const Size& rSize );
+ Size GetRollUpOutputSizePixel() const;
- void SetMinOutputSizePixel( const Size& rSize );
- const Size& GetMinOutputSizePixel() const;
+ void SetMinOutputSizePixel( const Size& rSize );
+ const Size& GetMinOutputSizePixel() const;
- void SetMaxOutputSizePixel( const Size& rSize );
- const Size& GetMaxOutputSizePixel() const;
+ void SetMaxOutputSizePixel( const Size& rSize );
+ const Size& GetMaxOutputSizePixel() const;
- sal_Bool IsDocking() const { return mbDocking; }
- sal_Bool IsDockable() const { return mbDockable; }
- sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
- sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
+ BOOL IsDocking() const { return mbDocking; }
+ BOOL IsDockable() const { return mbDockable; }
+ BOOL IsDockingCanceled() const { return mbDockCanceled; }
+ BOOL IsFloatingPrevented() const { return mbFloatPrevented; }
- void SetFloatingMode( sal_Bool bFloatMode = sal_False );
- sal_Bool IsFloatingMode() const;
+ void SetFloatingMode( BOOL bFloatMode = FALSE );
+ BOOL IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
- void SetFloatingPos( const Point& rNewPos );
- Point GetFloatingPos() const;
+ void SetFloatingPos( const Point& rNewPos );
+ Point GetFloatingPos() const;
- void SetFloatStyle( WinBits nWinStyle );
- WinBits GetFloatStyle() const;
- void SetTabStop();
+ void SetFloatStyle( WinBits nWinStyle );
+ WinBits GetFloatStyle() const;
+ void SetTabStop();
- virtual void SetPosSizePixel( long nX, long nY,
+ virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
- void SetPosSizePixel( const Point& rNewPos,
+ USHORT nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ mpDockingWindow->SetPosSizePixel( rNewPos, rNewSize ); }
- Point GetPosPixel() const;
- Size GetSizePixel() const;
- void SetOutputSizePixel( const Size& rNewSize );
- Size GetOutputSizePixel() const;
+ Point GetPosPixel() const;
+ Size GetSizePixel() const;
+ void SetOutputSizePixel( const Size& rNewSize );
+ Size GetOutputSizePixel() const;
};
class VCL_DLLPUBLIC DockingManager
@@ -225,26 +225,26 @@ public:
void RemoveWindow( const Window *pWin );
ImplDockingWindowWrapper* GetDockingWindowWrapper( const Window *pWin );
- sal_Bool IsDockable( const Window *pWin );
+ BOOL IsDockable( const Window *pWin );
- sal_Bool IsFloating( const Window *pWin );
- void SetFloatingMode( const Window *pWin, sal_Bool bFloating );
+ BOOL IsFloating( const Window *pWin );
+ void SetFloatingMode( const Window *pWin, BOOL bFloating );
void Lock( const Window *pWin );
void Unlock( const Window *pWin );
- sal_Bool IsLocked( const Window *pWin );
+ BOOL IsLocked( const Window *pWin );
void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin );
- void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, sal_uLong nPopupModeFlags );
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, ULONG nPopupModeFlags );
- sal_Bool IsInPopupMode( const Window *pWin );
- void EndPopupMode( const Window *pWin );
+ 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,
+ void SetPosSizePixel( Window *pWin, long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ USHORT nFlags = WINDOW_POSSIZE_ALL );
Rectangle GetPosSizePixel( const Window *pWin );
};
@@ -257,24 +257,24 @@ class VCL_DLLPUBLIC DockingWindow : public Window
class ImplData;
private:
FloatingWindow* mpFloatWin;
- Window* mpOldBorderWin;
+ Window* mpOldBorderWin;
ImplData* mpImplData;
- Point maFloatPos;
- Point maDockPos;
- Point maMouseOff;
- Point maMouseStart;
- Size maRollUpOutSize;
- Size maMinOutSize;
- long mnTrackX;
- long mnTrackY;
- long mnTrackWidth;
- long mnTrackHeight;
- sal_Int32 mnDockLeft;
- sal_Int32 mnDockTop;
- sal_Int32 mnDockRight;
- sal_Int32 mnDockBottom;
- WinBits mnFloatBits;
- sal_Bool mbDockCanceled:1,
+ Point maFloatPos;
+ Point maDockPos;
+ Point maMouseOff;
+ Point maMouseStart;
+ Size maRollUpOutSize;
+ Size maMinOutSize;
+ long mnTrackX;
+ long mnTrackY;
+ long mnTrackWidth;
+ long mnTrackHeight;
+ sal_Int32 mnDockLeft;
+ sal_Int32 mnDockTop;
+ sal_Int32 mnDockRight;
+ sal_Int32 mnDockBottom;
+ WinBits mnFloatBits;
+ BOOL mbDockCanceled:1,
mbDockPrevented:1,
mbFloatPrevented:1,
mbDockable:1,
@@ -301,7 +301,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE sal_Bool ImplStartDocking( const Point& rPos );
+ SAL_DLLPRIVATE BOOL ImplStartDocking( const Point& rPos );
protected:
DockingWindow( WindowType nType );
@@ -311,79 +311,79 @@ public:
DockingWindow( Window* pParent, const ResId& rResId );
~DockingWindow();
- virtual void StartDocking();
- 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( sal_uInt16 nButton );
- virtual void Pin();
- virtual void Roll();
- virtual void PopupModeEnd();
- virtual void Resizing( Size& rSize );
- 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( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
- sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
-
- void SetPin( sal_Bool bPin );
- sal_Bool IsPined() const;
-
- void RollUp();
- void RollDown();
- sal_Bool IsRollUp() const;
-
- void SetRollUpOutputSizePixel( const Size& rSize );
- Size GetRollUpOutputSizePixel() const;
-
- void SetMinOutputSizePixel( const Size& rSize );
- const Size& GetMinOutputSizePixel() const;
-
- void SetMaxOutputSizePixel( const Size& rSize );
- const Size& GetMaxOutputSizePixel() const;
-
- 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( sal_Bool bFloatMode = sal_False );
- sal_Bool IsFloatingMode() const;
+ virtual void StartDocking();
+ virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+ virtual BOOL PrepareToggleFloatingMode();
+ virtual void ToggleFloatingMode();
+
+ virtual void TitleButtonClick( USHORT nButton );
+ virtual void Pin();
+ virtual void Roll();
+ virtual void PopupModeEnd();
+ virtual void Resizing( Size& rSize );
+ virtual 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 SetPin( BOOL bPin );
+ BOOL IsPined() const;
+
+ void RollUp();
+ void RollDown();
+ BOOL IsRollUp() const;
+
+ void SetRollUpOutputSizePixel( const Size& rSize );
+ Size GetRollUpOutputSizePixel() const;
+
+ void SetMinOutputSizePixel( const Size& rSize );
+ const Size& GetMinOutputSizePixel() const;
+
+ 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; }
+
+ void SetFloatingMode( BOOL bFloatMode = FALSE );
+ BOOL IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
- void SetFloatingPos( const Point& rNewPos );
- Point GetFloatingPos() const;
+ void SetFloatingPos( const Point& rNewPos );
+ Point GetFloatingPos() const;
- void SetFloatStyle( WinBits nWinStyle );
- WinBits GetFloatStyle() const;
- void SetTabStop();
+ void SetFloatStyle( WinBits nWinStyle );
+ WinBits GetFloatStyle() const;
+ void SetTabStop();
- virtual void SetPosSizePixel( long nX, long nY,
+ virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
- void SetPosSizePixel( const Point& rNewPos,
+ USHORT nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ Window::SetPosSizePixel( rNewPos, rNewSize ); }
- Point GetPosPixel() const;
- Size GetSizePixel() const;
- void SetOutputSizePixel( const Size& rNewSize );
- Size GetOutputSizePixel() const;
+ Point GetPosPixel() const;
+ Size GetSizePixel() const;
+ void SetOutputSizePixel( const Size& rNewSize );
+ Size GetOutputSizePixel() const;
};
-inline void DockingWindow::SetPin( sal_Bool bPin )
+inline void DockingWindow::SetPin( BOOL bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-inline sal_Bool DockingWindow::IsPined() const
+inline BOOL DockingWindow::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -394,17 +394,17 @@ inline void DockingWindow::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = sal_True;
+ mbRollUp = TRUE;
}
inline void DockingWindow::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = sal_False;
+ mbRollUp = FALSE;
}
-inline sal_Bool DockingWindow::IsRollUp() const
+inline BOOL DockingWindow::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
@@ -448,6 +448,6 @@ inline void DockingWindow::SetFloatingPos( const Point& rNewPos )
}
-#endif // _SV_DOCKWIN_HXX
+#endif // _SV_DOCKWIN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index 0263daa5a427..b8549cdf855e 100644
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,8 +53,8 @@ struct Impl_IMEInfos;
// - Edit-Types -
// --------------
-#define EDIT_NOLIMIT STRING_LEN
-#define EDIT_UPDATEDATA_TIMEOUT 350
+#define EDIT_NOLIMIT STRING_LEN
+#define EDIT_UPDATEDATA_TIMEOUT 350
typedef XubString (*FncGetSpecialChars)( Window* pWin, const Font& rFont );
@@ -68,20 +68,20 @@ class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropCli
{
private:
Edit* mpSubEdit;
- Timer* mpUpdateDataTimer;
- DDInfo* mpDDInfo;
- Impl_IMEInfos* mpIMEInfos;
- XubString maText;
- XubString maSaveValue;
- XubString maUndoText;
- XubString maRedoText;
- long mnXOffset;
- Selection maSelection;
- sal_uInt16 mnAlign;
- xub_StrLen mnMaxTextLen;
- AutocompleteAction meAutocompleteAction;
- xub_Unicode mcEchoChar;
- sal_Bool mbModified:1,
+ Timer* mpUpdateDataTimer;
+ DDInfo* mpDDInfo;
+ Impl_IMEInfos* mpIMEInfos;
+ XubString maText;
+ XubString maSaveValue;
+ XubString maUndoText;
+ XubString maRedoText;
+ long mnXOffset;
+ Selection maSelection;
+ USHORT mnAlign;
+ xub_StrLen mnMaxTextLen;
+ AutocompleteAction meAutocompleteAction;
+ xub_Unicode mcEchoChar;
+ BOOL mbModified:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -89,9 +89,9 @@ private:
mbIsSubEdit:1,
mbInMBDown:1,
mbActivePopup:1;
- Link maModifyHdl;
- Link maUpdateDataHdl;
- Link maAutocompleteHdl;
+ Link maModifyHdl;
+ Link maUpdateDataHdl;
+ Link maAutocompleteHdl;
DECL_DLLPRIVATE_LINK( ImplUpdateDataHdl, Timer* );
@@ -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, sal_uInt8 nDirection, sal_uInt8 nMode );
+ SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE 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( sal_Bool bOnlyIfVisible = sal_True );
+ SAL_DLLPRIVATE void ImplShowCursor( BOOL bOnlyIfVisible = 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, sal_Bool bSelect );
- SAL_DLLPRIVATE void ImplShowDDCursor();
+ SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect );
+ SAL_DLLPRIVATE void ImplShowDDCursor();
SAL_DLLPRIVATE void ImplHideDDCursor();
- SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvt );
+ SAL_DLLPRIVATE 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( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, sal_Bool bPaint = sal_True );
+ SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, BOOL bPaint = TRUE );
SAL_DLLPRIVATE int ImplGetNativeControlType();
static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( Window* pWin );
@@ -160,108 +160,104 @@ public:
Edit( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabeledByRelation );
virtual ~Edit();
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
- 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, sal_uLong nFlags );
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void Command( const CommandEvent& rCEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ 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 GetFocus();
+ virtual void LoseFocus();
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual Window* GetPreferredKeyInputWindow();
- virtual void Modify();
- virtual void UpdateData();
+ virtual void Modify();
+ virtual void UpdateData();
- static sal_Bool IsCharInput( const KeyEvent& rKEvt );
+ static BOOL IsCharInput( const KeyEvent& rKEvt );
- virtual void SetModifyFlag();
- virtual void ClearModifyFlag();
- virtual sal_Bool IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
+ virtual void SetModifyFlag();
+ virtual void ClearModifyFlag();
+ virtual BOOL IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
- virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
- virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
- virtual sal_uLong IsUpdateDataEnabled() const;
+ virtual void EnableUpdateData( ULONG nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
+ virtual ULONG IsUpdateDataEnabled() const;
- void SetEchoChar( xub_Unicode c );
- xub_Unicode GetEchoChar() const { return mcEchoChar; }
+ void SetEchoChar( xub_Unicode c );
+ xub_Unicode GetEchoChar() const { return mcEchoChar; }
- virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
- virtual sal_Bool IsReadOnly() const { return mbReadOnly; }
+ virtual void SetReadOnly( BOOL bReadOnly = TRUE );
+ virtual BOOL IsReadOnly() const { return mbReadOnly; }
- void SetInsertMode( sal_Bool bInsert );
- sal_Bool IsInsertMode() const;
+ void SetInsertMode( BOOL bInsert );
+ BOOL IsInsertMode() const;
- virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT );
- virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; }
+ virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT );
+ virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; }
- virtual void SetSelection( const Selection& rSelection );
- virtual const Selection& GetSelection() const;
+ virtual void SetSelection( const Selection& rSelection );
+ virtual const Selection& GetSelection() const;
- virtual void ReplaceSelected( const XubString& rStr );
- virtual void DeleteSelected();
- virtual XubString GetSelected() const;
+ virtual void ReplaceSelected( const XubString& rStr );
+ virtual void DeleteSelected();
+ virtual XubString GetSelected() const;
- virtual void Cut();
- virtual void Copy();
- virtual void Paste();
- void Undo();
+ virtual void Cut();
+ virtual void Copy();
+ virtual void Paste();
+ void Undo();
- virtual void SetText( const XubString& rStr );
- virtual void SetText( const XubString& rStr, const Selection& rNewSelection );
- virtual XubString GetText() const;
+ virtual void SetText( const XubString& rStr );
+ virtual void SetText( const XubString& rStr, const Selection& rNewSelection );
+ virtual XubString GetText() const;
- void SaveValue() { maSaveValue = GetText(); }
- const XubString& GetSavedValue() const { return maSaveValue; }
+ void SaveValue() { maSaveValue = GetText(); }
+ const XubString& GetSavedValue() const { return maSaveValue; }
- virtual void SetModifyHdl( const Link& rLink ) { maModifyHdl = rLink; }
- virtual const Link& GetModifyHdl() const { return maModifyHdl; }
- virtual void SetUpdateDataHdl( const Link& rLink ) { maUpdateDataHdl = rLink; }
+ virtual void SetModifyHdl( const Link& rLink ) { maModifyHdl = rLink; }
+ virtual const Link& GetModifyHdl() const { return maModifyHdl; }
+ virtual void SetUpdateDataHdl( const Link& rLink ) { maUpdateDataHdl = rLink; }
virtual const Link& GetUpdateDataHdl() const { return maUpdateDataHdl; }
- void SetSubEdit( Edit* pEdit );
- Edit* GetSubEdit() const { return mpSubEdit; }
+ void SetSubEdit( Edit* pEdit );
+ Edit* GetSubEdit() const { return mpSubEdit; }
- void SetAutocompleteHdl( const Link& rHdl );
- const Link& GetAutocompleteHdl() const { return maAutocompleteHdl; }
- AutocompleteAction GetAutocompleteAction() const { return meAutocompleteAction; }
+ void SetAutocompleteHdl( const Link& rHdl );
+ const Link& GetAutocompleteHdl() const { return maAutocompleteHdl; }
+ AutocompleteAction GetAutocompleteAction() const { return meAutocompleteAction; }
- virtual Size CalcMinimumSize() const;
+ virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( sal_uInt16 nChars ) const;
- virtual xub_StrLen GetMaxVisChars() const;
+ virtual Size CalcSize( USHORT nChars ) const;
+ virtual xub_StrLen GetMaxVisChars() const;
xub_StrLen GetCharPos( const Point& rWindowPos ) const;
-
+
// shows a warning box saying "text too long, truncated"
static void ShowTruncationWarning( Window* pParent );
- static void SetGetSpecialCharsFunction( FncGetSpecialChars fn );
- static FncGetSpecialChars GetGetSpecialCharsFunction();
+ static void SetGetSpecialCharsFunction( FncGetSpecialChars fn );
+ static FncGetSpecialChars GetGetSpecialCharsFunction();
- static PopupMenu* CreatePopupMenu();
- static void DeletePopupMenu( PopupMenu* pMenu );
+ static PopupMenu* CreatePopupMenu();
+ static void DeletePopupMenu( PopupMenu* pMenu );
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 sal_uLong Edit::IsUpdateDataEnabled() const
+inline ULONG Edit::IsUpdateDataEnabled() const
{
if ( mpUpdateDataTimer )
return mpUpdateDataTimer->GetTimeout();
else
- return sal_False;
+ return FALSE;
}
-#endif // _SV_EDIT_HXX
+#endif // _SV_EDIT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx
index 9e8666ea7c78..64377b6a7ac2 100644
--- a/vcl/inc/vcl/event.hxx
+++ b/vcl/inc/vcl/event.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ namespace com { namespace sun { namespace star { namespace awt {
enum TextDirectionality {
TextDirectionality_LeftToRight_TopToBottom,
TextDirectionality_RightToLeft_TopToBottom,
- TextDirectionality_TopToBottom_RightToLeft
+ TextDirectionality_TopToBottom_RightToLeft
};
// ------------
@@ -58,13 +58,13 @@ class VCL_DLLPUBLIC KeyEvent
{
private:
KeyCode maKeyCode;
- sal_uInt16 mnRepeat;
+ USHORT mnRepeat;
xub_Unicode mnCharCode;
public:
KeyEvent();
KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
- sal_uInt16 nRepeat = 0 );
+ USHORT 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; }
- sal_uInt16 GetRepeat() const { return mnRepeat; }
+ USHORT 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,
- sal_uInt16 nRepeat ) :
+ USHORT nRepeat ) :
maKeyCode( rKeyCode )
{
@@ -101,24 +101,24 @@ inline KeyEvent::KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
// --------------------
// Maus-Move-Modi
-#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)
+#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)
// Maus-Button-Down/Up-Modi
-#define MOUSE_SIMPLECLICK ((sal_uInt16)0x0001)
-#define MOUSE_SELECT ((sal_uInt16)0x0002)
-#define MOUSE_MULTISELECT ((sal_uInt16)0x0004)
-#define MOUSE_RANGESELECT ((sal_uInt16)0x0008)
+#define MOUSE_SIMPLECLICK ((USHORT)0x0001)
+#define MOUSE_SELECT ((USHORT)0x0002)
+#define MOUSE_MULTISELECT ((USHORT)0x0004)
+#define MOUSE_RANGESELECT ((USHORT)0x0008)
// Maus-Buttons
-#define MOUSE_LEFT ((sal_uInt16)0x0001)
-#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
-#define MOUSE_RIGHT ((sal_uInt16)0x0004)
+#define MOUSE_LEFT ((USHORT)0x0001)
+#define MOUSE_MIDDLE ((USHORT)0x0002)
+#define MOUSE_RIGHT ((USHORT)0x0004)
// --------------
// - MouseEvent -
@@ -128,53 +128,53 @@ class VCL_DLLPUBLIC MouseEvent
{
private:
Point maPos;
- sal_uInt16 mnMode;
- sal_uInt16 mnClicks;
- sal_uInt16 mnCode;
+ USHORT mnMode;
+ USHORT mnClicks;
+ USHORT mnCode;
public:
MouseEvent();
- MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1,
- sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0,
- sal_uInt16 nModifier = 0 );
+ MouseEvent( const Point& rPos, USHORT nClicks = 1,
+ USHORT nMode = 0, USHORT nButtons = 0,
+ USHORT nModifier = 0 );
const Point& GetPosPixel() const { return maPos; }
- sal_uInt16 GetMode() const { return mnMode; }
+ USHORT 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;
- sal_uInt16 GetClicks() const { return mnClicks; }
+ USHORT GetClicks() const { return mnClicks; }
- sal_Bool IsEnterWindow() const
+ BOOL IsEnterWindow() const
{ return ((mnMode & MOUSE_ENTERWINDOW) != 0); }
- sal_Bool IsLeaveWindow() const
+ BOOL IsLeaveWindow() const
{ return ((mnMode & MOUSE_LEAVEWINDOW) != 0); }
- sal_Bool IsSynthetic() const
+ BOOL IsSynthetic() const
{ return ((mnMode & MOUSE_SYNTHETIC) != 0); }
- sal_Bool IsModifierChanged() const
+ BOOL IsModifierChanged() const
{ return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); }
- sal_uInt16 GetButtons() const
+ USHORT GetButtons() const
{ return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
- sal_Bool IsLeft() const
+ BOOL IsLeft() const
{ return ((mnCode & MOUSE_LEFT) != 0); }
- sal_Bool IsMiddle() const
+ BOOL IsMiddle() const
{ return ((mnCode & MOUSE_MIDDLE) != 0); }
- sal_Bool IsRight() const
+ BOOL IsRight() const
{ return ((mnCode & MOUSE_RIGHT) != 0); }
- sal_uInt16 GetModifier() const
+ USHORT GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
- bool IsShift() const
+ BOOL IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- sal_Bool IsMod1() const
+ BOOL IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- sal_Bool IsMod2() const
+ BOOL IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- sal_Bool IsMod3() const
+ BOOL IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -185,9 +185,9 @@ inline MouseEvent::MouseEvent()
mnCode = 0;
}
-inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
- sal_uInt16 nMode,
- sal_uInt16 nButtons, sal_uInt16 nModifier ) :
+inline MouseEvent::MouseEvent( const Point& rPos, USHORT nClicks,
+ USHORT nMode,
+ USHORT nButtons, USHORT nModifier ) :
maPos( rPos )
{
mnClicks = nClicks;
@@ -199,46 +199,46 @@ inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
// - HelpEvent -
// -------------
-#define HELPMODE_CONTEXT ((sal_uInt16)0x0001)
-#define HELPMODE_EXTENDED ((sal_uInt16)0x0002)
-#define HELPMODE_BALLOON ((sal_uInt16)0x0004)
-#define HELPMODE_QUICK ((sal_uInt16)0x0008)
+#define HELPMODE_CONTEXT ((USHORT)0x0001)
+#define HELPMODE_EXTENDED ((USHORT)0x0002)
+#define HELPMODE_BALLOON ((USHORT)0x0004)
+#define HELPMODE_QUICK ((USHORT)0x0008)
class VCL_DLLPUBLIC HelpEvent
{
private:
Point maPos;
- sal_uInt16 mnMode;
- sal_Bool mbKeyboardActivated;
+ USHORT mnMode;
+ BOOL mbKeyboardActivated;
public:
HelpEvent();
- HelpEvent( sal_uInt16 nHelpMode );
- HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode );
+ HelpEvent( USHORT nHelpMode );
+ HelpEvent( const Point& rMousePos, USHORT nHelpMode );
const Point& GetMousePosPixel() const;
- sal_uInt16 GetMode() const { return mnMode; }
- sal_Bool KeyboardActivated() const { return mbKeyboardActivated; }
- void SetKeyboardActivated( sal_Bool bKeyboard ) { mbKeyboardActivated = bKeyboard; }
+ USHORT GetMode() const { return mnMode; }
+ BOOL KeyboardActivated() const { return mbKeyboardActivated; }
+ void SetKeyboardActivated( BOOL bKeyboard ) { mbKeyboardActivated = bKeyboard; }
};
inline HelpEvent::HelpEvent()
{
mnMode = HELPMODE_CONTEXT;
- mbKeyboardActivated = sal_True;
+ mbKeyboardActivated = TRUE;
}
-inline HelpEvent::HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ) :
+inline HelpEvent::HelpEvent( const Point& rMousePos, USHORT nHelpMode ) :
maPos( rMousePos )
{
mnMode = nHelpMode;
- mbKeyboardActivated = sal_False;
+ mbKeyboardActivated = FALSE;
}
-inline HelpEvent::HelpEvent( sal_uInt16 nHelpMode )
+inline HelpEvent::HelpEvent( USHORT nHelpMode )
{
mnMode = nHelpMode;
- mbKeyboardActivated = sal_True;
+ mbKeyboardActivated = TRUE;
}
// -----------------
@@ -250,19 +250,19 @@ class VCL_DLLPUBLIC UserDrawEvent
private:
OutputDevice* mpOutDev;
Rectangle maOutRect;
- sal_uInt16 mnItemId;
- sal_uInt16 mnStyle;
+ USHORT mnItemId;
+ USHORT mnStyle;
public:
UserDrawEvent();
UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- sal_uInt16 nId, sal_uInt16 nStyle = 0 );
+ USHORT nId, USHORT nStyle = 0 );
OutputDevice* GetDevice() const { return mpOutDev; }
const Rectangle& GetRect() const { return maOutRect; }
- sal_uInt16 GetItemId() const { return mnItemId; }
- sal_uInt16 GetStyle() const { return mnStyle; }
+ USHORT GetItemId() const { return mnItemId; }
+ USHORT GetStyle() const { return mnStyle; }
};
inline UserDrawEvent::UserDrawEvent()
@@ -274,7 +274,7 @@ inline UserDrawEvent::UserDrawEvent()
inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- sal_uInt16 nId, sal_uInt16 nStyle ) :
+ USHORT nId, USHORT nStyle ) :
maOutRect( rOutRect )
{
mpOutDev = pOut;
@@ -286,13 +286,13 @@ inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
// - Tracking-Types -
// ------------------
-#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 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 TRACKING_REPEAT ((sal_uInt16)0x0100)
+#define TRACKING_REPEAT ((USHORT)0x0100)
// -----------------
// - TrackingEvent -
@@ -302,23 +302,23 @@ class VCL_DLLPUBLIC TrackingEvent
{
private:
MouseEvent maMEvt;
- sal_uInt16 mnFlags;
+ USHORT mnFlags;
public:
TrackingEvent();
TrackingEvent( const MouseEvent& rMEvt,
- sal_uInt16 nTrackFlags = 0 );
+ USHORT nTrackFlags = 0 );
const MouseEvent& GetMouseEvent() const { return maMEvt; }
- sal_Bool IsTrackingRepeat() const
+ BOOL IsTrackingRepeat() const
{ return ((mnFlags & TRACKING_REPEAT) != 0); }
- sal_Bool IsTrackingEnded() const
+ BOOL IsTrackingEnded() const
{ return ((mnFlags & ENDTRACK_END) != 0); }
- sal_Bool IsTrackingCanceled() const
+ BOOL IsTrackingCanceled() const
{ return ((mnFlags & ENDTRACK_CANCEL) != 0); }
- sal_uInt16 GetTrackingFlags() const { return mnFlags; }
+ USHORT GetTrackingFlags() const { return mnFlags; }
};
inline TrackingEvent::TrackingEvent()
@@ -327,7 +327,7 @@ inline TrackingEvent::TrackingEvent()
}
inline TrackingEvent::TrackingEvent( const MouseEvent& rMEvt,
- sal_uInt16 nTrackFlags ) :
+ USHORT nTrackFlags ) :
maMEvt( rMEvt )
{
mnFlags = nTrackFlags;
@@ -357,17 +357,17 @@ class VCL_DLLPUBLIC NotifyEvent
private:
Window* mpWindow;
void* mpData;
- sal_uInt16 mnType;
+ USHORT mnType;
long mnRetValue;
public:
NotifyEvent();
- NotifyEvent( sal_uInt16 nType,
+ NotifyEvent( USHORT nType,
Window* pWindow,
const void* pEvent = NULL,
long nRet = 0 );
- sal_uInt16 GetType() const { return mnType; }
+ USHORT 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( sal_uInt16 nType, Window* pWindow,
+inline NotifyEvent::NotifyEvent( USHORT nType, Window* pWindow,
const void* pEvent, long nRet )
{
mpWindow = pWindow;
@@ -424,30 +424,30 @@ inline const CommandEvent* NotifyEvent::GetCommandEvent() const
// - DataChangedEvent -
// --------------------
-#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)
+#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)
class VCL_DLLPUBLIC DataChangedEvent
{
private:
void* mpData;
- sal_uLong mnFlags;
- sal_uInt16 mnType;
+ ULONG mnFlags;
+ USHORT mnType;
public:
DataChangedEvent();
- DataChangedEvent( sal_uInt16 nType,
+ DataChangedEvent( USHORT nType,
const void* pData = NULL,
- sal_uLong nFlags = 0 );
+ ULONG nFlags = 0 );
- sal_uInt16 GetType() const { return mnType; }
+ USHORT GetType() const { return mnType; }
void* GetData() const { return mpData; }
- sal_uLong GetFlags() const { return mnFlags; }
+ ULONG GetFlags() const { return mnFlags; }
const AllSettings* GetOldSettings() const;
};
@@ -459,9 +459,9 @@ inline DataChangedEvent::DataChangedEvent()
mnType = 0;
}
-inline DataChangedEvent::DataChangedEvent( sal_uInt16 nType,
+inline DataChangedEvent::DataChangedEvent( USHORT nType,
const void* pData,
- sal_uLong nChangeFlags )
+ ULONG nChangeFlags )
{
mpData = (void*)pData;
mnFlags = nChangeFlags;
diff --git a/vcl/inc/vcl/evntpost.hxx b/vcl/inc/vcl/evntpost.hxx
index 90a165506c65..aa70ed36f528 100644
--- a/vcl/inc/vcl/evntpost.hxx
+++ b/vcl/inc/vcl/evntpost.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,13 +37,13 @@ namespace vcl
{
struct UserEvent
{
- sal_uLong m_nWhich;
+ ULONG m_nWhich;
void* m_pData;
};
class VCL_DLLPUBLIC EventPoster
{
- sal_uLong m_nId;
+ ULONG m_nId;
Link m_aLink;
DECL_DLLPRIVATE_LINK( DoEvent_Impl, UserEvent* );
diff --git a/vcl/inc/vcl/extoutdevdata.hxx b/vcl/inc/vcl/extoutdevdata.hxx
index 28f9a05c5b9f..c23c8b27b7a2 100644
--- a/vcl/inc/vcl/extoutdevdata.hxx
+++ b/vcl/inc/vcl/extoutdevdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index fd0ce90cb0d7..a1e989c29329 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#include <tools/time.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/combobox.hxx>
-#include <tools/fldunit.hxx>
+#include <vcl/fldunit.hxx>
namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
@@ -52,21 +52,21 @@ private:
Edit* mpField;
LocaleDataWrapper* mpLocaleDataWrapper;
Link maErrorLink;
- sal_Bool mbReformat;
- sal_Bool mbStrictFormat;
- sal_Bool mbEmptyFieldValue;
- sal_Bool mbEmptyFieldValueEnabled;
- sal_Bool mbDefaultLocale;
+ BOOL mbReformat;
+ BOOL mbStrictFormat;
+ BOOL mbEmptyFieldValue;
+ BOOL mbEmptyFieldValueEnabled;
+ BOOL mbDefaultLocale;
protected:
SAL_DLLPRIVATE void ImplSetText( const XubString& rText, Selection* pNewSel = NULL );
- SAL_DLLPRIVATE sal_Bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
+ SAL_DLLPRIVATE BOOL ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
- void SetFieldText( const XubString& rText, sal_Bool bKeepSelection );
- void SetEmptyFieldValueData( sal_Bool bValue ) { mbEmptyFieldValue = bValue; }
+ void SetFieldText( const XubString& rText, BOOL bKeepSelection );
+ void SetEmptyFieldValueData( BOOL bValue ) { mbEmptyFieldValue = bValue; }
SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
- sal_Bool IsDefaultLocale() const { return mbDefaultLocale; }
+ 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; }
- sal_Bool MustBeReformatted() const { return mbReformat; }
- void MarkToBeReformatted( sal_Bool b ) { mbReformat = b; }
+ BOOL MustBeReformatted() const { return mbReformat; }
+ void MarkToBeReformatted( BOOL b ) { mbReformat = b; }
- void SetStrictFormat( sal_Bool bStrict );
- sal_Bool IsStrictFormat() const { return mbStrictFormat; }
+ void SetStrictFormat( BOOL bStrict );
+ BOOL IsStrictFormat() const { return mbStrictFormat; }
virtual void Reformat();
virtual void ReformatAll();
@@ -95,10 +95,10 @@ public:
const Link& GetErrorHdl() const { return maErrorLink; }
void SetEmptyFieldValue();
- sal_Bool IsEmptyFieldValue() const;
+ BOOL IsEmptyFieldValue() const;
- void EnableEmptyFieldValue( sal_Bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
- sal_Bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
+ void EnableEmptyFieldValue( BOOL bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
+ BOOL IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
};
@@ -106,7 +106,7 @@ public:
// - PatternFormatter -
// --------------------
-#define PATTERN_FORMAT_EMPTYLITERALS ((sal_uInt16)0x0001)
+#define PATTERN_FORMAT_EMPTYLITERALS ((USHORT)0x0001)
class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
{
@@ -114,17 +114,17 @@ private:
ByteString maEditMask;
XubString maFieldString;
XubString maLiteralMask;
- sal_uInt16 mnFormatFlags;
- sal_Bool mbSameMask;
- sal_Bool mbInPattKeyInput;
+ USHORT mnFormatFlags;
+ BOOL mbSameMask;
+ BOOL mbInPattKeyInput;
protected:
PatternFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
- SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
- SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
+ SAL_DLLPRIVATE BOOL ImplIsSameMask() const { return mbSameMask; }
+ SAL_DLLPRIVATE 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( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
- sal_uInt16 GetFormatFlags() const { return mnFormatFlags; }
+ void SetFormatFlags( USHORT nFlags ) { mnFormatFlags = nFlags; }
+ USHORT GetFormatFlags() const { return mnFormatFlags; }
void SetString( const XubString& rStr );
XubString GetString() const;
- sal_Bool IsStringModified() const { return !(GetString().Equals( maFieldString )); }
+ BOOL IsStringModified() const { return !(GetString().Equals( maFieldString )); }
void SelectFixedFont();
};
@@ -161,10 +161,10 @@ protected:
sal_Int64 mnMin;
sal_Int64 mnMax;
sal_Int64 mnCorrectedValue;
- sal_uInt16 mnType;
- sal_uInt16 mnDecimalDigits;
- sal_Bool mbThousandSep;
- sal_Bool mbShowTrailingZeros;
+ USHORT mnType;
+ USHORT mnDecimalDigits;
+ BOOL mbThousandSep;
+ 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 sal_Bool ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE 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( sal_uInt16 nDigits );
- sal_uInt16 GetDecimalDigits() const;
-
- void SetUseThousandSep( sal_Bool b );
- sal_Bool IsUseThousandSep() const { return mbThousandSep; }
-
- void SetShowTrailingZeros( sal_Bool bShowTrailingZeros );
- sal_Bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
+ void SetDecimalDigits( USHORT nDigits );
+ USHORT GetDecimalDigits() const;
+ void SetUseThousandSep( BOOL b );
+ BOOL IsUseThousandSep() const { return mbThousandSep; }
+
+ void SetShowTrailingZeros( BOOL bShowTrailingZeros );
+ BOOL IsShowTrailingZeros() const { return mbShowTrailingZeros; }
+
void SetUserValue( sal_Int64 nNewValue );
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue() const;
- sal_Bool IsValueModified() const;
+ 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 sal_Bool ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE 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 sal_Bool ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE BOOL ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
public:
~CurrencyFormatter();
@@ -329,12 +329,12 @@ private:
Date maMin;
Date maMax;
Date maCorrectedDate;
- sal_Bool mbLongFormat;
- sal_Bool mbEmptyDate;
- sal_Bool mbShowDateCentury;
- sal_uInt16 mnDateFormat;
- sal_uLong mnExtDateFormat;
- sal_Bool mbEnforceValidValue;
+ BOOL mbLongFormat;
+ BOOL mbEmptyDate;
+ BOOL mbShowDateCentury;
+ USHORT mnDateFormat;
+ ULONG mnExtDateFormat;
+ 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 sal_Bool ImplDateReformat( const XubString& rStr, XubString& rOutStr,
+ SAL_DLLPRIVATE 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 sal_Bool ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
public:
~DateFormatter();
@@ -364,7 +364,7 @@ public:
void SetExtDateFormat( ExtDateFieldFormat eFormat );
- ExtDateFieldFormat GetExtDateFormat( sal_Bool bResolveSystemFormat = sal_False ) const;
+ ExtDateFieldFormat GetExtDateFormat( BOOL bResolveSystemFormat = 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=sal_False?
+ // What should happen if using DDMMYYYY, but ShowCentury=FALSE?
// --------------------------------------------------------------
- void SetLongFormat( sal_Bool bLong );
- sal_Bool IsLongFormat() const { return mbLongFormat; }
- void SetShowDateCentury( sal_Bool bShowCentury );
- sal_Bool IsShowDateCentury() const { return mbShowDateCentury; }
+ void SetLongFormat( BOOL bLong );
+ BOOL IsLongFormat() const { return mbLongFormat; }
+ void SetShowDateCentury( BOOL bShowCentury );
+ BOOL IsShowDateCentury() const { return mbShowDateCentury; }
// --------------------------------------------------------------
void SetDate( const Date& rNewDate );
void SetUserDate( const Date& rNewDate );
Date GetDate() const;
Date GetRealDate() const;
- sal_Bool IsDateModified() const;
+ BOOL IsDateModified() const;
void SetEmptyDate();
- sal_Bool IsEmptyDate() const;
+ 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, sal_uInt16 nTwoDigitYearStart );
+ static void ExpandCentury( Date& rDate, USHORT 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( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline BOOL IsEnforceValidValue( ) const { return mbEnforceValidValue; }
};
@@ -428,10 +428,10 @@ private:
Time maMax;
Time maCorrectedTime;
TimeFieldFormat meFormat;
- sal_uInt16 mnTimeFormat;
- sal_Bool mbDuration;
- sal_Bool mbEmptyTime;
- sal_Bool mbEnforceValidValue;
+ USHORT mnTimeFormat;
+ BOOL mbDuration;
+ BOOL mbEmptyTime;
+ BOOL mbEnforceValidValue;
SAL_DLLPRIVATE void ImplInit();
@@ -441,10 +441,10 @@ protected:
TimeFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE 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 sal_Bool ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
public:
@@ -469,16 +469,16 @@ public:
void SetFormat( TimeFieldFormat eNewFormat );
TimeFieldFormat GetFormat() const { return meFormat; }
- void SetDuration( sal_Bool mbDuration );
- sal_Bool IsDuration() const { return mbDuration; }
+ void SetDuration( BOOL mbDuration );
+ BOOL IsDuration() const { return mbDuration; }
void SetTime( const Time& rNewTime );
void SetUserTime( const Time& rNewTime );
Time GetTime() const;
Time GetRealTime() const;
- sal_Bool IsTimeModified() const;
+ BOOL IsTimeModified() const;
void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
- sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
+ 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( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline 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, sal_uInt16 nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
-
+
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, USHORT nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, USHORT nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, USHORT 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( sal_Bool bUp );
+ SAL_DLLPRIVATE void ImplDateSpinArea( BOOL bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -687,7 +687,7 @@ private:
Time maLast;
protected:
- SAL_DLLPRIVATE void ImplTimeSpinArea( sal_Bool bUp );
+ SAL_DLLPRIVATE void ImplTimeSpinArea( BOOL bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -734,11 +734,11 @@ public:
virtual void ReformatAll();
void InsertString( const XubString& rStr,
- sal_uInt16 nPos = COMBOBOX_APPEND );
+ USHORT nPos = COMBOBOX_APPEND );
void RemoveString( const XubString& rStr );
using PatternFormatter::GetString;
- XubString GetString( sal_uInt16 nPos ) const;
- sal_uInt16 GetStringPos( const XubString& rStr ) const;
+ XubString GetString( USHORT nPos ) const;
+ USHORT GetStringPos( const XubString& rStr ) const;
};
@@ -761,11 +761,11 @@ public:
virtual void ReformatAll();
- void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
using NumericFormatter::GetValue;
- sal_Int64 GetValue( sal_uInt16 nPos ) const;
- sal_uInt16 GetValuePos( sal_Int64 nPos ) const;
+ sal_Int64 GetValue( USHORT nPos ) const;
+ USHORT GetValuePos( sal_Int64 nPos ) const;
};
@@ -790,10 +790,10 @@ public:
virtual void ReformatAll();
void InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE,
- sal_uInt16 nPos = COMBOBOX_APPEND );
+ USHORT nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE );
- sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
- sal_uInt16 GetValuePos( sal_Int64 nValue,
+ sal_Int64 GetValue( USHORT nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
+ USHORT 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, sal_uInt16 nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
- sal_Int64 GetValue( sal_uInt16 nPos ) const;
- sal_uInt16 GetValuePos( sal_Int64 nValue ) const;
+ sal_Int64 GetValue( USHORT nPos ) const;
+ USHORT 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, sal_uInt16 nPos = COMBOBOX_APPEND );
+ void InsertDate( const Date& rDate, USHORT nPos = COMBOBOX_APPEND );
void RemoveDate( const Date& rDate );
using DateFormatter::GetDate;
- Date GetDate( sal_uInt16 nPos ) const;
- sal_uInt16 GetDatePos( const Date& rDate ) const;
+ Date GetDate( USHORT nPos ) const;
+ USHORT GetDatePos( const Date& rDate ) const;
};
@@ -877,11 +877,11 @@ public:
virtual void ReformatAll();
- void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND );
+ void InsertTime( const Time& rTime, USHORT nPos = COMBOBOX_APPEND );
void RemoveTime( const Time& rTime );
using TimeFormatter::GetTime;
- Time GetTime( sal_uInt16 nPos ) const;
- sal_uInt16 GetTimePos( const Time& rTime ) const;
+ Time GetTime( USHORT nPos ) const;
+ USHORT GetTimePos( const Time& rTime ) const;
};
#endif // _SV_FIELD_HXX
diff --git a/vcl/inc/vcl/fixbrd.hxx b/vcl/inc/vcl/fixbrd.hxx
index e091f68d4fad..295de6de5e82 100644
--- a/vcl/inc/vcl/fixbrd.hxx
+++ b/vcl/inc/vcl/fixbrd.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,11 +38,11 @@
// - FixedBorder-Types -
// ---------------------
-#define FIXEDBORDER_TYPE_IN (FRAME_DRAW_IN)
-#define FIXEDBORDER_TYPE_OUT (FRAME_DRAW_OUT)
-#define FIXEDBORDER_TYPE_GROUP (FRAME_DRAW_GROUP)
-#define FIXEDBORDER_TYPE_DOUBLEIN (FRAME_DRAW_DOUBLEIN)
-#define FIXEDBORDER_TYPE_DOUBLEOUT (FRAME_DRAW_DOUBLEOUT)
+#define FIXEDBORDER_TYPE_IN (FRAME_DRAW_IN)
+#define FIXEDBORDER_TYPE_OUT (FRAME_DRAW_OUT)
+#define FIXEDBORDER_TYPE_GROUP (FRAME_DRAW_GROUP)
+#define FIXEDBORDER_TYPE_DOUBLEIN (FRAME_DRAW_DOUBLEIN)
+#define FIXEDBORDER_TYPE_DOUBLEOUT (FRAME_DRAW_DOUBLEOUT)
// ---------------
// - FixedBorder -
@@ -51,16 +51,16 @@
class VCL_DLLPUBLIC FixedBorder : public Control
{
private:
- sal_uInt16 mnType;
- sal_Bool mbTransparent;
+ USHORT mnType;
+ BOOL mbTransparent;
private:
using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize );
public:
@@ -68,18 +68,18 @@ public:
FixedBorder( Window* pParent, const ResId& rResId );
~FixedBorder();
- virtual void Paint( const Rectangle& rRect );
- 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 );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void SetTransparent( sal_Bool bTransparent );
- sal_Bool IsTransparent() const { return mbTransparent; }
- void SetBorderType( sal_uInt16 nType );
- sal_uInt16 GetBorderType() const { return mnType; }
+ void SetTransparent( BOOL bTransparent );
+ BOOL IsTransparent() const { return mbTransparent; }
+ void SetBorderType( USHORT nType );
+ USHORT GetBorderType() const { return mnType; }
};
-#endif // _SV_FIXBRD_HXX
+#endif // _SV_FIXBRD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 3912f19e778a..a2a52ef598b1 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
public:
- SAL_DLLPRIVATE static sal_uInt16 ImplGetTextStyle( WinBits nWinBits );
+ SAL_DLLPRIVATE static USHORT 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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -87,11 +87,11 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplDraw( bool bLayout = false );
protected:
- virtual void FillLayoutData() const;
+ virtual void FillLayoutData() const;
virtual const Font&
GetCanonicalFont( const StyleSettings& _rStyle ) const;
virtual const Color&
@@ -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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -118,13 +118,14 @@ class VCL_DLLPUBLIC FixedBitmap : public Control
{
private:
Bitmap maBitmap;
+ Bitmap maBitmapHC;
using Control::ImplInitSettings;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize );
protected:
@@ -136,7 +137,7 @@ public:
~FixedBitmap();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -144,8 +145,8 @@ public:
void SetBitmap( const Bitmap& rBitmap );
using OutputDevice::GetBitmap;
const Bitmap& GetBitmap() const { return maBitmap; }
- sal_Bool SetModeBitmap( const Bitmap& rBitmap );
- const Bitmap& GetModeBitmap( ) const;
+ BOOL SetModeBitmap( const Bitmap& rBitmap, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Bitmap& GetModeBitmap( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
};
// --------------
@@ -156,7 +157,8 @@ class VCL_DLLPUBLIC FixedImage : public Control
{
private:
Image maImage;
- sal_Bool mbInUserDraw;
+ Image maImageHC;
+ BOOL mbInUserDraw;
private:
using Control::ImplInitSettings;
@@ -164,10 +166,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 +178,7 @@ public:
~FixedImage();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -186,8 +188,8 @@ public:
void SetImage( const Image& rImage );
const Image& GetImage() const { return maImage; }
- sal_Bool SetModeImage( const Image& rImage );
- const Image& GetModeImage( ) const;
+ BOOL SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Image& GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
Point CalcImagePos( const Point& rPos,
const Size& rObjSize, const Size& rWinSize );
diff --git a/vcl/inc/vcl/fldunit.hxx b/vcl/inc/vcl/fldunit.hxx
new file mode 100644
index 000000000000..c5a84fcaa8a0
--- /dev/null
+++ b/vcl/inc/vcl/fldunit.hxx
@@ -0,0 +1,36 @@
+/* -*- 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 e6a5b58eea32..7007c7ec7724 100644
--- a/vcl/inc/vcl/floatwin.hxx
+++ b/vcl/inc/vcl/floatwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,34 +40,34 @@ class PopupModeEvent;
// - FloatingWindow-Types -
// ------------------------
-#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)
+#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)
// ------------------
// - FloatingWindow -
@@ -78,22 +78,22 @@ class VCL_DLLPUBLIC FloatingWindow : public SystemWindow
class ImplData;
private:
FloatingWindow* mpNextFloat;
- Window* mpFirstPopupModeWin;
+ Window* mpFirstPopupModeWin;
ImplData* mpImplData;
- Rectangle maFloatRect;
- 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;
+ 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;
+ Link maPopupModeEndHdl;
SAL_DLLPRIVATE void ImplCallPopupModeEnd();
DECL_DLLPRIVATE_LINK( ImplEndPopupModeHdl, void* );
@@ -109,53 +109,53 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
-#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 );
+#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 );
SAL_DLLPRIVATE FloatingWindow* ImplFindLastLevelFloat();
- 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, sal_uLong nFlags,
- sal_uInt16& rArrangeIndex );
- SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
+ SAL_DLLPRIVATE BOOL ImplIsFloatPopupModeWindow( const Window* pWindow );
+ SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = TRUE; }
+ SAL_DLLPRIVATE 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 );
SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
- SAL_DLLPRIVATE sal_Bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
+ SAL_DLLPRIVATE BOOL ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
public:
FloatingWindow( Window* pParent, WinBits nStyle = WB_STDFLOATWIN );
FloatingWindow( Window* pParent, const ResId& rResId );
~FloatingWindow();
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void PopupModeEnd();
+ virtual void PopupModeEnd();
- void SetTitleType( sal_uInt16 nTitle );
- sal_uInt16 GetTitleType() const { return mnTitle; }
+ void SetTitleType( USHORT nTitle );
+ USHORT GetTitleType() const { return mnTitle; }
- 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 );
- 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 StartPopupMode( const Rectangle& rRect, ULONG nFlags = 0 );
+ void StartPopupMode( ToolBox* pBox, ULONG nFlags = 0 );
+ void EndPopupMode( USHORT 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; }
- void SetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; }
- const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; }
+ void SetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; }
+ const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; }
- sal_Bool GrabsFocus() const { return mbGrabFocus; }
+ BOOL GrabsFocus() const { return mbGrabFocus; }
- static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex );
+ static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex );
};
#endif // _SV_FLOATWIN_HXX
diff --git a/vcl/inc/vcl/fntstyle.hxx b/vcl/inc/vcl/fntstyle.hxx
index 82c8c8ad5932..103863dbe272 100644
--- a/vcl/inc/vcl/fntstyle.hxx
+++ b/vcl/inc/vcl/fntstyle.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,10 +47,10 @@ enum FontRelief { RELIEF_NONE, RELIEF_EMBOSSED, RELIEF_ENGRAVED, FontRelief_FORC
// - Font types -
// --------------
-typedef sal_uInt8 FontKerning;
-#define KERNING_FONTSPECIFIC ((FontKerning)0x01)
-#define KERNING_ASIAN ((FontKerning)0x02)
+typedef BYTE FontKerning;
+#define KERNING_FONTSPECIFIC ((FontKerning)0x01)
+#define KERNING_ASIAN ((FontKerning)0x02)
-#endif // _VCL_FNTSTYLE_HXX
+#endif // _VCL_FNTSTYLE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/font.hxx b/vcl/inc/vcl/font.hxx
index 8ca4ba5bbb87..e59575d9407f 100644
--- a/vcl/inc/vcl/font.hxx
+++ b/vcl/inc/vcl/font.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,8 +50,8 @@ class ImplFontAttributes;
class VCL_DLLPUBLIC Font
{
private:
- Impl_Font* mpImplFont;
- void MakeUnique();
+ Impl_Font* mpImplFont;
+ void MakeUnique();
public:
Font();
@@ -61,83 +61,83 @@ public:
Font( FontFamily eFamily, const Size& );
~Font();
- void SetColor( const Color& );
- const Color& GetColor() const;
- void SetFillColor( const Color& );
- const Color& GetFillColor() const;
- void SetTransparent( sal_Bool bTransparent );
- sal_Bool IsTransparent() const;
- void SetAlign( FontAlign );
- FontAlign GetAlign() const;
-
- void SetName( const String& rFamilyName );
- const String& GetName() const;
- void SetStyleName( const String& rStyleName );
- const String& GetStyleName() const;
- void SetSize( const Size& );
- const Size& GetSize() const;
- void SetHeight( long nHeight );
- long GetHeight() const;
- void SetWidth( long nWidth );
- long GetWidth() const;
-
- void SetFamily( FontFamily );
- FontFamily GetFamily() const;
- void SetCharSet( rtl_TextEncoding );
- rtl_TextEncoding GetCharSet() const;
- void SetLanguage( LanguageType );
- LanguageType GetLanguage() const;
- void SetCJKContextLanguage( LanguageType );
- LanguageType GetCJKContextLanguage() const;
- void SetPitch( FontPitch ePitch );
- FontPitch GetPitch() const;
-
- void SetOrientation( short nLineOrientation );
- short GetOrientation() const;
- void SetVertical( sal_Bool bVertical );
- sal_Bool IsVertical() const;
- void SetKerning( FontKerning nKerning );
- FontKerning GetKerning() const;
- sal_Bool IsKerning() const;
-
- void SetWeight( FontWeight );
- FontWeight GetWeight() const;
- void SetWidthType( FontWidth );
- FontWidth GetWidthType() const;
- void SetItalic( FontItalic );
- FontItalic GetItalic() 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 );
- FontUnderline GetUnderline() const;
- void SetOverline( FontUnderline );
- FontUnderline GetOverline() const;
- void SetStrikeout( FontStrikeout );
- FontStrikeout GetStrikeout() const;
- void SetEmphasisMark( FontEmphasisMark );
- FontEmphasisMark GetEmphasisMark() const;
- void SetWordLineMode( sal_Bool bWordLine );
- sal_Bool IsWordLineMode() const;
-
- void Merge( const Font& rFont );
+ void SetColor( const Color& );
+ const Color& GetColor() const;
+ void SetFillColor( const Color& );
+ const Color& GetFillColor() const;
+ void SetTransparent( BOOL bTransparent );
+ BOOL IsTransparent() const;
+ void SetAlign( FontAlign );
+ FontAlign GetAlign() const;
+
+ void SetName( const String& rFamilyName );
+ const String& GetName() const;
+ void SetStyleName( const String& rStyleName );
+ const String& GetStyleName() const;
+ void SetSize( const Size& );
+ const Size& GetSize() const;
+ void SetHeight( long nHeight );
+ long GetHeight() const;
+ void SetWidth( long nWidth );
+ long GetWidth() const;
+
+ void SetFamily( FontFamily );
+ FontFamily GetFamily() const;
+ void SetCharSet( rtl_TextEncoding );
+ rtl_TextEncoding GetCharSet() const;
+ void SetLanguage( LanguageType );
+ LanguageType GetLanguage() const;
+ void SetCJKContextLanguage( LanguageType );
+ LanguageType GetCJKContextLanguage() const;
+ void SetPitch( FontPitch ePitch );
+ FontPitch GetPitch() const;
+
+ void SetOrientation( short nLineOrientation );
+ short GetOrientation() const;
+ void SetVertical( BOOL bVertical );
+ BOOL IsVertical() const;
+ void SetKerning( FontKerning nKerning );
+ FontKerning GetKerning() const;
+ BOOL IsKerning() const;
+
+ void SetWeight( FontWeight );
+ FontWeight GetWeight() const;
+ void SetWidthType( FontWidth );
+ FontWidth GetWidthType() const;
+ void SetItalic( FontItalic );
+ FontItalic GetItalic() const;
+ void SetOutline( BOOL bOutline );
+ BOOL IsOutline() const;
+ void SetShadow( BOOL bShadow );
+ BOOL IsShadow() const;
+ void SetRelief( FontRelief );
+ FontRelief GetRelief() const;
+ void SetUnderline( FontUnderline );
+ FontUnderline GetUnderline() const;
+ void SetOverline( FontUnderline );
+ FontUnderline GetOverline() const;
+ void SetStrikeout( FontStrikeout );
+ FontStrikeout GetStrikeout() const;
+ void SetEmphasisMark( FontEmphasisMark );
+ FontEmphasisMark GetEmphasisMark() const;
+ void SetWordLineMode( BOOL bWordLine );
+ BOOL IsWordLineMode() const;
+
+ void Merge( const Font& rFont );
void GetFontAttributes( ImplFontAttributes& rAttrs ) const;
- Font& operator=( const Font& );
- sal_Bool operator==( const Font& ) const;
- sal_Bool operator!=( const Font& rFont ) const
+ Font& operator=( const Font& );
+ BOOL operator==( const Font& ) const;
+ BOOL operator!=( const Font& rFont ) const
{ return !(Font::operator==( rFont )); }
- sal_Bool IsSameInstance( const Font& ) const;
-
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
+ BOOL IsSameInstance( const Font& ) const;
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
+
static Font identifyFont( const void* pBuffer, sal_uInt32 nLen );
};
-#endif // _VCL_FONT_HXX
+#endif // _VCL_FONT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/fontcache.hxx b/vcl/inc/vcl/fontcache.hxx
index ad261e8d8e6d..8beb1e4c6a70 100644
--- a/vcl/inc/vcl/fontcache.hxx
+++ b/vcl/inc/vcl/fontcache.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,12 +34,12 @@
#include "tools/string.hxx"
-#include <boost/unordered_map.hpp>
+#include <hash_map>
namespace psp
{
-class VCL_PLUGIN_PUBLIC FontCache
+class VCL_DLLPUBLIC FontCache
{
struct FontDir;
friend class FontDir;
@@ -49,24 +49,24 @@ class VCL_PLUGIN_PUBLIC FontCache
typedef std::list< PrintFontManager::PrintFont* > FontCacheEntry;
struct FontFile
{
- FontCacheEntry m_aEntry;
+ FontCacheEntry m_aEntry;
};
- typedef boost::unordered_map< ::rtl::OString, FontFile, ::rtl::OStringHash > FontDirMap;
+ typedef std::hash_map< ::rtl::OString, FontFile, ::rtl::OStringHash > FontDirMap;
struct FontDir
{
- sal_Int64 m_nTimestamp;
- bool m_bNoFiles;
+ sal_Int64 m_nTimestamp;
+ bool m_bNoFiles;
bool m_bUserOverrideOnly;
- FontDirMap m_aEntries;
+ FontDirMap m_aEntries;
FontDir() : m_nTimestamp(0), m_bNoFiles(false), m_bUserOverrideOnly( false ) {}
};
-
- typedef boost::unordered_map< int, FontDir > FontCacheData;
- FontCacheData m_aCache;
- String m_aCacheFile;
- bool m_bDoFlush;
+
+ typedef std::hash_map< int, FontDir > FontCacheData;
+ FontCacheData m_aCache;
+ String m_aCacheFile;
+ bool m_bDoFlush;
void read();
void clearCache();
diff --git a/vcl/inc/vcl/fontcapabilities.hxx b/vcl/inc/vcl/fontcapabilities.hxx
deleted file mode 100644
index 09eddf4e3a5b..000000000000
--- a/vcl/inc/vcl/fontcapabilities.hxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Initial Developer of the Original Code is
- * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
- * Portions created by the Initial Developer are Copyright (C) 2011 the
- * Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Caolán McNamara <caolanm@redhat.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-#ifndef _VCLFONTCAPABILITIES_HXX
-#define _VCLFONTCAPABILITIES_HXX
-
-#include <boost/dynamic_bitset.hpp>
-#include <vector>
-
-namespace vcl
-{
- struct UnicodeCoverage
- {
- enum
- {
- BASIC_LATIN = 0,
- LATIN_1_SUPPLEMENT = 1,
- LATIN_EXTENDED_A = 2,
- LATIN_EXTENDED_B = 3,
- IPA_EXTENSIONS = 4,
- SPACING_MODIFIER_LETTERS = 5,
- COMBINING_DIACRITICAL_MARKS = 6,
- GREEK_AND_COPTIC = 7,
- COPTIC = 8,
- CYRILLIC = 9,
- ARMENIAN = 10,
- HEBREW = 11,
- VAI = 12,
- ARABIC = 13,
- NKO = 14,
- DEVANAGARI = 15,
- BENGALI = 16,
- GURMUKHI = 17,
- GUJARATI = 18,
- ORIYA = 19,
- TAMIL = 20,
- TELUGU = 21,
- KANNADA = 22,
- MALAYALAM = 23,
- THAI = 24,
- LAO = 25,
- GEORGIAN = 26,
- BALINESE = 27,
- HANGUL_JAMO = 28,
- LATIN_EXTENDED_ADDITIONAL = 29,
- GREEK_EXTENDED = 30,
- GENERAL_PUNCTUATION = 31,
- SUPERSCRIPTS_AND_SUBSCRIPTS = 32,
- CURRENCY_SYMBOLS = 33,
- COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34,
- LETTERLIKE_SYMBOLS = 35,
- NUMBER_FORMS = 36,
- ARROWS = 37,
- MATHEMATICAL_OPERATORS = 38,
- MISCELLANEOUS_TECHNICAL = 39,
- CONTROL_PICTURES = 40,
- OPTICAL_CHARACTER_RECOGNITION = 41,
- ENCLOSED_ALPHANUMERICS = 42,
- BOX_DRAWING = 43,
- BLOCK_ELEMENTS = 44,
- GEOMETRIC_SHAPES = 45,
- MISCELLANEOUS_SYMBOLS = 46,
- DINGBATS = 47,
- CJK_SYMBOLS_AND_PUNCTUATION = 48,
- HIRAGANA = 49,
- KATAKANA = 50,
- BOPOMOFO = 51,
- HANGUL_COMPATIBILITY_JAMO = 52,
- PHAGS_PA = 53,
- ENCLOSED_CJK_LETTERS_AND_MONTHS = 54,
- CJK_COMPATIBILITY = 55,
- HANGUL_SYLLABLES = 56,
- NONPLANE_0 = 57,
- PHOENICIAN = 58,
- CJK_UNIFIED_IDEOGRAPHS = 59,
- PRIVATE_USE_AREA_PLANE_0 = 60,
- CJK_STROKES = 61,
- ALPHABETIC_PRESENTATION_FORMS = 62,
- ARABIC_PRESENTATION_FORMS_A = 63,
- COMBINING_HALF_MARKS = 64,
- VERTICAL_FORMS = 65,
- SMALL_FORM_VARIANTS = 66,
- ARABIC_PRESENTATION_FORMS_B = 67,
- HALFWIDTH_AND_FULLWIDTH_FORMS = 68,
- SPECIALS = 69,
- TIBETAN = 70,
- SYRIAC = 71,
- THAANA = 72,
- SINHALA = 73,
- MYANMAR = 74,
- ETHIOPIC = 75,
- CHEROKEE = 76,
- UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = 77,
- OGHAM = 78,
- RUNIC = 79,
- KHMER = 80,
- MONGOLIAN = 81,
- BRAILLE_PATTERNS = 82,
- YI_SYLLABLES = 83,
- TAGALOG = 84,
- OLD_ITALIC = 85,
- GOTHIC = 86,
- DESERET = 87,
- BYZANTINE_MUSICAL_SYMBOLS = 88,
- MATHEMATICAL_ALPHANUMERIC_SYMBOLS = 89,
- PRIVATE_USE_PLANE_15 = 90,
- VARIATION_SELECTORS = 91,
- TAGS = 92,
- LIMBU = 93,
- TAI_LE = 94,
- NEW_TAI_LUE = 95,
- BUGINESE = 96,
- GLAGOLITIC = 97,
- TIFINAGH = 98,
- YIJING_HEXAGRAM_SYMBOLS = 99,
- SYLOTI_NAGRI = 100,
- LINEAR_B_SYLLABARY = 101,
- ANCIENT_GREEK_NUMBERS = 102,
- UGARITIC = 103,
- OLD_PERSIAN = 104,
- SHAVIAN = 105,
- OSMANYA = 106,
- CYPRIOT_SYLLABARY = 107,
- KHAROSHTHI = 108,
- TAI_XUAN_JING_SYMBOLS = 109,
- CUNEIFORM = 110,
- COUNTING_ROD_NUMERALS = 111,
- SUNDANESE = 112,
- LEPCHA = 113,
- OL_CHIKI = 114,
- SAURASHTRA = 115,
- KAYAH_LI = 116,
- REJANG = 117,
- CHAM = 118,
- ANCIENT_SYMBOLS = 119,
- PHAISTOS_DISC = 120,
- CARIAN = 121,
- DOMINO_TILES = 122,
- RESERVED1 = 123,
- RESERVED2 = 124,
- RESERVED3 = 125,
- RESERVED4 = 126,
- RESERVED5 = 127,
- MAX_UC_ENUM = 128
- };
- };
-
- struct CodePageCoverage
- {
- enum
- {
- CP1252 = 0,
- CP1250 = 1,
- CP1251 = 2,
- CP1253 = 3,
- CP1254 = 4,
- CP1255 = 5,
- CP1256 = 6,
- CP1257 = 7,
- CP1258 = 8,
- CP874 = 16,
- CP932 = 17,
- CP936 = 18,
- CP949 = 19,
- CP950 = 20,
- CP1361 = 21,
- CP869 = 48,
- CP866 = 49,
- CP865 = 50,
- CP864 = 51,
- CP863 = 52,
- CP862 = 53,
- CP861 = 54,
- CP860 = 55,
- CP857 = 56,
- CP855 = 57,
- CP852 = 58,
- CP775 = 59,
- CP737 = 60,
- CP780 = 61,
- CP850 = 62,
- CP437 = 63,
- MAX_CP_ENUM = 64
- };
- };
-
- struct FontCapabilities
- {
- boost::dynamic_bitset<sal_uInt32> maUnicodeRange;
- boost::dynamic_bitset<sal_uInt32> maCodePageRange;
- std::vector< sal_uInt32 > maGSUBScriptTags;
- };
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 25674b76ae8a..8a97e0449053 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#ifndef _PSPRINT_FONTMANAGER_HXX_
#define _PSPRINT_FONTMANAGER_HXX_
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <map>
#include <list>
#include <set>
@@ -39,8 +39,6 @@
#include "com/sun/star/lang/Locale.hpp"
-#include <vector>
-
#define ATOM_FAMILYNAME 2
#define ATOM_PSNAME 3
@@ -82,7 +80,7 @@ enum type {
UltraExpanded = 9
};
}
-
+
namespace pitch
{
enum type {
@@ -112,13 +110,13 @@ enum type {
namespace family
{
enum type {
- Unknown = 0,
- Decorative = 1,
+ Unknown = 0,
+ Decorative = 1,
Modern = 2,
- Roman = 3,
- Script = 4,
- Swiss = 5,
- System = 6
+ Roman = 3,
+ Script = 4,
+ Swiss = 5,
+ System = 6
};
}
@@ -132,12 +130,12 @@ enum type {
};
}
-namespace fcstatus
+namespace fcstatus
{
-enum type {
+enum type {
istrue,
isunset,
- isfalse
+ isfalse
};
}
@@ -153,19 +151,19 @@ enum type {
struct FastPrintFontInfo
{
- fontID m_nID; // FontID
- fonttype::type m_eType;
-
+ fontID m_nID; // FontID
+ fonttype::type m_eType;
+
// font attributes
- rtl::OUString m_aFamilyName;
+ rtl::OUString m_aFamilyName;
rtl::OUString m_aStyleName;
- std::list< rtl::OUString > m_aAliases;
- family::type m_eFamilyStyle;
- italic::type m_eItalic;
- width::type m_eWidth;
- weight::type m_eWeight;
- pitch::type m_ePitch;
- rtl_TextEncoding m_aEncoding;
+ std::list< rtl::OUString > m_aAliases;
+ family::type m_eFamilyStyle;
+ italic::type m_eItalic;
+ width::type m_eWidth;
+ weight::type m_eWeight;
+ pitch::type m_ePitch;
+ rtl_TextEncoding m_aEncoding;
bool m_bSubsettable;
bool m_bEmbeddable;
@@ -183,10 +181,10 @@ struct FastPrintFontInfo
struct PrintFontInfo : public FastPrintFontInfo
{
- int m_nAscend;
- int m_nDescend;
- int m_nLeading;
- int m_nWidth;
+ int m_nAscend;
+ int m_nDescend;
+ int m_nLeading;
+ int m_nWidth;
PrintFontInfo() :
FastPrintFontInfo(),
@@ -225,7 +223,7 @@ class FontCache;
class FontCache;
-class VCL_PLUGIN_PUBLIC PrintFontManager
+class VCL_DLLPUBLIC PrintFontManager
{
struct PrintFont;
struct TrueTypeFontFile;
@@ -244,7 +242,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
// upper byte contains: 0 for horizontal metric
// 1 for vertical metric
// highest byte: 0 for now
- boost::unordered_map< int, CharacterMetric > m_aMetrics;
+ std::hash_map< int, CharacterMetric > m_aMetrics;
// contains the unicode blocks for which metrics were queried
// this implies that metrics should be queried in terms of
// unicode blocks. here a unicode block is identified
@@ -259,20 +257,20 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
bool m_bKernPairsQueried;
std::list< KernPair > m_aXKernPairs;
std::list< KernPair > m_aYKernPairs;
- boost::unordered_map< sal_Unicode, bool > m_bVerticalSubstitutions;
+ std::hash_map< sal_Unicode, bool > m_bVerticalSubstitutions;
PrintFontMetrics() : m_bKernPairsQueried( false ) {}
-
+
bool isEmpty() const { return m_aMetrics.empty(); }
};
struct PrintFont
{
fonttype::type m_eType;
-
+
// font attributes
int m_nFamilyName; // atom
- std::list< int > m_aAliases;
+ std::list< int > m_aAliases;
int m_nPSName; // atom
rtl::OUString m_aStyleName;
italic::type m_eItalic;
@@ -280,22 +278,22 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
weight::type m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
- bool m_bFontEncodingOnly; // set if font should be only accessed by builtin encoding
+ bool m_bFontEncodingOnly; // set if font should be only accessed by builtin encoding
CharacterMetric m_aGlobalMetricX;
CharacterMetric m_aGlobalMetricY;
PrintFontMetrics* m_pMetrics;
int m_nAscend;
int m_nDescend;
int m_nLeading;
- int m_nXMin; // font bounding box
- int m_nYMin;
- int m_nXMax;
- int m_nYMax;
- bool m_bHaveVerticalSubstitutedGlyphs;
+ int m_nXMin; // font bounding box
+ int m_nYMin;
+ int m_nXMax;
+ int m_nYMax;
+ bool m_bHaveVerticalSubstitutedGlyphs;
bool m_bUserOverride;
- std::map< sal_Unicode, sal_Int32 > m_aEncodingVector;
- std::map< sal_Unicode, rtl::OString > m_aNonEncoded;
+ std::map< sal_Unicode, sal_Int32 > m_aEncodingVector;
+ std::map< sal_Unicode, rtl::OString > m_aNonEncoded;
PrintFont( fonttype::type eType );
virtual ~PrintFont();
@@ -321,11 +319,11 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
struct TrueTypeFontFile : public PrintFont
{
- int m_nDirectory; // atom containing system dependent path
+ int m_nDirectory; // atom containing system dependent path
rtl::OString m_aFontFile; // relative to directory
rtl::OString m_aXLFD; // mainly for administration, contains the XLFD from fonts.dir
int m_nCollectionEntry; // -1 for regular fonts, 0 to ... for fonts stemming from collections
- unsigned int m_nTypeFlags; // copyright bits and PS-OpenType flag
+ unsigned int m_nTypeFlags; // copyright bits and PS-OpenType flag
TrueTypeFontFile();
virtual ~TrueTypeFontFile();
@@ -344,25 +342,25 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
struct XLFDEntry
{
- static const int MaskFoundry = 1;
- static const int MaskFamily = 2;
- static const int MaskAddStyle = 4;
- static const int MaskItalic = 8;
- static const int MaskWeight = 16;
- static const int MaskWidth = 32;
- static const int MaskPitch = 64;
- static const int MaskEncoding = 128;
-
- int nMask; // contains a bit set for every valid member
-
- rtl::OString aFoundry;
- rtl::OString aFamily;
- rtl::OString aAddStyle;
- italic::type eItalic;
- weight::type eWeight;
- width::type eWidth;
- pitch::type ePitch;
- rtl_TextEncoding aEncoding;
+ static const int MaskFoundry = 1;
+ static const int MaskFamily = 2;
+ static const int MaskAddStyle = 4;
+ static const int MaskItalic = 8;
+ static const int MaskWeight = 16;
+ static const int MaskWidth = 32;
+ static const int MaskPitch = 64;
+ static const int MaskEncoding = 128;
+
+ int nMask; // contains a bit set for every valid member
+
+ rtl::OString aFoundry;
+ rtl::OString aFamily;
+ rtl::OString aAddStyle;
+ italic::type eItalic;
+ weight::type eWeight;
+ width::type eWidth;
+ pitch::type ePitch;
+ rtl_TextEncoding aEncoding;
XLFDEntry() { nMask = 0; }
@@ -373,35 +371,35 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
static rtl::OString s_aEmptyOString;
fontID m_nNextFontID;
- boost::unordered_map< fontID, PrintFont* > m_aFonts;
- boost::unordered_map< int, family::type > m_aFamilyTypes;
+ std::hash_map< fontID, PrintFont* > m_aFonts;
+ std::hash_map< int, family::type > m_aFamilyTypes;
std::list< rtl::OUString > m_aPrinterDrivers;
std::list< rtl::OString > m_aFontDirectories;
- std::list< int > m_aPrivateFontDirectories;
+ std::list< int > m_aPrivateFontDirectories;
std::map< struct XLFDEntry, std::list< struct XLFDEntry > >
m_aXLFD_Aliases;
utl::MultiAtomProvider* m_pAtoms;
// for speeding up findFontFileID
- boost::unordered_map< rtl::OString, std::set< fontID >, rtl::OStringHash >
+ std::hash_map< rtl::OString, std::set< fontID >, rtl::OStringHash >
m_aFontFileToFontID;
- boost::unordered_map< rtl::OString, int, rtl::OStringHash >
+ std::hash_map< rtl::OString, int, rtl::OStringHash >
m_aDirToAtom;
- boost::unordered_map< int, rtl::OString > m_aAtomToDir;
+ std::hash_map< int, rtl::OString > m_aAtomToDir;
int m_nNextDirAtom;
- boost::unordered_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >
+ std::hash_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >
m_aAdobenameToUnicode;
- boost::unordered_multimap< sal_Unicode, rtl::OString >
+ std::hash_multimap< sal_Unicode, rtl::OString >
m_aUnicodeToAdobename;
- boost::unordered_multimap< sal_Unicode, sal_uInt8 > m_aUnicodeToAdobecode;
- boost::unordered_multimap< sal_uInt8, sal_Unicode > m_aAdobecodeToUnicode;
+ std::hash_multimap< sal_Unicode, sal_uInt8 > m_aUnicodeToAdobecode;
+ std::hash_multimap< sal_uInt8, sal_Unicode > m_aAdobecodeToUnicode;
mutable FontCache* m_pFontCache;
bool m_bFontconfigSuccess;
mutable std::vector< fontID > m_aOverrideFonts;
-
+
rtl::OString getAfmFile( PrintFont* pFont ) const;
rtl::OString getFontFile( PrintFont* pFont ) const;
@@ -420,7 +418,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
PrintFont* getFont( fontID nID ) const
{
- boost::unordered_map< fontID, PrintFont* >::const_iterator it;
+ std::hash_map< fontID, PrintFont* >::const_iterator it;
it = m_aFonts.find( nID );
return it == m_aFonts.end() ? NULL : it->second;
}
@@ -440,7 +438,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
false else (e.g. no libfontconfig found)
*/
bool initFontconfig();
- int countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths );
+ int countFontconfigFonts( std::hash_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths );
/* deinitialize fontconfig
*/
void deinitFontconfig();
@@ -449,18 +447,18 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
since fontconfig is asked for font substitutes before OOo will check for font availability
and fontconfig will happily substitute fonts it doesn't know (e.g. "Arial Narrow" -> "DejaVu Sans Book"!)
- it becomes necessary to tell the library about all the hidden font treasures
-
+ it becomes necessary to tell the library about all the hidden font treasures
+
@returns
true if libfontconfig accepted the directory
false else (e.g. no libfontconfig found)
*/
bool addFontconfigDir(const rtl::OString& rDirectory);
-
+
static bool parseXLFD( const rtl::OString& rXLFD, XLFDEntry& rEntry );
void parseXLFD_appendAliases( const std::list< rtl::OString >& rXLFDs, std::list< XLFDEntry >& rEntries ) const;
void initFontsAlias();
-
+
bool readOverrideMetrics();
PrintFontManager();
@@ -468,17 +466,17 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
public:
static PrintFontManager& get(); // one instance only
- int addFontFile( const rtl::OString& rFileName, int nFaceNum );
+ int addFontFile( const rtl::OString& rFileName, int nFaceNum );
void initialize();
// returns the number of managed fonts
int getFontCount() const { return m_aFonts.size(); }
-
+
// caution: the getFontList* methods can change the font list on demand
// depending on the pParser argument. That is getFontCount() may
// return a larger value after getFontList()
-
+
// returns the ids of all managed fonts. on pParser != NULL
// all fonttype::Builtin type fonts are not listed
// which do not occur in the PPD of pParser
@@ -505,7 +503,7 @@ public:
// get a specific fonts family name aliases
void getFontFamilyAliases( fontID nFontID ) const;
-
+
// get a specific fonts type
fonttype::type getFontType( fontID nFontID ) const
{
@@ -620,15 +618,15 @@ public:
// helper for type 1 fonts
std::list< rtl::OString > getAdobeNameFromUnicode( sal_Unicode aChar ) const;
- std::pair< boost::unordered_multimap< sal_Unicode, sal_uInt8 >::const_iterator,
- boost::unordered_multimap< sal_Unicode, sal_uInt8 >::const_iterator >
+ std::pair< std::hash_multimap< sal_Unicode, sal_uInt8 >::const_iterator,
+ std::hash_multimap< sal_Unicode, sal_uInt8 >::const_iterator >
getAdobeCodeFromUnicode( sal_Unicode aChar ) const
{
return m_aUnicodeToAdobecode.equal_range( aChar );
}
std::list< sal_Unicode > getUnicodeFromAdobeName( const rtl::OString& rName ) const;
- std::pair< boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator,
- boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator >
+ std::pair< std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator,
+ std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator >
getUnicodeFromAdobeCode( sal_uInt8 aChar ) const
{
return m_aAdobecodeToUnicode.equal_range( aChar );
@@ -733,10 +731,10 @@ public:
false else
*/
bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
- ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
+ bool getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*), ImplFontOptions& rResult ) const;
- rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
- const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
+ rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
+ const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
width::type& rWidth, pitch::type& rPitch) const;
bool hasFontconfig() const { return m_bFontconfigSuccess; }
diff --git a/vcl/inc/vcl/fontsubset.hxx b/vcl/inc/vcl/fontsubset.hxx
index f710434698de..392ad42a7c56 100644
--- a/vcl/inc/vcl/fontsubset.hxx
+++ b/vcl/inc/vcl/fontsubset.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,60 +38,60 @@ namespace vcl { struct _TrueTypeFont; } // SFT's idea of a TTF font
class FontSubsetInfo
{
public:
- explicit FontSubsetInfo( void );
- virtual ~FontSubsetInfo( void );
+ explicit FontSubsetInfo( void );
+ virtual ~FontSubsetInfo( void );
enum FontType {
- NO_FONT = 0,
- SFNT_TTF = 1<<1, // SFNT container with TrueType glyphs
- SFNT_CFF = 1<<2, // SFNT container with CFF-container
- TYPE1_PFA = 1<<3, // PSType1 Postscript Font Ascii
- TYPE1_PFB = 1<<4, // PSType1 Postscript Font Binary
- CFF_FONT = 1<<5, // CFF-container with PSType2 glyphs
- TYPE3_FONT = 1<<6, // PSType3 Postscript font
- TYPE42_FONT = 1<<7, // PSType42 wrapper for an SFNT_TTF
- ANY_SFNT = SFNT_TTF | SFNT_CFF,
- ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB,
- ANY_FONT = 0xFF
+ NO_FONT = 0,
+ SFNT_TTF = 1<<1, // SFNT container with TrueType glyphs
+ SFNT_CFF = 1<<2, // SFNT container with CFF-container
+ TYPE1_PFA = 1<<3, // PSType1 Postscript Font Ascii
+ TYPE1_PFB = 1<<4, // PSType1 Postscript Font Binary
+ CFF_FONT = 1<<5, // CFF-container with PSType2 glyphs
+ TYPE3_FONT = 1<<6, // PSType3 Postscript font
+ TYPE42_FONT = 1<<7, // PSType42 wrapper for an SFNT_TTF
+ ANY_SFNT = SFNT_TTF | SFNT_CFF,
+ ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB,
+ ANY_FONT = 0xFF
};
- bool LoadFont( FontType eInFontType,
+ bool LoadFont( FontType eInFontType,
const unsigned char* pFontBytes, int nByteLength );
- bool LoadFont( vcl::_TrueTypeFont* pSftTrueTypeFont );
+ bool LoadFont( vcl::_TrueTypeFont* pSftTrueTypeFont );
- bool CreateFontSubset( int nOutFontTypeMask,
+ bool CreateFontSubset( int nOutFontTypeMask,
FILE* pOutFile, const char* pOutFontName,
const long* pReqGlyphIds, const sal_uInt8* pEncodedIds,
int nReqGlyphCount, sal_Int32* pOutGlyphWidths = NULL );
public: // TODO: make subsetter results private and provide accessor methods instead
// subsetter-provided subset details needed by e.g. Postscript or PDF
- String m_aPSName;
- int m_nAscent; // all metrics in PS font units
- int m_nDescent;
- int m_nCapHeight;
- Rectangle m_aFontBBox;
- FontType m_nFontType; // font-type of subset result
+ String m_aPSName;
+ int m_nAscent; // all metrics in PS font units
+ int m_nDescent;
+ int m_nCapHeight;
+ Rectangle m_aFontBBox;
+ FontType m_nFontType; // font-type of subset result
private:
// input-font-specific details
- unsigned const char* mpInFontBytes;
- int mnInByteLength;
- FontType meInFontType; // allowed mask of input font-types
- vcl::_TrueTypeFont* mpSftTTFont;
+ unsigned const char* mpInFontBytes;
+ int mnInByteLength;
+ FontType meInFontType; // allowed mask of input font-types
+ vcl::_TrueTypeFont* mpSftTTFont;
// subset-request details
- int mnReqFontTypeMask; // allowed subset-target font types
- FILE* mpOutFile;
- const char* mpReqFontName;
- const long* mpReqGlyphIds;
- const sal_uInt8* mpReqEncodedIds;
- int mnReqGlyphCount;
+ int mnReqFontTypeMask; // allowed subset-target font types
+ FILE* mpOutFile;
+ const char* mpReqFontName;
+ const long* mpReqGlyphIds;
+ const sal_uInt8* mpReqEncodedIds;
+ int mnReqGlyphCount;
protected:
- bool CreateFontSubsetFromCff( sal_Int32* pOutGlyphWidths = NULL );
- bool CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths = NULL );
- bool CreateFontSubsetFromType1( sal_Int32* pOutGlyphWidths = NULL );
+ bool CreateFontSubsetFromCff( sal_Int32* pOutGlyphWidths = NULL );
+ bool CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths = NULL );
+ bool CreateFontSubsetFromType1( sal_Int32* pOutGlyphWidths = NULL );
};
#endif // _SV_FONTSUBSET_HXX
diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index ffbd4867ecb8..4bf3d4669fbc 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,8 +31,8 @@
#include <vcl/dllapi.h>
#include <tools/gen.hxx>
-#include <tools/link.hxx>
#include <tools/list.hxx>
+#include <tools/link.hxx>
#include <tools/string.hxx>
#include <vcl/mapmod.hxx>
@@ -51,24 +51,24 @@ class Gradient;
// - GDIMetaFile-Types -
// ---------------------
-#define GDI_METAFILE_END ((sal_uLong)0xFFFFFFFF)
-#define GDI_METAFILE_LABEL_NOTFOUND ((sal_uLong)0xFFFFFFFF)
+#define GDI_METAFILE_END ((ULONG)0xFFFFFFFF)
+#define GDI_METAFILE_LABEL_NOTFOUND ((ULONG)0xFFFFFFFF)
#ifndef METAFILE_END
-#define METAFILE_END GDI_METAFILE_END
+#define METAFILE_END GDI_METAFILE_END
#endif
#ifndef METAFILE_LABEL_NOTFOUND
-#define METAFILE_LABEL_NOTFOUND GDI_METAFILE_LABEL_NOTFOUND
+#define METAFILE_LABEL_NOTFOUND GDI_METAFILE_LABEL_NOTFOUND
#endif
// -----------
// - Defines -
// -----------
-#define MTF_MIRROR_NONE 0x00000000UL
-#define MTF_MIRROR_HORZ 0x00000001UL
-#define MTF_MIRROR_VERT 0x00000002UL
+#define MTF_MIRROR_NONE 0x00000000UL
+#define MTF_MIRROR_HORZ 0x00000001UL
+#define MTF_MIRROR_VERT 0x00000002UL
// ---------
// - Enums -
@@ -104,59 +104,59 @@ private:
GDIMetaFile* pNext;
OutputDevice* pOutDev;
ImpLabelList* pLabelList;
- sal_Bool bPause;
- sal_Bool bRecord;
- sal_Bool bUseCanvas;
+ BOOL bPause;
+ BOOL bRecord;
+ BOOL bUseCanvas;
SAL_DLLPRIVATE static Color ImplColAdjustFnc( const Color& rColor, const void* pColParam );
SAL_DLLPRIVATE static BitmapEx ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
- SAL_DLLPRIVATE static Color ImplColConvertFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static Color ImplColConvertFnc( const Color& rColor, const void* pColParam );
SAL_DLLPRIVATE static BitmapEx ImplBmpConvertFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
- SAL_DLLPRIVATE static Color ImplColMonoFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static Color ImplColMonoFnc( const Color& rColor, const void* pColParam );
SAL_DLLPRIVATE static BitmapEx ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
- SAL_DLLPRIVATE static Color ImplColReplaceFnc( const Color& rColor, const void* pColParam );
+ SAL_DLLPRIVATE static Color ImplColReplaceFnc( const Color& rColor, const void* pColParam );
SAL_DLLPRIVATE static BitmapEx ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBmpParam );
- SAL_DLLPRIVATE void ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pColParam,
+ SAL_DLLPRIVATE void ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pColParam,
BmpExchangeFnc pFncBmp, const void* pBmpParam );
- SAL_DLLPRIVATE Point ImplGetRotatedPoint( const Point& rPt, const Point& rRotatePt,
+ SAL_DLLPRIVATE Point ImplGetRotatedPoint( const Point& rPt, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos );
- SAL_DLLPRIVATE Polygon ImplGetRotatedPolygon( const Polygon& rPoly, const Point& rRotatePt,
+ SAL_DLLPRIVATE Polygon ImplGetRotatedPolygon( const Polygon& rPoly, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos );
- SAL_DLLPRIVATE PolyPolygon ImplGetRotatedPolyPolygon( const PolyPolygon& rPoly, const Point& rRotatePt,
+ SAL_DLLPRIVATE PolyPolygon ImplGetRotatedPolyPolygon( const PolyPolygon& rPoly, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos );
- SAL_DLLPRIVATE void ImplAddGradientEx( GDIMetaFile& rMtf,
+ SAL_DLLPRIVATE void ImplAddGradientEx( GDIMetaFile& rMtf,
const OutputDevice& rMapDev,
const PolyPolygon& rPolyPoly,
- const Gradient& rGrad );
- SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
+ const Gradient& rGrad );
+ SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize );
SAL_DLLPRIVATE void ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut );
protected:
- virtual void Linker( OutputDevice* pOut, sal_Bool bLink );
+ virtual void Linker( OutputDevice* pOut, BOOL bLink );
virtual long Hook();
public:
GDIMetaFile();
GDIMetaFile( const GDIMetaFile& rMtf );
- virtual ~GDIMetaFile();
+ virtual ~GDIMetaFile();
using List::operator==;
using List::operator!=;
GDIMetaFile& operator=( const GDIMetaFile& rMtf );
- sal_Bool operator==( const GDIMetaFile& rMtf ) const;
- sal_Bool operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
+ BOOL operator==( const GDIMetaFile& rMtf ) const;
+ BOOL operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
void Clear();
- sal_Bool IsEqual( const GDIMetaFile& rMtf ) const;
- sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool IsEqual( const GDIMetaFile& rMtf ) const;
+ BOOL Mirror( 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 );
@@ -173,54 +173,54 @@ public:
*/
Rectangle GetBoundRect( OutputDevice& i_rReference );
- void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
- short nChannelRPercent = 0, short nChannelGPercent = 0,
- short nChannelBPercent = 0, double fGamma = 1.0, sal_Bool bInvert = sal_False );
- void Convert( MtfConversion eConversion );
- void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
- void ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
- sal_uLong nColorCount, sal_uLong* pTols = NULL );
+ void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
+ short nChannelRPercent = 0, short nChannelGPercent = 0,
+ short nChannelBPercent = 0, double fGamma = 1.0, BOOL bInvert = FALSE );
+ void Convert( MtfConversion eConversion );
+ void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ void ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
+ ULONG nColorCount, ULONG* pTols = NULL );
GDIMetaFile GetMonochromeMtf( const Color& rCol ) const;
void Record( OutputDevice* pOutDev );
- sal_Bool IsRecord() const { return bRecord; }
+ BOOL IsRecord() const { return bRecord; }
- void Play( GDIMetaFile& rMtf, sal_uLong nPos = GDI_METAFILE_END );
- void Play( OutputDevice* pOutDev, sal_uLong nPos = GDI_METAFILE_END );
+ void Play( GDIMetaFile& rMtf, ULONG nPos = GDI_METAFILE_END );
+ void Play( OutputDevice* pOutDev, ULONG nPos = GDI_METAFILE_END );
void Play( OutputDevice* pOutDev, const Point& rPos,
- const Size& rSize, sal_uLong nPos = GDI_METAFILE_END );
+ const Size& rSize, ULONG nPos = GDI_METAFILE_END );
- void Pause( sal_Bool bPause );
- sal_Bool IsPause() const { return bPause; }
+ void Pause( BOOL bPause );
+ BOOL IsPause() const { return bPause; }
void Stop();
void WindStart();
void WindEnd();
- void Wind( sal_uLong nAction );
+ void Wind( ULONG nAction );
void WindPrev();
void WindNext();
- sal_uLong GetActionCount() const { return Count(); }
+ ULONG GetActionCount() const { return Count(); }
void AddAction( MetaAction* pAction );
- void AddAction( MetaAction* pAction, sal_uLong nPos );
- void RemoveAction( sal_uLong nPos );
- MetaAction* CopyAction( sal_uLong nPos ) const;
+ void AddAction( MetaAction* pAction, ULONG nPos );
+ void RemoveAction( ULONG nPos );
+ MetaAction* CopyAction( ULONG nPos ) const;
MetaAction* GetCurAction() const { return (MetaAction*) GetCurObject(); }
- MetaAction* GetAction( sal_uLong nAction ) const { return (MetaAction*) GetObject( nAction ); }
- MetaAction* FirstAction() { return (MetaAction*) First(); }
- MetaAction* NextAction() { return (MetaAction*) Next(); }
- MetaAction* ReplaceAction( MetaAction* pAction, sal_uLong nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
+ MetaAction* GetAction( 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 ); }
- sal_uLong GetActionPos( const String& rLabel );
- sal_Bool InsertLabel( const String& rLabel, sal_uLong nActionPos );
+ ULONG GetActionPos( const String& rLabel );
+ BOOL InsertLabel( const String& rLabel, ULONG nActionPos );
void RemoveLabel( const String& rLabel );
void RenameLabel( const String& rLabel, const String& rNewLabel );
- sal_uLong GetLabelCount() const;
- String GetLabel( sal_uLong nLabel );
+ ULONG GetLabelCount() const;
+ String GetLabel( ULONG nLabel );
- sal_Bool SaveStatus();
+ BOOL SaveStatus();
const Size& GetPrefSize() const { return aPrefSize; }
void SetPrefSize( const Size& rSize ) { aPrefSize = rSize; }
@@ -231,23 +231,23 @@ public:
void SetHookHdl( const Link& rLink ) { aHookHdlLink = rLink; }
const Link& GetHookHdl() const { return aHookHdlLink; }
- sal_uLong GetChecksum() const;
- sal_uLong GetSizeBytes() const;
+ ULONG GetChecksum() const;
+ ULONG GetSizeBytes() const;
// Methoden zum Lesen und Schreiben des neuen Formats;
// die Read-Methode kann auch das alte Format lesen
- SvStream& Read( SvStream& rIStm );
- SvStream& Write( SvStream& rOStm );
+ SvStream& Read( SvStream& rIStm );
+ SvStream& Write( SvStream& rOStm );
// Stream-Operatoren schreiben das alte Format (noch)
// und lesen sowohl das alte wie auch das neue Format
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile );
- sal_Bool CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
+ BOOL CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
- void UseCanvas( sal_Bool _bUseCanvas );
- sal_Bool GetUseCanvas() const { return bUseCanvas; }
+ void UseCanvas( BOOL _bUseCanvas );
+ 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 1d4362f00dc1..29b6461b8f5a 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,16 +40,16 @@
struct ImpBuffer
{
- sal_uLong mnRefCount;
- sal_uInt8* mpBuffer;
+ ULONG mnRefCount;
+ BYTE* mpBuffer;
- ImpBuffer( sal_uLong nSize )
+ ImpBuffer( ULONG nSize )
{
mnRefCount = 1UL;
- mpBuffer = nSize ? new sal_uInt8[ nSize ] : NULL;
+ mpBuffer = nSize ? new BYTE[ nSize ] : NULL;
}
- ImpBuffer( sal_uInt8* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
+ ImpBuffer( BYTE* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
~ImpBuffer() { delete[] mpBuffer; }
};
@@ -60,18 +60,18 @@ struct ImpBuffer
struct ImpSwap
{
- rtl::OUString maURL;
- sal_uLong mnDataSize;
- sal_uLong mnRefCount;
+ rtl::OUString maURL;
+ ULONG mnDataSize;
+ ULONG mnRefCount;
- ImpSwap( sal_uInt8* pData, sal_uLong nDataSize );
+ ImpSwap( BYTE* pData, ULONG nDataSize );
~ImpSwap();
- sal_uInt8* GetData() const;
+ BYTE* GetData() const;
- sal_Bool IsSwapped() const { return maURL.getLength() > 0; }
+ BOOL IsSwapped() const { return maURL.getLength() > 0; }
- void WriteTo( SvStream& rOStm ) const;
+ void WriteTo( SvStream& rOStm ) const;
};
// --------------
@@ -82,14 +82,14 @@ struct ImpGfxLink
{
MapMode maPrefMapMode;
Size maPrefSize;
- bool mbPrefMapModeValid;
- bool mbPrefSizeValid;
+ bool mbPrefMapModeValid;
+ bool mbPrefSizeValid;
- ImpGfxLink() :
+ ImpGfxLink() :
maPrefMapMode(),
maPrefSize(),
- mbPrefMapModeValid( false ),
- mbPrefSizeValid( false )
+ mbPrefMapModeValid( false ),
+ mbPrefSizeValid( false )
{}
};
@@ -101,20 +101,20 @@ struct ImpGfxLink
enum GfxLinkType
{
- GFX_LINK_TYPE_NONE = 0,
- GFX_LINK_TYPE_EPS_BUFFER = 1,
- GFX_LINK_TYPE_NATIVE_GIF = 2, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_JPG = 3, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_PNG = 4, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_TIF = 5, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_WMF = 6, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
- GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
- GFX_LINK_TYPE_USER = 0xffff
+ GFX_LINK_TYPE_NONE = 0,
+ GFX_LINK_TYPE_EPS_BUFFER = 1,
+ GFX_LINK_TYPE_NATIVE_GIF = 2, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_JPG = 3, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_PNG = 4, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_TIF = 5, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_WMF = 6, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
+ GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
+ GFX_LINK_TYPE_USER = 0xffff
};
-#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
-#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_PCT
+#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
+#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_PCT
// -----------
// - GfxLink -
@@ -129,58 +129,58 @@ class VCL_DLLPUBLIC GfxLink
{
private:
- GfxLinkType meType;
- ImpBuffer* mpBuf;
- ImpSwap* mpSwap;
- sal_uInt32 mnBufSize;
- sal_uInt32 mnUserId;
+ GfxLinkType meType;
+ ImpBuffer* mpBuf;
+ ImpSwap* mpSwap;
+ sal_uInt32 mnBufSize;
+ sal_uInt32 mnUserId;
ImpGfxLink* mpImpData;
- sal_uLong mnExtra2;
+ ULONG mnExtra2;
- SAL_DLLPRIVATE void ImplCopy( const GfxLink& rGfxLink );
+ SAL_DLLPRIVATE void ImplCopy( const GfxLink& rGfxLink );
-public:
+public:
GfxLink();
GfxLink( const GfxLink& );
GfxLink( const String& rPath, GfxLinkType nType );
- GfxLink( sal_uInt8* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, sal_Bool bOwns );
+ GfxLink( BYTE* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, BOOL bOwns );
~GfxLink();
- GfxLink& operator=( const GfxLink& );
- sal_Bool IsEqual( const GfxLink& ) const;
+ GfxLink& operator=( const GfxLink& );
+ sal_Bool IsEqual( const GfxLink& ) const;
- GfxLinkType GetType() const;
+ GfxLinkType GetType() const;
- void SetUserId( sal_uInt32 nUserId ) { mnUserId = nUserId; }
- sal_uInt32 GetUserId() const { return mnUserId; }
+ void SetUserId( sal_uInt32 nUserId ) { mnUserId = nUserId; }
+ sal_uInt32 GetUserId() const { return mnUserId; }
- sal_uInt32 GetDataSize() const;
- void SetData( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns );
- const sal_uInt8* GetData() const;
+ sal_uInt32 GetDataSize() const;
+ void SetData( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns );
+ const BYTE* GetData() const;
- const Size& GetPrefSize() const;
- void SetPrefSize( const Size& rPrefSize );
- bool IsPrefSizeValid();
+ const Size& GetPrefSize() const;
+ void SetPrefSize( const Size& rPrefSize );
+ bool IsPrefSizeValid();
- const MapMode& GetPrefMapMode() const;
- void SetPrefMapMode( const MapMode& rPrefMapMode );
- bool IsPrefMapModeValid();
+ const MapMode& GetPrefMapMode() const;
+ void SetPrefMapMode( const MapMode& rPrefMapMode );
+ bool IsPrefMapModeValid();
- sal_Bool IsNative() const;
- sal_Bool IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
+ BOOL IsNative() const;
+ BOOL IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
- sal_Bool LoadNative( Graphic& rGraphic );
+ BOOL LoadNative( Graphic& rGraphic );
- sal_Bool ExportNative( SvStream& rOStream ) const;
+ BOOL ExportNative( SvStream& rOStream ) const;
- void SwapOut();
- void SwapIn();
- sal_Bool IsSwappedOut() const { return( mpSwap != NULL ); }
+ void SwapOut();
+ void SwapIn();
+ BOOL IsSwappedOut() const { return( mpSwap != NULL ); }
public:
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink );
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink );
};
#endif
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index dc11ba1637d8..9731440a6c98 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,13 +43,13 @@ struct ImplKernPairData;
class ImplFontOptions;
#include <tools/gen.hxx>
-#include <boost/unordered_map.hpp>
-#include <boost/unordered_set.hpp>
-#include <boost/shared_ptr.hpp>
+#include <hash_map>
+#include <hash_set>
namespace basegfx { class B2DPolyPolygon; }
class RawBitmap;
+class CmapResult;
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
@@ -57,20 +57,15 @@ class RawBitmap;
class ServerFontLayout;
#include <vcl/sallayout.hxx>
-namespace vcl
-{
- struct FontCapabilities;
-}
-
// =======================================================================
-class VCL_PLUGIN_PUBLIC GlyphCache
+class VCL_DLLPUBLIC GlyphCache
{
public:
explicit GlyphCache( GlyphCachePeer& );
/*virtual*/ ~GlyphCache();
- static GlyphCache& GetInstance();
+ static GlyphCache& GetInstance();
void LoadFonts();
void ClearFontPath();
@@ -96,17 +91,17 @@ private:
void GrowNotify();
private:
- sal_uLong CalcByteCount() const;
+ ULONG CalcByteCount() const;
void GarbageCollect();
// the GlyphCache's FontList matches a font request to a serverfont instance
// the FontList key's mpFontData member is reinterpreted as integer font id
struct IFSD_Equal{ bool operator()( const ImplFontSelectData&, const ImplFontSelectData& ) const; };
struct IFSD_Hash{ size_t operator()( const ImplFontSelectData& ) const; };
- typedef ::boost::unordered_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
+ typedef ::std::hash_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
FontList maFontList;
- sal_uLong mnMaxSize; // max overall cache size in bytes
- mutable sal_uLong mnBytesUsed;
+ ULONG mnMaxSize; // max overall cache size in bytes
+ mutable ULONG mnBytesUsed;
mutable long mnLruIndex;
mutable int mnGlyphCount;
ServerFont* mpCurrentGCFont;
@@ -179,7 +174,7 @@ private:
// =======================================================================
-class VCL_PLUGIN_PUBLIC ServerFont
+class VCL_DLLPUBLIC ServerFont
{
public:
virtual const ::rtl::OString* GetFontFileName() const { return NULL; }
@@ -187,19 +182,16 @@ public:
virtual bool TestFont() const { return true; }
virtual void* GetFtFace() const { return 0; }
virtual int GetLoadFlags() const { return 0; }
- virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> ) {}
- virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const
- { return boost::shared_ptr<ImplFontOptions>(); }
+ virtual void SetFontOptions( const ImplFontOptions&) {}
virtual bool NeedsArtificialBold() const { return false; }
virtual bool NeedsArtificialItalic() const { return false; }
const ImplFontSelectData& GetFontSelData() const { return maFontSelData; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
- virtual sal_uLong GetKernPairs( ImplKernPairData** ) const { return 0; }
+ virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; }
virtual int GetGlyphKernValue( int, int ) const { return 0; }
- virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
- virtual bool GetFontCapabilities(vcl::FontCapabilities &) const { return false; }
+ virtual bool GetFontCodeRanges( CmapResult& ) const { return false; }
Point TransformPoint( const Point& ) const;
GlyphData& GetGlyphData( int nGlyphIndex );
@@ -226,7 +218,7 @@ protected:
void AddRef() const { ++mnRefCount; }
long GetRefCount() const { return mnRefCount; }
long Release() const;
- sal_uLong GetByteCount() const { return mnBytesUsed; }
+ ULONG GetByteCount() const { return mnBytesUsed; }
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const = 0;
virtual void GarbageCollect( long );
@@ -235,7 +227,7 @@ protected:
virtual ServerFontLayoutEngine* GetLayoutEngine() { return NULL; }
private:
- typedef ::boost::unordered_map<int,GlyphData> GlyphList;
+ typedef ::std::hash_map<int,GlyphData> GlyphList;
mutable GlyphList maGlyphList;
const ImplFontSelectData maFontSelData;
@@ -246,7 +238,7 @@ private:
// used by GlyphCache for cache LRU algorithm
mutable long mnRefCount;
- mutable sal_uLong mnBytesUsed;
+ mutable ULONG mnBytesUsed;
ServerFont* mpPrevGCFont;
ServerFont* mpNextGCFont;
@@ -264,12 +256,13 @@ private:
// =======================================================================
// a class for cache entries for physical font instances that are based on serverfonts
-class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
+class VCL_DLLPUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
- boost::shared_ptr<ImplFontOptions> mpFontOptions;
+ ImplFontOptions maFontOptions;
bool mbGotFontOptions;
+ bool mbValidFontOptions;
public:
ImplServerFontEntry( ImplFontSelectData& );
@@ -280,7 +273,7 @@ public:
// =======================================================================
-class VCL_PLUGIN_PUBLIC ServerFontLayout : public GenericSalLayout
+class VCL_DLLPUBLIC ServerFontLayout : public GenericSalLayout
{
private:
ServerFont& mrServerFont;
@@ -325,7 +318,7 @@ protected:
// =======================================================================
-class VCL_PLUGIN_PUBLIC RawBitmap
+class VCL_DLLPUBLIC RawBitmap
{
public:
RawBitmap();
@@ -334,13 +327,13 @@ public:
public:
unsigned char* mpBits;
- sal_uLong mnAllocated;
+ ULONG mnAllocated;
- sal_uLong mnWidth;
- sal_uLong mnHeight;
+ ULONG mnWidth;
+ ULONG mnHeight;
- sal_uLong mnScanlineSize;
- sal_uLong mnBitCount;
+ ULONG mnScanlineSize;
+ ULONG mnBitCount;
int mnXOffset;
int mnYOffset;
@@ -358,7 +351,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_PLUGIN_PUBLIC ExtraKernInfo
+class VCL_DLLPUBLIC ExtraKernInfo
{
public:
ExtraKernInfo( sal_IntPtr nFontId );
@@ -380,7 +373,7 @@ protected:
{ return (rA.mnChar1 == rB.mnChar1) && (rA.mnChar2 == rB.mnChar2); } };
struct PairHash{ int operator()(const ImplKernPairData& rA) const
{ return (rA.mnChar1) * 256 ^ rA.mnChar2; } };
- typedef boost::unordered_set< ImplKernPairData, PairHash, PairEqual > UnicodeKernPairs;
+ typedef std::hash_set< ImplKernPairData, PairHash, PairEqual > UnicodeKernPairs;
mutable UnicodeKernPairs maUnicodeKernPairs;
};
diff --git a/vcl/inc/vcl/gradient.hxx b/vcl/inc/vcl/gradient.hxx
index 1ed0c12ce98f..46abd8dd83a2 100644
--- a/vcl/inc/vcl/gradient.hxx
+++ b/vcl/inc/vcl/gradient.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,6 @@
#include <vcl/dllapi.h>
#include <tools/color.hxx>
-#include <tools/gen.hxx>
#include <vcl/vclenum.hxx>
@@ -56,17 +55,17 @@ class SvStream;
class Impl_Gradient
{
public:
- sal_uLong mnRefCount;
+ ULONG mnRefCount;
GradientStyle meStyle;
Color maStartColor;
Color maEndColor;
- sal_uInt16 mnAngle;
- sal_uInt16 mnBorder;
- sal_uInt16 mnOfsX;
- sal_uInt16 mnOfsY;
- sal_uInt16 mnIntensityStart;
- sal_uInt16 mnIntensityEnd;
- sal_uInt16 mnStepCount;
+ USHORT mnAngle;
+ USHORT mnBorder;
+ USHORT mnOfsX;
+ USHORT mnOfsY;
+ USHORT mnIntensityStart;
+ USHORT mnIntensityEnd;
+ USHORT mnStepCount;
friend SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImplGradient );
friend SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImplGradient );
@@ -81,9 +80,9 @@ public:
class VCL_DLLPUBLIC Gradient
{
-private:
- Impl_Gradient* mpImplGradient;
- void MakeUnique();
+private:
+ Impl_Gradient* mpImplGradient;
+ void MakeUnique();
public:
Gradient();
@@ -102,31 +101,29 @@ public:
void SetEndColor( const Color& rColor );
const Color& GetEndColor() const { return mpImplGradient->maEndColor; }
- void SetAngle( sal_uInt16 nAngle );
- sal_uInt16 GetAngle() const { return mpImplGradient->mnAngle; }
-
- 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 SetAngle( USHORT nAngle );
+ USHORT GetAngle() const { return mpImplGradient->mnAngle; }
- 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 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 SetSteps( sal_uInt16 nSteps );
- sal_uInt16 GetSteps() const { return mpImplGradient->mnStepCount; }
+ void SetStartIntensity( USHORT nIntens );
+ USHORT GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
+ void SetEndIntensity( USHORT nIntens );
+ USHORT GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
- void GetBoundRect( const Rectangle& rRect, Rectangle &rBoundRect, Point& rCenter ) const;
+ void SetSteps( USHORT nSteps );
+ USHORT GetSteps() const { return mpImplGradient->mnStepCount; }
Gradient& operator=( const Gradient& rGradient );
- sal_Bool operator==( const Gradient& rGradient ) const;
- sal_Bool operator!=( const Gradient& rGradient ) const
+ BOOL operator==( const Gradient& rGradient ) const;
+ BOOL operator!=( const Gradient& rGradient ) const
{ return !(Gradient::operator==( rGradient )); }
- sal_Bool IsSameInstance( const Gradient& rGradient ) const
+ 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 1df2ee7a3df3..62a9a67cd99f 100644
--- a/vcl/inc/vcl/graph.h
+++ b/vcl/inc/vcl/graph.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,11 +57,11 @@ protected:
String maUpperName;
ReaderData* mpReaderData;
- sal_Bool mbIsReading;
+ BOOL mbIsReading;
GraphicReader() :
mpReaderData( NULL ),
- mbIsReading( sal_False ) {}
+ mbIsReading( FALSE ) {}
public:
@@ -69,11 +69,11 @@ public:
const String& GetUpperFilterName() const { return maUpperName; }
ReaderData* GetReaderData() const { return mpReaderData; }
- sal_Bool IsReading() const { return mbIsReading; }
+ BOOL IsReading() const { return mbIsReading; }
// TODO: when incompatible changes are possible again
// the preview size hint should be redone
- sal_Bool IsPreviewModeEnabled() const;
+ 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 3dfbb8d261d8..1f98376234b5 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -106,19 +106,19 @@ public:
virtual ~Graphic();
Graphic& operator=( const Graphic& rGraphic );
- sal_Bool operator==( const Graphic& rGraphic ) const;
- sal_Bool operator!=( const Graphic& rGraphic ) const;
- sal_Bool operator!() const;
+ BOOL operator==( const Graphic& rGraphic ) const;
+ BOOL operator!=( const Graphic& rGraphic ) const;
+ BOOL operator!() const;
void Clear();
GraphicType GetType() const;
void SetDefaultType();
- sal_Bool IsSupportedGraphic() const;
+ BOOL IsSupportedGraphic() const;
- sal_Bool IsTransparent() const;
- sal_Bool IsAlpha() const;
- sal_Bool IsAnimated() const;
+ BOOL IsTransparent() const;
+ BOOL IsAlpha() const;
+ 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;
- sal_uLong GetSizeBytes() const;
+ ULONG GetSizeBytes() const;
void Draw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
@@ -170,12 +170,12 @@ public:
void SetAnimationNotifyHdl( const Link& rLink );
Link GetAnimationNotifyHdl() const;
- sal_uLong GetAnimationLoopCount() const;
+ ULONG GetAnimationLoopCount() const;
void ResetAnimationLoopCount();
List* GetAnimationInfoList() const;
- sal_uLong GetChecksum() const;
+ ULONG GetChecksum() const;
public:
@@ -184,26 +184,26 @@ public:
public:
- static sal_uInt16 GetGraphicsCompressMode( SvStream& rIStm );
+ static USHORT GetGraphicsCompressMode( SvStream& rIStm );
- void SetDocFileName( const String& rName, sal_uLong nFilePos );
+ void SetDocFileName( const String& rName, ULONG nFilePos );
const String& GetDocFileName() const;
- sal_uLong GetDocFilePos() const;
+ ULONG GetDocFilePos() const;
- sal_Bool ReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
- sal_Bool WriteEmbedded( SvStream& rOStream );
+ BOOL ReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
+ BOOL WriteEmbedded( SvStream& rOStream );
- sal_Bool SwapOut();
- sal_Bool SwapOut( SvStream* pOStm );
- sal_Bool SwapIn();
- sal_Bool SwapIn( SvStream* pIStm );
- sal_Bool IsSwapOut() const;
+ BOOL SwapOut();
+ BOOL SwapOut( SvStream* pOStm );
+ BOOL SwapIn();
+ BOOL SwapIn( SvStream* pIStm );
+ BOOL IsSwapOut() const;
void SetLink( const GfxLink& );
GfxLink GetLink() const;
- sal_Bool IsLink() const;
+ BOOL IsLink() const;
- sal_Bool ExportNative( SvStream& rOStream ) const;
+ 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/graphictools.hxx b/vcl/inc/vcl/graphictools.hxx
index edd29ab9db01..5ace72cf27aa 100644
--- a/vcl/inc/vcl/graphictools.hxx
+++ b/vcl/inc/vcl/graphictools.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -65,29 +65,29 @@ class VCL_DLLPUBLIC SvtGraphicStroke
{
public:
/// Style for open stroke ends
- enum CapType
+ enum CapType
{
/// No additional cap
- capButt=0,
+ capButt=0,
/// Half-round cap at the line end, the center lying at the end point
- capRound,
+ capRound,
/// Half-square cap at the line end, the center lying at the end point
capSquare
};
/// Style for joins of individual stroke segments
- enum JoinType
+ enum JoinType
{
/// Extend segment edges, until they cross
- joinMiter=0,
+ joinMiter=0,
/// Connect segments by a filled round arc
- joinRound,
+ joinRound,
/// Connect segments by a direct straight line
- joinBevel,
+ joinBevel,
/// Perform no join, leads to visible gaps between thick line segments
joinNone
};
enum
- {
+ {
/// Width of stroke start/end arrow to exactly fit the joining stroke
normalizedArrowWidth=65536
};
@@ -98,19 +98,19 @@ public:
See accessor method descriptions for argument description
*/
- SvtGraphicStroke( const Polygon& rPath,
- const PolyPolygon& rStartArrow,
- const PolyPolygon& rEndArrow,
- double fTransparency,
- double fStrokeWidth,
- CapType aCap,
- JoinType aJoin,
- double fMiterLimit,
- const DashArray& rDashArray ); // TODO: Dash array offset (position where to start, see PS)
+ SvtGraphicStroke( const Polygon& rPath,
+ const PolyPolygon& rStartArrow,
+ const PolyPolygon& rEndArrow,
+ double fTransparency,
+ double fStrokeWidth,
+ CapType aCap,
+ JoinType aJoin,
+ double fMiterLimit,
+ const DashArray& rDashArray ); // TODO: Dash array offset (position where to start, see PS)
// accessors
/// Query path to stroke
- void getPath ( Polygon& ) const;
+ void getPath ( Polygon& ) const;
/** Get the polygon that is put at the start of the line
The polygon is in a special normalized position: the center of
@@ -124,7 +124,7 @@ public:
width, it has to fit every stroke with every stroke width
exactly.
*/
- void getStartArrow ( PolyPolygon& ) const;
+ void getStartArrow ( PolyPolygon& ) const;
/** Get the polygon that is put at the end of the line
The polygon is in a special normalized position, and already
@@ -138,28 +138,28 @@ public:
arrow does have this width, it has to fit every stroke with
every stroke width exactly.
*/
- void getEndArrow ( PolyPolygon& ) const;
+ void getEndArrow ( PolyPolygon& ) const;
/** Get stroke transparency
@return the transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
*/
- double getTransparency () const;
+ double getTransparency () const;
/// Get width of the stroke
- double getStrokeWidth () const;
+ double getStrokeWidth () const;
/// Get the style in which open stroke ends are drawn
- CapType getCapType () const;
+ CapType getCapType () const;
/// Get the style in which the stroke segments are joined
- JoinType getJoinType () const;
+ JoinType getJoinType () const;
/// Get the maximum length of mitered joins
- double getMiterLimit () const;
+ double getMiterLimit () const;
/// Get an array of "on" and "off" lengths for stroke dashing
- void getDashArray ( DashArray& ) const;
+ void getDashArray ( DashArray& ) const;
/// Query a textual representation of the object's content
- ::rtl::OString toString () const;
+ ::rtl::OString toString () const;
// mutators
/// Set path to stroke
- void setPath ( const Polygon& );
+ void setPath ( const Polygon& );
/** Set the polygon that is put at the start of the line
The polygon has to be in a special normalized position, and
@@ -173,7 +173,7 @@ public:
arrow does have this width, it will fit every stroke with
every stroke width exactly.
*/
- void setStartArrow ( const PolyPolygon& );
+ void setStartArrow ( const PolyPolygon& );
/** Set the polygon that is put at the end of the line
The polygon has to be in a special normalized position, and
@@ -187,38 +187,38 @@ public:
arrow does have this width, it will fit every stroke with
every stroke width exactly.
*/
- void setEndArrow ( const PolyPolygon& );
+ void setEndArrow ( const PolyPolygon& );
/** Set stroke transparency
@param fTrans
The transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
*/
- void setTransparency ( double fTrans );
+ void setTransparency ( double fTrans );
/// Set width of the stroke
- void setStrokeWidth ( double );
+ void setStrokeWidth ( double );
/// Set the style in which open stroke ends are drawn
- void setCapType ( CapType );
+ void setCapType ( CapType );
/// Set the style in which the stroke segments are joined
- void setJoinType ( JoinType );
+ void setJoinType ( JoinType );
/// Set the maximum length of mitered joins
- void setMiterLimit ( double );
+ void setMiterLimit ( double );
/// Set the array of "on" and "off" lengths for stroke dashing
- void setDashArray ( const DashArray& );
+ void setDashArray ( const DashArray& );
private:
// friends
VCL_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass );
VCL_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass );
- Polygon maPath;
- PolyPolygon maStartArrow;
- PolyPolygon maEndArrow;
- double mfTransparency;
- double mfStrokeWidth;
- CapType maCapType;
- JoinType maJoinType;
- double mfMiterLimit;
- DashArray maDashArray;
+ Polygon maPath;
+ PolyPolygon maStartArrow;
+ PolyPolygon maEndArrow;
+ double mfTransparency;
+ double mfStrokeWidth;
+ CapType maCapType;
+ JoinType maJoinType;
+ double mfMiterLimit;
+ DashArray maDashArray;
};
/** Encapsulates geometry and associated attributes of a filled area
@@ -249,7 +249,7 @@ public:
one. The part of the scanline where the winding number is
non-zero gets filled.
*/
- fillNonZero=0,
+ fillNonZero=0,
/** Even-odd fill rule
Fill shape scanline-wise. Starting at the left, count the
@@ -262,11 +262,11 @@ public:
enum FillType
{
/// Fill with a specified solid color
- fillSolid=0,
+ fillSolid=0,
/// Fill with the specified gradient
- fillGradient,
+ fillGradient,
/// Fill with the specified hatch
- fillHatch,
+ fillHatch,
/// Fill with the specified texture (a Graphic object)
fillTexture
};
@@ -274,9 +274,9 @@ public:
enum HatchType
{
/// horizontal parallel lines, one unit apart
- hatchSingle=0,
+ hatchSingle=0,
/// horizontal and verticall orthogonally crossing lines, one unit apart
- hatchDouble,
+ hatchDouble,
/// three crossing lines, like HatchType::hatchDouble, but
/// with an additional diagonal line, rising to the upper
/// right corner. The first diagonal line goes through the
@@ -313,40 +313,40 @@ public:
See accessor method descriptions for argument description
*/
- SvtGraphicFill( const PolyPolygon& rPath,
- Color aFillColor,
- double fTransparency,
- FillRule aFillRule,
- FillType aFillType, // TODO: Multitexturing
- const Transform& aFillTransform,
- bool bTiling,
- HatchType aHatchType, // TODO: vector of directions and start points
- Color aHatchColor,
- GradientType aGradientType, // TODO: Transparent gradients (orthogonal to normal ones)
- Color aGradient1stColor, // TODO: vector of colors and offsets
- Color aGradient2ndColor,
- int aGradientStepCount, // numbers of steps to render the gradient. gradientStepsInfinite means infinitely many.
- const Graphic& aFillGraphic );
+ SvtGraphicFill( const PolyPolygon& rPath,
+ Color aFillColor,
+ double fTransparency,
+ FillRule aFillRule,
+ FillType aFillType, // TODO: Multitexturing
+ const Transform& aFillTransform,
+ bool bTiling,
+ HatchType aHatchType, // TODO: vector of directions and start points
+ Color aHatchColor,
+ GradientType aGradientType, // TODO: Transparent gradients (orthogonal to normal ones)
+ Color aGradient1stColor, // TODO: vector of colors and offsets
+ Color aGradient2ndColor,
+ int aGradientStepCount, // numbers of steps to render the gradient. gradientStepsInfinite means infinitely many.
+ const Graphic& aFillGraphic );
// accessors
/// Query path to fill
- void getPath ( PolyPolygon& ) const;
+ void getPath ( PolyPolygon& ) const;
/// Get color used for solid fills
- Color getFillColor () const;
+ Color getFillColor () const;
/** Get stroke transparency
@return the transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
*/
- double getTransparency () const;
+ double getTransparency () const;
/// Get fill rule used
- FillRule getFillRule () const;
+ FillRule getFillRule () const;
/** Get fill type used
Currently, only one of the fill types can be used
simultaneously. If you specify e.g. FillRule::fillGradient,
hatching, texture and solid fill color are ignored.
*/
- FillType getFillType () const;
+ FillType getFillType () const;
/** Get transformation applied to hatch, gradient or texture during fill
A fill operation generally starts at the top left position of
@@ -358,29 +358,29 @@ public:
top left corner plus the translation components.
*/
- void getTransform ( Transform& ) const;
+ void getTransform ( Transform& ) const;
/// deprecated
- bool IsTiling () const;
+ bool IsTiling () const;
/** Query state of texture tiling
@return true, if texture is tiled, false, if output only once.
*/
- bool isTiling () const;
+ bool isTiling () const;
/// Get type of hatch used
- HatchType getHatchType () const;
+ HatchType getHatchType () const;
/// Get color used for drawing the hatch
- Color getHatchColor () const;
+ Color getHatchColor () const;
/// Get type of gradient used
- GradientType getGradientType () const;
+ GradientType getGradientType () const;
/// Get start color of the gradient
- Color getGradient1stColor () const;
+ Color getGradient1stColor () const;
/// Get end color of the gradient
- Color getGradient2ndColor () const;
- /** Get the numbers of steps to render the gradient.
+ Color getGradient2ndColor () const;
+ /** Get the numbers of steps to render the gradient.
@return the step count. gradientStepsInfinite means infinitely many.
*/
- int getGradientStepCount() const;
+ int getGradientStepCount() const;
/** Get the texture graphic used
The Graphic object returned is used to fill the geometry, if
@@ -388,76 +388,76 @@ public:
assumed to be of size 1x1, the transformation is used to scale
it to the appropriate size.
*/
- void getGraphic ( Graphic& ) const;
+ void getGraphic ( Graphic& ) const;
/// Query a textual representation of the object's content
- ::rtl::OString toString () const;
+ ::rtl::OString toString () const;
// mutators
/// Set path to fill
- void setPath ( const PolyPolygon& rPath );
- /// Set color used for solid fills
- void setFillColor ( Color aFillColor );
+ void setPath ( const PolyPolygon& rPath );
+ /// Set color used for solid fills
+ void setFillColor ( Color aFillColor );
/** Set stroke transparency
@param fTransparency
The transparency, ranging from 0.0 (opaque) to 1.0 (fully translucent)
*/
- void setTransparency ( double fTransparency );
+ void setTransparency ( double fTransparency );
/// Set fill rule used
- void setFillRule ( FillRule aFillRule );
+ void setFillRule ( FillRule aFillRule );
/** Set fill type used
Currently, only one of the fill types can be used
simultaneously. If you specify e.g. FillRule::fillGradient,
hatching, texture and solid fill color are ignored.
*/
- void setFillType ( FillType aFillType );
+ void setFillType ( FillType aFillType );
/// Set transformation applied to hatch, gradient or texture during fill
- void setTransform ( const Transform& pTransform );
+ void setTransform ( const Transform& pTransform );
/** Set state of texture tiling
@param bTiling
If set to true, texture is tiled, if set to false, texture is output only once.
*/
- void setTiling ( bool bTiling = true );
+ void setTiling ( bool bTiling = true );
/// Set type of hatch used
- void setHatchType ( HatchType aHatchType );
+ void setHatchType ( HatchType aHatchType );
/// Set color used for drawing the hatch
- void setHatchColor ( Color aHatchColor );
+ void setHatchColor ( Color aHatchColor );
/// Set type of gradient used
- void setGradientType ( GradientType aGradType );
+ void setGradientType ( GradientType aGradType );
/// Set start color of the gradient
- void setGradient1stColor ( Color aColor );
+ void setGradient1stColor ( Color aColor );
/// Set end color of the gradient
- void setGradient2ndColor ( Color aColor );
- /** Set the numbers of steps to render the gradient.
+ void setGradient2ndColor ( Color aColor );
+ /** Set the numbers of steps to render the gradient.
@param aCount
The step count. gradientStepsInfinite means use infinitely many.
*/
- void setGradientStepCount( int aCount );
+ void setGradientStepCount( int aCount );
/// Set the texture graphic used
- void setGraphic ( const Graphic& rGraphic );
+ void setGraphic ( const Graphic& rGraphic );
private:
// friends
VCL_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass );
VCL_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass );
- PolyPolygon maPath;
- Color maFillColor;
- double mfTransparency;
- FillRule maFillRule;
- FillType maFillType;
- Transform maFillTransform;
- bool mbTiling;
- HatchType maHatchType;
- Color maHatchColor;
- GradientType maGradientType;
- Color maGradient1stColor;
- Color maGradient2ndColor;
- int maGradientStepCount;
- Graphic maFillGraphic;
+ PolyPolygon maPath;
+ Color maFillColor;
+ double mfTransparency;
+ FillRule maFillRule;
+ FillType maFillType;
+ Transform maFillTransform;
+ bool mbTiling;
+ HatchType maHatchType;
+ Color maHatchColor;
+ GradientType maGradientType;
+ Color maGradient1stColor;
+ Color maGradient2ndColor;
+ int maGradientStepCount;
+ Graphic maFillGraphic;
};
#endif /* _VCL_GRAPHICTOOLS_HXX_ */
diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx
new file mode 100644
index 000000000000..66413031f504
--- /dev/null
+++ b/vcl/inc/vcl/graphite_adaptors.hxx
@@ -0,0 +1,147 @@
+/* -*- 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_GRAPHITEADAPTORS_HXX
+#define _SV_GRAPHITEADAPTORS_HXX
+
+// We need this to enable namespace support in libgrengine headers.
+#define GR_NAMESPACE
+
+// Standard Library
+#include <stdexcept>
+// Platform
+
+#include <tools/svwin.h>
+
+#include <svsys.h>
+
+#include <vcl/salgdi.hxx>
+
+#include <vcl/sallayout.hxx>
+
+// Module
+#include "vcl/dllapi.h"
+
+// Libraries
+#include <preextstl.h>
+#include <graphite/GrClient.h>
+#include <graphite/Font.h>
+#include <graphite/ITextSource.h>
+#include <postextstl.h>
+
+// Module type definitions and forward declarations.
+//
+#ifndef MSC
+// SAL/VCL types
+class ServerFont;
+class FreetypeServerFont;
+
+// Graphite types
+
+struct FontProperties : gr::FontProps
+{
+ FontProperties(const FreetypeServerFont & font) throw();
+};
+
+namespace grutils
+{
+ class GrFeatureParser;
+}
+
+// This class adapts the Sal font and graphics services to form required by
+// the Graphite engine.
+// @author tse
+//
+class VCL_DLLPUBLIC GraphiteFontAdaptor : public gr::Font
+{
+ typedef std::map<const gr::gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
+ friend class GrFontHasher;
+public:
+ static bool IsGraphiteEnabledFont(ServerFont &) throw();
+
+ GraphiteFontAdaptor(ServerFont & font, const sal_Int32 dpi_x, const sal_Int32 dpi_y);
+ GraphiteFontAdaptor(const GraphiteFontAdaptor &) throw();
+ ~GraphiteFontAdaptor() throw();
+
+ gr::Font * copyThis();
+
+ // Basic attribute accessors.
+ virtual float ascent();
+ virtual float descent();
+ virtual bool bold();
+ virtual bool italic();
+ virtual float height();
+ virtual unsigned int getDPIx();
+ virtual unsigned int getDPIy();
+
+ // Font access methods.
+ virtual const void * getTable(gr::fontTableId32 tableID, size_t * pcbSize);
+ virtual void getFontMetrics(float * ascent_out, float * descent_out = 0, float * em_square_out = 0);
+
+ // Glyph metrics.
+ virtual void getGlyphMetrics(gr::gid16 glyphID, gr::Rect & boundingBox, gr::Point & advances);
+
+ // Adaptor attributes.
+ const FontProperties & fontProperties() const throw();
+ FreetypeServerFont & font() const throw();
+ const grutils::GrFeatureParser * features() const { return mpFeatures; };
+
+private:
+ virtual void UniqueCacheInfo(ext_std::wstring &, bool &, bool &);
+
+ FreetypeServerFont& mrFont;
+ FontProperties maFontProperties;
+ const unsigned int mnDpiX, mnDpiY;
+ const float mfAscent,
+ mfDescent,
+ mfEmUnits;
+ grutils::GrFeatureParser * mpFeatures;
+ GlyphMetricMap maGlyphMetricMap;
+};
+
+// Partial implementation of class GraphiteFontAdaptor.
+//
+inline const FontProperties & GraphiteFontAdaptor::fontProperties() const throw() {
+ return maFontProperties;
+}
+
+inline FreetypeServerFont & GraphiteFontAdaptor::font() const throw() {
+ return mrFont;
+}
+#endif // not MFC
+
+// Partial implementation of class TextSourceAdaptor.
+//
+//inline const ImplLayoutArgs & TextSourceAdaptor::layoutArgs() const throw() {
+// return _layout_args;
+//}
+
+
+#endif // _SV_GRAPHITEADAPTORS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx
new file mode 100644
index 000000000000..1c2aff06414f
--- /dev/null
+++ b/vcl/inc/vcl/graphite_cache.hxx
@@ -0,0 +1,290 @@
+/* -*- 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.
+ *
+ ************************************************************************/
+
+// Description: Classes to cache Graphite Segments to try to improve
+// rendering performance.
+
+#ifndef GraphiteSegmentCache_h
+#define GraphiteSegmentCache_h
+
+#include <tools/solar.h>
+#include <rtl/ustring.h>
+
+#define GRCACHE_REUSE_VECTORS 1
+
+#include <hash_map>
+
+class TextSourceAdaptor;
+/**
+* GrSegRecord stores a Graphite Segment and its associated text
+*/
+class GrSegRecord {
+public:
+ GrSegRecord(rtl::OUString * rope, TextSourceAdaptor * textSrc, gr::Segment * seg, bool bIsRtl);
+
+ ~GrSegRecord();
+
+ void reuse(rtl::OUString * rope, TextSourceAdaptor * textSrc, gr::Segment * seg, bool bIsRtl);
+
+ void clearVectors();
+ void clear();
+#ifdef GRCACHE_REUSE_VECTORS
+ void setGlyphVectors(long nWidth, GraphiteLayout::Glyphs & vGlyphs, std::vector<int> vCharDxs,
+ std::vector<int> & vChar2Base, std::vector<int> & vGlyph2Char, float fScale)
+ {
+ clearVectors();
+ mnWidth = nWidth;
+ m_fontScale = fScale;
+ mvGlyphs.insert(mvGlyphs.begin(), vGlyphs.begin(), vGlyphs.end());
+ mvCharDxs.insert(mvCharDxs.begin(),vCharDxs.begin(),vCharDxs.end());
+ mvChar2BaseGlyph.insert(mvChar2BaseGlyph.begin(),vChar2Base.begin(),vChar2Base.end());
+ mvGlyph2Char.insert(mvGlyph2Char.begin(),vGlyph2Char.begin(),vGlyph2Char.end());
+ }
+#endif
+ gr::Segment * getSegment() { return m_seg; }
+ TextSourceAdaptor * getTextSrc() { return m_text; }
+ void unlock() { --m_lockCount; }
+ bool isRtl() const { return mbIsRtl; }
+#ifdef GRCACHE_REUSE_VECTORS
+ const long & width() const { return mnWidth; }
+ const GraphiteLayout::Glyphs & glyphs() const { return mvGlyphs; }
+ const std::vector<int> & charDxs() const { return mvCharDxs; }
+ const std::vector<int> & char2BaseGlyph() const { return mvChar2BaseGlyph; }
+ const std::vector<int> & glyph2Char() const { return mvGlyph2Char; }
+ float & fontScale() { return m_fontScale; }
+#endif
+private:
+ rtl::OUString * m_rope;
+ TextSourceAdaptor * m_text;
+ gr::Segment * m_seg;
+ const xub_Unicode * m_nextKey;
+ const xub_Unicode* m_pStr;
+ size_t m_startChar;
+ float m_fontScale;
+ long mnWidth;
+ GraphiteLayout::Glyphs mvGlyphs; // glyphs in display order
+ std::vector<int> mvCharDxs; // right hand side x offset of each glyph
+ std::vector<int> mvChar2BaseGlyph;
+ std::vector<int> mvGlyph2Char;
+ bool mbIsRtl;
+ int m_lockCount;
+ friend class GraphiteSegmentCache;
+};
+
+typedef std::hash_map<long, GrSegRecord*, std::hash<long> > GraphiteSegMap;
+typedef std::hash_multimap<size_t, GrSegRecord*> GraphiteRopeMap;
+typedef std::pair<GraphiteRopeMap::iterator, GraphiteRopeMap::iterator> GrRMEntry;
+
+/**
+* GraphiteSegmentCache contains the cached Segments for one particular font size
+*/
+class GraphiteSegmentCache
+{
+public:
+ enum {
+ // not really sure what good values are here,
+ // bucket size should be >> cache size
+ SEG_BUCKET_FACTOR = 4,
+ SEG_DEFAULT_CACHE_SIZE = 2047
+ };
+ GraphiteSegmentCache(sal_uInt32 nSegCacheSize)
+ : m_segMap(nSegCacheSize * SEG_BUCKET_FACTOR),
+ m_nSegCacheSize(nSegCacheSize),
+ m_oldestKey(NULL) {};
+ ~GraphiteSegmentCache()
+ {
+ m_ropeMap.clear();
+ GraphiteSegMap::iterator i = m_segMap.begin();
+ while (i != m_segMap.end())
+ {
+ GrSegRecord *r = i->second;
+ delete r;
+ ++i;
+ }
+ m_segMap.clear();
+ };
+ GrSegRecord * getSegment(ImplLayoutArgs & layoutArgs, bool bIsRtl, int segCharLimit)
+ {
+ GrSegRecord * found = NULL;
+ // try to find a segment starting at correct place, if not, try to find a
+ // match for the complete buffer
+ GraphiteSegMap::iterator iMap =
+ m_segMap.find(reinterpret_cast<long>(layoutArgs.mpStr +
+ layoutArgs.mnMinCharPos));
+ if (iMap != m_segMap.end())
+ {
+ found = iMap->second;
+ }
+ else
+ {
+ iMap = m_segMap.find(reinterpret_cast<long>(layoutArgs.mpStr));
+ if (iMap != m_segMap.end())
+ {
+ found = iMap->second;
+ }
+ }
+ if (found)
+ {
+ if (found->m_seg->startCharacter() <= layoutArgs.mnMinCharPos &&
+ found->m_seg->stopCharacter() >= layoutArgs.mnEndCharPos)
+ {
+ DBG_ASSERT(found && found->m_seg, "null entry in GraphiteSegmentCache");
+ // restore original start character, in case it has changed
+ found->m_seg->setTextSourceOffset(found->m_startChar);
+ // check that characters are the same, at least in the range of
+ // interest
+ // We could use substr and ==, but substr does a copy,
+ // so its probably faster to do it like this
+ for (int i = layoutArgs.mnMinCharPos; i < segCharLimit; i++)
+ {
+ //if (!found->m_rope->match(rtl::OUString(layoutArgs.mpStr[i], layoutArgs.mnLength), i - found->m_seg->startCharacter()))
+ if (found->m_rope->getStr()[i-found->m_seg->startCharacter()] != layoutArgs.mpStr[i])
+ return NULL;
+ }
+ if (found->isRtl() != bIsRtl)
+ {
+ return NULL;
+ }
+ if (found->m_seg->stopCharacter() > layoutArgs.mnEndCharPos &&
+ static_cast<int>(found->char2BaseGlyph().size()) > layoutArgs.mnEndCharPos)
+ {
+ // check that the requested end character isn't mid cluster
+ if (found->char2BaseGlyph()[layoutArgs.mnEndCharPos-layoutArgs.mnMinCharPos] == -1)
+ {
+ return NULL;
+ }
+ }
+// if (found->m_lockCount != 0)
+// OutputDebugString("Multple users of SegRecord!");
+ found->m_lockCount++;
+ }
+ else found = NULL;
+ }
+ else
+ {
+ // the pointers aren't the same, but we might still have the same text in a segment
+ // this is expecially needed when editing a large paragraph
+ // each edit changes the pointers, but if we don't reuse any segments it gets very
+ // slow.
+ rtl::OUString * rope = new rtl::OUString(layoutArgs.mpStr + layoutArgs.mnMinCharPos,
+ segCharLimit - layoutArgs.mnMinCharPos);
+ if (!rope) return NULL;
+ size_t nHash = (*(rope)).hashCode();
+ GrRMEntry range = m_ropeMap.equal_range(nHash);
+ while (range.first != range.second)
+ {
+ found = range.first->second;
+ if (found->m_lockCount == 0)
+ {
+ if(rope->match(*(found->m_rope)))
+ {
+ // found, but the pointers are all wrong
+ found->m_seg->setTextSourceOffset(layoutArgs.mnMinCharPos);
+ // the switch is done in graphite_layout.cxx
+ //found->m_text->switchLayoutArgs(layoutArgs);
+ found->m_lockCount++;
+ break;
+ }
+ else
+ found = NULL;
+ }
+ else
+ found = NULL;
+ ++(range.first);
+ }
+ delete rope;
+ }
+ return found;
+ };
+ GrSegRecord * cacheSegment(TextSourceAdaptor * adapter, gr::Segment * seg, bool bIsRtl);
+private:
+ GraphiteSegMap m_segMap;
+ GraphiteRopeMap m_ropeMap;
+ sal_uInt32 m_nSegCacheSize;
+ const xub_Unicode * m_oldestKey;
+ const xub_Unicode * m_prevKey;
+};
+
+typedef std::hash_map<int, GraphiteSegmentCache *, std::hash<int> > GraphiteCacheMap;
+
+/**
+* GraphiteCacheHandler maps a particular font, style, size to a GraphiteSegmentCache
+*/
+class GraphiteCacheHandler
+{
+public:
+ GraphiteCacheHandler() : m_cacheMap(255)
+ {
+ const char * pEnvCache = getenv( "SAL_GRAPHITE_CACHE_SIZE" );
+ if (pEnvCache != NULL)
+ {
+ int envCacheSize = atoi(pEnvCache);
+ if (envCacheSize <= 0)
+ m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE;
+ else
+ {
+ m_nSegCacheSize = envCacheSize;
+ }
+ }
+ else
+ {
+ m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE;
+ }
+ };
+ ~GraphiteCacheHandler()
+ {
+ GraphiteCacheMap::iterator i = m_cacheMap.begin();
+ while (i != m_cacheMap.end())
+ {
+ GraphiteSegmentCache *r = i->second;
+ delete r;
+ ++i;
+ }
+ m_cacheMap.clear();
+ };
+
+ static GraphiteCacheHandler instance;
+
+ GraphiteSegmentCache * getCache(sal_Int32 & fontHash)
+ {
+ if (m_cacheMap.count(fontHash) > 0)
+ {
+ return m_cacheMap.find(fontHash)->second;
+ }
+ GraphiteSegmentCache *pCache = new GraphiteSegmentCache(m_nSegCacheSize);
+ m_cacheMap[fontHash] = pCache;
+ return pCache;
+ }
+private:
+ GraphiteCacheMap m_cacheMap;
+ sal_uInt32 m_nSegCacheSize;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx
index 742ad2c3f5f5..1cb109e77aaa 100644
--- a/vcl/inc/vcl/graphite_features.hxx
+++ b/vcl/inc/vcl/graphite_features.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,17 +30,14 @@
// Parse a string of features specified as ; separated pairs.
// e.g.
// 1001=1&2002=2&fav1=0
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-#include <graphite2/Font.h>
+#include <preextstl.h>
+#include <graphite/GrClient.h>
+#include <graphite/Font.h>
+#include <graphite/GrFeature.h>
+#include <postextstl.h>
namespace grutils
{
- union FeatId
- {
- gr_uint32 num;
- unsigned char label[5];
- };
class GrFeatureParser
{
@@ -49,30 +46,32 @@ namespace grutils
static const char FEAT_PREFIX;
static const char FEAT_SEPARATOR;
static const char FEAT_ID_VALUE_SEPARATOR;
- GrFeatureParser(const gr_face * face, const ::rtl::OString features, const ::rtl::OString lang);
- GrFeatureParser(const gr_face * face, const ::rtl::OString lang);
+ GrFeatureParser(gr::Font & font, const std::string features, const std::string lang);
+ GrFeatureParser(gr::Font & font, const std::string lang);
+ GrFeatureParser(const GrFeatureParser & copy);
~GrFeatureParser();
- //size_t getFontFeatures(gr::FeatureSetting settings[MAX_FEATURES]) const;
+ size_t getFontFeatures(gr::FeatureSetting settings[MAX_FEATURES]) const;
bool parseErrors() { return mbErrors; };
- //static bool isValid(gr::Font & font, gr::FeatureSetting & setting);
- gr_uint32 getLanguage() const { return maLang.num; };
- bool hasLanguage() const { return (maLang.label[0] != '\0'); }
- sal_Int32 hashCode() const { return mnHash; }
- size_t numFeatures() const { return mnNumSettings; }
- gr_feature_val * values() const { return mpSettings; };
+ static bool isValid(gr::Font & font, gr::FeatureSetting & setting);
+ gr::isocode getLanguage() const { return maLang; };
+ bool hasLanguage() const { return (maLang.rgch[0] != '\0'); }
+ sal_Int32 hashCode() const;
private:
- GrFeatureParser(const GrFeatureParser & copy);
- void setLang(const gr_face * face, const ::rtl::OString & lang);
- bool isCharId(const ::rtl::OString & id, size_t offset, size_t length);
- gr_uint32 getCharId(const ::rtl::OString & id, size_t offset, size_t length);
- short getIntValue(const ::rtl::OString & id, size_t offset, size_t length);
+ void setLang(gr::Font & font, const std::string & lang);
+ bool isCharId(const std::string & id, size_t offset, size_t length);
+ int getCharId(const std::string & id, size_t offset, size_t length);
+ int getIntValue(const std::string & id, size_t offset, size_t length);
size_t mnNumSettings;
- FeatId maLang;
+ gr::isocode maLang;
bool mbErrors;
- sal_uInt32 mnHash;
- gr_feature_val * mpSettings;
+ gr::FeatureSetting maSettings[64];
};
+ union FeatId
+ {
+ gr::featid num;
+ unsigned char label[5];
+ };
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index f605f190f669..f3abdfe0623a 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,19 +34,31 @@
// We need this to enable namespace support in libgrengine headers.
#define GR_NAMESPACE
+#define GRCACHE 1
+
// Standard Library
#include <memory>
#include <vector>
-#include <map>
#include <utility>
// Libraries
-#include <graphite2/Font.h>
-#include <graphite2/Segment.h>
+#include <preextstl.h>
+#include <graphite/GrClient.h>
+#include <graphite/Font.h>
+#include <graphite/GrConstants.h>
+#include <graphite/GrAppData.h>
+#include <graphite/SegmentAux.h>
+#include <postextstl.h>
// Platform
#include <vcl/sallayout.hxx>
#include <vcl/dllapi.h>
// Module
+// For backwards compatibility with 2.4.x
+#if (SUPD == 680)
+typedef sal_Int32 sal_GlyphId;
+#endif
+
+
// Module type definitions and forward declarations.
//
class TextSourceAdaptor;
@@ -55,79 +67,85 @@ class GrSegRecord;
// SAL/VCL types
class ServerFont;
-// Graphite types
-namespace grutils { class GrFeatureParser; }
-
-class GraphiteFaceWrapper
+#ifdef WNT
+// The GraphiteWinFont is just a wrapper to enable GrFontHasher to be a friend
+// so that UniqueCacheInfo can be called.
+#include <graphite/WinFont.h>
+class GraphiteWinFont : public gr::WinFont
{
+ friend class GrFontHasher;
public:
- typedef std::map<int, gr_font*> GrFontMap;
- GraphiteFaceWrapper(gr_face * pFace) : m_pFace(pFace) {}
- ~GraphiteFaceWrapper()
- {
- GrFontMap::iterator i = m_fonts.begin();
- while (i != m_fonts.end())
- gr_font_destroy((*i++).second);
- m_fonts.clear();
- gr_face_destroy(m_pFace);
- }
- const gr_face * face() const { return m_pFace; }
- gr_font * font(int ppm) const
- {
- GrFontMap::const_iterator i = m_fonts.find(ppm);
- if (i != m_fonts.end())
- return i->second;
- return NULL;
- };
- void addFont(int ppm, gr_font * pFont)
- {
- if (m_fonts[ppm])
- gr_font_destroy(m_fonts[ppm]);
- m_fonts[ppm] = pFont;
- }
-private:
- gr_face * m_pFace;
- GrFontMap m_fonts;
+ GraphiteWinFont(HDC hdc) : gr::WinFont(hdc) {};
+ virtual ~GraphiteWinFont() {};
};
+#endif
+// Graphite types
+namespace gr { class Segment; class GlyphIterator; }
+namespace grutils { class GrFeatureParser; }
// This class uses the SIL Graphite engine to provide complex text layout services to the VCL
// @author tse
//
-class VCL_PLUGIN_PUBLIC GraphiteLayout : public SalLayout
+class VCL_DLLPUBLIC GraphiteLayout : public SalLayout
{
public:
+ // Mask to allow Word break status to be stored within mvChar2BaseGlyph
+ enum {
+ WORD_BREAK_BEFORE = 0x40000000,
+ HYPHEN_BREAK_BEFORE = 0x80000000,
+ BREAK_MASK = 0xC0000000,
+ GLYPH_INDEX_MASK = 0x3FFFFFFF
+ } LineBreakMask;
class Glyphs : public std::vector<GlyphItem>
{
public:
typedef std::pair<Glyphs::const_iterator, Glyphs::const_iterator> iterator_pair_t;
+ void fill_from(gr::Segment & rSeg, ImplLayoutArgs & rArgs,
+ bool bRtl, long &rWidth, float fScaling,
+ std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char,
+ std::vector<int> & rCharDxs);
+ void move_glyph(Glyphs::iterator, long dx);
+
+ const_iterator cluster_base(const_iterator) const;
+ iterator_pair_t neighbour_clusters(const_iterator) const;
+ private:
+ std::pair<float,float> appendCluster(gr::Segment & rSeg, ImplLayoutArgs & rArgs,
+ bool bRtl, float fSegmentAdvance, int nFirstCharInCluster, int nNextChar,
+ int nFirstGlyphInCluster, int nNextGlyph, float fScaling,
+ std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char,
+ std::vector<int> & rCharDxs, long & rDXOffset);
+ void append(gr::Segment & rSeg, ImplLayoutArgs & rArgs, gr::GlyphInfo & rGi, float nextGlyphOrigin, float fScaling, std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs, long & rDXOffset, bool bIsBase);
};
mutable Glyphs mvGlyphs;
void clear();
private:
- const gr_face * mpFace; // not owned by layout
- gr_font * mpFont; // not owned by layout
- int mnSegCharOffset; // relative to ImplLayoutArgs::mpStr
+ TextSourceAdaptor * mpTextSrc; // Text source.
+ gr::LayoutEnvironment maLayout;
+ const gr::Font &mrFont;
long mnWidth;
+ std::vector<int> mvCharDxs;
std::vector<int> mvChar2BaseGlyph;
std::vector<int> mvGlyph2Char;
- std::vector<int> mvCharDxs;
- std::vector<int> mvCharBreaks;
float mfScaling;
const grutils::GrFeatureParser * mpFeatures;
public:
- GraphiteLayout(const gr_face * pFace, gr_font * pFont = NULL,
- const grutils::GrFeatureParser * features = NULL) throw();
+ GraphiteLayout(const gr::Font & font, const grutils::GrFeatureParser * features = NULL) throw();
// used by upper layers
virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout
// split into two stages to allow dc to be restored on the segment
- gr_segment * CreateSegment(ImplLayoutArgs& rArgs);
- bool LayoutGlyphs(ImplLayoutArgs& rArgs, gr_segment * pSegment);
+#ifdef GRCACHE
+ gr::Segment * CreateSegment(ImplLayoutArgs& rArgs, GrSegRecord ** pRecord = NULL);
+ bool LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment, GrSegRecord * pSegRecord);
+#else
+ gr::Segment * CreateSegment(ImplLayoutArgs& rArgs);
+ bool LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment);
+#endif
virtual void AdjustLayout( ImplLayoutArgs& ); // adjusting positions
@@ -151,25 +169,23 @@ public:
virtual void DrawText(SalGraphics&) const {};
virtual ~GraphiteLayout() throw();
- void SetFont(gr_font * pFont) { mpFont = pFont; }
- gr_font * GetFont() { return mpFont; }
void SetFeatures(grutils::GrFeatureParser * aFeature) { mpFeatures = aFeature; }
void SetFontScale(float s) { mfScaling = s; };
+ const TextSourceAdaptor * textSrc() const { return mpTextSrc; };
virtual sal_GlyphId getKashidaGlyph(int & width) = 0;
void kashidaJustify(std::vector<int> & rDeltaWidth, sal_GlyphId, int width);
static const int EXTRA_CONTEXT_LENGTH;
private:
- void expandOrCondense(ImplLayoutArgs &rArgs);
- void fillFrom(gr_segment * rSeg, ImplLayoutArgs & rArgs, float fScaling);
+ int glyph_to_char(Glyphs::iterator);
+ std::pair<int,int> glyph_to_chars(const GlyphItem &) const;
- void append(gr_segment * pSeg,
- ImplLayoutArgs & rArgs,
- const gr_slot * pSlot,
- float nextGlyphOrigin, float fScaling,
- long & rDXOffset, bool bIsBase, int baseChar);
+ std::pair<long,long> caret_positions(size_t) const;
+ void expandOrCondense(ImplLayoutArgs &rArgs);
};
+
+
#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 b4a6e10be925..21873e0582a1 100644
--- a/vcl/inc/vcl/graphite_serverfont.hxx
+++ b/vcl/inc/vcl/graphite_serverfont.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,41 +33,35 @@
#define GR_NAMESPACE
#ifndef MSC
-#include "vcl/graphite_layout.hxx"
+#include <vcl/graphite_layout.hxx>
+#include <vcl/graphite_adaptors.hxx>
// Modules
-class VCL_PLUGIN_PUBLIC GraphiteLayoutImpl : public GraphiteLayout
+class VCL_DLLPUBLIC GraphiteLayoutImpl : public GraphiteLayout
{
public:
- GraphiteLayoutImpl(const gr_face * pFace,
- ServerFont & rServerFont) throw()
- : GraphiteLayout(pFace), mrServerFont(rServerFont) {};
+ GraphiteLayoutImpl(const gr::Font & font, const grutils::GrFeatureParser * features, GraphiteFontAdaptor * pFont) throw()
+ : GraphiteLayout(font, features), mpFont(pFont) {};
virtual ~GraphiteLayoutImpl() throw() {};
virtual sal_GlyphId getKashidaGlyph(int & width);
private:
- ServerFont & mrServerFont;
+ GraphiteFontAdaptor * mpFont;
};
// This class implments the server font specific parts.
// @author tse
//
-class VCL_PLUGIN_PUBLIC GraphiteServerFontLayout : public ServerFontLayout
+class VCL_DLLPUBLIC GraphiteServerFontLayout : public ServerFontLayout
{
private:
+ mutable GraphiteFontAdaptor * mpFont;
// mutable so that the DrawOffset/DrawBase can be set
mutable GraphiteLayoutImpl maImpl;
- grutils::GrFeatureParser * mpFeatures;
- const sal_Unicode * mpStr;
public:
- GraphiteServerFontLayout(ServerFont& pServerFont) throw();
+ GraphiteServerFontLayout(GraphiteFontAdaptor * font) throw();
- virtual bool LayoutText( ImplLayoutArgs& rArgs)
- {
- mpStr = rArgs.mpStr;
- SalLayout::AdjustLayout(rArgs);
- return maImpl.LayoutText(rArgs);
- }; // first step of layout
+ virtual bool LayoutText( ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); return maImpl.LayoutText(rArgs); }; // first step of layout
virtual void AdjustLayout( ImplLayoutArgs& rArgs)
{
SalLayout::AdjustLayout(rArgs);
@@ -95,13 +89,14 @@ public:
virtual ~GraphiteServerFontLayout() throw();
- static bool IsGraphiteEnabledFont(ServerFont * pServerFont);
// For use with PspGraphics
- const sal_Unicode* getTextPtr() const { return mpStr; };
+ const sal_Unicode* getTextPtr() const;
int getMinCharPos() const { return mnMinCharPos; }
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 3334988c7877..5eff89280e45 100644
--- a/vcl/inc/vcl/group.hxx
+++ b/vcl/inc/vcl/group.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,11 +44,11 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout = false );
- virtual void FillLayoutData() const;
+ virtual void FillLayoutData() const;
virtual const Font&
GetCanonicalFont( const StyleSettings& _rStyle ) const;
virtual const Color&
@@ -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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 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 947740229f7f..d8826ac5d199 100644
--- a/vcl/inc/vcl/hatch.hxx
+++ b/vcl/inc/vcl/hatch.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,17 +42,17 @@ class SvStream;
struct ImplHatch
{
- sal_uLong mnRefCount;
- Color maColor;
- HatchStyle meStyle;
- long mnDistance;
- sal_uInt16 mnAngle;
+ ULONG mnRefCount;
+ Color maColor;
+ HatchStyle meStyle;
+ long mnDistance;
+ USHORT mnAngle;
ImplHatch();
ImplHatch( const ImplHatch& rImplHatch );
- friend SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch );
- friend SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch );
+ friend SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch );
+ friend SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch );
};
// ---------
@@ -61,34 +61,34 @@ struct ImplHatch
class VCL_DLLPUBLIC Hatch
{
-private:
+private:
- ImplHatch* mpImplHatch;
- SAL_DLLPRIVATE void ImplMakeUnique();
+ ImplHatch* mpImplHatch;
+ SAL_DLLPRIVATE void ImplMakeUnique();
public:
Hatch();
Hatch( const Hatch& rHatch );
- Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
+ Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, USHORT nAngle10 = 0 );
~Hatch();
- Hatch& operator=( const Hatch& rHatch );
- 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 ); }
+ 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 ); }
void SetStyle( HatchStyle eStyle );
- HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
+ HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
void SetColor( const Color& rColor );
- const Color& GetColor() const { return mpImplHatch->maColor; }
+ const Color& GetColor() const { return mpImplHatch->maColor; }
void SetDistance( long nDistance );
- long GetDistance() const { return mpImplHatch->mnDistance; }
+ long GetDistance() const { return mpImplHatch->mnDistance; }
- void SetAngle( sal_uInt16 nAngle10 );
- sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
+ void SetAngle( USHORT nAngle10 );
+ USHORT 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 ce7d1baf4fd6..60ab16ae077c 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,26 +41,20 @@ class Window;
// - Help-Types -
// --------------
-#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)
+#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)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ".help:index"
-#define OOO_HELP_HELPONHELP ".help:helponhelp"
+#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
+#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
// --------
// - Help -
@@ -69,67 +63,64 @@ class Window;
class VCL_DLLPUBLIC Help
{
private:
- String maHelpFile;
+ String maHelpFile;
public:
Help();
- virtual ~Help();
+ virtual ~Help();
- void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
- const String& GetHelpFile() const { return maHelpFile; }
+ void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
+ const String& GetHelpFile() const { return maHelpFile; }
- 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 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 XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
- static void EnableContextHelp();
- static void DisableContextHelp();
- static sal_Bool IsContextHelpEnabled();
- static sal_Bool StartContextHelp();
-
- static void EnableExtHelp();
- static void DisableExtHelp();
- static sal_Bool IsExtHelpEnabled();
- static sal_Bool StartExtHelp();
- static sal_Bool EndExtHelp();
- static sal_Bool IsExtHelpActive();
-
- static void EnableBalloonHelp();
- static void DisableBalloonHelp();
- static sal_Bool IsBalloonHelpEnabled();
- static sal_Bool ShowBalloon( Window* pParent,
+ static void EnableContextHelp();
+ static void DisableContextHelp();
+ static BOOL IsContextHelpEnabled();
+ static BOOL StartContextHelp();
+
+ static void EnableExtHelp();
+ static void DisableExtHelp();
+ static BOOL IsExtHelpEnabled();
+ static BOOL StartExtHelp();
+ static BOOL EndExtHelp();
+ static BOOL IsExtHelpActive();
+
+ static void EnableBalloonHelp();
+ static void DisableBalloonHelp();
+ static BOOL IsBalloonHelpEnabled();
+ static BOOL ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText );
- static sal_Bool ShowBalloon( Window* pParent,
+ static BOOL ShowBalloon( Window* pParent,
const Point& rScreenPos,
const Rectangle&,
const XubString& rHelpText );
- static void EnableQuickHelp();
- static void DisableQuickHelp();
- static sal_Bool IsQuickHelpEnabled();
- static sal_Bool ShowQuickHelp( Window* pParent,
+ static void EnableQuickHelp();
+ static void DisableQuickHelp();
+ static BOOL IsQuickHelpEnabled();
+ static BOOL ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- sal_uInt16 nStyle = 0 );
- static sal_Bool ShowQuickHelp( Window* pParent,
+ USHORT nStyle = 0 );
+ static BOOL ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
- sal_uInt16 nStyle = 0 )
+ USHORT nStyle = 0 )
{ return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); }
- static sal_uLong ShowTip( Window* pParent,
+ static ULONG ShowTip( Window* pParent,
const Rectangle& rScreenRect,
- 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 );
+ const XubString& rText, USHORT nStyle = 0 );
+ static void HideTip( ULONG nId );
};
-#endif // _SV_HELP_HXX
+#endif // _SV_HELP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/helper.hxx b/vcl/inc/vcl/helper.hxx
index 732e98080c62..f5bb4816f210 100644
--- a/vcl/inc/vcl/helper.hxx
+++ b/vcl/inc/vcl/helper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/helpwin.hxx b/vcl/inc/vcl/helpwin.hxx
index 7862a4961bbd..bf0fde690133 100644
--- a/vcl/inc/vcl/helpwin.hxx
+++ b/vcl/inc/vcl/helpwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,56 +39,55 @@
class HelpTextWindow : public FloatingWindow
{
private:
- Point maPos;
- Rectangle maHelpArea; // Wenn naechste Hilfe fuers gleiche Rectangle, gleicher Text, dann Fenster stehen lassen
+ Point maPos;
+ Rectangle maHelpArea; // Wenn naechste Hilfe fuers gleiche Rectangle, gleicher Text, dann Fenster stehen lassen
- Rectangle maTextRect; // Bei umgebrochenen Text in QuickHelp
+ Rectangle maTextRect; // Bei umgebrochenen Text in QuickHelp
- String maHelpText;
- String maStatusText;
+ String maHelpText;
+ String maStatusText;
- Timer maShowTimer;
- Timer maHideTimer;
+ Timer maShowTimer;
+ Timer maHideTimer;
- sal_uInt16 mnHelpWinStyle;
- sal_uInt16 mnStyle;
+ USHORT mnHelpWinStyle;
+ USHORT mnStyle;
protected:
DECL_LINK( TimerHdl, Timer* );
- virtual void Paint( const Rectangle& );
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual String GetText() const;
- void ImplShow();
+ virtual void Paint( const Rectangle& );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual String GetText() const;
+ void ImplShow();
public:
- HelpTextWindow( Window* pParent, const String& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
+ HelpTextWindow( Window* pParent, const String& rText, USHORT nHelpWinStyle, USHORT nStyle );
~HelpTextWindow();
- const String& GetHelpText() const { return maHelpText; }
- void SetHelpText( const String& rHelpText );
- sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
- sal_uInt16 GetStyle() const { return mnStyle; }
+ const String& GetHelpText() const { return maHelpText; }
+ void SetHelpText( const String& rHelpText );
+ USHORT GetWinStyle() const { return mnHelpWinStyle; }
// Nur merken:
- void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
- void SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
+ void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
+ void SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
- void ShowHelp( sal_uInt16 nDelayMode );
+ void ShowHelp( USHORT nDelayMode );
- Size CalcOutSize() const;
- const Rectangle& GetHelpArea() const { return maHelpArea; }
+ Size CalcOutSize() const;
+ const Rectangle& GetHelpArea() const { return maHelpArea; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- sal_Bool RegisterAccessibleParent();
- void RevokeAccessibleParent();
+ BOOL RegisterAccessibleParent();
+ void RevokeAccessibleParent();
};
-void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
+void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
const String& rHelpText, const String& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea = NULL );
void ImplDestroyHelpWindow( bool bUpdateHideTime );
-void ImplSetHelpWindowPos( Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWindow, USHORT nHelpWinStyle, USHORT 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 a83afa4510ab..d8b460338bd5 100644
--- a/vcl/inc/vcl/i18nhelp.hxx
+++ b/vcl/inc/vcl/i18nhelp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,7 +39,7 @@ namespace com {
namespace sun {
namespace star {
namespace lang {
- class XMultiServiceFactory;
+ class XMultiServiceFactory;
}
}}}
@@ -57,7 +57,7 @@ namespace vcl
class VCL_DLLPUBLIC I18nHelper
{
private:
- ::osl::Mutex maMutex;
+ ::osl::Mutex maMutex;
::com::sun::star::lang::Locale maLocale;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
@@ -87,12 +87,12 @@ public:
sal_Bool MatchMnemonic( const String& rString, sal_Unicode cMnemonicChar ) const;
String GetDate( const Date& rDate ) const;
- String GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep = sal_True, sal_Bool bTrailingZeros = sal_True ) const;
-
+ String GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep = TRUE, BOOL bTrailingZeros = TRUE ) const;
+
static String filterFormattingChars( const String& );
};
-} // namespace vcl
+} // namespace vcl
#endif // _VCL_I18NHELP_HXX
diff --git a/vcl/inc/vcl/idlemgr.hxx b/vcl/inc/vcl/idlemgr.hxx
index 674bdf070c3a..edb449d960a7 100644
--- a/vcl/inc/vcl/idlemgr.hxx
+++ b/vcl/inc/vcl/idlemgr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,10 +31,8 @@
#include <vcl/sv.h>
#include <vcl/timer.hxx>
-#include <vector>
-struct ImplIdleData;
-typedef ::std::vector< ImplIdleData* > ImplIdleList;
+class ImplIdleList;
// ---------------
// - ImplIdleMgr -
@@ -50,7 +48,7 @@ public:
ImplIdleMgr();
~ImplIdleMgr();
- sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
+ BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
void RemoveIdleHdl( const Link& rLink );
void RestartIdler()
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index 850531c64d9d..17ddd3033a49 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,6 @@
#include <vcl/lstbox.h>
#include <vcl/timer.hxx>
-#include "vcl/quickselectionengine.hxx"
class ScrollBar;
class ScrollBarBox;
@@ -46,8 +45,8 @@ class ScrollBarBox;
// - ListBox-Types -
// -----------------
-#define HORZ_SCROLL 4
-#define IMG_TXT_DISTANCE 6
+#define HORZ_SCROLL 4
+#define IMG_TXT_DISTANCE 6
enum LB_EVENT_TYPE
{
@@ -61,14 +60,14 @@ enum LB_EVENT_TYPE
// -----------------
// - ImplEntryType -
// -----------------
-
+
struct ImplEntryType
{
- XubString maStr;
- Image maImage;
- void* mpUserData;
- sal_Bool mbIsSelected;
- long mnFlags;
+ XubString maStr;
+ Image maImage;
+ void* mpUserData;
+ BOOL mbIsSelected;
+ long mnFlags;
long mnHeight;
ImplEntryType( const XubString& rStr, const Image& rImage ) :
@@ -77,7 +76,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = sal_False;
+ mbIsSelected = FALSE;
mpUserData = NULL;
}
@@ -86,7 +85,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = sal_False;
+ mbIsSelected = FALSE;
mpUserData = NULL;
}
@@ -95,7 +94,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = sal_False;
+ mbIsSelected = FALSE;
mpUserData = NULL;
}
};
@@ -103,183 +102,184 @@ struct ImplEntryType
// -----------------
// - ImplEntryList -
// -----------------
-
+
class ImplEntryList : private List
{
private:
Window* mpWindow; // For getting the current locale when matching strings
- sal_uInt16 mnLastSelected;
- sal_uInt16 mnSelectionAnchor;
- sal_uInt16 mnImages;
+ USHORT mnLastSelected;
+ USHORT mnSelectionAnchor;
+ USHORT mnImages;
- sal_uInt16 mnMRUCount;
- sal_uInt16 mnMaxMRUCount;
+ USHORT mnMRUCount;
+ USHORT mnMaxMRUCount;
- Link maSelectionChangedHdl;
- sal_Bool mbCallSelectionChangedHdl;
+ Link maSelectionChangedHdl;
+ BOOL mbCallSelectionChangedHdl;
- ImplEntryType* GetEntry( sal_uInt16 nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
+ ImplEntryType* GetEntry( USHORT nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
public:
ImplEntryList( Window* pWindow );
~ImplEntryList();
- 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 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 ); }
+ void Clear();
- 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;
+ 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;
// 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( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const;
- long GetEntryHeight( sal_uInt16 nPos ) const;
+ long GetAddedHeight( USHORT nEndIndex, USHORT nBeginIndex = 0, long nBeginHeight = 0 ) const;
+ long GetEntryHeight( USHORT nPos ) const;
- sal_uInt16 GetEntryCount() const { return (sal_uInt16)List::Count(); }
- sal_Bool HasImages() const { return mnImages ? sal_True : sal_False; }
+ USHORT GetEntryCount() const { return (USHORT)List::Count(); }
+ BOOL HasImages() const { return mnImages ? TRUE : FALSE; }
- XubString GetEntryText( sal_uInt16 nPos ) const;
+ XubString GetEntryText( USHORT nPos ) const;
- sal_Bool HasEntryImage( sal_uInt16 nPos ) const;
- Image GetEntryImage( sal_uInt16 nPos ) const;
+ BOOL HasEntryImage( USHORT nPos ) const;
+ Image GetEntryImage( USHORT nPos ) const;
- void SetEntryData( sal_uInt16 nPos, void* pNewData );
- void* GetEntryData( sal_uInt16 nPos ) const;
+ void SetEntryData( USHORT nPos, void* pNewData );
+ void* GetEntryData( USHORT nPos ) const;
- void SetEntryFlags( sal_uInt16 nPos, long nFlags );
- long GetEntryFlags( sal_uInt16 nPos ) const;
+ void SetEntryFlags( USHORT nPos, long nFlags );
+ long GetEntryFlags( USHORT nPos ) const;
- void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
+ void SelectEntry( USHORT nPos, BOOL bSelect );
- 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;
+ USHORT GetSelectEntryCount() const;
+ XubString GetSelectEntry( USHORT nIndex ) const;
+ USHORT GetSelectEntryPos( USHORT nIndex ) const;
+ BOOL IsEntrySelected( const XubString& rStr ) const;
+ BOOL IsEntryPosSelected( USHORT nIndex ) const;
- void SetLastSelected( sal_uInt16 nPos ) { mnLastSelected = nPos; }
- sal_uInt16 GetLastSelected() const { return mnLastSelected; }
+ void SetLastSelected( USHORT nPos ) { mnLastSelected = nPos; }
+ USHORT GetLastSelected() const { return mnLastSelected; }
- void SetSelectionAnchor( sal_uInt16 nPos ) { mnSelectionAnchor = nPos; }
- sal_uInt16 GetSelectionAnchor() const { return mnSelectionAnchor; }
+ void SetSelectionAnchor( USHORT nPos ) { mnSelectionAnchor = nPos; }
+ USHORT GetSelectionAnchor() const { return mnSelectionAnchor; }
- void SetSelectionChangedHdl( const Link& rLnk ) { maSelectionChangedHdl = rLnk; }
- void SetCallSelectionChangedHdl( sal_Bool bCall ) { mbCallSelectionChangedHdl = bCall; }
+ void SetSelectionChangedHdl( const Link& rLnk ) { maSelectionChangedHdl = rLnk; }
+ void SetCallSelectionChangedHdl( BOOL bCall ) { mbCallSelectionChangedHdl = bCall; }
- void SetMRUCount( sal_uInt16 n ) { mnMRUCount = n; }
- sal_uInt16 GetMRUCount() const { return mnMRUCount; }
+ void SetMRUCount( USHORT n ) { mnMRUCount = n; }
+ USHORT GetMRUCount() const { return mnMRUCount; }
- void SetMaxMRUCount( sal_uInt16 n ) { mnMaxMRUCount = n; }
- sal_uInt16 GetMaxMRUCount() const { return mnMaxMRUCount; }
+ void SetMaxMRUCount( USHORT n ) { mnMaxMRUCount = n; }
+ USHORT GetMaxMRUCount() const { return mnMaxMRUCount; }
- /** An Entry is selectable if its mnFlags does not have the
+ /** An Entry is selectable if its mnFlags does not have the
LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */
- bool IsEntrySelectable( sal_uInt16 nPos ) const;
+ bool IsEntrySelectable( USHORT 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.
*/
- sal_uInt16 FindFirstSelectable( sal_uInt16 nPos, bool bForward = true );
+ USHORT FindFirstSelectable( USHORT nPos, bool bForward = true );
};
// ---------------------
// - ImplListBoxWindow -
// ---------------------
-class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
+class ImplListBoxWindow : public Control
{
private:
- ImplEntryList* mpEntryList; // EntryListe
- Rectangle maFocusRect;
+ ImplEntryList* mpEntryList; // EntryListe
+ Rectangle maFocusRect;
+ String maSearchStr;
+ Timer maSearchTimeout;
- Size maUserItemSize;
+ Size maUserItemSize;
- long mnMaxTxtHeight; // Maximale Hoehe eines Text-Items
- long mnMaxTxtWidth; // Maximale Breite eines Text-Items
+ long mnMaxTxtHeight; // Maximale Hoehe eines Text-Items
+ long mnMaxTxtWidth; // Maximale Breite eines Text-Items
// Entry ohne Image
- long mnMaxImgTxtWidth;// Maximale Breite eines Text-Items
+ long mnMaxImgTxtWidth;// Maximale Breite eines Text-Items
// Entry UND Image
- long mnMaxImgWidth; // Maximale Breite eines Image-Items
- long mnMaxImgHeight; // Maximale Hoehe eines Image-Items
- long mnMaxWidth; // Maximale Breite eines Eintrags
- long mnMaxHeight; // Maximale Hoehe eines Eintrags
+ long mnMaxImgWidth; // Maximale Breite eines Image-Items
+ long mnMaxImgHeight; // Maximale Hoehe eines Image-Items
+ long mnMaxWidth; // Maximale Breite eines Eintrags
+ long mnMaxHeight; // Maximale Hoehe eines Eintrags
- sal_uInt16 mnCurrentPos; // Position (Focus)
- sal_uInt16 mnTrackingSaveSelection; // Selektion vor Tracking();
+ USHORT mnCurrentPos; // Position (Focus)
+ USHORT mnTrackingSaveSelection; // Selektion vor Tracking();
- sal_uInt16 mnSeparatorPos; // Separator
+ USHORT mnSeparatorPos; // Separator
- sal_uInt16 mnUserDrawEntry;
+ USHORT mnUserDrawEntry;
- sal_uInt16 mnTop; // Ausgabe ab Zeile
- long mnLeft; // Ausgabe ab Spalte
- long mnBorder; // Abstand Rahmen - Text
- long mnTextHeight; // Texthoehe
+ USHORT mnTop; // Ausgabe ab Zeile
+ long mnLeft; // Ausgabe ab Spalte
+ long mnBorder; // Abstand Rahmen - Text
+ long mnTextHeight; // Texthoehe
ProminentEntry meProminentType; // where is the "prominent" entry
- sal_uInt16 mnSelectModifier; // Modifiers
-
- sal_Bool mbHasFocusRect: 1,
- mbSort: 1, // ListBox sortiert
- mbTrack: 1, // Tracking
- mbMulti: 1, // MultiListBox
- mbStackMode: 1, // StackSelection
- mbSimpleMode: 1, // SimpleMode fuer MultiListBox
- mbImgsDiffSz: 1, // Images haben verschiedene Groessen
- mbTravelSelect: 1, // TravelSelect
- mbTrackingSelect: 1, // Selektiert bei MouseMove
- mbSelectionChanged: 1, // Select() nicht zu oft rufen...
- mbMouseMoveSelect: 1, // Selektieren bei MouseMove
- mbGrabFocus: 1, // Focus bei MBDown grabben
- mbUserDrawEnabled: 1, // UserDraw possible
- mbInUserDraw: 1, // In UserDraw
- mbReadOnly: 1, // ReadOnly
- mbMirroring: 1, // pb: #106948# explicit mirroring for calc
+ USHORT mnSelectModifier; // Modifiers
+
+ BOOL mbHasFocusRect: 1,
+ mbSort: 1, // ListBox sortiert
+ mbTrack: 1, // Tracking
+ mbMulti: 1, // MultiListBox
+ mbStackMode: 1, // StackSelection
+ mbSimpleMode: 1, // SimpleMode fuer MultiListBox
+ mbImgsDiffSz: 1, // Images haben verschiedene Groessen
+ mbTravelSelect: 1, // TravelSelect
+ mbTrackingSelect: 1, // Selektiert bei MouseMove
+ mbSelectionChanged: 1, // Select() nicht zu oft rufen...
+ mbMouseMoveSelect: 1, // Selektieren bei MouseMove
+ mbGrabFocus: 1, // Focus bei MBDown grabben
+ mbUserDrawEnabled: 1, // UserDraw possible
+ mbInUserDraw: 1, // In UserDraw
+ mbReadOnly: 1, // ReadOnly
+ mbMirroring: 1, // pb: #106948# explicit mirroring for calc
mbRight: 1, // right align Text output
mbCenter: 1; // center Text output
- Link maScrollHdl;
- Link maSelectHdl;
- Link maCancelHdl;
- Link maDoubleClickHdl;
- Link maUserDrawHdl;
- Link maMRUChangedHdl;
-
- ::vcl::QuickSelectionEngine
- maQuickSelectionEngine;
+ Link maScrollHdl;
+ Link maSelectHdl;
+ Link maCancelHdl;
+ Link maDoubleClickHdl;
+ Link maUserDrawHdl;
+ Link maMRUChangedHdl;
protected:
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Resize();
- virtual void GetFocus();
- virtual void LoseFocus();
-
- 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 );
- void ImplCallSelect();
+ DECL_LINK( SearchStringTimeout, Timer* );
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ 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 );
+ void ImplDoPaint( const Rectangle& rRect, bool bLayout = false );
+ void ImplCalcMetrics();
+ void ImplUpdateEntryMetrics( ImplEntryType& rEntry );
+ void ImplCallSelect();
void ImplShowFocusRect();
void ImplHideFocusRect();
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
public:
virtual void FillLayoutData() const;
@@ -287,293 +287,288 @@ public:
ImplListBoxWindow( Window* pParent, WinBits nWinStyle );
~ImplListBoxWindow();
- ImplEntryList* GetEntryList() const { return mpEntryList; }
+ ImplEntryList* GetEntryList() const { return mpEntryList; }
- sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry );
- void RemoveEntry( sal_uInt16 nPos );
- void Clear();
- void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
- sal_uInt16 GetCurrentPos() const { return mnCurrentPos; }
- sal_uInt16 GetDisplayLineCount() const;
- void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ USHORT InsertEntry( USHORT nPos, ImplEntryType* pNewEntry );
+ void RemoveEntry( USHORT nPos );
+ void Clear();
+ void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
+ USHORT GetCurrentPos() const { return mnCurrentPos; }
+ USHORT GetDisplayLineCount() const;
+ void SetEntryFlags( USHORT nPos, long nFlags );
- void DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
+ void DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
- void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
- void DeselectAll();
- sal_uInt16 GetEntryPosForPoint( const Point& rPoint ) const;
- sal_uInt16 GetLastVisibleEntry() const;
+ void SelectEntry( USHORT nPos, BOOL bSelect );
+ void DeselectAll();
+ USHORT GetEntryPosForPoint( const Point& rPoint ) const;
+ USHORT GetLastVisibleEntry() const;
- sal_Bool ProcessKeyInput( const KeyEvent& rKEvt );
+ BOOL ProcessKeyInput( const KeyEvent& rKEvt );
- void SetTopEntry( sal_uInt16 nTop );
- sal_uInt16 GetTopEntry() const { return mnTop; }
+ void SetTopEntry( USHORT nTop );
+ USHORT 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( sal_uInt16 nEntryPos );
+ void ShowProminentEntry( USHORT nEntryPos );
void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
ProminentEntry GetProminentEntryType() const { return meProminentType; }
using Window::IsVisible;
- sal_Bool IsVisible( sal_uInt16 nEntry ) const;
+ BOOL IsVisible( USHORT nEntry ) const;
- long GetLeftIndent() const { return mnLeft; }
- void SetLeftIndent( long n );
- void ScrollHorz( long nDiff );
+ long GetLeftIndent() const { return mnLeft; }
+ void SetLeftIndent( long n );
+ void ScrollHorz( long nDiff );
- void AllowGrabFocus( sal_Bool b ) { mbGrabFocus = b; }
- sal_Bool IsGrabFocusAllowed() const { return mbGrabFocus; }
+ void AllowGrabFocus( BOOL b ) { mbGrabFocus = b; }
+ BOOL IsGrabFocusAllowed() const { return mbGrabFocus; }
- void SetSeparatorPos( sal_uInt16 n ) { mnSeparatorPos = n; }
- sal_uInt16 GetSeparatorPos() const { return mnSeparatorPos; }
+ void SetSeparatorPos( USHORT n ) { mnSeparatorPos = n; }
+ USHORT GetSeparatorPos() const { return mnSeparatorPos; }
- void SetTravelSelect( sal_Bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
- sal_Bool IsTravelSelect() const { return mbTravelSelect; }
- sal_Bool IsTrackingSelect() const { return mbTrackingSelect; }
+ void SetTravelSelect( BOOL bTravelSelect ) { mbTravelSelect = bTravelSelect; }
+ BOOL IsTravelSelect() const { return mbTravelSelect; }
+ BOOL IsTrackingSelect() const { return mbTrackingSelect; }
- void SetUserItemSize( const Size& rSz );
- const Size& GetUserItemSize() const { return maUserItemSize; }
+ void SetUserItemSize( const Size& rSz );
+ const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
- sal_Bool IsMultiSelectionEnabled() const { return mbMulti; }
+ void EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
+ BOOL IsMultiSelectionEnabled() const { return mbMulti; }
- void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { mbSimpleMode = bSimple; }
- sal_Bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
+ void SetMultiSelectionSimpleMode( BOOL bSimple ) { mbSimpleMode = bSimple; }
+ BOOL IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
- void EnableMouseMoveSelect( sal_Bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
- sal_Bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
- sal_Bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
+ void EnableMouseMoveSelect( BOOL bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
+ BOOL IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
+ BOOL IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
- Size CalcSize( sal_uInt16 nMaxLines ) const;
- Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
+ Size CalcSize( USHORT nMaxLines ) const;
+ Rectangle GetBoundingRectangle( USHORT nItem ) const;
- long GetEntryHeight() const { return mnMaxHeight; }
- long GetMaxEntryWidth() const { return mnMaxWidth; }
+ long GetEntryHeight() const { return mnMaxHeight; }
+ long GetMaxEntryWidth() const { return mnMaxWidth; }
- void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; }
- const Link& GetScrollHdl() const { return maScrollHdl; }
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
- void SetCancelHdl( const Link& rLink ) { maCancelHdl = rLink; }
- const Link& GetCancelHdl() const { return maCancelHdl; }
- void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
- const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
- void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
- const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
- void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
- const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
+ void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; }
+ const Link& GetScrollHdl() const { return maScrollHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetCancelHdl( const Link& rLink ) { maCancelHdl = rLink; }
+ const Link& GetCancelHdl() const { return maCancelHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
+ const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
+ void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
+ const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
- sal_Bool IsSelectionChanged() const { return mbSelectionChanged; }
- sal_uInt16 GetSelectModifier() const { return mnSelectModifier; }
+ BOOL IsSelectionChanged() const { return mbSelectionChanged; }
+ USHORT GetSelectModifier() const { return mnSelectModifier; }
- void EnableSort( sal_Bool b ) { mbSort = b; }
+ void EnableSort( BOOL b ) { mbSort = b; }
- void SetReadOnly( sal_Bool bReadOnly ) { mbReadOnly = bReadOnly; }
- sal_Bool IsReadOnly() const { return mbReadOnly; }
+ void SetReadOnly( BOOL bReadOnly ) { mbReadOnly = bReadOnly; }
+ BOOL IsReadOnly() const { return mbReadOnly; }
using Control::ImplInitSettings;
- void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- sal_uInt16 ImplGetTextStyle() const;
+ void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ USHORT ImplGetTextStyle() const;
// pb: #106948# explicit mirroring for calc
- 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 );
+ inline void EnableMirroring() { mbMirroring = TRUE; }
+ inline BOOL IsMirroring() const { return mbMirroring; }
};
// ---------------
// - ImplListBox -
// ---------------
-
+
class ImplListBox : public Control
{
private:
- ImplListBoxWindow maLBWindow;
- ScrollBar* mpHScrollBar;
- ScrollBar* mpVScrollBar;
- ScrollBarBox* mpScrollBarBox;
- 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.
+ ImplListBoxWindow maLBWindow;
+ ScrollBar* mpHScrollBar;
+ ScrollBar* mpVScrollBar;
+ ScrollBarBox* mpScrollBarBox;
+ 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.
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
protected:
- virtual void GetFocus();
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void GetFocus();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- long Notify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
- void ImplResizeControls();
- void ImplCheckScrollBars();
- void ImplInitScrollBars();
+ void ImplResizeControls();
+ void ImplCheckScrollBars();
+ void ImplInitScrollBars();
- DECL_LINK( ScrollBarHdl, ScrollBar* );
- DECL_LINK( LBWindowScrolled, void* );
- DECL_LINK( MRUChanged, void* );
+ DECL_LINK( ScrollBarHdl, ScrollBar* );
+ DECL_LINK( LBWindowScrolled, void* );
+ DECL_LINK( MRUChanged, void* );
public:
ImplListBox( Window* pParent, WinBits nWinStyle );
~ImplListBox();
- const ImplEntryList* GetEntryList() const { return maLBWindow.GetEntryList(); }
- ImplListBoxWindow* GetMainWindow() { return &maLBWindow; }
+ const ImplEntryList* GetEntryList() const { return maLBWindow.GetEntryList(); }
+ ImplListBoxWindow* GetMainWindow() { return &maLBWindow; }
- virtual void Resize();
+ virtual void Resize();
virtual const Wallpaper& GetDisplayBackground() const;
virtual Window* GetPreferredKeyInputWindow();
- 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();
+ 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 ); }
+ void Clear();
- void SetEntryFlags( sal_uInt16 nPos, long nFlags );
- long GetEntryFlags( sal_uInt16 nPos ) const;
+ void SetEntryFlags( USHORT nPos, long nFlags );
+ long GetEntryFlags( USHORT nPos ) const;
- void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
- void SetNoSelection();
- void ResetCurrentPos() { maLBWindow.ResetCurrentPos(); }
- sal_uInt16 GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
+ void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SetNoSelection();
+ void ResetCurrentPos() { maLBWindow.ResetCurrentPos(); }
+ USHORT GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
- sal_Bool ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
- sal_Bool HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
+ BOOL ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
+ BOOL HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
- void SetSeparatorPos( sal_uInt16 n ) { maLBWindow.SetSeparatorPos( n ); }
- sal_uInt16 GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
+ void SetSeparatorPos( USHORT n ) { maLBWindow.SetSeparatorPos( n ); }
+ USHORT GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
- void SetTopEntry( sal_uInt16 nTop ) { maLBWindow.SetTopEntry( nTop ); }
- sal_uInt16 GetTopEntry() const { return maLBWindow.GetTopEntry(); }
- void ShowProminentEntry( sal_uInt16 nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
+ void SetTopEntry( USHORT nTop ) { maLBWindow.SetTopEntry( nTop ); }
+ USHORT GetTopEntry() const { return maLBWindow.GetTopEntry(); }
+ void ShowProminentEntry( USHORT nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
using Window::IsVisible;
- sal_Bool IsVisible( sal_uInt16 nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
+ BOOL IsVisible( USHORT 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( sal_uInt16 n ) { maLBWindow.SetLeftIndent( n ); }
- void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); }
-
- void SetTravelSelect( sal_Bool bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
- sal_Bool IsTravelSelect() const { return maLBWindow.IsTravelSelect(); }
- sal_Bool IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); }
-
- void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
- sal_Bool IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
-
- void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
- sal_Bool IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
-
- void SetReadOnly( sal_Bool b ) { maLBWindow.SetReadOnly( b ); }
- sal_Bool IsReadOnly() const { return maLBWindow.IsReadOnly(); }
-
-
- Size CalcSize( sal_uInt16 nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
- long GetEntryHeight() const { return maLBWindow.GetEntryHeight(); }
- long GetMaxEntryWidth() const { return maLBWindow.GetMaxEntryWidth(); }
-
- void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; }
- const Link& GetScrollHdl() const { return maScrollHdl; }
- void SetSelectHdl( const Link& rLink ) { maLBWindow.SetSelectHdl( rLink ); }
- const Link& GetSelectHdl() const { return maLBWindow.GetSelectHdl(); }
- void SetCancelHdl( const Link& rLink ) { maLBWindow.SetCancelHdl( rLink ); }
- const Link& GetCancelHdl() const { return maLBWindow.GetCancelHdl(); }
- void SetDoubleClickHdl( const Link& rLink ) { maLBWindow.SetDoubleClickHdl( rLink ); }
- const Link& GetDoubleClickHdl() const { return maLBWindow.GetDoubleClickHdl(); }
- void SetUserDrawHdl( const Link& rLink ) { maLBWindow.SetUserDrawHdl( rLink ); }
- const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); }
-
- void SetSelectionChangedHdl( const Link& rLnk ) { maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); }
- 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( sal_uInt16 n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
- sal_uInt16 GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
- sal_uInt16 GetDisplayLineCount() const
+ long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); }
+ void SetLeftIndent( USHORT 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 EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
+ BOOL IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
+
+ void SetMultiSelectionSimpleMode( BOOL bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
+ BOOL IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
+
+ void SetReadOnly( BOOL b ) { maLBWindow.SetReadOnly( b ); }
+ BOOL IsReadOnly() const { return maLBWindow.IsReadOnly(); }
+
+
+ Size CalcSize( USHORT nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
+ long GetEntryHeight() const { return maLBWindow.GetEntryHeight(); }
+ long GetMaxEntryWidth() const { return maLBWindow.GetMaxEntryWidth(); }
+
+ void SetScrollHdl( const Link& rLink ) { maScrollHdl = rLink; }
+ const Link& GetScrollHdl() const { return maScrollHdl; }
+ void SetSelectHdl( const Link& rLink ) { maLBWindow.SetSelectHdl( rLink ); }
+ const Link& GetSelectHdl() const { return maLBWindow.GetSelectHdl(); }
+ void SetCancelHdl( const Link& rLink ) { maLBWindow.SetCancelHdl( rLink ); }
+ const Link& GetCancelHdl() const { return maLBWindow.GetCancelHdl(); }
+ void SetDoubleClickHdl( const Link& rLink ) { maLBWindow.SetDoubleClickHdl( rLink ); }
+ const Link& GetDoubleClickHdl() const { return maLBWindow.GetDoubleClickHdl(); }
+ void SetUserDrawHdl( const Link& rLink ) { maLBWindow.SetUserDrawHdl( rLink ); }
+ 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 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
{ return maLBWindow.GetDisplayLineCount(); }
// pb: #106948# explicit mirroring for calc
- inline void EnableMirroring() { maLBWindow.EnableMirroring(); }
+ inline void EnableMirroring() { maLBWindow.EnableMirroring(); }
inline void SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; }
};
// -----------------------------
// - ImplListBoxFloatingWindow -
// -----------------------------
-
+
class ImplListBoxFloatingWindow : public FloatingWindow
{
private:
- ImplListBox* mpImplLB;
- Size maPrefSz;
- sal_uInt16 mnDDLineCount;
- sal_uInt16 mnPopupModeStartSaveSelection;
- sal_Bool mbAutoWidth;
+ ImplListBox* mpImplLB;
+ Size maPrefSz;
+ USHORT mnDDLineCount;
+ USHORT mnPopupModeStartSaveSelection;
+ BOOL mbAutoWidth;
protected:
- long PreNotify( NotifyEvent& rNEvt );
+ long PreNotify( NotifyEvent& rNEvt );
public:
ImplListBoxFloatingWindow( Window* pParent );
- void SetImplListBox( ImplListBox* pLB ) { mpImplLB = pLB; }
+ void SetImplListBox( ImplListBox* pLB ) { mpImplLB = pLB; }
- void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; }
- const Size& GetPrefSize() const { return maPrefSz; }
+ void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; }
+ const Size& GetPrefSize() const { return maPrefSz; }
- void SetAutoWidth( sal_Bool b ) { mbAutoWidth = b; }
- sal_Bool IsAutoWidth() const { return mbAutoWidth; }
+ void SetAutoWidth( BOOL b ) { mbAutoWidth = b; }
+ BOOL IsAutoWidth() const { return mbAutoWidth; }
- Size CalcFloatSize();
- void StartFloat( sal_Bool bStartTracking );
+ Size CalcFloatSize();
+ void StartFloat( BOOL bStartTracking );
- 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 )
+ virtual void SetPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
- void SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; }
- sal_uInt16 GetDropDownLineCount() const { return mnDDLineCount; }
+ void SetDropDownLineCount( USHORT n ) { mnDDLineCount = n; }
+ USHORT GetDropDownLineCount() const { return mnDDLineCount; }
- sal_uInt16 GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
+ USHORT GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
- virtual void Resize();
+ virtual void Resize();
};
// -----------
// - ImplWin -
// -----------
-
+
class ImplWin : public Control
{
private:
- sal_uInt16 mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
- XubString maString;
- Image maImage;
+ USHORT mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
+ XubString maString;
+ Image maImage;
+ Image maImageHC;
- Rectangle maFocusRect;
- Size maUserItemSize;
+ Rectangle maFocusRect;
+ Size maUserItemSize;
- Link maMBDownHdl;
- Link maUserDrawHdl;
+ Link maMBDownHdl;
+ Link maUserDrawHdl;
- sal_Bool mbUserDrawEnabled : 1,
- mbInUserDraw : 1;
+ BOOL mbUserDrawEnabled : 1,
+ mbInUserDraw : 1;
void ImplDraw( bool bLayout = false );
@@ -584,40 +579,40 @@ public:
ImplWin( Window* pParent, WinBits nWinStyle = 0 );
~ImplWin() {};
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Resize();
- virtual void GetFocus();
- virtual void LoseFocus();
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
virtual long PreNotify( NotifyEvent& rNEvt );
- sal_uInt16 GetItemPos() const { return mnItemPos; }
- void SetItemPos( sal_uInt16 n ) { mnItemPos = n; }
+ USHORT GetItemPos() const { return mnItemPos; }
+ void SetItemPos( USHORT n ) { mnItemPos = n; }
const XubString& GetString() const { return maString; }
- void SetString( const XubString& rStr ) { maString = rStr; }
+ void SetString( const XubString& rStr ) { maString = rStr; }
- const Image& GetImage() const { return maImage; }
- void SetImage( const Image& rImg ) { maImage = rImg; }
+ const Image& GetImage() const { return maImage; }
+ void SetImage( const Image& rImg ) { maImage = rImg; }
- sal_Bool SetModeImage( const Image& rImage );
- const Image& GetModeImage( ) const;
+ BOOL SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Image& GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
- virtual void MBDown();
- void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
- const Link& GetMBDownHdl() const { return maMBDownHdl; }
+ virtual void MBDown();
+ void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
+ const Link& GetMBDownHdl() const { return maMBDownHdl; }
- void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
- const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
+ void SetUserDrawHdl( const Link& rLink ) { maUserDrawHdl = rLink; }
+ const Link& GetUserDrawHdl() const { return maUserDrawHdl; }
- void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
- const Size& GetUserItemSize() const { return maUserItemSize; }
+ void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
+ const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
+ void DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
};
// -----------
@@ -627,25 +622,25 @@ public:
class ImplBtn : public PushButton
{
private:
- sal_Bool mbDown;
+ BOOL mbDown;
- Link maMBDownHdl;
+ Link maMBDownHdl;
public:
ImplBtn( Window* pParent, WinBits nWinStyle = 0 );
~ImplBtn() {};
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MBDown();
- void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
- const Link& GetMBDownHdl() const { return maMBDownHdl; }
+ virtual void MBDown();
+ void SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
+ const Link& GetMBDownHdl() const { return maMBDownHdl; }
};
-void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground );
void ImplInitDropDownButton( PushButton* pButton );
-#endif // _SV_ILSTBOX_HXX
+#endif // _SV_ILSTBOX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/image.h b/vcl/inc/vcl/image.h
index 86f924993ed3..0234d57f6811 100644
--- a/vcl/inc/vcl/image.h
+++ b/vcl/inc/vcl/image.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,7 @@
#include <vcl/bitmapex.hxx>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
// ----------------
// - ImplImageBmp -
@@ -44,34 +44,34 @@ public:
ImplImageBmp();
~ImplImageBmp();
- void Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize );
- void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,sal_uInt16 nInitSize );
+ void Create( long nItemWidth, long nItemHeight, USHORT nInitSize );
+ void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,USHORT nInitSize );
- void Expand( sal_uInt16 nGrowSize );
+ void Expand( USHORT nGrowSize );
- 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 Replace( USHORT nPos, USHORT nSrcPos );
+ void Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT nSrcPos );
+ void Replace( USHORT nPos, const BitmapEx& rBmpEx );
- void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uIntPtr nColorCount );
- void ColorTransform();
- void Invert();
+ void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount );
+ void ColorTransform( BmpColorMode eColorMode );
+ void Invert();
- BitmapEx GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const;
+ BitmapEx GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const;
- void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize = NULL );
+ void Draw( USHORT nPos, OutputDevice* pDev, const Point& rPos, USHORT nStyle, const Size* pSize = NULL );
private:
- BitmapEx maBmpEx;
- BitmapEx maDisabledBmpEx;
- BitmapEx* mpDisplayBmp;
- Size maSize;
- sal_uInt8* mpInfoAry;
- sal_uInt16 mnSize;
+ BitmapEx maBmpEx;
+ BitmapEx maDisabledBmpEx;
+ BitmapEx* mpDisplayBmp;
+ Size maSize;
+ BYTE* mpInfoAry;
+ USHORT mnSize;
- void ImplUpdateDisplayBmp( OutputDevice* pOutDev );
- void ImplUpdateDisabledBmpEx( int nPos );
+ void ImplUpdateDisplayBmp( OutputDevice* pOutDev );
+ void ImplUpdateDisabledBmpEx( int nPos );
private: // prevent assignment and copy construction
ImplImageBmp( const ImplImageBmp& );
@@ -90,21 +90,21 @@ enum ImageType { IMAGETYPE_BITMAP, IMAGETYPE_IMAGE };
struct ImageAryData
{
- ::rtl::OUString maName;
+ ::rtl::OUString maName;
// Images identified by either name, or by id
- sal_uInt16 mnId;
+ USHORT mnId;
BitmapEx maBitmapEx;
ImageAryData();
ImageAryData( const rtl::OUString &aName,
- sal_uInt16 nId, const BitmapEx &aBitmap );
+ USHORT nId, const BitmapEx &aBitmap );
ImageAryData( const ImageAryData& rData );
~ImageAryData();
bool IsLoadable() { return maBitmapEx.IsEmpty() && maName.getLength(); }
void Load(const rtl::OUString &rPrefix);
- ImageAryData& operator=( const ImageAryData& rData );
+ ImageAryData& operator=( const ImageAryData& rData );
};
// ------------------------------------------------------------------------------
@@ -112,23 +112,23 @@ struct ImageAryData
struct ImplImageList
{
typedef std::vector<ImageAryData *> ImageAryDataVec;
- typedef boost::unordered_map< rtl::OUString, ImageAryData *, rtl::OUStringHash >
+ typedef std::hash_map< rtl::OUString, ImageAryData *, rtl::OUStringHash >
ImageAryDataNameHash;
ImageAryDataVec maImages;
ImageAryDataNameHash maNameHash;
rtl::OUString maPrefix;
- Size maImageSize;
- sal_uIntPtr mnRefCount;
+ Size maImageSize;
+ ULONG mnRefCount;
ImplImageList();
ImplImageList( const ImplImageList &aSrc );
~ImplImageList();
void AddImage( const ::rtl::OUString &aName,
- sal_uInt16 nId, const BitmapEx &aBitmapEx );
- void RemoveImage( sal_uInt16 nPos );
- sal_uInt16 GetImageCount() const;
+ USHORT nId, const BitmapEx &aBitmapEx );
+ void RemoveImage( USHORT nPos );
+ USHORT GetImageCount() const;
};
// --------------------
@@ -137,13 +137,13 @@ struct ImplImageList
struct ImplImageRefData
{
- ImplImageList* mpImplData;
- sal_uInt16 mnIndex;
+ ImplImageList* mpImplData;
+ USHORT mnIndex;
- ImplImageRefData() {} // Um Warning zu umgehen
+ ImplImageRefData() {} // Um Warning zu umgehen
~ImplImageRefData();
- sal_Bool IsEqual( const ImplImageRefData& rData );
+ BOOL IsEqual( const ImplImageRefData& rData );
};
// ----------------
@@ -152,13 +152,13 @@ struct ImplImageRefData
struct ImplImageData
{
- ImplImageBmp* mpImageBitmap;
- BitmapEx maBmpEx;
+ ImplImageBmp* mpImageBitmap;
+ BitmapEx maBmpEx;
ImplImageData( const BitmapEx& rBmpEx );
~ImplImageData();
- sal_Bool IsEqual( const ImplImageData& rData );
+ BOOL IsEqual( const ImplImageData& rData );
};
// -------------
@@ -167,10 +167,10 @@ struct ImplImageData
struct ImplImage
{
- sal_uIntPtr mnRefCount;
+ ULONG mnRefCount;
// TODO: use inheritance to get rid of meType+mpData
- void* mpData;
- ImageType meType;
+ void* mpData;
+ ImageType meType;
ImplImage();
~ImplImage();
diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index d536d6bd03d7..600e86ecf652 100644
--- a/vcl/inc/vcl/image.hxx
+++ b/vcl/inc/vcl/image.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,8 +46,8 @@ namespace com { namespace sun { namespace star { namespace graphic { class XGrap
// - Defines -
// -----------
-#define IMAGE_STDBTN_COLOR Color( 0xC0, 0xC0, 0xC0 )
-#define IMAGELIST_IMAGE_NOTFOUND ((sal_uInt16)0xFFFF)
+#define IMAGE_STDBTN_COLOR Color( 0xC0, 0xC0, 0xC0 )
+#define IMAGELIST_IMAGE_NOTFOUND ((USHORT)0xFFFF)
// -----------------------
// - ImageColorTransform -
@@ -81,24 +81,24 @@ public:
Image( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic );
~Image();
- Size GetSizePixel() const;
+ Size GetSizePixel() const;
- BitmapEx GetBitmapEx() const;
+ BitmapEx GetBitmapEx() const;
::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, sal_uLong& rColorCount );
+ static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount );
void Invert();
- sal_Bool operator!() const { return( !mpImplData ? true : false ); }
- Image& operator=( const Image& rImage );
- sal_Bool operator==( const Image& rImage ) const;
- sal_Bool operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
+ 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 )); }
private:
- ImplImage* mpImplData;
+ ImplImage* mpImplData;
SAL_DLLPRIVATE void ImplInit( const BitmapEx& rBmpEx );
};
@@ -110,7 +110,7 @@ private:
class VCL_DLLPUBLIC ImageList
{
public:
- ImageList( sal_uInt16 nInit = 8, sal_uInt16 nGrow = 4 );
+ ImageList( USHORT nInit = 8, USHORT nGrow = 4 );
ImageList( const ResId& rResId );
ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
const ::rtl::OUString& rPrefix,
@@ -118,64 +118,64 @@ public:
ImageList( const ImageList& rImageList );
~ImageList();
- void Clear();
- void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
+ void Clear();
+ void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector );
- void InsertFromHorizontalBitmap( const ResId& rResId,
- sal_uInt16 nCount,
+ void InsertFromHorizontalBitmap( const ResId& rResId,
+ USHORT nCount,
const Color *pNonAlphaMaskColor,
const Color *pSearchColors = NULL,
const Color *pReplaceColors = NULL,
- sal_uLong nColorCount = 0);
- BitmapEx GetAsHorizontalStrip() const;
- sal_uInt16 GetImageCount() const;
- Size GetImageSize() const;
+ ULONG nColorCount = 0);
+ BitmapEx GetAsHorizontalStrip() const;
+ USHORT GetImageCount() const;
+ Size GetImageSize() const;
- void AddImage( sal_uInt16 nNewId, const Image& rImage );
- void AddImage( const ::rtl::OUString& rImageName, const Image& rImage );
+ void AddImage( USHORT nNewId, const Image& rImage );
+ void AddImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( sal_uInt16 nId, const Image& rImage );
- void ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage );
+ void ReplaceImage( USHORT nId, const Image& rImage );
+ void ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId );
- void ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName );
+ void ReplaceImage( USHORT nId, USHORT nReplaceId );
+ void ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName );
- void RemoveImage( sal_uInt16 nId );
- void RemoveImage( const ::rtl::OUString& rImageName );
+ void RemoveImage( USHORT nId );
+ void RemoveImage( const ::rtl::OUString& rImageName );
- Image GetImage( sal_uInt16 nId ) const;
- Image GetImage( const ::rtl::OUString& rImageName ) const;
+ Image GetImage( USHORT nId ) const;
+ Image GetImage( 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 GetImagePos( USHORT nId ) const;
+ bool HasImageAtPos( USHORT nId ) const;
+ USHORT GetImagePos( const ::rtl::OUString& rImageName ) const;
- sal_uInt16 GetImageId( sal_uInt16 nPos ) const;
- void GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const;
+ USHORT GetImageId( USHORT nPos ) const;
+ void GetImageIds( ::std::vector< USHORT >& rIds ) const;
- ::rtl::OUString GetImageName( sal_uInt16 nPos ) const;
- void GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const;
+ ::rtl::OUString GetImageName( USHORT nPos ) const;
+ void GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const;
- ImageList& operator=( const ImageList& rImageList );
- sal_Bool operator==( const ImageList& rImageList ) const;
- sal_Bool operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
+ ImageList& operator=( const ImageList& rImageList );
+ BOOL operator==( const ImageList& rImageList ) const;
+ BOOL operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
private:
- ImplImageList* mpImplData;
- sal_uInt16 mnInitSize;
- sal_uInt16 mnGrowSize;
+ ImplImageList* mpImplData;
+ USHORT mnInitSize;
+ USHORT 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( sal_uInt16 nItems, const Size &rSize );
- SAL_DLLPRIVATE sal_uInt16 ImplGetImageId( const ::rtl::OUString& rImageName ) const;
+ SAL_DLLPRIVATE void ImplInit( USHORT nItems, const Size &rSize );
+ SAL_DLLPRIVATE USHORT ImplGetImageId( const ::rtl::OUString& rImageName ) const;
SAL_DLLPRIVATE void ImplMakeUnique();
};
-#endif // _SV_IMAGE_HXX
+#endif // _SV_IMAGE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/imagerepository.hxx b/vcl/inc/vcl/imagerepository.hxx
index 8f963fb51edc..a9009df3dd29 100644
--- a/vcl/inc/vcl/imagerepository.hxx
+++ b/vcl/inc/vcl/imagerepository.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,12 +59,7 @@ namespace vcl
static bool loadImage(
const ::rtl::OUString& _rName,
BitmapEx& _out_rImage,
- bool bSearchLanguageDependent,
- bool loadMissing = false
- );
-
- static bool loadDefaultImage(
- BitmapEx& _out_rImage
+ bool bSearchLanguageDependent
);
};
diff --git a/vcl/inc/vcl/imgctrl.hxx b/vcl/inc/vcl/imgctrl.hxx
index ec8ed99c93bb..c72743397f05 100644
--- a/vcl/inc/vcl/imgctrl.hxx
+++ b/vcl/inc/vcl/imgctrl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,29 +41,30 @@
class VCL_DLLPUBLIC ImageControl : public FixedImage
{
private:
+ BitmapEx maBmp;
+ BitmapEx maBmpHC;
::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 Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Resize();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
virtual void Paint( const Rectangle& rRect );
virtual void GetFocus();
virtual void LoseFocus();
-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;
+ void SetBitmap( const BitmapEx& rBmp );
+ using OutputDevice::GetBitmap;
+ const BitmapEx& GetBitmap() const { return maBmp; }
+ BOOL SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const BitmapEx& GetModeBitmap( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
};
-#endif // _SV_IMGCTRL_HXX
+#endif // _SV_IMGCTRL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/impbmp.hxx b/vcl/inc/vcl/impbmp.hxx
index c77e906bd8ae..fedf9a11a993 100644
--- a/vcl/inc/vcl/impbmp.hxx
+++ b/vcl/inc/vcl/impbmp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@ struct BitmapBuffer;
class SalBitmap;
class BitmapPalette;
class SalGraphics;
-class ImplServerBitmap;
+class ImplServerBitmap;
class Bitmap;
class OutputDevice;
class Color;
@@ -50,11 +50,11 @@ class ImpBitmap
{
private:
- sal_uLong mnRefCount;
- sal_uLong mnChecksum;
- SalBitmap* mpSalBitmap;
- Size maSourceSize;
-
+ ULONG mnRefCount;
+ ULONG mnChecksum;
+ SalBitmap* mpSalBitmap;
+ Size maSourceSize;
+
public:
ImpBitmap();
@@ -64,34 +64,34 @@ public:
public:
- void ImplSetSalBitmap( SalBitmap* pSalBitmap );
- SalBitmap* ImplGetSalBitmap() const { return mpSalBitmap; }
+ void ImplSetSalBitmap( SalBitmap* pSalBitmap );
+ SalBitmap* ImplGetSalBitmap() const { return mpSalBitmap; }
public:
- 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&);
- sal_uInt16 ImplGetBitCount() const;
-
- BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly );
- void ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
-
-public:
-
- sal_uLong ImplGetRefCount() const { return mnRefCount; }
- void ImplIncRefCount() { mnRefCount++; }
- void ImplDecRefCount() { mnRefCount--; }
-
- inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
- inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
+ 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 );
+
+ void ImplDestroy();
+
+ Size ImplGetSize() const;
+ Size ImplGetSourceSize() const;
+ void ImplSetSourceSize( const Size&);
+ USHORT ImplGetBitCount() const;
+
+ BitmapBuffer* ImplAcquireBuffer( BOOL bReadOnly );
+ void ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly );
+
+public:
+
+ ULONG ImplGetRefCount() const { return mnRefCount; }
+ void ImplIncRefCount() { mnRefCount++; }
+ void ImplDecRefCount() { mnRefCount--; }
+
+ inline void ImplSetChecksum( ULONG nChecksum ) { mnChecksum = nChecksum; }
+ inline ULONG ImplGetChecksum() const { return mnChecksum; }
#endif // PRIVATE
};
diff --git a/vcl/inc/vcl/wpropset.hxx b/vcl/inc/vcl/impbmpconv.hxx
index ac0f98fd3525..b949ea898c3f 100644
--- a/vcl/inc/vcl/wpropset.hxx
+++ b/vcl/inc/vcl/impbmpconv.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -26,42 +26,15 @@
*
************************************************************************/
-#ifndef VCL_WPROPSET_HXX
-#define VCL_WPROPSET_HXX
-
-#include "vcl/dllapi.h"
-
-#include "tools/link.hxx"
-#include "vcl/arrange.hxx"
+#ifndef _VCL_IMPBMPCONV_HXX_
+#define _VCL_IMPBMPCONV_HXX_
-#include "com/sun/star/beans/XPropertySet.hpp"
-
-class VclWindowEvent;
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/uno/Reference.hxx>
namespace vcl
{
- 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;
- };
+com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
}
#endif
diff --git a/vcl/inc/vcl/impdel.hxx b/vcl/inc/vcl/impdel.hxx
index 90ab82bd1878..5e39eff5541e 100644
--- a/vcl/inc/vcl/impdel.hxx
+++ b/vcl/inc/vcl/impdel.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,14 +28,14 @@
#ifndef _VCL_IMPDEL_HXX
#define _VCL_IMPDEL_HXX
-
+
#include <list>
-
+
namespace vcl
{
-
+
class DeletionListener;
-
+
class DeletionNotifier
{
std::list< DeletionListener* > m_aListeners;
@@ -44,23 +44,23 @@
~DeletionNotifier()
{ notifyDelete(); }
-
+
inline void notifyDelete();
- public:
+ public:
void addDel( DeletionListener* pListener )
{ m_aListeners.push_back( pListener ); }
-
+
void removeDel( DeletionListener* pListener )
{ m_aListeners.remove( pListener ); }
};
-
+
class DeletionListener
{
- DeletionNotifier* m_pNotifier;
+ DeletionNotifier* m_pNotifier;
public:
DeletionListener( DeletionNotifier* pNotifier )
- : m_pNotifier( pNotifier )
+ : m_pNotifier( pNotifier )
{
if( m_pNotifier )
m_pNotifier->addDel( this );
@@ -79,12 +79,12 @@
for( std::list< DeletionListener* >::const_iterator it =
m_aListeners.begin(); it != m_aListeners.end(); ++it )
(*it)->deleted();
-
+
m_aListeners.clear();
}
-
+
} // namespace vcl
-
+
#endif // _VCL_IMPDEL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index 40355af21518..b7a0368f89bf 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,38 +59,38 @@ private:
friend class Font;
void AskConfig();
- int mnRefCount;
- String maFamilyName;
- String maStyleName;
- Size maSize;
- Color maColor; // compatibility, now on output device
- Color maFillColor; // compatibility, now on output device
- rtl_TextEncoding meCharSet;
- LanguageType meLanguage;
- LanguageType meCJKLanguage;
- FontFamily meFamily;
- FontPitch mePitch;
- TextAlign meAlign;
- FontWeight meWeight;
- FontWidth meWidthType;
- FontItalic meItalic;
- FontUnderline meUnderline;
- FontUnderline meOverline;
- FontStrikeout meStrikeout;
- FontRelief meRelief;
- FontEmphasisMark meEmphasisMark;
- FontType meType; // used by metrics only
- short mnOrientation;
- FontKerning mnKerning;
- sal_Bool mbWordLine:1,
+ int mnRefCount;
+ String maFamilyName;
+ String maStyleName;
+ Size maSize;
+ Color maColor; // compatibility, now on output device
+ Color maFillColor; // compatibility, now on output device
+ rtl_TextEncoding meCharSet;
+ LanguageType meLanguage;
+ LanguageType meCJKLanguage;
+ FontFamily meFamily;
+ FontPitch mePitch;
+ TextAlign meAlign;
+ FontWeight meWeight;
+ FontWidth meWidthType;
+ FontItalic meItalic;
+ FontUnderline meUnderline;
+ FontUnderline meOverline;
+ FontStrikeout meStrikeout;
+ FontRelief meRelief;
+ FontEmphasisMark meEmphasisMark;
+ FontType meType; // used by metrics only
+ short mnOrientation;
+ FontKerning mnKerning;
+ BOOL mbWordLine:1,
mbOutline:1,
mbConfigLookup:1, // there was a config lookup
mbShadow:1,
mbVertical:1,
- mbTransparent:1; // compatibility, now on output device
+ mbTransparent:1; // compatibility, now on output device
- friend SvStream& operator>>( SvStream& rIStm, Impl_Font& );
- friend SvStream& operator<<( SvStream& rOStm, const Impl_Font& );
+ friend SvStream& operator>>( SvStream& rIStm, Impl_Font& );
+ friend SvStream& operator<<( SvStream& rOStm, const Impl_Font& );
};
// ------------------
@@ -108,8 +108,8 @@ private:
long mnExtLeading; // External Leading
long mnLineHeight; // Ascent+Descent+EmphasisMark
long mnSlant; // Slant
- sal_uInt16 mnMiscFlags; // Misc Flags
- sal_uInt32 mnRefCount; // Reference Counter
+ USHORT mnMiscFlags; // Misc Flags
+ UINT32 mnRefCount; // Reference Counter
enum { DEVICE_FLAG=1, SCALABLE_FLAG=2, LATIN_FLAG=4, CJK_FLAG=8, CTL_FLAG=16 };
@@ -135,7 +135,7 @@ public:
};
// ------------------
-// - ImplFontOptions -
+// - ImplFontHints -
// ------------------
class ImplFontOptions
@@ -148,26 +148,25 @@ public:
FontHintStyle meHintStyle; // type of font hinting to be used
public:
ImplFontOptions() :
- meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
- meAntiAlias(ANTIALIAS_DONTKNOW),
- meAutoHint(AUTOHINT_DONTKNOW),
- meHinting(HINTING_DONTKNOW),
+ meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
+ meAntiAlias(ANTIALIAS_DONTKNOW),
+ meAutoHint(AUTOHINT_DONTKNOW),
+ meHinting(HINTING_DONTKNOW),
meHintStyle(HINT_SLIGHT)
{}
- virtual ~ImplFontOptions()
+ ImplFontOptions( FontEmbeddedBitmap eEmbeddedBitmap, FontAntiAlias eAntiAlias,
+ FontAutoHint eAutoHint, FontHinting eHinting, FontHintStyle eHintStyle) :
+ meEmbeddedBitmap(eEmbeddedBitmap),
+ meAntiAlias(eAntiAlias),
+ meAutoHint(eAutoHint),
+ meHinting(eHinting),
+ meHintStyle(eHintStyle)
{}
- FontAutoHint GetUseAutoHint() const
- { return meAutoHint; }
- FontHintStyle GetHintStyle() const
- { return meHintStyle; }
- bool DontUseEmbeddedBitmaps() const
- { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
- bool DontUseAntiAlias() const
- { return meAntiAlias == ANTIALIAS_FALSE; }
- bool DontUseHinting() const
- { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
- virtual void *GetPattern(void * /*pFace*/, bool /*bEmbolden*/) const
- { return NULL; }
+ FontAutoHint GetUseAutoHint() const { return meAutoHint; }
+ FontHintStyle GetHintStyle() const { return meHintStyle; }
+ bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
+ bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
+ bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
};
// -------------------
@@ -176,7 +175,7 @@ public:
class CmapResult;
-class VCL_PLUGIN_PUBLIC ImplFontCharMap
+class VCL_DLLPUBLIC ImplFontCharMap
{
public:
explicit ImplFontCharMap( const CmapResult& );
@@ -198,8 +197,8 @@ public:
int GetIndexFromChar( sal_uInt32 ) const;
sal_uInt32 GetCharFromIndex( int ) const;
- void AddReference() const;
- void DeReference() const;
+ void AddReference();
+ void DeReference();
int GetGlyphIndex( sal_uInt32 ) const;
@@ -213,26 +212,30 @@ private:
private:
const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1)
const int* mpStartGlyphs; // range-specific mapper to glyphs
- const sal_uInt16* mpGlyphIds; // individual glyphid mappings
+ const USHORT* mpGlyphIds; // individual glyphid mappings
int mnRangeCount;
- int mnCharCount; // covered codepoints
- mutable int mnRefCount;
+ int mnCharCount;
+ int mnRefCount;
};
// CmapResult is a normalized version of the many CMAP formats
-class VCL_PLUGIN_PUBLIC CmapResult
+class
+#ifdef UNX
+ VCL_DLLPUBLIC // vcl-plugins need it
+#endif // UNX
+CmapResult
{
public:
- explicit CmapResult( bool bSymbolic = false,
+ explicit CmapResult( bool bSymbolic = false,
const sal_uInt32* pRangeCodes = NULL, int nRangeCount = 0,
- const int* pStartGlyphs = 0, const sal_uInt16* pGlyphIds = NULL );
+ const int* pStartGlyphs = 0, const USHORT* pGlyphIds = NULL );
const sal_uInt32* mpRangeCodes;
const int* mpStartGlyphs;
- const sal_uInt16* mpGlyphIds;
- int mnRangeCount;
- bool mbSymbolic;
- bool mbRecoded;
+ const USHORT* mpGlyphIds;
+ int mnRangeCount;
+ bool mbSymbolic;
+ bool mbRecoded;
};
bool ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& );
diff --git a/vcl/inc/vcl/impgraph.hxx b/vcl/inc/vcl/impgraph.hxx
index 22c409fb476a..fc6b12a7e863 100644
--- a/vcl/inc/vcl/impgraph.hxx
+++ b/vcl/inc/vcl/impgraph.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,17 +42,17 @@
struct ImpSwapInfo
{
- MapMode maPrefMapMode;
- Size maPrefSize;
+ MapMode maPrefMapMode;
+ Size maPrefSize;
};
// --------------
// - ImpGraphic -
// --------------
-class OutputDevice;
-class GfxLink;
-struct ImpSwapFile;
+class OutputDevice;
+class GfxLink;
+struct ImpSwapFile;
class GraphicConversionParameters;
class ImpGraphic
@@ -61,20 +61,20 @@ class ImpGraphic
private:
- GDIMetaFile maMetaFile;
- BitmapEx maEx;
- ImpSwapInfo maSwapInfo;
- Animation* mpAnimation;
- GraphicReader* mpContext;
- ImpSwapFile* mpSwapFile;
- GfxLink* mpGfxLink;
- GraphicType meType;
- String maDocFileURLStr;
- sal_uLong mnDocFilePos;
- mutable sal_uLong mnSizeBytes;
- sal_uLong mnRefCount;
- sal_Bool mbSwapOut;
- sal_Bool mbSwapUnderway;
+ GDIMetaFile maMetaFile;
+ BitmapEx maEx;
+ ImpSwapInfo maSwapInfo;
+ Animation* mpAnimation;
+ GraphicReader* mpContext;
+ ImpSwapFile* mpSwapFile;
+ GfxLink* mpGfxLink;
+ GraphicType meType;
+ String maDocFileURLStr;
+ ULONG mnDocFilePos;
+ mutable ULONG mnSizeBytes;
+ ULONG mnRefCount;
+ BOOL mbSwapOut;
+ BOOL mbSwapUnderway;
private:
@@ -84,94 +84,94 @@ private:
ImpGraphic( const BitmapEx& rBmpEx );
ImpGraphic( const Animation& rAnimation );
ImpGraphic( const GDIMetaFile& rMtf );
- virtual ~ImpGraphic();
-
- ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
- sal_Bool operator==( const ImpGraphic& rImpGraphic ) const;
- sal_Bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
+ virtual ~ImpGraphic();
- void ImplClearGraphics( sal_Bool bCreateSwapInfo );
- void ImplClear();
+ ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
+ BOOL operator==( const ImpGraphic& rImpGraphic ) const;
+ BOOL operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
- GraphicType ImplGetType() const;
- void ImplSetDefaultType();
- sal_Bool ImplIsSupportedGraphic() const;
+ void ImplClearGraphics( BOOL bCreateSwapInfo );
+ void ImplClear();
- sal_Bool ImplIsTransparent() const;
- sal_Bool ImplIsAlpha() const;
- sal_Bool ImplIsAnimated() const;
+ GraphicType ImplGetType() const;
+ void ImplSetDefaultType();
+ BOOL ImplIsSupportedGraphic() const;
- Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
- BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
- Animation ImplGetAnimation() const;
- const GDIMetaFile& ImplGetGDIMetaFile() const;
+ BOOL ImplIsTransparent() const;
+ BOOL ImplIsAlpha() const;
+ BOOL ImplIsAnimated() const;
- Size ImplGetPrefSize() const;
- void ImplSetPrefSize( const Size& rPrefSize );
+ Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
+ BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
+ Animation ImplGetAnimation() const;
+ const GDIMetaFile& ImplGetGDIMetaFile() const;
- MapMode ImplGetPrefMapMode() const;
- void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
+ Size ImplGetPrefSize() const;
+ void ImplSetPrefSize( const Size& rPrefSize );
+
+ MapMode ImplGetPrefMapMode() const;
+ void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
- sal_uLong ImplGetSizeBytes() const;
+ ULONG ImplGetSizeBytes() const;
- void ImplDraw( OutputDevice* pOutDev,
+ void ImplDraw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
- void ImplDraw( OutputDevice* pOutDev,
- const Point& rDestPt,
+ void ImplDraw( OutputDevice* pOutDev,
+ const Point& rDestPt,
const Size& rDestSize ) const;
- void ImplStartAnimation( OutputDevice* pOutDev,
+ void ImplStartAnimation( OutputDevice* pOutDev,
const Point& rDestPt,
long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
- void ImplStartAnimation( OutputDevice* pOutDev,
+ void ImplStartAnimation( OutputDevice* pOutDev,
const Point& rDestPt,
- const Size& rDestSize,
+ const Size& rDestSize,
long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
- void ImplStopAnimation( OutputDevice* pOutputDevice = NULL,
+ void ImplStopAnimation( OutputDevice* pOutputDevice = NULL,
long nExtraData = 0 );
- void ImplSetAnimationNotifyHdl( const Link& rLink );
- Link ImplGetAnimationNotifyHdl() const;
+ void ImplSetAnimationNotifyHdl( const Link& rLink );
+ Link ImplGetAnimationNotifyHdl() const;
- sal_uLong ImplGetAnimationLoopCount() const;
- void ImplResetAnimationLoopCount();
+ ULONG ImplGetAnimationLoopCount() const;
+ void ImplResetAnimationLoopCount();
- List* ImplGetAnimationInfoList() const;
+ List* ImplGetAnimationInfoList() const;
private:
- GraphicReader* ImplGetContext();
- void ImplSetContext( GraphicReader* pReader );
+ GraphicReader* ImplGetContext();
+ void ImplSetContext( GraphicReader* pReader );
private:
- void ImplSetDocFileName( const String& rName, sal_uLong nFilePos );
- const String& ImplGetDocFileName() const;
- sal_uLong ImplGetDocFilePos() const;
+ void ImplSetDocFileName( const String& rName, ULONG nFilePos );
+ const String& ImplGetDocFileName() const;
+ ULONG ImplGetDocFilePos() const;
- sal_Bool ImplReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
- sal_Bool ImplWriteEmbedded( SvStream& rOStream );
+ BOOL ImplReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
+ BOOL ImplWriteEmbedded( SvStream& rOStream );
- sal_Bool ImplSwapIn();
- sal_Bool ImplSwapIn( SvStream* pIStm );
+ BOOL ImplSwapIn();
+ BOOL ImplSwapIn( SvStream* pIStm );
- sal_Bool ImplSwapOut();
- sal_Bool ImplSwapOut( SvStream* pOStm );
+ BOOL ImplSwapOut();
+ BOOL ImplSwapOut( SvStream* pOStm );
- sal_Bool ImplIsSwapOut() const;
+ BOOL ImplIsSwapOut() const;
- void ImplSetLink( const GfxLink& );
- GfxLink ImplGetLink();
- sal_Bool ImplIsLink() const;
+ void ImplSetLink( const GfxLink& );
+ GfxLink ImplGetLink();
+ BOOL ImplIsLink() const;
- sal_uLong ImplGetChecksum() const;
+ ULONG ImplGetChecksum() const;
- sal_Bool ImplExportNative( SvStream& rOStm ) const;
+ BOOL ImplExportNative( SvStream& rOStm ) const;
- friend SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic );
- friend SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic );
+ friend SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic );
+ friend SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic );
};
#endif // _SV_IMPGRAPH_HXX
diff --git a/vcl/inc/vcl/impimagetree.hxx b/vcl/inc/vcl/impimagetree.hxx
index 41c4f565ef22..8b694eb8625b 100644
--- a/vcl/inc/vcl/impimagetree.hxx
+++ b/vcl/inc/vcl/impimagetree.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#include <utility>
#include <vector>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include "boost/noncopyable.hpp"
#include "com/sun/star/uno/Reference.hxx"
@@ -58,11 +58,7 @@ public:
bool loadImage(
rtl::OUString const & name, rtl::OUString const & style,
- BitmapEx & bitmap, bool localized = false, bool loadMissing = false );
-
- bool loadDefaultImage(
- rtl::OUString const & style,
- BitmapEx& bitmap);
+ BitmapEx & bitmap, bool localized = false );
void shutDown();
// a crude form of life cycle control (called from DeInitVCL; otherwise,
@@ -70,19 +66,15 @@ public:
// be too late for the destructors of the bitmaps in m_iconCache)
private:
- bool doLoadImage(
- rtl::OUString const & name, rtl::OUString const & style,
- BitmapEx & bitmap, bool localized);
-
typedef std::list<
std::pair<
rtl::OUString,
com::sun::star::uno::Reference<
com::sun::star::container::XNameAccess > > > Zips;
- typedef boost::unordered_map<
+ typedef std::hash_map<
rtl::OUString, bool, rtl::OUStringHash > CheckStyleCache;
- typedef boost::unordered_map<
+ typedef std::hash_map<
rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > IconCache;
rtl::OUString m_style;
diff --git a/vcl/inc/vcl/impoct.hxx b/vcl/inc/vcl/impoct.hxx
index daf6a275ada1..6437027db402 100644
--- a/vcl/inc/vcl/impoct.hxx
+++ b/vcl/inc/vcl/impoct.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,28 +37,28 @@
class ImpErrorQuad
{
- long nRed;
- long nGreen;
- long nBlue;
- long nReserved;
-
-public:
-
- inline ImpErrorQuad() {}
- inline ImpErrorQuad( const BitmapColor& rColor ) :
- nRed ( (long) rColor.GetRed() << 5L ),
- nGreen ( (long) rColor.GetGreen() << 5L ),
- nBlue ( (long) rColor.GetBlue() << 5L ) {}
-
- inline void operator=( const BitmapColor& rColor );
- inline ImpErrorQuad& operator-=( const BitmapColor& rColor );
-
- inline void ImplAddColorError1( const ImpErrorQuad& rErrQuad );
- inline void ImplAddColorError3( const ImpErrorQuad& rErrQuad );
- inline void ImplAddColorError5( const ImpErrorQuad& rErrQuad );
- inline void ImplAddColorError7( const ImpErrorQuad& rErrQuad );
-
- inline BitmapColor ImplGetColor();
+ long nRed;
+ long nGreen;
+ long nBlue;
+ long nReserved;
+
+public:
+
+ inline ImpErrorQuad() {}
+ inline ImpErrorQuad( const BitmapColor& rColor ) :
+ nRed ( (long) rColor.GetRed() << 5L ),
+ nGreen ( (long) rColor.GetGreen() << 5L ),
+ nBlue ( (long) rColor.GetBlue() << 5L ) {}
+
+ inline void operator=( const BitmapColor& rColor );
+ inline ImpErrorQuad& operator-=( const BitmapColor& rColor );
+
+ inline void ImplAddColorError1( const ImpErrorQuad& rErrQuad );
+ inline void ImplAddColorError3( const ImpErrorQuad& rErrQuad );
+ inline void ImplAddColorError5( const ImpErrorQuad& rErrQuad );
+ inline void ImplAddColorError7( const ImpErrorQuad& rErrQuad );
+
+ inline BitmapColor ImplGetColor();
};
// ------------------------------------------------------------------------
@@ -121,9 +121,9 @@ inline void ImpErrorQuad::ImplAddColorError7( const ImpErrorQuad& rErrQuad )
inline BitmapColor ImpErrorQuad::ImplGetColor()
{
- 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 ) );
+ 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 ) );
}
// -------------
@@ -132,19 +132,19 @@ inline BitmapColor ImpErrorQuad::ImplGetColor()
class ImpNodeCache
{
- OctreeNode* pActNode;
- sal_uLong nNew;
- sal_uLong nDelete;
- sal_uLong nGet;
- sal_uLong nRelease;
-
-public:
-
- ImpNodeCache( const sal_uLong nInitSize );
+ OctreeNode* pActNode;
+ ULONG nNew;
+ ULONG nDelete;
+ ULONG nGet;
+ ULONG nRelease;
+
+public:
+
+ ImpNodeCache( const ULONG nInitSize );
~ImpNodeCache();
- inline OctreeNode* ImplGetFreeNode();
- inline void ImplReleaseNode( OctreeNode* pNode );
+ inline OctreeNode* ImplGetFreeNode();
+ inline void ImplReleaseNode( OctreeNode* pNode );
};
// ------------------------------------------------------------------------
diff --git a/vcl/inc/vcl/inputctx.hxx b/vcl/inc/vcl/inputctx.hxx
index eaaec5e7bd1d..474d84c85d34 100644
--- a/vcl/inc/vcl/inputctx.hxx
+++ b/vcl/inc/vcl/inputctx.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,10 +37,10 @@
// - InputContext-Flags -
// ----------------------
-#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)
+#define INPUTCONTEXT_TEXT ((ULONG)0x00000001)
+#define INPUTCONTEXT_EXTTEXTINPUT ((ULONG)0x00000002)
+#define INPUTCONTEXT_EXTTEXTINPUT_ON ((ULONG)0x00000004)
+#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((ULONG)0x00000008)
// ----------------
// - InputContext -
@@ -49,41 +49,41 @@
class VCL_DLLPUBLIC InputContext
{
private:
- Font maFont;
- sal_uLong mnOptions;
+ Font maFont;
+ ULONG mnOptions;
public:
InputContext() { mnOptions = 0; }
InputContext( const InputContext& rInputContext ) :
maFont( rInputContext.maFont )
{ mnOptions = rInputContext.mnOptions; }
- InputContext( const Font& rFont, sal_uLong nOptions = 0 ) :
+ InputContext( const Font& rFont, ULONG nOptions = 0 ) :
maFont( rFont )
{ mnOptions = nOptions; }
- void SetFont( const Font& rFont ) { maFont = rFont; }
- const Font& GetFont() const { return maFont; }
+ void SetFont( const Font& rFont ) { maFont = rFont; }
+ const Font& GetFont() const { return maFont; }
- void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; }
- sal_uLong GetOptions() const { return mnOptions; }
+ void SetOptions( ULONG nOptions ) { mnOptions = nOptions; }
+ ULONG GetOptions() const { return mnOptions; }
- InputContext& operator=( const InputContext& rInputContext );
- sal_Bool operator==( const InputContext& rInputContext ) const;
- sal_Bool operator!=( const InputContext& rInputContext ) const
+ InputContext& operator=( const InputContext& rInputContext );
+ BOOL operator==( const InputContext& rInputContext ) const;
+ BOOL operator!=( const InputContext& rInputContext ) const
{ return !(InputContext::operator==( rInputContext )); }
};
inline InputContext& InputContext::operator=( const InputContext& rInputContext )
{
- maFont = rInputContext.maFont;
- mnOptions = rInputContext.mnOptions;
+ maFont = rInputContext.maFont;
+ mnOptions = rInputContext.mnOptions;
return *this;
}
-inline sal_Bool InputContext::operator==( const InputContext& rInputContext ) const
+inline BOOL InputContext::operator==( const InputContext& rInputContext ) const
{
- return ((mnOptions == rInputContext.mnOptions) &&
- (maFont == rInputContext.maFont));
+ return ((mnOptions == rInputContext.mnOptions) &&
+ (maFont == rInputContext.maFont));
}
#endif // _VCL_INPUTCTX_HXX
diff --git a/vcl/inc/vcl/introwin.hxx b/vcl/inc/vcl/introwin.hxx
index e5503bc5dfd6..128f7afae15a 100644
--- a/vcl/inc/vcl/introwin.hxx
+++ b/vcl/inc/vcl/introwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx
index a7b39d0bff8f..413e0cf14fdf 100644
--- a/vcl/inc/vcl/javachild.hxx
+++ b/vcl/inc/vcl/javachild.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,10 +44,12 @@ public:
JavaChildWindow( Window* pParent, const ResId& rResId );
~JavaChildWindow();
- sal_IntPtr getParentWindowHandleForJava();
+ sal_IntPtr getParentWindowHandleForJava();
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 7517b41ef03c..baefe2ac4819 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,7 +51,6 @@ 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;
@@ -66,17 +65,14 @@ struct JobData
m_nColorDepth( 24 ),
m_nPSLevel( 0 ),
m_nColorDevice( 0 ),
- m_nPDFDevice( 0 ),
m_eOrientation( orientation::Portrait ),
m_pParser( NULL ) {}
JobData& operator=(const psp::JobData& rRight);
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 b1cbdb9853f9..096f31020f5b 100644
--- a/vcl/inc/vcl/jobset.h
+++ b/vcl/inc/vcl/jobset.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,7 +32,7 @@
#include <tools/string.hxx>
#include <vcl/sv.h>
#include <vcl/prntypes.hxx>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <rtl/ustring.hxx>
// ------------------
@@ -40,11 +40,11 @@
// ------------------
// see com.sun.star.portal.client.JobSetupSystem.idl:
-#define JOBSETUP_SYSTEM_DONTKNOW 0
-#define JOBSETUP_SYSTEM_WINDOWS 1
-#define JOBSETUP_SYSTEM_OS2 2
-#define JOBSETUP_SYSTEM_UNIX 3
-#define JOBSETUP_SYSTEM_MAC 4
+#define JOBSETUP_SYSTEM_DONTKNOW 0
+#define JOBSETUP_SYSTEM_WINDOWS 1
+#define JOBSETUP_SYSTEM_OS2 2
+#define JOBSETUP_SYSTEM_UNIX 3
+#define JOBSETUP_SYSTEM_MAC 4
#define JOBSETUP_SYSTEM_JAVA 5
// ----------------
@@ -53,19 +53,19 @@
struct ImplJobSetup
{
- 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
+ USHORT mnRefCount; // RefCount (only independ data)
+ USHORT mnSystem; // Sytem - JOBSETUP_SYSTEM_xxxx
+ String maPrinterName; // Printer-Name
+ String maDriver; // Driver-Name
+ Orientation meOrientation; // Orientation
DuplexMode meDuplexMode; // Duplex
- sal_uInt16 mnPaperBin; // paper bin / in tray
- Paper mePaperFormat; // paper format
- long mnPaperWidth; // paper width (100th mm)
- long mnPaperHeight; // paper height (100th mm)
- 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;
+ USHORT 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)
+ ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > maValueMap;
ImplJobSetup();
ImplJobSetup( const ImplJobSetup& rJobSetup );
@@ -77,6 +77,6 @@ struct ImplJobSetup
// Papierbreite/hoehe wird wenn 0 im unabhaengigen Teil automatisch aus
// Papierformat berechnet, wenn dieses ungleich PAPER_USER ist
-#endif // _SV_JOBSET_H
+#endif // _SV_JOBSET_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/jobset.hxx b/vcl/inc/vcl/jobset.hxx
index 0340f5dd8587..80f52d90068c 100644
--- a/vcl/inc/vcl/jobset.hxx
+++ b/vcl/inc/vcl/jobset.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,11 +46,11 @@ class VCL_DLLPUBLIC JobSetup
friend class Printer;
private:
- ImplJobSetup* mpData;
+ ImplJobSetup* mpData;
public:
- SAL_DLLPRIVATE ImplJobSetup* ImplGetData();
- SAL_DLLPRIVATE ImplJobSetup* ImplGetConstData();
+ SAL_DLLPRIVATE ImplJobSetup* ImplGetData();
+ SAL_DLLPRIVATE ImplJobSetup* ImplGetConstData();
SAL_DLLPRIVATE const ImplJobSetup* ImplGetConstData() const;
public:
@@ -58,27 +58,27 @@ public:
JobSetup( const JobSetup& rJob );
~JobSetup();
- String GetPrinterName() const;
- String GetDriverName() const;
+ String GetPrinterName() const;
+ String GetDriverName() const;
- /* Get/SetValue are used to read/store additional
- * Parameters in the job setup that may be used
- * by the printer driver. One possible use are phone
- * numbers for faxes (which disguise as printers)
+ /* Get/SetValue are used to read/store additional
+ * Parameters in the job setup that may be used
+ * by the printer driver. One possible use are phone
+ * numbers for faxes (which disguise as printers)
*/
- String GetValue( const String& rKey ) const;
- void SetValue( const String& rKey, const String& rValue );
+ String GetValue( const String& rKey ) const;
+ void SetValue( const String& rKey, const String& rValue );
- JobSetup& operator=( const JobSetup& rJob );
+ JobSetup& operator=( const JobSetup& rJob );
- sal_Bool operator==( const JobSetup& rJobSetup ) const;
- sal_Bool operator!=( const JobSetup& rJobSetup ) const
+ BOOL operator==( const JobSetup& rJobSetup ) const;
+ BOOL operator!=( const JobSetup& rJobSetup ) const
{ return !(JobSetup::operator==( rJobSetup )); }
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup );
};
-#endif // _SV_JOBSET_HXX
+#endif // _SV_JOBSET_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx
index b5be547b1781..c1792fd715ea 100644
--- a/vcl/inc/vcl/keycod.hxx
+++ b/vcl/inc/vcl/keycod.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,54 +63,54 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN,
class VCL_DLLPUBLIC KeyCode
{
private:
- sal_uInt16 nCode;
+ USHORT nCode;
KeyFuncType eFunc;
public:
KeyCode() { nCode = 0; eFunc = KEYFUNC_DONTKNOW; }
KeyCode( const ResId& rResId );
- KeyCode( sal_uInt16 nKey, sal_uInt16 nModifier = 0 )
+ KeyCode( USHORT nKey, USHORT nModifier = 0 )
{ nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
- KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 );
+ KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 );
KeyCode( KeyFuncType eFunction );
- sal_uInt16 GetFullCode() const { return nCode; }
- sal_uInt16 GetFullKeyCode() const { return (nCode) ; }
+ USHORT GetFullCode() const { return nCode; }
+ USHORT GetFullKeyCode() const { return (nCode) ; }
KeyFuncType GetFullFunction() const { return eFunc; }
- sal_Bool IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
+ BOOL IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
- sal_uInt16 GetCode() const
+ USHORT GetCode() const
{ return (nCode & KEY_CODE); }
- sal_uInt16 GetModifier() const
+ USHORT GetModifier() const
{ return (nCode & KEY_MODTYPE); }
- sal_uInt16 GetAllModifier() const
+ USHORT GetAllModifier() const
{ return (nCode & KEY_ALLMODTYPE); }
- sal_Bool IsShift() const
+ BOOL IsShift() const
{ return ((nCode & KEY_SHIFT) != 0); }
- sal_Bool IsMod1() const
+ BOOL IsMod1() const
{ return ((nCode & KEY_MOD1) != 0); }
- sal_Bool IsMod2() const
+ BOOL IsMod2() const
{ return ((nCode & KEY_MOD2) != 0); }
- sal_Bool IsMod3() const
- { return ((nCode & KEY_MOD3) != 0); }
- sal_uInt16 GetGroup() const
+ BOOL IsMod3() const
+ { return ((nCode & KEY_MOD3) != 0); }
+ USHORT GetGroup() const
{ return (nCode & KEYGROUP_TYPE); }
- XubString GetName( Window* pWindow = NULL ) const;
- XubString GetSymbolName( const XubString& rFontName, Window* pWindow = NULL ) const;
+ XubString GetName( Window* pWindow = NULL ) const;
+ XubString GetSymbolName( const XubString& rFontName, Window* pWindow = NULL ) const;
- sal_Bool IsFunction() const
- { return ((eFunc != KEYFUNC_DONTKNOW) ? sal_True : sal_False); }
+ BOOL IsFunction() const
+ { return ((eFunc != KEYFUNC_DONTKNOW) ? TRUE : FALSE); }
KeyFuncType GetFunction() const;
KeyCode& operator = ( const KeyCode& rKeyCode );
- sal_Bool operator ==( const KeyCode& rKeyCode ) const;
- sal_Bool operator !=( const KeyCode& rKeyCode ) const;
+ BOOL operator ==( const KeyCode& rKeyCode ) const;
+ BOOL operator !=( const KeyCode& rKeyCode ) const;
};
-inline KeyCode::KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 )
+inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 )
{
nCode = nKey;
if( bShift )
@@ -124,7 +124,7 @@ inline KeyCode::KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_B
eFunc = KEYFUNC_DONTKNOW;
}
-inline sal_Bool KeyCode::operator ==( const KeyCode& rKeyCode ) const
+inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode == rKeyCode.nCode);
@@ -132,7 +132,7 @@ inline sal_Bool KeyCode::operator ==( const KeyCode& rKeyCode ) const
return (GetFunction() == rKeyCode.GetFunction());
}
-inline sal_Bool KeyCode::operator !=( const KeyCode& rKeyCode ) const
+inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode != rKeyCode.nCode);
@@ -140,7 +140,7 @@ inline sal_Bool KeyCode::operator !=( const KeyCode& rKeyCode ) const
return (GetFunction() != rKeyCode.GetFunction());
}
-inline sal_Bool KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
+inline 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 9b4fc0893b34..41c21bc4d51d 100644
--- a/vcl/inc/vcl/keycodes.hxx
+++ b/vcl/inc/vcl/keycodes.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,139 +40,139 @@
// By changes you must also change: rsc/vclrsc.hxx
// Key-Gruppen
-#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)
+#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)
// Key-Codes
-#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)
+#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)
// Modifier-Tasten
-#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)
+#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)
// extended Modifier-Keys (only used for modkey events)
#define MODKEY_LSHIFT 0x0001
@@ -192,9 +192,9 @@
// - Mouse-Types -
// ---------------
-#define MOUSE_LEFT ((sal_uInt16)0x0001)
-#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
-#define MOUSE_RIGHT ((sal_uInt16)0x0004)
+#define MOUSE_LEFT ((USHORT)0x0001)
+#define MOUSE_MIDDLE ((USHORT)0x0002)
+#define MOUSE_RIGHT ((USHORT)0x0004)
// -------------------
// - Indicator-Types -
diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx
index e7edee035e4d..713e22ef022a 100644
--- a/vcl/inc/vcl/lazydelete.hxx
+++ b/vcl/inc/vcl/lazydelete.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,7 +32,7 @@
#include "dllapi.h"
#include <vector>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <algorithm>
#if OSL_DEBUG_LEVEL > 2
@@ -40,28 +40,26 @@
#include <stdio.h>
#endif
-#include <com/sun/star/lang/XComponent.hpp>
-
namespace vcl
{
/* Helpers for lazy object deletion
-
+
With vcl it is often necessary to delete objects (especially Windows)
in the right order as well as in a way ensuring that the deleted objects
are not still on the stack (e.g. deleting a Window in its key handler). To
make this easier a helper class is given here which takes care of both
sorting as well as lazy deletion.
-
+
The grisly details:
LazyDelete is a class that LazyDeletor register to. When vcl's event
loop (that is Application::Yield or Application::Reschedule) comes out
of the last level, the LazyDelete::flush is called. This will cause
LazyDelete to delete all registered LazyDeletor objects.
-
+
LazyDeletor<T> is a one instance object that contains a list of
<T> objects to be deleted in sorted order. It is derived from
LazyDeletorBase as to be able to register itself in LazyDelete.
-
+
The user calls the static method LazyDeletor<T>::Delete( T* ) with the
object to be destroyed lazy. The static method creates the LazyDeletor<T>
(which in turn registers itself in LazyDelete) if this is the first time
@@ -70,19 +68,19 @@ namespace vcl
that will ensure the correct order of deletion via the specialized is_less method
(e.g. if a Window is a child of another Window and therefore should be destroyed
first it is "less" in this sense)
-
+
LazyDelete::flush will be called when the top of the nested event loop is
reached again and will then destroy each registered LazyDeletor<T> which
in turn destroys the objects needed to be destroyed lazily. After this
the state is as before entering the event loop.
-
+
Preconditions:
- The class <T> of which objects are to be destroyed needs a virtual
destructor or must be final, else the wrong type will be destroyed.
- The destructor of <T> should call LazyDeletor<T>::Undelete( this ). This
prevents duplicate deletionin case someone destroys the object prematurely.
*/
-
+
class LazyDeletorBase;
class VCL_DLLPUBLIC LazyDelete
{
@@ -107,27 +105,27 @@ namespace vcl
class VCL_DLLPUBLIC LazyDeletor : public LazyDeletorBase
{
static LazyDeletor< T >* s_pOneInstance;
-
+
struct DeleteObjectEntry
{
T* m_pObject;
bool m_bDeleted;
-
+
DeleteObjectEntry() :
m_pObject( NULL ),
m_bDeleted( false )
{}
-
+
DeleteObjectEntry( T* i_pObject ) :
m_pObject( i_pObject ),
m_bDeleted( false )
{}
};
-
+
std::vector< DeleteObjectEntry > m_aObjects;
- typedef boost::unordered_map< sal_IntPtr, unsigned int > PtrToIndexMap;
+ typedef std::hash_map< sal_IntPtr, unsigned int > PtrToIndexMap;
PtrToIndexMap m_aPtrToIndex;
-
+
/** strict weak ordering funtion to bring objects to be destroyed lazily
in correct order, e.g. for Window objects children before parents
*/
@@ -142,7 +140,7 @@ namespace vcl
#endif
if( s_pOneInstance == this ) // sanity check
s_pOneInstance = NULL;
-
+
// do the actual work
unsigned int nCount = m_aObjects.size();
std::vector<T*> aRealDelete;
@@ -171,7 +169,7 @@ namespace vcl
delete aRealDelete[n];
}
}
-
+
public:
/** mark an object for lazy deletion
*/
@@ -205,7 +203,7 @@ namespace vcl
}
}
};
-
+
/*
class DeleteOnDeinit matches a similar need as LazyDelete for static objects:
you may not access vcl objects after DeInitVCL has been called this includes their destruction
@@ -213,36 +211,36 @@ namespace vcl
To work around this use DeleteOnDeinit<BitmapEx> which will allow you to have a static object container,
that will have its contents destroyed on DeinitVCL. The single drawback is that you need to check on the
container object whether it still contains content before actually accessing it.
-
+
caveat: when constructing a vcl object, you certainly want to ensure that InitVCL has run already.
However this is not necessarily the case when using a class static member or a file level static variable.
In these cases make judicious use of the set() method of DeleteOnDeinit, but beware of the changing
ownership.
-
+
example use case: use a lazy initialized on call BitmapEx in a paint method. Of course a paint method
would not normally be called after DeInitVCL anyway, so the check might not be necessary in a
Window::Paint implementation, but always checking is a good idea.
-
+
SomeWindow::Paint()
{
static vcl::DeleteOnDeinit< BitmapEx > aBmp( new BitmapEx( ResId( 1000, myResMgr ) ) );
-
+
if( aBmp.get() ) // check whether DeInitVCL has been called already
DrawBitmapEx( Point( 10, 10 ), *aBmp.get() );
}
*/
-
+
class VCL_DLLPUBLIC DeleteOnDeinitBase
{
public:
static void SAL_DLLPRIVATE ImplDeleteOnDeInit();
virtual ~DeleteOnDeinitBase();
protected:
- static void addDeinitContainer( DeleteOnDeinitBase* i_pContainer );
+ static void addDeinitContainer( DeleteOnDeinitBase* i_pContainer );
virtual void doCleanup() = 0;
};
-
+
template < typename T >
class DeleteOnDeinit : public DeleteOnDeinitBase
{
@@ -251,51 +249,14 @@ namespace vcl
public:
DeleteOnDeinit( T* i_pT ) : m_pT( i_pT ) { addDeinitContainer( this ); }
virtual ~DeleteOnDeinit() {}
-
+
// get contents
T* get() { return m_pT; }
-
+
// set contents, returning old contents
// 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 046257cbdd9f..333b61f9ca3f 100644
--- a/vcl/inc/vcl/lineinfo.hxx
+++ b/vcl/inc/vcl/lineinfo.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,24 +43,22 @@ namespace basegfx { class B2DPolyPolygon; }
struct ImplLineInfo
{
- sal_uLong mnRefCount;
- LineStyle meStyle;
- long mnWidth;
- sal_uInt16 mnDashCount;
- long mnDashLen;
- sal_uInt16 mnDotCount;
- long mnDotLen;
- long mnDistance;
-
+ ULONG mnRefCount;
+ LineStyle meStyle;
+ long mnWidth;
+ USHORT mnDashCount;
+ long mnDashLen;
+ USHORT mnDotCount;
+ long mnDotLen;
+ long mnDistance;
+
basegfx::B2DLineJoin meLineJoin;
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 );
+ friend SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo );
+ friend SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo );
};
// ------------
@@ -69,12 +67,12 @@ struct ImplLineInfo
class VCL_DLLPUBLIC LineInfo
{
-private:
+private:
- ImplLineInfo* mpImplLineInfo;
- long n1;
- long n2;
- long n3;
+ ImplLineInfo* mpImplLineInfo;
+ long n1;
+ long n2;
+ long n3;
SAL_DLLPRIVATE void ImplMakeUnique();
@@ -84,36 +82,36 @@ public:
LineInfo( const LineInfo& rLineInfo );
~LineInfo();
- LineInfo& operator=( const LineInfo& rLineInfo );
- 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 ); }
+ 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 ); }
void SetStyle( LineStyle eStyle );
- LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
+ LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
void SetWidth( long nWidth );
- long GetWidth() const { return mpImplLineInfo->mnWidth; }
+ long GetWidth() const { return mpImplLineInfo->mnWidth; }
- void SetDashCount( sal_uInt16 nDashCount );
- sal_uInt16 GetDashCount() const { return mpImplLineInfo->mnDashCount; }
+ void SetDashCount( USHORT nDashCount );
+ USHORT GetDashCount() const { return mpImplLineInfo->mnDashCount; }
- void SetDashLen( long nDashLen );
- long GetDashLen() const { return mpImplLineInfo->mnDashLen; }
+ void SetDashLen( long nDashLen );
+ long GetDashLen() const { return mpImplLineInfo->mnDashLen; }
- void SetDotCount( sal_uInt16 nDotCount );
- sal_uInt16 GetDotCount() const { return mpImplLineInfo->mnDotCount; }
+ void SetDotCount( USHORT nDotCount );
+ USHORT GetDotCount() const { return mpImplLineInfo->mnDotCount; }
- void SetDotLen( long nDotLen );
- long GetDotLen() const { return mpImplLineInfo->mnDotLen; }
+ void SetDotLen( long nDotLen );
+ long GetDotLen() const { return mpImplLineInfo->mnDotLen; }
- void SetDistance( long nDistance );
- long GetDistance() const { return mpImplLineInfo->mnDistance; }
+ void SetDistance( long nDistance );
+ long GetDistance() const { return mpImplLineInfo->mnDistance; }
void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
- sal_Bool IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
+ 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 ca4ebcadc77e..31c7752da3d4 100644
--- a/vcl/inc/vcl/longcurr.hxx
+++ b/vcl/inc/vcl/longcurr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,54 +42,54 @@ class LocaleDataWrapper;
class VCL_DLLPUBLIC LongCurrencyFormatter : public FormatterBase
{
private:
- SAL_DLLPRIVATE friend sal_Bool ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, sal_uInt16, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
+ SAL_DLLPRIVATE friend BOOL ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, USHORT, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
SAL_DLLPRIVATE void ImpInit();
protected:
- BigInt mnFieldValue;
- BigInt mnLastValue;
- BigInt mnMin;
- BigInt mnMax;
- BigInt mnCorrectedValue;
+ BigInt mnFieldValue;
+ BigInt mnLastValue;
+ BigInt mnMin;
+ BigInt mnMax;
+ BigInt mnCorrectedValue;
String maCurrencySymbol;
- sal_uInt16 mnType;
- sal_uInt16 mnDecimalDigits;
- sal_Bool mbThousandSep;
+ USHORT mnType;
+ USHORT mnDecimalDigits;
+ BOOL mbThousandSep;
LongCurrencyFormatter();
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
~LongCurrencyFormatter();
- virtual void Reformat();
- virtual void ReformatAll();
+ virtual void Reformat();
+ virtual void ReformatAll();
- void SetUseThousandSep( sal_Bool b );
- sal_Bool IsUseThousandSep() const { return mbThousandSep; }
+ void SetUseThousandSep( BOOL b );
+ BOOL IsUseThousandSep() const { return mbThousandSep; }
void SetCurrencySymbol( const String& rStr );
String GetCurrencySymbol() const;
- void SetMin( BigInt nNewMin );
- BigInt GetMin() const { return mnMin; }
- void SetMax( BigInt nNewMax );
- BigInt GetMax() const { return mnMax; }
+ void SetMin( BigInt nNewMin );
+ BigInt GetMin() const { return mnMin; }
+ void SetMax( BigInt nNewMax );
+ BigInt GetMax() const { return mnMax; }
- void SetDecimalDigits( sal_uInt16 nDigits );
- sal_uInt16 GetDecimalDigits() const;
- void SetValue( BigInt nNewValue );
- void SetUserValue( BigInt nNewValue );
- BigInt GetValue() const;
- sal_Bool IsValueModified() const;
+ void SetDecimalDigits( USHORT nDigits );
+ USHORT GetDecimalDigits() const;
+ void SetValue( BigInt nNewValue );
+ void SetUserValue( BigInt nNewValue );
+ BigInt GetValue() const;
+ BOOL IsValueModified() const;
- void SetEmptyValue();
- sal_Bool IsEmptyValue() const { return !GetField()->GetText().Len(); }
+ void SetEmptyValue();
+ BOOL IsEmptyValue() const { return !GetField()->GetText().Len(); }
- BigInt GetCorrectedValue() const { return mnCorrectedValue; }
+ BigInt GetCorrectedValue() const { return mnCorrectedValue; }
- BigInt Normalize( BigInt nValue ) const;
- BigInt Denormalize( BigInt nValue ) const;
+ BigInt Normalize( BigInt nValue ) const;
+ BigInt Denormalize( BigInt nValue ) const;
};
// ---------------------
@@ -101,9 +101,9 @@ class VCL_DLLPUBLIC LongCurrencyField : public SpinField, public LongCurrencyFor
friend void ImplNewLongCurrencyFieldValue( LongCurrencyField*, BigInt );
private:
- BigInt mnSpinSize;
- BigInt mnFirst;
- BigInt mnLast;
+ BigInt mnSpinSize;
+ BigInt mnFirst;
+ BigInt mnLast;
protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
@@ -113,21 +113,21 @@ public:
LongCurrencyField( Window* pParent, const ResId& rResId );
~LongCurrencyField();
- long PreNotify( NotifyEvent& rNEvt );
- long Notify( NotifyEvent& rNEvt );
-
- void Modify();
- void Up();
- void Down();
- void First();
- void Last();
-
- void SetFirst( BigInt nNewFirst ) { mnFirst = nNewFirst; }
- BigInt GetFirst() const { return mnFirst; }
- void SetLast( BigInt nNewLast ) { mnLast = nNewLast; }
- BigInt GetLast() const { return mnLast; }
- void SetSpinSize( BigInt nNewSize ) { mnSpinSize = nNewSize; }
- BigInt GetSpinSize() const { return mnSpinSize; }
+ long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
+
+ void Modify();
+ void Up();
+ void Down();
+ void First();
+ void Last();
+
+ void SetFirst( BigInt nNewFirst ) { mnFirst = nNewFirst; }
+ BigInt GetFirst() const { return mnFirst; }
+ void SetLast( BigInt nNewLast ) { mnLast = nNewLast; }
+ BigInt GetLast() const { return mnLast; }
+ void SetSpinSize( BigInt nNewSize ) { mnSpinSize = nNewSize; }
+ BigInt GetSpinSize() const { return mnSpinSize; }
};
// -------------------
@@ -141,19 +141,19 @@ public:
LongCurrencyBox( Window* pParent, const ResId& rResId );
~LongCurrencyBox();
- long PreNotify( NotifyEvent& rNEvt );
- long Notify( NotifyEvent& rNEvt );
+ long PreNotify( NotifyEvent& rNEvt );
+ long Notify( NotifyEvent& rNEvt );
- void Modify();
- void ReformatAll();
+ void Modify();
+ void ReformatAll();
- void InsertValue( BigInt nValue,
- sal_uInt16 nPos = COMBOBOX_APPEND );
- void RemoveValue( BigInt nValue );
- BigInt GetValue() const
+ void InsertValue( BigInt nValue,
+ USHORT nPos = COMBOBOX_APPEND );
+ void RemoveValue( BigInt nValue );
+ BigInt GetValue() const
{ return LongCurrencyFormatter::GetValue(); }
- BigInt GetValue( sal_uInt16 nPos ) const;
- sal_uInt16 GetValuePos( BigInt nValue ) const;
+ BigInt GetValue( USHORT nPos ) const;
+ USHORT GetValuePos( BigInt nValue ) const;
};
#endif // _LONGCURR_HXX
diff --git a/vcl/inc/vcl/lstbox.h b/vcl/inc/vcl/lstbox.h
index f4577dc1e718..1a4824ca23b2 100644
--- a/vcl/inc/vcl/lstbox.h
+++ b/vcl/inc/vcl/lstbox.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,11 +29,11 @@
#ifndef _SV_LSTBOX_H
#define _SV_LSTBOX_H
-#define LISTBOX_APPEND ((sal_uInt16)0xFFFF)
-#define LISTBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
-#define LISTBOX_ERROR ((sal_uInt16)0xFFFF)
+#define LISTBOX_APPEND ((USHORT)0xFFFF)
+#define LISTBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
+#define LISTBOX_ERROR ((USHORT)0xFFFF)
-#define LISTBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
+#define LISTBOX_USERDRAW_SELECTED ((USHORT)0x0001)
// --------------------------------------------------------------------
@@ -42,14 +42,14 @@
// !! Do not use these flags for user data as they are reserved !!
// !! to change the internal behaviour of the ListBox implementation !!
-// !! for specific entries. !!
+// !! for specific entries. !!
/** this flag disables a selection of an entry completly. It is not
possible to select such entries either from the user interface
nor from the ListBox methods. Cursor traveling is handled correctly.
This flag can be used to add titles to a ListBox.
*/
-#define LISTBOX_ENTRY_FLAG_DISABLE_SELECTION 0x0000001
+#define LISTBOX_ENTRY_FLAG_DISABLE_SELECTION 0x0000001
/** this flag can be used to make an entry multine capable
A normal entry is single line and will therefore be clipped
@@ -63,6 +63,6 @@
*/
#define LISTBOX_ENTRY_FLAG_DRAW_DISABLED 0x0000004
-#endif // _SV_LSTBOX_H
+#endif // _SV_LSTBOX_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index cc1d0615cb7b..0b0a69265a75 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,22 +40,22 @@ class ImplBtn;
class ImplWin;
// --------------------------------------------------------------------
-// - ListBox -
+// - ListBox -
// --------------------------------------------------------------------
class VCL_DLLPUBLIC ListBox : public Control
{
private:
- ImplListBox* mpImplLB;
- ImplListBoxFloatingWindow* mpFloatWin;
- ImplWin* mpImplWin;
- ImplBtn* mpBtn;
- sal_uInt16 mnDDHeight;
- sal_uInt16 mnSaveValue;
- sal_Bool mbDDAutoSize;
- Link maSelectHdl;
- Link maDoubleClickHdl;
- sal_uInt16 mnLineCount;
+ ImplListBox* mpImplLB;
+ ImplListBoxFloatingWindow* mpFloatWin;
+ ImplWin* mpImplWin;
+ ImplBtn* mpBtn;
+ USHORT mnDDHeight;
+ USHORT mnSaveValue;
+ BOOL mbDDAutoSize;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ USHORT 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 );
- sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
+ BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : FALSE; }
protected:
ListBox( WindowType nType );
@@ -86,66 +86,66 @@ public:
ListBox( Window* pParent, const ResId& rResId );
~ListBox();
- 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 );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
-
- virtual void Select();
- virtual void DoubleClick();
- virtual void GetFocus();
- virtual void LoseFocus();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Resize();
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void GetFocus();
+ virtual void LoseFocus();
virtual Window* GetPreferredKeyInputWindow();
virtual const Wallpaper& GetDisplayBackground() const;
- 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 )
+ virtual void SetPosSizePixel( long nX, long nY,
+ long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Control::SetPosSizePixel( rNewPos, rNewSize ); }
- void SetDropDownSizePixel( const Size& rNewSize )
+ void SetDropDownSizePixel( const Size& rNewSize )
{ if( IsDropDownBox() ) SetPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
- Rectangle GetDropDownPosSizePixel() const;
+ Rectangle GetDropDownPosSizePixel() const;
- void SetDropDownLineCount( sal_uInt16 nLines );
- sal_uInt16 GetDropDownLineCount() const;
+ void SetDropDownLineCount( USHORT nLines );
+ USHORT GetDropDownLineCount() const;
- void EnableAutoSize( sal_Bool bAuto );
- sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( BOOL bAuto );
+ BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( sal_Bool b );
- sal_Bool IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( BOOL b );
+ BOOL IsDDAutoWidthEnabled() const;
- 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( sal_uInt16 nPos );
+ 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 void RemoveEntry( const XubString& rStr );
+ virtual void RemoveEntry( USHORT nPos );
- virtual void Clear();
+ virtual void Clear();
- 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 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 void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True );
- virtual void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
+ virtual void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE );
+ virtual void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
- virtual sal_uInt16 GetSelectEntryCount() const;
- virtual XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const;
- virtual sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
+ virtual USHORT GetSelectEntryCount() const;
+ virtual XubString GetSelectEntry( USHORT nSelIndex = 0 ) const;
+ virtual USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
- virtual sal_Bool IsEntrySelected( const XubString& rStr ) const;
- virtual sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
- virtual void SetNoSelection();
+ virtual BOOL IsEntrySelected( const XubString& rStr ) const;
+ virtual BOOL IsEntryPosSelected( USHORT nPos ) const;
+ virtual void SetNoSelection();
- void SetEntryData( sal_uInt16 nPos, void* pNewData );
- void* GetEntryData( sal_uInt16 nPos ) const;
+ void SetEntryData( USHORT nPos, void* pNewData );
+ void* GetEntryData( USHORT nPos ) const;
/** this methods stores a combination of flags from the
LISTBOX_ENTRY_FLAG_* defines at the given entry.
@@ -155,71 +155,71 @@ public:
to change the internal behaviour of the ListBox implementation
for specific entries.
*/
- void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ void SetEntryFlags( USHORT 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( sal_uInt16 nPos ) const;
+ long GetEntryFlags( USHORT nPos ) const;
- void SetTopEntry( sal_uInt16 nPos );
- void ShowProminentEntry( sal_uInt16 nPos );
- void SetTopEntryStr( const XubString& rStr );
- sal_uInt16 GetTopEntry() const;
+ void SetTopEntry( USHORT nPos );
+ void ShowProminentEntry( USHORT nPos );
+ void SetTopEntryStr( const XubString& rStr );
+ USHORT GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
- void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
- sal_uInt16 GetSavedValue() const { return mnSaveValue; }
+ void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
+ USHORT GetSavedValue() const { return mnSaveValue; }
- void SetSeparatorPos( sal_uInt16 n );
- void SetSeparatorPos();
- sal_uInt16 GetSeparatorPos() const;
+ void SetSeparatorPos( USHORT n );
+ void SetSeparatorPos();
+ USHORT GetSeparatorPos() const;
- sal_Bool IsTravelSelect() const;
- sal_Bool IsInDropDown() const;
- void ToggleDropDown();
+ BOOL IsTravelSelect() const;
+ BOOL IsInDropDown() const;
+ void ToggleDropDown();
- void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection );
- void EnableMultiSelection( sal_Bool bMulti );
- sal_Bool IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( BOOL bMulti, BOOL bStackSelection );
+ void EnableMultiSelection( BOOL bMulti );
+ BOOL IsMultiSelectionEnabled() const;
- void SetReadOnly( sal_Bool bReadOnly = sal_True );
- sal_Bool IsReadOnly() const;
+ void SetReadOnly( BOOL bReadOnly = TRUE );
+ BOOL IsReadOnly() const;
- long CalcWindowSizePixel( sal_uInt16 nLines ) const;
- Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
+ long CalcWindowSizePixel( USHORT nLines ) const;
+ Rectangle GetBoundingRectangle( USHORT nItem ) const;
- void SetUserItemSize( const Size& rSz );
- const Size& GetUserItemSize() const;
+ void SetUserItemSize( const Size& rSz );
+ const Size& GetUserItemSize() const;
- void EnableUserDraw( sal_Bool bUserDraw );
- sal_Bool IsUserDrawEnabled() const;
+ void EnableUserDraw( BOOL bUserDraw );
+ BOOL IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
+ void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
- void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
- const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
- Size CalcMinimumSize() const;
+ Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- Size CalcAdjustedSize( const Size& rPrefSize ) const;
- Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
- void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
+ Size CalcAdjustedSize( const Size& rPrefSize ) const;
+ Size CalcSize( USHORT nColumns, USHORT nLines ) const;
+ void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
- void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
- XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( sal_uInt16 n );
- sal_uInt16 GetMaxMRUCount() const;
+ void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
+ XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
+ void SetMaxMRUCount( USHORT n );
+ USHORT GetMaxMRUCount() const;
- sal_uInt16 GetDisplayLineCount() const;
+ USHORT GetDisplayLineCount() const;
- void EnableMirroring();
+ void EnableMirroring();
/** checks whether a certain point lies within the bounds of
a listbox item and returns the item as well as the character position
@@ -240,7 +240,7 @@ public:
if no item is at that point.
*/
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
};
// ----------------
@@ -254,14 +254,14 @@ public:
using ListBox::GetSavedValue;
private:
// Bei MultiListBox nicht erlaubt...
- void SaveValue();
- sal_uInt16 GetSavedValue();
+ void SaveValue();
+ USHORT GetSavedValue();
public:
MultiListBox( Window* pParent, WinBits nStyle = 0 );
MultiListBox( Window* pParent, const ResId& rResId );
};
-#endif // _SV_LSTBOX_HXX
+#endif // _SV_LSTBOX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/mapmod.hxx b/vcl/inc/vcl/mapmod.hxx
index bf666bc782cb..6888595135a5 100644
--- a/vcl/inc/vcl/mapmod.hxx
+++ b/vcl/inc/vcl/mapmod.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,7 +34,7 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <tools/resid.hxx>
-#include <tools/mapunit.hxx>
+#include <vcl/mapunit.hxx>
class SvStream;
@@ -42,20 +42,20 @@ class SvStream;
// - ImplMapMode -
// --------------
-class OutputDevice;
+class OutputDevice;
class ImplMapMode
{
- friend class MapMode;
- friend class OutputDevice;
+ friend class MapMode;
+ friend class OutputDevice;
private:
- sal_uLong mnRefCount;
- MapUnit meUnit;
- Point maOrigin;
- Fraction maScaleX;
- Fraction maScaleY;
- sal_Bool mbSimple;
+ ULONG mnRefCount;
+ MapUnit meUnit;
+ Point maOrigin;
+ Fraction maScaleX;
+ Fraction maScaleY;
+ BOOL mbSimple;
friend SvStream& operator>>( SvStream& rIStm, ImplMapMode& rMapMode );
friend SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rMapMode );
@@ -72,10 +72,10 @@ public:
class VCL_DLLPUBLIC MapMode
{
- friend class OutputDevice;
+ friend class OutputDevice;
private:
- ImplMapMode* mpImplMapMode;
+ ImplMapMode* mpImplMapMode;
SAL_DLLPRIVATE void ImplMakeUnique();
@@ -87,33 +87,33 @@ public:
const Fraction& rScaleX, const Fraction& rScaleY );
~MapMode();
- void SetMapUnit( MapUnit eUnit );
- MapUnit GetMapUnit() const
+ void SetMapUnit( MapUnit eUnit );
+ MapUnit GetMapUnit() const
{ return mpImplMapMode->meUnit; }
- void SetOrigin( const Point& rOrigin );
- const Point& GetOrigin() const
+ void SetOrigin( const Point& rOrigin );
+ const Point& GetOrigin() const
{ return mpImplMapMode->maOrigin; }
- void SetScaleX( const Fraction& rScaleX );
+ void SetScaleX( const Fraction& rScaleX );
const Fraction& GetScaleX() const
{ return mpImplMapMode->maScaleX; }
- void SetScaleY( const Fraction& rScaleY );
+ void SetScaleY( const Fraction& rScaleY );
const Fraction& GetScaleY() const
{ return mpImplMapMode->maScaleY; }
- MapMode& operator=( const MapMode& rMapMode );
- sal_Bool operator==( const MapMode& rMapMode ) const;
- sal_Bool operator!=( const MapMode& rMapMode ) const
+ MapMode& operator=( const MapMode& rMapMode );
+ BOOL operator==( const MapMode& rMapMode ) const;
+ BOOL operator!=( const MapMode& rMapMode ) const
{ return !(MapMode::operator==( rMapMode )); }
- sal_Bool IsDefault() const;
- sal_Bool IsSameInstance( const MapMode& rMapMode ) const
+ BOOL IsDefault() const;
+ BOOL IsSameInstance( const MapMode& rMapMode ) const
{ return (mpImplMapMode == rMapMode.mpImplMapMode); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, MapMode& rMapMode );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const MapMode& rMapMode );
};
-#endif // _SV_MAPMOD_HXX
+#endif // _SV_MAPMOD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/mapunit.hxx b/vcl/inc/vcl/mapunit.hxx
new file mode 100644
index 000000000000..dfb5c121abd7
--- /dev/null
+++ b/vcl/inc/vcl/mapunit.hxx
@@ -0,0 +1,36 @@
+/* -*- 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 2712cefbb5d8..4351f1cd49a0 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -68,38 +68,38 @@ namespace vcl { struct MenuLayoutData; }
// - Menu-Types -
// --------------
-#define MENU_APPEND ((sal_uInt16)0xFFFF)
-#define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define MENU_APPEND ((USHORT)0xFFFF)
+#define MENU_ITEM_NOTFOUND ((USHORT)0xFFFF)
-#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_EXECUTE_DOWN ((USHORT)0x0001)
+#define POPUPMENU_EXECUTE_UP ((USHORT)0x0002)
+#define POPUPMENU_EXECUTE_LEFT ((USHORT)0x0004)
+#define POPUPMENU_EXECUTE_RIGHT ((USHORT)0x0008)
-#define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010)
+#define POPUPMENU_NOMOUSEUPCLOSE ((USHORT)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 sal_uInt16 MenuItemBits;
-#define MIB_CHECKABLE ((MenuItemBits)0x0001)
-#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
-#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
-#define MIB_ABOUT ((MenuItemBits)0x0008)
-#define MIB_HELP ((MenuItemBits)0x0010)
-#define MIB_POPUPSELECT ((MenuItemBits)0x0020)
+typedef USHORT MenuItemBits;
+#define MIB_CHECKABLE ((MenuItemBits)0x0001)
+#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
+#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
+#define MIB_ABOUT ((MenuItemBits)0x0008)
+#define MIB_HELP ((MenuItemBits)0x0010)
+#define MIB_POPUPSELECT ((MenuItemBits)0x0020)
// not in rsc/vclsrc.hxx because only a prelimitary solution
-#define MIB_NOSELECT ((MenuItemBits)0x0040)
-#define MIB_ICON ((MenuItemBits)0x0080)
-#define MIB_TEXT ((MenuItemBits)0x0100)
+#define MIB_NOSELECT ((MenuItemBits)0x0040)
+#define MIB_ICON ((MenuItemBits)0x0080)
+#define MIB_TEXT ((MenuItemBits)0x0100)
-#define MENU_FLAG_NOAUTOMNEMONICS 0x0001
-#define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002
+#define MENU_FLAG_NOAUTOMNEMONICS 0x0001
+#define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002
// overrides default hiding of disabled entries in popup menus
-#define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004
+#define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004
// forces images & toggle visibility for toolbar config popup
#define MENU_FLAG_SHOWCHECKIMAGES 0x0008
@@ -121,9 +121,9 @@ struct ImplMenuDelData
struct MenuLogo
{
- BitmapEx aBitmap;
- Color aStartColor;
- Color aEndColor;
+ BitmapEx aBitmap;
+ Color aStartColor;
+ Color aEndColor;
};
class VCL_DLLPUBLIC Menu : public Resource
@@ -135,209 +135,209 @@ class VCL_DLLPUBLIC Menu : public Resource
friend class SystemWindow;
friend struct ImplMenuDelData;
private:
- ImplMenuDelData* mpFirstDel;
- MenuItemList* pItemList; // Liste mit den MenuItems
- MenuLogo* pLogo;
- Menu* pStartedFrom;
- Window* pWindow;
-
- Link aActivateHdl; // Active-Handler
- Link aDeactivateHdl; // Deactivate-Handler
- Link aHighlightHdl; // Highlight-Handler
- Link aSelectHdl; // Highlight-Handler
-
+ ImplMenuDelData* mpFirstDel;
+ MenuItemList* pItemList; // Liste mit den MenuItems
+ MenuLogo* pLogo;
+ Menu* pStartedFrom;
+ Window* pWindow;
+
+ Link aActivateHdl; // Active-Handler
+ Link aDeactivateHdl; // Deactivate-Handler
+ Link aHighlightHdl; // Highlight-Handler
+ Link aSelectHdl; // Highlight-Handler
+
VclEventListeners maEventListeners;
VclEventListeners maChildEventListeners;
- XubString aTitleText; // PopupMenu-Text
+ XubString aTitleText; // PopupMenu-Text
- 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;
+ ULONG nEventId;
+ USHORT mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
+ USHORT nMenuFlags;
+ USHORT nDefaultItem; // Id vom Default-Item
+ USHORT nSelectedId;
// Fuer Ausgabe:
- sal_uInt16 nCheckPos;
- sal_uInt16 nImagePos;
- sal_uInt16 nTextPos;
+ USHORT nCheckPos;
+ USHORT nImagePos;
+ USHORT nTextPos;
- sal_Bool bIsMenuBar : 1, // Handelt es sich um den MenuBar
- bCanceled : 1, // Waehrend eines Callbacks abgebrochen
- bInCallback : 1, // In Activate/Deactivate
- bKilled : 1; // Gekillt...
+ BOOL bIsMenuBar : 1, // Handelt es sich um den MenuBar
+ bCanceled : 1, // Waehrend eines Callbacks abgebrochen
+ bInCallback : 1, // In Activate/Deactivate
+ bKilled : 1; // Gekillt...
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
mutable vcl::MenuLayoutData* mpLayoutData;
- SalMenu* mpSalMenu;
+ SalMenu* mpSalMenu;
protected:
- SAL_DLLPRIVATE void ImplInit();
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE Menu* ImplGetStartMenu();
- SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
- SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
- SAL_DLLPRIVATE Size ImplCalcSize( Window* pWin );
- 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( sal_uInt16 nHighlightItem );
- SAL_DLLPRIVATE void ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
+ SAL_DLLPRIVATE void ImplInit();
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE Menu* ImplGetStartMenu();
+ SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
+ SAL_DLLPRIVATE Menu* ImplFindMenu( USHORT 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 void ImplSelect();
+ SAL_DLLPRIVATE void ImplCallHighlight( USHORT nHighlightItem );
+ SAL_DLLPRIVATE void ImplCallEventListeners( ULONG nEvent, USHORT nPos );
DECL_DLLPRIVATE_LINK( ImplCallSelect, Menu* );
- SAL_DLLPRIVATE void ImplFillLayoutData() const;
+ SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
-
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
+
// returns native check and option menu symbol height;
- // return value is Max( rCheckHeight, rRadioHeight )
+ // return value is Max( rCheckHeight, rRadioHeight )
SAL_DLLPRIVATE long ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth ) const;
SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
public:
- SAL_DLLPRIVATE void ImplKillLayoutData() const;
+ SAL_DLLPRIVATE void ImplKillLayoutData() const;
SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const;
Menu();
- Menu( sal_Bool bMenuBar );
+ Menu( BOOL bMenuBar );
SAL_DLLPRIVATE Window* ImplGetWindow() const { return pWindow; }
-
+
SAL_DLLPRIVATE void ImplSelectWithStart( Menu* pStartMenu = NULL );
public:
- virtual ~Menu();
+ virtual ~Menu();
- virtual void Activate();
- virtual void Deactivate();
- virtual void Highlight();
- virtual void Select();
- virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual void Highlight();
+ virtual void Select();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
- void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
+ void InsertItem( USHORT nItemId, const XubString& rStr,
MenuItemBits nItemBits = 0,
- sal_uInt16 nPos = MENU_APPEND );
- void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ USHORT nPos = MENU_APPEND );
+ void InsertItem( USHORT nItemId, const Image& rImage,
MenuItemBits nItemBits = 0,
- sal_uInt16 nPos = MENU_APPEND );
- void InsertItem( sal_uInt16 nItemId,
+ USHORT nPos = MENU_APPEND );
+ void InsertItem( USHORT nItemId,
const XubString& rString, const Image& rImage,
MenuItemBits nItemBits = 0,
- 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();
+ 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 );
+ void Clear();
void CreateAutoMnemonics();
- void SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
- sal_uInt16 GetMenuFlags() const { return nMenuFlags; }
-
- 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 SetMenuFlags( USHORT nFlags ) { nMenuFlags = nFlags; }
+ USHORT GetMenuFlags() const { return nMenuFlags; }
- void SetDefaultItem( sal_uInt16 nItemId ) { nDefaultItem = nItemId; }
- sal_uInt16 GetDefaultItem() const { return nDefaultItem; }
+ USHORT GetItemCount() const;
+ USHORT GetItemId( USHORT nPos ) const;
+ USHORT GetItemPos( USHORT nItemId ) const;
+ MenuItemType GetItemType( USHORT nPos ) const;
+ USHORT GetCurItemId() const;
- void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
- MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
+ void SetDefaultItem( USHORT nItemId ) { nDefaultItem = nItemId; }
+ USHORT GetDefaultItem() const { return nDefaultItem; }
- void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
- sal_uLong GetUserValue( sal_uInt16 nItemId ) const;
+ void SetItemBits( USHORT nItemId, MenuItemBits nBits );
+ MenuItemBits GetItemBits( USHORT nItemId ) const;
- void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
- PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
+ void SetUserValue( USHORT nItemId, ULONG nValue );
+ ULONG GetUserValue( USHORT nItemId ) const;
- void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
- KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
+ void SetPopupMenu( USHORT nItemId, PopupMenu* pMenu );
+ PopupMenu* GetPopupMenu( USHORT nItemId ) const;
- void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
- sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
+ void SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode );
+ KeyCode GetAccelKey( USHORT nItemId ) const;
- void SelectItem( sal_uInt16 nItemId );
- void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
+ void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
+ BOOL IsItemChecked( USHORT nItemId ) const;
- void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
- sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+ void SelectItem( USHORT nItemId );
+ void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
- void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
- void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
+ void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
+ BOOL IsItemEnabled( USHORT nItemId ) const;
- 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 ShowItem( USHORT nItemId, BOOL bVisible = TRUE );
+ void HideItem( USHORT nItemId ) { ShowItem( nItemId, FALSE ); }
- void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
- sal_Bool HasValidEntries( sal_Bool bCheckPopups = sal_True );
+ BOOL IsItemVisible( USHORT nItemId ) const;
+ BOOL IsItemPosVisible( USHORT nItemPos ) const;
+ BOOL IsMenuVisible() const;
+ BOOL IsMenuBar() const { return bIsMenuBar; }
- void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
- XubString GetItemText( sal_uInt16 nItemId ) const;
+ void RemoveDisabledEntries( BOOL bCheckPopups = TRUE, BOOL bRemoveEmptyPopups = FALSE );
+ BOOL HasValidEntries( BOOL bCheckPopups = TRUE );
- 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 SetItemText( USHORT nItemId, const XubString& rStr );
+ XubString GetItemText( USHORT nItemId ) const;
- void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( 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 SetHelpText( sal_uInt16 nItemId, const XubString& rString );
- const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+ void SetItemCommand( USHORT nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( USHORT nItemId ) const;
- void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString );
- const XubString& GetTipHelpText( sal_uInt16 nItemId ) const;
+ void SetHelpText( USHORT nItemId, const XubString& rString );
+ const XubString& GetHelpText( USHORT nItemId ) const;
- void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
- const XubString& GetHelpCommand( sal_uInt16 nItemId ) const;
+ void SetTipHelpText( USHORT nItemId, const XubString& rString );
+ const XubString& GetTipHelpText( USHORT nItemId ) const;
- void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
- rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
+ void SetHelpCommand( USHORT nItemId, const XubString& rString );
+ const XubString& GetHelpCommand( USHORT nItemId ) const;
+
+ void SetHelpId( USHORT nItemId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nItemId ) const;
- void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
- const Link& GetActivateHdl() const { return aActivateHdl; }
+ void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return aActivateHdl; }
- void SetDeactivateHdl( const Link& rLink ) { aDeactivateHdl = rLink; }
- const Link& GetDeactivateHdl() const { return aDeactivateHdl; }
+ void SetDeactivateHdl( const Link& rLink ) { aDeactivateHdl = rLink; }
+ const Link& GetDeactivateHdl() const { return aDeactivateHdl; }
- void SetHighlightHdl( const Link& rLink ) { aHighlightHdl = rLink; }
- const Link& GetHighlightHdl() const { return aHighlightHdl; }
+ void SetHighlightHdl( const Link& rLink ) { aHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return aHighlightHdl; }
- void SetSelectHdl( const Link& rLink ) { aSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return aSelectHdl; }
-
- void SetLogo( const MenuLogo& rLogo );
- void SetLogo();
- sal_Bool HasLogo() const { return pLogo ? sal_True : sal_False; }
- MenuLogo GetLogo() const;
+ void SetSelectHdl( const Link& rLink ) { aSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return aSelectHdl; }
+ void SetLogo( const MenuLogo& rLogo );
+ void SetLogo();
+ BOOL HasLogo() const { return pLogo ? TRUE : FALSE; }
+ MenuLogo GetLogo() const;
+
void AddEventListener( const Link& rEventListener );
void RemoveEventListener( const Link& rEventListener );
//void AddChildEventListener( const Link& rEventListener );
//void RemoveChildEventListener( const Link& rEventListener );
-
- Menu& operator =( const Menu& rMenu );
+
+ Menu& operator =( const Menu& rMenu );
// Fuer Menu-'Funktionen'
- MenuItemList* GetItemList() const { return pItemList; }
+ MenuItemList* GetItemList() const { return pItemList; }
// returns the system's menu handle if native menues are supported
// pData must point to a SystemMenuData structure
- sal_Bool GetSystemMenuData( SystemMenuData* pData ) const;
+ BOOL GetSystemMenuData( SystemMenuData* pData ) const;
// accessibility helpers
@@ -346,44 +346,44 @@ 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( sal_uInt16 nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( USHORT 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, sal_uInt16& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, USHORT& 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( sal_uInt16 nItemId ) const;
+ Pair GetItemStartEnd( USHORT nItemId ) const;
// returns the item id for line nLine or 0 if nLine is invalid
- sal_uInt16 GetDisplayItemId( long nLine ) const;
+ USHORT GetDisplayItemId( long nLine ) const;
// returns the bounding rectangle for an item at pos nItemPos
- Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
- sal_Bool ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
+ Rectangle GetBoundingRectangle( USHORT nItemPos ) const;
+ 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( sal_uInt16 nItemId ) const;
-
- Window* GetWindow() const { return pWindow; }
+ KeyEvent GetActivationKey( USHORT nItemId ) const;
- void SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
- XubString GetAccessibleName( sal_uInt16 nItemId ) const;
+ Window* GetWindow() const { return pWindow; }
- void SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr );
- XubString GetAccessibleDescription( sal_uInt16 nItemId ) const;
+ void SetAccessibleName( USHORT nItemId, const XubString& rStr );
+ XubString GetAccessibleName( USHORT nItemId ) const;
+ void SetAccessibleDescription( USHORT nItemId, const XubString& rStr );
+ XubString GetAccessibleDescription( USHORT nItemId ) const;
+
// returns whether the item a position nItemPos is highlighted or not.
- bool IsHighlighted( sal_uInt16 nItemPos ) const;
+ bool IsHighlighted( USHORT nItemPos ) const;
- void HighlightItem( sal_uInt16 nItemPos );
+ void HighlightItem( USHORT nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
-
-
+
+
void doLazyDelete();
};
@@ -393,13 +393,13 @@ public:
class VCL_DLLPUBLIC MenuBar : public Menu
{
- Link maCloserHdl;
- Link maFloatHdl;
- Link maHideHdl;
- sal_Bool mbCloserVisible;
- sal_Bool mbFloatBtnVisible;
- sal_Bool mbHideBtnVisible;
- sal_Bool mbDisplayable;
+ Link maCloserHdl;
+ Link maFloatHdl;
+ Link maHideHdl;
+ BOOL mbCloserVisible;
+ BOOL mbFloatBtnVisible;
+ BOOL mbHideBtnVisible;
+ BOOL mbDisplayable;
friend class Application;
friend class Menu;
@@ -407,9 +407,9 @@ class VCL_DLLPUBLIC MenuBar : public Menu
friend class MenuFloatingWindow;
friend class SystemWindow;
- SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
- SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, sal_Bool bDelete );
- SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
+ 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 );
public:
MenuBar();
@@ -417,59 +417,59 @@ public:
MenuBar( const MenuBar& rMenu );
~MenuBar();
- MenuBar& operator =( const MenuBar& rMenu );
-
- 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; }
- void SetFloatButtonClickHdl( const Link& rLink ) { maFloatHdl = rLink; }
- const Link& GetFloatButtonClickHdl() const { return maFloatHdl; }
- void SetHideButtonClickHdl( const Link& rLink ) { maHideHdl = rLink; }
- const Link& GetHideButtonClickHdl() const { return maHideHdl; }
+ 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 SetCloserHdl( const Link& rLink ) { maCloserHdl = rLink; }
+ const Link& GetCloserHdl() const { return maCloserHdl; }
+ void SetFloatButtonClickHdl( const Link& rLink ) { maFloatHdl = rLink; }
+ const Link& GetFloatButtonClickHdl() const { return maFloatHdl; }
+ void SetHideButtonClickHdl( const Link& rLink ) { maHideHdl = rLink; }
+ const Link& GetHideButtonClickHdl() const { return maHideHdl; }
// - by default a menubar is displayable
// - 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( sal_Bool bDisplayable );
- sal_Bool IsDisplayable() const { return mbDisplayable; }
+ void SetDisplayable( BOOL bDisplayable );
+ BOOL IsDisplayable() const { return mbDisplayable; }
struct MenuBarButtonCallbackArg
{
- sal_uInt16 nId; // Id of the button
+ USHORT 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
- sal_uInt16 AddMenuBarButton( const Image&, const Link&, sal_uInt16 nPos = 0 );
+ USHORT AddMenuBarButton( const Image&, const Link&, USHORT 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
- sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos = 0 );
+ USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT 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( sal_uInt16 nId, const Link& );
+ void SetMenuBarButtonHighlightHdl( USHORT 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( sal_uInt16 nId );
- void RemoveMenuBarButton( sal_uInt16 nId );
+ Rectangle GetMenuBarButtonRectPixel( USHORT nId );
+ void RemoveMenuBarButton( USHORT nId );
};
inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
@@ -491,14 +491,14 @@ class VCL_DLLPUBLIC PopupMenu : public Menu
friend struct MenuItemData;
private:
- Menu** pRefAutoSubMenu; // keeps track if a pointer to this Menu is stored in the MenuItemData
+ Menu** pRefAutoSubMenu; // keeps track if a pointer to this Menu is stored in the MenuItemData
SAL_DLLPRIVATE MenuFloatingWindow* ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
protected:
- 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;
+ 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;
public:
PopupMenu();
@@ -506,21 +506,21 @@ public:
PopupMenu( const ResId& rResId );
~PopupMenu();
- void SetText( const XubString& rTitle ) { aTitleText = rTitle; }
- const XubString& GetText() const { return aTitleText; }
+ void SetText( const XubString& rTitle ) { aTitleText = rTitle; }
+ const XubString& GetText() const { return aTitleText; }
- sal_uInt16 Execute( Window* pWindow, const Point& rPopupPos );
- sal_uInt16 Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ USHORT Execute( Window* pWindow, const Point& rPopupPos );
+ USHORT Execute( Window* pWindow, const Rectangle& rRect, USHORT nFlags = 0 );
// Fuer das TestTool
- void EndExecute( sal_uInt16 nSelect = 0 );
- void SelectEntry( sal_uInt16 nId );
- void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
+ void EndExecute( USHORT nSelect = 0 );
+ void SelectEntry( USHORT nId );
+ void SetSelectedEntry( USHORT nId ); // for use by native submenu only
- static sal_Bool IsInExecute();
- static PopupMenu* GetActivePopupMenu();
+ static BOOL IsInExecute();
+ static PopupMenu* GetActivePopupMenu();
- PopupMenu& operator =( const PopupMenu& rMenu );
+ PopupMenu& operator =( const PopupMenu& rMenu );
};
inline PopupMenu& PopupMenu::operator =( const PopupMenu& rMenu )
diff --git a/vcl/inc/vcl/menubtn.hxx b/vcl/inc/vcl/menubtn.hxx
index 1e65504b97bc..f55ffdffd206 100644
--- a/vcl/inc/vcl/menubtn.hxx
+++ b/vcl/inc/vcl/menubtn.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@ class PopupMenu;
// - MenuButton-Types -
// --------------------
-#define MENUBUTTON_MENUMODE_TIMED ((sal_uInt16)0x0001)
+#define MENUBUTTON_MENUMODE_TIMED ((USHORT)0x0001)
// --------------
// - MenuButton -
@@ -49,14 +49,14 @@ class PopupMenu;
class VCL_DLLPUBLIC MenuButton : public PushButton
{
private:
- Rectangle maFocusRect;
- Timer* mpMenuTimer;
- PopupMenu* mpOwnMenu;
- PopupMenu* mpMenu;
- sal_uInt16 mnCurItemId;
- sal_uInt16 mnMenuMode;
- Link maActivateHdl;
- Link maSelectHdl;
+ Rectangle maFocusRect;
+ Timer* mpMenuTimer;
+ PopupMenu* mpOwnMenu;
+ PopupMenu* mpMenu;
+ USHORT mnCurItemId;
+ USHORT mnMenuMode;
+ Link maActivateHdl;
+ Link maSelectHdl;
SAL_DLLPRIVATE void ImplInitMenuButtonData();
SAL_DLLPRIVATE void ImplExecuteMenu();
@@ -76,26 +76,26 @@ public:
MenuButton( Window* pParent, const ResId& rResId );
~MenuButton();
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void Activate();
- virtual void Select();
+ virtual void Activate();
+ virtual void Select();
- void SetMenuMode( sal_uInt16 nMode );
- sal_uInt16 GetMenuMode() const { return mnMenuMode; }
+ void SetMenuMode( USHORT nMode );
+ USHORT GetMenuMode() const { return mnMenuMode; }
- void SetPopupMenu( PopupMenu* pNewMenu );
- PopupMenu* GetPopupMenu() const { return mpMenu; }
+ void SetPopupMenu( PopupMenu* pNewMenu );
+ PopupMenu* GetPopupMenu() const { return mpMenu; }
- sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ USHORT GetCurItemId() const { return mnCurItemId; }
- void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
- const Link& GetActivateHdl() const { return maActivateHdl; }
- void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
+ const Link& GetActivateHdl() const { return maActivateHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
};
-#endif // _SV_MENUBTN_HXX
+#endif // _SV_MENUBTN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index fd8f3b8e985b..5a85e3b7fbb3 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,91 +50,91 @@ class SvStream;
// - Defines -
// -----------
-#define META_NULL_ACTION (0)
-#define META_PIXEL_ACTION (100)
-#define META_POINT_ACTION (101)
-#define META_LINE_ACTION (102)
-#define META_RECT_ACTION (103)
-#define META_ROUNDRECT_ACTION (104)
-#define META_ELLIPSE_ACTION (105)
-#define META_ARC_ACTION (106)
-#define META_PIE_ACTION (107)
-#define META_CHORD_ACTION (108)
-#define META_POLYLINE_ACTION (109)
-#define META_POLYGON_ACTION (110)
-#define META_POLYPOLYGON_ACTION (111)
-#define META_TEXT_ACTION (112)
-#define META_TEXTARRAY_ACTION (113)
-#define META_STRETCHTEXT_ACTION (114)
-#define META_TEXTRECT_ACTION (115)
-#define META_BMP_ACTION (116)
-#define META_BMPSCALE_ACTION (117)
-#define META_BMPSCALEPART_ACTION (118)
-#define META_BMPEX_ACTION (119)
-#define META_BMPEXSCALE_ACTION (120)
-#define META_BMPEXSCALEPART_ACTION (121)
-#define META_MASK_ACTION (122)
-#define META_MASKSCALE_ACTION (123)
-#define META_MASKSCALEPART_ACTION (124)
-#define META_GRADIENT_ACTION (125)
-#define META_HATCH_ACTION (126)
-#define META_WALLPAPER_ACTION (127)
-#define META_CLIPREGION_ACTION (128)
-#define META_ISECTRECTCLIPREGION_ACTION (129)
-#define META_ISECTREGIONCLIPREGION_ACTION (130)
-#define META_MOVECLIPREGION_ACTION (131)
-#define META_LINECOLOR_ACTION (132)
-#define META_FILLCOLOR_ACTION (133)
-#define META_TEXTCOLOR_ACTION (134)
-#define META_TEXTFILLCOLOR_ACTION (135)
-#define META_TEXTALIGN_ACTION (136)
-#define META_MAPMODE_ACTION (137)
-#define META_FONT_ACTION (138)
-#define META_PUSH_ACTION (139)
-#define META_POP_ACTION (140)
-#define META_RASTEROP_ACTION (141)
-#define META_TRANSPARENT_ACTION (142)
-#define META_EPS_ACTION (143)
-#define META_REFPOINT_ACTION (144)
-#define META_TEXTLINECOLOR_ACTION (145)
-#define META_TEXTLINE_ACTION (146)
-#define META_FLOATTRANSPARENT_ACTION (147)
-#define META_GRADIENTEX_ACTION (148)
-#define META_LAYOUTMODE_ACTION (149)
-#define META_TEXTLANGUAGE_ACTION (150)
-#define META_OVERLINECOLOR_ACTION (151)
-
-#define META_COMMENT_ACTION (512)
+#define META_NULL_ACTION (0)
+#define META_PIXEL_ACTION (100)
+#define META_POINT_ACTION (101)
+#define META_LINE_ACTION (102)
+#define META_RECT_ACTION (103)
+#define META_ROUNDRECT_ACTION (104)
+#define META_ELLIPSE_ACTION (105)
+#define META_ARC_ACTION (106)
+#define META_PIE_ACTION (107)
+#define META_CHORD_ACTION (108)
+#define META_POLYLINE_ACTION (109)
+#define META_POLYGON_ACTION (110)
+#define META_POLYPOLYGON_ACTION (111)
+#define META_TEXT_ACTION (112)
+#define META_TEXTARRAY_ACTION (113)
+#define META_STRETCHTEXT_ACTION (114)
+#define META_TEXTRECT_ACTION (115)
+#define META_BMP_ACTION (116)
+#define META_BMPSCALE_ACTION (117)
+#define META_BMPSCALEPART_ACTION (118)
+#define META_BMPEX_ACTION (119)
+#define META_BMPEXSCALE_ACTION (120)
+#define META_BMPEXSCALEPART_ACTION (121)
+#define META_MASK_ACTION (122)
+#define META_MASKSCALE_ACTION (123)
+#define META_MASKSCALEPART_ACTION (124)
+#define META_GRADIENT_ACTION (125)
+#define META_HATCH_ACTION (126)
+#define META_WALLPAPER_ACTION (127)
+#define META_CLIPREGION_ACTION (128)
+#define META_ISECTRECTCLIPREGION_ACTION (129)
+#define META_ISECTREGIONCLIPREGION_ACTION (130)
+#define META_MOVECLIPREGION_ACTION (131)
+#define META_LINECOLOR_ACTION (132)
+#define META_FILLCOLOR_ACTION (133)
+#define META_TEXTCOLOR_ACTION (134)
+#define META_TEXTFILLCOLOR_ACTION (135)
+#define META_TEXTALIGN_ACTION (136)
+#define META_MAPMODE_ACTION (137)
+#define META_FONT_ACTION (138)
+#define META_PUSH_ACTION (139)
+#define META_POP_ACTION (140)
+#define META_RASTEROP_ACTION (141)
+#define META_TRANSPARENT_ACTION (142)
+#define META_EPS_ACTION (143)
+#define META_REFPOINT_ACTION (144)
+#define META_TEXTLINECOLOR_ACTION (145)
+#define META_TEXTLINE_ACTION (146)
+#define META_FLOATTRANSPARENT_ACTION (147)
+#define META_GRADIENTEX_ACTION (148)
+#define META_LAYOUTMODE_ACTION (149)
+#define META_TEXTLANGUAGE_ACTION (150)
+#define META_OVERLINECOLOR_ACTION (151)
+
+#define META_COMMENT_ACTION (512)
// ------------------------------------------------------------------------
struct ImplMetaReadData
{
- rtl_TextEncoding meActualCharSet;
+ rtl_TextEncoding meActualCharSet;
};
// ------------------------------------------------------------------------
struct ImplMetaWriteData
{
- rtl_TextEncoding meActualCharSet;
+ rtl_TextEncoding meActualCharSet;
};
// ------------------------------------------------------------------------
-#define DECL_META_ACTION( Name, nType ) \
- Meta##Name##Action(); \
+#define DECL_META_ACTION( Name, nType ) \
+ Meta##Name##Action(); \
protected: \
- virtual ~Meta##Name##Action(); \
+ virtual ~Meta##Name##Action(); \
public: \
- virtual void Execute( OutputDevice* pOut ); \
- virtual MetaAction* Clone(); \
- virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); \
- virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
-
-#define IMPL_META_ACTION( Name, nType ) \
-Meta##Name##Action::Meta##Name##Action() : \
- MetaAction( nType ) {} \
+ virtual void Execute( OutputDevice* pOut ); \
+ virtual MetaAction* Clone(); \
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); \
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+
+#define IMPL_META_ACTION( Name, nType ) \
+Meta##Name##Action::Meta##Name##Action() : \
+ MetaAction( nType ) {} \
Meta##Name##Action::~Meta##Name##Action() {}
// --------------
@@ -144,38 +144,38 @@ Meta##Name##Action::~Meta##Name##Action() {}
class VCL_DLLPUBLIC MetaAction
{
private:
- sal_uLong mnRefCount;
- sal_uInt16 mnType;
+ ULONG mnRefCount;
+ UINT16 mnType;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
protected:
- virtual ~MetaAction();
+ virtual ~MetaAction();
public:
MetaAction();
- MetaAction( sal_uInt16 nType );
+ MetaAction( USHORT nType );
- virtual void Execute( OutputDevice* pOut );
+ virtual void Execute( OutputDevice* pOut );
virtual MetaAction* Clone();
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
- virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
- sal_Bool IsEqual( const MetaAction& ) const;
+ sal_Bool IsEqual( const MetaAction& ) const;
- 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; }
+ USHORT GetType() const { return mnType; }
+ ULONG GetRefCount() const { return mnRefCount; }
+ void ResetRefCount() { mnRefCount = 1; }
+ void Duplicate() { mnRefCount++; }
+ void Delete() { if ( 0 == --mnRefCount ) delete this; }
public:
- static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData );
+ static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData );
};
// -------------------
@@ -185,21 +185,21 @@ public:
class VCL_DLLPUBLIC MetaPixelAction : public MetaAction
{
private:
- Point maPt;
- Color maColor;
+ Point maPt;
+ Color maColor;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Pixel, META_PIXEL_ACTION )
MetaPixelAction( const Point& rPt, const Color& rColor );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Point& GetPoint() const { return maPt; }
- const Color& GetColor() const { return maColor; }
+ const Point& GetPoint() const { return maPt; }
+ const Color& GetColor() const { return maColor; }
};
// -------------------
@@ -209,19 +209,19 @@ public:
class VCL_DLLPUBLIC MetaPointAction : public MetaAction
{
private:
- Point maPt;
+ Point maPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Point, META_POINT_ACTION )
MetaPointAction( const Point& rPt );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Point& GetPoint() const { return maPt; }
+ const Point& GetPoint() const { return maPt; }
};
// ------------------
@@ -232,11 +232,11 @@ class VCL_DLLPUBLIC MetaLineAction : public MetaAction
{
private:
- LineInfo maLineInfo;
- Point maStartPt;
- Point maEndPt;
+ LineInfo maLineInfo;
+ Point maStartPt;
+ Point maEndPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Line, META_LINE_ACTION )
@@ -245,12 +245,12 @@ public:
MetaLineAction( const Point& rStart, const Point& rEnd,
const LineInfo& rLineInfo );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Point& GetStartPoint() const { return maStartPt; }
- const Point& GetEndPoint() const { return maEndPt; }
- const LineInfo& GetLineInfo() const { return maLineInfo; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
+ const LineInfo& GetLineInfo() const { return maLineInfo; }
};
// ------------------
@@ -261,18 +261,18 @@ class VCL_DLLPUBLIC MetaRectAction : public MetaAction
{
private:
- Rectangle maRect;
+ Rectangle maRect;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Rect, META_RECT_ACTION )
MetaRectAction( const Rectangle& rRect );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
+ const Rectangle& GetRect() const { return maRect; }
};
// -----------------------
@@ -283,11 +283,11 @@ class VCL_DLLPUBLIC MetaRoundRectAction : public MetaAction
{
private:
- Rectangle maRect;
- sal_uInt32 mnHorzRound;
- sal_uInt32 mnVertRound;
+ Rectangle maRect;
+ sal_uInt32 mnHorzRound;
+ sal_uInt32 mnVertRound;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION )
@@ -295,12 +295,12 @@ public:
MetaRoundRectAction( const Rectangle& rRect,
sal_uInt32 nHorzRound, sal_uInt32 nVertRound );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- sal_uInt32 GetHorzRound() const { return mnHorzRound; }
- sal_uInt32 GetVertRound() const { return mnVertRound; }
+ const Rectangle& GetRect() const { return maRect; }
+ sal_uInt32 GetHorzRound() const { return mnHorzRound; }
+ sal_uInt32 GetVertRound() const { return mnVertRound; }
};
// ---------------------
@@ -311,19 +311,19 @@ class VCL_DLLPUBLIC MetaEllipseAction : public MetaAction
{
private:
- Rectangle maRect;
+ Rectangle maRect;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Ellipse, META_ELLIPSE_ACTION )
MetaEllipseAction( const Rectangle& rRect );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
+ const Rectangle& GetRect() const { return maRect; }
};
// -----------------
@@ -334,11 +334,11 @@ class VCL_DLLPUBLIC MetaArcAction : public MetaAction
{
private:
- Rectangle maRect;
- Point maStartPt;
- Point maEndPt;
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Arc, META_ARC_ACTION )
@@ -346,12 +346,12 @@ public:
MetaArcAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- const Point& GetStartPoint() const { return maStartPt; }
- const Point& GetEndPoint() const { return maEndPt; }
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
};
// -----------------
@@ -362,11 +362,11 @@ class VCL_DLLPUBLIC MetaPieAction : public MetaAction
{
private:
- Rectangle maRect;
- Point maStartPt;
- Point maEndPt;
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Pie, META_PIE_ACTION )
@@ -374,12 +374,12 @@ public:
MetaPieAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- const Point& GetStartPoint() const { return maStartPt; }
- const Point& GetEndPoint() const { return maEndPt; }
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
};
// -------------------
@@ -390,11 +390,11 @@ class VCL_DLLPUBLIC MetaChordAction : public MetaAction
{
private:
- Rectangle maRect;
- Point maStartPt;
- Point maEndPt;
+ Rectangle maRect;
+ Point maStartPt;
+ Point maEndPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Chord, META_CHORD_ACTION )
@@ -402,12 +402,12 @@ public:
MetaChordAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- const Point& GetStartPoint() const { return maStartPt; }
- const Point& GetEndPoint() const { return maEndPt; }
+ const Rectangle& GetRect() const { return maRect; }
+ const Point& GetStartPoint() const { return maStartPt; }
+ const Point& GetEndPoint() const { return maEndPt; }
};
// ----------------------
@@ -418,10 +418,10 @@ class VCL_DLLPUBLIC MetaPolyLineAction : public MetaAction
{
private:
- LineInfo maLineInfo;
- Polygon maPoly;
+ LineInfo maLineInfo;
+ Polygon maPoly;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( PolyLine, META_POLYLINE_ACTION )
@@ -429,11 +429,11 @@ public:
MetaPolyLineAction( const Polygon& rPoly );
MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Polygon& GetPolygon() const { return maPoly; }
- const LineInfo& GetLineInfo() const { return maLineInfo; }
+ const Polygon& GetPolygon() const { return maPoly; }
+ const LineInfo& GetLineInfo() const { return maLineInfo; }
};
// ---------------------
@@ -444,19 +444,19 @@ class VCL_DLLPUBLIC MetaPolygonAction : public MetaAction
{
private:
- Polygon maPoly;
+ Polygon maPoly;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Polygon, META_POLYGON_ACTION )
MetaPolygonAction( const Polygon& rPoly );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Polygon& GetPolygon() const { return maPoly; }
+ const Polygon& GetPolygon() const { return maPoly; }
};
// -------------------------
@@ -467,19 +467,19 @@ class VCL_DLLPUBLIC MetaPolyPolygonAction : public MetaAction
{
private:
- PolyPolygon maPolyPoly;
+ PolyPolygon maPolyPoly;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION )
MetaPolyPolygonAction( const PolyPolygon& rPolyPoly );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
};
// ------------------
@@ -490,26 +490,26 @@ class VCL_DLLPUBLIC MetaTextAction : public MetaAction
{
private:
- Point maPt;
- XubString maStr;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ Point maPt;
+ XubString maStr;
+ USHORT mnIndex;
+ USHORT mnLen;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Text, META_TEXT_ACTION )
MetaTextAction( const Point& rPt, const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen );
+ USHORT nIndex, USHORT nLen );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ 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; }
- sal_uInt16 GetIndex() const { return mnIndex; }
- sal_uInt16 GetLen() const { return mnLen; }
+ const Point& GetPoint() const { return maPt; }
+ const XubString& GetText() const { return maStr; }
+ USHORT GetIndex() const { return mnIndex; }
+ USHORT GetLen() const { return mnLen; }
};
// -----------------------
@@ -520,16 +520,16 @@ class VCL_DLLPUBLIC MetaTextArrayAction : public MetaAction
{
private:
- Point maStartPt;
- XubString maStr;
- sal_Int32* mpDXAry;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ Point maStartPt;
+ XubString maStr;
+ sal_Int32* mpDXAry;
+ USHORT mnIndex;
+ USHORT mnLen;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
protected:
- virtual ~MetaTextArrayAction();
+ virtual ~MetaTextArrayAction();
public:
MetaTextArrayAction();
@@ -537,24 +537,24 @@ public:
MetaTextArrayAction( const Point& rStartPt,
const XubString& rStr,
const sal_Int32* pDXAry,
- sal_uInt16 nIndex,
- sal_uInt16 nLen );
+ USHORT nIndex,
+ USHORT nLen );
- virtual void Execute( OutputDevice* pOut );
+ virtual void Execute( OutputDevice* pOut );
virtual MetaAction* Clone();
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
- virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
- const Point& GetPoint() const { return maStartPt; }
- const XubString& GetText() const { return maStr; }
- sal_uInt16 GetIndex() const { return mnIndex; }
- sal_uInt16 GetLen() const { return mnLen; }
- sal_Int32* GetDXArray() const { return mpDXAry; }
+ const Point& GetPoint() const { return maStartPt; }
+ const XubString& GetText() const { return maStr; }
+ USHORT GetIndex() const { return mnIndex; }
+ USHORT GetLen() const { return mnLen; }
+ sal_Int32* GetDXArray() const { return mpDXAry; }
};
// -------------------------
@@ -565,29 +565,29 @@ class VCL_DLLPUBLIC MetaStretchTextAction : public MetaAction
{
private:
- Point maPt;
- XubString maStr;
- sal_uInt32 mnWidth;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ Point maPt;
+ XubString maStr;
+ sal_uInt32 mnWidth;
+ USHORT mnIndex;
+ USHORT mnLen;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen );
+ USHORT nIndex, USHORT nLen );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ 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; }
- sal_uInt32 GetWidth() const { return mnWidth; }
- sal_uInt16 GetIndex() const { return mnIndex; }
- sal_uInt16 GetLen() const { return mnLen; }
+ 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; }
};
// ----------------------
@@ -598,24 +598,24 @@ class VCL_DLLPUBLIC MetaTextRectAction : public MetaAction
{
private:
- Rectangle maRect;
- XubString maStr;
- sal_uInt16 mnStyle;
+ Rectangle maRect;
+ XubString maStr;
+ USHORT mnStyle;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle );
+ const XubString& rStr, USHORT nStyle );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ 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; }
- sal_uInt16 GetStyle() const { return mnStyle; }
+ const Rectangle& GetRect() const { return maRect; }
+ const XubString& GetText() const { return maStr; }
+ USHORT GetStyle() const { return mnStyle; }
};
// ----------------------
@@ -626,13 +626,13 @@ class VCL_DLLPUBLIC MetaTextLineAction : public MetaAction
{
private:
- Point maPos;
- long mnWidth;
- FontStrikeout meStrikeout;
- FontUnderline meUnderline;
- FontUnderline meOverline;
+ Point maPos;
+ long mnWidth;
+ FontStrikeout meStrikeout;
+ FontUnderline meUnderline;
+ FontUnderline meOverline;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextLine, META_TEXTLINE_ACTION )
@@ -641,14 +641,14 @@ public:
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
-
- const Point& GetStartPoint() const { return maPos; }
- long GetWidth() const { return mnWidth; }
- FontStrikeout GetStrikeout() const { return meStrikeout; }
- FontUnderline GetUnderline() const { return meUnderline; }
- FontUnderline GetOverline() const { return meOverline; }
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
+
+ const Point& GetStartPoint() const { return maPos; }
+ long GetWidth() const { return mnWidth; }
+ FontStrikeout GetStrikeout() const { return meStrikeout; }
+ FontUnderline GetUnderline() const { return meUnderline; }
+ FontUnderline GetOverline() const { return meOverline; }
};
// -----------------
@@ -659,21 +659,21 @@ class VCL_DLLPUBLIC MetaBmpAction : public MetaAction
{
private:
- Bitmap maBmp;
- Point maPt;
+ Bitmap maBmp;
+ Point maPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Bmp, META_BMP_ACTION )
MetaBmpAction( const Point& rPt, const Bitmap& rBmp );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Point& GetPoint() const { return maPt; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetPoint() const { return maPt; }
};
// ----------------------
@@ -684,11 +684,11 @@ class VCL_DLLPUBLIC MetaBmpScaleAction : public MetaAction
{
private:
- Bitmap maBmp;
- Point maPt;
- Size maSz;
+ Bitmap maBmp;
+ Point maPt;
+ Size maSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( BmpScale, META_BMPSCALE_ACTION )
@@ -696,12 +696,12 @@ public:
MetaBmpScaleAction( const Point& rPt, const Size& rSz,
const Bitmap& rBmp );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Point& GetPoint() const { return maPt; }
- const Size& GetSize() const { return maSz; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
};
// --------------------------
@@ -712,13 +712,13 @@ class VCL_DLLPUBLIC MetaBmpScalePartAction : public MetaAction
{
private:
- Bitmap maBmp;
- Point maDstPt;
- Size maDstSz;
- Point maSrcPt;
- Size maSrcSz;
+ Bitmap maBmp;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION )
@@ -727,14 +727,14 @@ public:
const Point& rSrcPt, const Size& rSrcSz,
const Bitmap& rBmp );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Point& GetDestPoint() const { return maDstPt; }
- const Size& GetDestSize() const { return maDstSz; }
- const Point& GetSrcPoint() const { return maSrcPt; }
- const Size& GetSrcSize() const { return maSrcSz; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
};
// -----------------
@@ -745,21 +745,21 @@ class VCL_DLLPUBLIC MetaBmpExAction : public MetaAction
{
private:
- BitmapEx maBmpEx;
- Point maPt;
+ BitmapEx maBmpEx;
+ Point maPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( BmpEx, META_BMPEX_ACTION )
MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const BitmapEx& GetBitmapEx() const { return maBmpEx; }
- const Point& GetPoint() const { return maPt; }
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetPoint() const { return maPt; }
};
// ----------------------
@@ -770,11 +770,11 @@ class VCL_DLLPUBLIC MetaBmpExScaleAction : public MetaAction
{
private:
- BitmapEx maBmpEx;
- Point maPt;
- Size maSz;
+ BitmapEx maBmpEx;
+ Point maPt;
+ Size maSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION )
@@ -782,12 +782,12 @@ public:
MetaBmpExScaleAction( const Point& rPt, const Size& rSz,
const BitmapEx& rBmpEx ) ;
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const BitmapEx& GetBitmapEx() const { return maBmpEx; }
- const Point& GetPoint() const { return maPt; }
- const Size& GetSize() const { return maSz; }
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
};
// ----------------------------
@@ -798,13 +798,13 @@ class VCL_DLLPUBLIC MetaBmpExScalePartAction : public MetaAction
{
private:
- BitmapEx maBmpEx;
- Point maDstPt;
- Size maDstSz;
- Point maSrcPt;
- Size maSrcSz;
+ BitmapEx maBmpEx;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION )
@@ -813,14 +813,14 @@ public:
const Point& rSrcPt, const Size& rSrcSz,
const BitmapEx& rBmpEx );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const BitmapEx& GetBitmapEx() const { return maBmpEx; }
- const Point& GetDestPoint() const { return maDstPt; }
- const Size& GetDestSize() const { return maDstSz; }
- const Point& GetSrcPoint() const { return maSrcPt; }
- const Size& GetSrcSize() const { return maSrcSz; }
+ const BitmapEx& GetBitmapEx() const { return maBmpEx; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
};
// ------------------
@@ -831,11 +831,11 @@ class VCL_DLLPUBLIC MetaMaskAction : public MetaAction
{
private:
- Bitmap maBmp;
- Color maColor;
- Point maPt;
+ Bitmap maBmp;
+ Color maColor;
+ Point maPt;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Mask, META_MASK_ACTION )
@@ -844,12 +844,12 @@ public:
const Bitmap& rBmp,
const Color& rColor );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Color& GetColor() const { return maColor; }
- const Point& GetPoint() const { return maPt; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetPoint() const { return maPt; }
};
// -----------------------
@@ -860,12 +860,12 @@ class VCL_DLLPUBLIC MetaMaskScaleAction : public MetaAction
{
private:
- Bitmap maBmp;
- Color maColor;
- Point maPt;
- Size maSz;
+ Bitmap maBmp;
+ Color maColor;
+ Point maPt;
+ Size maSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( MaskScale, META_MASKSCALE_ACTION )
@@ -874,13 +874,13 @@ public:
const Bitmap& rBmp,
const Color& rColor );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Color& GetColor() const { return maColor; }
- const Point& GetPoint() const { return maPt; }
- const Size& GetSize() const { return maSz; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetPoint() const { return maPt; }
+ const Size& GetSize() const { return maSz; }
};
// ---------------------------
@@ -891,14 +891,14 @@ class VCL_DLLPUBLIC MetaMaskScalePartAction : public MetaAction
{
private:
- Bitmap maBmp;
- Color maColor;
- Point maDstPt;
- Size maDstSz;
- Point maSrcPt;
- Size maSrcSz;
+ Bitmap maBmp;
+ Color maColor;
+ Point maDstPt;
+ Size maDstSz;
+ Point maSrcPt;
+ Size maSrcSz;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( MaskScalePart, META_MASKSCALEPART_ACTION )
@@ -908,15 +908,15 @@ public:
const Bitmap& rBmp,
const Color& rColor );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Bitmap& GetBitmap() const { return maBmp; }
- const Color& GetColor() const { return maColor; }
- const Point& GetDestPoint() const { return maDstPt; }
- const Size& GetDestSize() const { return maDstSz; }
- const Point& GetSrcPoint() const { return maSrcPt; }
- const Size& GetSrcSize() const { return maSrcSz; }
+ const Bitmap& GetBitmap() const { return maBmp; }
+ const Color& GetColor() const { return maColor; }
+ const Point& GetDestPoint() const { return maDstPt; }
+ const Size& GetDestSize() const { return maDstSz; }
+ const Point& GetSrcPoint() const { return maSrcPt; }
+ const Size& GetSrcSize() const { return maSrcSz; }
};
// ----------------------
@@ -927,21 +927,21 @@ class VCL_DLLPUBLIC MetaGradientAction : public MetaAction
{
private:
- Rectangle maRect;
- Gradient maGradient;
+ Rectangle maRect;
+ Gradient maGradient;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Gradient, META_GRADIENT_ACTION )
MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- const Gradient& GetGradient() const { return maGradient; }
+ const Rectangle& GetRect() const { return maRect; }
+ const Gradient& GetGradient() const { return maGradient; }
};
// ------------------------
@@ -952,21 +952,21 @@ class VCL_DLLPUBLIC MetaGradientExAction : public MetaAction
{
private:
- PolyPolygon maPolyPoly;
- Gradient maGradient;
+ PolyPolygon maPolyPoly;
+ Gradient maGradient;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( GradientEx, META_GRADIENTEX_ACTION )
MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
- const Gradient& GetGradient() const { return maGradient; }
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ const Gradient& GetGradient() const { return maGradient; }
};
// -------------------
@@ -977,21 +977,21 @@ class VCL_DLLPUBLIC MetaHatchAction : public MetaAction
{
private:
- PolyPolygon maPolyPoly;
- Hatch maHatch;
+ PolyPolygon maPolyPoly;
+ Hatch maHatch;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Hatch, META_HATCH_ACTION )
MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
- const Hatch& GetHatch() const { return maHatch; }
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ const Hatch& GetHatch() const { return maHatch; }
};
// -----------------------
@@ -1002,10 +1002,10 @@ class VCL_DLLPUBLIC MetaWallpaperAction : public MetaAction
{
private:
- Rectangle maRect;
- Wallpaper maWallpaper;
+ Rectangle maRect;
+ Wallpaper maWallpaper;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION )
@@ -1013,11 +1013,11 @@ public:
MetaWallpaperAction( const Rectangle& rRect,
const Wallpaper& rPaper );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
- const Wallpaper& GetWallpaper() const { return maWallpaper; }
+ const Rectangle& GetRect() const { return maRect; }
+ const Wallpaper& GetWallpaper() const { return maWallpaper; }
};
// ------------------------
@@ -1028,21 +1028,21 @@ class VCL_DLLPUBLIC MetaClipRegionAction : public MetaAction
{
private:
- Region maRegion;
- sal_Bool mbClip;
+ Region maRegion;
+ BOOL mbClip;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
- MetaClipRegionAction( const Region& rRegion, sal_Bool bClip );
+ MetaClipRegionAction( const Region& rRegion, BOOL bClip );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Region& GetRegion() const { return maRegion; }
- sal_Bool IsClipping() const { return mbClip; }
+ const Region& GetRegion() const { return maRegion; }
+ BOOL IsClipping() const { return mbClip; }
};
// ---------------------------------
@@ -1053,19 +1053,19 @@ class VCL_DLLPUBLIC MetaISectRectClipRegionAction : public MetaAction
{
private:
- Rectangle maRect;
+ Rectangle maRect;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION )
MetaISectRectClipRegionAction( const Rectangle& rRect );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Rectangle& GetRect() const { return maRect; }
+ const Rectangle& GetRect() const { return maRect; }
};
// -----------------------------------
@@ -1076,19 +1076,19 @@ class VCL_DLLPUBLIC MetaISectRegionClipRegionAction : public MetaAction
{
private:
- Region maRegion;
+ Region maRegion;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION )
MetaISectRegionClipRegionAction( const Region& rRegion );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Region& GetRegion() const { return maRegion; }
+ const Region& GetRegion() const { return maRegion; }
};
// ----------------------------
@@ -1099,20 +1099,20 @@ class VCL_DLLPUBLIC MetaMoveClipRegionAction : public MetaAction
{
private:
- long mnHorzMove;
- long mnVertMove;
+ long mnHorzMove;
+ long mnVertMove;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION )
MetaMoveClipRegionAction( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Scale( double fScaleX, double fScaleY );
- long GetHorzMove() const { return mnHorzMove; }
- long GetVertMove() const { return mnVertMove; }
+ long GetHorzMove() const { return mnHorzMove; }
+ long GetVertMove() const { return mnVertMove; }
};
// -----------------------
@@ -1123,18 +1123,18 @@ class VCL_DLLPUBLIC MetaLineColorAction : public MetaAction
{
private:
- Color maColor;
- sal_Bool mbSet;
+ Color maColor;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
- MetaLineColorAction( const Color& rColor, sal_Bool bSet );
+ MetaLineColorAction( const Color& rColor, BOOL bSet );
- const Color& GetColor() const { return maColor; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Color& GetColor() const { return maColor; }
+ BOOL IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1145,18 +1145,18 @@ class VCL_DLLPUBLIC MetaFillColorAction : public MetaAction
{
private:
- Color maColor;
- sal_Bool mbSet;
+ Color maColor;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
- MetaFillColorAction( const Color& rColor, sal_Bool bSet );
+ MetaFillColorAction( const Color& rColor, BOOL bSet );
- const Color& GetColor() const { return maColor; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Color& GetColor() const { return maColor; }
+ BOOL IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1167,16 +1167,16 @@ class VCL_DLLPUBLIC MetaTextColorAction : public MetaAction
{
private:
- Color maColor;
+ Color maColor;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION )
MetaTextColorAction( const Color& rColor );
- const Color& GetColor() const { return maColor; }
+ const Color& GetColor() const { return maColor; }
};
// ---------------------------
@@ -1187,18 +1187,18 @@ class VCL_DLLPUBLIC MetaTextFillColorAction : public MetaAction
{
private:
- Color maColor;
- sal_Bool mbSet;
+ Color maColor;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
- MetaTextFillColorAction( const Color& rColor, sal_Bool bSet );
+ MetaTextFillColorAction( const Color& rColor, BOOL bSet );
- const Color& GetColor() const { return maColor; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Color& GetColor() const { return maColor; }
+ BOOL IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1209,18 +1209,18 @@ class VCL_DLLPUBLIC MetaTextLineColorAction : public MetaAction
{
private:
- Color maColor;
- sal_Bool mbSet;
+ Color maColor;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
- MetaTextLineColorAction( const Color& rColor, sal_Bool bSet );
+ MetaTextLineColorAction( const Color& rColor, BOOL bSet );
- const Color& GetColor() const { return maColor; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Color& GetColor() const { return maColor; }
+ BOOL IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1231,18 +1231,18 @@ class VCL_DLLPUBLIC MetaOverlineColorAction : public MetaAction
{
private:
- Color maColor;
- sal_Bool mbSet;
+ Color maColor;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
- MetaOverlineColorAction( const Color& rColor, sal_Bool bSet );
+ MetaOverlineColorAction( const Color& rColor, BOOL bSet );
- const Color& GetColor() const { return maColor; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Color& GetColor() const { return maColor; }
+ BOOL IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1253,16 +1253,16 @@ class VCL_DLLPUBLIC MetaTextAlignAction : public MetaAction
{
private:
- TextAlign maAlign;
+ TextAlign maAlign;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION )
MetaTextAlignAction( TextAlign aAlign );
- TextAlign GetTextAlign() const { return maAlign; }
+ TextAlign GetTextAlign() const { return maAlign; }
};
// ---------------------
@@ -1273,18 +1273,18 @@ class VCL_DLLPUBLIC MetaMapModeAction : public MetaAction
{
private:
- MapMode maMapMode;
+ MapMode maMapMode;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( MapMode, META_MAPMODE_ACTION )
MetaMapModeAction( const MapMode& rMapMode );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Scale( double fScaleX, double fScaleY );
- const MapMode& GetMapMode() const { return maMapMode; }
+ const MapMode& GetMapMode() const { return maMapMode; }
};
// ---------------------
@@ -1295,18 +1295,18 @@ class VCL_DLLPUBLIC MetaFontAction : public MetaAction
{
private:
- Font maFont;
+ Font maFont;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Font, META_FONT_ACTION )
MetaFontAction( const Font& rFont );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Scale( double fScaleX, double fScaleY );
- const Font& GetFont() const { return maFont; }
+ const Font& GetFont() const { return maFont; }
};
// ------------------
@@ -1317,16 +1317,16 @@ class VCL_DLLPUBLIC MetaPushAction : public MetaAction
{
private:
- sal_uInt16 mnFlags;
+ USHORT mnFlags;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Push, META_PUSH_ACTION )
- MetaPushAction( sal_uInt16 nFlags );
+ MetaPushAction( USHORT nFlags );
- sal_uInt16 GetFlags() const { return mnFlags; }
+ USHORT GetFlags() const { return mnFlags; }
};
// -----------------
@@ -1348,16 +1348,16 @@ class VCL_DLLPUBLIC MetaRasterOpAction : public MetaAction
{
private:
- RasterOp meRasterOp;
+ RasterOp meRasterOp;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( RasterOp, META_RASTEROP_ACTION )
MetaRasterOpAction( RasterOp eRasterOp );
- RasterOp GetRasterOp() const { return meRasterOp; }
+ RasterOp GetRasterOp() const { return meRasterOp; }
};
// -------------------------
@@ -1368,21 +1368,21 @@ class VCL_DLLPUBLIC MetaTransparentAction : public MetaAction
{
private:
- PolyPolygon maPolyPoly;
- sal_uInt16 mnTransPercent;
+ PolyPolygon maPolyPoly;
+ USHORT mnTransPercent;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
- MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent );
+ MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT nTransPercent );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
- sal_uInt16 GetTransparence() const { return mnTransPercent; }
+ const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
+ USHORT GetTransparence() const { return mnTransPercent; }
};
// ------------------------------
@@ -1393,12 +1393,12 @@ class VCL_DLLPUBLIC MetaFloatTransparentAction : public MetaAction
{
private:
- GDIMetaFile maMtf;
- Point maPoint;
- Size maSize;
- Gradient maGradient;
+ GDIMetaFile maMtf;
+ Point maPoint;
+ Size maSize;
+ Gradient maGradient;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION )
@@ -1406,13 +1406,13 @@ public:
MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos,
const Size& rSize, const Gradient& rGradient );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const GDIMetaFile& GetGDIMetaFile() const { return maMtf; }
- const Point& GetPoint() const { return maPoint; }
- const Size& GetSize() const { return maSize; }
- const Gradient& GetGradient() const { return maGradient; }
+ const GDIMetaFile& GetGDIMetaFile() const { return maMtf; }
+ const Point& GetPoint() const { return maPoint; }
+ const Size& GetSize() const { return maSize; }
+ const Gradient& GetGradient() const { return maGradient; }
};
// ---------------------
@@ -1423,12 +1423,12 @@ class VCL_DLLPUBLIC MetaEPSAction : public MetaAction
{
private:
- GfxLink maGfxLink;
- GDIMetaFile maSubst;
- Point maPoint;
- Size maSize;
+ GfxLink maGfxLink;
+ GDIMetaFile maSubst;
+ Point maPoint;
+ Size maSize;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( EPS, META_EPS_ACTION )
@@ -1436,13 +1436,13 @@ public:
MetaEPSAction( const Point& rPoint, const Size& rSize,
const GfxLink& rGfxLink, const GDIMetaFile& rSubst );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- const GfxLink& GetLink() const { return maGfxLink; }
- const GDIMetaFile& GetSubstitute() const { return maSubst; }
- const Point& GetPoint() const { return maPoint; }
- const Size& GetSize() const { return maSize; }
+ const GfxLink& GetLink() const { return maGfxLink; }
+ const GDIMetaFile& GetSubstitute() const { return maSubst; }
+ const Point& GetPoint() const { return maPoint; }
+ const Size& GetSize() const { return maSize; }
};
// ----------------------
@@ -1453,18 +1453,18 @@ class VCL_DLLPUBLIC MetaRefPointAction : public MetaAction
{
private:
- Point maRefPoint;
- sal_Bool mbSet;
+ Point maRefPoint;
+ BOOL mbSet;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
- MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet );
+ MetaRefPointAction( const Point& rRefPoint, BOOL bSet );
- const Point& GetRefPoint() const { return maRefPoint; }
- sal_Bool IsSetting() const { return mbSet; }
+ const Point& GetRefPoint() const { return maRefPoint; }
+ BOOL IsSetting() const { return mbSet; }
};
// ---------------------
@@ -1475,13 +1475,13 @@ class VCL_DLLPUBLIC MetaCommentAction : public MetaAction
{
private:
- ByteString maComment;
- sal_Int32 mnValue;
- sal_uInt32 mnDataSize;
- sal_uInt8* mpData;
+ ByteString maComment;
+ sal_Int32 mnValue;
+ sal_uInt32 mnDataSize;
+ BYTE* mpData;
- SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize );
- virtual sal_Bool Compare( const MetaAction& ) const;
+ SAL_DLLPRIVATE void ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize );
+ virtual sal_Bool Compare( const MetaAction& ) const;
protected:
~MetaCommentAction();
@@ -1489,21 +1489,21 @@ protected:
public:
MetaCommentAction( sal_Int32 nValue = 0L );
MetaCommentAction( const MetaCommentAction& rAct );
- 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 );
+ MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const BYTE* pData = NULL, sal_uInt32 nDataSize = 0UL );
+ MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize );
- virtual void Move( long nHorzMove, long nVertMove );
- virtual void Scale( double fScaleX, double fScaleY );
+ virtual void Move( long nHorzMove, long nVertMove );
+ virtual void Scale( double fScaleX, double fScaleY );
- virtual void Execute( OutputDevice* pOut );
+ virtual void Execute( OutputDevice* pOut );
virtual MetaAction* Clone();
- virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
- virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
+ virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
+ virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
- const ByteString& GetComment() const { return maComment; }
- sal_Int32 GetValue() const { return mnValue; }
- sal_uInt32 GetDataSize() const { return mnDataSize; }
- const sal_uInt8* GetData() const { return mpData; }
+ const ByteString& GetComment() const { return maComment; }
+ sal_Int32 GetValue() const { return mnValue; }
+ sal_uInt32 GetDataSize() const { return mnDataSize; }
+ const BYTE* GetData() const { return mpData; }
};
// ------------------------
@@ -1514,15 +1514,15 @@ class VCL_DLLPUBLIC MetaLayoutModeAction : public MetaAction
{
private:
- sal_uInt32 mnLayoutMode;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ sal_uInt32 mnLayoutMode;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION )
MetaLayoutModeAction( sal_uInt32 nLayoutMode );
- sal_uInt32 GetLayoutMode() const { return mnLayoutMode; }
+ sal_uInt32 GetLayoutMode() const { return mnLayoutMode; }
};
// ------------------------
@@ -1533,15 +1533,15 @@ class VCL_DLLPUBLIC MetaTextLanguageAction : public MetaAction
{
private:
- LanguageType meTextLanguage;
- virtual sal_Bool Compare( const MetaAction& ) const;
+ LanguageType meTextLanguage;
+ virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION )
MetaTextLanguageAction( LanguageType );
- LanguageType GetTextLanguage() const { return meTextLanguage; }
+ LanguageType GetTextLanguage() const { return meTextLanguage; }
};
#endif // _SV_METAACT_HXX
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
index 677135b99990..b78ce5df9247 100644
--- a/vcl/inc/vcl/metric.hxx
+++ b/vcl/inc/vcl/metric.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,22 +46,22 @@ class VCL_DLLPUBLIC FontInfo : public Font
friend class OutputDevice;
protected:
- ImplFontMetric* mpImplMetric; // Implementation
+ ImplFontMetric* mpImplMetric; // Implementation
public:
FontInfo();
FontInfo( const FontInfo& );
~FontInfo();
- FontType GetType() const;
- sal_Bool IsDeviceFont() const;
- sal_Bool SupportsLatin() const;
- sal_Bool SupportsCJK() const;
- sal_Bool SupportsCTL() const;
+ FontType GetType() const;
+ BOOL IsDeviceFont() const;
+ BOOL SupportsLatin() const;
+ BOOL SupportsCJK() const;
+ BOOL SupportsCTL() const;
- FontInfo& operator=( const FontInfo& );
- sal_Bool operator==( const FontInfo& ) const;
- sal_Bool operator!=( const FontInfo& rInfo ) const
+ FontInfo& operator=( const FontInfo& );
+ BOOL operator==( const FontInfo& ) const;
+ BOOL operator!=( const FontInfo& rInfo ) const
{ return !operator==( rInfo ); }
};
@@ -76,16 +76,16 @@ public:
FontMetric( const FontMetric& );
~FontMetric() {}
- long GetAscent() const;
- long GetDescent() const;
- long GetIntLeading() const;
- long GetExtLeading() const;
- long GetLineHeight() const;
- long GetSlant() const;
+ long GetAscent() const;
+ long GetDescent() const;
+ long GetIntLeading() const;
+ long GetExtLeading() const;
+ long GetLineHeight() const;
+ long GetSlant() const;
- FontMetric& operator=( const FontMetric& rMetric );
- sal_Bool operator==( const FontMetric& rMetric ) const;
- sal_Bool operator!=( const FontMetric& rMetric ) const
+ FontMetric& operator=( const FontMetric& rMetric );
+ BOOL operator==( const FontMetric& rMetric ) const;
+ BOOL operator!=( const FontMetric& rMetric ) const
{ return !operator==( rMetric ); }
};
@@ -96,14 +96,14 @@ public:
class VCL_DLLPUBLIC FontCharMap
{
private:
- const ImplFontCharMap* mpImpl;
+ ImplFontCharMap* mpImpl;
public:
FontCharMap();
~FontCharMap();
- sal_Bool IsDefaultMap() const;
- sal_Bool HasChar( sal_uInt32 ) const;
+ BOOL IsDefaultMap() const;
+ 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( const ImplFontCharMap* pNewMap = NULL );
+ void Reset( ImplFontCharMap* pNewMap = NULL );
// prevent assignment and copy construction
FontCharMap( const FontCharMap& );
@@ -135,30 +135,30 @@ class VCL_DLLPUBLIC TextRectInfo
friend class OutputDevice;
private:
- long mnMaxWidth;
- sal_uInt16 mnLineCount;
- sal_Bool mbEllipsis;
+ long mnMaxWidth;
+ USHORT mnLineCount;
+ BOOL mbEllipsis;
public:
TextRectInfo();
- sal_uInt16 GetLineCount() const { return mnLineCount; }
- long GetMaxLineWidth() const { return mnMaxWidth; }
- sal_Bool IsEllipses() const { return mbEllipsis; }
+ USHORT GetLineCount() const { return mnLineCount; }
+ long GetMaxLineWidth() const { return mnMaxWidth; }
+ BOOL IsEllipses() const { return mbEllipsis; }
- sal_Bool operator ==( const TextRectInfo& rInfo ) const
- { return ((mnMaxWidth == rInfo.mnMaxWidth) &&
- (mnLineCount == rInfo.mnLineCount) &&
- (mbEllipsis == rInfo.mbEllipsis)); }
- sal_Bool operator !=( const TextRectInfo& rInfo ) const
+ BOOL operator ==( const TextRectInfo& rInfo ) const
+ { return ((mnMaxWidth == rInfo.mnMaxWidth) &&
+ (mnLineCount == rInfo.mnLineCount) &&
+ (mbEllipsis == rInfo.mbEllipsis)); }
+ BOOL operator !=( const TextRectInfo& rInfo ) const
{ return !(TextRectInfo::operator==( rInfo )); }
};
inline TextRectInfo::TextRectInfo()
{
- mnMaxWidth = 0;
- mnLineCount = 0;
- mbEllipsis = sal_False;
+ mnMaxWidth = 0;
+ mnLineCount = 0;
+ mbEllipsis = FALSE;
}
#endif // _SV_METRIC_HXX
diff --git a/vcl/inc/vcl/mnemonic.hxx b/vcl/inc/vcl/mnemonic.hxx
index 1a0aac80a4a4..bdea35ffc471 100644
--- a/vcl/inc/vcl/mnemonic.hxx
+++ b/vcl/inc/vcl/mnemonic.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,25 +40,25 @@
// Mnemonic Chars, which we want support
// Latin 0-9
-#define MNEMONIC_RANGE_1_START 0x30
-#define MNEMONIC_RANGE_1_END 0x39
+#define MNEMONIC_RANGE_1_START 0x30
+#define MNEMONIC_RANGE_1_END 0x39
// Latin A-Z
-#define MNEMONIC_RANGE_2_START 0x41
-#define MNEMONIC_RANGE_2_END 0x5A
+#define MNEMONIC_RANGE_2_START 0x41
+#define MNEMONIC_RANGE_2_END 0x5A
// Cyrillic
-#define MNEMONIC_RANGE_3_START 0x0410
-#define MNEMONIC_RANGE_3_END 0x042F
+#define MNEMONIC_RANGE_3_START 0x0410
+#define MNEMONIC_RANGE_3_END 0x042F
// Greek
-#define MNEMONIC_RANGE_4_START 0x0391
-#define MNEMONIC_RANGE_4_END 0x03AB
-#define MNEMONIC_RANGES 4
-#define MAX_MNEMONICS ((MNEMONIC_RANGE_1_END-MNEMONIC_RANGE_1_START+1)+\
+#define MNEMONIC_RANGE_4_START 0x0391
+#define MNEMONIC_RANGE_4_END 0x03AB
+#define MNEMONIC_RANGES 4
+#define MAX_MNEMONICS ((MNEMONIC_RANGE_1_END-MNEMONIC_RANGE_1_START+1)+\
(MNEMONIC_RANGE_2_END-MNEMONIC_RANGE_2_START+1)+\
(MNEMONIC_RANGE_3_END-MNEMONIC_RANGE_3_START+1)+\
(MNEMONIC_RANGE_4_END-MNEMONIC_RANGE_4_START+1))
-#define MNEMONIC_CHAR ((sal_Unicode)'~')
-#define MNEMONIC_INDEX_NOTFOUND ((sal_uInt16)0xFFFF)
+#define MNEMONIC_CHAR ((sal_Unicode)'~')
+#define MNEMONIC_INDEX_NOTFOUND ((USHORT)0xFFFF)
// -------------------------
// - MnemonicGenerator -
@@ -68,18 +68,18 @@ class VCL_DLLPUBLIC MnemonicGenerator
{
private:
// 0 == Mnemonic; >0 == count of characters
- sal_uInt8 maMnemonics[MAX_MNEMONICS];
+ BYTE maMnemonics[MAX_MNEMONICS];
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
protected:
- SAL_DLLPRIVATE sal_uInt16 ImplGetMnemonicIndex( sal_Unicode c );
- SAL_DLLPRIVATE sal_Unicode ImplFindMnemonic( const XubString& rKey );
+ SAL_DLLPRIVATE USHORT ImplGetMnemonicIndex( sal_Unicode c );
+ SAL_DLLPRIVATE sal_Unicode ImplFindMnemonic( const XubString& rKey );
public:
MnemonicGenerator();
- void RegisterMnemonic( const XubString& rKey );
- sal_Bool CreateMnemonic( XubString& rKey );
+ void RegisterMnemonic( const XubString& rKey );
+ 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 79f6856cb704..3e196cbaf6bf 100644
--- a/vcl/inc/vcl/mnemonicengine.hxx
+++ b/vcl/inc/vcl/mnemonicengine.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -60,7 +60,7 @@ namespace vcl
If this value is <NULL/>, searching stops.
*/
- virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
+ virtual const void* FirstSearchEntry( String& _rEntryText ) = 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 ) const = 0;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) = 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 ) const = 0;
+ virtual void ExecuteSearchEntry( const void* _pEntry ) = 0;
};
//====================================================================
diff --git a/vcl/inc/vcl/morebtn.hxx b/vcl/inc/vcl/morebtn.hxx
index e84798479d7f..0a9c930ebb80 100644
--- a/vcl/inc/vcl/morebtn.hxx
+++ b/vcl/inc/vcl/morebtn.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,9 +44,9 @@ class VCL_DLLPUBLIC MoreButton : public PushButton
{
private:
ImplMoreButtonData* mpMBData;
- sal_uLong mnDelta;
+ ULONG mnDelta;
MapUnit meUnit;
- sal_Bool mbState;
+ BOOL mbState;
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE MoreButton( const MoreButton & );
@@ -56,7 +56,7 @@ private:
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
MoreButton( Window* pParent, WinBits nStyle = 0 );
@@ -68,15 +68,15 @@ public:
void AddWindow( Window* pWindow );
void RemoveWindow( Window* pWindow );
- void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
- sal_uLong GetDelta() const { return mnDelta; }
+ void SetDelta( ULONG nNewDelta ) { mnDelta = nNewDelta; }
+ ULONG GetDelta() const { return mnDelta; }
void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
MapUnit GetMapUnit() const { return meUnit; }
using PushButton::SetState;
- void SetState( sal_Bool bNewState = sal_True );
- sal_Bool GetState() const { return mbState; }
+ void SetState( BOOL bNewState = TRUE );
+ 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( sal_Bool bNewState )
+inline void MoreButton::SetState( BOOL bNewState )
{
if ( mbState != bNewState )
Click();
diff --git a/vcl/inc/vcl/msgbox.hxx b/vcl/inc/vcl/msgbox.hxx
index 326dae5616e3..d3af9841f861 100644
--- a/vcl/inc/vcl/msgbox.hxx
+++ b/vcl/inc/vcl/msgbox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,20 +45,20 @@ class CheckBox;
// Return-Werte von Execute
//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
-#define RET_OK sal_True
-#define RET_CANCEL sal_False
-#define RET_YES 2
-#define RET_NO 3
-#define RET_RETRY 4
+#define RET_OK TRUE
+#define RET_CANCEL FALSE
+#define RET_YES 2
+#define RET_NO 3
+#define RET_RETRY 4
#define RET_IGNORE 5
-#define BUTTONID_OK RET_OK
-#define BUTTONID_CANCEL RET_CANCEL
-#define BUTTONID_YES RET_YES
-#define BUTTONID_NO RET_NO
-#define BUTTONID_RETRY RET_RETRY
+#define BUTTONID_OK RET_OK
+#define BUTTONID_CANCEL RET_CANCEL
+#define BUTTONID_YES RET_YES
+#define BUTTONID_NO RET_NO
+#define BUTTONID_RETRY RET_RETRY
#define BUTTONID_IGNORE RET_IGNORE
-#define BUTTONID_HELP 10
+#define BUTTONID_HELP 10
// -----------
// - MessBox -
@@ -67,23 +67,24 @@ class CheckBox;
class VCL_DLLPUBLIC MessBox : public ButtonDialog
{
protected:
- FixedText* mpFixedText;
- FixedImage* mpFixedImage;
- XubString maMessText;
- Image maImage;
- sal_uInt16 mnSoundType;
- sal_Bool mbHelpBtn;
- sal_Bool mbSound;
+ FixedText* mpFixedText;
+ FixedImage* mpFixedImage;
+ XubString maMessText;
+ Image maImage;
+ Image maImageHC;
+ USHORT mnSoundType;
+ BOOL mbHelpBtn;
+ BOOL mbSound;
CheckBox* mpCheckBox;
XubString maCheckBoxText;
- sal_Bool mbCheck;
+ BOOL mbCheck;
- SAL_DLLPRIVATE void ImplInitMessBoxData();
- SAL_DLLPRIVATE void ImplInitButtons();
- SAL_DLLPRIVATE void ImplPosControls();
+ SAL_DLLPRIVATE void ImplInitMessBoxData();
+ SAL_DLLPRIVATE void ImplInitButtons();
+ SAL_DLLPRIVATE void ImplPosControls();
protected:
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
MessBox( WindowType nType );
public:
@@ -92,22 +93,22 @@ public:
MessBox( Window* pParent, const ResId& rResId );
~MessBox();
- virtual void StateChanged( StateChangedType nStateChange );
+ virtual void StateChanged( StateChangedType nStateChange );
- void SetMessText( const XubString& rText ) { maMessText = rText; }
- const XubString& GetMessText() const { return maMessText; }
+ void SetMessText( const XubString& rText ) { maMessText = rText; }
+ const XubString& GetMessText() const { return maMessText; }
- void SetImage( const Image& rImage ) { maImage = rImage; }
- const Image& GetImage() const { return maImage; }
+ void SetImage( const Image& rImage ) { maImage = rImage; }
+ const Image& GetImage() const { return maImage; }
- sal_Bool SetModeImage( const Image& rImage );
- const Image& GetModeImage( ) const;
+ BOOL SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
+ const Image& GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
void SetDefaultCheckBoxText();
void SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
const XubString& GetCheckBoxText() const { return maCheckBoxText;}
- void SetCheckBoxState( sal_Bool bCheck );
- sal_Bool GetCheckBoxState() const;
+ void SetCheckBoxState( BOOL bCheck );
+ BOOL GetCheckBoxState() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
};
@@ -119,13 +120,14 @@ public:
class VCL_DLLPUBLIC InfoBox : public MessBox
{
private:
- SAL_DLLPRIVATE void ImplInitInfoBoxData();
+ SAL_DLLPRIVATE void ImplInitInfoBoxData();
public:
InfoBox( Window* pParent, const XubString& rMessage );
InfoBox( Window* pParent, const ResId & rResId );
- static Image GetStandardImage();
+ static Image GetStandardImage();
+ static Image GetStandardImageHC();
};
// --------------
@@ -135,7 +137,7 @@ public:
class VCL_DLLPUBLIC WarningBox : public MessBox
{
private:
- SAL_DLLPRIVATE void ImplInitWarningBoxData();
+ SAL_DLLPRIVATE void ImplInitWarningBoxData();
public:
WarningBox( Window* pParent, WinBits nStyle,
@@ -144,7 +146,8 @@ public:
void SetDefaultCheckBoxText();
- static Image GetStandardImage();
+ static Image GetStandardImage();
+ static Image GetStandardImageHC();
};
// ------------
@@ -154,14 +157,15 @@ public:
class VCL_DLLPUBLIC ErrorBox : public MessBox
{
private:
- SAL_DLLPRIVATE void ImplInitErrorBoxData();
+ SAL_DLLPRIVATE void ImplInitErrorBoxData();
public:
ErrorBox( Window* pParent, WinBits nStyle,
const XubString& rMessage );
ErrorBox( Window* pParent, const ResId& rResId );
- static Image GetStandardImage();
+ static Image GetStandardImage();
+ static Image GetStandardImageHC();
};
// ------------
@@ -171,7 +175,7 @@ public:
class VCL_DLLPUBLIC QueryBox : public MessBox
{
private:
- SAL_DLLPRIVATE void ImplInitQueryBoxData();
+ SAL_DLLPRIVATE void ImplInitQueryBoxData();
public:
QueryBox( Window* pParent, WinBits nStyle,
@@ -180,9 +184,10 @@ public:
void SetDefaultCheckBoxText();
- static Image GetStandardImage();
+ static Image GetStandardImage();
+ static Image GetStandardImageHC();
};
-#endif // _SV_MSGBOX_HXX
+#endif // _SV_MSGBOX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/octree.hxx b/vcl/inc/vcl/octree.hxx
index 3cef6384a7d6..08f5153b7754 100644
--- a/vcl/inc/vcl/octree.hxx
+++ b/vcl/inc/vcl/octree.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,8 +36,8 @@
// - Defines -
// -----------
-#define OCTREE_BITS 5
-#define OCTREE_BITS_1 10
+#define OCTREE_BITS 5
+#define OCTREE_BITS_1 10
// --------------
// - OctreeNode -
@@ -45,19 +45,19 @@
typedef struct OctreeNode
{
- sal_uLong nCount;
- sal_uLong nRed;
- sal_uLong nGreen;
- sal_uLong nBlue;
+ ULONG nCount;
+ ULONG nRed;
+ ULONG nGreen;
+ ULONG nBlue;
OctreeNode* pChild[ 8 ];
- OctreeNode* pNext;
- OctreeNode* pNextInCache;
- sal_uInt16 nPalIndex;
- sal_Bool bLeaf;
+ OctreeNode* pNext;
+ OctreeNode* pNextInCache;
+ USHORT nPalIndex;
+ BOOL bLeaf;
} NODE;
-typedef NODE* PNODE;
-typedef PNODE* PPNODE;
+typedef NODE* PNODE;
+typedef PNODE* PPNODE;
// ----------
// - Octree -
@@ -66,48 +66,48 @@ typedef PNODE* PPNODE;
class ImpNodeCache;
class BitmapReadAccess;
-class VCL_PLUGIN_PUBLIC Octree
+class VCL_DLLPUBLIC Octree
{
private:
- BitmapPalette aPal;
- sal_uLong nMax;
- sal_uLong nLeafCount;
- sal_uLong nLevel;
- PNODE pTree;
- PNODE pReduce[ OCTREE_BITS + 1 ];
- BitmapColor* pColor;
- ImpNodeCache* pNodeCache;
- const BitmapReadAccess* pAcc;
- sal_uInt16 nPalIndex;
+ BitmapPalette aPal;
+ ULONG nMax;
+ ULONG nLeafCount;
+ ULONG nLevel;
+ PNODE pTree;
+ PNODE pReduce[ OCTREE_BITS + 1 ];
+ BitmapColor* pColor;
+ ImpNodeCache* pNodeCache;
+ const BitmapReadAccess* pAcc;
+ USHORT nPalIndex;
Octree() {};
- void CreatePalette( PNODE pNode );
- void GetPalIndex( PNODE pNode );
+ void CreatePalette( PNODE pNode );
+ void GetPalIndex( PNODE pNode );
SAL_DLLPRIVATE void ImplCreateOctree();
- SAL_DLLPRIVATE void ImplDeleteOctree( PPNODE ppNode );
- SAL_DLLPRIVATE void ImplAdd( PPNODE ppNode );
- SAL_DLLPRIVATE void ImplReduce();
+ SAL_DLLPRIVATE void ImplDeleteOctree( PPNODE ppNode );
+ SAL_DLLPRIVATE void ImplAdd( PPNODE ppNode );
+ SAL_DLLPRIVATE void ImplReduce();
-public:
+public:
- Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors );
- Octree( sal_uLong nColors );
+ Octree( const BitmapReadAccess& rReadAcc, ULONG nColors );
+ Octree( ULONG nColors );
~Octree();
- void AddColor( const BitmapColor& rColor );
+ void AddColor( const BitmapColor& rColor );
- inline const BitmapPalette& GetPalette();
- inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
+ inline const BitmapPalette& GetPalette();
+ inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
inline const BitmapPalette& Octree::GetPalette()
{
- aPal.SetEntryCount( (sal_uInt16) nLeafCount );
+ aPal.SetEntryCount( (USHORT) nLeafCount );
nPalIndex = 0;
CreatePalette( pTree );
return aPal;
@@ -115,7 +115,7 @@ inline const BitmapPalette& Octree::GetPalette()
// ------------------------------------------------------------------------
-inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
+inline USHORT Octree::GetBestPaletteIndex( const BitmapColor& rColor )
{
pColor = &(BitmapColor&) rColor;
nPalIndex = 65535;
@@ -128,32 +128,32 @@ inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
// - InverseColorMap -
// -------------------
-class VCL_PLUGIN_PUBLIC InverseColorMap
+class VCL_DLLPUBLIC InverseColorMap
{
private:
- sal_uInt8* pBuffer;
- sal_uInt8* pMap;
- const sal_uLong nBits;
+ BYTE* pBuffer;
+ BYTE* pMap;
+ const ULONG nBits;
- SAL_DLLPRIVATE void ImplCreateBuffers( const sal_uLong nMax );
+ SAL_DLLPRIVATE void ImplCreateBuffers( const ULONG nMax );
public:
- explicit InverseColorMap( const BitmapPalette& rPal );
+ InverseColorMap( const BitmapPalette& rPal );
~InverseColorMap();
- inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
+ inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
-inline sal_uInt16 InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
+inline USHORT InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
{
- return pMap[ ( ( (sal_uLong) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
- ( ( (sal_uLong) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
- ( (sal_uLong) rColor.GetBlue() >> nBits ) ];
+ return pMap[ ( ( (ULONG) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
+ ( ( (ULONG) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
+ ( (ULONG) rColor.GetBlue() >> nBits ) ];
}
#endif // _SV_OCTREE_HXX
diff --git a/vcl/inc/vcl/oldprintadaptor.hxx b/vcl/inc/vcl/oldprintadaptor.hxx
index 1a6705b42cb8..2d68a08eee53 100644
--- a/vcl/inc/vcl/oldprintadaptor.hxx
+++ b/vcl/inc/vcl/oldprintadaptor.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,10 +40,10 @@ namespace vcl
public:
OldStylePrintAdaptor( const boost::shared_ptr< Printer >& );
virtual ~OldStylePrintAdaptor();
-
+
void StartPage();
void EndPage();
-
+
virtual int getPageCount() const;
virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const;
virtual void printPage( int i_nPage ) const;
diff --git a/vcl/inc/vcl/outdata.hxx b/vcl/inc/vcl/outdata.hxx
index 2f4a9b5ed7aa..e0a3a541d42c 100644
--- a/vcl/inc/vcl/outdata.hxx
+++ b/vcl/inc/vcl/outdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/outdev.h b/vcl/inc/vcl/outdev.h
index fc6bab815c48..3b9b07eefb74 100644
--- a/vcl/inc/vcl/outdev.h
+++ b/vcl/inc/vcl/outdev.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,14 +48,14 @@ class GetDevSizeList;
// -----------------------
// flags for mnMatchType member
-#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)
+#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)
// 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
- sal_uIntPtr mnTypeFaces; // Typeface Flags
- sal_uIntPtr mnMatchType; // MATCH - Type
+ ULONG mnTypeFaces; // Typeface Flags
+ ULONG mnMatchType; // MATCH - Type
String maMatchFamilyName; // MATCH - FamilyName
FontWeight meMatchWeight; // MATCH - Weight
FontWidth meMatchWidth; // MATCH - Width
@@ -140,10 +140,10 @@ public:
// nowadays these substitutions are needed for backward compatibility and tight platform integration:
// - substitutions from configuration entries (Tools->Options->FontReplacement and/or fontconfig)
// - device specific substitutions (e.g. for PS printer builtin fonts)
-// - substitutions for missing fonts defined by configuration entries (generic and/or platform dependent fallbacks)
+// - substitutions for missing fonts defined by configuration entries (generic and/or platform dependent fallbacks)
// - substitutions for missing fonts defined by multi-token fontnames (e.g. fontname="SpecialFont;FallbackA;FallbackB")
// - substitutions for incomplete fonts (implicit, generic, EUDC and/or platform dependent fallbacks)
-// - substitutions for missing symbol fonts by translating code points into other symbol fonts
+// - substitutions for missing symbol fonts by translating code points into other symbol fonts
class ImplFontSubstitution
{
@@ -162,9 +162,9 @@ struct ImplFontSubstEntry
String maReplaceName;
String maSearchName;
String maSearchReplaceName;
- sal_uInt16 mnFlags;
+ USHORT mnFlags;
- ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, sal_uInt16 nSubstFlags );
+ ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, USHORT nSubstFlags );
};
class ImplDirectFontSubstitution
@@ -174,14 +174,14 @@ private:
typedef std::list<ImplFontSubstEntry> FontSubstList;
FontSubstList maFontSubstList;
public:
- void AddFontSubstitute( const String& rFontName, const String& rSubstName, sal_uInt16 nFlags );
+ void AddFontSubstitute( const String& rFontName, const String& rSubstName, USHORT nFlags );
void RemoveFontSubstitute( int nIndex );
- bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, sal_uInt16& rFlags ) const;
+ bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, USHORT& 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, sal_uInt16 nFlags ) const;
+ bool FindFontSubstitute( String& rSubstName, const String& rFontName, USHORT nFlags ) const;
};
// PreMatchFontSubstitution
@@ -218,11 +218,11 @@ private:
// cache of recently used font instances
struct IFSD_Equal { bool operator()( const ImplFontSelectData&, const ImplFontSelectData& ) const; };
struct IFSD_Hash { size_t operator()( const ImplFontSelectData& ) const; };
- typedef ::boost::unordered_map<ImplFontSelectData,ImplFontEntry*,IFSD_Hash,IFSD_Equal > FontInstanceList;
+ typedef ::std::hash_map<ImplFontSelectData,ImplFontEntry*,IFSD_Hash,IFSD_Equal > FontInstanceList;
FontInstanceList maFontInstanceList;
// cache of recently requested font names vs. selected font names
- typedef ::boost::unordered_map<String,String,FontNameHash> FontNameList;
+ typedef ::std::hash_map<String,String,FontNameHash> FontNameList;
FontNameList maFontNameList;
public:
@@ -250,14 +250,14 @@ namespace basegfx { class B2DHomMatrix; }
struct ImplOutDevData
{
- VirtualDevice* mpRotateDev;
- vcl::ControlLayoutData* mpRecordLayout;
- Rectangle maRecordRect;
- ImplDirectFontSubstitution maDevFontSubst;
+ VirtualDevice* mpRotateDev;
+ vcl::ControlLayoutData* mpRecordLayout;
+ Rectangle maRecordRect;
+ ImplDirectFontSubstitution maDevFontSubst;
// #i75163#
- basegfx::B2DHomMatrix* mpViewTransform;
- basegfx::B2DHomMatrix* mpInverseViewTransform;
+ basegfx::B2DHomMatrix* mpViewTransform;
+ basegfx::B2DHomMatrix* mpInverseViewTransform;
};
void ImplFreeOutDevFontData();
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index e6aaec2c9971..e975de6f7dbd 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -109,7 +109,6 @@ namespace vcl
class PDFWriterImpl;
class ExtOutDevData;
class ITextLayout;
- struct FontCapabilities;
}
#define OUTDEV_BUFFER_SIZE 128
@@ -153,55 +152,54 @@ struct KerningPair
// ----------------------
// Flags for Push()
-#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_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_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 ((sal_uInt16)0xFFFF)
+#define PUSH_ALL ((USHORT)0xFFFF)
// Flags for DrawText()
-#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)
+#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)
// Flags for CopyArea()
-#define COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
+#define COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
// Flags for DrawImage()
-#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_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_MONOCHROME_BLACK ((USHORT)0x0020)
+#define IMAGE_DRAW_MONOCHROME_WHITE ((USHORT)0x0040)
#define IMAGE_DRAW_3DLOOK 0
#define IMAGE_DRAW_BTNLOOK 0
@@ -211,63 +209,63 @@ struct KerningPair
#define WAVE_NORMAL 3
// Grid
-#define GRID_DOTS ((sal_uLong)0x00000001)
-#define GRID_HORZLINES ((sal_uLong)0x00000002)
-#define GRID_VERTLINES ((sal_uLong)0x00000004)
+#define GRID_DOTS ((ULONG)0x00000001)
+#define GRID_HORZLINES ((ULONG)0x00000002)
+#define GRID_VERTLINES ((ULONG)0x00000004)
#define GRID_LINES (GRID_HORZLINES | GRID_VERTLINES)
// LayoutModes for Complex Text Layout
-#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)
+#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)
// DrawModes
-#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)
+#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)
// Antialiasing
-#define ANTIALIASING_DISABLE_TEXT ((sal_uInt16)0x0001)
-#define ANTIALIASING_ENABLE_B2DDRAW ((sal_uInt16)0x0002)
-#define ANTIALIASING_PIXELSNAPHAIRLINE ((sal_uInt16)0x0004)
+#define ANTIALIASING_DISABLE_TEXT ((USHORT)0x0001)
+#define ANTIALIASING_ENABLE_B2DDRAW ((USHORT)0x0002)
+#define ANTIALIASING_PIXELSNAPHAIRLINE ((USHORT)0x0004)
// AddFontSubstitute
-#define FONT_SUBSTITUTE_ALWAYS ((sal_uInt16)0x0001)
-#define FONT_SUBSTITUTE_SCREENONLY ((sal_uInt16)0x0002)
+#define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001)
+#define FONT_SUBSTITUTE_SCREENONLY ((USHORT)0x0002)
-#define DEFAULTFONT_FLAGS_ONLYONE ((sal_uLong)0x00000001)
+#define DEFAULTFONT_FLAGS_ONLYONE ((ULONG)0x00000001)
enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
@@ -279,8 +277,6 @@ enum OutDevViewType { OUTDEV_VIEWTYPE_DONTKNOW, OUTDEV_VIEWTYPE_PRINTPREVIEW, OU
class VirtualDevice;
class Printer;
-class ImplFontSelectData;
-class ImplFontMetricData;
const char* ImplDbgCheckOutputDevice( const void* pObj );
@@ -314,19 +310,19 @@ private:
ImplOutDevData* mpOutDevData;
List* mpUnoGraphicsList;
vcl::PDFWriterImpl* mpPDFWriter;
- vcl::ExtOutDevData* mpExtOutDevData;
+ vcl::ExtOutDevData* mpExtOutDevData;
// TEMP TEMP TEMP
VirtualDevice* mpAlphaVDev;
/// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
- long mnOutOffOrigX;
+ long mnOutOffOrigX;
/// Additional output offset in _logical_ coordinates, applied in PixelToLogic (used by SetPixelOffset/GetPixelOffset)
- long mnOutOffLogicX;
+ long mnOutOffLogicX;
/// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
- long mnOutOffOrigY;
+ long mnOutOffOrigY;
/// Additional output offset in _logical_ coordinates, applied in PixelToLogic (used by SetPixelOffset/GetPixelOffset)
- long mnOutOffLogicY;
+ long mnOutOffLogicY;
/// Output offset for device output in pixel (pseudo window offset within window system's frames)
long mnOutOffX;
/// Output offset for device output in pixel (pseudo window offset within window system's frames)
@@ -340,8 +336,8 @@ private:
mutable long mnTextOffY;
mutable long mnEmphasisAscent;
mutable long mnEmphasisDescent;
- sal_uLong mnDrawMode;
- sal_uLong mnTextLayoutMode;
+ ULONG mnDrawMode;
+ ULONG mnTextLayoutMode;
ImplMapRes maMapRes;
ImplThresholdRes maThresRes;
OutDevType meOutDevType;
@@ -359,9 +355,9 @@ private:
AllSettings maSettings;
MapMode maMapMode;
Point maRefPoint;
- sal_uInt16 mnAntialiasing;
+ USHORT mnAntialiasing;
LanguageType meTextLanguage;
- mutable sal_Bool mbMap:1,
+ mutable BOOL mbMap:1,
mbMapIsDefault:1,
mbClipRegion:1,
mbBackground:1,
@@ -384,24 +380,25 @@ private:
mbEnableRTL:1;
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( sal_Bool bRelease = sal_True );
- SAL_DLLPRIVATE sal_Bool ImplHasMirroredGraphics();
+ 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 ImplReMirror( Point &rPoint ) const;
SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const;
SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const;
- SAL_DLLPRIVATE void ImplInitOutDevData();
- SAL_DLLPRIVATE void ImplDeInitOutDevData();
- SAL_DLLPRIVATE void ImplInitLineColor();
- SAL_DLLPRIVATE void ImplInitFillColor();
- SAL_DLLPRIVATE bool ImplNewFont() const;
- SAL_DLLPRIVATE void ImplInitFont() const;
- SAL_DLLPRIVATE void ImplInitTextColor();
- SAL_DLLPRIVATE void ImplInitClipRegion();
- SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
- SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion );
+ SAL_DLLPRIVATE void ImplInitOutDevData();
+ SAL_DLLPRIVATE void ImplDeInitOutDevData();
+ SAL_DLLPRIVATE void ImplInitLineColor();
+ SAL_DLLPRIVATE void ImplInitFillColor();
+ SAL_DLLPRIVATE bool ImplNewFont() const;
+ SAL_DLLPRIVATE void ImplInitFont() const;
+ SAL_DLLPRIVATE void ImplInitTextColor();
+ 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),
@@ -416,90 +413,90 @@ public:
SAL_DLLPRIVATE long ImplGetTextWidth( const SalLayout& ) const;
static
SAL_DLLPRIVATE XubString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rStr,
- long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
+ long nMaxWidth, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
static
SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, sal_uInt16 nStyle,
+ const String& rOrigStr, USHORT 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, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove );
SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, sal_Bool bTextLines );
+ SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, BOOL bTextLines );
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawText( SalLayout& );
SAL_DLLPRIVATE Rectangle ImplGetTextBoundRect( const SalLayout& );
- SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& );
+ SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
+ SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
- 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, 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 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 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, sal_Bool bUnderlineAbove );
- SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
- 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 );
+ SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, 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 );
static
- 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 );
-
- SAL_DLLPRIVATE long ImplLogicXToDevicePixel( long nX ) const;
- SAL_DLLPRIVATE long ImplLogicYToDevicePixel( long nY ) const;
- SAL_DLLPRIVATE long ImplLogicWidthToDevicePixel( long nWidth ) const;
- SAL_DLLPRIVATE long ImplLogicHeightToDevicePixel( long nHeight ) const;
- SAL_DLLPRIVATE long ImplDevicePixelToLogicWidth( long nWidth ) const;
- SAL_DLLPRIVATE long ImplDevicePixelToLogicHeight( long nHeight ) const;
- SAL_DLLPRIVATE float ImplFloatLogicWidthToDevicePixel( float ) const;
- SAL_DLLPRIVATE float ImplFloatLogicHeightToDevicePixel( float ) const;
- SAL_DLLPRIVATE float ImplFloatDevicePixelToLogicWidth( float ) const;
- SAL_DLLPRIVATE float ImplFloatDevicePixelToLogicHeight( float ) const;
- SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const;
- SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const;
- SAL_DLLPRIVATE Rectangle ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const;
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE void ImplInitFontList() const;
+ SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists );
+ SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
+
+ SAL_DLLPRIVATE long ImplLogicXToDevicePixel( long nX ) const;
+ SAL_DLLPRIVATE long ImplLogicYToDevicePixel( long nY ) const;
+ SAL_DLLPRIVATE long ImplLogicWidthToDevicePixel( long nWidth ) const;
+ SAL_DLLPRIVATE long ImplLogicHeightToDevicePixel( long nHeight ) const;
+ SAL_DLLPRIVATE long ImplDevicePixelToLogicWidth( long nWidth ) const;
+ SAL_DLLPRIVATE long ImplDevicePixelToLogicHeight( long nHeight ) const;
+ SAL_DLLPRIVATE float ImplFloatLogicWidthToDevicePixel( float ) const;
+ SAL_DLLPRIVATE float ImplFloatLogicHeightToDevicePixel( float ) const;
+ SAL_DLLPRIVATE float ImplFloatDevicePixelToLogicWidth( float ) const;
+ SAL_DLLPRIVATE float ImplFloatDevicePixelToLogicHeight( float ) const;
+ SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const;
+ SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const;
+ SAL_DLLPRIVATE Rectangle ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const;
SAL_DLLPRIVATE ::basegfx::B2DPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolygon& ) const;
SAL_DLLPRIVATE ::basegfx::B2DPolyPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolyPolygon& ) const;
- SAL_DLLPRIVATE Polygon ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const;
- SAL_DLLPRIVATE PolyPolygon ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const;
- SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const;
- SAL_DLLPRIVATE Rectangle ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const;
- SAL_DLLPRIVATE Region ImplPixelToDevicePixel( const Region& rRegion ) const;
- SAL_DLLPRIVATE void ImplInvalidateViewTransform();
+ SAL_DLLPRIVATE Polygon ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const;
+ SAL_DLLPRIVATE PolyPolygon ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const;
+ SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const;
+ SAL_DLLPRIVATE Rectangle ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const;
+ SAL_DLLPRIVATE Region ImplPixelToDevicePixel( const Region& rRegion ) const;
+ SAL_DLLPRIVATE void ImplInvalidateViewTransform();
SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const;
- 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( 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 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 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 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 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 );
- SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
- SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
- SAL_DLLPRIVATE void ImplDraw2ColorFrame( const Rectangle& rRect, const Color& rLeftTopColor, const Color& rRightBottomColor );
+ 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 );
+ SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
+ SAL_DLLPRIVATE void ImplDraw2ColorFrame( const Rectangle& rRect, const Color& rLeftTopColor, const Color& rRightBottomColor );
- SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
- SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ 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 sal_uLong nAction );
- SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap, const ULONG nAction );
+ SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx, const sal_uLong nAction );
- SAL_DLLPRIVATE void ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
+ const BitmapEx& rBitmapEx, const 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 sal_uLong nAction );
- SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
+ const ULONG nAction );
+ SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
SAL_DLLPRIVATE Bitmap ImplBlend( Bitmap aBmp,
@@ -525,28 +522,28 @@ public:
const sal_Int32 nDstWidth,
const long* pMapX,
const long* pMapY );
- SAL_DLLPRIVATE void ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
+ SAL_DLLPRIVATE void ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
- SAL_DLLPRIVATE void ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
+ SAL_DLLPRIVATE void ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
- SAL_DLLPRIVATE void ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+ SAL_DLLPRIVATE void ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
const OutputDevice& rOutDev, const Region& rRegion );
- SAL_DLLPRIVATE void ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
+ SAL_DLLPRIVATE void ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize,
OutputDevice& rOutDev );
- SAL_DLLPRIVATE void ImplGetFrameBitmap( const Point& rPt, const Size& rSize,
+ SAL_DLLPRIVATE void ImplGetFrameBitmap( const Point& rPt, const Size& rSize,
Bitmap& rBitmap ) const;
- SAL_DLLPRIVATE sal_Bool ImplIsRecordLayout() const;
+ SAL_DLLPRIVATE BOOL ImplIsRecordLayout() const;
void ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- sal_uInt16 nFlags = 0 );
+ USHORT nFlags = 0 );
SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
- SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& );
-
+ SAL_DLLPRIVATE static 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 ;
@@ -554,7 +551,7 @@ public:
// Helper which holds the old line geometry creation and is extended to use AA when
// switched on. Advantage is that line geometry is only temporarily used for paint
SAL_DLLPRIVATE void ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo);
-
+
// #i101491#
// Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon
// without MetaFile processing
@@ -567,9 +564,6 @@ public:
// Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area)
void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon);
- SAL_DLLPRIVATE void forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &rFallbackFont,
- ImplFontSelectData &rFontSelData, int nFallbackLevel,
- ImplLayoutArgs& rLayoutArgs, const ImplFontMetricData& rOrigMetric) const;
protected:
OutputDevice();
@@ -591,15 +585,15 @@ public:
vcl::PDFWriterImpl* GetPDFWriter() const { return mpPDFWriter; }
- void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
- vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
+ void SetExtOutDevData( vcl::ExtOutDevData* pExtOutDevData ) { mpExtOutDevData = pExtOutDevData; }
+ vcl::ExtOutDevData* GetExtOutDevData() const { return mpExtOutDevData; }
void DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- sal_Bool bUnderlineAbove = sal_False );
- static sal_Bool IsTextUnderlineAbove( const Font& rFont );
+ BOOL bUnderlineAbove = FALSE );
+ static BOOL IsTextUnderlineAbove( const Font& rFont );
void DrawText( const Point& rStartPt, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
@@ -617,15 +611,15 @@ public:
bool GetCaretPositions( const XubString&, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry = NULL, long nWidth = 0,
- sal_Bool bCellBreaking = sal_True ) const;
- void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
+ BOOL bCellBreaking = TRUE ) const;
+ void DrawStretchText( const Point& rStartPt, 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, sal_Bool bCellBreaking = sal_True ) const;
+ long nCharExtra = 0, BOOL bCellBreaking = TRUE ) const;
xub_StrLen GetTextBreak( const XubString& rStr, long nTextWidth,
- sal_uInt16 nExtraChar, xub_StrLen& rExtraCharPos,
+ USHORT nExtraChar, xub_StrLen& rExtraCharPos,
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra = 0 ) const;
/** Generate MetaTextActions for the text rect
@@ -638,47 +632,47 @@ public:
*/
void AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- sal_uInt16 nStyle,
+ USHORT nStyle,
GDIMetaFile& rMtf );
void DrawText( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle = 0,
+ const XubString& rStr, USHORT nStyle = 0,
MetricVector* pVector = NULL, String* pDisplayText = NULL,
::vcl::ITextLayout* _pTextLayout = NULL );
Rectangle GetTextRect( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
+ const XubString& rStr, USHORT nStyle = TEXT_DRAW_WORDBREAK,
TextRectInfo* pInfo = NULL,
const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
XubString GetEllipsisString( const XubString& rStr, long nMaxWidth,
- sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
+ USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
+ USHORT nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
long GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN,
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
+ USHORT 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 ); }
- sal_uLong GetKerningPairCount() const;
- void GetKerningPairs( sal_uLong nPairs, KerningPair* pKernPairs ) const;
+ ULONG GetKerningPairCount() const;
+ void GetKerningPairs( ULONG nPairs, KerningPair* pKernPairs ) const;
- sal_Bool GetTextBoundRect( Rectangle& rRect,
+ BOOL GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- sal_Bool GetTextOutline( PolyPolygon&,
+ ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ BOOL GetTextOutline( PolyPolygon&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
- sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- sal_Bool GetTextOutlines( PolyPolyVector&,
+ xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
+ ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ BOOL GetTextOutlines( PolyPolyVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- 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&,
+ xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
+ ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ BOOL GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- 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,
+ 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,
int nLen, int nBase, MetricVector& rVector );
void DrawPixel( const Point& rPt );
@@ -742,7 +736,7 @@ public:
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
- sal_uLong nHorzRount, sal_uLong nVertRound );
+ ULONG nHorzRount, ULONG nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
@@ -758,7 +752,7 @@ public:
const OutputDevice& rOutDev );
void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- sal_uInt16 nFlags = 0 );
+ USHORT nFlags = 0 );
void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -785,9 +779,9 @@ public:
const Bitmap& rBitmap, const Color& rMaskColor );
void DrawImage( const Point& rPos,
- const Image& rImage, sal_uInt16 nStyle = 0 );
+ const Image& rImage, USHORT nStyle = 0 );
void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, sal_uInt16 nStyle = 0 );
+ const Image& rImage, USHORT nStyle = 0 );
void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
@@ -808,10 +802,10 @@ public:
#endif
void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
- void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle );
- void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags );
+ void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle );
+ void DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags );
- void DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
+ void DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent );
void DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency);
void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, const Gradient& rTransparenceGradient );
@@ -824,40 +818,41 @@ public:
*/
BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
- void EnableMapMode( sal_Bool bEnable = sal_True );
- sal_Bool IsMapModeEnabled() const { return mbMap; }
+ void EnableMapMode( BOOL bEnable = TRUE );
+ BOOL IsMapModeEnabled() const { return mbMap; }
// Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
- void EnableRTL( sal_Bool bEnable = sal_True);
- sal_Bool IsRTLEnabled() const { return mbEnableRTL; }
+ void EnableRTL( BOOL bEnable = TRUE);
+ BOOL IsRTLEnabled() const { return mbEnableRTL; }
void SetConnectMetaFile( GDIMetaFile* pMtf );
GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; }
- 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 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 SetClipRegion();
void SetClipRegion( const Region& rRegion );
+ void SetTriangleClipRegion( const PolyPolygon &rRegion );
Region GetClipRegion() const;
- sal_Bool IsClipRegion() const { return mbClipRegion; }
+ 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( sal_uInt16 nMode = 0 );
- sal_uInt16 GetAntialiasing() const { return mnAntialiasing; }
+ void SetAntialiasing( USHORT nMode = 0 );
+ USHORT GetAntialiasing() const { return mnAntialiasing; }
- void SetDrawMode( sal_uLong nDrawMode );
- sal_uLong GetDrawMode() const { return mnDrawMode; }
+ void SetDrawMode( ULONG nDrawMode );
+ ULONG GetDrawMode() const { return mnDrawMode; }
- void SetLayoutMode( sal_uLong nTextLayoutMode );
- sal_uLong GetLayoutMode() const { return mnTextLayoutMode; }
+ void SetLayoutMode( ULONG nTextLayoutMode );
+ ULONG GetLayoutMode() const { return mnTextLayoutMode; }
void SetDigitLanguage( LanguageType );
LanguageType GetDigitLanguage() const { return meTextLanguage; }
@@ -878,18 +873,18 @@ public:
void SetLineColor();
void SetLineColor( const Color& rColor );
const Color& GetLineColor() const { return maLineColor; }
- sal_Bool IsLineColor() const { return mbLineColor; }
+ BOOL IsLineColor() const { return mbLineColor; }
void SetFillColor();
void SetFillColor( const Color& rColor );
const Color& GetFillColor() const { return maFillColor; }
- sal_Bool IsFillColor() const { return mbFillColor; }
+ BOOL IsFillColor() const { return mbFillColor; }
void SetBackground();
void SetBackground( const Wallpaper& rBackground );
const Wallpaper& GetBackground() const { return maBackground; }
- sal_Bool IsBackground() const { return mbBackground; }
+ BOOL IsBackground() const { return mbBackground; }
void SetFont( const Font& rNewFont );
const Font& GetFont() const { return maFont; }
@@ -905,15 +900,15 @@ public:
void SetTextFillColor( const Color& rColor );
Color GetTextFillColor() const;
- sal_Bool IsTextFillColor() const { return !maFont.IsTransparent(); }
+ BOOL IsTextFillColor() const { return !maFont.IsTransparent(); }
void SetTextLineColor();
void SetTextLineColor( const Color& rColor );
const Color& GetTextLineColor() const { return maTextLineColor; }
- sal_Bool IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
+ BOOL IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
void SetOverlineColor();
void SetOverlineColor( const Color& rColor );
const Color& GetOverlineColor() const { return maOverlineColor; }
- sal_Bool IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
+ BOOL IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
void SetTextAlign( TextAlign eAlign );
TextAlign GetTextAlign() const { return maFont.GetAlign(); }
@@ -927,17 +922,17 @@ public:
virtual void SetMapMode( const MapMode& rNewMapMode );
virtual void SetRelativeMapMode( const MapMode& rNewMapMode );
const MapMode& GetMapMode() const { return maMapMode; }
- sal_Bool IsMapMode() const { return mbMap; }
+ BOOL IsMapMode() const { return mbMap; }
void SetRefPoint();
void SetRefPoint( const Point& rRefPoint );
const Point& GetRefPoint() const { return maRefPoint; }
- sal_Bool IsRefPoint() const { return mbRefPoint; }
+ BOOL IsRefPoint() const { return mbRefPoint; }
// #i75163#
basegfx::B2DHomMatrix GetViewTransformation() const;
basegfx::B2DHomMatrix GetInverseViewTransformation() const;
-
+
basegfx::B2DHomMatrix GetViewTransformation( const MapMode& rMapMode ) const;
basegfx::B2DHomMatrix GetInverseViewTransformation( const MapMode& rMapMode ) const;
@@ -964,7 +959,7 @@ public:
@param rOffset
The offset in pixel
*/
- void SetPixelOffset( const Size& rOffset );
+ void SetPixelOffset( const Size& rOffset );
/** Get the offset in pixel
@@ -972,7 +967,7 @@ public:
@return the current offset in pixel
*/
- Size GetPixelOffset() const;
+ Size GetPixelOffset() const;
Point LogicToPixel( const Point& rLogicPt ) const;
Size LogicToPixel( const Size& rLogicSize ) const;
@@ -1033,7 +1028,7 @@ public:
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
long* LogicToLogic( long* pX,
- sal_uInt16 nCount,
+ USHORT nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
static Point LogicToLogic( const Point& rPtSource,
@@ -1055,13 +1050,13 @@ public:
static basegfx::B2DPolyPolygon LogicToLogic( const basegfx::B2DPolyPolygon& rPolyPoly,
const MapMode& rMapModeSource,
const MapMode& rMapModeDest );
-
+
Size GetOutputSizePixel() const
{ return Size( mnOutWidth, mnOutHeight ); }
- long GetOutputWidthPixel() const { return mnOutWidth; }
- long GetOutputHeightPixel() const { return mnOutHeight; }
- long GetOutOffXPixel() const { return mnOutOffX; }
- long GetOutOffYPixel() const { return mnOutOffY; }
+ long GetOutputWidthPixel() const { return mnOutWidth; }
+ long GetOutputHeightPixel() const { return mnOutHeight; }
+ long GetOutOffXPixel() const { return mnOutOffX; }
+ long GetOutOffYPixel() const { return mnOutOffY; }
Size GetOutputSize() const
{ return PixelToLogic( GetOutputSizePixel() ); }
@@ -1069,17 +1064,16 @@ public:
void Erase();
void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
- sal_Bool AddTempDevFont( const String& rFileURL, const String& rFontName );
+ 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;
- sal_Bool IsFontAvailable( const String& rFontName ) const;
+ BOOL IsFontAvailable( const String& rFontName ) const;
FontMetric GetFontMetric() const;
FontMetric GetFontMetric( const Font& rFont ) const;
- sal_Bool GetFontCharMap( FontCharMap& rFontCharMap ) const;
- bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
+ BOOL GetFontCharMap( FontCharMap& rFontCharMap ) const;
xub_StrLen HasGlyphs( const Font& rFont, const String& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN ) const;
@@ -1090,16 +1084,16 @@ public:
// i60594
// validate kashida positions against the current font
// returns count of invalid kashida positions
- xub_StrLen ValidateKashidas ( const String& rTxt,
+ xub_StrLen ValidateKashidas ( const String& rTxt,
xub_StrLen nIdx, xub_StrLen nLen,
xub_StrLen nKashCount, // number of suggested kashida positions (in)
const xub_StrLen* pKashidaPos, // suggested kashida positions (in)
xub_StrLen* pKashidaPosDropped // invalid kashida positions (out)
) const;
- sal_uInt16 GetBitCount() const;
+ USHORT GetBitCount() const;
- sal_Bool GetTextIsRTL( const String&, xub_StrLen nIndex,
+ BOOL GetTextIsRTL( const String&, xub_StrLen nIndex,
xub_StrLen nLen ) const;
/** Query the existence and depth of the alpha channel
@@ -1107,25 +1101,21 @@ public:
@return 0, if no alpha channel available, and the bit depth of
the alpha channel otherwise.
*/
- sal_uInt16 GetAlphaBitCount() const;
- sal_uLong GetColorCount() const;
+ USHORT GetAlphaBitCount() const;
+ ULONG GetColorCount() const;
- void Push( sal_uInt16 nFlags = PUSH_ALL );
+ void Push( USHORT 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 sal_True, if this device has an alpha channel.
+ @return TRUE, if this device has an alpha channel.
*/
- sal_Bool HasAlpha();
+ 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 in Metafiles). This
+ painting rotated EPS files (e.g. contained mín 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,
@@ -1143,17 +1133,17 @@ public:
static void EndFontSubstitution();
static void AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- sal_uInt16 nFlags = 0 );
- static void RemoveFontSubstitute( sal_uInt16 n );
- static sal_uInt16 GetFontSubstituteCount();
- static void GetFontSubstitute( sal_uInt16 n,
+ USHORT nFlags = 0 );
+ static void RemoveFontSubstitute( USHORT n );
+ static USHORT GetFontSubstituteCount();
+ static void GetFontSubstitute( USHORT n,
XubString& rFontName,
XubString& rReplaceFontName,
- sal_uInt16& rFlags );
+ USHORT& rFlags );
- static Font GetDefaultFont( sal_uInt16 nType,
+ static Font GetDefaultFont( USHORT nType,
LanguageType eLang,
- sal_uLong nFlags,
+ ULONG nFlags,
const OutputDevice* pOutDev = NULL );
/** helper method removing transparencies from a metafile (e.g. for printing)
@@ -1197,17 +1187,17 @@ public:
// These all just call through to the private mpGraphics functions of the same name.
// Query the platform layer for control support
- sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- sal_Bool HitTestNativeControl( ControlType nType,
+ BOOL HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- sal_Bool& rIsInside );
+ BOOL& rIsInside );
// Request rendering of a particular control and/or part
- sal_Bool DrawNativeControl( ControlType nType,
+ BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1215,7 +1205,7 @@ public:
::rtl::OUString aCaption );
// Request rendering of a caption string for a control
- sal_Bool DrawNativeControlText( ControlType nType,
+ BOOL DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1223,7 +1213,7 @@ public:
::rtl::OUString aCaption );
// Query the native control's actual drawing region (including adornment)
- sal_Bool GetNativeControlRegion( ControlType nType,
+ 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 faf2b00793f2..5555930b8f35 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,6 +30,7 @@
#define _SV_OUTFONT_HXX
#include <tools/string.hxx>
+#include <tools/list.hxx>
#include <i18npool/lang.h>
#include <tools/gen.hxx>
#include <tools/solar.h>
@@ -37,7 +38,9 @@
#include <unotools/fontdefs.hxx>
#include <vcl/vclenum.hxx>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
+
+#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
class ImplDevFontListData;
class ImplGetDevFontList;
@@ -52,8 +55,6 @@ class ConvertChar;
struct FontMatchStatus;
class OutputDevice;
-namespace com { namespace sun { namespace star { namespace lang { struct Locale; }}}}
-
// ----------------------
// - ImplFontAttributes -
// ----------------------
@@ -116,7 +117,7 @@ public: // TODO: hide members behind accessor methods
// TODO: make cloning cheaper
// abstract base class for physical font faces
-class VCL_PLUGIN_PUBLIC ImplFontData : public ImplDevFontAttributes
+class VCL_DLLPUBLIC ImplFontData : public ImplDevFontAttributes
{
public:
// by using an ImplFontData object as a factory for its corresponding
@@ -140,7 +141,7 @@ public:
virtual ImplFontData* Clone() const = 0;
protected:
- explicit ImplFontData( const ImplDevFontAttributes&, int nMagic );
+ ImplFontData( const ImplDevFontAttributes&, int nMagic );
void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
long mnWidth; // Width (in pixels)
@@ -185,22 +186,22 @@ public: // TODO: change to private
// TODO: merge with ImplFontCache
// TODO: rename to LogicalFontManager
-class VCL_PLUGIN_PUBLIC ImplDevFontList
+class VCL_DLLPUBLIC ImplDevFontList
{
private:
friend class WinGlyphFallbackSubstititution;
mutable bool mbMatchData; // true if matching attributes are initialized
bool mbMapNames; // true if MapNames are available
- typedef boost::unordered_map<const String, ImplDevFontListData*,FontNameHash> DevFontList;
+ typedef std::hash_map<const String, ImplDevFontListData*,FontNameHash> DevFontList;
DevFontList maDevFontList;
ImplPreMatchFontSubstitution* mpPreMatchHook; // device specific prematch substitution
ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyh fallback substitution
public:
- explicit ImplDevFontList();
- virtual ~ImplDevFontList();
+ ImplDevFontList();
+ ~ImplDevFontList();
// fill the list with device fonts
void Add( ImplFontData* );
@@ -226,7 +227,7 @@ public:
ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const;
//used by 2-level font fallback
- ImplDevFontListData* ImplFindByLocale( com::sun::star::lang::Locale& ) const;
+ ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const;
protected:
void InitMatchData() const;
@@ -235,7 +236,7 @@ protected:
ImplDevFontListData* ImplFindByTokenNames( const String& ) const;
ImplDevFontListData* ImplFindByAliasName( const String& rSearchName, const String& rShortName ) const;
ImplDevFontListData* ImplFindBySubstFontAttr( const utl::FontNameAttr& ) const;
- ImplDevFontListData* ImplFindByAttributes( sal_uLong nSearchType, FontWeight, FontWidth,
+ ImplDevFontListData* ImplFindByAttributes( ULONG nSearchType, FontWeight, FontWidth,
FontFamily, FontItalic, const String& rSearchFamily ) const;
ImplDevFontListData* FindDefaultFont() const;
@@ -254,8 +255,8 @@ private:
struct ImplKernPairData
{
- sal_uInt16 mnChar1;
- sal_uInt16 mnChar2;
+ USHORT mnChar1;
+ USHORT mnChar2;
long mnKern;
};
@@ -267,12 +268,12 @@ struct ImplKernPairData
class ImplFontMetricData : public ImplFontAttributes
{
public:
- explicit ImplFontMetricData( const ImplFontSelectData& );
+ ImplFontMetricData( const ImplFontSelectData& );
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
public: // TODO: hide members behind accessor methods
- // font instance attributes from the font request
+ // font instance attributes from the font request
long mnWidth; // Reference Width
short mnOrientation; // Rotation in 1/10 degrees
@@ -324,10 +325,10 @@ public: // TODO: hide members behind accessor methods
// TODO: rename ImplFontEntry to LogicalFontInstance
// TODO: allow sharing of metrics for related fonts
-class VCL_PLUGIN_PUBLIC ImplFontEntry
+class VCL_DLLPUBLIC ImplFontEntry
{
public:
- explicit ImplFontEntry( const ImplFontSelectData& );
+ ImplFontEntry( const ImplFontSelectData& );
virtual ~ImplFontEntry();
public: // TODO: make data members private
@@ -335,8 +336,8 @@ public: // TODO: make data members private
ImplFontMetricData maMetric; // Font Metric
const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
long mnLineHeight;
- sal_uLong mnRefCount;
- sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
+ ULONG mnRefCount;
+ USHORT 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
@@ -351,7 +352,7 @@ private:
// TODO: at least the ones which just differ in orientation, stretching or height
typedef ::std::pair<sal_UCS4,FontWeight> GFBCacheKey;
struct GFBCacheKey_Hash{ size_t operator()( const GFBCacheKey& ) const; };
- typedef ::boost::unordered_map<GFBCacheKey,String,GFBCacheKey_Hash> UnicodeFallbackList;
+ typedef ::std::hash_map<GFBCacheKey,String,GFBCacheKey_Hash> UnicodeFallbackList;
UnicodeFallbackList* mpUnicodeFallbackList;
};
@@ -393,7 +394,7 @@ public:
void AddLine( ImplTextLineInfo* pLine );
void Clear();
- ImplTextLineInfo* GetLine( sal_uInt16 nLine ) const
+ ImplTextLineInfo* GetLine( USHORT 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 f4b8039fc9e8..59fdc76d354b 100644
--- a/vcl/inc/vcl/pdfextoutdevdata.hxx
+++ b/vcl/inc/vcl/pdfextoutdevdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@
class Graphic;
-namespace vcl { class PDFWriter; }
+namespace vcl { class PDFWriter; }
namespace vcl
{
@@ -53,8 +53,8 @@ namespace vcl
*/
struct PDFExtOutDevBookmarkEntry
{
- sal_Int32 nLinkId;
- rtl::OUString aBookmark;
+ sal_Int32 nLinkId;
+ rtl::OUString aBookmark;
};
/*
@@ -69,19 +69,19 @@ class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
const OutputDevice& mrOutDev;
sal_Bool mbTaggedPDF;
- sal_Bool mbExportNotes;
- sal_Bool mbTransitionEffects;
- sal_Bool mbUseLosslessCompression;
- sal_Bool mbReduceImageResolution;
+ sal_Bool mbExportNotes;
+ sal_Bool mbTransitionEffects;
+ sal_Bool mbUseLosslessCompression;
+ sal_Bool mbReduceImageResolution;
sal_Bool mbExportFormFields;
sal_Bool mbExportBookmarks;
sal_Bool mbExportNDests; //i56629
sal_Int32 mnFormsFormat;
- sal_Int32 mnPage;
+ sal_Int32 mnPage;
com::sun::star::lang::Locale maDocLocale;
- PageSyncData* mpPageSyncData;
- GlobalSyncData* mpGlobalSyncData;
+ PageSyncData* mpPageSyncData;
+ GlobalSyncData* mpGlobalSyncData;
std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
@@ -98,20 +98,20 @@ public :
- sal_Bool GetIsExportNotes() const;
- void SetIsExportNotes( const sal_Bool bExportNotes );
+ sal_Bool GetIsExportNotes() const;
+ void SetIsExportNotes( const sal_Bool bExportNotes );
- sal_Bool GetIsExportTaggedPDF() const;
- void SetIsExportTaggedPDF( const sal_Bool bTaggedPDF );
+ sal_Bool GetIsExportTaggedPDF() const;
+ void SetIsExportTaggedPDF( const sal_Bool bTaggedPDF );
- sal_Bool GetIsExportTransitionEffects() const;
- void SetIsExportTransitionEffects( const sal_Bool bTransitionalEffects );
+ sal_Bool GetIsExportTransitionEffects() const;
+ void SetIsExportTransitionEffects( const sal_Bool bTransitionalEffects );
sal_Bool GetIsExportFormFields() const;
void SetIsExportFormFields( const sal_Bool bExportFormFields );
- sal_Int32 GetFormsFormat() const;
- void SetFormsFormat( const sal_Int32 nFormsFormat );
+ sal_Int32 GetFormsFormat() const;
+ void SetFormsFormat( const sal_Int32 nFormsFormat );
sal_Bool GetIsExportBookmarks() const;
void SetIsExportBookmarks( const sal_Bool bExportBookmarks );
@@ -120,14 +120,14 @@ public :
void SetIsExportNamedDestinations( const sal_Bool bExportNDests ); //i56629
// PageNumber, Compression is being set by the PDFExport
- sal_Int32 GetCurrentPageNumber() const;
- void SetCurrentPageNumber( const sal_Int32 nPage );
+ sal_Int32 GetCurrentPageNumber() const;
+ void SetCurrentPageNumber( const sal_Int32 nPage );
- sal_Bool GetIsLosslessCompression() const;
- void SetIsLosslessCompression( const sal_Bool bLosslessCompression );
+ sal_Bool GetIsLosslessCompression() const;
+ void SetIsLosslessCompression( const sal_Bool bLosslessCompression );
- sal_Bool GetIsReduceImageResolution() const;
- void SetIsReduceImageResolution( const sal_Bool bReduceImageResolution );
+ sal_Bool GetIsReduceImageResolution() const;
+ void SetIsReduceImageResolution( const sal_Bool bReduceImageResolution );
const com::sun::star::lang::Locale& GetDocumentLocale() const;
void SetDocumentLocale( const com::sun::star::lang::Locale& rLoc );
@@ -138,14 +138,14 @@ public :
Use this method to group render output.
*/
- void BeginGroup();
+ void BeginGroup();
/** End render output
This method ends grouped render output without
further actions.
*/
- void EndGroup();
+ void EndGroup();
/** End render output
@@ -170,20 +170,20 @@ public :
The visible part of the output. This might be less than
rOutputRect, e.g. for cropped graphics.
*/
- void EndGroup( const Graphic& rGraphic,
- sal_uInt8 nTransparency,
- const Rectangle& rOutputRect,
- const Rectangle& rVisibleOutputRect );
+ void EndGroup( const Graphic& rGraphic,
+ BYTE nTransparency,
+ const Rectangle& rOutputRect,
+ const Rectangle& rVisibleOutputRect );
//--->i56629
/** Create a new named destination to be used in a link to this document from another PDF document
(see PDF spec 1.4, 8.2.1)
-
+
@parm sDestName
the name this destination will be addressed with from others PDF document
@param rRect
target rectangle on page to be displayed if dest is jumped to
-
+
@param nPageNr
number of page the dest is on (as returned by NewPage)
or -1 in which case the current page is used
@@ -202,7 +202,7 @@ public :
@param rRect
target rectangle on page to be displayed if dest is jumped to
-
+
@param nPageNr
number of page the dest is on (as returned by NewPage)
or -1 in which case the current page is used
@@ -248,14 +248,14 @@ public :
<p>will change a dest type link to an URL type link if necessary</p>
@param nLinkId
the link to be changed
-
+
@param rURL
the URL the link shall point to.
there will be no error checking or any kind of
conversion done to this parameter execept this:
it will be output as 7bit Ascii. The URL
will appear literally in the PDF file produced
-
+
@returns
0 for success
-1 in case the link id does not exist
@@ -307,7 +307,7 @@ public :
-1 if the item does not exist
*/
sal_Int32 SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText );
-
+
/** Set an outline item's destination
@param nItem
@@ -374,7 +374,7 @@ public :
*/
sal_Int32 BeginStructureElement( PDFWriter::StructElement eType, const rtl::OUString& rAlias = rtl::OUString() );
/** end a logical structure element
-
+
@see BeginStructureElement
*/
void EndStructureElement();
@@ -399,14 +399,14 @@ public :
*/
bool SetCurrentStructureElement( sal_Int32 nElement );
/** get the current structure element id
-
+
@returns
the id of the current structure element
*/
sal_Int32 GetCurrentStructureElement();
/** set a structure attribute on the current structural element
-
+
SetStructureAttribute sets an attribute of the current structural element to a
new value. A consistency check is performed before actually setting the value;
if the check fails, the function returns <FALSE/> and the attribute remains
@@ -424,7 +424,7 @@ public :
*/
bool SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
/** set a structure attribute on the current structural element
-
+
SetStructureAttributeNumerical sets an attribute of the current structural element
to a new numerical value. A consistency check is performed before actually setting
the value; if the check fails, the function returns <FALSE/> and the attribute
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index b1f76046678d..c5d4dd136cfe 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,8 +39,7 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include "com/sun/star/io/XOutputStream.hpp"
-#include "com/sun/star/beans/XMaterialHolder.hpp"
+#include <com/sun/star/io/XOutputStream.hpp>
#include <list>
#include <vector>
@@ -49,7 +48,6 @@
class Font;
class Point;
class OutputDevice;
-class GDIMetaFile;
class MapMode;
class Polygon;
class LineInfo;
@@ -64,12 +62,20 @@ class Wallpaper;
namespace vcl
{
-class PDFExtOutDevData;
+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
+};
struct PDFNote
{
- String Title; // optional title for the popup containing the note
- String Contents; // contents of the note
+ String Title; // optional title for the popup containing the note
+ String Contents; // contents of the note
};
class VCL_DLLPUBLIC PDFOutputStream
@@ -209,7 +215,7 @@ public:
// PDF/A does not allow transparency
Warning_Transparency_Omitted_PDFA,
- // transparent object occurred but is only supported since
+ // transparent object occured but is only supported since
// PDF 1.4
Warning_Transparency_Omitted_PDF13,
@@ -225,21 +231,21 @@ public:
struct VCL_DLLPUBLIC AnyWidget
{
protected:
- WidgetType Type; // primitive RTTI
+ WidgetType Type; // primitive RTTI
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
- 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
- Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
- bool Background; // true: widget shall draw its background, false: no background
- Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
- Font TextFont; // an empty font will be replaced by the
+ 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
+ bool ReadOnly;
+ Rectangle Location; // describes the area filled by the control
+ bool Border; // true: widget should have a border, false: no border
+ Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
+ bool Background; // true: widget shall draw its background, false: no background
+ Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
+ Font TextFont; // an empty font will be replaced by the
// appropriate font from the user settings
- Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
+ Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
sal_Int32 TabOrder; // lowest number is first in tab order
/* style flags for text are those for OutputDevice::DrawText
@@ -322,7 +328,7 @@ public:
will appear literally in the PDF file produced
*/
sal_Int32 Dest;
- rtl::OUString URL;
+ rtl::OUString URL;
bool Submit;
bool SubmitGet;
@@ -339,8 +345,8 @@ public:
struct CheckBoxWidget : public AnyWidget
{
- bool Checked;
- bool ButtonIsLeft;
+ bool Checked;
+ bool ButtonIsLeft;
CheckBoxWidget()
: AnyWidget( vcl::PDFWriter::CheckBox ),
@@ -356,9 +362,9 @@ public:
struct RadioButtonWidget : public AnyWidget
{
- bool Selected;
- sal_Int32 RadioGroup;
- bool ButtonIsLeft;
+ bool Selected;
+ sal_Int32 RadioGroup;
+ bool ButtonIsLeft;
rtl::OUString OnValue; // the value of the radio button if it is selected
RadioButtonWidget()
@@ -384,10 +390,10 @@ public:
struct EditWidget : public AnyWidget
{
- bool MultiLine; // whether multiple lines are allowed
- bool Password; // visible echo off
- bool FileSelect; // field is a file selector
- sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
+ bool MultiLine; // whether multiple lines are allowed
+ bool Password; // visible echo off
+ bool FileSelect; // field is a file selector
+ sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
EditWidget()
: AnyWidget( vcl::PDFWriter::Edit ),
@@ -405,10 +411,10 @@ public:
struct ListBoxWidget : public AnyWidget
{
- bool DropDown;
- bool Sort;
- bool MultiSelect;
- std::vector<rtl::OUString> Entries;
+ bool DropDown;
+ bool Sort;
+ bool MultiSelect;
+ std::vector<rtl::OUString> Entries;
std::vector<sal_Int32> SelectedEntries;
// if MultiSelect is false only the first entry of SelectedEntries
// will be taken into account. the same is implicit for PDF < 1.4
@@ -430,8 +436,8 @@ public:
// note: PDF only supports dropdown comboboxes
struct ComboBoxWidget : public AnyWidget
{
- bool Sort;
- std::vector<rtl::OUString> Entries;
+ bool Sort;
+ std::vector<rtl::OUString> Entries;
// set the current value in AnyWidget::Text
ComboBoxWidget()
@@ -463,7 +469,7 @@ public:
FitVisible,
ActionZoom
};
-// These enums are treated as integer while reading/writing to configuration
+// These emuns are treated as integer while reading/writing to configuration
enum PDFPageLayout
{
DefaultLayout,
@@ -484,71 +490,37 @@ public:
/*
The following structure describes the permissions used in PDF security
*/
- struct PDFEncryptionProperties
+ struct PDFSecPermissions
{
-
- 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;
+//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;
-
- // 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 ),
- CanAddOrModify ( false ),
- CanFillInteractive ( false ),
- CanExtractForAccessibility ( true ),
- CanAssemble ( false ),
- CanPrintFull ( false )
+//permission default set for 128 bit, accessibility only
+ PDFSecPermissions() :
+ CanPrintTheDocument ( false ),
+ CanModifyTheContent ( false ),
+ CanCopyOrExtract ( false ),
+ CanAddOrModify ( false ),
+ CanFillInteractive ( false ),
+ CanExtractForAccessibility ( true ),
+ 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
{
/* must be a valid file: URL usable by osl */
- rtl::OUString URL;
+ rtl::OUString URL;
/* the URL of the document being exported, used for relative links*/
- rtl::OUString BaseURL;
+ rtl::OUString BaseURL;
/*if relative to file system should be formed*/
bool RelFsys;//i56629, i49415?, i64585?
/*the action to set the PDF hyperlink to*/
@@ -560,17 +532,17 @@ The following structure describes the permissions used in PDF security
bool ForcePDFAction;
/* decides the PDF language level to be produced */
- PDFVersion Version;
+ PDFVersion Version;
/* valid for PDF >= 1.4
causes the MarkInfo entry in the document catalog to be set
*/
- bool Tagged;
+ bool Tagged;
/* forces the embedding of PDF standard fonts */
bool EmbedStandardFonts;
/* determines in which format a form
will be submitted.
*/
- PDFWriter::ExportDataFormat SubmitFormat;
+ PDFWriter::ExportDataFormat SubmitFormat;
bool AllowDuplicateFieldNames;
bool FieldsUseSystemFonts;
/* the following data members are used to customize the PDF viewer
@@ -599,13 +571,14 @@ The following structure describes the permissions used in PDF security
sal_Int32 InitialPage;
sal_Int32 OpenBookmarkLevels; // -1 means all levels
- PDFWriter::PDFEncryptionProperties Encryption;
- PDFWriter::PDFDocInfo DocumentInfo;
+ 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
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?
@@ -632,14 +605,13 @@ The following structure describes the permissions used in PDF security
FirstPageLeft( false ),
InitialPage( 1 ),
OpenBookmarkLevels( -1 ),
- Encryption(),
- DPIx( 0 ),
- DPIy( 0 ),
- ColorMode( PDFWriter::DrawColor )
+ AccessPermissions( ),
+ Encrypt( false ),
+ Security128bit( true )
{}
};
- PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+ PDFWriter( const PDFWriterContext& rContext );
~PDFWriter();
/** Returns an OutputDevice for formatting
@@ -664,24 +636,17 @@ 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 )
- {}
- };
- void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
+ /*
+ * 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;
/* sets the document locale originally passed with the context to a new value
* only affects the output if used before calling <code>Emit/code>.
@@ -692,24 +657,18 @@ The following structure describes the permissions used in PDF security
bool Emit();
/*
- * Get a list of errors that occurred during processing
+ * Get a list of errors that occured during processing
* this should enable the producer to give feedback about
- * any anomalies that might have occurred
+ * any anomalies that might have occured
*/
std::set< ErrorCode > GetErrors();
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( sal_uInt16 nFlags = 0xffff );
- void Pop();
+ void Push( USHORT nFlags = 0xffff );
+ void Pop();
void SetClipRegion();
void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
@@ -717,9 +676,9 @@ The following structure describes the permissions used in PDF security
void IntersectClipRegion( const Rectangle& rRect );
void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
- void SetAntialiasing( sal_uInt16 nMode = 0 );
+ void SetAntialiasing( USHORT nMode = 0 );
- void SetLayoutMode( sal_uLong nMode );
+ void SetLayoutMode( ULONG nMode );
void SetDigitLanguage( LanguageType eLang );
void SetLineColor( const Color& rColor );
@@ -744,82 +703,82 @@ The following structure describes the permissions used in PDF security
/* actual drawing functions */
- void DrawText( const Point& rPos, const String& rText );
+ void DrawText( const Point& rPos, const String& rText );
- void DrawTextLine( const Point& rPos, long nWidth,
+ void DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- sal_Bool bUnderlineAbove = sal_False );
- void DrawTextArray( const Point& rStartPt, const XubString& rStr,
+ BOOL bUnderlineAbove = 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, sal_uLong nWidth,
+ void DrawStretchText( const Point& rStartPt, ULONG nWidth,
const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
- void DrawText( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle = 0 );
+ void DrawText( const Rectangle& rRect,
+ const XubString& rStr, USHORT nStyle = 0 );
- void DrawPixel( const Point& rPt, const Color& rColor );
- void DrawPixel( const Point& rPt )
+ void DrawPixel( const Point& rPt, const Color& rColor );
+ void DrawPixel( const Point& rPt )
{ DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
- void DrawPixel( const Polygon& rPts, const Color* pColors = NULL );
- void DrawPixel( const Polygon& rPts, const Color& rColor )
+ void DrawPixel( const Polygon& rPts, const Color* pColors = NULL );
+ void DrawPixel( const Polygon& rPts, const Color& rColor )
{ Push(); SetLineColor( rColor ); DrawPixel( rPts ); Pop(); }
- void DrawLine( const Point& rStartPt, const Point& rEndPt );
- void DrawLine( const Point& rStartPt, const Point& rEndPt,
+ void DrawLine( const Point& rStartPt, const Point& rEndPt );
+ void DrawLine( const Point& rStartPt, const Point& rEndPt,
const LineInfo& rLineInfo );
- void DrawPolyLine( const Polygon& rPoly );
- void DrawPolyLine( const Polygon& rPoly,
+ void DrawPolyLine( const Polygon& rPoly );
+ void DrawPolyLine( const Polygon& rPoly,
const LineInfo& rLineInfo );
void DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
- void DrawPolygon( const Polygon& rPoly );
- void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
- void DrawRect( const Rectangle& rRect );
- void DrawRect( const Rectangle& rRect,
- sal_uLong nHorzRount, sal_uLong nVertRound );
- void DrawEllipse( const Rectangle& rRect );
- void DrawArc( const Rectangle& rRect,
+ void DrawPolygon( const Polygon& rPoly );
+ void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
+ void DrawRect( const Rectangle& rRect );
+ void DrawRect( const Rectangle& rRect,
+ ULONG nHorzRount, ULONG nVertRound );
+ void DrawEllipse( const Rectangle& rRect );
+ void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
- void DrawPie( const Rectangle& rRect,
+ void DrawPie( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
- void DrawChord( const Rectangle& rRect,
+ void DrawChord( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
- void DrawBitmap( const Point& rDestPt,
+ void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
- void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap );
- void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap );
- void DrawBitmapEx( const Point& rDestPt,
+ void DrawBitmapEx( const Point& rDestPt,
const BitmapEx& rBitmapEx );
- void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const BitmapEx& rBitmapEx );
- void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const BitmapEx& rBitmapEx );
- void DrawMask( const Point& rDestPt,
+ void DrawMask( const Point& rDestPt,
const Bitmap& rBitmap, const Color& rMaskColor );
- void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap, const Color& rMaskColor );
- void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor );
- void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
- void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
+ void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
+ void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
- void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
+ void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
- void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
- void DrawTransparent( const PolyPolygon& rPolyPoly,
- sal_uInt16 nTransparencePercent );
+ void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
+ void DrawTransparent( const PolyPolygon& rPolyPoly,
+ USHORT nTransparencePercent );
/** Start a transparency group
@@ -839,7 +798,7 @@ The following structure describes the permissions used in PDF security
will be ignored if the produced PDF has a lower version. The drawing
operations will be emitted normally.
*/
- void BeginTransparencyGroup();
+ void BeginTransparencyGroup();
/** End a transparency group with constant transparency factor
@@ -852,7 +811,7 @@ The following structure describes the permissions used in PDF security
@param nTransparencePercent
The transparency factor
*/
- void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
+ void EndTransparencyGroup( const Rectangle& rBoundRect, USHORT nTransparencePercent );
/** End a transparency group with an alpha mask
@@ -865,7 +824,7 @@ The following structure describes the permissions used in PDF security
@param rAlphaMask
The transparency mask; must be an 8 bit grayscale image
*/
- void EndTransparencyGroup( const Rectangle& rBoundRect, const Bitmap& rAlphaMask );
+ void EndTransparencyGroup( const Rectangle& rBoundRect, const Bitmap& rAlphaMask );
/** Insert a JPG encoded image (optionally with mask)
@@ -886,7 +845,7 @@ The following structure describes the permissions used in PDF security
the same pixel size as the image and
be either 1 bit black&white or 8 bit grey
*/
- void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
+ void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
/** Create a new named destination to be used in a link from another PDF document
@@ -907,7 +866,7 @@ The following structure describes the permissions used in PDF security
the destination id (to be used in SetLinkDest) or
-1 if page id does not exist
*/
- sal_Int32 CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ sal_Int32 CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
/** Create a new destination to be used in a link
@param rRect
@@ -924,7 +883,7 @@ The following structure describes the permissions used in PDF security
the destination id (to be used in SetLinkDest) or
-1 if page id does not exist
*/
- sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
/** Create a new link on a page
@param rRect
@@ -939,7 +898,7 @@ The following structure describes the permissions used in PDF security
the link id (to be used in SetLinkDest, SetLinkURL) or
-1 if page id does not exist
*/
- sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
+ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
/** Set the destination for a link
<p>will change a URL type link to a dest link if necessary</p>
@@ -953,7 +912,7 @@ The following structure describes the permissions used in PDF security
-1 in case the link id does not exist
-2 in case the dest id does not exist
*/
- sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
+ sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
/** Set the URL for a link
<p>will change a dest type link to an URL type link if necessary</p>
@param nLinkId
@@ -968,7 +927,7 @@ The following structure describes the permissions used in PDF security
0 for success
-1 in case the link id does not exist
*/
- sal_Int32 SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL );
+ sal_Int32 SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL );
/** Resolve link in logical structure
<p>
If a link is created after the corresponding visual appearance was drawn
@@ -998,7 +957,7 @@ The following structure describes the permissions used in PDF security
the arbitrary id set in a <code>Link</code> structure element to address
the link with real id <code>nLinkId</code>
*/
- void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
+ void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
/** Create a new outline item
@param nParent
diff --git a/vcl/inc/vcl/pngread.hxx b/vcl/inc/vcl/pngread.hxx
index 64385f604537..c22ee413233b 100644
--- a/vcl/inc/vcl/pngread.hxx
+++ b/vcl/inc/vcl/pngread.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@ namespace vcl
class VCL_DLLPUBLIC PNGReader
{
- PNGReaderImpl* mpImpl;
+ PNGReaderImpl* mpImpl;
public:
@@ -54,15 +54,15 @@ namespace vcl
/* an empty preview size hint (=default) will read the whole image
*/
- BitmapEx Read( const Size& i_rPreviewHint = Size() );
+ BitmapEx Read( const Size& i_rPreviewHint = Size() );
// retrieve every chunk that resides inside the PNG
struct ChunkData
{
- sal_uInt32 nType;
- std::vector< sal_uInt8 > aData;
+ sal_uInt32 nType;
+ std::vector< sal_uInt8 > aData;
};
- const std::vector< ChunkData >& GetChunks() const;
+ const std::vector< ChunkData >& GetChunks() const;
void SetIgnoreGammaChunk( sal_Bool b );
};
diff --git a/vcl/inc/vcl/pngwrite.hxx b/vcl/inc/vcl/pngwrite.hxx
index 15c8c624a5ff..6894c651f047 100644
--- a/vcl/inc/vcl/pngwrite.hxx
+++ b/vcl/inc/vcl/pngwrite.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,7 +45,7 @@ namespace vcl
class VCL_DLLPUBLIC PNGWriter
{
- PNGWriterImpl* mpImpl;
+ PNGWriterImpl* mpImpl;
public:
@@ -58,8 +58,8 @@ namespace vcl
// additional method to be able to modify all chunk before they are stored
struct ChunkData
{
- sal_uInt32 nType;
- std::vector< sal_uInt8 > aData;
+ sal_uInt32 nType;
+ std::vector< sal_uInt8 > aData;
};
std::vector< vcl::PNGWriter::ChunkData >& GetChunks();
};
diff --git a/vcl/inc/vcl/pointr.hxx b/vcl/inc/vcl/pointr.hxx
index d5d2a49b33f0..642e3c9c5cb1 100644
--- a/vcl/inc/vcl/pointr.hxx
+++ b/vcl/inc/vcl/pointr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@ class Point;
class VCL_DLLPUBLIC Pointer
{
- PointerStyle meStyle;
+ PointerStyle meStyle;
public:
Pointer()
@@ -49,11 +49,11 @@ public:
Pointer( PointerStyle eStyle )
{ meStyle = eStyle; }
- PointerStyle GetStyle() const { return meStyle; }
+ PointerStyle GetStyle() const { return meStyle; }
- sal_Bool operator==( const Pointer& rPointer ) const
+ BOOL operator==( const Pointer& rPointer ) const
{ return (meStyle == rPointer.meStyle); }
- sal_Bool operator!=( const Pointer& rPointer ) const
+ 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 da91477f6a67..83859edec270 100644
--- a/vcl/inc/vcl/polyscan.hxx
+++ b/vcl/inc/vcl/polyscan.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,14 +37,14 @@
struct ScanlinePoint
{
- long mnX;
- ScanlinePoint* mpNext;
+ long mnX;
+ ScanlinePoint* mpNext;
ScanlinePoint() : mnX( 0L ), mpNext( NULL ) {};
ScanlinePoint( long nX, ScanlinePoint* pNext ) : mnX( nX ), mpNext( pNext ) {};
~ScanlinePoint() {};
- void Set( long nX, ScanlinePoint* pNext ) { mnX = nX, mpNext = pNext; }
+ void Set( long nX, ScanlinePoint* pNext ) { mnX = nX, mpNext = pNext; }
};
// -------------------
@@ -53,11 +53,11 @@ struct ScanlinePoint
struct PolyScanSegment
{
- long mnStart;
- long mnEnd;
-
+ long mnStart;
+ long mnEnd;
+
PolyScanSegment() : mnStart( 0L ), mnEnd( 0L ) {};
- PolyScanSegment( long nStart, long nEnd ) : mnStart( nStart ), mnEnd( nEnd ) {};
+ PolyScanSegment( long nStart, long nEnd ) : mnStart( nStart ), mnEnd( nEnd ) {};
~PolyScanSegment() {};
};
@@ -65,51 +65,51 @@ struct PolyScanSegment
// - PolyScanline -
// ----------------
-struct ScanlinePoint;
-class Polygon;
-class PolyPolygon;
+struct ScanlinePoint;
+class Polygon;
+class PolyPolygon;
class PolyScanline
{
private:
- ScanlinePoint* mpFirst;
- ScanlinePoint* mpLast;
- ScanlinePoint* mpAct;
- long mnLeft;
- long mnRight;
-
- void ImplDelete();
-
+ ScanlinePoint* mpFirst;
+ ScanlinePoint* mpLast;
+ ScanlinePoint* mpAct;
+ long mnLeft;
+ long mnRight;
+
+ void ImplDelete();
+
public:
-
+
PolyScanline();
~PolyScanline();
-
- void Insert( long nX );
- void Set( long nStart, long nEnd );
- void Set( const PolyScanSegment& rSegment ) { Set( rSegment.mnStart, rSegment.mnEnd ); }
-
- inline sal_Bool GetFirstX( long& rX );
- inline sal_Bool GetNextX( long& rX );
-
- sal_Bool GetFirstSegment( PolyScanSegment& rSegment );
- sal_Bool GetNextSegment( PolyScanSegment& rSegment );
+
+ void Insert( long nX );
+ 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 );
+
+ BOOL GetFirstSegment( PolyScanSegment& rSegment );
+ BOOL GetNextSegment( PolyScanSegment& rSegment );
};
// ------------------------------------------------------------------------
-inline sal_Bool PolyScanline::GetFirstX( long& rX )
+inline BOOL PolyScanline::GetFirstX( long& rX )
{
mpAct = mpFirst;
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
}
// ------------------------------------------------------------------------
-inline sal_Bool PolyScanline::GetNextX( long& rX )
+inline BOOL PolyScanline::GetNextX( long& rX )
{
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
}
// ---------------
@@ -119,18 +119,18 @@ inline sal_Bool PolyScanline::GetNextX( long& rX )
class PolyScanner
{
private:
-
- PolyScanline* mpArray;
- long mnLeft;
- long mnTop;
- long mnRight;
- long mnBottom;
+
+ PolyScanline* mpArray;
+ long mnLeft;
+ long mnTop;
+ long mnRight;
+ long mnBottom;
PolyScanner() {};
protected:
- void InsertLine( const Point& rStart, const Point& rEnd );
+ void InsertLine( const Point& rStart, const Point& rEnd );
public:
@@ -139,18 +139,18 @@ public:
PolyScanner( const PolyPolygon& rPolyPoly );
~PolyScanner();
- long Left() const { return mnLeft; }
- long Top() const { return mnTop; }
- long Right() const { return mnRight; }
- long Bottom() const { return mnBottom; }
+ long Left() const { return mnLeft; }
+ long Top() const { return mnTop; }
+ long Right() const { return mnRight; }
+ long Bottom() const { return mnBottom; }
- long Width() const { return( mnRight - mnLeft + 1L ); }
- long Height() const { return( mnBottom - mnTop + 1L ); }
+ long Width() const { return( mnRight - mnLeft + 1L ); }
+ long Height() const { return( mnBottom - mnTop + 1L ); }
- Rectangle GetBoundRect() const { return Rectangle( mnLeft, mnTop, mnRight, mnBottom ); }
+ Rectangle GetBoundRect() const { return Rectangle( mnLeft, mnTop, mnRight, mnBottom ); }
- sal_uLong Count() const { return Height(); }
- PolyScanline* operator[]( sal_uLong nPos ) const;
+ ULONG Count() const { return Height(); }
+ PolyScanline* operator[]( ULONG nPos ) const;
};
#endif // _SV_POLYSCAN_HXX
diff --git a/vcl/inc/vcl/popupmenuwindow.hxx b/vcl/inc/vcl/popupmenuwindow.hxx
index 9759ab42fb73..59cdad454a43 100644
--- a/vcl/inc/vcl/popupmenuwindow.hxx
+++ b/vcl/inc/vcl/popupmenuwindow.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index 846835e22d3b..047b0677eca2 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,7 @@
#include <list>
#include <vector>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include "tools/string.hxx"
#include "tools/stream.hxx"
@@ -63,25 +63,25 @@ class PPDKey
{
friend class PPDParser;
- typedef ::boost::unordered_map< ::rtl::OUString, PPDValue, ::rtl::OUStringHash > hash_type;
+ typedef ::std::hash_map< ::rtl::OUString, PPDValue, ::rtl::OUStringHash > hash_type;
typedef ::std::vector< PPDValue* > value_type;
- String m_aKey;
- hash_type m_aValues;
- value_type m_aOrderedValues;
- const PPDValue* m_pDefaultValue;
- bool m_bQueryValue;
- PPDValue m_aQueryValue;
+ String m_aKey;
+ hash_type m_aValues;
+ value_type m_aOrderedValues;
+ const PPDValue* m_pDefaultValue;
+ bool m_bQueryValue;
+ PPDValue m_aQueryValue;
public:
enum UIType { PickOne, PickMany, Boolean };
enum SetupType { ExitServer, Prolog, DocumentSetup, PageSetup, JCLSetup, AnySetup };
private:
- bool m_bUIOption;
- UIType m_eUIType;
- int m_nOrderDependency;
- SetupType m_eSetupType;
+ bool m_bUIOption;
+ UIType m_eUIType;
+ int m_nOrderDependency;
+ SetupType m_eSetupType;
void eraseValue( const String& rOption );
public:
@@ -125,9 +125,8 @@ class PPDParser
{
friend class PPDContext;
friend class CUPSManager;
- friend class PPDCache;
- typedef ::boost::unordered_map< ::rtl::OUString, PPDKey*, ::rtl::OUStringHash > hash_type;
+ typedef ::std::hash_map< ::rtl::OUString, PPDKey*, ::rtl::OUStringHash > hash_type;
typedef ::std::vector< PPDKey* > value_type;
void insertKey( const String& rKey, PPDKey* pKey );
@@ -142,42 +141,47 @@ public:
PPDConstraint() : m_pKey1( NULL ), m_pOption1( NULL ), m_pKey2( NULL ), m_pOption2( NULL ) {}
};
private:
- hash_type m_aKeys;
- value_type m_aOrderedKeys;
- ::std::list< PPDConstraint > m_aConstraints;
+
+ static ::std::list< PPDParser* > aAllParsers;
+ static ::std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >*
+ pAllPPDFiles;
+
+ hash_type m_aKeys;
+ value_type m_aOrderedKeys;
+ ::std::list< PPDConstraint > m_aConstraints;
// some identifying fields
- String m_aPrinterName;
- String m_aNickName;
+ String m_aPrinterName;
+ String m_aNickName;
// the full path of the PPD file
- String m_aFile;
+ String m_aFile;
// some basic attributes
- bool m_bColorDevice;
- bool m_bType42Capable;
- sal_uLong m_nLanguageLevel;
+ bool m_bColorDevice;
+ bool m_bType42Capable;
+ ULONG m_nLanguageLevel;
rtl_TextEncoding m_aFileEncoding;
// shortcuts to important keys and their default values
// imageable area
- const PPDValue* m_pDefaultImageableArea;
- const PPDKey* m_pImageableAreas;
+ const PPDValue* m_pDefaultImageableArea;
+ const PPDKey* m_pImageableAreas;
// paper dimensions
- const PPDValue* m_pDefaultPaperDimension;
- const PPDKey* m_pPaperDimensions;
+ const PPDValue* m_pDefaultPaperDimension;
+ const PPDKey* m_pPaperDimensions;
// paper trays
- const PPDValue* m_pDefaultInputSlot;
- const PPDKey* m_pInputSlots;
+ const PPDValue* m_pDefaultInputSlot;
+ const PPDKey* m_pInputSlots;
// resolutions
- const PPDValue* m_pDefaultResolution;
- const PPDKey* m_pResolutions;
+ const PPDValue* m_pDefaultResolution;
+ const PPDKey* m_pResolutions;
// duplex commands
- const PPDValue* m_pDefaultDuplexType;
- const PPDKey* m_pDuplexTypes;
+ const PPDValue* m_pDefaultDuplexType;
+ const PPDKey* m_pDuplexTypes;
// fonts
- const PPDKey* m_pFontList;
-
+ const PPDKey* m_pFontList;
+
// translations
PPDTranslator* m_pTranslator;
@@ -188,7 +192,7 @@ private:
void parseOpenUI( const ByteString& rLine );
void parseConstraint( const ByteString& rLine );
void parse( std::list< ByteString >& rLines );
-
+
String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized );
static void scanPPDDir( const String& rDir );
@@ -216,7 +220,7 @@ public:
bool isColorDevice() const { return m_bColorDevice; }
bool isType42Capable() const { return m_bType42Capable; }
- sal_uLong getLanguageLevel() const { return m_nLanguageLevel; }
+ ULONG getLanguageLevel() const { return m_nLanguageLevel; }
String getDefaultPaperDimension() const;
void getDefaultPaperDimension( int& rWidth, int& rHeight ) const
@@ -233,15 +237,15 @@ public:
// match the best paper for width and height
String matchPaper( int nWidth, int nHeight ) const;
-
+
bool getMargins( const String& rPaperName,
int &rLeft, int& rRight,
int &rUpper, int& rLower ) const;
// values in pt
// returns true if paper found
-
+
// values int pt
-
+
String getDefaultInputSlot() const;
int getInputSlots() const
{ return m_pInputSlots ? m_pInputSlots->countValues() : 0; }
@@ -273,8 +277,8 @@ public:
String& rEncoding,
String& rCharset ) const;
String getFont( int ) const;
-
-
+
+
rtl::OUString translateKey( const rtl::OUString& i_rKey,
const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
rtl::OUString translateOption( const rtl::OUString& i_rKey,
@@ -295,7 +299,7 @@ public:
class PPDContext
{
- typedef ::boost::unordered_map< const PPDKey*, const PPDValue*, PPDKeyhash > hash_type;
+ typedef ::std::hash_map< const PPDKey*, const PPDValue*, PPDKeyhash > hash_type;
hash_type m_aCurrentValues;
const PPDParser* m_pParser;
@@ -324,8 +328,8 @@ public:
void getUnconstrainedValues( const PPDKey*, ::std::list< const PPDValue* >& rValues );
// for printer setup
- void* getStreamableBuffer( sal_uLong& rBytes ) const;
- void rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes );
+ void* getStreamableBuffer( ULONG& rBytes ) const;
+ void rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes );
// convenience
int getRenderResolution() const;
diff --git a/vcl/inc/vcl/print.h b/vcl/inc/vcl/print.h
index db236f2a0f17..57c4bf074395 100644
--- a/vcl/inc/vcl/print.h
+++ b/vcl/inc/vcl/print.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,7 +33,7 @@
#include "vcl/dllapi.h"
#include <vector>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
struct SalPrinterQueueInfo;
class QueueInfo;
@@ -48,18 +48,18 @@ namespace vcl
struct ImplPrnQueueData
{
- QueueInfo* mpQueueInfo;
- SalPrinterQueueInfo* mpSalQueueInfo;
+ QueueInfo* mpQueueInfo;
+ SalPrinterQueueInfo* mpSalQueueInfo;
};
// --------------------
// - ImplPrnQueueList -
// --------------------
-class VCL_PLUGIN_PUBLIC ImplPrnQueueList
+class VCL_DLLPUBLIC ImplPrnQueueList
{
public:
- boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash >
+ std::hash_map< rtl::OUString, sal_Int32, rtl::OUStringHash >
m_aNameToIndex;
std::vector< ImplPrnQueueData > m_aQueueInfos;
std::vector< rtl::OUString > m_aPrinterList;
@@ -67,7 +67,7 @@ public:
ImplPrnQueueList() {}
~ImplPrnQueueList();
- void Add( SalPrinterQueueInfo* pData );
+ void Add( SalPrinterQueueInfo* pData );
ImplPrnQueueData* Get( const rtl::OUString& rPrinter );
};
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 182258aeb3c1..db41a166dcd2 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@
#include "com/sun/star/view/PrintableState.hpp"
#include <boost/shared_ptr.hpp>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <set>
struct SalPrinterInfoQueue;
@@ -62,7 +62,7 @@ namespace vcl {
// - Printer-Types -
// -----------------
-#define PAGEQUEUE_ALLPAGES 0xFFFF
+#define PAGEQUEUE_ALLPAGES 0xFFFF
enum PrinterSupport { SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
SUPPORT_SET_PAPERSIZE, SUPPORT_SET_PAPER,
@@ -77,18 +77,18 @@ class VCL_DLLPUBLIC PrinterPage
{
GDIMetaFile* mpMtf;
JobSetup maJobSetup;
- sal_uInt16 mbNewJobSetup;
+ UINT16 mbNewJobSetup;
public:
PrinterPage() : mpMtf( new GDIMetaFile() ) {}
- PrinterPage( GDIMetaFile* pMtf, sal_Bool bNewJobSetup, const JobSetup& rSetup ) :
+ PrinterPage( GDIMetaFile* pMtf, 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; }
- sal_Bool IsNewJobSetup() const { return (mbNewJobSetup != 0); }
+ 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; }
@@ -106,29 +106,29 @@ class VCL_DLLPUBLIC QueueInfo
friend class Printer;
private:
- XubString maPrinterName;
- XubString maDriver;
- XubString maLocation;
- XubString maComment;
- sal_uInt32 mnStatus;
- sal_uInt32 mnJobs;
+ XubString maPrinterName;
+ XubString maDriver;
+ XubString maLocation;
+ XubString maComment;
+ sal_uInt32 mnStatus;
+ sal_uInt32 mnJobs;
public:
QueueInfo();
QueueInfo( const QueueInfo& rInfo );
~QueueInfo();
- const XubString& GetPrinterName() const { return maPrinterName; }
- const XubString& GetDriver() const { return maDriver; }
- const XubString& GetLocation() const { return maLocation; }
- const XubString& GetComment() const { return maComment; }
- sal_uInt32 GetStatus() const { return mnStatus; }
- sal_uInt32 GetJobs() const { return mnJobs; }
+ const XubString& GetPrinterName() const { return maPrinterName; }
+ const XubString& GetDriver() const { return maDriver; }
+ const XubString& GetLocation() const { return maLocation; }
+ const XubString& GetComment() const { return maComment; }
+ sal_uInt32 GetStatus() const { return mnStatus; }
+ sal_uInt32 GetJobs() const { return mnJobs; }
bool operator==( const QueueInfo& rInfo ) const;
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo );
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo );
+ friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo );
+ friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo );
};
// ------------------
@@ -136,7 +136,7 @@ public:
// ------------------
enum PrinterTransparencyMode
-{
+{
PRINTER_TRANSPARENCY_AUTO = 0,
PRINTER_TRANSPARENCY_NONE = 1
};
@@ -144,7 +144,7 @@ enum PrinterTransparencyMode
// -----------------------------------------------------------------------------
enum PrinterGradientMode
-{
+{
PRINTER_GRADIENT_STRIPES = 0,
PRINTER_GRADIENT_COLOR = 1
};
@@ -152,7 +152,7 @@ enum PrinterGradientMode
// -----------------------------------------------------------------------------
enum PrinterBitmapMode
-{
+{
PRINTER_BITMAP_OPTIMAL = 0,
PRINTER_BITMAP_NORMAL = 1,
PRINTER_BITMAP_RESOLUTION = 2
@@ -164,56 +164,51 @@ class VCL_DLLPUBLIC PrinterOptions
{
private:
- sal_Bool mbReduceTransparency;
+ BOOL mbReduceTransparency;
PrinterTransparencyMode meReducedTransparencyMode;
- sal_Bool mbReduceGradients;
+ BOOL mbReduceGradients;
PrinterGradientMode meReducedGradientsMode;
- sal_uInt16 mnReducedGradientStepCount;
- sal_Bool mbReduceBitmaps;
+ USHORT mnReducedGradientStepCount;
+ BOOL mbReduceBitmaps;
PrinterBitmapMode meReducedBitmapMode;
- sal_uInt16 mnReducedBitmapResolution;
- sal_Bool mbReducedBitmapsIncludeTransparency;
- sal_Bool mbConvertToGreyscales;
+ USHORT mnReducedBitmapResolution;
+ BOOL mbReducedBitmapsIncludeTransparency;
+ BOOL mbConvertToGreyscales;
public:
-
+
PrinterOptions();
~PrinterOptions();
- sal_Bool IsReduceTransparency() const { return mbReduceTransparency; }
- void SetReduceTransparency( sal_Bool bSet ) { mbReduceTransparency = bSet; }
-
+ BOOL IsReduceTransparency() const { return mbReduceTransparency; }
+ void SetReduceTransparency( BOOL bSet ) { mbReduceTransparency = bSet; }
+
PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
void SetReducedTransparencyMode( PrinterTransparencyMode eMode ) { meReducedTransparencyMode = eMode; }
-
- sal_Bool IsReduceGradients() const { return mbReduceGradients; }
- void SetReduceGradients( sal_Bool bSet ) { mbReduceGradients = bSet; }
-
+
+ BOOL IsReduceGradients() const { return mbReduceGradients; }
+ void SetReduceGradients( BOOL bSet ) { mbReduceGradients = bSet; }
+
PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
- sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
- void SetReducedGradientStepCount( sal_uInt16 nStepCount ) { mnReducedGradientStepCount = nStepCount; }
-
- sal_Bool IsReduceBitmaps() const { return mbReduceBitmaps; }
- void SetReduceBitmaps( sal_Bool bSet ) { mbReduceBitmaps = bSet; }
-
+ USHORT GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
+ void SetReducedGradientStepCount( USHORT nStepCount ) { mnReducedGradientStepCount = nStepCount; }
+
+ BOOL IsReduceBitmaps() const { return mbReduceBitmaps; }
+ void SetReduceBitmaps( 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; }
-
- sal_Bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
- void SetReducedBitmapIncludesTransparency( sal_Bool bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
+ BOOL IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
+ void SetReducedBitmapIncludesTransparency( BOOL bSet ) { mbReducedBitmapsIncludeTransparency = 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 );
+ BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; }
+ void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; }
};
// -----------
@@ -226,54 +221,54 @@ class VCL_DLLPUBLIC Printer : public OutputDevice
friend class ImplQPrinter;
private:
- SalInfoPrinter* mpInfoPrinter;
- SalPrinter* mpPrinter;
- SalGraphics* mpJobGraphics;
- Printer* mpPrev;
- Printer* mpNext;
- VirtualDevice* mpDisplayDev;
+ SalInfoPrinter* mpInfoPrinter;
+ SalPrinter* mpPrinter;
+ SalGraphics* mpJobGraphics;
+ Printer* mpPrev;
+ Printer* mpNext;
+ VirtualDevice* mpDisplayDev;
PrinterOptions* mpPrinterOptions;
- XubString maPrinterName;
- XubString maDriver;
- XubString maPrintFile;
- XubString maJobName;
- JobSetup maJobSetup;
- Point maPageOffset;
- Size maPaperSize;
- 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();
- SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
- SAL_DLLPRIVATE void ImplInitDisplay( const Window* pWindow );
+ XubString maPrinterName;
+ XubString maDriver;
+ XubString maPrintFile;
+ XubString maJobName;
+ 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;
+ Link maErrorHdl;
+
+ SAL_DLLPRIVATE void ImplInitData();
+ SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
+ SAL_DLLPRIVATE void ImplInitDisplay( const Window* pWindow );
SAL_DLLPRIVATE static SalPrinterQueueInfo* ImplGetQueueInfo( const XubString& rPrinterName,
const XubString* pDriver );
- SAL_DLLPRIVATE void ImplUpdatePageData();
- SAL_DLLPRIVATE void ImplUpdateFontList();
- SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
+ SAL_DLLPRIVATE void ImplUpdatePageData();
+ SAL_DLLPRIVATE void ImplUpdateFontList();
+ SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* );
SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
-
- static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
+
+ static SAL_DLLPRIVATE ULONG ImplSalPrinterErrorCodeToVCL( ULONG nError );
private:
- SAL_DLLPRIVATE void ImplEndPrint();
- SAL_DLLPRIVATE sal_Bool EndJob();
+ SAL_DLLPRIVATE void ImplEndPrint();
+ SAL_DLLPRIVATE BOOL EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
public:
@@ -285,8 +280,8 @@ public:
protected:
- void SetSelfAsQueuePrinter( sal_Bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
- sal_Bool IsQueuePrinter() const { return mbIsQueuePrinter; }
+ void SetSelfAsQueuePrinter( BOOL bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
+ BOOL IsQueuePrinter() const { return mbIsQueuePrinter; }
public:
Printer();
@@ -294,88 +289,84 @@ public:
Printer( const JobSetup& rJobSetup );
Printer( const QueueInfo& rQueueInfo );
Printer( const XubString& rPrinterName );
- virtual ~Printer();
+ virtual ~Printer();
static const std::vector< rtl::OUString >& GetPrinterQueues();
static const QueueInfo* GetQueueInfo( const String& rPrinterName, bool bStatusUpdate );
- static XubString GetDefaultPrinterName();
+ static XubString GetDefaultPrinterName();
- virtual void Error();
+ virtual void Error();
- const XubString& GetName() const { return maPrinterName; }
- const XubString& GetDriverName() const { return maDriver; }
- sal_Bool IsDefPrinter() const { return mbDefPrinter; }
- sal_Bool IsDisplayPrinter() const { return mpDisplayDev != NULL; }
- sal_Bool IsValid() const { return !IsDisplayPrinter(); }
+ 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_uLong GetCapabilities( sal_uInt16 nType ) const;
- sal_Bool HasSupport( PrinterSupport eFeature ) const;
+ ULONG GetCapabilities( USHORT nType ) const;
+ BOOL HasSupport( PrinterSupport eFeature ) const;
- 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 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 ); }
- sal_Bool Setup( Window* pWindow = NULL );
- sal_Bool SetPrinterProps( const Printer* pPrinter );
+ BOOL Setup( Window* pWindow = NULL );
+ BOOL SetPrinterProps( const Printer* pPrinter );
- // 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 );
+ void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; }
const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
- sal_Bool SetOrientation( Orientation eOrient );
- Orientation GetOrientation() const;
+ BOOL SetOrientation( Orientation eOrient );
+ Orientation GetOrientation() const;
DuplexMode GetDuplexMode() const;
- sal_Bool SetDuplexMode( DuplexMode );
+ 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;
- 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;
+ 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 );
+ Paper GetPaper() const;
// returns number of available paper formats
- int GetPaperInfoCount() const;
+ int GetPaperInfoCount() const;
// returns info about paper format nPaper
- const PaperInfo& GetPaperInfo( int nPaper ) 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 ); }
-
- sal_Bool SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate = sal_False );
- sal_uInt16 GetCopyCount() const { return mnCopyCount; }
- sal_Bool IsCollateCopy() const { return mbCollateCopy; }
-
- sal_Bool IsPrinting() const { return mbPrinting; }
-
- sal_Bool AbortJob();
- const XubString& GetCurJobName() const { return maJobName; }
- sal_uInt16 GetCurPage() const { return mnCurPage; }
- sal_Bool IsJobActive() const { return mbJobActive; }
-
- 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; }
-
+ const PaperInfo& GetPaperInfo( int nPaper ) const;
+ USHORT GetPaperBinCount() const;
+ XubString GetPaperBinName( USHORT 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; }
+
+ 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();
+ const XubString& GetCurJobName() const { return maJobName; }
+ USHORT GetCurPage() const { return mnCurPage; }
+ BOOL IsJobActive() const { return mbJobActive; }
+
+ ULONG GetError() const { return ERRCODE_TOERROR(mnError); }
+ ULONG GetErrorCode() const { return mnError; }
+
+ void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
+ const Link& GetErrorHdl() const { return maErrorHdl; }
+
void Compat_OldPrinterMetrics( bool bSet );
-
+
/** checks the printer list and updates it necessary
*
* sends a DataChanged event of type DATACHANGED_PRINTER
@@ -384,9 +375,9 @@ public:
static void updatePrinters();
/** execute a print job
-
+
starts a print job asynchronously (that is will return
-
+
*/
static void PrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
const JobSetup& i_rInitSetup
@@ -410,7 +401,7 @@ protected:
PrinterController( const boost::shared_ptr<Printer>& );
public:
enum NupOrderType
- { LRTB, TBLR, TBRL, RLTB };
+ { LRTB, TBLR };
struct MultiPageSetup
{
// all metrics in 100th mm
@@ -426,7 +417,7 @@ public:
long nVerticalSpacing;
bool bDrawBorder;
PrinterController::NupOrderType nOrder;
-
+
MultiPageSetup()
: nRows( 1 ), nColumns( 1 ), nRepeat( 1 ), aPaperSize( 21000, 29700 )
, nLeftMargin( 0 ), nTopMargin( 0 )
@@ -437,30 +428,30 @@ public:
{
}
};
-
+
struct PageSize
{
Size aSize; // in 100th mm
bool bFullPaper; // full paper, not only imageable area is printed
-
+
PageSize( const Size& i_rSize = Size( 21000, 29700 ),
bool i_bFullPaper = false
) : aSize( i_rSize ), bFullPaper( i_bFullPaper ) {}
};
-
+
PrinterController();
virtual ~PrinterController();
-
+
const boost::shared_ptr<Printer>& getPrinter() const;
/* for implementations: get current job properties as changed by e.g. print dialog
this gets the current set of properties initially told to Printer::PrintJob
-
+
For convenience a second sequence will be merged in to get a combined sequence.
In case of duplicate property names, the value of i_MergeList wins.
*/
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
getJobProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rMergeList ) const;
-
+
/* get the PropertyValue of a Property
*/
com::sun::star::beans::PropertyValue* getValue( const rtl::OUString& i_rPropertyName );
@@ -471,12 +462,12 @@ public:
in case the property is unknown or not convertible to bool, i_bFallback is returned
*/
sal_Bool getBoolProperty( const rtl::OUString& i_rPropertyName, sal_Bool i_bFallback ) const;
-
+
/* set a property value - can also be used to add another UI property
*/
void setValue( const rtl::OUString& i_rPropertyName, const com::sun::star::uno::Any& i_rValue );
void setValue( const com::sun::star::beans::PropertyValue& i_rValue );
-
+
/* return the currently active UI options. These are the same that were passed to setUIOptions.
*/
const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& getUIOptions() const;
@@ -488,7 +479,6 @@ 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.
*/
@@ -496,7 +486,7 @@ public:
/* makeEnabled will chage the property rPropName depends on to the value
that makes rPropName enabled. If the dependency itself is also disabled,
no action will be performed.
-
+
returns the property name rPropName depends on or an empty string
if no change was made.
*/
@@ -515,46 +505,42 @@ public:
virtual void printPage( int i_nPage ) const = 0; // must be overloaded by the app
virtual void jobStarted(); // will be called after a possible dialog has been shown and the real printjob starts
virtual void jobFinished( com::sun::star::view::PrintableState );
-
+
com::sun::star::view::PrintableState getJobState() const;
-
+
void abortJob();
-
+
bool isShowDialogs() const;
bool isDirectPrint() const;
-
+
// implementation details, not usable outside vcl
- // 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 int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ SAL_DLLPRIVATE 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& );
- VCL_PLUGIN_PUBLIC void createProgressDialog();
- VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
+ SAL_DLLPRIVATE void createProgressDialog();
+ SAL_DLLPRIVATE bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- VCL_PLUGIN_PUBLIC void setLastPage( sal_Bool i_bLastPage );
+ SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- VCL_PLUGIN_PUBLIC void setJobState( com::sun::star::view::PrintableState );
+ SAL_DLLPRIVATE 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 sal_uLong removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
- SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
+
+ SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
};
class VCL_DLLPUBLIC PrinterOptionsHelper
{
protected:
- boost::unordered_map< rtl::OUString, com::sun::star::uno::Any, rtl::OUStringHash > m_aPropertyMap;
+ std::hash_map< rtl::OUString, com::sun::star::uno::Any, rtl::OUStringHash > m_aPropertyMap;
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_aUIProperties;
public:
@@ -566,7 +552,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
{}
/* process a new set of properties
- * merges changed properties and returns "true" if any occurred
+ * merges changed properties and returns "true" if any occured
* if the optional output set is not NULL then the names of the changed properties are returned
**/
bool processProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp,
@@ -581,7 +567,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
bool hasProperty( const rtl::OUString& i_rPropertyName ) const;
bool hasProperty( const char* i_pPropertyName ) const
{ return hasProperty( rtl::OUString::createFromAscii( i_pPropertyName ) ); }
-
+
// returns an empty Any for not existing properties
com::sun::star::uno::Any getValue( const rtl::OUString& i_rPropertyName ) const;
// change a value in the property set; this will not have an effect to an eventual PrinterController
@@ -615,7 +601,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
sal_Bool mbInternalOnly;
sal_Bool mbEnabled;
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maAddProps;
-
+
UIControlOptions( const rtl::OUString& i_rDependsOnName = rtl::OUString(),
sal_Int32 i_nDependsOnEntry = -1,
sal_Bool i_bAttachToDependency = sal_False,
@@ -631,54 +617,47 @@ 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_rHelpId,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
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_rHelpId );
+ static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
// 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_rHelpId,
+ const rtl::OUString& i_rHelpText,
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_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
-
+
// 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_rHelpId,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
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_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue = -1,
@@ -689,7 +668,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_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
@@ -699,6 +678,6 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
}
-#endif // _SV_PRINT_HXX
+#endif // _SV_PRINT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/printergfx.hxx b/vcl/inc/vcl/printergfx.hxx
index 8bfd1c69a7d2..e625cd9d13b7 100644
--- a/vcl/inc/vcl/printergfx.hxx
+++ b/vcl/inc/vcl/printergfx.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#include "tools/gen.hxx"
#include <list>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
namespace psp {
@@ -61,10 +61,10 @@ private:
public:
- PrinterColor () :
- meColorspace(eInvalid)
+ PrinterColor () :
+ meColorspace(eInvalid)
{}
- PrinterColor (sal_uInt16 nRed, sal_uInt16 nGreen,
+ PrinterColor (sal_uInt16 nRed, sal_uInt16 nGreen,
sal_uInt16 nBlue) :
mnRed (nRed),
mnGreen (nGreen),
@@ -92,11 +92,11 @@ public:
sal_uInt16 GetBlue () const
{ return mnBlue; }
sal_Bool operator== (const PrinterColor& aColor) const
- {
- return aColor.Is() && this->Is()
- && mnRed == aColor.mnRed
- && mnGreen == aColor.mnGreen
- && mnBlue == aColor.mnBlue;
+ {
+ return aColor.Is() && this->Is()
+ && mnRed == aColor.mnRed
+ && mnGreen == aColor.mnGreen
+ && mnBlue == aColor.mnBlue;
}
sal_Bool operator!= (const PrinterColor& aColor) const
{ return ! (aColor==*this); }
@@ -107,7 +107,7 @@ public:
mnGreen = aColor.mnGreen;
mnBlue = aColor.mnBlue;
- return *this;
+ return *this;
}
PrinterColor& operator= (sal_uInt32 nRGB)
@@ -117,7 +117,7 @@ public:
mnGreen = (nRGB & 0x0000ff00) >> 8;
mnRed = (nRGB & 0x00ff0000) >> 16;
- return *this;
+ return *this;
}
};
@@ -135,7 +135,7 @@ struct CharacterMetric;
/*
* Bitmap Interface, this has to be filled with your actual bitmap implementation
* sample implementations can be found in:
- * psprint/workben/cui/pspdem.cxx
+ * psprint/workben/cui/pspdem.cxx
* vcl/unx/source/gdi/salgdi2.cxx
*/
@@ -156,22 +156,22 @@ public:
typedef enum {
InvalidType = 0,
- TrueColorImage,
- MonochromeImage,
- PaletteImage,
+ TrueColorImage,
+ MonochromeImage,
+ PaletteImage,
GrayScaleImage
} ImageType;
/*
- * printer raster operations
+ * printer raster operations
*/
struct GraphicsStatus
{
rtl::OString maFont;
- rtl_TextEncoding maEncoding;
- bool mbArtItalic;
- bool mbArtBold;
+ rtl_TextEncoding maEncoding;
+ bool mbArtItalic;
+ bool mbArtBold;
sal_Int32 mnTextHeight;
sal_Int32 mnTextWidth;
PrinterColor maColor;
@@ -184,8 +184,8 @@ class Font3;
class PrinterGfx
{
-private:
-
+private:
+
/* common settings */
double mfScaleX;
@@ -201,18 +201,18 @@ private:
osl::File* mpPageHeader;
osl::File* mpPageBody;
- void TranslateCoordinates (sal_Int32 &rXOut, sal_Int32 &rYOut,
+ void TranslateCoordinates (sal_Int32 &rXOut, sal_Int32 &rYOut,
sal_Int32 nXIn, sal_Int32 nYIn )
{ rXOut = nXIn; rYOut = nYIn; }
void TranslateCoordinates (Point& rOut, const Point& rIn)
{ rOut = rIn; }
- /* text/font related data, for a type1 font it has to be checked
+ /* text/font related data, for a type1 font it has to be checked
whether this font has already been downloaded. A TrueType font
will be converted into one or more Type3 fonts, containing glyphs
- in no particular order. In addition to the existence of the
- glyph in one of the subfonts, the mapping from unicode to the
- glyph has to be remembered */
+ in no particular order. In addition to the existence of the
+ glyph in one of the subfonts, the mapping from unicode to the
+ glyph has to be remembered */
std::list< sal_Int32 > maPS1Font;
std::list< GlyphSet > maPS3Font;
@@ -221,10 +221,10 @@ private:
sal_Int32 mnFallbackID;
sal_Int32 mnTextAngle;
bool mbTextVertical;
- PrintFontManager& mrFontMgr;
+ PrintFontManager& mrFontMgr;
/* bitmap drawing implementation */
-
+
sal_Bool mbCompressBmp;
void DrawPS1GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea);
@@ -253,10 +253,10 @@ private:
/* font / font substitution */
friend class Font3;
- const ::boost::unordered_map< fontID, fontID >* mpFontSubstitutes;
- int getCharWidth (sal_Bool b_vert, sal_Unicode n_char,
+ const ::std::hash_map< fontID, fontID >* mpFontSubstitutes;
+ int getCharWidth (sal_Bool b_vert, sal_Unicode n_char,
CharacterMetric *p_bbox);
- fontID getCharMetric (const Font3 &rFont, sal_Unicode n_char,
+ fontID getCharMetric (const Font3 &rFont, sal_Unicode n_char,
CharacterMetric *p_bbox);
fontID getFontSubstitute () const;
fontID getFallbackID () const { return mnFallbackID; }
@@ -273,7 +273,7 @@ public:
{ maVirtualStatus.maColor = rColor; }
void PSUploadPS1Font (sal_Int32 nFontID);
- void PSSetFont (const rtl::OString& rName,
+ void PSSetFont (const rtl::OString& rName,
rtl_TextEncoding nEncoding = RTL_TEXTENCODING_DONTKNOW)
{ maVirtualStatus.maFont = rName; maVirtualStatus.maEncoding = nEncoding; }
@@ -284,14 +284,14 @@ public:
/* PS helpers */
enum pspath_t { moveto = 0, lineto = 1 };
- void PSBinLineTo (const Point& rCurrent, Point& rOld,
+ void PSBinLineTo (const Point& rCurrent, Point& rOld,
sal_Int32& nColumn);
- void PSBinMoveTo (const Point& rCurrent, Point& rOld,
+ void PSBinMoveTo (const Point& rCurrent, Point& rOld,
sal_Int32& nColumn);
void PSBinStartPath ();
void PSBinEndPath ();
void PSBinCurrentPath (sal_uInt32 nPoints, const Point* pPath);
- void PSBinPath (const Point& rCurrent, Point& rOld,
+ void PSBinPath (const Point& rCurrent, Point& rOld,
pspath_t eType, sal_Int32& nColumn);
void PSRotate (sal_Int32 nAngle);
@@ -303,27 +303,27 @@ public:
void PSPointOp (const Point& rPoint, const sal_Char* pOperator);
void PSHexString (const sal_uChar* pString, sal_Int16 nLen);
void PSDeltaArray (const sal_Int32 *pArray, sal_Int16 nEntries);
- void PSShowText (const sal_uChar* pString,
- sal_Int16 nGlyphs, sal_Int16 nBytes,
+ void PSShowText (const sal_uChar* pString,
+ sal_Int16 nGlyphs, sal_Int16 nBytes,
const sal_Int32* pDeltaArray = NULL);
- void PSComment (const sal_Char* pComment );
- void LicenseWarning (const Point& rPoint, const sal_Unicode* pStr,
- sal_Int16 nLen, const sal_Int32* pDeltaArray);
+ void PSComment (const sal_Char* pComment );
+ void LicenseWarning (const Point& rPoint, const sal_Unicode* pStr,
+ sal_Int16 nLen, const sal_Int32* pDeltaArray);
- void OnEndPage ();
- void OnEndJob ();
- void writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppliedFonts, std::list< rtl::OString >& rNeededFonts );
+ void OnEndPage ();
+ void OnEndJob ();
+ void writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppliedFonts, std::list< rtl::OString >& rNeededFonts );
PrintFontManager& GetFontMgr () { return mrFontMgr; }
void drawVerticalizedText (const Point& rPoint,
const sal_Unicode* pStr,
sal_Int16 nLen,
const sal_Int32* pDeltaArray );
- void drawText (const Point& rPoint,
- const sal_Unicode* pStr, sal_Int16 nLen,
+ void drawText (const Point& rPoint,
+ const sal_Unicode* pStr, sal_Int16 nLen,
const sal_Int32* pDeltaArray = NULL);
- void drawGlyphs( const Point& rPoint,
+ void drawGlyphs( const Point& rPoint,
sal_GlyphId* pGlyphIds,
sal_Unicode* pUnicodes,
sal_Int16 nLen,
@@ -335,14 +335,14 @@ public:
sal_Bool Init (const JobData& rData);
void Clear();
- // query depth and size
+ // query depth and size
void GetResolution (sal_Int32 &rDpiX, sal_Int32 &rDpiY) const;
sal_uInt16 GetBitCount ();
// clip region
void ResetClipRegion ();
void BeginSetClipRegion (sal_uInt32);
- sal_Bool UnionClipRegion (sal_Int32 nX, sal_Int32 nY,
+ sal_Bool UnionClipRegion (sal_Int32 nX, sal_Int32 nY,
sal_Int32 nDX, sal_Int32 nDY);
void EndSetClipRegion ();
@@ -351,7 +351,7 @@ public:
{ maLineColor = rLineColor; }
void SetFillColor (const PrinterColor& rFillColor = PrinterColor())
{ maFillColor = rFillColor; }
-
+
// drawing primitives
void DrawPixel (const Point& rPoint, const PrinterColor& rPixelColor);
void DrawPixel (const Point& rPoint)
@@ -360,30 +360,30 @@ public:
void DrawRect (const Rectangle& rRectangle);
void DrawPolyLine (sal_uInt32 nPoints, const Point* pPath );
void DrawPolygon (sal_uInt32 nPoints, const Point* pPath);
- void DrawPolyPolygon (sal_uInt32 nPoly,
- const sal_uInt32 *pPolygonSize,
+ void DrawPolyPolygon (sal_uInt32 nPoly,
+ const sal_uInt32 *pPolygonSize,
const Point** pPolygonList);
- void DrawPolyLineBezier (sal_uInt32 nPoints,
+ void DrawPolyLineBezier (sal_uInt32 nPoints,
const Point* pPath,
- const sal_uInt8* pFlgAry );
- void DrawPolygonBezier (sal_uInt32 nPoints,
+ const BYTE* pFlgAry );
+ void DrawPolygonBezier (sal_uInt32 nPoints,
const Point* pPath,
- const sal_uInt8* pFlgAry);
+ const BYTE* pFlgAry);
void DrawPolyPolygonBezier (sal_uInt32 nPoly,
- const sal_uInt32* pPoints,
+ const sal_uInt32* pPoints,
const Point* const* pPtAry,
- const sal_uInt8* const* pFlgAry);
+ const BYTE* const* pFlgAry);
// eps
sal_Bool DrawEPS ( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize);
// image drawing
- void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
+ void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp& rBitmap);
- void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
- const PrinterBmp& rBitmap,
+ void DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
+ const PrinterBmp& rBitmap,
const PrinterBmp& rTransBitmap);
- void DrawMask (const Rectangle& rDest, const Rectangle& rSrc,
+ void DrawMask (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp &rBitmap, PrinterColor& rMaskColor);
// font and text handling
@@ -401,37 +401,37 @@ public:
{ return mnTextAngle; }
sal_Int32 GetFontID () const
{ return mnFontID; }
- bool GetFontVertical() const
+ bool GetFontVertical() const
{ return mbTextVertical; }
sal_Int32 GetFontHeight () const
{ return maVirtualStatus.mnTextHeight; }
sal_Int32 GetFontWidth () const
{ return maVirtualStatus.mnTextWidth; }
- bool GetArtificialItalic() const
+ bool GetArtificialItalic() const
{ return maVirtualStatus.mbArtItalic; }
- bool GetArtificialBold() const
+ bool GetArtificialBold() const
{ return maVirtualStatus.mbArtBold; }
- void DrawText (const Point& rPoint,
- const sal_Unicode* pStr, sal_Int16 nLen,
+ void DrawText (const Point& rPoint,
+ const sal_Unicode* pStr, sal_Int16 nLen,
const sal_Int32* pDeltaArray = NULL);
void SetTextColor (PrinterColor& rTextColor)
{ maTextColor = rTextColor; }
- sal_Int32 GetCharWidth (sal_uInt16 nFrom, sal_uInt16 nTo,
+ sal_Int32 GetCharWidth (sal_uInt16 nFrom, sal_uInt16 nTo,
long *pWidthArray);
const ::std::list< KernPair >& getKernPairs( bool bVertical = false ) const;
// advanced font handling
sal_Bool GetGlyphBoundRect (sal_Unicode c, Rectangle& rOutRect);
- sal_uInt32 GetGlyphOutline (sal_Unicode c,
- sal_uInt16 **ppPolySizes, Point **ppPoints,
+ sal_uInt32 GetGlyphOutline (sal_Unicode c,
+ sal_uInt16 **ppPolySizes, Point **ppPoints,
sal_uInt8 **ppFlags);
// for CTL
- void DrawGlyphs( const Point& rPoint,
+ void DrawGlyphs( const Point& rPoint,
sal_GlyphId* pGlyphIds,
sal_Unicode* pUnicodes,
sal_Int16 nLen,
sal_Int32* pDeltaArray );
-
+
bool getStrictSO52Compatibility() const;
void setStrictSO52Compatibility( bool );
};
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index b6ebc072b8cf..1d271d192016 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#ifndef _PSPRINT_PRINTERINFOMANAGER_HXX_
#define _PSPRINT_PRINTERINFOMANAGER_HXX_
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <list>
#include "vcl/dllapi.h"
@@ -70,9 +70,9 @@ struct PrinterInfo : JobData
// this vector is currently implicitly given by the adobe
// standard encoding
bool m_bPerformFontSubstitution;
- boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >
+ std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >
m_aFontSubstitutes;
- boost::unordered_map< fontID, fontID >
+ std::hash_map< fontID, fontID >
m_aFontSubstitutions;
PrinterInfo() :
@@ -122,43 +122,42 @@ protected:
PrinterInfo m_aInfo;
};
- boost::unordered_map< rtl::OUString, Printer, rtl::OUStringHash > m_aPrinters;
+ std::hash_map< rtl::OUString, Printer, rtl::OUStringHash > m_aPrinters;
PrinterInfo m_aGlobalDefaults;
std::list< WatchFile > m_aWatchFiles;
rtl::OUString m_aDefaultPrinter;
rtl::OUString m_aSystemPrintCommand;
-
+
std::list< SystemPrintQueue > m_aSystemPrintQueues;
- SystemQueueInfo* m_pQueueInfo;
+ SystemQueueInfo* m_pQueueInfo;
- Type m_eType;
+ Type m_eType;
bool m_bUseIncludeFeature;
bool m_bUseJobPatch;
rtl::OUString m_aSystemDefaultPaper;
-
+
bool m_bDisableCUPS;
PrinterInfoManager( Type eType = Default );
+ virtual ~PrinterInfoManager();
virtual void initialize();
// fill in font substitutions
- // the resulting boost::unordered_map maps from source to target font ids
+ // the resulting hash_map maps from source to target font ids
void fillFontSubstitutions( PrinterInfo& rInfo ) const;
-
+
// fill default paper if not configured in config file
// default paper is e.g. locale dependent
// if a paper is already set it will not be overwritten
void setDefaultPaper( PPDContext& rInfo ) const;
-
+
void initSystemDefaultPaper();
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; }
@@ -171,7 +170,7 @@ public:
// gets info about a named printer
const PrinterInfo& getPrinterInfo( const rtl::OUString& rPrinter ) const;
-
+
// gets the name of the default printer
const rtl::OUString& getDefaultPrinter() const { return m_aDefaultPrinter; }
@@ -210,7 +209,7 @@ public:
// primarily used internally but also by padmin
// returns the printer queue names
virtual const std::list< SystemPrintQueue >& getSystemPrintQueues();
-
+
// similar but returnse whole commandlines
virtual void getSystemPrintCommands( std::list< rtl::OUString >& rCommands );
@@ -219,29 +218,25 @@ 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, bool bBanner );
-
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
-
+
bool getUseIncludeFeature() const { return m_bUseIncludeFeature; }
bool getUseJobPatch() const { return m_bUseJobPatch; }
-
+
// check whether a printer's feature string contains a subfeature
bool checkFeatureToken( const rtl::OUString& rPrinterName, const char* pToken ) const;
-
+
// set m_bDisableCUPS and update printer config
void setCUPSDisabled( bool );
-
+
// gets m_bDisableCUPS, initialized from printer config
bool isCUPSDisabled() const;
-
- virtual ~PrinterInfoManager();
};
-
+
} // namespace
#endif // _PSPRINT_PRINTERINFOMANAGER_HXX_
diff --git a/vcl/inc/vcl/printerjob.hxx b/vcl/inc/vcl/printerjob.hxx
index 62a1c078bc32..1d70218437d4 100644
--- a/vcl/inc/vcl/printerjob.hxx
+++ b/vcl/inc/vcl/printerjob.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,14 +41,14 @@ namespace psp {
class PrinterGfx;
-class PrinterJob
+class PrinterJob
{
private: // private data
rtl::OUString maSpoolDirName;
rtl::OUString maFileName; // empty: spool to command, else spool to named file
- rtl::OUString maJobTitle;
- int mnFileMode;
+ rtl::OUString maJobTitle;
+ int mnFileMode;
osl::File* mpJobHeader;
osl::File* mpJobTrailer;
@@ -80,21 +80,21 @@ private: // private data
sal_Int32 mnErrorCode;
bool m_bQuickJob;
-
+
private: // private methods
- osl::File* CreateSpoolFile (const rtl::OUString& rName,
+ osl::File* CreateSpoolFile (const rtl::OUString& rName,
const rtl::OUString& rExtension);
void InitPaperSize (const JobData& rJobSetup);
- bool writeFeatureList( osl::File* pFile, const JobData&, bool bDocumentSetup );
+ bool writeFeatureList( osl::File* pFile, const JobData&, bool bDocumentSetup );
bool writeSetup( osl::File* pFile, const JobData& );
bool writePageSetup( osl::File* pFile, const JobData&, bool bWriteFeatures = true );
- void writeJobPatch( osl::File* File, const JobData& );
+ void writeJobPatch( osl::File* File, const JobData& );
bool writeProlog (osl::File* pFile, const JobData& );
public: // for usage in PrinterGfx
-
+
sal_uInt32 GetResolution () const { return mnResolution; }
void GetScale (double &rXScale, double &rYScale) const;
sal_uInt16 GetDepth () const;
@@ -138,7 +138,7 @@ public:
sal_Bool AbortJob ();
- sal_Bool StartPage (const JobData& rJobSetup);
+ sal_Bool StartPage (const JobData& rJobSetup);
sal_Bool EndPage ();
sal_uInt32 GetErrorCode ();
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index 247998303178..00265d725f4e 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -60,27 +60,22 @@ namespace vcl
VirtualDevice maPageVDev;
rtl::OUString maReplacementString;
rtl::OUString maToolTipString;
- bool mbGreyscale;
- FixedLine maHorzDim;
- FixedLine maVertDim;
-
+
+ bool useHCColorReplacement() const;
public:
PrintPreviewWindow( Window* pParent, const ResId& );
virtual ~PrintPreviewWindow();
-
+
virtual void Paint( const Rectangle& rRect );
virtual void Command( const CommandEvent& );
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& );
- 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
+ void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
+ sal_Int32 i_nDPIX, sal_Int32 i_nDPIY
);
};
-
+
class ShowNupOrderWindow : public Window
{
int mnOrderMode;
@@ -90,9 +85,9 @@ namespace vcl
public:
ShowNupOrderWindow( Window* pParent );
virtual ~ShowNupOrderWindow();
-
+
virtual void Paint( const Rectangle& );
-
+
void setValues( int i_nOrderMode, int i_nColumns, int i_nRows )
{
mnOrderMode = i_nOrderMode;
@@ -101,7 +96,7 @@ namespace vcl
Invalidate();
}
};
-
+
class NUpTabPage : public TabPage
{
public:
@@ -110,10 +105,10 @@ namespace vcl
RadioButton maBrochureBtn;
FixedText maPagesBoxTitleTxt;
ListBox maNupPagesBox;
-
+
// controls for "Custom" page mode
FixedText maNupNumPagesTxt;
- NumericField maNupColEdt;
+ NumericField maNupColEdt;
FixedText maNupTimesTxt;
NumericField maNupRowsEdt;
FixedText maPageMarginTxt1;
@@ -131,25 +126,26 @@ namespace vcl
ShowNupOrderWindow maNupOrderWin;
// border around each page
CheckBox maBorderCB;
-
+
+ vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
-
+
void setupLayout();
-
+
NUpTabPage( Window*, const ResId& );
virtual ~NUpTabPage();
-
+
void readFromSettings();
void storeToSettings();
void initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& );
void enableNupControls( bool bEnable );
-
+
void showAdvancedControls( bool );
-
- // virtual void Resize();
+
+ virtual void Resize();
};
-
+
class JobTabPage : public TabPage
{
public:
@@ -162,52 +158,56 @@ namespace vcl
FixedText maLocationTxt;
FixedText maCommentLabel;
FixedText maCommentTxt;
-
+
PushButton maSetupButton;
-
+
FixedLine maCopies;
FixedLine maCopySpacer;
FixedText maCopyCount;
NumericField maCopyCountField;
CheckBox maCollateBox;
FixedImage maCollateImage;
- CheckBox maReverseOrderBox;
-
+
Image maCollateImg;
+ Image maCollateHCImg;
Image maNoCollateImg;
-
+ Image maNoCollateHCImg;
+
long mnCollateUIMode;
+ vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
boost::shared_ptr<vcl::WindowArranger> mxDetails;
-
+
JobTabPage( Window*, const ResId& );
virtual ~JobTabPage();
void readFromSettings();
void storeToSettings();
-
- // virtual void Resize();
-
+
+ virtual void Resize();
+
void setupLayout();
};
-
+
class OutputOptPage : public TabPage
{
public:
FixedLine maOptionsLine;
CheckBox maToFileBox;
CheckBox maCollateSingleJobsBox;
+ CheckBox maReverseOrderBox;
+ vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
-
+
OutputOptPage( Window*, const ResId& );
virtual ~OutputOptPage();
void readFromSettings();
void storeToSettings();
- // virtual void Resize();
+ virtual void Resize();
void setupLayout();
};
@@ -220,21 +220,21 @@ namespace vcl
FixedText maNumPagesText;
PushButton maBackwardBtn;
PushButton maForwardBtn;
-
+
TabControl maTabCtrl;
NUpTabPage maNUpPage;
JobTabPage maJobPage;
OutputOptPage maOptionsPage;
-
+
FixedLine maButtonLine;
-
+
boost::shared_ptr< PrinterController > maPController;
-
+
rtl::OUString maPageStr;
rtl::OUString maNoPageStr;
sal_Int32 mnCurPage;
sal_Int32 mnCachedPages;
-
+
std::list< Window* > maControls;
std::map< Window*, rtl::OUString > maControlToPropertyMap;
std::map< rtl::OUString, std::vector< Window* > >
@@ -244,21 +244,22 @@ namespace vcl
Size maNupPortraitSize;
Size maNupLandscapeSize;
-
+
// internal, used for automatic Nup-Portrait/landscape
Size maFirstPageSize;
-
+
rtl::OUString maPrintToFileText;
rtl::OUString maPrintText;
rtl::OUString maDefPrtText;
-
+
+ vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
-
+
Size maDetailsCollapsedSize;
Size maDetailsExpandedSize;
-
+
sal_Bool mbShowLayoutPage;
-
+
Size getJobPageSize();
void updateNup();
void updateNupFromPages();
@@ -273,41 +274,41 @@ namespace vcl
void readFromSettings();
void storeToSettings();
com::sun::star::beans::PropertyValue* getValueForWindow( Window* ) const;
-
+
virtual void Resize();
virtual void Command( const CommandEvent& );
virtual void DataChanged( const DataChangedEvent& );
-
+
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( ClickHdl, Button* );
DECL_LINK( ModifyHdl, Edit* );
DECL_LINK( UIOptionsChanged, void* );
-
+
DECL_LINK( UIOption_CheckHdl, CheckBox* );
DECL_LINK( UIOption_RadioHdl, RadioButton* );
DECL_LINK( UIOption_SelectHdl, ListBox* );
DECL_LINK( UIOption_ModifyHdl, Edit* );
-
+
void setupLayout();
public:
PrintDialog( Window*, const boost::shared_ptr< PrinterController >& );
virtual ~PrintDialog();
-
+
bool isPrintToFile();
int getCopyCount();
bool isCollate();
bool isSingleJobs();
-
+
void previewForward();
void previewBackward();
};
-
+
class PrintProgressDialog : public ModelessDialog
{
String maStr;
FixedText maText;
CancelButton maButton;
-
+
bool mbCanceled;
sal_Int32 mnCur;
sal_Int32 mnMax;
@@ -316,17 +317,17 @@ namespace vcl
bool mbNativeProgress;
DECL_LINK( ClickHdl, Button* );
-
+
void implCalcProgressRect();
public:
PrintProgressDialog( Window* i_pParent, int i_nMax );
~PrintProgressDialog();
-
+
bool isCanceled() const { return mbCanceled; }
void setProgress( int i_nCurrent, int i_nMax = -1 );
void tick();
void reset();
-
+
virtual void Paint( const Rectangle& );
};
}
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 13d87a94d3ac..3e26ee5f175c 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,51 +49,50 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
// - QueueInfo-Types -
// -------------------
-#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_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_JOBS_DONTKNOW ((sal_uLong)0xFFFFFFFF)
+#define QUEUE_JOBS_DONTKNOW ((ULONG)0xFFFFFFFF)
// -----------------
// - Printer-Types -
// -----------------
-#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)
+#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)
-#endif // _SV_PRNTYPES_HXX
+#endif // _SV_PRNTYPES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/ptrstyle.hxx b/vcl/inc/vcl/ptrstyle.hxx
index 1f6b375e81b5..4ed6fd53ad17 100644
--- a/vcl/inc/vcl/ptrstyle.hxx
+++ b/vcl/inc/vcl/ptrstyle.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,96 +35,96 @@
// - Pointer-Types -
// -----------------
-typedef sal_uInt16 PointerStyle;
+typedef USHORT PointerStyle;
-#define POINTER_ARROW ((PointerStyle)0)
-#define POINTER_NULL ((PointerStyle)1)
-#define POINTER_WAIT ((PointerStyle)2)
-#define POINTER_TEXT ((PointerStyle)3)
-#define POINTER_HELP ((PointerStyle)4)
-#define POINTER_CROSS ((PointerStyle)5)
-#define POINTER_MOVE ((PointerStyle)6)
-#define POINTER_NSIZE ((PointerStyle)7)
-#define POINTER_SSIZE ((PointerStyle)8)
-#define POINTER_WSIZE ((PointerStyle)9)
-#define POINTER_ESIZE ((PointerStyle)10)
-#define POINTER_NWSIZE ((PointerStyle)11)
-#define POINTER_NESIZE ((PointerStyle)12)
-#define POINTER_SWSIZE ((PointerStyle)13)
-#define POINTER_SESIZE ((PointerStyle)14)
-#define POINTER_WINDOW_NSIZE ((PointerStyle)15)
-#define POINTER_WINDOW_SSIZE ((PointerStyle)16)
-#define POINTER_WINDOW_WSIZE ((PointerStyle)17)
-#define POINTER_WINDOW_ESIZE ((PointerStyle)18)
-#define POINTER_WINDOW_NWSIZE ((PointerStyle)19)
-#define POINTER_WINDOW_NESIZE ((PointerStyle)20)
-#define POINTER_WINDOW_SWSIZE ((PointerStyle)21)
-#define POINTER_WINDOW_SESIZE ((PointerStyle)22)
-#define POINTER_HSPLIT ((PointerStyle)23)
-#define POINTER_VSPLIT ((PointerStyle)24)
-#define POINTER_HSIZEBAR ((PointerStyle)25)
-#define POINTER_VSIZEBAR ((PointerStyle)26)
-#define POINTER_HAND ((PointerStyle)27)
-#define POINTER_REFHAND ((PointerStyle)28)
-#define POINTER_PEN ((PointerStyle)29)
-#define POINTER_MAGNIFY ((PointerStyle)30)
-#define POINTER_FILL ((PointerStyle)31)
-#define POINTER_ROTATE ((PointerStyle)32)
-#define POINTER_HSHEAR ((PointerStyle)33)
-#define POINTER_VSHEAR ((PointerStyle)34)
-#define POINTER_MIRROR ((PointerStyle)35)
-#define POINTER_CROOK ((PointerStyle)36)
-#define POINTER_CROP ((PointerStyle)37)
-#define POINTER_MOVEPOINT ((PointerStyle)38)
-#define POINTER_MOVEBEZIERWEIGHT ((PointerStyle)39)
-#define POINTER_MOVEDATA ((PointerStyle)40)
-#define POINTER_COPYDATA ((PointerStyle)41)
-#define POINTER_LINKDATA ((PointerStyle)42)
-#define POINTER_MOVEDATALINK ((PointerStyle)43)
-#define POINTER_COPYDATALINK ((PointerStyle)44)
-#define POINTER_MOVEFILE ((PointerStyle)45)
-#define POINTER_COPYFILE ((PointerStyle)46)
-#define POINTER_LINKFILE ((PointerStyle)47)
-#define POINTER_MOVEFILELINK ((PointerStyle)48)
-#define POINTER_COPYFILELINK ((PointerStyle)49)
-#define POINTER_MOVEFILES ((PointerStyle)50)
-#define POINTER_COPYFILES ((PointerStyle)51)
-#define POINTER_NOTALLOWED ((PointerStyle)52)
-#define POINTER_DRAW_LINE ((PointerStyle)53)
-#define POINTER_DRAW_RECT ((PointerStyle)54)
-#define POINTER_DRAW_POLYGON ((PointerStyle)55)
-#define POINTER_DRAW_BEZIER ((PointerStyle)56)
-#define POINTER_DRAW_ARC ((PointerStyle)57)
-#define POINTER_DRAW_PIE ((PointerStyle)58)
-#define POINTER_DRAW_CIRCLECUT ((PointerStyle)59)
-#define POINTER_DRAW_ELLIPSE ((PointerStyle)60)
-#define POINTER_DRAW_FREEHAND ((PointerStyle)61)
-#define POINTER_DRAW_CONNECT ((PointerStyle)62)
-#define POINTER_DRAW_TEXT ((PointerStyle)63)
-#define POINTER_DRAW_CAPTION ((PointerStyle)64)
-#define POINTER_CHART ((PointerStyle)65)
-#define POINTER_DETECTIVE ((PointerStyle)66)
-#define POINTER_PIVOT_COL ((PointerStyle)67)
-#define POINTER_PIVOT_ROW ((PointerStyle)68)
-#define POINTER_PIVOT_FIELD ((PointerStyle)69)
-#define POINTER_CHAIN ((PointerStyle)70)
-#define POINTER_CHAIN_NOTALLOWED ((PointerStyle)71)
-#define POINTER_TIMEEVENT_MOVE ((PointerStyle)72)
-#define POINTER_TIMEEVENT_SIZE ((PointerStyle)73)
-#define POINTER_AUTOSCROLL_N ((PointerStyle)74)
-#define POINTER_AUTOSCROLL_S ((PointerStyle)75)
-#define POINTER_AUTOSCROLL_W ((PointerStyle)76)
-#define POINTER_AUTOSCROLL_E ((PointerStyle)77)
-#define POINTER_AUTOSCROLL_NW ((PointerStyle)78)
-#define POINTER_AUTOSCROLL_NE ((PointerStyle)79)
-#define POINTER_AUTOSCROLL_SW ((PointerStyle)80)
-#define POINTER_AUTOSCROLL_SE ((PointerStyle)81)
-#define POINTER_AUTOSCROLL_NS ((PointerStyle)82)
-#define POINTER_AUTOSCROLL_WE ((PointerStyle)83)
-#define POINTER_AUTOSCROLL_NSWE ((PointerStyle)84)
-#define POINTER_AIRBRUSH ((PointerStyle)85)
-#define POINTER_TEXT_VERTICAL ((PointerStyle)86)
-#define POINTER_PIVOT_DELETE ((PointerStyle)87)
+#define POINTER_ARROW ((PointerStyle)0)
+#define POINTER_NULL ((PointerStyle)1)
+#define POINTER_WAIT ((PointerStyle)2)
+#define POINTER_TEXT ((PointerStyle)3)
+#define POINTER_HELP ((PointerStyle)4)
+#define POINTER_CROSS ((PointerStyle)5)
+#define POINTER_MOVE ((PointerStyle)6)
+#define POINTER_NSIZE ((PointerStyle)7)
+#define POINTER_SSIZE ((PointerStyle)8)
+#define POINTER_WSIZE ((PointerStyle)9)
+#define POINTER_ESIZE ((PointerStyle)10)
+#define POINTER_NWSIZE ((PointerStyle)11)
+#define POINTER_NESIZE ((PointerStyle)12)
+#define POINTER_SWSIZE ((PointerStyle)13)
+#define POINTER_SESIZE ((PointerStyle)14)
+#define POINTER_WINDOW_NSIZE ((PointerStyle)15)
+#define POINTER_WINDOW_SSIZE ((PointerStyle)16)
+#define POINTER_WINDOW_WSIZE ((PointerStyle)17)
+#define POINTER_WINDOW_ESIZE ((PointerStyle)18)
+#define POINTER_WINDOW_NWSIZE ((PointerStyle)19)
+#define POINTER_WINDOW_NESIZE ((PointerStyle)20)
+#define POINTER_WINDOW_SWSIZE ((PointerStyle)21)
+#define POINTER_WINDOW_SESIZE ((PointerStyle)22)
+#define POINTER_HSPLIT ((PointerStyle)23)
+#define POINTER_VSPLIT ((PointerStyle)24)
+#define POINTER_HSIZEBAR ((PointerStyle)25)
+#define POINTER_VSIZEBAR ((PointerStyle)26)
+#define POINTER_HAND ((PointerStyle)27)
+#define POINTER_REFHAND ((PointerStyle)28)
+#define POINTER_PEN ((PointerStyle)29)
+#define POINTER_MAGNIFY ((PointerStyle)30)
+#define POINTER_FILL ((PointerStyle)31)
+#define POINTER_ROTATE ((PointerStyle)32)
+#define POINTER_HSHEAR ((PointerStyle)33)
+#define POINTER_VSHEAR ((PointerStyle)34)
+#define POINTER_MIRROR ((PointerStyle)35)
+#define POINTER_CROOK ((PointerStyle)36)
+#define POINTER_CROP ((PointerStyle)37)
+#define POINTER_MOVEPOINT ((PointerStyle)38)
+#define POINTER_MOVEBEZIERWEIGHT ((PointerStyle)39)
+#define POINTER_MOVEDATA ((PointerStyle)40)
+#define POINTER_COPYDATA ((PointerStyle)41)
+#define POINTER_LINKDATA ((PointerStyle)42)
+#define POINTER_MOVEDATALINK ((PointerStyle)43)
+#define POINTER_COPYDATALINK ((PointerStyle)44)
+#define POINTER_MOVEFILE ((PointerStyle)45)
+#define POINTER_COPYFILE ((PointerStyle)46)
+#define POINTER_LINKFILE ((PointerStyle)47)
+#define POINTER_MOVEFILELINK ((PointerStyle)48)
+#define POINTER_COPYFILELINK ((PointerStyle)49)
+#define POINTER_MOVEFILES ((PointerStyle)50)
+#define POINTER_COPYFILES ((PointerStyle)51)
+#define POINTER_NOTALLOWED ((PointerStyle)52)
+#define POINTER_DRAW_LINE ((PointerStyle)53)
+#define POINTER_DRAW_RECT ((PointerStyle)54)
+#define POINTER_DRAW_POLYGON ((PointerStyle)55)
+#define POINTER_DRAW_BEZIER ((PointerStyle)56)
+#define POINTER_DRAW_ARC ((PointerStyle)57)
+#define POINTER_DRAW_PIE ((PointerStyle)58)
+#define POINTER_DRAW_CIRCLECUT ((PointerStyle)59)
+#define POINTER_DRAW_ELLIPSE ((PointerStyle)60)
+#define POINTER_DRAW_FREEHAND ((PointerStyle)61)
+#define POINTER_DRAW_CONNECT ((PointerStyle)62)
+#define POINTER_DRAW_TEXT ((PointerStyle)63)
+#define POINTER_DRAW_CAPTION ((PointerStyle)64)
+#define POINTER_CHART ((PointerStyle)65)
+#define POINTER_DETECTIVE ((PointerStyle)66)
+#define POINTER_PIVOT_COL ((PointerStyle)67)
+#define POINTER_PIVOT_ROW ((PointerStyle)68)
+#define POINTER_PIVOT_FIELD ((PointerStyle)69)
+#define POINTER_CHAIN ((PointerStyle)70)
+#define POINTER_CHAIN_NOTALLOWED ((PointerStyle)71)
+#define POINTER_TIMEEVENT_MOVE ((PointerStyle)72)
+#define POINTER_TIMEEVENT_SIZE ((PointerStyle)73)
+#define POINTER_AUTOSCROLL_N ((PointerStyle)74)
+#define POINTER_AUTOSCROLL_S ((PointerStyle)75)
+#define POINTER_AUTOSCROLL_W ((PointerStyle)76)
+#define POINTER_AUTOSCROLL_E ((PointerStyle)77)
+#define POINTER_AUTOSCROLL_NW ((PointerStyle)78)
+#define POINTER_AUTOSCROLL_NE ((PointerStyle)79)
+#define POINTER_AUTOSCROLL_SW ((PointerStyle)80)
+#define POINTER_AUTOSCROLL_SE ((PointerStyle)81)
+#define POINTER_AUTOSCROLL_NS ((PointerStyle)82)
+#define POINTER_AUTOSCROLL_WE ((PointerStyle)83)
+#define POINTER_AUTOSCROLL_NSWE ((PointerStyle)84)
+#define POINTER_AIRBRUSH ((PointerStyle)85)
+#define POINTER_TEXT_VERTICAL ((PointerStyle)86)
+#define POINTER_PIVOT_DELETE ((PointerStyle)87)
// --> FME 2004-07-30 #i32329# Enhanced table selection
#define POINTER_TAB_SELECT_S ((PointerStyle)88)
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
deleted file mode 100644
index f70736428010..000000000000
--- a/vcl/inc/vcl/quickselectionengine.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
-* 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 0ebacbdb93d4..3de3fbf70bcb 100644
--- a/vcl/inc/vcl/regband.hxx
+++ b/vcl/inc/vcl/regband.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,10 +55,10 @@ IsOver.
// element for the list with x-separations
struct ImplRegionBandSep
{
- ImplRegionBandSep* mpNextSep;
- long mnXLeft;
- long mnXRight;
- sal_Bool mbRemoved;
+ ImplRegionBandSep* mpNextSep;
+ long mnXLeft;
+ long mnXRight;
+ BOOL mbRemoved;
};
enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL };
@@ -66,11 +66,11 @@ enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL };
// element for the list with x-separations
struct ImplRegionBandPoint
{
- ImplRegionBandPoint* mpNextBandPoint;
- long mnX;
- long mnLineId;
- sal_Bool mbEndPoint;
- LineType meLineType;
+ ImplRegionBandPoint* mpNextBandPoint;
+ long mnX;
+ long mnLineId;
+ BOOL mbEndPoint;
+ LineType meLineType;
};
// ------------------
@@ -80,13 +80,13 @@ struct ImplRegionBandPoint
class ImplRegionBand
{
public:
- ImplRegionBand* mpNextBand; // pointer to the next element of the list
- ImplRegionBand* mpPrevBand; // pointer to the previous element of the list (only used temporaery)
- ImplRegionBandSep* mpFirstSep; // root of the list with x-separations
- ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
- long mnYTop; // actual boundary of the band
- long mnYBottom;
- sal_Bool mbTouched;
+ ImplRegionBand* mpNextBand; // pointer to the next element of the list
+ ImplRegionBand* mpPrevBand; // pointer to the previous element of the list (only used temporaery)
+ ImplRegionBandSep* mpFirstSep; // root of the list with x-separations
+ ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
+ long mnYTop; // actual boundary of the band
+ long mnYBottom;
+ BOOL mbTouched;
// create y-band with boundaries
ImplRegionBand( long nYTop, long nYBottom );
@@ -107,34 +107,34 @@ public:
const bool bIgnorePoints = true);
~ImplRegionBand();
- long GetXLeftBoundary() const;
- long GetXRightBoundary() const;
+ long GetXLeftBoundary() const;
+ long GetXRightBoundary() const;
// combine overlapping bands
- sal_Bool OptimizeBand();
+ BOOL OptimizeBand();
// generate separations from lines and process
// union with existing separations
- void ProcessPoints();
+ void ProcessPoints();
// insert point in the list for later processing
- sal_Bool InsertPoint( long nX, long nLineID,
- sal_Bool bEndPoint, LineType eLineType );
+ BOOL InsertPoint( long nX, long nLineID,
+ BOOL bEndPoint, LineType eLineType );
- void Union( long nXLeft, long nXRight );
- void Intersect( long nXLeft, long nXRight );
- void Exclude( long nXLeft, long nXRight );
- void XOr( long nXLeft, long nXRight );
+ void Union( long nXLeft, long nXRight );
+ void Intersect( long nXLeft, long nXRight );
+ void Exclude( long nXLeft, long nXRight );
+ void XOr( long nXLeft, long nXRight );
- void MoveX( long nHorzMove );
- void ScaleX( double fHorzScale );
+ void MoveX( long nHorzMove );
+ void ScaleX( double fHorzScale );
- sal_Bool IsInside( long nX );
- sal_Bool IsInside( long nLeft, long nRight );
- sal_Bool IsOver( long nLeft, long nRight );
+ BOOL IsInside( long nX );
+ BOOL IsInside( long nLeft, long nRight );
+ BOOL IsOver( long nLeft, long nRight );
- sal_Bool IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
+ BOOL IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
- sal_Bool operator==( const ImplRegionBand& rRegionBand ) const;
+ 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.
@@ -148,6 +148,6 @@ public:
ImplRegionBand* SplitBand (const sal_Int32 nY);
};
-#endif // _SV_REGBAND_HXX
+#endif // _SV_REGBAND_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/region.h b/vcl/inc/vcl/region.h
index 5814e981aac2..3c83d0b3a136 100644
--- a/vcl/inc/vcl/region.h
+++ b/vcl/inc/vcl/region.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,10 +47,10 @@ const char* ImplDbgTestRegion( const void* pObj );
struct ImplRegionHandle
{
- Region* mpRegion;
- ImplRegionBand* mpCurrRectBand;
- ImplRegionBandSep* mpCurrRectBandSep;
- sal_Bool mbFirst;
+ Region* mpRegion;
+ ImplRegionBand* mpCurrRectBand;
+ ImplRegionBandSep* mpCurrRectBandSep;
+ BOOL mbFirst;
};
// ------------------
@@ -59,8 +59,8 @@ struct ImplRegionHandle
struct ImplRegionInfo
{
- void* mpVoidCurrRectBand;
- void* mpVoidCurrRectBandSep;
+ void* mpVoidCurrRectBand;
+ void* mpVoidCurrRectBandSep;
};
// --------------
@@ -73,9 +73,9 @@ public:
ImplRegionBase( int nCount = 1 ); // TODO: replace manual refcounting
virtual ~ImplRegionBase();
public:
- sal_uIntPtr mnRefCount;
- sal_uIntPtr mnRectCount;
- PolyPolygon* mpPolyPoly;
+ ULONG mnRefCount;
+ ULONG mnRectCount;
+ PolyPolygon* mpPolyPoly;
basegfx::B2DPolyPolygon* mpB2DPolyPoly;
};
@@ -84,8 +84,8 @@ class ImplRegion : public ImplRegionBase
friend class Region;
private:
- ImplRegionBand* mpFirstBand; // root of the list with y-bands
- ImplRegionBand* mpLastCheckedBand;
+ ImplRegionBand* mpFirstBand; // root of the list with y-bands
+ ImplRegionBand* mpLastCheckedBand;
public:
ImplRegion();
@@ -94,19 +94,19 @@ public:
ImplRegion( const ImplRegion& rImplRegion );
~ImplRegion();
- ImplRegionBand* ImplGetFirstRegionBand() const { return mpFirstBand; }
- PolyPolygon* ImplGetPolyPoly() const { return mpPolyPoly; }
+ ImplRegionBand* ImplGetFirstRegionBand() const { return mpFirstBand; }
+ PolyPolygon* ImplGetPolyPoly() const { return mpPolyPoly; }
- void CreateBandRange( long nYTop, long nYBottom );
- void InsertBands( long nYTop, long nYBottom );
- sal_Bool InsertSingleBand( ImplRegionBand* mpImplRegionBand,
+ void CreateBandRange( long nYTop, long nYBottom );
+ void InsertBands( long nYTop, long nYBottom );
+ BOOL InsertSingleBand( ImplRegionBand* mpImplRegionBand,
long nYBandPosition );
- sal_Bool InsertLine( const Point & rFirstPoint,
+ BOOL InsertLine( const Point & rFirstPoint,
const Point & rSecondPoint,
long nLineID );
- sal_Bool InsertPoint( const Point &rPoint,
+ BOOL InsertPoint( const Point &rPoint,
long nLineID,
- sal_Bool bEndPoint, LineType eLineType );
+ 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.
@@ -120,18 +120,18 @@ public:
*/
void InsertBand (ImplRegionBand* pPreviousBand,
ImplRegionBand* pBandToInsert);
-
- void Union( long nLeft, long nTop, long nRight, long nBottom );
- void Exclude( long nLeft, long nTop, long nRight, long nBottom );
- void XOr( long nLeft, long nTop, long nRight, long nBottom );
+
+ void Union( long nLeft, long nTop, long nRight, long nBottom );
+ void Exclude( long nLeft, long nTop, long nRight, long nBottom );
+ void XOr( long nLeft, long nTop, long nRight, long nBottom );
// remove emtpy rects
- sal_Bool OptimizeBandList();
+ BOOL OptimizeBandList();
- friend SvStream& operator>>( SvStream& rIStm, Region& rRegion );
- friend SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
+ friend SvStream& operator>>( SvStream& rIStm, Region& rRegion );
+ friend SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
};
-#endif // _SV_REGION_H
+#endif // _SV_REGION_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx
index f21cca472252..52516552a442 100644
--- a/vcl/inc/vcl/region.hxx
+++ b/vcl/inc/vcl/region.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,30 +61,25 @@ class VCL_DLLPUBLIC Region
friend class Bitmap;
private:
- ImplRegion* mpImplRegion;
-
- SAL_DLLPRIVATE void ImplCopyData();
- SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect );
- SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
- SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc();
- SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
- SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
- SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; }
- SAL_DLLPRIVATE void ImplBeginAddRect( );
- 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,
+ ImplRegion* mpImplRegion;
+
+ SAL_DLLPRIVATE void ImplCopyData();
+ SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc();
+ 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;
- VCL_PLUGIN_PUBLIC bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+ 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 void ImplEndAddRect( );
+
#ifdef DBG_UTIL
- friend const char* ImplDbgTestRegion( const void* pObj );
+ friend const char* ImplDbgTestRegion( const void* pObj );
#endif
public:
@@ -97,50 +92,50 @@ public:
Region( const Region& rRegion );
~Region();
- void Move( long nHorzMove, long nVertMove );
- void Scale( double fScaleX, double fScaleY );
- 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 );
+ 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 );
- RegionType GetType() const;
- sal_Bool IsEmpty() const { return GetType() == REGION_EMPTY; };
- sal_Bool IsNull() const { return GetType() == REGION_NULL; };
+ RegionType GetType() const;
+ BOOL IsEmpty() const { return GetType() == REGION_EMPTY; };
+ BOOL IsNull() const { return GetType() == REGION_NULL; };
- void SetEmpty();
- void SetNull();
+ void SetEmpty();
+ void SetNull();
- Rectangle GetBoundRect() const;
+ Rectangle GetBoundRect() const;
- sal_Bool HasPolyPolygon() const;
+ BOOL HasPolyPolygon() const;
PolyPolygon GetPolyPolygon() const;
- // returns an empty polypolygon in case HasPolyPolygon is sal_False
+ // returns an empty polypolygon in case HasPolyPolygon is 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();
- sal_uLong GetRectCount() const;
- RegionHandle BeginEnumRects();
- sal_Bool GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
- sal_Bool GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
+ ULONG GetRectCount() const;
+ RegionHandle BeginEnumRects();
+ BOOL GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
+ BOOL GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
{ return GetEnumRects( hRegionHandle, rRect ); }
- void EndEnumRects( RegionHandle hRegionHandle );
+ void EndEnumRects( RegionHandle hRegionHandle );
- sal_Bool IsInside( const Point& rPoint ) const;
- sal_Bool IsInside( const Rectangle& rRect ) const;
- sal_Bool IsOver( const Rectangle& rRect ) const;
+ BOOL IsInside( const Point& rPoint ) const;
+ BOOL IsInside( const Rectangle& rRect ) const;
+ BOOL IsOver( const Rectangle& rRect ) const;
- Region& operator=( const Region& rRegion );
- Region& operator=( const Rectangle& rRect );
+ Region& operator=( const Region& rRegion );
+ Region& operator=( const Rectangle& rRect );
- sal_Bool operator==( const Region& rRegion ) const;
- sal_Bool operator!=( const Region& rRegion ) const
+ BOOL operator==( const Region& rRegion ) const;
+ BOOL operator!=( const Region& rRegion ) const
{ return !(Region::operator==( rRegion )); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Region& rRegion );
@@ -158,6 +153,6 @@ public:
static Region GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly );
};
-#endif // _SV_REGION_HXX
+#endif // _SV_REGION_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx
new file mode 100644
index 000000000000..2fd87f31ca51
--- /dev/null
+++ b/vcl/inc/vcl/salatype.hxx
@@ -0,0 +1,50 @@
+/* -*- 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 d880be0d6d37..95bb9ac37fe2 100644
--- a/vcl/inc/vcl/salbmp.hxx
+++ b/vcl/inc/vcl/salbmp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,29 +39,29 @@ class SalGraphics;
class BitmapPalette;
struct BitmapSystemData;
-class VCL_PLUGIN_PUBLIC SalBitmap
+class VCL_DLLPUBLIC SalBitmap
{
public:
SalBitmap() {}
virtual ~SalBitmap();
- virtual bool Create( const Size& rSize,
- sal_uInt16 nBitCount,
+ virtual bool Create( const Size& rSize,
+ USHORT nBitCount,
const BitmapPalette& rPal ) = 0;
- virtual bool Create( const SalBitmap& rSalBmp ) = 0;
- virtual bool Create( const SalBitmap& rSalBmp,
+ virtual bool Create( const SalBitmap& rSalBmp ) = 0;
+ virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics ) = 0;
- virtual bool Create( const SalBitmap& rSalBmp,
- sal_uInt16 nNewBitCount ) = 0;
- virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ virtual bool Create( const SalBitmap& rSalBmp,
+ USHORT 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 sal_uInt16 GetBitCount() const = 0;
+ virtual void Destroy() = 0;
+ virtual Size GetSize() const = 0;
+ virtual USHORT GetBitCount() const = 0;
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ) = 0;
- virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) = 0;
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ) = 0;
+ virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) = 0;
virtual bool GetSystemData( BitmapSystemData& rData ) = 0;
};
diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx
index 111fdecda62d..5ace8c9afc93 100644
--- a/vcl/inc/vcl/salbtype.hxx
+++ b/vcl/inc/vcl/salbtype.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,64 +43,64 @@
// - Memory -
// ----------
-typedef sal_uInt8* HPBYTE;
-typedef HPBYTE Scanline;
-typedef const sal_uInt8* ConstHPBYTE;
-typedef ConstHPBYTE ConstScanline;
+typedef BYTE* HPBYTE;
+typedef HPBYTE Scanline;
+typedef const BYTE* ConstHPBYTE;
+typedef ConstHPBYTE ConstScanline;
// ------------------
// - Bitmap formats -
// ------------------
-#define BMP_FORMAT_BOTTOM_UP 0x00000000UL
-#define BMP_FORMAT_TOP_DOWN 0x80000000UL
+#define BMP_FORMAT_BOTTOM_UP 0x00000000UL
+#define BMP_FORMAT_TOP_DOWN 0x80000000UL
-#define BMP_FORMAT_1BIT_MSB_PAL 0x00000001UL
-#define BMP_FORMAT_1BIT_LSB_PAL 0x00000002UL
+#define BMP_FORMAT_1BIT_MSB_PAL 0x00000001UL
+#define BMP_FORMAT_1BIT_LSB_PAL 0x00000002UL
-#define BMP_FORMAT_4BIT_MSN_PAL 0x00000004UL
-#define BMP_FORMAT_4BIT_LSN_PAL 0x00000008UL
+#define BMP_FORMAT_4BIT_MSN_PAL 0x00000004UL
+#define BMP_FORMAT_4BIT_LSN_PAL 0x00000008UL
-#define BMP_FORMAT_8BIT_PAL 0x00000010UL
-#define BMP_FORMAT_8BIT_TC_MASK 0x00000020UL
+#define BMP_FORMAT_8BIT_PAL 0x00000010UL
+#define BMP_FORMAT_8BIT_TC_MASK 0x00000020UL
-// #define BMP_FORMAT_16BIT_TC_MASK 0x00000040UL
+// #define BMP_FORMAT_16BIT_TC_MASK 0x00000040UL
-#define BMP_FORMAT_24BIT_TC_BGR 0x00000080UL
-#define BMP_FORMAT_24BIT_TC_RGB 0x00000100UL
-#define BMP_FORMAT_24BIT_TC_MASK 0x00000200UL
+#define BMP_FORMAT_24BIT_TC_BGR 0x00000080UL
+#define BMP_FORMAT_24BIT_TC_RGB 0x00000100UL
+#define BMP_FORMAT_24BIT_TC_MASK 0x00000200UL
-#define BMP_FORMAT_32BIT_TC_ABGR 0x00000400UL
-#define BMP_FORMAT_32BIT_TC_ARGB 0x00000800UL
-#define BMP_FORMAT_32BIT_TC_BGRA 0x00001000UL
-#define BMP_FORMAT_32BIT_TC_RGBA 0x00002000UL
-#define BMP_FORMAT_32BIT_TC_MASK 0x00004000UL
+#define BMP_FORMAT_32BIT_TC_ABGR 0x00000400UL
+#define BMP_FORMAT_32BIT_TC_ARGB 0x00000800UL
+#define BMP_FORMAT_32BIT_TC_BGRA 0x00001000UL
+#define BMP_FORMAT_32BIT_TC_RGBA 0x00002000UL
+#define BMP_FORMAT_32BIT_TC_MASK 0x00004000UL
-#define BMP_FORMAT_16BIT_TC_MSB_MASK 0x00008000UL
-#define BMP_FORMAT_16BIT_TC_LSB_MASK 0x00010000UL
+#define BMP_FORMAT_16BIT_TC_MSB_MASK 0x00008000UL
+#define BMP_FORMAT_16BIT_TC_LSB_MASK 0x00010000UL
-#define BMP_SCANLINE_ADJUSTMENT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x80000000UL )
-#define BMP_SCANLINE_FORMAT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x7FFFFFFFUL )
+#define BMP_SCANLINE_ADJUSTMENT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x80000000UL )
+#define BMP_SCANLINE_FORMAT( Mac_nBmpFormat ) ( (Mac_nBmpFormat) & 0x7FFFFFFFUL )
// ------------------------------------------------------------------
-#define MASK_TO_COLOR( d_nVal, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS, d_Col ) \
-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 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 ) ) );
// ------------------------------------------------------------------
#define COLOR_TO_MASK( d_rCol, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS ) \
-( ( ( ( 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 ) )
+( ( ( ( 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 ) )
// ---------------
// - BitmapColor -
@@ -111,59 +111,59 @@ class Color;
class VCL_DLLPUBLIC BitmapColor
{
private:
-
+
// !!! Achtung:
// !!! da auf die Member dieser Klasse via memcpy
// !!! zugegriffen wird, darf diese Klasse weder
// !!! in der Groesse noch der Reihenfolge der
// !!! Member veraendert werden (KA 02.09.97)
- sal_uInt8 mcBlueOrIndex;
- sal_uInt8 mcGreen;
- sal_uInt8 mcRed;
- sal_uInt8 mbIndex;
+ BYTE mcBlueOrIndex;
+ BYTE mcGreen;
+ BYTE mcRed;
+ BYTE mbIndex;
public:
- inline BitmapColor();
- inline BitmapColor( const BitmapColor& rBitmapColor );
- inline BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
- inline BitmapColor( const Color& rColor );
- inline BitmapColor( sal_uInt8 cIndex );
- inline ~BitmapColor() {};
+ inline BitmapColor();
+ inline BitmapColor( const BitmapColor& rBitmapColor );
+ inline BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue );
+ inline BitmapColor( const Color& rColor );
+ inline BitmapColor( BYTE cIndex );
+ inline ~BitmapColor() {};
- inline sal_Bool operator==( const BitmapColor& rBitmapColor ) const;
- inline sal_Bool operator!=( const BitmapColor& rBitmapColor ) const;
+ inline BOOL operator==( const BitmapColor& rBitmapColor ) const;
+ inline BOOL operator!=( const BitmapColor& rBitmapColor ) const;
inline BitmapColor& operator=( const BitmapColor& rBitmapColor );
- inline sal_Bool IsIndex() const;
+ inline BOOL IsIndex() const;
- inline sal_uInt8 GetRed() const;
- inline void SetRed( sal_uInt8 cRed );
+ inline BYTE GetRed() const;
+ inline void SetRed( BYTE cRed );
- inline sal_uInt8 GetGreen() const;
- inline void SetGreen( sal_uInt8 cGreen );
+ inline BYTE GetGreen() const;
+ inline void SetGreen( BYTE cGreen );
- inline sal_uInt8 GetBlue() const;
- inline void SetBlue( sal_uInt8 cBlue );
+ inline BYTE GetBlue() const;
+ inline void SetBlue( BYTE cBlue );
- inline sal_uInt8 GetIndex() const;
- inline void SetIndex( sal_uInt8 cIndex );
+ inline BYTE GetIndex() const;
+ inline void SetIndex( BYTE cIndex );
- operator Color() const;
- inline operator sal_uInt8() const;
+ operator Color() const;
+ inline operator BYTE() const;
- inline sal_uInt8 GetBlueOrIndex() const;
+ inline BYTE GetBlueOrIndex() const;
inline BitmapColor& Invert();
- inline sal_uInt8 GetLuminance() const;
- inline BitmapColor& IncreaseLuminance( sal_uInt8 cGreyInc );
- inline BitmapColor& DecreaseLuminance( sal_uInt8 cGreyDec );
-
- 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 BYTE GetLuminance() const;
+ inline BitmapColor& IncreaseLuminance( BYTE cGreyInc );
+ inline BitmapColor& DecreaseLuminance( BYTE cGreyDec );
+
+ inline BitmapColor& Merge( const BitmapColor& rColor, BYTE cTransparency );
+ inline BitmapColor& Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency );
- inline sal_uLong GetColorError( const BitmapColor& rBitmapColor ) const;
+ inline ULONG GetColorError( const BitmapColor& rBitmapColor ) const;
};
// ---------------
@@ -179,35 +179,35 @@ class VCL_DLLPUBLIC BitmapPalette
private:
- BitmapColor* mpBitmapColor;
- sal_uInt16 mnCount;
+ BitmapColor* mpBitmapColor;
+ USHORT mnCount;
public:
-
+
SAL_DLLPRIVATE inline BitmapColor* ImplGetColorBuffer() const;
public:
- inline BitmapPalette();
- inline BitmapPalette( const BitmapPalette& rBitmapPalette );
- inline BitmapPalette( sal_uInt16 nCount );
- inline ~BitmapPalette();
+ inline BitmapPalette();
+ inline BitmapPalette( const BitmapPalette& rBitmapPalette );
+ inline BitmapPalette( USHORT nCount );
+ inline ~BitmapPalette();
- inline BitmapPalette& operator=( const BitmapPalette& rBitmapPalette );
- inline sal_Bool operator==( const BitmapPalette& rBitmapPalette ) const;
- inline sal_Bool operator!=( const BitmapPalette& rBitmapPalette ) const;
- inline sal_Bool operator!();
+ 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_uInt16 GetEntryCount() const;
- inline void SetEntryCount( sal_uInt16 nCount );
+ inline USHORT GetEntryCount() const;
+ inline void SetEntryCount( USHORT nCount );
- inline const BitmapColor& operator[]( sal_uInt16 nIndex ) const;
- inline BitmapColor& operator[]( sal_uInt16 nIndex );
+ inline const BitmapColor& operator[]( USHORT nIndex ) const;
+ inline BitmapColor& operator[]( USHORT nIndex );
- inline sal_uInt16 GetBestIndex( const BitmapColor& rCol ) const;
- bool IsGreyPalette() const;
+ inline USHORT GetBestIndex( const BitmapColor& rCol ) const;
+ bool IsGreyPalette() const;
};
// ---------------
@@ -216,43 +216,43 @@ public:
class VCL_DLLPUBLIC ColorMask
{
- sal_uLong mnRMask;
- sal_uLong mnGMask;
- sal_uLong mnBMask;
- long mnRShift;
- long mnGShift;
- long mnBShift;
- sal_uLong mnROrShift;
- sal_uLong mnGOrShift;
- sal_uLong mnBOrShift;
- sal_uLong mnROr;
- sal_uLong mnGOr;
- sal_uLong mnBOr;
-
- SAL_DLLPRIVATE inline long ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const;
+ ULONG mnRMask;
+ ULONG mnGMask;
+ ULONG mnBMask;
+ long mnRShift;
+ long mnGShift;
+ long mnBShift;
+ ULONG mnROrShift;
+ ULONG mnGOrShift;
+ ULONG mnBOrShift;
+ ULONG mnROr;
+ ULONG mnGOr;
+ ULONG mnBOr;
+
+ SAL_DLLPRIVATE inline long ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const;
public:
- inline ColorMask( sal_uLong nRedMask = 0UL, sal_uLong nGreenMask = 0UL, sal_uLong nBlueMask = 0UL );
- inline ~ColorMask() {}
+ inline ColorMask( ULONG nRedMask = 0UL, ULONG nGreenMask = 0UL, ULONG nBlueMask = 0UL );
+ inline ~ColorMask() {}
- inline sal_uLong GetRedMask() const;
- inline sal_uLong GetGreenMask() const;
- inline sal_uLong GetBlueMask() const;
+ inline ULONG GetRedMask() const;
+ inline ULONG GetGreenMask() const;
+ inline ULONG GetBlueMask() const;
- inline void GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
- inline void SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
- inline void GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
- inline void SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
- inline void GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
- inline void SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const;
- inline void GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
- inline void SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
- inline void GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
- inline void SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
+ inline void GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+ inline void SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
};
// ---------------
@@ -261,14 +261,14 @@ public:
struct VCL_DLLPUBLIC BitmapBuffer
{
- sal_uLong mnFormat;
- long mnWidth;
- long mnHeight;
- long mnScanlineSize;
- sal_uInt16 mnBitCount;
- ColorMask maColorMask;
- BitmapPalette maPalette;
- sal_uInt8* mpBits;
+ ULONG mnFormat;
+ long mnWidth;
+ long mnHeight;
+ long mnScanlineSize;
+ USHORT mnBitCount;
+ ColorMask maColorMask;
+ BitmapPalette maPalette;
+ BYTE* mpBits;
BitmapBuffer(){}
~BitmapBuffer() {}
@@ -278,62 +278,62 @@ struct VCL_DLLPUBLIC BitmapBuffer
// - StretchAndConvert -
// ---------------------
-VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
+VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
+ ULONG nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
// ------------------------------------------------------------------
inline BitmapColor::BitmapColor() :
- mcBlueOrIndex ( 0 ),
- mcGreen ( 0 ),
- mcRed ( 0 ),
- mbIndex ( sal_False )
+ mcBlueOrIndex ( 0 ),
+ mcGreen ( 0 ),
+ mcRed ( 0 ),
+ mbIndex ( FALSE )
{
}
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) :
- mcBlueOrIndex ( cBlue ),
- mcGreen ( cGreen ),
- mcRed ( cRed ),
- mbIndex ( sal_False )
+inline BitmapColor::BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue ) :
+ mcBlueOrIndex ( cBlue ),
+ mcGreen ( cGreen ),
+ mcRed ( cRed ),
+ mbIndex ( FALSE )
{
}
// ------------------------------------------------------------------
inline BitmapColor::BitmapColor( const BitmapColor& rBitmapColor ) :
- mcBlueOrIndex ( rBitmapColor.mcBlueOrIndex ),
- mcGreen ( rBitmapColor.mcGreen ),
- mcRed ( rBitmapColor.mcRed ),
- mbIndex ( rBitmapColor.mbIndex )
+ mcBlueOrIndex ( rBitmapColor.mcBlueOrIndex ),
+ mcGreen ( rBitmapColor.mcGreen ),
+ mcRed ( rBitmapColor.mcRed ),
+ mbIndex ( rBitmapColor.mbIndex )
{
}
// ------------------------------------------------------------------
inline BitmapColor::BitmapColor( const Color& rColor ) :
- mcBlueOrIndex ( rColor.GetBlue() ),
- mcGreen ( rColor.GetGreen() ),
- mcRed ( rColor.GetRed() ),
- mbIndex ( 0 )
+ mcBlueOrIndex ( rColor.GetBlue() ),
+ mcGreen ( rColor.GetGreen() ),
+ mcRed ( rColor.GetRed() ),
+ mbIndex ( 0 )
{
}
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
- mcBlueOrIndex ( cIndex ),
- mcGreen ( 0 ),
- mcRed ( 0 ),
- mbIndex ( sal_True )
+inline BitmapColor::BitmapColor( BYTE cIndex ) :
+ mcBlueOrIndex ( cIndex ),
+ mcGreen ( 0 ),
+ mcRed ( 0 ),
+ mbIndex ( TRUE )
{
}
// ------------------------------------------------------------------
-inline sal_Bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
+inline BOOL BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
{
return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
( mbIndex ? rBitmapColor.mbIndex :
@@ -342,7 +342,7 @@ inline sal_Bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
// ------------------------------------------------------------------
-inline sal_Bool BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
+inline BOOL BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
{
return !( *this == rBitmapColor );
}
@@ -361,14 +361,14 @@ inline BitmapColor& BitmapColor::operator=( const BitmapColor& rBitmapColor )
// ------------------------------------------------------------------
-inline sal_Bool BitmapColor::IsIndex() const
+inline BOOL BitmapColor::IsIndex() const
{
return mbIndex;
}
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetRed() const
+inline BYTE BitmapColor::GetRed() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcRed;
@@ -376,7 +376,7 @@ inline sal_uInt8 BitmapColor::GetRed() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetRed( sal_uInt8 cRed )
+inline void BitmapColor::SetRed( BYTE cRed )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcRed = cRed;
@@ -384,7 +384,7 @@ inline void BitmapColor::SetRed( sal_uInt8 cRed )
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetGreen() const
+inline BYTE BitmapColor::GetGreen() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcGreen;
@@ -392,7 +392,7 @@ inline sal_uInt8 BitmapColor::GetGreen() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetGreen( sal_uInt8 cGreen )
+inline void BitmapColor::SetGreen( BYTE cGreen )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcGreen = cGreen;
@@ -400,7 +400,7 @@ inline void BitmapColor::SetGreen( sal_uInt8 cGreen )
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetBlue() const
+inline BYTE BitmapColor::GetBlue() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcBlueOrIndex;
@@ -408,7 +408,7 @@ inline sal_uInt8 BitmapColor::GetBlue() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetBlue( sal_uInt8 cBlue )
+inline void BitmapColor::SetBlue( BYTE cBlue )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = cBlue;
@@ -416,7 +416,7 @@ inline void BitmapColor::SetBlue( sal_uInt8 cBlue )
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetIndex() const
+inline BYTE BitmapColor::GetIndex() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -424,7 +424,7 @@ inline sal_uInt8 BitmapColor::GetIndex() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetIndex( sal_uInt8 cIndex )
+inline void BitmapColor::SetIndex( BYTE cIndex )
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
mcBlueOrIndex = cIndex;
@@ -440,7 +440,7 @@ inline BitmapColor::operator Color() const
// ------------------------------------------------------------------
-inline BitmapColor::operator sal_uInt8() const
+inline BitmapColor::operator BYTE() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -448,7 +448,7 @@ inline BitmapColor::operator sal_uInt8() const
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetBlueOrIndex() const
+inline BYTE BitmapColor::GetBlueOrIndex() const
{
// #i47518# Yield a value regardless of mbIndex
return mcBlueOrIndex;
@@ -466,68 +466,68 @@ inline BitmapColor& BitmapColor::Invert()
// ------------------------------------------------------------------
-inline sal_uInt8 BitmapColor::GetLuminance() const
+inline BYTE BitmapColor::GetLuminance() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
+ return( (BYTE) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )
+inline BitmapColor& BitmapColor::IncreaseLuminance( BYTE cGreyInc )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- 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 );
+ mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
+ mcGreen = (BYTE) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
+ mcRed = (BYTE) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::DecreaseLuminance( sal_uInt8 cGreyDec )
+inline BitmapColor& BitmapColor::DecreaseLuminance( BYTE cGreyDec )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- 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 );
+ mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
+ mcGreen = (BYTE) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
+ mcRed = (BYTE) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uInt8 cTransparency )
+inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, BYTE cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, rBitmapColor.mcBlueOrIndex, cTransparency );
mcGreen = COLOR_CHANNEL_MERGE( mcGreen, rBitmapColor.mcGreen, cTransparency );
mcRed = COLOR_CHANNEL_MERGE( mcRed, rBitmapColor.mcRed, cTransparency );
-
+
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency )
+inline BitmapColor& BitmapColor::Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, cB, cTransparency );
mcGreen = COLOR_CHANNEL_MERGE( mcGreen, cG, cTransparency );
mcRed = COLOR_CHANNEL_MERGE( mcRed, cR, cTransparency );
-
+
return *this;
}
// ------------------------------------------------------------------
-inline sal_uLong BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
+inline 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( (sal_uLong) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
+ return( (ULONG) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
labs( mcGreen - rBitmapColor.mcGreen ) +
labs( mcRed - rBitmapColor.mcRed ) ) );
}
@@ -535,8 +535,8 @@ inline sal_uLong BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) c
// ------------------------------------------------------------------
inline BitmapPalette::BitmapPalette() :
- mpBitmapColor ( NULL ),
- mnCount ( 0 )
+ mpBitmapColor ( NULL ),
+ mnCount ( 0 )
{
}
@@ -547,8 +547,8 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
{
if( mnCount )
{
- const sal_uLong nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ const ULONG nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -557,13 +557,13 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
// ------------------------------------------------------------------
-inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
+inline BitmapPalette::BitmapPalette( USHORT nCount ) :
mnCount( nCount )
{
if( mnCount )
{
- const sal_uLong nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ const ULONG nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
memset( mpBitmapColor, 0, nSize );
}
else
@@ -574,20 +574,20 @@ inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
inline BitmapPalette::~BitmapPalette()
{
- delete[] (sal_uInt8*) mpBitmapColor;
+ delete[] (BYTE*) mpBitmapColor;
}
// ------------------------------------------------------------------
inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPalette )
{
- delete[] (sal_uInt8*) mpBitmapColor;
+ delete[] (BYTE*) mpBitmapColor;
mnCount = rBitmapPalette.mnCount;
if( mnCount )
{
- const sal_uLong nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
+ const ULONG nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -598,19 +598,19 @@ inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPale
// ------------------------------------------------------------------
-inline sal_Bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
+inline BOOL BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( rBitmapPalette.mnCount == mnCount )
{
- bRet = sal_True;
+ bRet = TRUE;
- for( sal_uInt16 i = 0; i < mnCount; i++ )
+ for( USHORT i = 0; i < mnCount; i++ )
{
if( mpBitmapColor[ i ] != rBitmapPalette.mpBitmapColor[ i ] )
{
- bRet = sal_False;
+ bRet = FALSE;
break;
}
}
@@ -621,44 +621,44 @@ inline sal_Bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette )
// ------------------------------------------------------------------
-inline sal_Bool BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
+inline BOOL BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
{
return !( *this == rBitmapPalette );
}
// ------------------------------------------------------------------
-inline sal_Bool BitmapPalette::operator!()
+inline BOOL BitmapPalette::operator!()
{
return( !mnCount || !mpBitmapColor );
}
// ------------------------------------------------------------------
-inline sal_uInt16 BitmapPalette::GetEntryCount() const
+inline USHORT BitmapPalette::GetEntryCount() const
{
return mnCount;
}
// ------------------------------------------------------------------
-inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
+inline void BitmapPalette::SetEntryCount( USHORT nCount )
{
if( !nCount )
{
- delete[] (sal_uInt8*) mpBitmapColor;
+ delete[] (BYTE*) mpBitmapColor;
mpBitmapColor = NULL;
mnCount = 0;
}
else if( nCount != mnCount )
{
- const sal_uLong nNewSize = nCount * sizeof( BitmapColor );
- const sal_uLong nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
- sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ];
+ const ULONG nNewSize = nCount * sizeof( BitmapColor );
+ const ULONG nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
+ BYTE* pNewColor = new BYTE[ nNewSize ];
- if ( nMinSize && mpBitmapColor )
+ if ( nMinSize && mpBitmapColor )
memcpy( pNewColor, mpBitmapColor, nMinSize );
- delete[] (sal_uInt8*) mpBitmapColor;
+ delete[] (BYTE*) mpBitmapColor;
memset( pNewColor + nMinSize, 0, nNewSize - nMinSize );
mpBitmapColor = (BitmapColor*) pNewColor;
mnCount = nCount;
@@ -667,7 +667,7 @@ inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
+inline const BitmapColor& BitmapPalette::operator[]( USHORT nIndex ) const
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -675,7 +675,7 @@ inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
// ------------------------------------------------------------------
-inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex )
+inline BitmapColor& BitmapPalette::operator[]( USHORT nIndex )
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -690,17 +690,17 @@ inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const
}
// ------------------------------------------------------------------
-inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
+inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
{
- sal_uInt16 nRetIndex = 0;
+ USHORT nRetIndex = 0;
if( mpBitmapColor && mnCount )
{
- sal_Bool bFound = sal_False;
+ BOOL bFound = FALSE;
for( long j = 0L; ( j < mnCount ) && !bFound; j++ )
if( rCol == mpBitmapColor[ j ] )
- nRetIndex = ( (sal_uInt16) j ), bFound = sal_True;
+ nRetIndex = ( (USHORT) j ), bFound = TRUE;
if( !bFound )
{
@@ -708,7 +708,7 @@ inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
for( long i = nRetIndex - 1; i >= 0L; i-- )
if ( ( nActErr = rCol.GetColorError( mpBitmapColor[ i ] ) ) < nLastErr )
- nLastErr = nActErr, nRetIndex = (sal_uInt16) i;
+ nLastErr = nActErr, nRetIndex = (USHORT) i;
}
}
@@ -717,7 +717,7 @@ inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
// ------------------------------------------------------------------
-inline ColorMask::ColorMask( sal_uLong nRedMask, sal_uLong nGreenMask, sal_uLong nBlueMask ) :
+inline ColorMask::ColorMask( ULONG nRedMask, ULONG nGreenMask, ULONG nBlueMask ) :
mnRMask( nRedMask ),
mnGMask( nGreenMask ),
mnBMask( nBlueMask ),
@@ -735,48 +735,48 @@ inline ColorMask::ColorMask( sal_uLong nRedMask, sal_uLong nGreenMask, sal_uLong
// ------------------------------------------------------------------
-inline long ColorMask::ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const
+inline long ColorMask::ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const
{
- long nShift;
- long nRet;
- sal_uLong nLen = 0UL;
+ long nShift;
+ long nRet;
+ ULONG nLen = 0UL;
// bei welchen Bits faengt die Maske an
- for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (sal_uLong) nShift ) ); nShift-- )
+ for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (ULONG) nShift ) ); nShift-- )
{}
nRet = nShift;
// XXX Anzahl der gesetzten Bits ermitteln => nach rechts bis Null laufen
- while( ( nShift >= 0L ) && ( nMask & ( 1 << (sal_uLong) nShift ) ) )
+ while( ( nShift >= 0L ) && ( nMask & ( 1 << (ULONG) nShift ) ) )
{
nShift--;
nLen++;
}
rOrShift = 8L - nLen;
- rOr = (sal_uInt8) ( ( 0xffUL >> nLen ) << rOrShift );
+ rOr = (BYTE) ( ( 0xffUL >> nLen ) << rOrShift );
return( nRet -= 7 );
}
// ------------------------------------------------------------------
-inline sal_uLong ColorMask::GetRedMask() const
+inline ULONG ColorMask::GetRedMask() const
{
return mnRMask;
}
// ------------------------------------------------------------------
-inline sal_uLong ColorMask::GetGreenMask() const
+inline ULONG ColorMask::GetGreenMask() const
{
return mnGMask;
}
// ------------------------------------------------------------------
-inline sal_uLong ColorMask::GetBlueMask() const
+inline ULONG ColorMask::GetBlueMask() const
{
return mnBMask;
}
@@ -785,7 +785,7 @@ inline sal_uLong ColorMask::GetBlueMask() const
inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
- const sal_uInt32 nVal = *pPixel;
+ const 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 = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *pPixel = (BYTE) 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 sal_uInt32 nVal = *(sal_uInt16*) pPixel;
+ const UINT32 nVal = *(UINT16*) pPixel;
#else
- const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
+ const UINT32 nVal = pPixel[ 1 ] | ( (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 sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- *(sal_uInt16*) pPixel = nVal;
+ *(UINT16*) pPixel = nVal;
#else
- pPixel[ 0 ] = (sal_uInt8)(nVal >> 8U);
- pPixel[ 1 ] = (sal_uInt8) nVal;
+ pPixel[ 0 ] = (BYTE)(nVal >> 8U);
+ pPixel[ 1 ] = (BYTE) 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 sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL );
+ const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL );
#else
- const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
+ const UINT32 nVal = *(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 sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- pPixel[ 0 ] = (sal_uInt8) nVal;
- pPixel[ 1 ] = (sal_uInt8)(nVal >> 8U);
+ pPixel[ 0 ] = (BYTE) nVal;
+ pPixel[ 1 ] = (BYTE)(nVal >> 8U);
#else
- *(sal_uInt16*) pPixel = nVal;
+ *(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 sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) | ( (sal_uInt32) pPixel[ 2 ] << 16UL );
+ const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) | ( (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 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 );
+ 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 );
}
// ------------------------------------------------------------------
@@ -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 sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
- ( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
+ const UINT32 nVal = (UINT32) pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) |
+ ( (UINT32) pPixel[ 2 ] << 16UL ) | ( (UINT32) pPixel[ 3 ] << 24UL );
#else
- const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
+ const UINT32 nVal = *(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 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 );
+ 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 );
#else
- *(sal_uInt32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *(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
new file mode 100644
index 000000000000..d3fe8dec3e94
--- /dev/null
+++ b/vcl/inc/vcl/salctrlhandle.hxx
@@ -0,0 +1,51 @@
+/* -*- 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 93eb69bd439d..5e9927551390 100644
--- a/vcl/inc/vcl/salctype.hxx
+++ b/vcl/inc/vcl/salctype.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,26 +29,23 @@
#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>
// -----------
// - Defines -
// -----------
-#define CVT_UNKNOWN (0x00000000UL)
-#define CVT_BMP (0x00000001UL)
-#define CVT_GIF (0x00000002UL)
-#define CVT_JPG (0x00000003UL)
-#define CVT_MET (0x00000004UL)
-#define CVT_PCT (0x00000005UL)
-#define CVT_PNG (0x00000006UL)
-#define CVT_SVM (0x00000007UL)
-#define CVT_TIF (0x00000008UL)
-#define CVT_WMF (0x00000009UL)
-#define CVT_EMF (0x0000000aUL)
+#define CVT_UNKNOWN (0x00000000UL)
+#define CVT_BMP (0x00000001UL)
+#define CVT_GIF (0x00000002UL)
+#define CVT_JPG (0x00000003UL)
+#define CVT_MET (0x00000004UL)
+#define CVT_PCT (0x00000005UL)
+#define CVT_PNG (0x00000006UL)
+#define CVT_SVM (0x00000007UL)
+#define CVT_TIF (0x00000008UL)
+#define CVT_WMF (0x00000009UL)
+#define CVT_EMF (0x0000000aUL)
// ---------------
// - ConvertData -
@@ -64,11 +61,11 @@ private:
public:
- Graphic maGraphic;
- SvStream& mrStm;
- sal_uLong mnFormat;
+ Graphic maGraphic;
+ SvStream& mrStm;
+ ULONG mnFormat;
- ConvertData( const Graphic& rGraphic, SvStream& rStm, sal_uLong nFormat ) :
+ ConvertData( const Graphic& rGraphic, SvStream& rStm, ULONG nFormat ) :
maGraphic( rGraphic ), mrStm( rStm ), mnFormat( nFormat ) {}
~ConvertData() {}
};
@@ -77,18 +74,9 @@ public:
// - Callback -
// ------------
-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();
-}
+typedef ULONG (*SALGRFCVTPROC)( void* pInst,
+ ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
+ ULONG nOutFormat, void** ppOutBuffer );
#endif // _SV_SALCTYPE_HXX
diff --git a/vcl/inc/vcl/saldatabasic.hxx b/vcl/inc/vcl/saldatabasic.hxx
index e080cb91ff99..77968c95aef4 100644
--- a/vcl/inc/vcl/saldatabasic.hxx
+++ b/vcl/inc/vcl/saldatabasic.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,17 +33,11 @@
#include <vcl/salinst.hxx>
#include <osl/module.h>
-namespace psp
-{
- class PrinterInfoManager;
-}
-
-class VCL_PLUGIN_PUBLIC SalData
+class VCL_DLLPUBLIC SalData
{
public:
- SalInstance* m_pInstance; // pointer to instance
- oslModule m_pPlugin; // plugin library handle
- psp::PrinterInfoManager* m_pPIManager;
+ SalInstance* m_pInstance; // pointer to instance
+ oslModule m_pPlugin; // plugin library handle
SalData();
virtual ~SalData();
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index f5b98756f5f6..3e4671dd3a7d 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -62,55 +62,55 @@ struct SystemEnvData;
// - SalFrameTypes -
// -----------------
-#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_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_ENDEXTTEXTINPUT_COMPLETE ((sal_uInt16)0x0001)
-#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((sal_uInt16)0x0002)
+#define SAL_FRAME_ENDEXTTEXTINPUT_COMPLETE ((USHORT)0x0001)
+#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((USHORT)0x0002)
// -----------------
// - SalFrameStyle -
// -----------------
-#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)
+#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)
// no shadow effect on WindowsXP
-#define SAL_FRAME_STYLE_NOSHADOW ((sal_uLong)0x00000010)
+#define SAL_FRAME_STYLE_NOSHADOW ((ULONG)0x00000010)
// indicate tooltip windows, so they can always be topmost
-#define SAL_FRAME_STYLE_TOOLTIP ((sal_uLong)0x00000020)
+#define SAL_FRAME_STYLE_TOOLTIP ((ULONG)0x00000020)
// windows without windowmanager decoration, this typically only applies to floating windows
-#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((sal_uLong)0x00000040)
+#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((ULONG)0x00000040)
// dialogs
-#define SAL_FRAME_STYLE_DIALOG ((sal_uLong)0x00000080)
+#define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00000080)
// partial fullscreen: fullscreen on one monitor of a multimonitor display
-#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((sal_uLong)0x00800000)
+#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((ULONG)0x00800000)
// plugged system child window
-#define SAL_FRAME_STYLE_PLUG ((sal_uLong)0x10000000)
+#define SAL_FRAME_STYLE_PLUG ((ULONG)0x10000000)
// system child window inside another SalFrame
-#define SAL_FRAME_STYLE_SYSTEMCHILD ((sal_uLong)0x08000000)
+#define SAL_FRAME_STYLE_SYSTEMCHILD ((ULONG)0x08000000)
// floating window
-#define SAL_FRAME_STYLE_FLOAT ((sal_uLong)0x20000000)
+#define SAL_FRAME_STYLE_FLOAT ((ULONG)0x20000000)
// floating window that needs to be focusable
-#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((sal_uLong)0x04000000)
+#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((ULONG)0x04000000)
// toolwindows should be painted with a smaller decoration
-#define SAL_FRAME_STYLE_TOOLWINDOW ((sal_uLong)0x40000000)
+#define SAL_FRAME_STYLE_TOOLWINDOW ((ULONG)0x40000000)
// the window containing the intro bitmap, aka splashscreen
-#define SAL_FRAME_STYLE_INTRO ((sal_uLong)0x80000000)
+#define SAL_FRAME_STYLE_INTRO ((ULONG)0x80000000)
/*
-#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)
+#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)
*/
// ----------------------------------------
@@ -125,15 +125,14 @@ typedef sal_uInt64 SalExtStyle;
// - Flags for SetPosSize -
// ------------------------
-#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)
+#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)
#ifdef __cplusplus
-using ::rtl::OUString;
-using ::rtl::OString;
+using namespace rtl;
// ------------
// - SalFrame -
@@ -141,98 +140,98 @@ using ::rtl::OString;
struct SystemParentData;
-class VCL_PLUGIN_PUBLIC SalFrame : public vcl::DeletionNotifier
+class VCL_DLLPUBLIC SalFrame : public vcl::DeletionNotifier
{
// the VCL window corresponding to this frame
- Window* m_pWindow;
- SALFRAMEPROC m_pProc;
+ Window* m_pWindow;
+ SALFRAMEPROC m_pProc;
public: // public for Sal Implementation
SalFrame() : m_pWindow( NULL ), m_pProc( NULL ) {}
virtual ~SalFrame();
public: // public for Sal Implementation
- SalFrameGeometry maGeometry;
+ SalFrameGeometry maGeometry;
public:
// SalGraphics or NULL, but two Graphics for all SalFrames
// must be returned
- virtual SalGraphics* GetGraphics() = 0;
- virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
+ virtual SalGraphics* GetGraphics() = 0;
+ virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual sal_Bool PostEvent( void* pData ) = 0;
+ virtual BOOL PostEvent( void* pData ) = 0;
- virtual void SetTitle( const XubString& rTitle ) = 0;
- virtual void SetIcon( sal_uInt16 nIcon ) = 0;
+ virtual void SetTitle( const XubString& rTitle ) = 0;
+ virtual void SetIcon( USHORT nIcon ) = 0;
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu *pSalMenu ) = 0;
virtual void DrawMenuBar() = 0;
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) = 0;
-
+
// Before the window is visible, a resize event
// must be sent with the correct size
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ) = 0;
- virtual void Enable( sal_Bool bEnable ) = 0;
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ) = 0;
+ virtual void Enable( 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, sal_uInt16 nFlags ) = 0;
- virtual void GetClientSize( long& rWidth, long& rHeight ) = 0;
- virtual void GetWorkArea( Rectangle& rRect ) = 0;
- virtual SalFrame* GetParent() const = 0;
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) = 0;
+ virtual void GetClientSize( long& rWidth, long& rHeight ) = 0;
+ virtual void GetWorkArea( Rectangle& rRect ) = 0;
+ virtual SalFrame* GetParent() const = 0;
// Note: x will be mirrored at parent if UI mirroring is active
- SalFrameGeometry GetGeometry();
- const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
- virtual void SetWindowState( const SalFrameState* pState ) = 0;
- virtual sal_Bool GetWindowState( SalFrameState* pState ) = 0;
- virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) = 0;
+ 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;
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( sal_Bool bStart ) = 0;
+ virtual void StartPresentation( BOOL bStart ) = 0;
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( sal_Bool bOnTop ) = 0;
+ virtual void SetAlwaysOnTop( BOOL bOnTop ) = 0;
// Window to top and grab focus
- virtual void ToTop( sal_uInt16 nFlags ) = 0;
+ virtual void ToTop( USHORT nFlags ) = 0;
// this function can call with the same
// pointer style
- virtual void SetPointer( PointerStyle ePointerStyle ) = 0;
- virtual void CaptureMouse( sal_Bool bMouse ) = 0;
- virtual void SetPointerPos( long nX, long nY ) = 0;
+ virtual void SetPointer( PointerStyle ePointerStyle ) = 0;
+ virtual void CaptureMouse( BOOL bMouse ) = 0;
+ virtual void SetPointerPos( long nX, long nY ) = 0;
// flush output buffer
- virtual void Flush( void) = 0;
+ virtual void Flush( void) = 0;
virtual void Flush( const Rectangle& );
// flush output buffer, wait till outstanding operations are done
- virtual void Sync() = 0;
+ virtual void Sync() = 0;
- virtual void SetInputContext( SalInputContext* pContext ) = 0;
- virtual void EndExtTextInput( sal_uInt16 nFlags ) = 0;
+ virtual void SetInputContext( SalInputContext* pContext ) = 0;
+ virtual void EndExtTextInput( USHORT nFlags ) = 0;
- virtual String GetKeyName( sal_uInt16 nKeyCode ) = 0;
- virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ) = 0;
+ virtual String GetKeyName( USHORT nKeyCode ) = 0;
+ virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ) = 0;
// returns in 'rKeyCode' the single keycode that translates to the given unicode when using a keyboard layout of language 'aLangType'
- // returns sal_False if no mapping exists or function not supported
+ // returns FALSE if no mapping exists or function not supported
// this is required for advanced menu support
- virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ) = 0;
+ virtual 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
- virtual LanguageType GetInputLanguage() = 0;
+ virtual LanguageType GetInputLanguage() = 0;
- virtual SalBitmap* SnapShot() = 0;
+ virtual SalBitmap* SnapShot() = 0;
- virtual void UpdateSettings( AllSettings& rSettings ) = 0;
+ virtual void UpdateSettings( AllSettings& rSettings ) = 0;
- virtual void Beep( SoundType eSoundType ) = 0;
+ virtual void Beep( SoundType eSoundType ) = 0;
// returns system data (most prominent: window handle)
- virtual const SystemEnvData* GetSystemData() const = 0;
-
+ virtual const SystemEnvData* GetSystemData() const = 0;
+
// sets a background bitmap on the frame; the implementation
// must not make assumptions about the lifetime of the passed SalBitmap
// but should copy its contents to an own buffer
@@ -242,28 +241,28 @@ public:
// get current modifier, button mask and mouse position
struct SalPointerState
{
- sal_uLong mnState;
+ ULONG mnState;
Point maPos; // in frame coordinates
};
- virtual SalPointerState GetPointerState() = 0;
+ virtual SalPointerState GetPointerState() = 0;
struct SalIndicatorState
{
- sal_uInt16 mnState;
+ USHORT mnState;
};
virtual SalIndicatorState GetIndicatorState() = 0;
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) = 0;
+ virtual void SimulateKeyPress( USHORT nKeyCode ) = 0;
// set new parent window
- virtual void SetParent( SalFrame* pNewParent ) = 0;
+ virtual void SetParent( SalFrame* pNewParent ) = 0;
// reparent window to act as a plugin; implementation
// may choose to use a new system window inetrnally
// return false to indicate failure
- virtual bool SetPluginParent( SystemParentData* pNewParent ) = 0;
-
+ virtual bool SetPluginParent( SystemParentData* pNewParent ) = 0;
+
// move the frame to a new screen
virtual void SetScreenNumber( unsigned int nScreen ) = 0;
@@ -271,17 +270,18 @@ public:
// shaped system windows
// set clip region to none (-> rectangular windows, normal state)
- virtual void ResetClipRegion() = 0;
+ virtual void ResetClipRegion() = 0;
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( sal_uLong nRects ) = 0;
+ virtual void BeginSetClipRegion( ULONG nRects ) = 0;
// add a rectangle to the clip region
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
// done setting up the clipregion
- virtual void EndSetClipRegion() = 0;
+ 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 )
+ void SetCallback( Window* pWindow, SALFRAMEPROC pProc )
{ m_pWindow = pWindow; m_pProc = pProc; }
// returns the instance set
@@ -290,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( sal_uInt16 nEvent, const void* pEvent ) const
+ long CallCallback( USHORT 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 5b9e59f68d8f..a92a7d91cdf1 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,6 +37,7 @@
#include "osl/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
+#include "vcl/salctrlhandle.hxx"
#include <map>
@@ -66,13 +67,13 @@ namespace basegfx {
// - SalGraphics-Codes -
// ---------------------
-#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_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_COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
+#define SAL_COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
// -------------------
// - common typedefs -
@@ -97,9 +98,9 @@ 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_PLUGIN_PUBLIC SalGraphics
+class VCL_DLLPUBLIC SalGraphics
{
- int m_nLayout; // 0: mirroring off, 1: mirror x-axis
+ int m_nLayout; // 0: mirroring off, 1: mirror x-axis
protected:
// flags which hold the SetAntialiasing() value from OutputDevice
@@ -114,58 +115,59 @@ public:
virtual ~SalGraphics();
protected:
- virtual bool setClipRegion( const Region& ) = 0;
+ virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
+ virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ) = 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( 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 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 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( 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;
+ 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;
// CopyArea --> No RasterOp, but ClipRegion
- virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, sal_uInt16 nFlags ) = 0;
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ long nSrcHeight, USHORT nFlags ) = 0;
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ) = 0;
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ) = 0;
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor ) = 0;
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rMaskBitmap ) = 0;
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor ) = 0;
- virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual SalColor getPixel( long nX, long nY ) = 0;
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
+ virtual SalColor getPixel( long nX, long nY ) = 0;
// invert --> ClipRegion (only Windows or VirDevs)
- virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
- virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
+ 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 sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) = 0;
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
// native widget rendering methods that require mirroring
- 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,
+ 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,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
@@ -181,7 +183,7 @@ protected:
otherwise. In this case, clients should try to emulate alpha
compositing themselves
*/
- virtual bool drawAlphaBitmap( const SalTwoRect&,
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap ) = 0;
/** Render solid rectangle with given transparency
@@ -190,61 +192,64 @@ protected:
Transparency value (0-255) to use. 0 blits and opaque, 255 a
fully transparent rectangle
*/
- virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) = 0;
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) = 0;
public:
// public SalGraphics methods, the interface to the independent vcl part
// get device resolution
- virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
+ virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
// get the depth of the device
- virtual sal_uInt16 GetBitCount() const = 0;
+ virtual USHORT GetBitCount() = 0;
// get the width of the device
- virtual long GetGraphicsWidth() const = 0;
+ virtual long GetGraphicsWidth() const = 0;
// set the clip region to empty
- virtual void ResetClipRegion() = 0;
+ 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;
+ virtual void SetLineColor() = 0;
// set the line color to a specific color
- virtual void SetLineColor( SalColor nSalColor ) = 0;
+ virtual void SetLineColor( SalColor nSalColor ) = 0;
// set the fill color to transparent (= don't fill)
- virtual void SetFillColor() = 0;
+ virtual void SetFillColor() = 0;
// set the fill color to a specific color, shapes will be
// filled accordingly
- virtual void SetFillColor( SalColor nSalColor ) = 0;
+ virtual void SetFillColor( SalColor nSalColor ) = 0;
// enable/disable XOR drawing
- virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
+ virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
// set line color for raster operations
- virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
+ virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
// set fill color for raster operations
- virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
+ virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
// set the text color to a specific color
- virtual void SetTextColor( SalColor nSalColor ) = 0;
+ virtual void SetTextColor( SalColor nSalColor ) = 0;
// set the font
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
// release the fonts
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual sal_uLong GetKernPairs( sal_uLong nMaxPairCount, ImplKernPairData* ) = 0;
+ virtual ULONG GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
// get the repertoire of the current font
- virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
- // get the layout capabilities of the current font
- virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
+ virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
// graphics must fill supplied font list
- virtual void GetDevFontList( ImplDevFontList* ) = 0;
+ virtual void GetDevFontList( ImplDevFontList* ) = 0;
// graphics should call ImplAddDevFontSubstitute on supplied
// OutputDevice for all its device specific preferred font substitutions
- virtual void GetDevFontSubstList( OutputDevice* ) = 0;
- virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ) = 0;
+ virtual void GetDevFontSubstList( OutputDevice* ) = 0;
+ 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 sal_True if creation of subset was successfull
+ // returns 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
@@ -254,7 +259,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -287,8 +292,8 @@ public:
FontSubsetInfo& rInfo,
long* pDataLen ) = 0;
// frees the font data again
- virtual void FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
-
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen ) = 0;
+
// get the same widths as in CreateFontSubset and GetEmbedFontData
// in case of an embeddable font also fill the mapping
// between unicode and glyph id
@@ -298,11 +303,11 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc ) = 0;
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
- virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
+ virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
+ virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
- virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
+ virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
/** Filter text from DrawText commands in a device specific manner
<p>
This function allows a device (or rather the corresponding SalGraphics
@@ -335,16 +340,16 @@ public:
false: no substitution has taken place, rNewText, rLen, rCutStart, rCutStop remain unchanged
*/
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
-
+
virtual bool supportsOperation( OutDevSupportType ) const = 0;
// mirroring specifica
- int GetLayout() { return m_nLayout; }
- void SetLayout( int aLayout ) { m_nLayout = aLayout;}
+ int GetLayout() { return m_nLayout; }
+ void SetLayout( int aLayout ) { m_nLayout = aLayout;}
- void mirror( long& nX, const OutputDevice *pOutDev, bool bBack = false ) const;
- void mirror( long& nX, long& nWidth, 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( 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;
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;
@@ -352,35 +357,36 @@ 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 possible coordinate mirroring and
+ // non virtual methods; these do eventual coordinate mirroring and
// then delegate to protected virtual methods
- bool SetClipRegion( const Region&, const OutputDevice *pOutDev );
+ BOOL UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
+ BOOL UnionClipRegion( const ::basegfx::B2DPolyPolygon&, const OutputDevice* );
// 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( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
- void DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolygon( 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( sal_uLong nPoints,
+ sal_Bool DrawPolyLineBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry,
+ const BYTE* pFlgAry,
const OutputDevice *pOutDev );
- sal_Bool DrawPolygonBezier( sal_uLong nPoints,
+ sal_Bool DrawPolygonBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry,
+ const BYTE* pFlgAry,
const OutputDevice *pOutDev );
sal_Bool DrawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry,
+ const BYTE* const* pFlgAry,
const OutputDevice *pOutDev );
// CopyArea --> No RasterOp, but ClipRegion
@@ -390,7 +396,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 nFlags,
+ USHORT nFlags,
const OutputDevice *pOutDev );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
@@ -421,27 +427,27 @@ public:
// invert --> ClipRegion (only Windows)
void Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
- void Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
+ void Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
- sal_Bool DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev );
+ BOOL DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
//-------------------------------------
// Native Widget Rendering functions
//-------------------------------------
// Query the platform layer for control support
- virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- sal_Bool HitTestNativeControl( ControlType nType,
+ BOOL HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- sal_Bool& rIsInside,
+ BOOL& rIsInside,
const OutputDevice *pOutDev );
// Request rendering of a particular control and/or part
- sal_Bool DrawNativeControl( ControlType nType,
+ BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -450,7 +456,7 @@ public:
const OutputDevice *pOutDev );
// Request rendering of a caption string for a control
- sal_Bool DrawNativeControlText( ControlType nType,
+ BOOL DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -459,7 +465,7 @@ public:
const OutputDevice *pOutDev );
// Query the native control's actual drawing region (including adornment)
- sal_Bool GetNativeControlRegion( ControlType nType,
+ BOOL GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -472,14 +478,14 @@ public:
static void AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- sal_uInt16 nFlags = 0 );
+ USHORT nFlags = 0 );
bool DrawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap,
const OutputDevice *pOutDev );
- bool DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
+ bool DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
sal_uInt8 nTransparency, const OutputDevice *pOutDev );
virtual SystemGraphicsData GetGraphicsData() const = 0;
diff --git a/vcl/inc/vcl/salgeom.hxx b/vcl/inc/vcl/salgeom.hxx
index c512d0a195fa..48d8e39d5121 100644
--- a/vcl/inc/vcl/salgeom.hxx
+++ b/vcl/inc/vcl/salgeom.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@ typedef struct _SalFrameGeometry {
nRightDecoration,
nBottomDecoration;
unsigned int nScreenNumber;
-
+
_SalFrameGeometry() :
nX( 0 ), nY( 0 ), nWidth( 1 ), nHeight( 1 ),
nLeftDecoration( 0 ), nTopDecoration( 0 ),
diff --git a/vcl/inc/vcl/salgtype.hxx b/vcl/inc/vcl/salgtype.hxx
index 7f994f452f2c..ea98f91c58f3 100644
--- a/vcl/inc/vcl/salgtype.hxx
+++ b/vcl/inc/vcl/salgtype.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,12 +35,12 @@
// - SalColor -
// ------------
-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)
+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))
+#define SALCOLOR_NONE (~(SalColor)0)
// ------------
// - SalPoint -
// ------------
@@ -48,8 +48,8 @@ typedef sal_uInt32 SalColor;
// must equal to class Point
struct SalPoint
{
- long mnX;
- long mnY;
+ long mnX;
+ long mnY;
};
typedef const SalPoint* PCONSTSALPOINT;
@@ -60,33 +60,33 @@ typedef const SalPoint* PCONSTSALPOINT;
struct SalTwoRect
{
- long mnSrcX;
- long mnSrcY;
- long mnSrcWidth;
- long mnSrcHeight;
- long mnDestX;
- long mnDestY;
- long mnDestWidth;
- long mnDestHeight;
+ long mnSrcX;
+ long mnSrcY;
+ long mnSrcWidth;
+ long mnSrcHeight;
+ long mnDestX;
+ long mnDestY;
+ long mnDestWidth;
+ long mnDestHeight;
};
// ---------------
// - SalROPColor -
// ---------------
-typedef sal_uInt16 SalROPColor;
-#define SAL_ROP_0 ((SalROPColor)0)
-#define SAL_ROP_1 ((SalROPColor)1)
-#define SAL_ROP_INVERT ((SalROPColor)2)
+typedef USHORT SalROPColor;
+#define SAL_ROP_0 ((SalROPColor)0)
+#define SAL_ROP_1 ((SalROPColor)1)
+#define SAL_ROP_INVERT ((SalROPColor)2)
// -------------
// - SalInvert -
// -------------
-typedef sal_uInt16 SalInvert;
-#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
-#define SAL_INVERT_50 ((SalInvert)0x0002)
-#define SAL_INVERT_TRACKFRAME ((SalInvert)0x0004)
+typedef USHORT SalInvert;
+#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
+#define SAL_INVERT_50 ((SalInvert)0x0002)
+#define SAL_INVERT_TRACKFRAME ((SalInvert)0x0004)
#endif // _SV_SALGTYPE_HXX
diff --git a/vcl/inc/vcl/salimestatus.hxx b/vcl/inc/vcl/salimestatus.hxx
index 13362c20071d..c43038b8ea0f 100644
--- a/vcl/inc/vcl/salimestatus.hxx
+++ b/vcl/inc/vcl/salimestatus.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,7 @@
#include <vcl/dllapi.h>
-class VCL_PLUGIN_PUBLIC SalI18NImeStatus
+class VCL_DLLPUBLIC SalI18NImeStatus
{
public:
SalI18NImeStatus() {}
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index d878dd7fea80..a69980c9acea 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -32,12 +32,10 @@
#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>
@@ -63,97 +61,114 @@ struct SalItemParams;
class SalSession;
struct SystemGraphicsData;
struct SystemWindowData;
-class Menu;
// ---------------
// - SalInstance -
// ---------------
-class VCL_PLUGIN_PUBLIC SalInstance
+class VCL_DLLPUBLIC SalInstance
{
+public:
+ typedef bool(*Callback)(void*,void*,int);
private:
- rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst;
+ void* m_pEventInst;
+ void* m_pErrorInst;
+ Callback m_pEventCallback;
+ Callback m_pErrorCallback;
public:
- SalInstance() {}
+ SalInstance() :
+ m_pEventInst( NULL ),
+ m_pErrorInst( NULL ),
+ m_pEventCallback( NULL ),
+ m_pErrorCallback( NULL )
+ {}
virtual ~SalInstance();
// Frame
// DisplayName for Unix ???
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) = 0;
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) = 0;
- virtual void DestroyFrame( SalFrame* pFrame ) = 0;
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ) = 0;
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ) = 0;
+ virtual void DestroyFrame( SalFrame* pFrame ) = 0;
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ) = 0;
- virtual void DestroyObject( SalObject* pObject ) = 0;
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ) = 0;
+ virtual void DestroyObject( SalObject* pObject ) = 0;
// VirtualDevice
// nDX and nDY in Pixel
// nBitCount: 0 == Default(=as window) / 1 == Mono
// pData allows for using a system dependent graphics or device context
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ) = 0;
+ USHORT nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ) = 0;
// Printer
// pSetupData->mpDriverData can be 0
// pSetupData must be updatet with the current
// JobSetup
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData ) = 0;
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ) = 0;
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ) = 0;
- virtual void DestroyPrinter( SalPrinter* pPrinter ) = 0;
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ) = 0;
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ) = 0;
+ virtual void DestroyPrinter( SalPrinter* pPrinter ) = 0;
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) = 0;
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) = 0;
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) = 0;
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ) = 0;
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) = 0;
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) = 0;
virtual String GetDefaultPrinter() = 0;
// SalTimer
- virtual SalTimer* CreateSalTimer() = 0;
+ virtual SalTimer* CreateSalTimer() = 0;
// SalI18NImeStatus
- virtual SalI18NImeStatus* CreateI18NImeStatus() = 0;
+ virtual SalI18NImeStatus* CreateI18NImeStatus() = 0;
// SalSystem
- virtual SalSystem* CreateSalSystem() = 0;
+ virtual SalSystem* CreateSalSystem() = 0;
// SalBitmap
- virtual SalBitmap* CreateSalBitmap() = 0;
+ virtual SalBitmap* CreateSalBitmap() = 0;
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex() = 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;
+ virtual ULONG ReleaseYieldMutex() = 0;
+ virtual void AcquireYieldMutex( ULONG nCount ) = 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( sal_uInt16 nType ) = 0;
+ virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) = 0;
+ virtual bool AnyInput( USHORT nType ) = 0;
// Menues
- virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pMenu );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
+ 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;
// may return NULL to disable session management
- virtual SalSession* CreateSalSession() = 0;
+ virtual SalSession* CreateSalSession() = 0;
// methods for XDisplayConnection
- void SetEventCallback( rtl::Reference< vcl::DisplayConnectionDispatch > const & pInstance )
- { m_pEventInst = pInstance; }
- bool CallEventCallback( void* pEvent, int nBytes )
- { return m_pEventInst.is() && m_pEventInst->dispatchEvent( pEvent, nBytes ); }
- bool CallErrorCallback( void* pEvent, int nBytes )
- { return m_pEventInst.is() && m_pEventInst->dispatchErrorEvent( pEvent, nBytes ); }
+ // 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; }
+ 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; }
+ bool CallErrorCallback( void* pEvent, int nBytes )
+ { return m_pErrorCallback ? m_pErrorCallback( m_pErrorInst, pEvent, nBytes ) : false; }
enum ConnectionIdentifierType { AsciiCString, Blob };
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
// this is a vehicle for PrintFontManager to bridge the gap between vcl and libvclplug_*
// this is only necessary because PrintFontManager is an exported vcl API and therefore
@@ -166,11 +181,6 @@ public:
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource();
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) = 0;
-
- // callbacks for printer updates
- virtual void updatePrinterUpdate() {}
- virtual void jobStartedPrinterUpdate() {}
- virtual void jobEndedPrinterUpdate() {}
};
// called from SVMain
@@ -183,7 +193,7 @@ void DestroySalInstance( SalInstance* pInst );
void SalAbort( const XubString& rErrorText );
-VCL_PLUGIN_PUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
+VCL_DLLPUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
// -----------
// - SalData -
@@ -200,7 +210,7 @@ void DeInitSalMain();
// ----------
// Callbacks (indepen in \sv\source\app\svmain.cxx)
-VCL_DLLPUBLIC int SVMain();
+VCL_DLLPUBLIC BOOL SVMain();
#endif // _SV_SALINST_HXX
diff --git a/vcl/inc/vcl/sallayout.hxx b/vcl/inc/vcl/sallayout.hxx
index b91185769b27..ffcec7f1f3e2 100644
--- a/vcl/inc/vcl/sallayout.hxx
+++ b/vcl/inc/vcl/sallayout.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -73,7 +73,7 @@ class ImplFontData;
// -----------------
// used for managing runs e.g. for BiDi, glyph and script fallback
-class VCL_PLUGIN_PUBLIC ImplLayoutRuns
+class VCL_DLLPUBLIC 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_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
+VCL_DLLPUBLIC 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_PLUGIN_PUBLIC SalLayout
+class VCL_DLLPUBLIC SalLayout
{
public:
// used by upper layers
@@ -197,7 +197,7 @@ public:
int GetUnitsPerPixel() const { return mnUnitsPerPixel; }
int GetOrientation() const { return mnOrientation; }
-
+
virtual const ImplFontData* GetFallbackFontData( sal_GlyphId ) const;
// methods using string indexing
@@ -259,7 +259,7 @@ protected:
// - MultiSalLayout -
// ------------------
-class VCL_PLUGIN_PUBLIC MultiSalLayout : public SalLayout
+class VCL_DLLPUBLIC 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
- explicit MultiSalLayout( SalLayout& rBaseLayout,
+ MultiSalLayout( SalLayout& rBaseLayout,
const ImplFontData* pBaseFont = NULL );
virtual bool AddFallback( SalLayout& rFallbackLayout,
ImplLayoutRuns&, const ImplFontData* pFallbackFont );
@@ -330,9 +330,9 @@ public:
enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200, IS_DIACRITIC=0x400 };
- bool IsClusterStart() const { return ((mnFlags & IS_IN_CLUSTER) == 0); }
- bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); }
- bool IsDiacritic() const { return ((mnFlags & IS_DIACRITIC) != 0); }
+ bool IsClusterStart() const { return ((mnFlags & IS_IN_CLUSTER) == 0); }
+ bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); }
+ bool IsDiacritic() const { return ((mnFlags & IS_DIACRITIC) != 0); }
};
// ---------------
@@ -342,7 +342,7 @@ typedef std::vector<GlyphItem> GlyphVector;
// ---------------
-class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
+class VCL_DLLPUBLIC GenericSalLayout : public SalLayout
{
public:
// used by layout engines
diff --git a/vcl/inc/vcl/salmenu.hxx b/vcl/inc/vcl/salmenu.hxx
index 63fb12ee4a84..44857692866f 100644
--- a/vcl/inc/vcl/salmenu.hxx
+++ b/vcl/inc/vcl/salmenu.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,60 +41,60 @@ class SalFrame;
struct SalItemParams
{
- sal_uInt16 nId; // item Id
- MenuItemType eType; // MenuItem-Type
- MenuItemBits nBits; // MenuItem-Bits
- Menu* pMenu; // Pointer to Menu
- XubString aText; // Menu-Text
- Image aImage; // Image
+ USHORT nId; // item Id
+ MenuItemType eType; // MenuItem-Type
+ MenuItemBits nBits; // MenuItem-Bits
+ Menu* pMenu; // Pointer to Menu
+ XubString aText; // Menu-Text
+ Image aImage; // Image
};
struct SalMenuButtonItem
{
- sal_uInt16 mnId;
+ USHORT mnId;
Image maImage;
rtl::OUString maToolTipText;
-
+
SalMenuButtonItem() : mnId( 0 ) {}
- SalMenuButtonItem( sal_uInt16 i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
+ SalMenuButtonItem( USHORT i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
: mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
};
-class VCL_PLUGIN_PUBLIC SalMenuItem
+class VCL_DLLPUBLIC SalMenuItem
{
public:
SalMenuItem() {}
virtual ~SalMenuItem();
};
-class VCL_PLUGIN_PUBLIC SalMenu
+class VCL_DLLPUBLIC SalMenu
{
public:
SalMenu() {}
virtual ~SalMenu();
- virtual sal_Bool VisibleMenuBar() = 0; // must return sal_True to actually DISPLAY native menu bars
+ virtual BOOL VisibleMenuBar() = 0; // 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 ) = 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, sal_Bool bCheck ) = 0;
- virtual void EnableItem( unsigned nPos, sal_Bool bEnable ) = 0;
+ virtual void CheckItem( unsigned nPos, BOOL bCheck ) = 0;
+ virtual void EnableItem( unsigned nPos, 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, sal_uLong nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
- virtual void RemoveMenuBarButton( sal_uInt16 nId );
-
+ virtual void RemoveMenuBarButton( USHORT 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( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
};
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index 696a8660bb2f..be3eeb6c2022 100644
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,32 +40,32 @@
* control if it were composite).
*/
-typedef sal_uInt32 ControlType;
+typedef sal_uInt32 ControlType;
// for use in general purpose ImplControlValue
#define CTRL_GENERIC 0
// Normal PushButton/Command Button
-#define CTRL_PUSHBUTTON 1
+#define CTRL_PUSHBUTTON 1
// Normal single radio button
-#define CTRL_RADIOBUTTON 2
+#define CTRL_RADIOBUTTON 2
// Normal single checkbox
-#define CTRL_CHECKBOX 10
+#define CTRL_CHECKBOX 10
// Combobox, i.e. a ListBox
// that allows data entry by user
-#define CTRL_COMBOBOX 20
+#define CTRL_COMBOBOX 20
// Control that allows text entry
-#define CTRL_EDITBOX 30
+#define CTRL_EDITBOX 30
// Control that allows text entry, but without the usual border
// Has to be handled separately, because this one cannot handle
// HAS_BACKGROUND_TEXTURE, which is drawn in the edit box'es
// border window.
-#define CTRL_EDITBOX_NOBORDER 31
+#define CTRL_EDITBOX_NOBORDER 31
// Control that allows text entry
// ( some systems distingish between single and multi line edit boxes )
@@ -73,61 +73,61 @@ typedef sal_uInt32 ControlType;
// Control that pops up a menu,
// but does NOT allow data entry
-#define CTRL_LISTBOX 35
+#define CTRL_LISTBOX 35
-// An edit field together with two little
+// An edit field together with two little
// buttons on the side (aka spin field)
-#define CTRL_SPINBOX 40
+#define CTRL_SPINBOX 40
// Two standalone spin buttons
// without an edit field
-#define CTRL_SPINBUTTONS 45
+#define CTRL_SPINBUTTONS 45
// A single tab
-#define CTRL_TAB_ITEM 50
+#define CTRL_TAB_ITEM 50
// The border around a tab area,
// but without the tabs themselves.
// May have a gap at the top for
// the active tab
-#define CTRL_TAB_PANE 55
+#define CTRL_TAB_PANE 55
// Background of a Tab Pane
-#define CTRL_TAB_BODY 56
+#define CTRL_TAB_BODY 56
// Normal scrollbar, including
// all parts like slider, buttons
-#define CTRL_SCROLLBAR 60
+#define CTRL_SCROLLBAR 60
#define CTRL_SLIDER 65
// Border around a group of related
// items, perhaps also displaying
// a label of identification
-#define CTRL_GROUPBOX 70
+#define CTRL_GROUPBOX 70
// A separator line
-#define CTRL_FIXEDLINE 80
+#define CTRL_FIXEDLINE 80
// A rectangular border, like a
// Tab Pane, but without the
// possible gap for a tab
-#define CTRL_FIXEDBORDER 90
+#define CTRL_FIXEDBORDER 90
// A toolbar control with buttons and a grip
-#define CTRL_TOOLBAR 100
+#define CTRL_TOOLBAR 100
// The menubar
-#define CTRL_MENUBAR 120
+#define CTRL_MENUBAR 120
// popup menu
#define CTRL_MENU_POPUP 121
// The statusbar
-#define CTRL_STATUSBAR 130
+#define CTRL_STATUSBAR 130
#define CTRL_PROGRESS 131
// Progress bar for the intro window
// (aka splash screen), in case some
-// wants native progress bar in the
+// wants native progress bar in the
// application but not for the splash
// screen (used in desktop/)
#define CTRL_INTROPROGRESS 132
@@ -155,29 +155,27 @@ typedef sal_uInt32 ControlType;
* for example the slider of a scroll bar.
*/
-typedef sal_uInt32 ControlPart;
-
-#define PART_ENTIRE_CONTROL 1
-#define PART_WINDOW 5 // the static listbox window containing the list
-#define PART_BUTTON 100
-#define PART_BUTTON_UP 101
-#define PART_BUTTON_DOWN 102 // Also for ComboBoxes/ListBoxes
-#define PART_BUTTON_LEFT 103
-#define PART_BUTTON_RIGHT 104
-#define PART_ALL_BUTTONS 105
-#define PART_SEPARATOR 106
-#define PART_TRACK_HORZ_LEFT 200
-#define PART_TRACK_VERT_UPPER 201
-#define PART_TRACK_HORZ_RIGHT 202
-#define PART_TRACK_VERT_LOWER 203
-#define PART_TRACK_HORZ_AREA 204
-#define PART_TRACK_VERT_AREA 205
-#define PART_THUMB_HORZ 210 // Also used as toolbar grip
-#define PART_THUMB_VERT 211 // Also used as toolbar grip
+typedef sal_uInt32 ControlPart;
+
+#define PART_ENTIRE_CONTROL 1
+#define PART_WINDOW 5 // the static listbox window containing the list
+#define PART_BUTTON 100
+#define PART_BUTTON_UP 101
+#define PART_BUTTON_DOWN 102 // Also for ComboBoxes/ListBoxes
+#define PART_BUTTON_LEFT 103
+#define PART_BUTTON_RIGHT 104
+#define PART_ALL_BUTTONS 105
+#define PART_TRACK_HORZ_LEFT 200
+#define PART_TRACK_VERT_UPPER 201
+#define PART_TRACK_HORZ_RIGHT 202
+#define PART_TRACK_VERT_LOWER 203
+#define PART_TRACK_HORZ_AREA 204
+#define PART_TRACK_VERT_AREA 205
+#define PART_THUMB_HORZ 210 // Also used as toolbar grip
+#define PART_THUMB_VERT 211 // Also used as toolbar grip
#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
@@ -186,10 +184,10 @@ typedef sal_uInt32 ControlPart;
However aqua draws a little outside. The canonical way would be to enhance the
HitTestNativeControl passing a ScrollbarValue additionally so all necessary
information is available in the call.
- .
+ .
However since there is only this one small exception we will deviate a little and
instead pass the respective rect as control region to allow for a small correction.
-
+
So all places using HitTestNativeControl on PART_THUMB_HORZ, PART_THUMB_VERT,
PART_TRACK_HORZ_LEFT, PART_TRACK_HORZ_RIGHT, PART_TRACK_VERT_UPPER, PART_TRACK_VERT_LOWER
do not use the control rectangle as region but the actuall part rectangle, making
@@ -210,12 +208,12 @@ typedef sal_uInt32 ControlPart;
// in to draw this part is expected to be the entire
// area of the control.
// A control may respond to one or both.
-#define PART_DRAW_BACKGROUND_HORZ 1000
-#define PART_DRAW_BACKGROUND_VERT 1001
+#define PART_DRAW_BACKGROUND_HORZ 1000
+#define PART_DRAW_BACKGROUND_VERT 1001
-// GTK+ also draws tabs right->left since there is a
+// GTK+ also draws tabs right->left since there is a
// hardcoded 2 pixel overlap between adjacent tabs
-#define PART_TABS_DRAW_RTL 3000
+#define PART_TABS_DRAW_RTL 3000
// For themes that do not want to have the focus
// rectangle part drawn by VCL but take care of the
@@ -242,16 +240,16 @@ typedef sal_uInt32 ControlPart;
* in the ControlState.
*/
-typedef sal_uInt32 ControlState;
+typedef sal_uInt32 ControlState;
-#define CTRL_STATE_ENABLED 0x0001
-#define CTRL_STATE_FOCUSED 0x0002
-#define CTRL_STATE_PRESSED 0x0004
-#define CTRL_STATE_ROLLOVER 0x0008
-#define CTRL_STATE_HIDDEN 0x0010
-#define CTRL_STATE_DEFAULT 0x0020
-#define CTRL_STATE_SELECTED 0x0040
-#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
+#define CTRL_STATE_ENABLED 0x0001
+#define CTRL_STATE_FOCUSED 0x0002
+#define CTRL_STATE_PRESSED 0x0004
+#define CTRL_STATE_ROLLOVER 0x0008
+#define CTRL_STATE_HIDDEN 0x0010
+#define CTRL_STATE_DEFAULT 0x0020
+#define CTRL_STATE_SELECTED 0x0040
+#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped)
/* ButtonValue:
*
@@ -278,7 +276,7 @@ class VCL_DLLPUBLIC ImplControlValue
private:
ControlType mType;
ButtonValue mTristate; // Tristate value: on, off, mixed
- long mNumber; // numeric value
+ long mNumber; // numeric value
protected:
ImplControlValue( ControlType i_eType, ButtonValue i_eTriState, long i_nNumber )
: mType( i_eType )
@@ -295,35 +293,35 @@ class VCL_DLLPUBLIC ImplControlValue
: mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
virtual ~ImplControlValue();
-
+
ControlType getType() const { return mType; }
- inline ButtonValue getTristateVal( void ) const { return mTristate; }
- inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+ inline ButtonValue getTristateVal( void ) const { return mTristate; }
+ inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
- inline long getNumericVal( void ) const { return mNumber; }
- inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+ inline long getNumericVal( void ) const { return mNumber; }
+ inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
};
/* ScrollbarValue:
*
* Value container for scrollbars.
*/
-class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
+ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
{
public:
- long mnMin;
- long mnMax;
- long mnCur;
- long mnVisibleSize;
- Rectangle maThumbRect;
- Rectangle maButton1Rect;
- Rectangle maButton2Rect;
- ControlState mnButton1State;
- ControlState mnButton2State;
- ControlState mnThumbState;
- ControlState mnPage1State;
- ControlState mnPage2State;
+ long mnMin;
+ long mnMax;
+ long mnCur;
+ long mnVisibleSize;
+ Rectangle maThumbRect;
+ Rectangle maButton1Rect;
+ Rectangle maButton2Rect;
+ ControlState mnButton1State;
+ ControlState mnButton2State;
+ ControlState mnThumbState;
+ ControlState mnPage1State;
+ ControlState mnPage2State;
inline ScrollbarValue()
: ImplControlValue( CTRL_SCROLLBAR, BUTTONVALUE_DONTKNOW, 0 )
@@ -338,12 +336,12 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
class VCL_DLLPUBLIC SliderValue : public ImplControlValue
{
public:
- long mnMin;
- long mnMax;
- long mnCur;
+ long mnMin;
+ long mnMax;
+ long mnCur;
Rectangle maThumbRect;
ControlState mnThumbState;
-
+
SliderValue()
: ImplControlValue( CTRL_SLIDER, BUTTONVALUE_DONTKNOW, 0 )
, mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
@@ -375,12 +373,12 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
};
virtual ~TabitemValue();
- 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; }
+ 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; }
};
/* SpinbuttonValue:
@@ -392,12 +390,12 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
{
public:
- Rectangle maUpperRect;
- Rectangle maLowerRect;
- ControlState mnUpperState;
- ControlState mnLowerState;
- int mnUpperPart;
- int mnLowerPart;
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ ControlState mnUpperState;
+ ControlState mnLowerState;
+ int mnUpperPart;
+ int mnLowerPart;
inline SpinbuttonValue()
: ImplControlValue( CTRL_SPINBUTTONS, BUTTONVALUE_DONTKNOW, 0 )
@@ -407,7 +405,7 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
virtual ~SpinbuttonValue();
};
-/* Toolbarvalue:
+/* Toolbarvalue:
*
* Value container for toolbars detailing the grip position
*/
@@ -415,14 +413,14 @@ class ToolbarValue : public ImplControlValue
{
public:
ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
- { mbIsTopDockingArea = sal_False; }
+ { mbIsTopDockingArea = FALSE; }
virtual ~ToolbarValue();
- Rectangle maGripRect;
- sal_Bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
+ Rectangle maGripRect;
+ BOOL mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
// adjacent to the menubar
};
-/* MenubarValue:
+/* MenubarValue:
*
* Value container for menubars specifying height of adjacent docking area
*/
@@ -435,25 +433,7 @@ 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:
+/* PushButtonValue:
*
* Value container for pushbuttons specifying additional drawing hints
*/
@@ -464,7 +444,7 @@ public:
: ImplControlValue( CTRL_PUSHBUTTON, BUTTONVALUE_DONTKNOW, 0 )
, mbBevelButton( false ), mbSingleLine( true ) {}
virtual ~PushButtonValue();
-
+
bool mbBevelButton:1;
bool mbSingleLine:1;
};
diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx
index 4e781787b0c9..ca6880652d10 100644
--- a/vcl/inc/vcl/salobj.hxx
+++ b/vcl/inc/vcl/salobj.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,55 +40,53 @@ struct SystemEnvData;
// - SalObject-Types -
// -------------------
-#define SAL_OBJECT_CLIP_INCLUDERECTS ((sal_uInt16)0x0001)
-#define SAL_OBJECT_CLIP_EXCLUDERECTS ((sal_uInt16)0x0002)
-#define SAL_OBJECT_CLIP_ABSOLUTE ((sal_uInt16)0x0004)
+#define SAL_OBJECT_CLIP_INCLUDERECTS ((USHORT)0x0001)
+#define SAL_OBJECT_CLIP_EXCLUDERECTS ((USHORT)0x0002)
+#define SAL_OBJECT_CLIP_ABSOLUTE ((USHORT)0x0004)
// -------------
// - SalObject -
// -------------
-class VCL_PLUGIN_PUBLIC SalObject
+class VCL_DLLPUBLIC SalObject
{
- void* m_pInst;
- SALOBJECTPROC m_pCallback;
- sal_Bool m_bMouseTransparent:1,
+ void* m_pInst;
+ SALOBJECTPROC m_pCallback;
+ BOOL m_bMouseTransparent:1,
m_bEraseBackground:1;
public:
- SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( sal_False ), m_bEraseBackground( sal_True ) {}
+ SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( FALSE ), m_bEraseBackground( TRUE ) {}
virtual ~SalObject();
- virtual void ResetClipRegion() = 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( sal_Bool bVisible ) = 0;
- virtual void Enable( sal_Bool nEnable ) = 0;
- virtual void GrabFocus() = 0;
+ virtual void ResetClipRegion() = 0;
+ virtual USHORT GetClipRegionType() = 0;
+ virtual void BeginSetClipRegion( ULONG nRects ) = 0;
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
+ virtual void EndSetClipRegion() = 0;
- virtual void SetBackground() = 0;
- virtual void SetBackground( SalColor nSalColor ) = 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 GrabFocus() = 0;
- virtual void SetForwardKey( sal_Bool /*bEnable*/ ) {}
+ virtual void SetBackground() = 0;
+ virtual void SetBackground( SalColor nSalColor ) = 0;
- virtual const SystemEnvData* GetSystemData() const = 0;
+ virtual void SetForwardKey( BOOL /*bEnable*/ ) {}
- virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
+ virtual const SystemEnvData* GetSystemData() const = 0;
- void SetCallback( void* pInst, SALOBJECTPROC pProc )
+ void SetCallback( void* pInst, SALOBJECTPROC pProc )
{ m_pInst = pInst; m_pCallback = pProc; }
- long CallCallback( sal_uInt16 nEvent, const void* pEvent )
+ long CallCallback( USHORT nEvent, const void* pEvent )
{ return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
- void SetMouseTransparent( sal_Bool bMouseTransparent )
+ void SetMouseTransparent( BOOL bMouseTransparent )
{ m_bMouseTransparent = bMouseTransparent; }
- sal_Bool IsMouseTransparent()
+ BOOL IsMouseTransparent()
{ return m_bMouseTransparent; }
- void EnableEraseBackground( sal_Bool bEnable )
+ void EnableEraseBackground( BOOL bEnable )
{ m_bEraseBackground = bEnable; }
- sal_Bool IsEraseBackgroundEnabled()
+ BOOL IsEraseBackgroundEnabled()
{ return m_bEraseBackground; }
};
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index e820614e4cdd..9c8cea57d228 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,15 +45,15 @@ namespace vcl { class PrinterController; }
// - SalPrinterQueueInfo -
// -----------------------
-struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
+struct VCL_DLLPUBLIC SalPrinterQueueInfo
{
- XubString maPrinterName;
- XubString maDriver;
- XubString maLocation;
- XubString maComment;
- sal_uLong mnStatus;
- sal_uLong mnJobs;
- void* mpSysData;
+ XubString maPrinterName;
+ XubString maDriver;
+ XubString maLocation;
+ XubString maComment;
+ ULONG mnStatus;
+ ULONG mnJobs;
+ void* mpSysData;
SalPrinterQueueInfo();
~SalPrinterQueueInfo();
@@ -63,11 +63,11 @@ struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
// - SalInfoPrinter -
// ------------------
-class VCL_PLUGIN_PUBLIC SalInfoPrinter
+class VCL_DLLPUBLIC SalInfoPrinter
{
public:
- std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
- bool m_bPapersInit; // set to true after InitPaperFormats
+ std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
+ bool m_bPapersInit; // set to true after InitPaperFormats
bool m_bCompatMetrics;
SalInfoPrinter() : m_bPapersInit( false ), m_bCompatMetrics( false ) {}
@@ -75,64 +75,64 @@ public:
// SalGraphics or NULL, but two Graphics for all SalFrames
// must be returned
- virtual SalGraphics* GetGraphics() = 0;
- virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
+ virtual SalGraphics* GetGraphics() = 0;
+ virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
- virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
+ virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
// This function set the driver data and
// set the new indepen data in pSetupData
- virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ) = 0;
+ virtual 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 sal_Bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
+ virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ) = 0;
- virtual void GetPageInfo( const ImplJobSetup* pSetupData,
+ virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight ) = 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;
+ 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;
// fills m_aPaperFormats and sets m_bPapersInit to true
- virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
+ virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
// returns angle that a landscape page will be turned counterclockwise wrt to portrait
- virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
+ virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
};
// --------------
// - SalPrinter -
// --------------
-class VCL_PLUGIN_PUBLIC SalPrinter
+class VCL_DLLPUBLIC SalPrinter
{
-public: // public for Sal Implementation
+public: // public for Sal Implementation
SalPrinter() {}
virtual ~SalPrinter();
- virtual sal_Bool StartJob( const String* pFileName,
+ virtual BOOL StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
- sal_uLong nCopies,
+ ULONG nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData ) = 0;
// implement for pull model print systems only,
- // default implementations (see salvtables.cxx) just returns sal_False
- virtual sal_Bool StartJob( const String* pFileName,
+ // default implementations (see salvtables.cxx) just returns FALSE
+ virtual BOOL StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
ImplJobSetup* pSetupData,
vcl::PrinterController& rController );
- 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;
-
+ virtual BOOL EndJob() = 0;
+ virtual BOOL AbortJob() = 0;
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;
+ virtual BOOL EndPage() = 0;
+ virtual ULONG GetErrorCode() = 0;
+
};
#endif // _SV_SALPRN_HXX
diff --git a/vcl/inc/vcl/salptype.hxx b/vcl/inc/vcl/salptype.hxx
index ca47f599271c..aa0ba427b5f3 100644
--- a/vcl/inc/vcl/salptype.hxx
+++ b/vcl/inc/vcl/salptype.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,10 +35,10 @@
// - SalJobSetupFlags -
// --------------------
-#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_ORIENTATION ((ULONG)0x00000001)
+#define SAL_JOBSET_PAPERBIN ((ULONG)0x00000002)
+#define SAL_JOBSET_PAPERSIZE ((ULONG)0x00000004)
+#define SAL_JOBSET_DUPLEXMODE ((ULONG)0x00000008)
#define SAL_JOBSET_ALL (SAL_JOBSET_ORIENTATION |\
SAL_JOBSET_PAPERBIN |\
SAL_JOBSET_PAPERSIZE |\
@@ -48,8 +48,8 @@
// - SalPrinterError -
// -------------------
-#define SAL_PRINTER_ERROR_GENERALERROR 1
-#define SAL_PRINTER_ERROR_ABORT 2
+#define SAL_PRINTER_ERROR_GENERALERROR 1
+#define SAL_PRINTER_ERROR_ABORT 2
// -------------------
// - SalPrinterProcs -
diff --git a/vcl/inc/vcl/salsession.hxx b/vcl/inc/vcl/salsession.hxx
index c912565a920c..8e38e78f33b1 100644
--- a/vcl/inc/vcl/salsession.hxx
+++ b/vcl/inc/vcl/salsession.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,18 +41,18 @@ enum SalSessionEventType
struct SalSessionEvent
{
- SalSessionEventType m_eType;
+ SalSessionEventType m_eType;
- SalSessionEvent( SalSessionEventType eType )
+ SalSessionEvent( SalSessionEventType eType )
: m_eType( eType )
{}
};
struct SalSessionInteractionEvent : public SalSessionEvent
{
- bool m_bInteractionGranted;
+ bool m_bInteractionGranted;
- SalSessionInteractionEvent( bool bGranted )
+ SalSessionInteractionEvent( bool bGranted )
: SalSessionEvent( Interaction ),
m_bInteractionGranted( bGranted )
{}
@@ -60,10 +60,10 @@ struct SalSessionInteractionEvent : public SalSessionEvent
struct SalSessionSaveRequestEvent : public SalSessionEvent
{
- bool m_bShutdown;
- bool m_bCancelable;
+ bool m_bShutdown;
+ bool m_bCancelable;
- SalSessionSaveRequestEvent( bool bShutdown, bool bCancelable )
+ SalSessionSaveRequestEvent( bool bShutdown, bool bCancelable )
: SalSessionEvent( SaveRequest ),
m_bShutdown( bShutdown ),
m_bCancelable( bCancelable )
@@ -72,30 +72,30 @@ struct SalSessionSaveRequestEvent : public SalSessionEvent
struct SalSessionShutdownCancelEvent : public SalSessionEvent
{
- SalSessionShutdownCancelEvent()
+ SalSessionShutdownCancelEvent()
: SalSessionEvent( ShutdownCancel )
{}
};
struct SalSessionQuitEvent : public SalSessionEvent
{
- SalSessionQuitEvent()
+ SalSessionQuitEvent()
: SalSessionEvent( Quit )
{}
};
typedef void(*SessionProc)( SalSessionEvent *pEvent);
-class VCL_PLUGIN_PUBLIC SalSession
+class VCL_DLLPUBLIC SalSession
{
- SessionProc m_aProc;
+ SessionProc m_aProc;
public:
- SalSession()
+ SalSession()
: m_aProc( 0 )
{}
virtual ~SalSession();
-
- void SetCallback( SessionProc aCallback )
+
+ void SetCallback( SessionProc aCallback )
{
m_aProc = aCallback;
}
@@ -104,7 +104,7 @@ public:
if( m_aProc )
m_aProc( pEvent );
}
-
+
// query the session manager for a user interaction slot
virtual void queryInteraction() = 0;
// signal the session manager that we're done with user interaction
diff --git a/vcl/inc/vcl/salsys.hxx b/vcl/inc/vcl/salsys.hxx
index 2f2f6d08e9e6..f197c77e4910 100644
--- a/vcl/inc/vcl/salsys.hxx
+++ b/vcl/inc/vcl/salsys.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,21 +59,21 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7;
// - SalSystem -
// -------------
-class VCL_PLUGIN_PUBLIC SalSystem
+class VCL_DLLPUBLIC SalSystem
{
public:
SalSystem() {}
virtual ~SalSystem();
-
+
// get info about the display
/* Gets the number of active screens attached to the display
-
+
@returns the number of active screens
*/
virtual unsigned int GetDisplayScreenCount() = 0;
/* Queries whether multiple screens are truly separate
-
+
@returns true if screens are distinct and windows cannot
be moved between them or span multiple of them
false if screens form up one big display
@@ -82,57 +82,57 @@ public:
/* Queries the default screen number. The default screen is the
screen on which windows will appear if no special positioning
is made.
-
+
@returns the default screen number
*/
virtual unsigned int GetDefaultDisplayNumber() = 0;
/* Gets relative position and size of the screens attached to the display
-
+
@param nScreen
The screen number to be queried
-
+
@returns position: (0,0) in case of IsMultiscreen() == true
else position relative to whole display
size: size of the screen
*/
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
/* Gets position and size of the work area of a screen attached to the display
-
+
@param nScreen
The screen number to be queried
-
+
@returns position and size relative to the scree
*/
virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) = 0;
/* Gets the name of a screen
-
+
@param nScreen
The screen number to be queried
-
+
@returns the name of the screen
*/
virtual rtl::OUString GetScreenName( unsigned int nScreen ) = 0;
/* Shows a native message box with the specified title, message and button
- combination.
-
+ combination.
+
@param rTitle
The title to be shown by the dialog box.
-
+
@param rMessage
The message to be shown by the dialog box.
-
+
@param nButtonCombination
Specify which button combination the message box should display.
See button combinations above.
-
+
@param nDefaultButton
- Specifies which button has the focus initially.
- See button identifiers above.
+ Specifies which button has the focus initially.
+ See button identifiers above.
The effect of specifying a button that doesn't belong
to the specified button combination is undefined.
-
- @returns the identifier of the button that was pressed by the user.
+
+ @returns the identifier of the button that was pressed by the user.
See button identifier above. If the function fails the
return value is 0.
*/
diff --git a/vcl/inc/vcl/saltimer.hxx b/vcl/inc/vcl/saltimer.hxx
index 4bbaddb65b31..ed79e586d97d 100644
--- a/vcl/inc/vcl/saltimer.hxx
+++ b/vcl/inc/vcl/saltimer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,24 +43,24 @@
* this needed to be virtualized for the sal plugin migration
*/
-class VCL_PLUGIN_PUBLIC SalTimer
+class VCL_DLLPUBLIC SalTimer
{
- SALTIMERPROC m_pProc;
+ SALTIMERPROC m_pProc;
public:
SalTimer() : m_pProc( NULL ) {}
virtual ~SalTimer();
// AutoRepeat and Restart
- virtual void Start( sal_uLong nMS ) = 0;
- virtual void Stop() = 0;
+ virtual void Start( ULONG nMS ) = 0;
+ virtual void Stop() = 0;
// Callbacks (indepen in \sv\source\app\timer.cxx)
- void SetCallback( SALTIMERPROC pProc )
+ void SetCallback( SALTIMERPROC pProc )
{
- m_pProc = pProc;
+ m_pProc = pProc;
}
- void CallCallback()
+ void CallCallback()
{
if( m_pProc )
m_pProc();
diff --git a/vcl/inc/vcl/salvd.hxx b/vcl/inc/vcl/salvd.hxx
index 68ed56a901d8..37e9958644de 100644
--- a/vcl/inc/vcl/salvd.hxx
+++ b/vcl/inc/vcl/salvd.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@ class SalGraphics;
// - SalVirtualDevice -
// --------------------
-class VCL_PLUGIN_PUBLIC SalVirtualDevice
+class VCL_DLLPUBLIC SalVirtualDevice
{
public: // public for Sal Implementation
SalVirtualDevice() {}
@@ -46,14 +46,14 @@ public: // public for Sal Implementation
// SalGraphics or NULL, but two Graphics for all SalVirtualDevices
// must be returned
- virtual SalGraphics* GetGraphics() = 0;
- virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
+ virtual SalGraphics* GetGraphics() = 0;
+ virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
// Set new size, without saving the old contents
- virtual sal_Bool SetSize( long nNewDX, long nNewDY ) = 0;
+ virtual BOOL SetSize( long nNewDX, long nNewDY ) = 0;
/// Get actual VDev size in pixel
- virtual void GetSize( long& rWidth, long& rHeight ) = 0;
+ virtual void GetSize( long& rWidth, long& rHeight ) = 0;
};
#endif // _SV_SALVD_HXX
diff --git a/vcl/inc/vcl/salwtype.hxx b/vcl/inc/vcl/salwtype.hxx
index d8bd6c527f85..fbc7832055bd 100644
--- a/vcl/inc/vcl/salwtype.hxx
+++ b/vcl/inc/vcl/salwtype.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,68 +46,68 @@ class ImplFontSelectData;
// Muessen mit den Defines in cmdevt.hxx uebereinstimmen, da diese
// nicht konvertiert werden
-#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)
+#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)
// ------------
// - SalEvent -
// ------------
-#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)
+#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)
// 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
{
- sal_uLong mnTime; // Time in ms, when event is created
+ ULONG mnTime; // Time in ms, when event is created
long mnX; // X-Position (Pixel, TopLeft-Output)
long mnY; // Y-Position (Pixel, TopLeft-Output)
- 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)
+ 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)
};
// KEYINPUT and KEYUP
struct SalKeyEvent
{
- 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)
+ 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)
};
// MENUEVENT
struct SalMenuEvent
{
- sal_uInt16 mnId; // Menu item ID
+ USHORT mnId; // Menu item ID
void* mpMenu; // pointer to VCL menu (class Menu)
-
+
SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {}
- SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
+ SalMenuEvent( USHORT i_nId, void* i_pMenu )
: mnId( i_nId ), mpMenu( i_pMenu ) {}
};
// KEYMODCHANGE
struct SalKeyModEvent
{
- 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)
+ 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)
};
// PAINT
@@ -158,7 +158,7 @@ struct SalPaintEvent
long mnBoundWidth; // BoundRect - Width
long mnBoundHeight; // BoundRect - Height
bool mbImmediateUpdate; // set to true to force an immediate update
-
+
SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) :
mnBoundX( x ), mnBoundY( y ),
mnBoundWidth( w ), mnBoundHeight( h ),
@@ -170,21 +170,21 @@ struct SalPaintEvent
// pEvent == pData
// WHEELMOUSE
-#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
+#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((ULONG)0xFFFFFFFF)
struct SalWheelMouseEvent
{
- sal_uLong mnTime; // Time in ms, when event is created
+ 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
- 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)
-
+ 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)
+
SalWheelMouseEvent()
- : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False )
+ : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( FALSE ), mbDeltaIsPixel( FALSE )
{}
};
@@ -200,13 +200,13 @@ struct SalMouseActivateEvent
// EXTTEXTINPUT
struct SalExtTextInputEvent
{
- sal_uLong mnTime; // Time in ms, when event is created
+ ULONG mnTime; // Time in ms, when event is created
UniString maText; // Text
- 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
+ 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
};
#endif // __cplusplus
@@ -238,8 +238,8 @@ struct SalInputContextChangeEvent
struct SalSurroundingTextRequestEvent
{
UniString maText; // Text
- sal_uLong mnStart; // The beggining index of selected range
- sal_uLong mnEnd; // The end index of selected range
+ ULONG mnStart; // The beggining index of selected range
+ ULONG mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -249,8 +249,8 @@ struct SalSurroundingTextRequestEvent
// SURROUNDINGTEXTSELECTIONCHANGE
struct SalSurroundingTextSelectionChangeEvent
{
- sal_uLong mnStart; // The beggining index of selected range
- sal_uLong mnEnd; // The end index of selected range
+ ULONG mnStart; // The beggining index of selected range
+ ULONG mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -260,50 +260,50 @@ struct SalSurroundingTextSelectionChangeEvent
// ------------------
typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
- sal_uInt16 nEvent, const void* pEvent );
+ USHORT nEvent, const void* pEvent );
// --------------------
// - SalObject-Events -
// --------------------
-#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)
+#define SALOBJ_EVENT_GETFOCUS ((USHORT)1)
+#define SALOBJ_EVENT_LOSEFOCUS ((USHORT)2)
+#define SALOBJ_EVENT_TOTOP ((USHORT)3)
+#define SALOBJ_EVENT_COUNT ((USHORT)4)
// ------------------
// - SalObject-Types -
// ------------------
typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
- sal_uInt16 nEvent, const void* pEvent );
+ USHORT nEvent, const void* pEvent );
// -----------------
// - SalFrameState -
// -----------------
// Must be the same as in syswin.hxx
-#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)
+#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)
struct SalFrameState
{
- sal_uLong mnMask;
+ ULONG mnMask;
long mnX;
long mnY;
long mnWidth;
@@ -312,7 +312,7 @@ struct SalFrameState
long mnMaximizedY;
long mnMaximizedWidth;
long mnMaximizedHeight;
- sal_uLong mnState;
+ 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 ((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)
+#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)
#ifdef __cplusplus
@@ -333,7 +333,7 @@ struct SalInputContext
{
ImplFontSelectData* mpFont;
LanguageType meLanguage;
- sal_uLong mnOptions;
+ ULONG mnOptions;
};
#endif // __cplusplus
diff --git a/vcl/inc/vcl/scrbar.hxx b/vcl/inc/vcl/scrbar.hxx
index 6e894bc2263b..8106317685fb 100644
--- a/vcl/inc/vcl/scrbar.hxx
+++ b/vcl/inc/vcl/scrbar.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -68,31 +68,31 @@ private:
long mnLineSize;
long mnPageSize;
long mnDelta;
- sal_uInt16 mnDragDraw;
- sal_uInt16 mnStateFlags;
+ USHORT mnDragDraw;
+ USHORT mnStateFlags;
ScrollType meScrollType;
ScrollType meDDScrollType;
- sal_Bool mbCalcSize;
- sal_Bool mbFullDrag;
+ BOOL mbCalcSize;
+ BOOL mbFullDrag;
Link maScrollHdl;
Link maEndScrollHdl;
SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
using Window::ImplInit;
- 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( sal_Bool bUpdate = sal_True );
- SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
- SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
- SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
- SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev );
+ 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 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 );
using Window::ImplScroll;
- 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 sal_Bool ImplDrawNative( sal_uInt16 nDrawFlags );
+ 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 void ImplInvert();
+ SAL_DLLPRIVATE BOOL ImplDrawNative( USHORT 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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 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( sal_Bool bEnable = sal_True )
+ void EnableDrag( BOOL bEnable = TRUE )
{ mbFullDrag = bEnable; }
- sal_Bool IsDragEnabled() const { return mbFullDrag; }
+ 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 8466df46a901..bcbe3a265860 100644
--- a/vcl/inc/vcl/seleng.hxx
+++ b/vcl/inc/vcl/seleng.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,8 +39,6 @@ class CommandEvent;
// Timerticks
#define SELENG_DRAGDROP_TIMEOUT 400
#define SELENG_AUTOREPEAT_INTERVAL 50
-#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
-#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION };
@@ -54,14 +52,14 @@ public:
virtual void BeginDrag() = 0;
virtual void CreateAnchor() = 0; // Anker-Pos := Cursor-Pos
- virtual void DestroyAnchor() = 0;
+ virtual void DestroyAnchor() = 0;
// Cursor neu setzen, dabei die beim Anker beginnende
- // Selektion der neuen Cursor-Position anpassen. sal_True == Ok
- virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel,
- sal_Bool bDontSelectAtCursor = sal_False ) = 0;
+ // Selektion der neuen Cursor-Position anpassen. TRUE == Ok
+ virtual BOOL SetCursorAtPoint( const Point& rPointPixel,
+ BOOL bDontSelectAtCursor = FALSE ) = 0;
- virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ) = 0;
+ virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ) = 0;
virtual void DeselectAtPoint( const Point& rPointPixel ) = 0;
// Anker loeschen & alles deselektieren
virtual void DeselectAll() = 0;
@@ -79,7 +77,7 @@ public:
#define SELENG_HAS_ANCH 0x0020
#define SELENG_CMDEVT 0x0040
#define SELENG_WAIT_UPEVT 0x0080
-#define SELENG_EXPANDONMOVE 0x0100
+#define SELENG_EXPANDONMOVE 0x0100
class VCL_DLLPUBLIC SelectionEngine
{
@@ -90,29 +88,27 @@ private:
Timer aWTimer; // erzeugt kuenstliche Mouse-Moves
MouseEvent aLastMove;
SelectionMode eSelMode;
- sal_uLong nUpdateInterval;
// Stufigkeit fuer Mausbewegungen waehrend einer Selektion
- sal_uInt16 nMouseSensitivity;
- sal_uInt16 nLockedMods;
- sal_uInt16 nFlags;
+ USHORT nMouseSensitivity;
+ USHORT nLockedMods;
+ USHORT nFlags;
DECL_DLLPRIVATE_LINK( ImpWatchDog, Timer * );
- inline sal_Bool ShouldDeselect( sal_Bool bModifierKey1 ) const;
+ inline BOOL ShouldDeselect( BOOL bModifierKey1 ) const;
// determines to deselect or not when Ctrl-key is pressed on CursorPosChanging
public:
SelectionEngine( Window* pWindow,
- FunctionSet* pFunctions = NULL,
- sal_uLong nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
+ FunctionSet* pFunctions = NULL );
~SelectionEngine();
- // 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 );
+ // TRUE: Event wurde von Selection-Engine verarbeitet.
+ BOOL SelMouseButtonDown( const MouseEvent& rMEvt );
+ BOOL SelMouseButtonUp( const MouseEvent& rMEvt );
+ BOOL SelMouseMove( const MouseEvent& rMEvt );
// Tastatur
- void CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 );
+ void CursorPosChanging( BOOL bShift, BOOL bMod1 );
// wird benoetigt, um bei ausserhalb des Bereichs stehender
// Maus ueber einen Timer Move-Events zu erzeugen
@@ -120,16 +116,16 @@ public:
{ aArea = rNewArea; }
const Rectangle& GetVisibleArea() const { return aArea; }
- void SetAddMode( sal_Bool);
- sal_Bool IsAddMode() const;
+ void SetAddMode( BOOL);
+ BOOL IsAddMode() const;
- void AddAlways( sal_Bool bOn );
- sal_Bool IsAlwaysAdding() const;
+ void AddAlways( BOOL bOn );
+ BOOL IsAlwaysAdding() const;
- void EnableDrag( sal_Bool bOn );
- sal_Bool IsDragEnabled() const;
+ void EnableDrag( BOOL bOn );
+ BOOL IsDragEnabled() const;
void ActivateDragMode();
- sal_Bool IsInDragMode() const;
+ BOOL IsInDragMode() const;
void SetSelectionMode( SelectionMode eMode );
SelectionMode GetSelectionMode() const { return eSelMode; }
@@ -138,9 +134,9 @@ public:
{ pFunctionSet = pFuncs; }
const FunctionSet* GetFunctionSet() const { return pFunctionSet; }
- void SetMouseSensitivity( sal_uInt16 nSensitivity )
+ void SetMouseSensitivity( USHORT nSensitivity )
{ nMouseSensitivity = nSensitivity; }
- sal_uInt16 GetMouseSensitivity() const
+ USHORT GetMouseSensitivity() const
{ return nMouseSensitivity; }
const Point& GetMousePosPixel() const
@@ -150,22 +146,20 @@ public:
void SetWindow( Window*);
Window* GetWindow() const { return pWin; }
- void LockModifiers( sal_uInt16 nModifiers )
+ void LockModifiers( USHORT nModifiers )
{ nLockedMods = nModifiers; }
- sal_uInt16 GetLockedModifiers() const { return nLockedMods; }
+ USHORT GetLockedModifiers() const { return nLockedMods; }
- sal_Bool IsInSelection() const;
+ BOOL IsInSelection() const;
void Reset();
void Command( const CommandEvent& rCEvt );
- sal_Bool HasAnchor() const;
- void SetAnchor( sal_Bool bAnchor );
-
- void SetUpdateInterval( sal_uLong nInterval );
+ BOOL HasAnchor() const;
+ void SetAnchor( BOOL bAnchor );
// wird im Ctor eingeschaltet
- void ExpandSelectionOnMouseMove( sal_Bool bExpand = sal_True )
+ void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
{
if( bExpand )
nFlags |= SELENG_EXPANDONMOVE;
@@ -174,23 +168,23 @@ public:
}
};
-inline sal_Bool SelectionEngine::IsDragEnabled() const
+inline BOOL SelectionEngine::IsDragEnabled() const
{
if ( nFlags & SELENG_DRG_ENAB )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool SelectionEngine::IsAddMode() const
+inline BOOL SelectionEngine::IsAddMode() const
{
if ( nFlags & (SELENG_IN_ADD | SELENG_ADD_ALW) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline void SelectionEngine::SetAddMode( sal_Bool bNewMode )
+inline void SelectionEngine::SetAddMode( BOOL bNewMode )
{
if ( bNewMode )
nFlags |= SELENG_IN_ADD;
@@ -198,7 +192,7 @@ inline void SelectionEngine::SetAddMode( sal_Bool bNewMode )
nFlags &= (~SELENG_IN_ADD);
}
-inline void SelectionEngine::EnableDrag( sal_Bool bOn )
+inline void SelectionEngine::EnableDrag( BOOL bOn )
{
if ( bOn )
nFlags |= SELENG_DRG_ENAB;
@@ -206,7 +200,7 @@ inline void SelectionEngine::EnableDrag( sal_Bool bOn )
nFlags &= (~SELENG_DRG_ENAB);
}
-inline void SelectionEngine::AddAlways( sal_Bool bOn )
+inline void SelectionEngine::AddAlways( BOOL bOn )
{
if( bOn )
nFlags |= SELENG_ADD_ALW;
@@ -214,39 +208,39 @@ inline void SelectionEngine::AddAlways( sal_Bool bOn )
nFlags &= (~SELENG_ADD_ALW);
}
-inline sal_Bool SelectionEngine::IsAlwaysAdding() const
+inline BOOL SelectionEngine::IsAlwaysAdding() const
{
if ( nFlags & SELENG_ADD_ALW )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool SelectionEngine::IsInDragMode() const
+inline BOOL SelectionEngine::IsInDragMode() const
{
if ( nFlags & SELENG_IN_DRG )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool SelectionEngine::IsInSelection() const
+inline BOOL SelectionEngine::IsInSelection() const
{
if ( nFlags & SELENG_IN_SEL )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool SelectionEngine::HasAnchor() const
+inline BOOL SelectionEngine::HasAnchor() const
{
if ( nFlags & SELENG_HAS_ANCH )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline void SelectionEngine::SetAnchor( sal_Bool bAnchor )
+inline void SelectionEngine::SetAnchor( BOOL bAnchor )
{
if ( bAnchor )
nFlags |= SELENG_HAS_ANCH;
@@ -254,6 +248,6 @@ inline void SelectionEngine::SetAnchor( sal_Bool bAnchor )
nFlags &= (~SELENG_HAS_ANCH);
}
-#endif // _SV_SELENG_HXX
+#endif // _SV_SELENG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index cc5b44169ff6..5fa547d6cf02 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,10 +57,10 @@ class ImplMachineData
ImplMachineData( const ImplMachineData& rData );
private:
- sal_uLong mnRefCount;
- sal_uLong mnOptions;
- sal_uLong mnScreenOptions;
- sal_uLong mnPrintOptions;
+ ULONG mnRefCount;
+ ULONG mnOptions;
+ ULONG mnScreenOptions;
+ ULONG mnPrintOptions;
long mnScreenRasterFontDeviation;
};
@@ -80,17 +80,17 @@ public:
MachineSettings( const MachineSettings& rSet );
~MachineSettings();
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
- void SetScreenOptions( sal_uLong nOptions )
+ void SetScreenOptions( ULONG nOptions )
{ CopyData(); mpData->mnScreenOptions = nOptions; }
- sal_uLong GetScreenOptions() const
+ ULONG GetScreenOptions() const
{ return mpData->mnScreenOptions; }
- void SetPrintOptions( sal_uLong nOptions )
+ void SetPrintOptions( ULONG nOptions )
{ CopyData(); mpData->mnPrintOptions = nOptions; }
- sal_uLong GetPrintOptions() const
+ ULONG GetPrintOptions() const
{ return mpData->mnPrintOptions; }
void SetScreenRasterFontDeviation( long nDeviation )
@@ -100,8 +100,8 @@ public:
const MachineSettings& operator =( const MachineSettings& rSet );
- sal_Bool operator ==( const MachineSettings& rSet ) const;
- sal_Bool operator !=( const MachineSettings& rSet ) const
+ BOOL operator ==( const MachineSettings& rSet ) const;
+ BOOL operator !=( const MachineSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -117,49 +117,49 @@ class ImplMouseData
ImplMouseData( const ImplMouseData& rData );
private:
- sal_uLong mnRefCount;
- sal_uLong mnOptions;
- sal_uLong mnDoubleClkTime;
+ ULONG mnRefCount;
+ ULONG mnOptions;
+ ULONG mnDoubleClkTime;
long mnDoubleClkWidth;
long mnDoubleClkHeight;
long mnStartDragWidth;
long mnStartDragHeight;
- 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;
+ 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;
};
// -----------------
// - MouseSettings -
// -----------------
-#define MOUSE_OPTION_AUTOFOCUS ((sal_uLong)0x00000001)
-#define MOUSE_OPTION_AUTOCENTERPOS ((sal_uLong)0x00000002)
-#define MOUSE_OPTION_AUTODEFBTNPOS ((sal_uLong)0x00000004)
+#define MOUSE_OPTION_AUTOFOCUS ((ULONG)0x00000001)
+#define MOUSE_OPTION_AUTOCENTERPOS ((ULONG)0x00000002)
+#define MOUSE_OPTION_AUTODEFBTNPOS ((ULONG)0x00000004)
-#define MOUSE_FOLLOW_MENU ((sal_uLong)0x00000001)
-#define MOUSE_FOLLOW_DDLIST ((sal_uLong)0x00000002)
+#define MOUSE_FOLLOW_MENU ((ULONG)0x00000001)
+#define MOUSE_FOLLOW_DDLIST ((ULONG)0x00000002)
-#define MOUSE_MIDDLE_NOTHING ((sal_uInt16)0)
-#define MOUSE_MIDDLE_AUTOSCROLL ((sal_uInt16)1)
-#define MOUSE_MIDDLE_PASTESELECTION ((sal_uInt16)2)
+#define MOUSE_MIDDLE_NOTHING ((USHORT)0)
+#define MOUSE_MIDDLE_AUTOSCROLL ((USHORT)1)
+#define MOUSE_MIDDLE_PASTESELECTION ((USHORT)2)
-#define MOUSE_WHEEL_DISABLE ((sal_uInt16)0)
-#define MOUSE_WHEEL_FOCUS_ONLY ((sal_uInt16)1)
-#define MOUSE_WHEEL_ALWAYS ((sal_uInt16)2)
+#define MOUSE_WHEEL_DISABLE ((USHORT)0)
+#define MOUSE_WHEEL_FOCUS_ONLY ((USHORT)1)
+#define MOUSE_WHEEL_ALWAYS ((USHORT)2)
class VCL_DLLPUBLIC MouseSettings
{
@@ -173,14 +173,14 @@ public:
MouseSettings( const MouseSettings& rSet );
~MouseSettings();
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
- void SetDoubleClickTime( sal_uLong nDoubleClkTime )
+ void SetDoubleClickTime( ULONG nDoubleClkTime )
{ CopyData(); mpData->mnDoubleClkTime = nDoubleClkTime; }
- sal_uLong GetDoubleClickTime() const
+ 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( sal_uInt16 nCode )
+ void SetStartDragCode( USHORT nCode )
{ CopyData(); mpData->mnStartDragCode = nCode; }
- sal_uInt16 GetStartDragCode() const
+ USHORT GetStartDragCode() const
{ return mpData->mnStartDragCode; }
- void SetDragMoveCode( sal_uInt16 nCode )
+ void SetDragMoveCode( USHORT nCode )
{ CopyData(); mpData->mnDragMoveCode = nCode; }
- sal_uInt16 GetDragMoveCode() const
+ USHORT GetDragMoveCode() const
{ return mpData->mnDragMoveCode; }
- void SetDragCopyCode( sal_uInt16 nCode )
+ void SetDragCopyCode( USHORT nCode )
{ CopyData(); mpData->mnDragCopyCode = nCode; }
- sal_uInt16 GetDragCopyCode() const
+ USHORT GetDragCopyCode() const
{ return mpData->mnDragCopyCode; }
- void SetDragLinkCode( sal_uInt16 nCode )
+ void SetDragLinkCode( USHORT nCode )
{ CopyData(); mpData->mnDragLinkCode = nCode; }
- sal_uInt16 GetDragLinkCode() const
+ USHORT GetDragLinkCode() const
{ return mpData->mnDragLinkCode; }
- void SetContextMenuCode( sal_uInt16 nCode )
+ void SetContextMenuCode( USHORT nCode )
{ CopyData(); mpData->mnContextMenuCode = nCode; }
- sal_uInt16 GetContextMenuCode() const
+ USHORT GetContextMenuCode() const
{ return mpData->mnContextMenuCode; }
- void SetContextMenuClicks( sal_uInt16 nClicks )
+ void SetContextMenuClicks( USHORT nClicks )
{ CopyData(); mpData->mnContextMenuClicks = nClicks; }
- sal_uInt16 GetContextMenuClicks() const
+ USHORT GetContextMenuClicks() const
{ return mpData->mnContextMenuClicks; }
- void SetContextMenuDown( sal_Bool bDown )
+ void SetContextMenuDown( BOOL bDown )
{ CopyData(); mpData->mbContextMenuDown = bDown; }
- sal_Bool GetContextMenuDown() const
+ BOOL GetContextMenuDown() const
{ return mpData->mbContextMenuDown; }
- void SetScrollRepeat( sal_uLong nRepeat )
+ void SetScrollRepeat( ULONG nRepeat )
{ CopyData(); mpData->mnScrollRepeat = nRepeat; }
- sal_uLong GetScrollRepeat() const
+ ULONG GetScrollRepeat() const
{ return mpData->mnScrollRepeat; }
- void SetButtonStartRepeat( sal_uLong nRepeat )
+ void SetButtonStartRepeat( ULONG nRepeat )
{ CopyData(); mpData->mnButtonStartRepeat = nRepeat; }
- sal_uLong GetButtonStartRepeat() const
+ ULONG GetButtonStartRepeat() const
{ return mpData->mnButtonStartRepeat; }
- void SetButtonRepeat( sal_uLong nRepeat )
+ void SetButtonRepeat( ULONG nRepeat )
{ CopyData(); mpData->mnButtonRepeat = nRepeat; }
- sal_uLong GetButtonRepeat() const
+ ULONG GetButtonRepeat() const
{ return mpData->mnButtonRepeat; }
- void SetActionDelay( sal_uLong nDelay )
+ void SetActionDelay( ULONG nDelay )
{ CopyData(); mpData->mnActionDelay = nDelay; }
- sal_uLong GetActionDelay() const
+ ULONG GetActionDelay() const
{ return mpData->mnActionDelay; }
- void SetMenuDelay( sal_uLong nDelay )
+ void SetMenuDelay( ULONG nDelay )
{ CopyData(); mpData->mnMenuDelay = nDelay; }
- sal_uLong GetMenuDelay() const
+ ULONG GetMenuDelay() const
{ return mpData->mnMenuDelay; }
- void SetFollow( sal_uLong nFollow )
+ void SetFollow( ULONG nFollow )
{ CopyData(); mpData->mnFollow = nFollow; }
- sal_uLong GetFollow() const
+ ULONG GetFollow() const
{ return mpData->mnFollow; }
- void SetMiddleButtonAction( sal_uInt16 nAction )
+ void SetMiddleButtonAction( USHORT nAction )
{ CopyData(); mpData->mnMiddleButtonAction = nAction; }
- sal_uInt16 GetMiddleButtonAction() const
+ USHORT GetMiddleButtonAction() const
{ return mpData->mnMiddleButtonAction; }
- void SetWheelBehavior( sal_uInt16 nBehavior )
+ void SetWheelBehavior( USHORT nBehavior )
{ CopyData(); mpData->mnWheelBehavior = nBehavior; }
- sal_uInt16 GetWheelBehavior() const
+ USHORT GetWheelBehavior() const
{ return mpData->mnWheelBehavior; }
const MouseSettings& operator =( const MouseSettings& rSet );
- sal_Bool operator ==( const MouseSettings& rSet ) const;
- sal_Bool operator !=( const MouseSettings& rSet ) const
+ BOOL operator ==( const MouseSettings& rSet ) const;
+ BOOL operator !=( const MouseSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -284,16 +284,16 @@ class ImplKeyboardData
ImplKeyboardData( const ImplKeyboardData& rData );
private:
- sal_uLong mnRefCount;
+ ULONG mnRefCount;
Accelerator maStandardAccel;
- sal_uLong mnOptions;
+ ULONG mnOptions;
};
// --------------------
// - KeyboardSettings -
// --------------------
-#define KEYBOARD_OPTION_QUICKCURSOR ((sal_uLong)0x00000001)
+#define KEYBOARD_OPTION_QUICKCURSOR ((ULONG)0x00000001)
class VCL_DLLPUBLIC KeyboardSettings
{
@@ -312,15 +312,15 @@ public:
const Accelerator& GetStandardAccel() const
{ return mpData->maStandardAccel; }
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
const KeyboardSettings& operator =( const KeyboardSettings& rSet );
- sal_Bool operator ==( const KeyboardSettings& rSet ) const;
- sal_Bool operator !=( const KeyboardSettings& rSet ) const
+ BOOL operator ==( const KeyboardSettings& rSet ) const;
+ BOOL operator !=( const KeyboardSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -337,9 +337,9 @@ class ImplStyleData
void SetStandardStyles();
private:
- sal_uLong mnRefCount;
+ ULONG mnRefCount;
- void* mpStyleData_NotUsedYet;
+ void* mpStyleData_NotUsedYet;
Color maActiveBorderColor;
Color maActiveColor;
@@ -413,27 +413,31 @@ private:
long mnIconHorzSpace;
long mnIconVertSpace;
long mnAntialiasedMin;
- 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;
+ 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;
long mnMinThumbSize;
- sal_uLong mnSymbolsStyle;
- sal_uLong mnPreferredSymbolsStyle;
- sal_uInt16 mnSkipDisabledInMenus;
+ ULONG mnSymbolsStyle;
+ ULONG mnPreferredSymbolsStyle;
+ USHORT mnSkipDisabledInMenus;
Wallpaper maWorkspaceGradient;
const void* mpFontOptions;
};
@@ -445,65 +449,90 @@ private:
// - StyleSettings -
// -----------------
-#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)
+#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)
class VCL_DLLPUBLIC StyleSettings
{
@@ -707,34 +736,34 @@ public:
const Color& GetInactiveTabColor() const
{ return mpData->maInactiveTabColor; }
- void SetHighContrastMode( sal_Bool bHighContrast )
+ void SetHighContrastMode( BOOL bHighContrast )
{ CopyData(); mpData->mnHighContrast = bHighContrast; }
- sal_Bool GetHighContrastMode() const
- { return (sal_Bool) mpData->mnHighContrast; }
- sal_Bool IsHighContrastBlackAndWhite() const;
- void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts )
+ BOOL GetHighContrastMode() const
+ { return (BOOL) mpData->mnHighContrast; }
+ BOOL IsHighContrastBlackAndWhite() const;
+ void SetUseSystemUIFonts( BOOL bUseSystemUIFonts )
{ CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
- sal_Bool GetUseSystemUIFonts() const
- { return (sal_Bool) mpData->mnUseSystemUIFonts; }
- void SetUseFlatBorders( sal_Bool bUseFlatBorders )
+ BOOL GetUseSystemUIFonts() const
+ { return (BOOL) mpData->mnUseSystemUIFonts; }
+ void SetUseFlatBorders( BOOL bUseFlatBorders )
{ CopyData(); mpData->mnUseFlatBorders = bUseFlatBorders; }
- sal_Bool GetUseFlatBorders() const
- { return (sal_Bool) mpData->mnUseFlatBorders; }
- void SetUseFlatMenues( sal_Bool bUseFlatMenues )
+ BOOL GetUseFlatBorders() const
+ { return (BOOL) mpData->mnUseFlatBorders; }
+ void SetUseFlatMenues( BOOL bUseFlatMenues )
{ CopyData(); mpData->mnUseFlatMenues = bUseFlatMenues; }
- sal_Bool GetUseFlatMenues() const
- { return (sal_Bool) mpData->mnUseFlatMenues; }
- void SetUseImagesInMenus( sal_Bool bUseImagesInMenus )
+ BOOL GetUseFlatMenues() const
+ { return (BOOL) mpData->mnUseFlatMenues; }
+ void SetUseImagesInMenus( BOOL bUseImagesInMenus )
{ CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus; }
- sal_Bool GetUseImagesInMenus() const;
- void SetPreferredUseImagesInMenus( sal_Bool bPreferredUseImagesInMenus )
+ BOOL GetUseImagesInMenus() const;
+ void SetPreferredUseImagesInMenus( BOOL bPreferredUseImagesInMenus )
{ CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
- sal_Bool GetPreferredUseImagesInMenus() const
+ BOOL GetPreferredUseImagesInMenus() const
{ return mpData->mbPreferredUseImagesInMenus; }
- void SetSkipDisabledInMenus( sal_Bool bSkipDisabledInMenus )
+ void SetSkipDisabledInMenus( BOOL bSkipDisabledInMenus )
{ CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
- sal_Bool GetSkipDisabledInMenus() const
- { return (sal_Bool) mpData->mnSkipDisabledInMenus; }
+ BOOL GetSkipDisabledInMenus() const
+ { return (BOOL) mpData->mnSkipDisabledInMenus; }
void SetCairoFontOptions( const void *pOptions )
{ CopyData(); mpData->mpFontOptions = pOptions; }
@@ -794,6 +823,23 @@ 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
@@ -847,104 +893,108 @@ public:
void SetCursorBlinkTime( long nBlinkTime )
{ CopyData(); mpData->mnCursorBlinkTime = nBlinkTime; }
long GetCursorBlinkTime() const
- { return (long) mpData->mnCursorBlinkTime; }
+ { return mpData->mnCursorBlinkTime; }
- void SetScreenZoom( sal_uInt16 nPercent )
+ void SetScreenZoom( USHORT nPercent )
{ CopyData(); mpData->mnScreenZoom = nPercent; }
- sal_uInt16 GetScreenZoom() const
+ USHORT GetScreenZoom() const
{ return mpData->mnScreenZoom; }
- void SetScreenFontZoom( sal_uInt16 nPercent )
+ void SetScreenFontZoom( USHORT nPercent )
{ CopyData(); mpData->mnScreenFontZoom = nPercent; }
- sal_uInt16 GetScreenFontZoom() const
+ USHORT GetScreenFontZoom() const
{ return mpData->mnScreenFontZoom; }
- void SetLogoDisplayTime( sal_uLong nDisplayTime )
+ void SetLogoDisplayTime( ULONG nDisplayTime )
{ CopyData(); mpData->mnLogoDisplayTime = nDisplayTime; }
- sal_uLong GetLogoDisplayTime() const
+ ULONG GetLogoDisplayTime() const
{ return mpData->mnLogoDisplayTime; }
- void SetDragFullOptions( sal_uLong nOptions )
+ void SetDragFullOptions( ULONG nOptions )
{ CopyData(); mpData->mnDragFullOptions = nOptions; }
- sal_uLong GetDragFullOptions() const
+ ULONG GetDragFullOptions() const
{ return mpData->mnDragFullOptions; }
- void SetAnimationOptions( sal_uLong nOptions )
+ void SetAnimationOptions( ULONG nOptions )
{ CopyData(); mpData->mnAnimationOptions = nOptions; }
- sal_uLong GetAnimationOptions() const
+ ULONG GetAnimationOptions() const
{ return mpData->mnAnimationOptions; }
- void SetSelectionOptions( sal_uLong nOptions )
+ void SetSelectionOptions( ULONG nOptions )
{ CopyData(); mpData->mnSelectionOptions = nOptions; }
- sal_uLong GetSelectionOptions() const
+ ULONG GetSelectionOptions() const
{ return mpData->mnSelectionOptions; }
- void SetDisplayOptions( sal_uLong nOptions )
+ void SetDisplayOptions( ULONG nOptions )
{ CopyData(); mpData->mnDisplayOptions = nOptions; }
- sal_uLong GetDisplayOptions() const
+ ULONG GetDisplayOptions() const
{ return mpData->mnDisplayOptions; }
void SetAntialiasingMinPixelHeight( long nMinPixel )
{ CopyData(); mpData->mnAntialiasedMin = nMinPixel; }
- sal_uLong GetAntialiasingMinPixelHeight() const
+ ULONG GetAntialiasingMinPixelHeight() const
{ return mpData->mnAntialiasedMin; }
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
- void SetAutoMnemonic( sal_Bool bAutoMnemonic )
- { CopyData(); mpData->mnAutoMnemonic = (sal_uInt16)bAutoMnemonic; }
- sal_Bool GetAutoMnemonic() const
- { return mpData->mnAutoMnemonic ? sal_True : sal_False; }
+ void SetAutoMnemonic( BOOL bAutoMnemonic )
+ { CopyData(); mpData->mnAutoMnemonic = (USHORT)bAutoMnemonic; }
+ BOOL GetAutoMnemonic() const
+ { return mpData->mnAutoMnemonic ? TRUE : FALSE; }
void SetFontColor( const Color& rColor )
{ CopyData(); mpData->maFontColor = rColor; }
const Color& GetFontColor() const
{ return mpData->maFontColor; }
- void SetToolbarIconSize( sal_uLong nSize )
+ void SetToolbarIconSize( ULONG nSize )
{ CopyData(); mpData->mnToolbarIconSize = nSize; }
- sal_uLong GetToolbarIconSize() const
+ ULONG GetToolbarIconSize() const
{ return mpData->mnToolbarIconSize; }
- void SetSymbolsStyle( sal_uLong nStyle )
+ void SetSymbolsStyle( ULONG nStyle )
{ CopyData(); mpData->mnSymbolsStyle = nStyle; }
- sal_uLong GetSymbolsStyle() const
+ ULONG GetSymbolsStyle() const
{ return mpData->mnSymbolsStyle; }
- void SetPreferredSymbolsStyle( sal_uLong nStyle )
+ void SetPreferredSymbolsStyle( ULONG nStyle )
{ CopyData(); mpData->mnPreferredSymbolsStyle = nStyle; }
- void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName );
- sal_uLong GetPreferredSymbolsStyle() const
+ void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName );
+ ULONG GetPreferredSymbolsStyle() const
{ return mpData->mnPreferredSymbolsStyle; }
- // check whether the symbols style is supported (icons are installed)
- bool CheckSymbolStyle( sal_uLong nStyle ) const;
- sal_uLong GetAutoSymbolsStyle() const;
+ // check whether the symbols style is supported (icons are installed)
+ bool CheckSymbolStyle( ULONG nStyle ) const;
+ ULONG GetAutoSymbolsStyle() const;
- sal_uLong GetCurrentSymbolsStyle() const;
+ ULONG GetCurrentSymbolsStyle() const;
- void SetSymbolsStyleName( const ::rtl::OUString &rName )
+ void SetSymbolsStyleName( const ::rtl::OUString &rName )
{ return SetSymbolsStyle( ImplNameToSymbolsStyle( rName ) ); }
- ::rtl::OUString GetSymbolsStyleName() const
+ ::rtl::OUString GetSymbolsStyleName() const
{ return ImplSymbolsStyleToName( GetSymbolsStyle() ); }
- ::rtl::OUString GetCurrentSymbolsStyleName() const
+ ::rtl::OUString GetCurrentSymbolsStyleName() const
{ return ImplSymbolsStyleToName( GetCurrentSymbolsStyle() ); }
-
+
const Wallpaper& GetWorkspaceGradient() const
{ return mpData->maWorkspaceGradient; }
void SetWorkspaceGradient( const Wallpaper& rWall )
{ CopyData(); mpData->maWorkspaceGradient = rWall; }
void SetStandardStyles();
+ void SetStandardWinStyles();
+ void SetStandardOS2Styles();
+ void SetStandardMacStyles();
+ void SetStandardUnixStyles();
const StyleSettings& operator =( const StyleSettings& rSet );
- sal_Bool operator ==( const StyleSettings& rSet ) const;
- sal_Bool operator !=( const StyleSettings& rSet ) const
+ BOOL operator ==( const StyleSettings& rSet ) const;
+ BOOL operator !=( const StyleSettings& rSet ) const
{ return !(*this == rSet); }
protected:
- ::rtl::OUString ImplSymbolsStyleToName( sal_uLong nStyle ) const;
- sal_uLong ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
+ ::rtl::OUString ImplSymbolsStyleToName( ULONG nStyle ) const;
+ ULONG ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
};
// ----------------
@@ -959,10 +1009,10 @@ class ImplMiscData
ImplMiscData( const ImplMiscData& rData );
private:
- sal_uLong mnRefCount;
- sal_uInt16 mnEnableATT;
- sal_Bool mbEnableLocalizedDecimalSep;
- sal_uInt16 mnDisablePrinting;
+ ULONG mnRefCount;
+ USHORT mnEnableATT;
+ BOOL mbEnableLocalizedDecimalSep;
+ USHORT mnDisablePrinting;
};
// ----------------
@@ -981,16 +1031,16 @@ public:
MiscSettings( const MiscSettings& rSet );
~MiscSettings();
- 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;
+ void SetEnableATToolSupport( BOOL bEnable );
+ BOOL GetEnableATToolSupport() const;
+ void SetDisablePrinting( BOOL bEnable );
+ BOOL GetDisablePrinting() const;
+ void SetEnableLocalizedDecimalSep( BOOL bEnable );
+ BOOL GetEnableLocalizedDecimalSep() const;
const MiscSettings& operator =( const MiscSettings& rSet );
- sal_Bool operator ==( const MiscSettings& rSet ) const;
- sal_Bool operator !=( const MiscSettings& rSet ) const
+ BOOL operator ==( const MiscSettings& rSet ) const;
+ BOOL operator !=( const MiscSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1006,8 +1056,8 @@ class ImplNotificationData
ImplNotificationData( const ImplNotificationData& rData );
private:
- sal_uLong mnRefCount;
- sal_uLong mnOptions;
+ ULONG mnRefCount;
+ ULONG mnOptions;
};
// ------------------------
@@ -1026,15 +1076,15 @@ public:
NotificationSettings( const NotificationSettings& rSet );
~NotificationSettings();
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
const NotificationSettings& operator =( const NotificationSettings& rSet );
- sal_Bool operator ==( const NotificationSettings& rSet ) const;
- sal_Bool operator !=( const NotificationSettings& rSet ) const
+ BOOL operator ==( const NotificationSettings& rSet ) const;
+ BOOL operator !=( const NotificationSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1050,19 +1100,19 @@ class ImplHelpData
ImplHelpData( const ImplHelpData& rData );
private:
- sal_uLong mnRefCount;
- sal_uLong mnOptions;
- sal_uLong mnTipDelay;
- sal_uLong mnTipTimeout;
- sal_uLong mnBalloonDelay;
+ ULONG mnRefCount;
+ ULONG mnOptions;
+ ULONG mnTipDelay;
+ ULONG mnTipTimeout;
+ ULONG mnBalloonDelay;
};
// ----------------
// - HelpSettings -
// ----------------
-#define HELP_OPTION_QUICK ((sal_uLong)0x00000001)
-#define HELP_OPTION_ACTIVE ((sal_uLong)0x00000002)
+#define HELP_OPTION_QUICK ((ULONG)0x00000001)
+#define HELP_OPTION_ACTIVE ((ULONG)0x00000002)
class VCL_DLLPUBLIC HelpSettings
{
@@ -1076,27 +1126,27 @@ public:
HelpSettings( const HelpSettings& rSet );
~HelpSettings();
- void SetOptions( sal_uLong nOptions )
+ void SetOptions( ULONG nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- sal_uLong GetOptions() const
+ ULONG GetOptions() const
{ return mpData->mnOptions; }
- void SetTipDelay( sal_uLong nTipDelay )
+ void SetTipDelay( ULONG nTipDelay )
{ CopyData(); mpData->mnTipDelay = nTipDelay; }
- sal_uLong GetTipDelay() const
+ ULONG GetTipDelay() const
{ return mpData->mnTipDelay; }
- void SetTipTimeout( sal_uLong nTipTimeout )
+ void SetTipTimeout( ULONG nTipTimeout )
{ CopyData(); mpData->mnTipTimeout = nTipTimeout; }
- sal_uLong GetTipTimeout() const
+ ULONG GetTipTimeout() const
{ return mpData->mnTipTimeout; }
- void SetBalloonDelay( sal_uLong nBalloonDelay )
+ void SetBalloonDelay( ULONG nBalloonDelay )
{ CopyData(); mpData->mnBalloonDelay = nBalloonDelay; }
- sal_uLong GetBalloonDelay() const
+ ULONG GetBalloonDelay() const
{ return mpData->mnBalloonDelay; }
const HelpSettings& operator =( const HelpSettings& rSet );
- sal_Bool operator ==( const HelpSettings& rSet ) const;
- sal_Bool operator !=( const HelpSettings& rSet ) const
+ BOOL operator ==( const HelpSettings& rSet ) const;
+ BOOL operator !=( const HelpSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1106,14 +1156,14 @@ public:
class LocaleConfigurationListener;
class ImplAllSettingsData
{
- friend class AllSettings;
+ friend class AllSettings;
ImplAllSettingsData();
ImplAllSettingsData( const ImplAllSettingsData& rData );
~ImplAllSettingsData();
private:
- sal_uLong mnRefCount;
+ ULONG mnRefCount;
MachineSettings maMachineSettings;
MouseSettings maMouseSettings;
KeyboardSettings maKeyboardSettings;
@@ -1122,41 +1172,43 @@ private:
NotificationSettings maNotificationSettings;
HelpSettings maHelpSettings;
::com::sun::star::lang::Locale maLocale;
- sal_uLong mnSystemUpdate;
- sal_uLong mnWindowUpdate;
+ ULONG mnSystemUpdate;
+ ULONG mnWindowUpdate;
::com::sun::star::lang::Locale maUILocale;
LanguageType meLanguage;
LanguageType meUILanguage;
LocaleDataWrapper* mpLocaleDataWrapper;
LocaleDataWrapper* mpUILocaleDataWrapper;
+ CollatorWrapper* mpCollatorWrapper;
+ CollatorWrapper* mpUICollatorWrapper;
vcl::I18nHelper* mpI18nHelper;
vcl::I18nHelper* mpUII18nHelper;
- LocaleConfigurationListener* mpLocaleCfgListener;
- SvtSysLocale maSysLocale;
+ LocaleConfigurationListener* mpLocaleCfgListener;
+ SvtSysLocale maSysLocale;
};
// ---------------
// - AllSettings -
// ---------------
-#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_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_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 ((sal_uLong)0x00000800) // this flag indicates that the data changed event was created
+#define SETTINGS_IN_UPDATE_SETTINGS ((ULONG)0x00000800) // this flag indicates that the data changed event was created
// in Windows::UpdateSettings probably because of a global
// settings changed
@@ -1215,7 +1267,7 @@ public:
LanguageType GetLanguage() const;
void SetUILanguage( LanguageType eLang );
LanguageType GetUILanguage() const;
- sal_Bool GetLayoutRTL() const; // returns sal_True if UI language requires right-to-left UI
+ BOOL GetLayoutRTL() const; // returns TRUE if UI language requires right-to-left UI
const LocaleDataWrapper& GetLocaleDataWrapper() const;
const LocaleDataWrapper& GetUILocaleDataWrapper() const;
const vcl::I18nHelper& GetLocaleI18nHelper() const;
@@ -1232,25 +1284,25 @@ public:
const String& rStr2, xub_StrLen nPos2, xub_StrLen nCount2 ) const;
*/
- void SetSystemUpdate( sal_uLong nUpdate )
+ void SetSystemUpdate( ULONG nUpdate )
{ CopyData(); mpData->mnSystemUpdate = nUpdate; }
- sal_uLong GetSystemUpdate() const
+ ULONG GetSystemUpdate() const
{ return mpData->mnSystemUpdate; }
- void SetWindowUpdate( sal_uLong nUpdate )
+ void SetWindowUpdate( ULONG nUpdate )
{ CopyData(); mpData->mnWindowUpdate = nUpdate; }
- sal_uLong GetWindowUpdate() const
+ ULONG GetWindowUpdate() const
{ return mpData->mnWindowUpdate; }
- sal_uLong Update( sal_uLong nFlags, const AllSettings& rSettings );
- sal_uLong GetChangeFlags( const AllSettings& rSettings ) const;
+ ULONG Update( ULONG nFlags, const AllSettings& rSettings );
+ ULONG GetChangeFlags( const AllSettings& rSettings ) const;
const AllSettings& operator =( const AllSettings& rSet );
- sal_Bool operator ==( const AllSettings& rSet ) const;
- sal_Bool operator !=( const AllSettings& rSet ) const
+ BOOL operator ==( const AllSettings& rSet ) const;
+ BOOL operator !=( const AllSettings& rSet ) const
{ return !(*this == rSet); }
- static void LocaleSettingsChanged( sal_uInt32 nHint );
- SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
+ static void LocaleSettingsChanged( sal_uInt32 nHint );
+ SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
};
#endif // _SV_SETTINGS_HXX
diff --git a/vcl/inc/vcl/slider.hxx b/vcl/inc/vcl/slider.hxx
index 15f049555386..fa8f5b40b277 100644
--- a/vcl/inc/vcl/slider.hxx
+++ b/vcl/inc/vcl/slider.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,92 +42,92 @@
class VCL_DLLPUBLIC Slider : public Control
{
private:
- Rectangle maChannel1Rect;
- Rectangle maChannel2Rect;
- Rectangle maThumbRect;
- long mnStartPos;
- long mnMouseOff;
- long mnThumbPixOffset;
- long mnThumbPixRange;
- long mnThumbPixPos;
- long mnChannelPixOffset;
- long mnChannelPixRange;
- long mnChannelPixTop;
- long mnChannelPixBottom;
- long mnMinRange;
- long mnMaxRange;
- long mnThumbPos;
- long mnLineSize;
- long mnPageSize;
- long mnDelta;
- sal_uInt16 mnDragDraw;
- sal_uInt16 mnStateFlags;
- ScrollType meScrollType;
- sal_Bool mbCalcSize;
- sal_Bool mbFullDrag;
- Link maSlideHdl;
- Link maEndSlideHdl;
+ Rectangle maChannel1Rect;
+ Rectangle maChannel2Rect;
+ Rectangle maThumbRect;
+ long mnStartPos;
+ long mnMouseOff;
+ long mnThumbPixOffset;
+ long mnThumbPixRange;
+ long mnThumbPixPos;
+ long mnChannelPixOffset;
+ long mnChannelPixRange;
+ long mnChannelPixTop;
+ long mnChannelPixBottom;
+ long mnMinRange;
+ long mnMaxRange;
+ long mnThumbPos;
+ long mnLineSize;
+ long mnPageSize;
+ long mnDelta;
+ USHORT mnDragDraw;
+ USHORT mnStateFlags;
+ ScrollType meScrollType;
+ BOOL mbCalcSize;
+ BOOL mbFullDrag;
+ Link maSlideHdl;
+ Link maEndSlideHdl;
using Control::ImplInitSettings;
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplInitSettings();
- 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( 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 );
+ 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 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 long ImplDoSlide( long nNewPos );
+ SAL_DLLPRIVATE long ImplDoSlideAction( ScrollType eScrollType );
public:
Slider( Window* pParent, WinBits nStyle = WB_HORZ );
Slider( Window* pParent, const ResId& rResId );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Resize();
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void Slide();
- virtual void EndSlide();
+ virtual void Slide();
+ virtual void EndSlide();
- void EnableDrag( sal_Bool bEnable = sal_True )
+ void EnableDrag( BOOL bEnable = TRUE )
{ mbFullDrag = bEnable; }
- sal_Bool IsDragEnabled() const { return mbFullDrag; }
+ BOOL IsDragEnabled() const { return mbFullDrag; }
- void SetRangeMin( long nNewRange );
- long GetRangeMin() const { return mnMinRange; }
- void SetRangeMax( long nNewRange );
- long GetRangeMax() const { return mnMaxRange; }
- void SetRange( const Range& rRange );
- Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
- void SetThumbPos( long nThumbPos );
- long GetThumbPos() const { return mnThumbPos; }
- void SetLineSize( long nNewSize ) { mnLineSize = nNewSize; }
- long GetLineSize() const { return mnLineSize; }
- void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
- long GetPageSize() const { return mnPageSize; }
+ void SetRangeMin( long nNewRange );
+ long GetRangeMin() const { return mnMinRange; }
+ void SetRangeMax( long nNewRange );
+ long GetRangeMax() const { return mnMaxRange; }
+ void SetRange( const Range& rRange );
+ Range GetRange() const { return Range( GetRangeMin(), GetRangeMax() ); }
+ void SetThumbPos( long nThumbPos );
+ long GetThumbPos() const { return mnThumbPos; }
+ void SetLineSize( long nNewSize ) { mnLineSize = nNewSize; }
+ long GetLineSize() const { return mnLineSize; }
+ void SetPageSize( long nNewSize ) { mnPageSize = nNewSize; }
+ long GetPageSize() const { return mnPageSize; }
- long GetDelta() const { return mnDelta; }
+ long GetDelta() const { return mnDelta; }
- Size CalcWindowSizePixel();
+ Size CalcWindowSizePixel();
- void SetSlideHdl( const Link& rLink ) { maSlideHdl = rLink; }
- const Link& GetSlideHdl() const { return maSlideHdl; }
- void SetEndSlideHdl( const Link& rLink ) { maEndSlideHdl = rLink; }
- const Link& GetEndSlideHdl() const { return maEndSlideHdl; }
+ void SetSlideHdl( const Link& rLink ) { maSlideHdl = rLink; }
+ const Link& GetSlideHdl() const { return maSlideHdl; }
+ void SetEndSlideHdl( const Link& rLink ) { maEndSlideHdl = rLink; }
+ const Link& GetEndSlideHdl() const { return maEndSlideHdl; }
};
#endif // _SV_SLIDER_HXX
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
new file mode 100644
index 000000000000..e1ed09463ef5
--- /dev/null
+++ b/vcl/inc/vcl/smartid.hxx
@@ -0,0 +1,90 @@
+/* -*- 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 170a51173726..1767b2610bbe 100644
--- a/vcl/inc/vcl/sndstyle.hxx
+++ b/vcl/inc/vcl/sndstyle.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
// - Sound-Types -
// ---------------
-typedef sal_uInt16 SoundType;
+typedef USHORT SoundType;
#define SOUND_DEFAULT ((SoundType)0)
#define SOUND_INFO ((SoundType)1)
#define SOUND_WARNING ((SoundType)2)
diff --git a/vcl/inc/vcl/sound.hxx b/vcl/inc/vcl/sound.hxx
index 1a32a27154ce..abb962a2501d 100644
--- a/vcl/inc/vcl/sound.hxx
+++ b/vcl/inc/vcl/sound.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/spin.h b/vcl/inc/vcl/spin.h
index f7b69cbf2a16..eb52925fcf66 100644
--- a/vcl/inc/vcl/spin.h
+++ b/vcl/inc/vcl/spin.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,10 +44,10 @@ class OutputDevice;
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- 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 );
+ BOOL bUpperIn, BOOL bLowerIn,
+ BOOL bUpperEnabled = TRUE,
+ BOOL bLowerEnabled = TRUE,
+ BOOL bHorz = FALSE, BOOL bMirrorHorz = FALSE );
#endif // _SV_SPIN_H
diff --git a/vcl/inc/vcl/spin.hxx b/vcl/inc/vcl/spin.hxx
index 02141bccd448..5a0d59feff54 100644
--- a/vcl/inc/vcl/spin.hxx
+++ b/vcl/inc/vcl/spin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,13 +45,13 @@ private:
Rectangle maUpperRect;
Rectangle maLowerRect;
Rectangle maFocusRect;
- 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;
+ BOOL mbRepeat : 1;
+ BOOL mbUpperIn : 1;
+ BOOL mbLowerIn : 1;
+ BOOL mbInitialUp : 1;
+ BOOL mbInitialDown : 1;
+ BOOL mbHorz : 1;
+ 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, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 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 sal_True if the focus rect actually changed.
- SAL_DLLPRIVATE sal_Bool ImplMoveFocus( sal_Bool _bUpper );
- SAL_DLLPRIVATE void ImplCalcFocusRect( sal_Bool _bUpper );
+ // 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 );
- SAL_DLLPRIVATE inline sal_Bool ImplIsUpperEnabled( ) const
+ SAL_DLLPRIVATE inline BOOL ImplIsUpperEnabled( ) const
{
return mnValue + mnValueStep <= mnMaxRange;
}
- SAL_DLLPRIVATE inline sal_Bool ImplIsLowerEnabled( ) const
+ SAL_DLLPRIVATE inline BOOL ImplIsLowerEnabled( ) const
{
return mnValue >= mnMinRange + mnValueStep;
}
diff --git a/vcl/inc/vcl/spinfld.hxx b/vcl/inc/vcl/spinfld.hxx
index becfe4be426f..f2b95084a382 100644
--- a/vcl/inc/vcl/spinfld.hxx
+++ b/vcl/inc/vcl/spinfld.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,16 +41,16 @@
class VCL_DLLPUBLIC SpinField : public Edit
{
protected:
- Edit* mpEdit;
- AutoTimer maRepeatTimer;
- Rectangle maUpperRect;
- Rectangle maLowerRect;
- Rectangle maDropDownRect; // noch nicht angebunden...
- Link maUpHdlLink;
- Link maDownHdlLink;
- Link maFirstHdlLink;
- Link maLastHdlLink;
- sal_Bool mbRepeat:1,
+ Edit* mpEdit;
+ AutoTimer maRepeatTimer;
+ Rectangle maUpperRect;
+ Rectangle maLowerRect;
+ Rectangle maDropDownRect; // noch nicht angebunden...
+ Link maUpHdlLink;
+ Link maDownHdlLink;
+ Link maFirstHdlLink;
+ Link maLastHdlLink;
+ BOOL mbRepeat:1,
mbSpin:1,
mbInitialUp:1,
mbInitialDown:1,
@@ -60,20 +60,20 @@ protected:
mbInDropDown:1;
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
private:
DECL_DLLPRIVATE_LINK( ImplTimeout, Timer* );
- SAL_DLLPRIVATE void ImplInitSpinFieldData();
- SAL_DLLPRIVATE void ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, Rectangle& rSpinUpArea, Rectangle& rSpinDownArea );
+ SAL_DLLPRIVATE void ImplInitSpinFieldData();
+ SAL_DLLPRIVATE void ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rectangle& rDDArea, Rectangle& rSpinUpArea, Rectangle& rSpinDownArea );
protected:
SpinField( WindowType nTyp );
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void Command( const CommandEvent& rCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Command( const CommandEvent& rCEvt );
- void EndDropDown();
+ void EndDropDown();
virtual void FillLayoutData() const;
Rectangle * ImplFindPartRect( const Point& rPt );
@@ -82,35 +82,35 @@ public:
SpinField( Window* pParent, const ResId& rResId );
~SpinField();
- virtual sal_Bool ShowDropDown( sal_Bool bShow );
-
- virtual void Up();
- virtual void Down();
- virtual void First();
- virtual void Last();
-
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- 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, sal_uLong nFlags );
- virtual void Resize();
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual BOOL ShowDropDown( BOOL bShow );
+
+ virtual void Up();
+ virtual void Down();
+ virtual void First();
+ virtual void Last();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ 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 Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- void SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
- const Link& GetUpHdl() const { return maUpHdlLink; }
- void SetDownHdl( const Link& rLink ) { maDownHdlLink = rLink; }
- const Link& GetDownHdl() const { return maDownHdlLink; }
- void SetFirstHdl( const Link& rLink ) { maFirstHdlLink = rLink; }
- const Link& GetFirstHdl() const { return maFirstHdlLink; }
- void SetLastHdl( const Link& rLink ) { maLastHdlLink = rLink; }
- const Link& GetLastHdl() const { return maLastHdlLink; }
+ void SetUpHdl( const Link& rLink ) { maUpHdlLink = rLink; }
+ const Link& GetUpHdl() const { return maUpHdlLink; }
+ void SetDownHdl( const Link& rLink ) { maDownHdlLink = rLink; }
+ const Link& GetDownHdl() const { return maDownHdlLink; }
+ void SetFirstHdl( const Link& rLink ) { maFirstHdlLink = rLink; }
+ const Link& GetFirstHdl() const { return maFirstHdlLink; }
+ void SetLastHdl( const Link& rLink ) { maLastHdlLink = rLink; }
+ const Link& GetLastHdl() const { return maLastHdlLink; }
- virtual Size CalcMinimumSize() const;
+ virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( sal_uInt16 nChars ) const;
+ virtual Size CalcSize( USHORT nChars ) const;
};
#endif // _SV_SPINFLD_HXX
diff --git a/vcl/inc/vcl/split.hxx b/vcl/inc/vcl/split.hxx
index 66371c6da1a2..d8a9634d2a97 100644
--- a/vcl/inc/vcl/split.hxx
+++ b/vcl/inc/vcl/split.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,21 +48,21 @@ private:
long mnStartSplitPos;
Point maDragPos;
Rectangle maDragRect;
- sal_Bool mbHorzSplit;
- sal_Bool mbDragFull;
- sal_Bool mbKbdSplitting;
+ BOOL mbHorzSplit;
+ BOOL mbDragFull;
+ BOOL mbKbdSplitting;
long mbInKeyEvent;
long mnKeyboardStepSize;
Link maStartSplitHdl;
Link maSplitHdl;
Link maEndSplitHdl;
- SAL_DLLPRIVATE void ImplInitSplitterData();
- SAL_DLLPRIVATE void ImplDrawSplitter();
+ SAL_DLLPRIVATE void ImplInitSplitterData();
+ SAL_DLLPRIVATE void ImplDrawSplitter();
SAL_DLLPRIVATE void ImplSplitMousePos( Point& rPos );
SAL_DLLPRIVATE void ImplStartKbdSplitting();
SAL_DLLPRIVATE void ImplKbdTracking( KeyCode aKeyCode );
- SAL_DLLPRIVATE sal_Bool ImplSplitterActive();
+ SAL_DLLPRIVATE BOOL ImplSplitterActive();
SAL_DLLPRIVATE Splitter* ImplFindSibling();
SAL_DLLPRIVATE void ImplRestoreSplitter();
@@ -72,7 +72,7 @@ private:
protected:
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nWinStyle );
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nWinStyle );
public:
Splitter( Window* pParent, WinBits nStyle = WB_VSCROLL );
@@ -109,7 +109,7 @@ public:
void SetLastSplitPosPixel( long nNewPos );
long GetLastSplitPosPixel() const { return mnLastSplitPos; }
- sal_Bool IsHorizontal() const { return mbHorzSplit; }
+ 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 ce1e74958f48..cdc6d0e9928e 100644
--- a/vcl/inc/vcl/splitwin.hxx
+++ b/vcl/inc/vcl/splitwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,24 +40,24 @@ struct ImplSplitSet;
// - SplitWindowItemBits -
// -----------------------
-typedef sal_uInt16 SplitWindowItemBits;
+typedef USHORT SplitWindowItemBits;
// -------------------------------
// - Bits fuer SplitWindow-Items -
// -------------------------------
-#define SWIB_FIXED ((SplitWindowItemBits)0x0001)
-#define SWIB_RELATIVESIZE ((SplitWindowItemBits)0x0002)
-#define SWIB_PERCENTSIZE ((SplitWindowItemBits)0x0004)
-#define SWIB_COLSET ((SplitWindowItemBits)0x0008)
-#define SWIB_INVISIBLE ((SplitWindowItemBits)0x0010)
+#define SWIB_FIXED ((SplitWindowItemBits)0x0001)
+#define SWIB_RELATIVESIZE ((SplitWindowItemBits)0x0002)
+#define SWIB_PERCENTSIZE ((SplitWindowItemBits)0x0004)
+#define SWIB_COLSET ((SplitWindowItemBits)0x0008)
+#define SWIB_INVISIBLE ((SplitWindowItemBits)0x0010)
// ---------------------
// - SplitWindow-Types -
// ---------------------
-#define SPLITWINDOW_APPEND ((sal_uInt16)0xFFFF)
-#define SPLITWINDOW_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define SPLITWINDOW_APPEND ((USHORT)0xFFFF)
+#define SPLITWINDOW_ITEM_NOTFOUND ((USHORT)0xFFFF)
// ---------------
// - SplitWindow -
@@ -66,27 +66,27 @@ typedef sal_uInt16 SplitWindowItemBits;
class VCL_DLLPUBLIC SplitWindow : public DockingWindow
{
private:
- ImplSplitSet* mpMainSet;
- ImplSplitSet* mpBaseSet;
- ImplSplitSet* mpSplitSet;
- long* mpLastSizes;
- Rectangle maDragRect;
- long mnDX;
- long mnDY;
- long mnLeftBorder;
- long mnTopBorder;
- long mnRightBorder;
- long mnBottomBorder;
- long mnMaxSize;
- long mnMouseOff;
- long mnMStartPos;
- long mnMSplitPos;
- WinBits mnWinStyle;
- WindowAlign meAlign;
- sal_uInt16 mnSplitTest;
- sal_uInt16 mnSplitPos;
- sal_uInt16 mnMouseModifier;
- sal_Bool mbDragFull:1,
+ ImplSplitSet* mpMainSet;
+ ImplSplitSet* mpBaseSet;
+ ImplSplitSet* mpSplitSet;
+ long* mpLastSizes;
+ Rectangle maDragRect;
+ long mnDX;
+ long mnDY;
+ long mnLeftBorder;
+ long mnTopBorder;
+ long mnRightBorder;
+ long mnBottomBorder;
+ long mnMaxSize;
+ long mnMouseOff;
+ long mnMStartPos;
+ long mnMSplitPos;
+ WinBits mnWinStyle;
+ WindowAlign meAlign;
+ USHORT mnSplitTest;
+ USHORT mnSplitPos;
+ USHORT mnMouseModifier;
+ BOOL mbDragFull:1,
mbHorz:1,
mbBottomRight:1,
mbCalc:1,
@@ -106,46 +106,46 @@ private:
mbFadeOutPressed:1,
mbFadeNoButtonMode:1,
mbNoAlign:1;
- Link maStartSplitHdl;
- Link maSplitHdl;
- Link maSplitResizeHdl;
- Link maAutoHideHdl;
- Link maFadeInHdl;
- Link maFadeOutHdl;
+ Link maStartSplitHdl;
+ Link maSplitHdl;
+ Link maSplitResizeHdl;
+ Link maAutoHideHdl;
+ Link maFadeInHdl;
+ Link maFadeOutHdl;
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplCalcLayout();
- SAL_DLLPRIVATE void ImplUpdate();
- 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, 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( 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, sal_Bool bHorz, sal_Bool bLeft );
- SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft );
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplCalcLayout();
+ SAL_DLLPRIVATE void ImplUpdate();
+ 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 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 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 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, sal_Bool bHide,
- sal_Bool bRows, sal_Bool bDown = sal_True );
+ static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
+ BOOL bRows, BOOL bDown = 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 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 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 void ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos );
// Copy assignment is forbidden and not implemented.
@@ -156,128 +156,116 @@ public:
SplitWindow( Window* pParent, const ResId& rResId );
~SplitWindow();
- virtual void StartSplit();
- virtual void Split();
- virtual void SplitResize();
- virtual void AutoHide();
- virtual void FadeIn();
- virtual void FadeOut();
+ virtual void StartSplit();
+ virtual void Split();
+ virtual void SplitResize();
+ virtual void AutoHide();
+ virtual void FadeIn();
+ virtual void FadeOut();
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Move();
- virtual void Resize();
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Move();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- void InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
- sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
+ void InsertItem( USHORT nId, Window* pWindow, long nSize,
+ USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
SplitWindowItemBits nBits = 0 );
- void InsertItem( sal_uInt16 nId, long nSize,
- sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
+ void InsertItem( USHORT nId, long nSize,
+ USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
SplitWindowItemBits nBits = 0 );
- 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 MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId = 0 );
+ void RemoveItem( USHORT nId, BOOL bHide = TRUE );
+ void Clear();
- void SetBaseSet( sal_uInt16 nSetId = 0 );
- sal_uInt16 GetBaseSet() const;
+ void SetBaseSet( USHORT nSetId = 0 );
+ USHORT GetBaseSet() 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 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 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 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 SetNoAlign( sal_Bool bNoAlign );
- sal_Bool IsNoAlign() const { return mbNoAlign; }
- void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
- WindowAlign GetAlign() const { return meAlign; }
- sal_Bool IsHorizontal() const { return mbHorz; }
+ void SetNoAlign( BOOL bNoAlign );
+ BOOL IsNoAlign() const { return mbNoAlign; }
+ void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
+ WindowAlign GetAlign() const { return meAlign; }
+ BOOL IsHorizontal() const { return mbHorz; }
- sal_Bool IsSplitting() const { return IsTracking(); }
+ BOOL IsSplitting() const { return IsTracking(); }
- void SetMaxSizePixel( long nNewMaxSize ) { mnMaxSize = nNewMaxSize; }
- long GetMaxSizePixel() const { return mnMaxSize; }
+ void SetMaxSizePixel( long nNewMaxSize ) { mnMaxSize = nNewMaxSize; }
+ long GetMaxSizePixel() const { return mnMaxSize; }
- static Size CalcWindowSizePixel( const Size& rSize,
+ static Size CalcWindowSizePixel( const Size& rSize,
WindowAlign eAlign,
WinBits nWinStyle,
- sal_Bool bExtra = sal_False );
- Size CalcWindowSizePixel( const Size& rSize )
+ BOOL bExtra = FALSE );
+ Size CalcWindowSizePixel( const Size& rSize )
{ return CalcWindowSizePixel( rSize, meAlign, mnWinStyle, (mbAutoHide || mbFadeOut) ); }
- Size CalcLayoutSizePixel( const Size& aNewSize );
+ Size CalcLayoutSizePixel( const Size& aNewSize );
- 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;
- sal_Bool IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
+ 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; }
+ long GetFadeInSize() const;
+ BOOL IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
- void SetAutoHideState( sal_Bool bAutoHide );
- sal_Bool GetAutoHideState() const { return mbAutoHideIn; }
+ void SetAutoHideState( BOOL bAutoHide );
+ BOOL GetAutoHideState() const { return mbAutoHideIn; }
- Rectangle GetAutoHideRect() const;
- Rectangle GetFadeInRect() const;
- Rectangle GetFadeOutRect() const;
+ Rectangle GetAutoHideRect() const;
+ Rectangle GetFadeInRect() const;
+ Rectangle GetFadeOutRect() const;
- void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; }
- const Link& GetStartSplitHdl() const { return maStartSplitHdl; }
- void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
- const Link& GetSplitHdl() const { return maSplitHdl; }
- void SetSplitResizeHdl( const Link& rLink ) { maSplitResizeHdl = rLink; }
- const Link& GetSplitResizeHdl() const { return maSplitResizeHdl; }
- void SetAutoHideHdl( const Link& rLink ) { maAutoHideHdl = rLink; }
- const Link& GetAutoHideHdl() const { return maAutoHideHdl; }
- void SetFadeInHdl( const Link& rLink ) { maFadeInHdl = rLink; }
- const Link& GetFadeInHdl() const { return maFadeInHdl; }
- void SetFadeOutHdl( const Link& rLink ) { maFadeOutHdl = rLink; }
- const Link& GetFadeOutHdl() const { return maFadeOutHdl; }
+ void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; }
+ const Link& GetStartSplitHdl() const { return maStartSplitHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+ void SetSplitResizeHdl( const Link& rLink ) { maSplitResizeHdl = rLink; }
+ const Link& GetSplitResizeHdl() const { return maSplitResizeHdl; }
+ void SetAutoHideHdl( const Link& rLink ) { maAutoHideHdl = rLink; }
+ const Link& GetAutoHideHdl() const { return maAutoHideHdl; }
+ void SetFadeInHdl( const Link& rLink ) { maFadeInHdl = rLink; }
+ const Link& GetFadeInHdl() const { return maFadeInHdl; }
+ void SetFadeOutHdl( const Link& rLink ) { maFadeOutHdl = rLink; }
+ const Link& GetFadeOutHdl() const { return maFadeOutHdl; }
};
-#endif // _SV_SPLITWIN_HXX
+#endif // _SV_SPLITWIN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index d039ddf8f203..6574b6ac3c1e 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,10 +32,8 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <vcl/window.hxx>
-#include <vector>
-struct ImplStatusItem;
-typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
+class ImplStatusItemList;
// --------------------
// - Progress-Ausgabe -
@@ -43,7 +41,7 @@ typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
+ USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
const Rectangle& rFramePosSize
);
@@ -51,28 +49,28 @@ void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
// - StatusBarItemBits -
// ---------------------
-typedef sal_uInt16 StatusBarItemBits;
+typedef USHORT StatusBarItemBits;
// ----------------------------
// - Bits fuer StatusBarItems -
// ----------------------------
-#define SIB_LEFT ((StatusBarItemBits)0x0001)
-#define SIB_CENTER ((StatusBarItemBits)0x0002)
-#define SIB_RIGHT ((StatusBarItemBits)0x0004)
-#define SIB_IN ((StatusBarItemBits)0x0008)
-#define SIB_OUT ((StatusBarItemBits)0x0010)
-#define SIB_FLAT ((StatusBarItemBits)0x0020)
-#define SIB_AUTOSIZE ((StatusBarItemBits)0x0040)
-#define SIB_USERDRAW ((StatusBarItemBits)0x0080)
+#define SIB_LEFT ((StatusBarItemBits)0x0001)
+#define SIB_CENTER ((StatusBarItemBits)0x0002)
+#define SIB_RIGHT ((StatusBarItemBits)0x0004)
+#define SIB_IN ((StatusBarItemBits)0x0008)
+#define SIB_OUT ((StatusBarItemBits)0x0010)
+#define SIB_FLAT ((StatusBarItemBits)0x0020)
+#define SIB_AUTOSIZE ((StatusBarItemBits)0x0040)
+#define SIB_USERDRAW ((StatusBarItemBits)0x0080)
// -------------------
// - StatusBar-Types -
// -------------------
-#define STATUSBAR_APPEND ((sal_uInt16)0xFFFF)
-#define STATUSBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
-#define STATUSBAR_OFFSET ((long)5)
+#define STATUSBAR_APPEND ((USHORT)0xFFFF)
+#define STATUSBAR_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define STATUSBAR_OFFSET ((long)5)
// -------------
// - StatusBar -
@@ -84,40 +82,40 @@ class VCL_DLLPUBLIC StatusBar : public Window
private:
ImplStatusItemList* mpItemList;
ImplData* mpImplData;
- XubString maPrgsTxt;
- Point maPrgsTxtPos;
- Rectangle maPrgsFrameRect;
- long mnPrgsSize;
- long mnItemsWidth;
- long mnDX;
- long mnDY;
- long mnCalcHeight;
- long mnTextY;
- long mnItemY;
- 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;
+ XubString maPrgsTxt;
+ Point maPrgsTxtPos;
+ Rectangle maPrgsFrameRect;
+ long mnPrgsSize;
+ long mnItemsWidth;
+ long mnDX;
+ long mnDY;
+ long mnCalcHeight;
+ long mnTextY;
+ long mnItemY;
+ USHORT mnCurItemId;
+ USHORT mnPercent;
+ USHORT mnPercentCount;
+ BOOL mbVisibleItems;
+ BOOL mbFormat;
+ BOOL mbProgressMode;
+ BOOL mbInUserDraw;
+ BOOL mbBottomBorder;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- SAL_DLLPRIVATE void ImplFormat();
- SAL_DLLPRIVATE sal_Bool ImplIsItemUpdate();
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplFormat();
+ SAL_DLLPRIVATE BOOL ImplIsItemUpdate();
using OutputDevice::ImplDrawText;
- 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( sal_uInt16 nPos ) const;
- SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisiblePos() const;
+ 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 ImplCalcProgressRect();
+ SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( USHORT nPos ) const;
+ SAL_DLLPRIVATE USHORT ImplGetFirstVisiblePos() const;
SAL_DLLPRIVATE void ImplCalcBorder();
public:
@@ -126,104 +124,104 @@ public:
StatusBar( Window* pParent, const ResId& rResId );
~StatusBar();
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void Paint( const Rectangle& rRect );
- virtual void Move();
- virtual void Resize();
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void StateChanged( StateChangedType nType );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Move();
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void Click();
- virtual void DoubleClick();
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
- void InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
+ void InsertItem( USHORT nItemId, ULONG nWidth,
StatusBarItemBits nBits = SIB_CENTER | SIB_IN,
long nOffset = STATUSBAR_OFFSET,
- sal_uInt16 nPos = STATUSBAR_APPEND );
- void RemoveItem( sal_uInt16 nItemId );
+ USHORT nPos = STATUSBAR_APPEND );
+ void RemoveItem( USHORT nItemId );
- void ShowItem( sal_uInt16 nItemId );
- void HideItem( sal_uInt16 nItemId );
- sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ void ShowItem( USHORT nItemId );
+ void HideItem( USHORT nItemId );
+ BOOL IsItemVisible( USHORT nItemId ) const;
- void ShowItems();
- void HideItems();
- sal_Bool AreItemsVisible() const { return mbVisibleItems; }
+ void ShowItems();
+ void HideItems();
+ BOOL AreItemsVisible() const { return mbVisibleItems; }
- void CopyItems( const StatusBar& rStatusBar );
- void Clear();
+ void CopyItems( const StatusBar& rStatusBar );
+ void Clear();
- 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; }
+ 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_uLong GetItemWidth( sal_uInt16 nItemId ) const;
- StatusBarItemBits GetItemBits( sal_uInt16 nItemId ) const;
- long GetItemOffset( sal_uInt16 nItemId ) const;
+ ULONG GetItemWidth( USHORT nItemId ) const;
+ StatusBarItemBits GetItemBits( USHORT nItemId ) const;
+ long GetItemOffset( USHORT nItemId ) const;
- void SetItemText( sal_uInt16 nItemId, const XubString& rText );
- const XubString& GetItemText( sal_uInt16 nItemId ) const;
+ void SetItemText( USHORT nItemId, const XubString& rText );
+ const XubString& GetItemText( USHORT nItemId ) const;
- void SetItemData( sal_uInt16 nItemId, void* pNewData );
- void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemData( USHORT nItemId, void* pNewData );
+ void* GetItemData( USHORT nItemId ) const;
- void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( sal_uInt16 nItemId );
+ void SetItemCommand( USHORT nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( USHORT nItemId );
- void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
- const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+ void SetHelpText( USHORT nItemId, const XubString& rText );
+ const XubString& GetHelpText( USHORT nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
+ void SetQuickHelpText( USHORT nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
+ const XubString& GetQuickHelpText( USHORT nItemId ) const;
- void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
- rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
+ void SetHelpId( USHORT nItemId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nItemId ) const;
- void SetBottomBorder( sal_Bool bBottomBorder = sal_True );
- sal_Bool IsBottomBorder() const { return mbBottomBorder; }
+ void SetBottomBorder( BOOL bBottomBorder = TRUE );
+ BOOL IsBottomBorder() const { return mbBottomBorder; }
- void SetTopBorder( sal_Bool bTopBorder = sal_True );
- sal_Bool IsTopBorder() const;
+ void SetTopBorder( BOOL bTopBorder = TRUE );
+ BOOL IsTopBorder() const;
- void StartProgressMode( const XubString& rText );
- void SetProgressValue( sal_uInt16 nPercent );
- void EndProgressMode();
- sal_Bool IsProgressMode() const { return mbProgressMode; }
- void ResetProgressMode();
+ void StartProgressMode( const XubString& rText );
+ void SetProgressValue( USHORT nPercent );
+ void EndProgressMode();
+ BOOL IsProgressMode() const { return mbProgressMode; }
+ void ResetProgressMode();
- void SetText( const XubString& rText );
+ void SetText( const XubString& rText );
- void SetHelpText( const XubString& rText )
+ void SetHelpText( const XubString& rText )
{ Window::SetHelpText( rText ); }
- const XubString& GetHelpText() const
+ const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( const rtl::OString& rId )
- { Window::SetHelpId( rId ); }
- const rtl::OString& GetHelpId() const
+ void SetHelpId( ULONG nId )
+ { Window::SetHelpId( nId ); }
+ ULONG GetHelpId() const
{ return Window::GetHelpId(); }
- Size CalcWindowSizePixel() const;
+ Size CalcWindowSizePixel() const;
- void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
- const Link& GetClickHdl() const { return maClickHdl; }
- void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
- const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
using Window::SetAccessibleName;
- void SetAccessibleName( sal_uInt16 nItemId, const XubString& rName );
+ void SetAccessibleName( USHORT nItemId, const XubString& rName );
using Window::GetAccessibleName;
- const XubString& GetAccessibleName( sal_uInt16 nItemId ) const;
+ const XubString& GetAccessibleName( USHORT nItemId ) const;
};
-#endif // _SV_STATUS_HXX
+#endif // _SV_STATUS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/stdtext.hxx b/vcl/inc/vcl/stdtext.hxx
index 693a2692b010..3d10073d455c 100644
--- a/vcl/inc/vcl/stdtext.hxx
+++ b/vcl/inc/vcl/stdtext.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,18 +39,18 @@ class Window;
// - Standard-Texte -
// ------------------
-#define STANDARD_TEXT_FIRST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((sal_uInt16)0)
-#define STANDARD_TEXT_LAST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
+#define STANDARD_TEXT_FIRST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
+#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((USHORT)0)
+#define STANDARD_TEXT_LAST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-XubString VCL_DLLPUBLIC GetStandardText( sal_uInt16 nStdText );
+XubString VCL_DLLPUBLIC GetStandardText( USHORT nStdText );
// -------------------------------------
// - Hilfsmethoden fuer Standard-Texte -
// -------------------------------------
-void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, sal_Bool bError );
+void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, BOOL bError );
-#endif // _VCL_STDTEXT_HXX
+#endif // _VCL_STDTEXT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index 450139b0ba14..a41cd65c9a34 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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&, 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 sal_True (nonzero), then
+String VCL_DLLPUBLIC WhitespaceToSpace( const String&, BOOL bProtect = TRUE );
+ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE );
+// returns a string with multiple adjacent occurences of whitespace
+// converted to a single space. if bProtect is TRUE (nonzero), then
// doublequote, singlequote and singleleftquote protect their respective
// contents
diff --git a/vcl/inc/vcl/subedit.hxx b/vcl/inc/vcl/subedit.hxx
index 17b22e2b5587..310af9abbee8 100644
--- a/vcl/inc/vcl/subedit.hxx
+++ b/vcl/inc/vcl/subedit.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/sv.h b/vcl/inc/vcl/sv.h
index 543e08caec8f..5d6527a16602 100644
--- a/vcl/inc/vcl/sv.h
+++ b/vcl/inc/vcl/sv.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 85e902161a48..860f41db193b 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 ((sal_uInt16)0x0001)
-#define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002)
+#define SYSTEMWINDOW_MODE_NOAUTOMODE ((USHORT)0x0001)
+#define SYSTEMWINDOW_MODE_DIALOG ((USHORT)0x0002)
// -------------
// - EventHook -
@@ -119,7 +119,7 @@ public:
const UniString& GetDomain() const { return aDomainName; }
int GetPID() const { return nPID; }
- sal_Bool IsConnectToSame( const ApplicationAddress& rAdr ) const;
+ BOOL IsConnectToSame( const ApplicationAddress& rAdr ) const;
};
inline ApplicationAddress::ApplicationAddress()
@@ -149,20 +149,20 @@ inline ApplicationAddress::ApplicationAddress( const UniString& rHost, int nPIDP
nPID = nPIDPar;
}
-inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
+inline BOOL ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
{
if ( nPID && ((nPID == rAdr.nPID) && (aHostName.Equals( rAdr.aHostName))) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-#define APPEVENT_PARAM_DELIMITER '\n'
+#define APPEVENT_PARAM_DELIMITER '\n'
-#define APPEVENT_OPEN_STRING "Open"
-#define APPEVENT_PRINT_STRING "Print"
-#define APPEVENT_DISKINSERT_STRING "DiskInsert"
-#define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments"
+#define APPEVENT_OPEN_STRING "Open"
+#define APPEVENT_PRINT_STRING "Print"
+#define APPEVENT_DISKINSERT_STRING "DiskInsert"
+#define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments"
class VCL_DLLPUBLIC ApplicationEvent
{
@@ -184,12 +184,12 @@ public:
const UniString& GetData() const { return aData; }
const ApplicationAddress& GetAppAddress() const { return aAppAddr; }
- sal_Bool IsOpenEvent() const;
- sal_Bool IsPrintEvent() const;
- sal_Bool IsDiskInsertEvent() const;
+ BOOL IsOpenEvent() const;
+ BOOL IsPrintEvent() const;
+ BOOL IsDiskInsertEvent() const;
- sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
- UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
+ USHORT GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
+ UniString GetParam( USHORT 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 sal_Bool ApplicationEvent::IsOpenEvent() const
+inline BOOL ApplicationEvent::IsOpenEvent() const
{
if ( aEvent.Equals( APPEVENT_OPEN_STRING ))
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool ApplicationEvent::IsPrintEvent() const
+inline BOOL ApplicationEvent::IsPrintEvent() const
{
if ( aEvent.Equals( APPEVENT_PRINT_STRING ))
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const
+inline BOOL ApplicationEvent::IsDiskInsertEvent() const
{
if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING ))
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
class VCL_DLLPUBLIC PropertyHandler
@@ -243,11 +243,11 @@ public:
Application();
virtual ~Application();
- virtual int Main() = 0;
+ virtual void Main() = 0;
- virtual sal_Bool QueryExit();
+ virtual BOOL QueryExit();
- virtual void UserEvent( sal_uLong nEvent, void* pEventData );
+ virtual void UserEvent( ULONG nEvent, void* pEventData );
virtual void ActivateExtHelp();
virtual void DeactivateExtHelp();
@@ -255,6 +255,9 @@ public:
virtual void ShowStatusText( const XubString& rText );
virtual void HideStatusText();
+ virtual void ShowHelpStatusText( const XubString& rText );
+ virtual void HideHelpStatusText();
+
virtual void FocusChanged();
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -264,11 +267,11 @@ public:
static void InitAppRes( const ResId& rResId );
- static sal_uInt16 GetCommandLineParamCount();
- static XubString GetCommandLineParam( sal_uInt16 nParam );
+ static USHORT GetCommandLineParamCount();
+ static XubString GetCommandLineParam( USHORT nParam );
static const XubString& GetAppFileName();
- virtual sal_uInt16 Exception( sal_uInt16 nError );
+ virtual USHORT Exception( USHORT nError );
static void Abort( const XubString& rErrorText );
static void Execute();
@@ -278,23 +281,23 @@ public:
static void EndYield();
static osl::SolarMutex& GetSolarMutex();
static oslThreadIdentifier GetMainThreadIdentifier();
- static sal_uLong ReleaseSolarMutex();
- static void AcquireSolarMutex( sal_uLong nCount );
+ static ULONG ReleaseSolarMutex();
+ static void AcquireSolarMutex( ULONG nCount );
static void EnableNoYieldMode( bool i_bNoYield );
static void AddPostYieldListener( const Link& i_rListener );
static void RemovePostYieldListener( const Link& i_rListener );
- static sal_Bool IsInMain();
- static sal_Bool IsInExecute();
- static sal_Bool IsShutDown();
- static sal_Bool IsInModalMode();
- static sal_uInt16 GetModalModeCount();
+ static BOOL IsInMain();
+ static BOOL IsInExecute();
+ static BOOL IsShutDown();
+ static BOOL IsInModalMode();
+ static USHORT GetModalModeCount();
- 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 );
+ static USHORT GetDispatchLevel();
+ static BOOL AnyInput( USHORT nType = INPUT_ANY );
+ static ULONG GetLastInputInterval();
+ static BOOL IsUICaptured();
+ static BOOL IsUserActive( USHORT nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame );
@@ -311,7 +314,7 @@ public:
<TRUE/> if the system font is suitable for our UI
<FALSE/> if the test string could not be displayed with the system font
*/
- static bool ValidateSystemFont();
+ static bool ValidateSystemFont();
static void SetSettings( const AllSettings& rSettings );
static const AllSettings& GetSettings();
@@ -321,22 +324,22 @@ public:
static void RemoveEventListener( const Link& rEventListener );
static void AddKeyListener( const Link& rKeyListener );
static void RemoveKeyListener( const Link& rKeyListener );
- static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
+ static void ImplCallEventListeners( ULONG nEvent, Window* pWin, void* pData );
static void ImplCallEventListeners( VclSimpleEvent* pEvent );
- static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static BOOL HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
- 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 sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId );
+ static ULONG PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static ULONG PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent );
+ static void RemoveMouseAndKeyEvents( Window *pWin );
+ static BOOL IsProcessedMouseOrKeyEvent( ULONG nEventId );
- 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 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_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
+ static BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
static void RemoveIdleHdl( const Link& rLink );
virtual void AppEvent( const ApplicationEvent& rAppEvent );
@@ -375,7 +378,7 @@ public:
static bool IsMultiDisplay();
static Rectangle GetScreenPosSizePixel( unsigned int nScreen );
static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen );
- static rtl::OUString GetScreenName( unsigned int nScreen );
+ static rtl::OUString GetScreenName( unsigned int nScreen );
static unsigned int GetDefaultDisplayNumber();
// if IsMultiDisplay() == false the return value will be
// nearest screen of the target rectangle
@@ -385,15 +388,15 @@ public:
static const LocaleDataWrapper& GetAppLocaleDataWrapper();
- static sal_Bool InsertAccel( Accelerator* pAccel );
+ static BOOL InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel );
static void FlushAccel();
- static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
+ static BOOL CallAccel( const KeyCode& rKeyCode, USHORT nRepeat = 0 );
- 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 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 long CallEventHooks( NotifyEvent& rEvt );
static long CallPreNotify( NotifyEvent& rEvt );
static long CallEvent( NotifyEvent& rEvt );
@@ -401,24 +404,24 @@ public:
static void SetHelp( Help* pHelp = NULL );
static Help* GetHelp();
- static void EnableAutoHelpId( sal_Bool bEnabled = sal_True );
- static sal_Bool IsAutoHelpIdEnabled();
+ static void EnableAutoHelpId( BOOL bEnabled = TRUE );
+ static BOOL IsAutoHelpIdEnabled();
- static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True );
- static sal_Bool IsAutoMnemonicEnabled();
+ static void EnableAutoMnemonic( BOOL bEnabled = TRUE );
+ static BOOL IsAutoMnemonicEnabled();
- static sal_uLong GetReservedKeyCodeCount();
- static const KeyCode* GetReservedKeyCode( sal_uLong i );
- static String GetReservedKeyCodeDescription( sal_uLong i );
+ static ULONG GetReservedKeyCodeCount();
+ static const KeyCode* GetReservedKeyCode( ULONG i );
+ static String GetReservedKeyCodeDescription( ULONG i );
static void SetDefDialogParent( Window* pWindow );
static Window* GetDefDialogParent();
- static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True );
- static sal_Bool IsDialogCancelEnabled();
+ static void EnableDialogCancel( BOOL bDialogCancel = TRUE );
+ static BOOL IsDialogCancelEnabled();
- static void SetSystemWindowMode( sal_uInt16 nMode );
- static sal_uInt16 GetSystemWindowMode();
+ static void SetSystemWindowMode( USHORT nMode );
+ static USHORT GetSystemWindowMode();
static void SetDialogScaleX( short nScale );
static short GetDialogScaleX();
@@ -432,16 +435,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( sal_Bool bCreateIfNotExists = sal_True );
+ static UnoWrapperBase* GetUnoWrapper( BOOL bCreateIfNotExists = TRUE );
static void SetUnoWrapper( UnoWrapperBase* pWrapper );
static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl();
- static sal_Bool IsAccessibilityEnabled();
+ static BOOL IsAccessibilityEnabled();
- static void EnableHeadlessMode( sal_Bool bEnable = sal_True );
- static sal_Bool IsHeadlessModeEnabled();
+ static void EnableHeadlessMode( BOOL bEnable = TRUE );
+ static BOOL IsHeadlessModeEnabled();
static void ShowNativeErrorBox(const String& sTitle ,
const String& sMessage);
@@ -557,52 +560,6 @@ 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
@@ -610,7 +567,7 @@ protected:
*/
class SolarMutexReleaser
{
- sal_uLong mnReleased;
+ ULONG mnReleased;
const bool mbRescheduleDuringAcquire;
public:
enum
@@ -642,10 +599,10 @@ public:
VCL_DLLPUBLIC Application* GetpApp();
-VCL_DLLPUBLIC sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
+VCL_DLLPUBLIC BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
VCL_DLLPUBLIC void DeInitVCL();
-VCL_DLLPUBLIC sal_Bool InitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
+VCL_DLLPUBLIC BOOL InitAccessBridge( BOOL bAllowCancel, 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 70d31381287f..2c7ef26c7af5 100644
--- a/vcl/inc/vcl/svcompat.hxx
+++ b/vcl/inc/vcl/svcompat.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,10 +36,10 @@
// -----------
#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
- ((sal_uLong)((((sal_uLong)(char)(char1)))| \
- (((sal_uLong)(char)(char2))<<8UL)| \
- (((sal_uLong)(char)(char3))<<16UL)| \
- ((sal_uLong)(char)(char4))<<24UL))
+ ((ULONG)((((ULONG)(char)(char1)))| \
+ (((ULONG)(char)(char2))<<8UL)| \
+ (((ULONG)(char)(char3))<<16UL)| \
+ ((ULONG)(char)(char4))<<24UL))
class SvStream;
@@ -51,21 +51,21 @@ class SvStream;
class ImplCompat
{
SvStream* mpRWStm;
- sal_uInt32 mnCompatPos;
- sal_uInt32 mnTotalSize;
- sal_uInt16 mnStmMode;
- sal_uInt16 mnVersion;
+ UINT32 mnCompatPos;
+ UINT32 mnTotalSize;
+ UINT16 mnStmMode;
+ UINT16 mnVersion;
ImplCompat() {}
ImplCompat( const ImplCompat& rCompat ) {}
ImplCompat& operator=( const ImplCompat& rCompat ) { return *this; }
- sal_Bool operator==( const ImplCompat& rCompat ) { return sal_False; }
+ BOOL operator==( const ImplCompat& rCompat ) { return FALSE; }
public:
- ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
+ ImplCompat( SvStream& rStm, USHORT nStreamMode, UINT16 nVersion = 1 );
~ImplCompat();
- sal_uInt16 GetVersion() const { return mnVersion; }
+ UINT16 GetVersion() const { return mnVersion; }
};
#endif // _SV_SVCOMPAT_HXX
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index b28283f1a405..f2d0f6e08bd2 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -30,21 +30,17 @@
#define _SV_SVDATA_HXX
#include <osl/thread.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>
+#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>
namespace com {
namespace sun {
@@ -55,6 +51,9 @@ namespace lang {
namespace frame {
class XSessionManagerClient;
}
+namespace awt {
+ class XDisplayConnection;
+}
}}}
struct ImplTimerData;
@@ -151,23 +150,21 @@ struct ImplSVAppData
ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners
- 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
+ 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
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
- 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
+ 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
// 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.
@@ -205,9 +202,10 @@ 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
- sal_Bool mbFontSubChanged; // sal_True: FontSubstitution wurde zwischen Begin/End geaendert
+ BOOL mbFontSubChanged; // 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
};
@@ -233,12 +231,13 @@ struct ImplSVWinData
Window* mpTrackWin; // window, that is in tracking mode
AutoTimer* mpTrackTimer; // tracking timer
ImageList* mpMsgBoxImgList; // ImageList for MessageBox
+ ImageList* mpMsgBoxHCImgList; // ImageList for MessageBox (high contrast mode)
Window* mpAutoScrollWin; // window, that is in AutoScrollMode mode
- 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
+ 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
};
@@ -246,8 +245,6 @@ struct ImplSVWinData
// - ImplSVCtrlData -
// ------------------
-typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
-
struct ImplSVCtrlData
{
ImageList* mpCheckImgList; // ImageList for CheckBoxes
@@ -258,19 +255,19 @@ struct ImplSVCtrlData
ImageList* mpSplitHArwImgList; // ImageList for Horizontale SplitWindows (Arrows)
ImageList* mpSplitVArwImgList; // ImageList for Vertikale SplitWindows (Arrows)
Image* mpDisclosurePlus;
+ Image* mpDisclosurePlusHC;
Image* mpDisclosureMinus;
+ Image* mpDisclosureMinusHC;
ImplTBDragMgr* mpTBDragMgr; // DragMgr for ToolBox
- 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
+ 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
};
@@ -280,18 +277,18 @@ struct ImplSVCtrlData
struct ImplSVHelpData
{
- 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
+ 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
HelpTextWindow* mpHelpWin; // HelpWindow
- sal_uLong mnLastHelpHideTime; // ticks of last show
+ ULONG mnLastHelpHideTime; // ticks of last show
};
struct ImplSVNWFData
@@ -318,8 +315,10 @@ 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
};
@@ -333,18 +332,18 @@ struct ImplSVData
SalInstance* mpDefInst; // Default SalInstance
Application* mpApp; // pApp
WorkWindow* mpDefaultWin; // Default-Window
- sal_Bool mbDeInit; // Is VCL deinitializing
- sal_uLong mnThreadCount; // is VCL MultiThread enabled
+ BOOL mbDeInit; // Is VCL deinitializing
+ 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
+ SalTimer* mpSalTimer; // interface to sal event loop/timers
+ SalI18NImeStatus* mpImeStatus; // interface to ime status window
+ SalSystem* mpSalSystem; // SalSystem interface
ResMgr* mpResMgr; // SV-Resource-Manager
- 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
+ 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
ImplSVAppData maAppData; // indepen data for class Application
ImplSVGDIData maGDIData; // indepen data for Output classes
ImplSVWinData maWinData; // indepen data for Windows classes
@@ -354,24 +353,24 @@ struct ImplSVData
UnoWrapperBase* mpUnoWrapper;
Window* mpIntroWindow; // the splash screen
DockingManager* mpDockingManager;
- sal_Bool mbIsTestTool;
+ BOOL mbIsTestTool;
oslThreadIdentifier mnMainThreadId;
- rtl::Reference< vcl::DisplayConnection > mxDisplayConnection;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::awt::XDisplayConnection > 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;
+ ::vcl::SettingsConfigItem* mpSettingsConfigItem;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
- boost::unordered_map< int, rtl::OUString >* mpPaperNames;
};
void ImplInitSVData();
void ImplDeInitSVData();
void ImplDestroySVData();
Window* ImplGetDefaultWindow();
-VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
-VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
+VCL_DLLPUBLIC ResMgr* ImplGetResMgr();
+VCL_DLLPUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
void ImplWindowAutoMnemonic( Window* pWindow );
@@ -379,7 +378,7 @@ void ImplUpdateSystemProcessWindow();
Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
// SVAPP.CXX
-sal_Bool ImplCallHotKey( const KeyCode& rKeyCode );
+BOOL ImplCallHotKey( const KeyCode& rKeyCode );
void ImplFreeHotKeyData();
void ImplFreeEventHookData();
@@ -387,15 +386,11 @@ void ImplFreeEventHookData();
long ImplCallPreNotify( NotifyEvent& rEvt );
long ImplCallEvent( NotifyEvent& rEvt );
-extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData;
-inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
+extern VCL_DLLPUBLIC ImplSVData* pImplSVData;
+inline VCL_DLLPUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
inline ImplSVData* ImplGetAppSVData() { return ImplGetSVData(); }
-bool ImplInitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
-
-FieldUnitStringList* ImplGetFieldUnits();
-FieldUnitStringList* ImplGetCleanedFieldUnits();
-
+bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
// -----------------------------------------------------------------------
@@ -423,20 +418,20 @@ struct ImplDelData
{
ImplDelData* mpNext;
const Window* mpWindow;
- sal_Bool mbDel;
+ BOOL mbDel;
ImplDelData( const Window* pWindow = NULL )
- : mpNext( NULL ), mpWindow( NULL ), mbDel( sal_False )
+ : mpNext( NULL ), mpWindow( NULL ), mbDel( FALSE )
{ if( pWindow ) AttachToWindow( pWindow ); }
virtual ~ImplDelData();
bool IsDead() const
{
- DBG_ASSERT( mbDel == sal_False, "object deleted while in use !" );
- return (mbDel!=sal_False);
+ DBG_ASSERT( mbDel == FALSE, "object deleted while in use !" );
+ return (mbDel!=FALSE);
}
- sal_Bool /*deprecated */IsDelete() const { return (sal_Bool)IsDead(); }
+ BOOL /*deprecated */IsDelete() const { return (BOOL)IsDead(); }
private:
void AttachToWindow( const Window* );
@@ -448,12 +443,12 @@ private:
struct ImplSVEvent
{
- sal_uLong mnEvent;
+ ULONG mnEvent;
void* mpData;
Link* mpLink;
Window* mpWindow;
ImplDelData maDelData;
- sal_Bool mbCall;
+ BOOL mbCall;
};
#endif // _SV_SVDATA_HXX
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index bc76c70e1ebe..1f688bc1be2e 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -30,41 +30,47 @@
#include "svl/solar.hrc"
-#define SV_RESID_STDOFFSET 0
-#define SV_RESID_MONOOFFSET 1
+#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
// Achtung: Diese Id's muessen min. 10 Werte auseinanderliegen, da
// je nach Style noch ein Offset aufgerechnet wird
-#define SV_RESID_BITMAP_CHECK 1000
-#define SV_RESID_BITMAP_RADIO 1010
+#define SV_RESID_BITMAP_CHECK 1000
+#define SV_RESID_BITMAP_RADIO 1010
-#define SV_RESID_BITMAP_MSGBOX 1020
+#define SV_RESID_BITMAP_MSGBOX 1020
+#define SV_RESID_BITMAP_MSGBOX_HC 1021
-#define SV_RESID_BITMAP_PIN 1030
+#define SV_RESID_BITMAP_PIN 1030
-#define SV_RESID_BITMAP_SPLITHPIN 1040
-#define SV_RESID_BITMAP_SPLITVPIN 1041
-#define SV_RESID_BITMAP_SPLITHARW 1042
-#define SV_RESID_BITMAP_SPLITVARW 1043
+#define SV_RESID_BITMAP_SPLITHPIN 1040
+#define SV_RESID_BITMAP_SPLITVPIN 1041
+#define SV_RESID_BITMAP_SPLITHARW 1042
+#define SV_RESID_BITMAP_SPLITVARW 1043
-#define SV_RESID_BITMAP_SCROLLMSK 1050
-#define SV_RESID_BITMAP_SCROLLBMP 1051
-#define SV_RESID_BITMAP_CLOSEDOC 1052
+#define SV_RESID_BITMAP_SCROLLMSK 1050
+#define SV_RESID_BITMAP_SCROLLBMP 1051
+#define SV_RESID_BITMAP_CLOSEDOC 1052
+#define SV_RESID_BITMAP_CLOSEDOCHC 1053
#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
-#define SV_MENU_EDIT_COPY 3
-#define SV_MENU_EDIT_PASTE 4
-#define SV_MENU_EDIT_DELETE 5
-#define SV_MENU_EDIT_SELECTALL 6
-#define SV_MENU_EDIT_INSERTSYMBOL 7
-#define SV_RESID_STRING_NOSELECTIONPOSSIBLE 2001
+#define SV_DISCLOSURE_PLUS_HC 1062
+#define SV_DISCLOSURE_MINUS_HC 1063
+
+#define SV_RESID_MENU_EDIT 2000
+#define SV_MENU_EDIT_UNDO 1
+#define SV_MENU_EDIT_CUT 2
+#define SV_MENU_EDIT_COPY 3
+#define SV_MENU_EDIT_PASTE 4
+#define SV_MENU_EDIT_DELETE 5
+#define SV_MENU_EDIT_SELECTALL 6
+#define SV_MENU_EDIT_INSERTSYMBOL 7
+#define SV_RESID_STRING_NOSELECTIONPOSSIBLE 2001
#define SV_MENU_MAC_SERVICES 2002
#define SV_MENU_MAC_HIDEAPP 2003
@@ -116,10 +122,8 @@
#define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT 1
#define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE 2
-#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_PRT_NUP_ORDER_LRTD 0
+#define SV_PRINT_PRT_NUP_ORDER_TDLR 1
#define SV_PRINT_TAB_JOB 2
#define SV_PRINT_PRINTERS_FL 1
@@ -138,17 +142,19 @@
#define SV_PRINT_BUTTONLINE 14
#define SV_PRINT_COLLATE_IMG 15
#define SV_PRINT_NOCOLLATE_IMG 16
+#define SV_PRINT_COLLATE_HC_IMG 17
+#define SV_PRINT_NOCOLLATE_HC_IMG 18
#define SV_PRINT_NOPAGES 19
#define SV_PRINT_STATUS_TXT 20
#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
@@ -158,34 +164,34 @@
#define SV_PRINT_NOPRINTERWARNING 2051
#define SV_PRINT_NOCONTENT 2052
-#define SV_HELPTEXT_CLOSE 10000
-#define SV_HELPTEXT_MINIMIZE 10001
-#define SV_HELPTEXT_MAXIMIZE 10002
-#define SV_HELPTEXT_RESTORE 10003
-#define SV_HELPTEXT_ROLLDOWN 10004
-#define SV_HELPTEXT_ROLLUP 10005
-#define SV_HELPTEXT_HELP 10006
-#define SV_HELPTEXT_ALWAYSVISIBLE 10007
-#define SV_HELPTEXT_FADEIN 10008
-#define SV_HELPTEXT_FADEOUT 10009
-#define SV_HELPTEXT_SPLITFLOATING 10010
-#define SV_HELPTEXT_SPLITFIXED 10011
+#define SV_HELPTEXT_CLOSE 10000
+#define SV_HELPTEXT_MINIMIZE 10001
+#define SV_HELPTEXT_MAXIMIZE 10002
+#define SV_HELPTEXT_RESTORE 10003
+#define SV_HELPTEXT_ROLLDOWN 10004
+#define SV_HELPTEXT_ROLLUP 10005
+#define SV_HELPTEXT_HELP 10006
+#define SV_HELPTEXT_ALWAYSVISIBLE 10007
+#define SV_HELPTEXT_FADEIN 10008
+#define SV_HELPTEXT_FADEOUT 10009
+#define SV_HELPTEXT_SPLITFLOATING 10010
+#define SV_HELPTEXT_SPLITFIXED 10011
#define SV_HELPTEXT_CLOSEDOCUMENT 10012
-#define SV_BUTTONTEXT_OK 10100
-#define SV_BUTTONTEXT_CANCEL 10101
-#define SV_BUTTONTEXT_YES 10102
-#define SV_BUTTONTEXT_NO 10103
-#define SV_BUTTONTEXT_RETRY 10104
-#define SV_BUTTONTEXT_HELP 10105
-#define SV_BUTTONTEXT_CLOSE SV_HELPTEXT_CLOSE
-#define SV_BUTTONTEXT_MORE 10107
-#define SV_BUTTONTEXT_IGNORE 10108
-#define SV_BUTTONTEXT_ABORT 10109
-#define SV_BUTTONTEXT_LESS 10110
-
-#define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE
-#define SV_STDTEXT_SERVICENOTAVAILABLE 10200
+#define SV_BUTTONTEXT_OK 10100
+#define SV_BUTTONTEXT_CANCEL 10101
+#define SV_BUTTONTEXT_YES 10102
+#define SV_BUTTONTEXT_NO 10103
+#define SV_BUTTONTEXT_RETRY 10104
+#define SV_BUTTONTEXT_HELP 10105
+#define SV_BUTTONTEXT_CLOSE SV_HELPTEXT_CLOSE
+#define SV_BUTTONTEXT_MORE 10107
+#define SV_BUTTONTEXT_IGNORE 10108
+#define SV_BUTTONTEXT_ABORT 10109
+#define SV_BUTTONTEXT_LESS 10110
+
+#define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE
+#define SV_STDTEXT_SERVICENOTAVAILABLE 10200
#define SV_STDTEXT_DONTHINTAGAIN 10201
#define SV_STDTEXT_DONTASKAGAIN 10202
#define SV_STDTEXT_DONTWARNAGAIN 10203
@@ -193,21 +199,20 @@
#define SV_STDTEXT_PREFERENCES 10205
#define SV_MAC_SCREENNNAME 10206
#define SV_STDTEXT_ALLFILETYPES 10207
-#define SV_STDTEXT_LAST SV_STDTEXT_ALLFILETYPES
+#define SV_STDTEXT_LAST SV_STDTEXT_ALLFILETYPES
-#define SV_ACCESSERROR_FIRST SV_ACCESSERROR_WRONG_VERSION
-#define SV_ACCESSERROR_WRONG_VERSION 10500
-#define SV_ACCESSERROR_BRIDGE_MSG 10501
+#define SV_ACCESSERROR_FIRST SV_ACCESSERROR_WRONG_VERSION
+#define SV_ACCESSERROR_WRONG_VERSION 10500
+#define SV_ACCESSERROR_BRIDGE_MSG 10501
#define SV_ACCESSERROR_OK_CANCEL_MSG 10502
-#define SV_ACCESSERROR_MISSING_BRIDGE 10503
-#define SV_ACCESSERROR_FAULTY_JAVA 10504
-#define SV_ACCESSERROR_JAVA_MSG 10505
-#define SV_ACCESSERROR_MISSING_JAVA 10506
+#define SV_ACCESSERROR_MISSING_BRIDGE 10503
+#define SV_ACCESSERROR_FAULTY_JAVA 10504
+#define SV_ACCESSERROR_JAVA_MSG 10505
+#define SV_ACCESSERROR_MISSING_JAVA 10506
#define SV_ACCESSERROR_JAVA_NOT_CONFIGURED 10507
#define SV_ACCESSERROR_JAVA_DISABLED 10508
#define SV_ACCESSERROR_TURNAROUND_MSG 10509
-#define SV_ACCESSERROR_NO_FONTS 10510
-#define SV_ACCESSERROR_LAST SV_ACCESSERROR_NO_FONTS
+#define SV_ACCESSERROR_LAST SV_ACCESSERROR_TURNAROUND_MSG
#define SV_SHORTCUT_HELP 10600
#define SV_SHORTCUT_CONTEXTHELP 10601
@@ -229,6 +234,8 @@
#define SV_ICON_LARGE_START 24000
#define SV_ICON_SMALL_START 25000
+#define SV_ICON_LARGE_HC_START 26000
+#define SV_ICON_SMALL_HC_START 27000
#define SV_ICON_ID_OFFICE 1
#define SV_ICON_ID_TEXT 2
@@ -251,4 +258,4 @@
#define HID_PRINTDLG HID_VCL_START
-#endif // _SV_SVIDS_HRC
+#endif // _SV_SVIDS_HRC
diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx
index c03bf9a6af58..7a745a433d9a 100644
--- a/vcl/inc/vcl/symbol.hxx
+++ b/vcl/inc/vcl/symbol.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,45 +36,48 @@
// ----------------
// By changes you must also change: rsc/vclrsc.hxx
-typedef sal_uInt16 SymbolType;
-#define SYMBOL_DONTKNOW ((SymbolType)0)
-#define SYMBOL_IMAGE ((SymbolType)1)
-#define SYMBOL_ARROW_UP ((SymbolType)2)
-#define SYMBOL_ARROW_DOWN ((SymbolType)3)
-#define SYMBOL_ARROW_LEFT ((SymbolType)4)
-#define SYMBOL_ARROW_RIGHT ((SymbolType)5)
-#define SYMBOL_SPIN_UP ((SymbolType)6)
-#define SYMBOL_SPIN_DOWN ((SymbolType)7)
-#define SYMBOL_SPIN_LEFT ((SymbolType)8)
-#define SYMBOL_SPIN_RIGHT ((SymbolType)9)
-#define SYMBOL_FIRST ((SymbolType)10)
-#define SYMBOL_LAST ((SymbolType)11)
-#define SYMBOL_PREV ((SymbolType)12)
-#define SYMBOL_NEXT ((SymbolType)13)
-#define SYMBOL_PAGEUP ((SymbolType)14)
-#define SYMBOL_PAGEDOWN ((SymbolType)15)
-#define SYMBOL_PLAY ((SymbolType)16)
-#define SYMBOL_REVERSEPLAY ((SymbolType)17)
-#define SYMBOL_RECORD ((SymbolType)18)
-#define SYMBOL_STOP ((SymbolType)19)
-#define SYMBOL_PAUSE ((SymbolType)20)
-#define SYMBOL_WINDSTART ((SymbolType)21)
-#define SYMBOL_WINDEND ((SymbolType)22)
-#define SYMBOL_WINDBACKWARD ((SymbolType)23)
-#define SYMBOL_WINDFORWARD ((SymbolType)24)
-#define SYMBOL_CLOSE ((SymbolType)25)
-#define SYMBOL_ROLLUP ((SymbolType)26)
-#define SYMBOL_ROLLDOWN ((SymbolType)27)
-#define SYMBOL_CHECKMARK ((SymbolType)28)
-#define SYMBOL_RADIOCHECKMARK ((SymbolType)29)
-#define SYMBOL_SPIN_UPDOWN ((SymbolType)30)
-#define SYMBOL_FLOAT ((SymbolType)31)
-#define SYMBOL_DOCK ((SymbolType)32)
-#define SYMBOL_HIDE ((SymbolType)33)
-#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_MENU SYMBOL_SPIN_DOWN
+typedef USHORT SymbolType;
+#define SYMBOL_DONTKNOW ((SymbolType)0)
+#define SYMBOL_IMAGE ((SymbolType)1)
+#define SYMBOL_ARROW_UP ((SymbolType)2)
+#define SYMBOL_ARROW_DOWN ((SymbolType)3)
+#define SYMBOL_ARROW_LEFT ((SymbolType)4)
+#define SYMBOL_ARROW_RIGHT ((SymbolType)5)
+#define SYMBOL_SPIN_UP ((SymbolType)6)
+#define SYMBOL_SPIN_DOWN ((SymbolType)7)
+#define SYMBOL_SPIN_LEFT ((SymbolType)8)
+#define SYMBOL_SPIN_RIGHT ((SymbolType)9)
+#define SYMBOL_FIRST ((SymbolType)10)
+#define SYMBOL_LAST ((SymbolType)11)
+#define SYMBOL_PREV ((SymbolType)12)
+#define SYMBOL_NEXT ((SymbolType)13)
+#define SYMBOL_PAGEUP ((SymbolType)14)
+#define SYMBOL_PAGEDOWN ((SymbolType)15)
+#define SYMBOL_PLAY ((SymbolType)16)
+#define SYMBOL_REVERSEPLAY ((SymbolType)17)
+#define SYMBOL_RECORD ((SymbolType)18)
+#define SYMBOL_STOP ((SymbolType)19)
+#define SYMBOL_PAUSE ((SymbolType)20)
+#define SYMBOL_WINDSTART ((SymbolType)21)
+#define SYMBOL_WINDEND ((SymbolType)22)
+#define SYMBOL_WINDBACKWARD ((SymbolType)23)
+#define SYMBOL_WINDFORWARD ((SymbolType)24)
+#define SYMBOL_CLOSE ((SymbolType)25)
+#define SYMBOL_ROLLUP ((SymbolType)26)
+#define SYMBOL_ROLLDOWN ((SymbolType)27)
+#define SYMBOL_CHECKMARK ((SymbolType)28)
+#define SYMBOL_RADIOCHECKMARK ((SymbolType)29)
+#define SYMBOL_SPIN_UPDOWN ((SymbolType)30)
+#define SYMBOL_FLOAT ((SymbolType)31)
+#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)
+#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
#endif // _SV_SYMBOL_HXX
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index 275e41312f17..ba1c2e5d1cdb 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,8 +44,7 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window
{
private:
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_False );
- SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
+ SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE );
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
@@ -54,21 +53,17 @@ private:
public:
SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
// create a SystemChildWindow using the given SystemWindowData
- SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_True );
+ SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = TRUE );
SystemChildWindow( Window* pParent, const ResId& rResId );
~SystemChildWindow();
- const SystemEnvData* GetSystemData() const;
+ const SystemEnvData* GetSystemData() const;
// per default systemchildwindows erase their background for better plugin support
// however, this might not always be required
- 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 );
+ void EnableEraseBackground( BOOL bEnable = TRUE );
+ BOOL IsEraseBackgroundEnabled();
+ void SetForwardKey( BOOL bEnable );
};
#endif // _SV_SYSCHILD_HXX
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 199f0ad67cac..108371b115c4 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,6 @@ typedef struct CGLayer *CGLayerRef;
class NSView;
#endif
#endif
-#if defined( WNT ) || defined( OS2 )
-#include <windef.h>
-#endif
// -----------------
// - SystemEnvData -
@@ -51,23 +48,23 @@ class NSView;
struct SystemEnvData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT ) || defined( OS2 )
- HWND hWnd; // the window hwnd
+ HWND hWnd; // the window hwnd
#elif defined( QUARTZ )
NSView* pView; // the cocoa (NSView *) implementing this object
#elif defined( UNX )
- void* pDisplay; // the relevant display connection
- long aWindow; // the window of the object
- void* pSalFrame; // contains a salframe, if object has one
- void* pWidget; // the corresponding widget
- void* pVisual; // the visual in use
- int nScreen; // the current screen of the window
- int nDepth; // depth of said visual
- long aColormap; // the colormap being used
- void* pAppContext; // the application context in use
- long aShellWindow; // the window of the frame's shell
- void* pShellWidget; // the frame's shell widget
+ void* pDisplay; // the relevant display connection
+ long aWindow; // the window of the object
+ void* pSalFrame; // contains a salframe, if object has one
+ void* pWidget; // the corresponding widget
+ void* pVisual; // the visual in use
+ int nScreen; // the current screen of the window
+ int nDepth; // depth of said visual
+ long aColormap; // the colormap being used
+ void* pAppContext; // the application context in use
+ long aShellWindow; // the window of the frame's shell
+ void* pShellWidget; // the frame's shell widget
#endif
};
@@ -79,13 +76,13 @@ struct SystemEnvData
struct SystemParentData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT ) || defined( OS2 )
- HWND hWnd; // the window hwnd
+ HWND hWnd; // the window hwnd
#elif defined( QUARTZ )
NSView* pView; // the cocoa (NSView *) implementing this object
#elif defined( UNX )
- long aWindow; // the window of the object
+ long aWindow; // the window of the object
bool bXEmbedSupport:1; // decides whether the object in question
// should support the XEmbed protocol
#endif
@@ -97,13 +94,13 @@ struct SystemParentData
struct SystemMenuData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT )
- HMENU hMenu; // the menu handle of the menu bar
+ HMENU hMenu; // the menu handle of the menu bar
#elif defined( QUARTZ )
//not defined
#elif defined( UNX )
- long aMenu; // ???
+ long aMenu; // ???
#endif
};
@@ -113,19 +110,19 @@ struct SystemMenuData
struct SystemGraphicsData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT )
- HDC hDC; // handle to a device context
+ HDC hDC; // handle to a device context
#elif defined( QUARTZ )
- CGContextRef rCGContext; // QUARTZ graphic context
+ CGContextRef rCGContext; // QUARTZ graphic context
#elif defined( UNX )
- void* pDisplay; // the relevant display connection
- long hDrawable; // a drawable
- void* pVisual; // the visual in use
- int nScreen; // the current screen of the drawable
- int nDepth; // depth of said visual
- long aColormap; // the colormap being used
- void* pXRenderFormat; // render format for drawable
+ void* pDisplay; // the relevant display connection
+ long hDrawable; // a drawable
+ void* pVisual; // the visual in use
+ int nScreen; // the current screen of the drawable
+ int nDepth; // depth of said visual
+ long aColormap; // the colormap being used
+ void* pXRenderFormat; // render format for drawable
#endif
};
@@ -136,11 +133,11 @@ struct SystemGraphicsData
struct SystemWindowData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT ) // meaningless on Windows
#elif defined( QUARTZ ) // meaningless on Mac OS X / Quartz
#elif defined( UNX )
- void* pVisual; // the visual to be used
+ void* pVisual; // the visual to be used
#endif
};
@@ -164,10 +161,10 @@ struct SystemGlyphData
struct SystemFontData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
#if defined( WNT )
HFONT hFont; // native font object
-#elif defined( QUARTZ )
+#elif defined( QUARTZ )
void* aATSUFontID; // native font object
#elif defined( UNX )
void* nFontId; // native font id
@@ -178,16 +175,15 @@ struct SystemFontData
bool bAntialias; // Should this font be antialiased
bool bVerticalCharacterType; // Is the font using vertical character type
};
-
+
// --------------------
// - SystemTextLayoutData -
// --------------------
typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
-
struct SystemTextLayoutData
{
- unsigned long nSize; // size in bytes of this structure
+ unsigned long nSize; // size in bytes of this structure
SystemGlyphDataVector rGlyphData; // glyph data
int orientation; // Text orientation
};
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 0fd2fd8d1512..db240c18f31f 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,34 +59,34 @@ class TaskPaneList;
#define ICON_MATH_DOCUMENT 15
#define ICON_TEMPLATE 16
#define ICON_MACROLIBRARY 17
-#define ICON_PLAYER 100
+#define ICON_PLAYER 100
#define ICON_SETUP 500
// -------------------
// - WindowStateData -
// -------------------
-#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_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_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 ((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)
+#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)
-class VCL_PLUGIN_PUBLIC WindowStateData
+class VCL_DLLPUBLIC WindowStateData
{
private:
sal_uInt32 mnValidMask;
@@ -107,7 +107,7 @@ public:
mnMaximizedX = mnMaximizedY = mnMaximizedWidth = mnMaximizedHeight = 0;
}
- void SetMask( sal_uLong nValidMask ) { mnValidMask = nValidMask; }
+ void SetMask( 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 ((sal_uInt16)0)
-#define MENUBAR_MODE_HIDE ((sal_uInt16)1)
+#define MENUBAR_MODE_NORMAL ((USHORT)0)
+#define MENUBAR_MODE_HIDE ((USHORT)1)
-#define TITLE_BUTTON_DOCKING ((sal_uInt16)1)
-#define TITLE_BUTTON_HIDE ((sal_uInt16)2)
-#define TITLE_BUTTON_MENU ((sal_uInt16)4)
+#define TITLE_BUTTON_DOCKING ((USHORT)1)
+#define TITLE_BUTTON_HIDE ((USHORT)2)
+#define TITLE_BUTTON_MENU ((USHORT)4)
// ----------------
// - SystemWindow -
@@ -156,20 +156,20 @@ private:
Size maOrgSize;
Size maRollUpOutSize;
Size maMinOutSize;
- sal_Bool mbPined;
- sal_Bool mbRollUp;
- sal_Bool mbRollFunc;
- sal_Bool mbDockBtn;
- sal_Bool mbHideBtn;
- sal_Bool mbSysChild;
- sal_uInt16 mnMenuBarMode;
- sal_uInt16 mnIcon;
+ BOOL mbPined;
+ BOOL mbRollUp;
+ BOOL mbRollFunc;
+ BOOL mbDockBtn;
+ BOOL mbHideBtn;
+ BOOL mbSysChild;
+ USHORT mnMenuBarMode;
+ USHORT mnIcon;
ImplData* mpImplData;
#if _SOLAR__PRIVATE
public:
using Window::ImplIsInTaskPaneList;
- SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList( Window* pWin );
+ SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList( Window* pWin );
#endif
private:
@@ -179,7 +179,7 @@ private:
// Copy assignment is forbidden and not implemented.
SystemWindow (const SystemWindow &);
SystemWindow & operator= (const SystemWindow &);
-
+
SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, Window* i_pConfigureWin );
protected:
@@ -193,34 +193,34 @@ public:
virtual long Notify( NotifyEvent& rNEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- virtual sal_Bool Close();
- virtual void TitleButtonClick( sal_uInt16 nButton );
+ virtual BOOL Close();
+ virtual void TitleButtonClick( USHORT nButton );
virtual void Pin();
virtual void Roll();
virtual void Resizing( Size& rSize );
- void SetIcon( sal_uInt16 nIcon );
- sal_uInt16 GetIcon() const { return mnIcon; }
+ void SetIcon( USHORT nIcon );
+ USHORT 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( sal_uInt8 nLevel );
- sal_uInt8 GetZLevel() const;
+ void SetZLevel( BYTE nLevel );
+ BYTE GetZLevel() const;
- void EnableSaveBackground( sal_Bool bSave = sal_True );
- sal_Bool IsSaveBackgroundEnabled() const;
+ void EnableSaveBackground( BOOL bSave = TRUE );
+ BOOL IsSaveBackgroundEnabled() const;
- void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
- sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
+ void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
+ BOOL IsTitleButtonVisible( USHORT nButton ) const;
- void SetPin( sal_Bool bPin );
- sal_Bool IsPined() const { return mbPined; }
+ void SetPin( BOOL bPin );
+ BOOL IsPined() const { return mbPined; }
void RollUp();
void RollDown();
- sal_Bool IsRollUp() const { return mbRollUp; }
+ BOOL IsRollUp() const { return mbRollUp; }
void SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
Size GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
@@ -232,41 +232,41 @@ public:
Size GetResizeOutputSizePixel() const;
void SetWindowState( const ByteString& rStr );
- ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const;
+ ByteString GetWindowState( ULONG nMask = WINDOWSTATE_MASK_ALL ) const;
void SetMenuBar( MenuBar* pMenuBar );
MenuBar* GetMenuBar() const { return mpMenuBar; }
- void SetMenuBarMode( sal_uInt16 nMode );
- sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
+ void SetMenuBarMode( USHORT nMode );
+ USHORT GetMenuBarMode() const { return mnMenuBarMode; }
- TaskPaneList* GetTaskPaneList();
+ TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
-
+
/**
Returns the screen number the window is on
-
+
The screen number is counted the same way that
<code>Application::GetScreenPosSizePixel</code>,
<code>Application::GetWorkAreaPosSizePixel</code>,
<code>Application::GetScreenName</code>
and of course <code>SystemWindow::SetScreenNumber</code>
are counted in.
-
+
In case the window is positioned on multiple screens the
screen number returned will be of the screen containing the
upper left pixel of the frame area (that is of the client
area on system decorated windows, or the frame area of
undecorated resp. owner decorated windows.
-
+
@returns the screen number
-
+
@see SystemWindow::SetScreenNumber
*/
unsigned int GetScreenNumber() const;
/**
Move the Window to a new screen. The same rules for
positioning apply as in <code>SystemWindow::GetScreenNumber</code>
-
+
The screen number is counted the same way that
<code>Application::GetScreenPosSizePixel</code>,
<code>Application::GetWorkAreaPosSizePixel</code>,
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index c6525138f73b..877772f284aa 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,8 +45,8 @@ class ListBox;
// --------------------
#ifndef TAB_APPEND
-#define TAB_APPEND ((sal_uInt16)0xFFFF)
-#define TAB_PAGE_NOTFOUND ((sal_uInt16)0xFFFF)
+#define TAB_APPEND ((USHORT)0xFFFF)
+#define TAB_PAGE_NOTFOUND ((USHORT)0xFFFF)
#endif /* !TAB_APPEND */
// --------------
@@ -62,30 +62,40 @@ private:
long mnLastHeight;
long mnBtnSize;
long mnMaxPageWidth;
- sal_uInt16 mnActPageId;
- sal_uInt16 mnCurPageId;
- sal_Bool mbFormat;
- sal_Bool mbRestoreHelpId;
- sal_Bool mbRestoreUnqId;
- sal_Bool mbSmallInvalidate;
- sal_Bool mbExtraSpace;
+ USHORT mnActPageId;
+ USHORT mnCurPageId;
+ USHORT mnFirstPagePos;
+ USHORT mnLastFirstPagePos;
+ BOOL mbFormat;
+ BOOL mbRestoreHelpId;
+ BOOL mbRestoreUnqId;
+ BOOL mbSingleLine;
+ BOOL mbScroll;
+ BOOL mbRestoreSmartId;
+ BOOL mbSmallInvalidate;
+ BOOL mbExtraSpace;
Link maActivateHdl;
Link maDeactivateHdl;
using Control::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
- SAL_DLLPRIVATE ImplTabItem* ImplGetItem( sal_uInt16 nId ) const;
+ 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 Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth );
- 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 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 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 );
-
+ 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* );
@@ -93,10 +103,9 @@ private:
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- virtual void FillLayoutData() const;
+ virtual void FillLayoutData() const;
virtual const Font& GetCanonicalFont( const StyleSettings& _rStyle ) const;
virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
SAL_DLLPRIVATE Rectangle* ImplFindPartRect( const Point& rPt );
@@ -134,52 +143,55 @@ public:
Point GetItemsOffset() const;
void InsertPage( const ResId& rResId,
- sal_uInt16 nPos = TAB_APPEND );
- void InsertPage( sal_uInt16 nPageId, const XubString& rText,
- sal_uInt16 nPos = TAB_APPEND );
- void RemovePage( sal_uInt16 nPageId );
+ USHORT nPos = TAB_APPEND );
+ void InsertPage( USHORT nPageId, const XubString& rText,
+ USHORT nPos = TAB_APPEND );
+ void RemovePage( USHORT nPageId );
void Clear();
- void EnablePage( sal_uInt16 nPageId, bool bEnable = true );
+ void EnablePage( USHORT nPageId, bool bEnable = true );
- 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;
+ USHORT GetPageCount() const;
+ USHORT GetPageId( USHORT nPos ) const;
+ USHORT GetPagePos( USHORT nPageId ) const;
+ USHORT GetPageId( const Point& rPos ) const;
- void SetCurPageId( sal_uInt16 nPageId );
- sal_uInt16 GetCurPageId() const;
+ void SetCurPageId( USHORT nPageId );
+ USHORT GetCurPageId() const;
- void SelectTabPage( sal_uInt16 nPageId );
+ void SetFirstPageId( USHORT nPageId );
+ USHORT GetFirstPageId() const { return GetPageId( mnFirstPagePos ); }
+
+ void SelectTabPage( USHORT nPageId );
void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; }
long GetMaxPageWidth() const { return mnMaxPageWidth; }
void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
- sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
-
- void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
- TabPage* GetTabPage( sal_uInt16 nPageId ) const;
- sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const;
+ BOOL IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
- void SetPageText( sal_uInt16 nPageId, const XubString& rText );
- XubString GetPageText( sal_uInt16 nPageId ) const;
+ void SetTabPage( USHORT nPageId, TabPage* pPage );
+ TabPage* GetTabPage( USHORT nPageId ) const;
+ USHORT GetTabPageResId( USHORT nPageId ) const;
- void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
- const XubString& GetHelpText( sal_uInt16 nPageId ) const;
+ void SetPageText( USHORT nPageId, const XubString& rText );
+ XubString GetPageText( USHORT nPageId ) const;
- void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId );
- rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
+ void SetHelpText( USHORT nPageId, const XubString& rText );
+ const XubString& GetHelpText( USHORT nPageId ) const;
- void SetPageImage( sal_uInt16 nPageId, const Image& rImage );
- const Image* GetPageImage( sal_uInt16 nPageId ) const;
+ void SetHelpId( USHORT nPageId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nPageId ) const;
+
+ void SetPageImage( USHORT nPageId, const Image& rImage );
+ const Image* GetPageImage( USHORT nPageId ) const;
void SetHelpText( const XubString& rText )
{ Control::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( const rtl::OString& rId )
- { Control::SetHelpId( rId ); }
- const rtl::OString& GetHelpId() const
+ void SetHelpId( ULONG nId )
+ { Control::SetHelpId( nId ); }
+ ULONG GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
@@ -190,19 +202,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( sal_uInt16 nPageId, long nIndex ) const;
+ Rectangle GetCharacterBounds( USHORT 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, sal_uInt16& rPageId ) const;
+ long GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const;
// returns the bounding rectangle of the union of tab page area and the
// corresponding tab
- Rectangle GetTabPageBounds( sal_uInt16 nPageId ) const;
+ Rectangle GetTabPageBounds( USHORT nPageId ) const;
// returns the rectangle of the tab for page nPageId
- Rectangle GetTabBounds( sal_uInt16 nPageId ) const;
+ Rectangle GetTabBounds( USHORT nPageId ) const;
};
#endif // _SV_TABCTRL_HXX
diff --git a/vcl/inc/vcl/tabdlg.hxx b/vcl/inc/vcl/tabdlg.hxx
index 0b654b409f33..ec340af68cbc 100644
--- a/vcl/inc/vcl/tabdlg.hxx
+++ b/vcl/inc/vcl/tabdlg.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,13 +43,13 @@ class TabControl;
class VCL_DLLPUBLIC TabDialog : public Dialog
{
private:
- FixedLine* mpFixedLine;
- Window* mpViewWindow;
- WindowAlign meViewAlign;
- sal_Bool mbPosControls;
+ FixedLine* mpFixedLine;
+ Window* mpViewWindow;
+ WindowAlign meViewAlign;
+ BOOL mbPosControls;
- SAL_DLLPRIVATE void ImplInitTabDialogData();
- SAL_DLLPRIVATE void ImplPosControls();
+ SAL_DLLPRIVATE void ImplInitTabDialogData();
+ SAL_DLLPRIVATE void ImplPosControls();
public:
TabDialog( Window* pParent,
@@ -57,17 +57,17 @@ public:
TabDialog( Window* pParent, const ResId& rResId );
~TabDialog();
- virtual void Resize();
- virtual void StateChanged( StateChangedType nStateChange );
-
- void AdjustLayout();
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void AdjustLayout();
- void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
- Window* GetViewWindow() const { return mpViewWindow; }
- void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
- WindowAlign GetViewAlign() const { return meViewAlign; }
+ void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
+ Window* GetViewWindow() const { return mpViewWindow; }
+ void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
+ WindowAlign GetViewAlign() const { return meViewAlign; }
};
-#endif // _SV_TABDLG_HXX
+#endif // _SV_TABDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/tabpage.hxx b/vcl/inc/vcl/tabpage.hxx
index 92a00f892845..bececc316fa4 100644
--- a/vcl/inc/vcl/tabpage.hxx
+++ b/vcl/inc/vcl/tabpage.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,23 +41,25 @@ class VCL_DLLPUBLIC TabPage : public Window
{
private:
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings();
+ SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
+ SAL_DLLPRIVATE void ImplInitSettings();
public:
TabPage( Window* pParent, WinBits nStyle = 0 );
TabPage( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void ActivatePage();
+ virtual void DeactivatePage();
- virtual void ActivatePage();
- virtual void DeactivatePage();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
};
-#endif // _SV_TABPAGE_HXX
+#endif // _SV_TABPAGE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx
index 102f755554f2..0331c1220858 100644
--- a/vcl/inc/vcl/taskpanelist.hxx
+++ b/vcl/inc/vcl/taskpanelist.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,12 +37,12 @@
class VCL_DLLPUBLIC TaskPaneList
{
::std::vector<Window *> mTaskPanes;
- 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 );
+ Window *FindNextPane( Window *pWindow, BOOL bForward = TRUE );
+ Window *FindNextFloat( Window *pWindow, BOOL bForward = TRUE );
+ Window *FindNextSplitter( Window *pWindow, BOOL bForward = TRUE );
public:
- sal_Bool IsInList( Window *pWindow );
+ BOOL IsInList( Window *pWindow );
public:
TaskPaneList();
@@ -50,7 +50,7 @@ public:
void AddWindow( Window *pWindow );
void RemoveWindow( Window *pWindow );
- sal_Bool HandleKeyEvent( KeyEvent aKeyEvent );
+ BOOL HandleKeyEvent( KeyEvent aKeyEvent );
};
#endif
diff --git a/vcl/inc/vcl/textlayout.hxx b/vcl/inc/vcl/textlayout.hxx
index 5902573f8746..7f42ecafe158 100644
--- a/vcl/inc/vcl/textlayout.hxx
+++ b/vcl/inc/vcl/textlayout.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -118,7 +118,7 @@ namespace vcl
virtual ~ControlTextRenderer();
Rectangle DrawText( const Rectangle& _rRect,
- const XubString& _rText, sal_uInt16 _nStyle = 0,
+ const XubString& _rText, USHORT _nStyle = 0,
MetricVector* _pVector = NULL, String* _pDisplayText = NULL );
private:
diff --git a/vcl/inc/vcl/threadex.hxx b/vcl/inc/vcl/threadex.hxx
index 429b43e6ac7c..1e1ab0e69b23 100644
--- a/vcl/inc/vcl/threadex.hxx
+++ b/vcl/inc/vcl/threadex.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,9 @@ namespace vcl
{
class VCL_DLLPUBLIC ThreadExecutor
{
- oslThread m_aThread;
- oslCondition m_aFinish;
- long m_nReturn;
+ oslThread m_aThread;
+ oslCondition m_aFinish;
+ long m_nReturn;
#ifdef THREADEX_IMPLEMENTATION
public:
@@ -60,8 +60,8 @@ namespace vcl
class VCL_DLLPUBLIC SolarThreadExecutor
{
oslCondition m_aStart;
- oslCondition m_aFinish;
- long m_nReturn;
+ oslCondition m_aFinish;
+ long m_nReturn;
bool m_bTimeout;
DECL_DLLPRIVATE_LINK( worker, void* );
diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx
deleted file mode 100644
index ce45631d2fda..000000000000
--- a/vcl/inc/vcl/throbber.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#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 efc4b00924a7..4cacc5662a35 100644
--- a/vcl/inc/vcl/timer.hxx
+++ b/vcl/inc/vcl/timer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,24 +44,24 @@ class VCL_DLLPUBLIC Timer
{
protected:
ImplTimerData* mpTimerData;
- sal_uLong mnTimeout;
- sal_Bool mbActive;
- sal_Bool mbAuto;
+ ULONG mnTimeout;
+ BOOL mbActive;
+ BOOL mbAuto;
Link maTimeoutHdl;
public:
Timer();
Timer( const Timer& rTimer );
- virtual ~Timer();
+ virtual ~Timer();
virtual void Timeout();
void Start();
void Stop();
- void SetTimeout( sal_uLong nTimeout );
- sal_uLong GetTimeout() const { return mnTimeout; }
- sal_Bool IsActive() const { return mbActive; }
+ void SetTimeout( ULONG nTimeout );
+ ULONG GetTimeout() const { return mnTimeout; }
+ 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 aec0c11cf790..014be121b349 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,28 +59,28 @@ class Window;
struct ImplToolItem
{
- Window* mpWindow;
- void* mpUserData;
- Image maImage;
- Image maHighImage;
- long mnImageAngle;
- bool mbMirrorMode;
- XubString maText;
- XubString maQuickHelpText;
- XubString maHelpText;
- String maCommandStr;
- rtl::OString maHelpId;
- Rectangle maRect;
- Rectangle maCalcRect;
+ Window* mpWindow;
+ void* mpUserData;
+ Image maImage;
+ Image maHighImage;
+ long mnImageAngle;
+ bool mbMirrorMode;
+ XubString maText;
+ XubString maQuickHelpText;
+ XubString maHelpText;
+ String maCommandStr;
+ ULONG mnHelpId;
+ Rectangle maRect;
+ Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
- Size maItemSize;
- long mnSepSize;
+ Size maItemSize;
+ long mnSepSize;
long mnDropDownArrowWidth;
- ToolBoxItemType meType;
- ToolBoxItemBits mnBits;
- TriState meState;
- sal_uInt16 mnId;
- sal_Bool mbEnabled:1,
+ ToolBoxItemType meType;
+ ToolBoxItemBits mnBits;
+ TriState meState;
+ USHORT mnId;
+ 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( sal_uInt16 nItemId, const Image& rImage,
+ ImplToolItem( USHORT nItemId, const Image& rImage,
ToolBoxItemBits nItemBits );
- ImplToolItem( sal_uInt16 nItemId, const XubString& rTxt,
+ ImplToolItem( USHORT nItemId, const XubString& rTxt,
ToolBoxItemBits nItemBits );
- ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
+ ImplToolItem( USHORT 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( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize );
+ Size GetSize( BOOL bHorz, 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, sal_Bool& rbImage, sal_Bool& rbText ) const;
+ void DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, 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( sal_Bool bHorz ) const;
+ Rectangle GetDropDownRect( BOOL bHorz ) const;
- // returns sal_True if the toolbar item is currently clipped, which can happen for docked toolbars
- sal_Bool IsClipped() const;
+ // returns TRUE if the toolbar item is currently clipped, which can happen for docked toolbars
+ BOOL IsClipped() const;
};
namespace vcl
@@ -123,8 +123,8 @@ namespace vcl
struct ToolBoxLayoutData : public ControlLayoutData
{
- std::vector< sal_uInt16 > m_aLineItemIds;
- std::vector< sal_uInt16 > m_aLineItemPositions;
+ std::vector< USHORT > m_aLineItemIds;
+ std::vector< USHORT > m_aLineItemPositions;
};
@@ -133,8 +133,8 @@ struct ToolBoxLayoutData : public ControlLayoutData
struct ImplToolBoxPrivateData
{
- vcl::ToolBoxLayoutData* m_pLayoutData;
- std::vector< ImplToolItem > m_aItems;
+ vcl::ToolBoxLayoutData* m_pLayoutData;
+ std::vector< ImplToolItem > m_aItems;
ImplToolBoxPrivateData();
~ImplToolBoxPrivateData();
@@ -143,35 +143,35 @@ struct ImplToolBoxPrivateData
// called when dropdown items are clicked
Link maDropdownClickHdl;
- Timer maDropdownTimer; // for opening dropdown items on "long click"
+ Timer maDropdownTimer; // for opening dropdown items on "long click"
// large or small buttons ?
ToolBoxButtonSize meButtonSize;
// the optional custom menu
PopupMenu* mpMenu;
- sal_uInt16 maMenuType;
- sal_uIntPtr mnEventId;
+ USHORT maMenuType;
+ ULONG mnEventId;
// called when menu button is clicked and before the popup menu is executed
- Link maMenuButtonHdl;
+ Link maMenuButtonHdl;
// a dummy item representing the custom menu button
ImplToolItem maMenubuttonItem;
long mnMenuButtonWidth;
-
+
Wallpaper maDisplayBackground;
-
+
// support for highcontrast
vcl::IImageListProvider* mpImageListProvider;
vcl::ImageListType meImageListType;
- sal_Bool mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
+ 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,
- mbKeyInputDisabled:1, // no KEY input if all items disabled, closing/docking will be allowed though
- mbIsPaintLocked:1, // don't allow paints
+ mbKeyInputDisabled:1, // no KEY input if all items disabled, closing/docking will be allowed though
+ mbIsPaintLocked:1, // don't allow paints
mbMenubuttonSelected:1, // menu button is highlighted
mbPageScroll:1, // determines if we scroll a page at a time
mbNativeButtons:1, // system supports native toolbar buttons
@@ -180,6 +180,6 @@ struct ImplToolBoxPrivateData
};
-#endif // _SV_TOOLBOX_H
+#endif // _SV_TOOLBOX_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index ccd7c229346b..e6b241729148 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,27 +54,27 @@ namespace vcl
// - ToolBoxCustomizeEvent -
// -------------------------
-#define TOOLBOX_CUSTOMIZE_RESIZE ((sal_uInt16)0xFFFE)
+#define TOOLBOX_CUSTOMIZE_RESIZE ((USHORT)0xFFFE)
class VCL_DLLPUBLIC ToolBoxCustomizeEvent
{
private:
ToolBox* mpTargetBox;
void* mpData;
- sal_uInt16 mnIdFrom;
- sal_uInt16 mnPosTo;
+ USHORT mnIdFrom;
+ USHORT mnPosTo;
public:
ToolBoxCustomizeEvent();
ToolBoxCustomizeEvent( ToolBox* pDropBox,
- sal_uInt16 nId, sal_uInt16 nPos = 0,
+ USHORT nId, USHORT nPos = 0,
void* pUserData = NULL );
ToolBox* GetTargetBox() const { return mpTargetBox; }
- sal_uInt16 GetTargetPos() const { return mnPosTo; }
- sal_uInt16 GetSourceId() const { return mnIdFrom; }
+ USHORT GetTargetPos() const { return mnPosTo; }
+ USHORT GetSourceId() const { return mnIdFrom; }
void* GetData() const { return mpData; }
- sal_Bool IsResized() const;
+ BOOL IsResized() const;
};
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
@@ -86,7 +86,7 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
}
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
- sal_uInt16 nId, sal_uInt16 nPos,
+ USHORT nId, USHORT nPos,
void* pUserData )
{
mpTargetBox = pDropBox;
@@ -95,19 +95,19 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
mpData = pUserData;
}
-inline sal_Bool ToolBoxCustomizeEvent::IsResized() const
+inline BOOL ToolBoxCustomizeEvent::IsResized() const
{
if ( mnPosTo == TOOLBOX_CUSTOMIZE_RESIZE )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -------------------
// - ToolBoxItemBits -
// -------------------
-typedef sal_uInt16 ToolBoxItemBits;
+typedef USHORT ToolBoxItemBits;
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -130,20 +130,20 @@ typedef sal_uInt16 ToolBoxItemBits;
// - ToolBox-Types -
// -----------------
-#define TOOLBOX_STYLE_OUTBUTTON ((sal_uInt16)0x0001)
-#define TOOLBOX_STYLE_HANDPOINTER ((sal_uInt16)0x0002)
-#define TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004)
+#define TOOLBOX_STYLE_OUTBUTTON ((USHORT)0x0001)
+#define TOOLBOX_STYLE_HANDPOINTER ((USHORT)0x0002)
+#define TOOLBOX_STYLE_FLAT ((USHORT)0x0004)
-#define TOOLBOX_APPEND ((sal_uInt16)0xFFFF)
-#define TOOLBOX_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
+#define TOOLBOX_APPEND ((USHORT)0xFFFF)
+#define TOOLBOX_ITEM_NOTFOUND ((USHORT)0xFFFF)
// item ids in the custom menu may not exceed this constant
-#define TOOLBOX_MENUITEM_START ((sal_uInt16)0xE000)
+#define TOOLBOX_MENUITEM_START ((USHORT)0xE000)
// defines for the menubutton
-#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
+#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
// By changes you must also change: rsc/vclrsc.hxx
enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
@@ -170,8 +170,8 @@ class VCL_DLLPUBLIC ToolBox : public DockingWindow
friend class ImplTBDragMgr;
private:
- ImplToolBoxPrivateData* mpData;
- VirtualDevice* mpBtnDev; // TODO: remove unused member
+ ImplToolBoxPrivateData* mpData;
+ VirtualDevice* mpBtnDev; // TODO: remove unused member
ImplToolSizeArray* mpFloatSizeAry;
XubString maCvtStr;
XubString maNextToolBoxStr;
@@ -184,7 +184,7 @@ private:
Rectangle maInDockRect;
Rectangle maPaintRect;
FloatingWindow* mpFloatWin;
- sal_uInt16 mnKeyModifier;
+ USHORT mnKeyModifier;
long mnDX;
long mnDY;
long mnMaxItemWidth; // max item width
@@ -198,22 +198,22 @@ private:
long mnBottomBorder;
long mnLastResizeDY;
long mnActivateCount;
- 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;
+ 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;
unsigned int mbDrag:1,
mbSelection:1,
mbCommandDrag:1,
@@ -230,6 +230,7 @@ private:
mbCustomize:1,
mbCustomizeMode:1,
mbDragging:1,
+ mbHideStatusText:1,
mbMenuStrings:1,
mbIsShift:1,
mbIsKeyEvent:1,
@@ -252,44 +253,43 @@ private:
private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
using DockingWindow::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- 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 );
+ 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 ImplDrawItem( USHORT nPos, BOOL bHighlight = FALSE, BOOL bPaint = FALSE, BOOL bLayout = FALSE );
using Window::ImplInvalidate;
- 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 ImplInvalidate( BOOL bNewCalc = FALSE, BOOL bFullPaint = FALSE );
+ SAL_DLLPRIVATE void ImplUpdateItem( USHORT nIndex = 0xFFFF );
SAL_DLLPRIVATE void ImplStartCustomizeMode();
SAL_DLLPRIVATE void ImplEndCustomizeMode();
SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr );
- 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 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 void ImplShowFocus();
SAL_DLLPRIVATE void ImplHideFocus();
- SAL_DLLPRIVATE void ImplUpdateInputEnable();
- SAL_DLLPRIVATE void ImplFillLayoutData() const;
+ SAL_DLLPRIVATE void ImplUpdateInputEnable();
+ SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE void ImplUpdateCustomMenu();
- SAL_DLLPRIVATE sal_Bool ImplHasClippedItems();
+ SAL_DLLPRIVATE BOOL ImplHasClippedItems();
SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const;
SAL_DLLPRIVATE void ImplExecuteCustomMenu();
- SAL_DLLPRIVATE sal_Bool ImplIsFloatingMode() const;
- SAL_DLLPRIVATE sal_Bool ImplIsInPopupMode() const;
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
+ SAL_DLLPRIVATE BOOL ImplIsFloatingMode() const;
+ SAL_DLLPRIVATE BOOL ImplIsInPopupMode() const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
SAL_DLLPRIVATE Size ImplGetOptimalFloatingSize( FloatingSizeMode eMode );
- SAL_DLLPRIVATE sal_Bool ImplHasExternalMenubutton();
+ SAL_DLLPRIVATE 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( sal_Bool bStart, FloatingWindow* pWindow = NULL );
+ SAL_DLLPRIVATE void ImplFloatControl( 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 sal_Bool ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
+ static SAL_DLLPRIVATE 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, sal_Bool bIsInPopupMode );
+ static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode );
static SAL_DLLPRIVATE void ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect );
- static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight = sal_False, sal_Bool bHasOpenPopup = sal_False );
+ static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight = FALSE, BOOL bHasOpenPopup = 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, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 );
+ static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode = 0 );
static SAL_DLLPRIVATE void ImplCalcFloatSizes( ToolBox* pThis );
- static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines );
+ static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines );
static SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMaxSize );
static SAL_DLLPRIVATE void ImplSetMinMaxFloatSize( ToolBox *pThis );
- 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,
+ 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,
long nSize = 6 );
static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
+ BOOL bLeft = FALSE, BOOL bTop = FALSE,
long nSize = 6 );
- static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight );
- static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis );
+ static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight );
+ static SAL_DLLPRIVATE USHORT ImplCountLineBreaks( const ToolBox *pThis );
SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
protected:
- void SetCurItemId(sal_uInt16 nSet) { mnCurItemId = nSet; }
+ void SetCurItemId(USHORT nSet) { mnCurItemId = nSet; }
public:
ToolBox( Window* pParent, WinBits nStyle = 0 );
@@ -375,42 +375,42 @@ public:
virtual void LoseFocus();
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual sal_Bool PrepareToggleFloatingMode();
+ virtual BOOL PrepareToggleFloatingMode();
virtual void ToggleFloatingMode();
virtual void StartDocking();
- virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
virtual void Resizing( Size& rSize );
void InsertItem( const ResId& rResId,
- sal_uInt16 nPos = TOOLBOX_APPEND );
- void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ USHORT nPos = TOOLBOX_APPEND );
+ void InsertItem( USHORT nItemId, const Image& rImage,
ToolBoxItemBits nBits = 0,
- sal_uInt16 nPos = TOOLBOX_APPEND );
- void InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ USHORT nPos = TOOLBOX_APPEND );
+ void InsertItem( USHORT nItemId, const Image& rImage,
const XubString& rText,
ToolBoxItemBits nBits = 0,
- sal_uInt16 nPos = TOOLBOX_APPEND );
- void InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ USHORT nPos = TOOLBOX_APPEND );
+ void InsertItem( USHORT nItemId, const XubString& rText,
ToolBoxItemBits nBits = 0,
- sal_uInt16 nPos = TOOLBOX_APPEND );
- void InsertWindow( sal_uInt16 nItemId, Window* pWindow,
+ USHORT nPos = TOOLBOX_APPEND );
+ void InsertWindow( USHORT nItemId, Window* pWindow,
ToolBoxItemBits nBits = 0,
- 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 );
+ 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 );
void CopyItems( const ToolBox& rToolBox );
void Clear();
void RecalcItems();
const ImageList& GetImageList() const { return maImageList; }
- void SetImageList( const ImageList& rImageList );
+ void SetImageList( const ImageList& rImageList );
void SetButtonType( ButtonType eNewType = BUTTON_SYMBOL );
ButtonType GetButtonType() const { return meButtonType; }
@@ -421,106 +421,106 @@ public:
void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
WindowAlign GetAlign() const { return meAlign; }
- sal_Bool IsHorizontal() const { return mbHorz; }
+ BOOL IsHorizontal() const { return mbHorz; }
- void SetLineCount( sal_uInt16 nNewLines );
- sal_uInt16 GetLineCount() const { return mnLines; }
- sal_uInt16 GetCurLine() const { return mnCurLine; }
- void ShowLine( sal_Bool bNext );
+ void SetLineCount( USHORT nNewLines );
+ USHORT GetLineCount() const { return mnLines; }
+ USHORT GetCurLine() const { return mnCurLine; }
+ void ShowLine( BOOL bNext );
// Used to enable/disable scrolling one page at a time for toolbar
- void SetPageScroll( sal_Bool b );
- sal_Bool GetPageScroll();
+ void SetPageScroll( BOOL b );
+ BOOL GetPageScroll();
void SetNextToolBox( const XubString& rStr );
const XubString& GetNextToolBox() const { return maNextToolBoxStr; }
- 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;
+ 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;
// retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
- Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
+ Point GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const;
Rectangle GetScrollRect() const;
Rectangle GetMenubuttonRect() const;
- 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; }
+ 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; }
void StartSelection();
void EndSelection();
- void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True );
- sal_Bool IsItemDown( sal_uInt16 nItemId ) const;
+ void SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease = TRUE );
+ BOOL IsItemDown( USHORT nItemId ) const;
- void SetItemState( sal_uInt16 nItemId, TriState eState );
- TriState GetItemState( sal_uInt16 nItemId ) const;
+ void SetItemState( USHORT nItemId, TriState eState );
+ TriState GetItemState( USHORT nItemId ) const;
- void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
- sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
+ void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
+ BOOL IsItemChecked( USHORT nItemId ) const;
- void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
- sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+ void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
+ BOOL IsItemEnabled( 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 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 SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
+ void SetItemCommand( USHORT nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( USHORT nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
+ void SetQuickHelpText( USHORT nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
+ const XubString& GetQuickHelpText( USHORT nItemId ) const;
- void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
- const XubString& GetHelpText( sal_uInt16 nItemId ) const;
+ void SetHelpText( USHORT nItemId, const XubString& rText );
+ const XubString& GetHelpText( USHORT nItemId ) const;
- void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
- rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
+ void SetHelpId( USHORT nItemId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT 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( sal_uInt16 nCalcLines ) const;
+ Size CalcWindowSizePixel( USHORT nCalcLines ) const;
// window size according to current floating state and a given number of lines and a given alignment
- Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const;
+ Size CalcWindowSizePixel( USHORT 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( sal_uInt16 nCalcLines ) const;
+ Size CalcFloatingWindowSizePixel( USHORT 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( sal_uInt16 nFloatLines );
- sal_uInt16 GetFloatingLines() const;
+ void SetFloatingLines( USHORT nFloatLines );
+ USHORT 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( sal_Bool bLock = sal_True );
+ void Lock( BOOL bLock = TRUE );
// read configuration to determine locking behaviour
- static sal_Bool AlwaysLocked();
+ static BOOL AlwaysLocked();
- void EnableMenuStrings( sal_Bool bEnable = sal_True ) { mbMenuStrings = (bEnable != 0); }
- sal_Bool IsMenuStringsEnabled() const { return mbMenuStrings; }
+ void EnableMenuStrings( BOOL bEnable = TRUE ) { mbMenuStrings = (bEnable != 0); }
+ BOOL IsMenuStringsEnabled() const { return mbMenuStrings; }
- void SetOutStyle( sal_uInt16 nNewStyle );
- sal_uInt16 GetOutStyle() const { return mnOutStyle; }
+ void SetOutStyle( USHORT nNewStyle );
+ USHORT GetOutStyle() const { return mnOutStyle; }
- void EnableCustomize( sal_Bool bEnable = sal_True );
- sal_Bool IsCustomize() { return mbCustomize; }
+ void EnableCustomize( BOOL bEnable = TRUE );
+ BOOL IsCustomize() { return mbCustomize; }
void StartCustomize( const Rectangle& rRect, void* pData = NULL );
- void SetCustomizeMode( sal_Bool );
- sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; }
+ void SetCustomizeMode( BOOL );
+ BOOL IsInCustomizeMode() const { return mbCustomizeMode; }
static void StartCustomizeMode();
static void EndCustomizeMode();
- static sal_Bool IsCustomizeMode();
+ static BOOL IsCustomizeMode();
void SetHelpText( const XubString& rText )
{ DockingWindow::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( const rtl::OString& rId )
- { DockingWindow::SetHelpId( rId ); }
- const rtl::OString& GetHelpId() const
+ void SetHelpId( ULONG nId )
+ { DockingWindow::SetHelpId( nId ); }
+ ULONG 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( sal_uInt16 aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
- sal_uInt16 GetMenuType() const;
- sal_Bool IsMenuEnabled() const;
+ void SetMenuType( USHORT aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
+ USHORT GetMenuType() const;
+ BOOL IsMenuEnabled() const;
PopupMenu* GetMenu() const;
void SetMenuButtonHdl( const Link& rLink );
const Link& GetMenuButtonHdl() const;
@@ -606,13 +606,13 @@ public:
void ExecuteCustomMenu();
// allow Click Handler to detect special key
- bool IsShift() const { return mbIsShift; }
+ BOOL IsShift() const { return mbIsShift; }
// allow Click Handler to distinguish between mouse and key input
- sal_Bool IsKeyEvent() const { return mbIsKeyEvent; }
+ BOOL IsKeyEvent() const { return mbIsKeyEvent; }
// allows framework to set/query the planned popupmode
- sal_Bool WillUsePopupMode() const;
- void WillUsePopupMode( sal_Bool b);
+ BOOL WillUsePopupMode() const;
+ void WillUsePopupMode( 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( sal_uInt16 nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( USHORT 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, sal_uInt16& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, USHORT& 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
- sal_uInt16 GetDisplayItemId( long nText ) const;
+ USHORT GetDisplayItemId( long nText ) const;
const Size& GetDefaultImageSize() const;
- void ChangeHighlight( sal_uInt16 nPos );
+ void ChangeHighlight( USHORT nPos );
void SetImageListProvider(vcl::IImageListProvider* _pProvider);
};
-inline void ToolBox::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
+inline void ToolBox::CheckItem( USHORT nItemId, BOOL bCheck )
{
SetItemState( nItemId, (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline sal_Bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
+inline BOOL ToolBox::IsItemChecked( USHORT nItemId ) const
{
return (GetItemState( nItemId ) == STATE_CHECK);
}
@@ -666,12 +666,12 @@ inline void ToolBox::SetDockingRects( const Rectangle& rOutRect,
maInDockRect = rInRect;
}
-inline void ToolBox::SetFloatingLines( sal_uInt16 nNewLines )
+inline void ToolBox::SetFloatingLines( USHORT nNewLines )
{
mnFloatLines = nNewLines;
}
-inline sal_uInt16 ToolBox::GetFloatingLines() const
+inline USHORT ToolBox::GetFloatingLines() const
{
return mnFloatLines;
}
diff --git a/vcl/inc/vcl/unobrok.hxx b/vcl/inc/vcl/unobrok.hxx
index 67c83ea83952..91916f4dfebe 100644
--- a/vcl/inc/vcl/unobrok.hxx
+++ b/vcl/inc/vcl/unobrok.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,6 +37,6 @@ namespace vcl_accept
sal_Bool accept(const ::rtl::OUString & accDcp, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> & rSMgr);
}
-#endif // _UNOBROK_HXX
+#endif // _UNOBROK_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/unohelp.hxx b/vcl/inc/vcl/unohelp.hxx
index 823ee477355a..1dc6c226db22 100644
--- a/vcl/inc/vcl/unohelp.hxx
+++ b/vcl/inc/vcl/unohelp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,7 +42,7 @@ namespace i18n {
class XCollator;
}
namespace lang {
- class XMultiServiceFactory;
+ class XMultiServiceFactory;
}
}}}
@@ -50,27 +50,22 @@ namespace com {
namespace sun {
namespace star {
namespace accessibility {
- struct AccessibleEventObject;
+ struct AccessibleEventObject;
}
}}}
-namespace comphelper {
- namespace string {
- class NaturalStringSorter;
-}}
-
namespace vcl
{
namespace unohelper
{
-VCL_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetMultiServiceFactory();
-VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > CreateBreakIterator();
-VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> CreateCharacterClassification();
-//Get access to singleton Natural String Sorter collating for Application::GetLocale
-VCL_DLLPUBLIC const comphelper::string::NaturalStringSorter& getNaturalStringSorterForAppLocale();
-VCL_DLLPUBLIC ::rtl::OUString CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD );
-VCL_DLLPUBLIC void NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject );
-}} // namespace vcl::unohelper
+
+::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > VCL_DLLPUBLIC GetMultiServiceFactory();
+::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > VCL_DLLPUBLIC CreateBreakIterator();
+::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> VCL_DLLPUBLIC CreateCharacterClassification();
+::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCollator > VCL_DLLPUBLIC CreateCollator();
+::rtl::OUString VCL_DLLPUBLIC CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD );
+void VCL_DLLPUBLIC NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject );
+}} // namespace vcl::unohelper
#endif // _VCL_UNOHELP_HXX
diff --git a/vcl/inc/vcl/unohelp2.hxx b/vcl/inc/vcl/unohelp2.hxx
index 5824f016c57c..0a51a5eb909e 100644
--- a/vcl/inc/vcl/unohelp2.hxx
+++ b/vcl/inc/vcl/unohelp2.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,18 +46,18 @@ namespace vcl { namespace unohelper {
public ::cppu::OWeakObject
{
private:
- String maText;
+ String maText;
- public:
+ public:
TextDataObject( const String& rText );
~TextDataObject();
- String& GetString() { return maText; }
+ String& GetString() { return maText; }
// ::com::sun::star::uno::XInterface
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
- void SAL_CALL release() throw() { OWeakObject::release(); }
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
+ void SAL_CALL release() throw() { OWeakObject::release(); }
// ::com::sun::star::datatransfer::XTransferable
::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
@@ -79,7 +79,7 @@ namespace vcl { namespace unohelper {
::osl::Mutex& GetMutex() { return maMutex; }
};
-}} // namespace vcl::unohelper
+}} // namespace vcl::unohelper
#endif // _VCL_UNOHELP2_HXX
diff --git a/vcl/inc/vcl/unowrap.hxx b/vcl/inc/vcl/unowrap.hxx
index 3691014d7477..258b49f59cce 100644
--- a/vcl/inc/vcl/unowrap.hxx
+++ b/vcl/inc/vcl/unowrap.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,17 +34,17 @@
#include <com/sun/star/uno/Reference.h>
class XWindowPeer;
-class XToolkit;
-class XVclToolkit;
-class EventList;
+class XToolkit;
+class XVclToolkit;
+class EventList;
class Window;
-class OutputDevice;
+class OutputDevice;
class MouseEvent;
class CommandEvent;
class KeyEvent;
class Rectangle;
class XVclComponentPeer;
-class Menu;
+class Menu;
namespace com {
namespace sun {
@@ -68,27 +68,27 @@ namespace accessibility {
class VCL_DLLPUBLIC UnoWrapperBase
{
-public:
- virtual void Destroy() = 0;
+public:
+ virtual void Destroy() = 0;
// Toolkit
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit() = 0;
// Graphics
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateGraphics( OutputDevice* pOutDev ) = 0;
- virtual void ReleaseAllGraphics( OutputDevice* pOutDev ) = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateGraphics( OutputDevice* pOutDev ) = 0;
+ virtual void ReleaseAllGraphics( OutputDevice* pOutDev ) = 0;
// Window
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window* pWindow, sal_Bool bCreate ) = 0;
- virtual void SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ) = 0;
+ virtual void SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ) = 0;
- virtual void WindowDestroyed( Window* pWindow ) = 0;
+ virtual void WindowDestroyed( Window* pWindow ) = 0;
// Accessibility
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
CreateAccessible( Menu* pMenu, sal_Bool bIsMenuBar ) = 0;
};
-#endif // _VCL_UNOWRAP_HXX
+#endif // _VCL_UNOWRAP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/vclenum.hxx b/vcl/inc/vcl/vclenum.hxx
index 80b84b2fb0f2..6fac4e31c438 100644
--- a/vcl/inc/vcl/vclenum.hxx
+++ b/vcl/inc/vcl/vclenum.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -67,13 +67,13 @@ enum ExtDateFieldFormat { XTDATEF_SYSTEM_SHORT, XTDATEF_SYSTEM_SHORT_YY, XTDATEF
// ------------------------------------------------------------
// to avoid conflicts with enum's declared otherwise
-#define GRADIENT_LINEAR GradientStyle_LINEAR
-#define GRADIENT_AXIAL GradientStyle_AXIAL
-#define GRADIENT_RADIAL GradientStyle_RADIAL
-#define GRADIENT_ELLIPTICAL GradientStyle_ELLIPTICAL
-#define GRADIENT_SQUARE GradientStyle_SQUARE
-#define GRADIENT_RECT GradientStyle_RECT
-#define GRADIENT_FORCE_EQUAL_SIZE GradientStyle_FORCE_EQUAL_SIZE
+#define GRADIENT_LINEAR GradientStyle_LINEAR
+#define GRADIENT_AXIAL GradientStyle_AXIAL
+#define GRADIENT_RADIAL GradientStyle_RADIAL
+#define GRADIENT_ELLIPTICAL GradientStyle_ELLIPTICAL
+#define GRADIENT_SQUARE GradientStyle_SQUARE
+#define GRADIENT_RECT GradientStyle_RECT
+#define GRADIENT_FORCE_EQUAL_SIZE GradientStyle_FORCE_EQUAL_SIZE
#ifndef ENUM_GRADIENTSTYLE_DECLARED
#define ENUM_GRADIENTSTYLE_DECLARED
@@ -94,10 +94,10 @@ enum GradientStyle
// ------------------------------------------------------------
// to avoid conflicts with enum's declared otherwise
-#define HATCH_SINGLE HatchStyle_SINGLE
-#define HATCH_DOUBLE HatchStyle_DOUBLE
-#define HATCH_TRIPLE HatchStyle_TRIPLE
-#define HATCH_FORCE_EQUAL_SIZE HatchStyle_FORCE_EQUAL_SIZE
+#define HATCH_SINGLE HatchStyle_SINGLE
+#define HATCH_DOUBLE HatchStyle_DOUBLE
+#define HATCH_TRIPLE HatchStyle_TRIPLE
+#define HATCH_FORCE_EQUAL_SIZE HatchStyle_FORCE_EQUAL_SIZE
#ifndef ENUM_HATCHSTYLE_DECLARED
#define ENUM_HATCHSTYLE_DECLARED
@@ -115,10 +115,10 @@ enum HatchStyle
// ------------------------------------------------------------
// to avoid conflicts with enum's declared otherwise
-#define LINE_NONE LineStyle_NONE
-#define LINE_SOLID LineStyle_SOLID
-#define LINE_DASH LineStyle_DASH
-#define LINE_FORCE_EQUAL_SIZE LineStyle_FORCE_EQUAL_SIZE
+#define LINE_NONE LineStyle_NONE
+#define LINE_SOLID LineStyle_SOLID
+#define LINE_DASH LineStyle_DASH
+#define LINE_FORCE_EQUAL_SIZE LineStyle_FORCE_EQUAL_SIZE
#ifndef ENUM_LINESTYLE_DECLARED
#define ENUM_LINESTYLE_DECLARED
@@ -240,21 +240,21 @@ enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
#ifndef ENUM_FONTEMPHASISMARK_DECLARED
#define ENUM_FONTEMPHASISMARK_DECLARED
-typedef sal_uInt16 FontEmphasisMark;
-#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
-#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
-#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
-#define EMPHASISMARK_DISC ((FontEmphasisMark)0x0003)
-#define EMPHASISMARK_ACCENT ((FontEmphasisMark)0x0004)
-#define EMPHASISMARK_STYLE ((FontEmphasisMark)0x00FF)
-#define EMPHASISMARK_POS_ABOVE ((FontEmphasisMark)0x1000)
-#define EMPHASISMARK_POS_BELOW ((FontEmphasisMark)0x2000)
+typedef USHORT FontEmphasisMark;
+#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
+#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
+#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
+#define EMPHASISMARK_DISC ((FontEmphasisMark)0x0003)
+#define EMPHASISMARK_ACCENT ((FontEmphasisMark)0x0004)
+#define EMPHASISMARK_STYLE ((FontEmphasisMark)0x00FF)
+#define EMPHASISMARK_POS_ABOVE ((FontEmphasisMark)0x1000)
+#define EMPHASISMARK_POS_BELOW ((FontEmphasisMark)0x2000)
// Only for kompability
-#define EMPHASISMARK_DOTS_ABOVE (EMPHASISMARK_DOT | EMPHASISMARK_POS_ABOVE)
-#define EMPHASISMARK_DOTS_BELOW (EMPHASISMARK_DOT | EMPHASISMARK_POS_BELOW)
-#define EMPHASISMARK_SIDE_DOTS (EMPHASISMARK_ACCENT | EMPHASISMARK_POS_ABOVE)
-#define EMPHASISMARK_CIRCLE_ABOVE (EMPHASISMARK_CIRCLE | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_DOTS_ABOVE (EMPHASISMARK_DOT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_DOTS_BELOW (EMPHASISMARK_DOT | EMPHASISMARK_POS_BELOW)
+#define EMPHASISMARK_SIDE_DOTS (EMPHASISMARK_ACCENT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_CIRCLE_ABOVE (EMPHASISMARK_CIRCLE | EMPHASISMARK_POS_ABOVE)
#endif
@@ -317,7 +317,7 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE,
#endif
-typedef sal_uInt32 sal_UCS4; // TODO: this should be moved to rtl
+typedef sal_uInt32 sal_UCS4; // TODO: this should be moved to rtl
#ifndef ENUM_OUTDEVSUPPORT_DECLARED
#define ENUM_OUTDEVSUPPORT_DECLARED
@@ -326,6 +326,6 @@ enum OutDevSupportType { OutDevSupport_TransparentRect, OutDevSupport_B2DClip, O
#endif
-#endif // _VCL_VCLENUM_HXX
+#endif // _VCL_VCLENUM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx
index c7347f7cd978..f4cc2f5afff8 100644
--- a/vcl/inc/vcl/vclevent.hxx
+++ b/vcl/inc/vcl/vclevent.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -109,14 +109,14 @@ namespace com { namespace sun { namespace star {
#define VCLEVENT_LISTBOX_SCROLLED 1127
#define VCLEVENT_COMBOBOX_SCROLLED 1128
#define VCLEVENT_EDIT_SELECTIONCHANGED 1129
-#define VCLEVENT_DROPDOWN_OPEN 1130
-#define VCLEVENT_DROPDOWN_CLOSE 1131
+#define VCLEVENT_DROPDOWN_OPEN 1130
+#define VCLEVENT_DROPDOWN_CLOSE 1131
#define VCLEVENT_TOOLBOX_ITEMADDED 1132 // pData = itempos
#define VCLEVENT_TOOLBOX_ITEMREMOVED 1133 // pData = itempos
#define VCLEVENT_TOOLBOX_ALLITEMSCHANGED 1134
#define VCLEVENT_TOOLBOX_HIGHLIGHTOFF 1135 // pData = itempos
-#define VCLEVENT_WINDOW_MENUBARADDED 1136 // pData = pMenuBar
+#define VCLEVENT_WINDOW_MENUBARADDED 1136 // pData = pMenuBar
#define VCLEVENT_TABPAGE_ACTIVATE 1137 // pData = pageid
#define VCLEVENT_TABPAGE_DEACTIVATE 1138 // pData = pageid
#define VCLEVENT_TABBAR_PAGEENABLED 1139 // pData = pageid
@@ -146,8 +146,8 @@ namespace com { namespace sun { namespace star {
#define VCLEVENT_STATUSBAR_HIDEITEM 1163 // pData = itemid
#define VCLEVENT_STATUSBAR_SHOWALLITEMS 1164
#define VCLEVENT_STATUSBAR_HIDEALLITEMS 1165
-#define VCLEVENT_STATUSBAR_DRAWITEM 1166 // pData = itemid
-#define VCLEVENT_STATUSBAR_NAMECHANGED 1167 // pData = itemid
+#define VCLEVENT_STATUSBAR_DRAWITEM 1166 // pData = itemid
+#define VCLEVENT_STATUSBAR_NAMECHANGED 1167 // pData = itemid
#define VCLEVENT_TOOLBOX_ITEMENABLED 1168 // pData = itempos
#define VCLEVENT_TOOLBOX_ITEMDISABLED 1169 // pData = itempos
#define VCLEVENT_TABPAGE_PAGETEXTCHANGED 1170 // pData = pageid
@@ -173,10 +173,10 @@ namespace com { namespace sun { namespace star {
#define VCLEVENT_MENU_SUBMENUCHANGED 1209
#define VCLEVENT_MENU_DEHIGHLIGHT 1210
#define VCLEVENT_MENU_DISABLE 1211
-#define VCLEVENT_MENU_ITEMTEXTCHANGED 1212
-#define VCLEVENT_MENU_ITEMCHECKED 1213
-#define VCLEVENT_MENU_ITEMUNCHECKED 1214
-#define VCLEVENT_MENU_ACCESSIBLENAMECHANGED 1215
+#define VCLEVENT_MENU_ITEMTEXTCHANGED 1212
+#define VCLEVENT_MENU_ITEMCHECKED 1213
+#define VCLEVENT_MENU_ITEMUNCHECKED 1214
+#define VCLEVENT_MENU_ACCESSIBLENAMECHANGED 1215
#define VCLEVENT_MENU_SHOW 1250
#define VCLEVENT_MENU_HIDE 1251
@@ -187,24 +187,24 @@ 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 = sal_Bool
+#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = BOOL
#define VCLEVENT_WINDOW_TOGGLEFLOATING 1221
#define VCLEVENT_WINDOW_ENDPOPUPMODE 1222 // pData = EndPopupModeData
#define VCLEVENT_TOOLBOX_BUTTONSTATECHANGED 1223 // pData = itempos
#define VCLEVENT_TABLECELL_NAMECHANGED 1224 // pData = struct(Entry, Column, oldText)
-#define VCLEVENT_TABLEROW_SELECT 1225
+#define VCLEVENT_TABLEROW_SELECT 1225
class VCL_DLLPUBLIC VclSimpleEvent
{
private:
- sal_uLong nId;
+ ULONG nId;
public:
- VclSimpleEvent( sal_uLong n ) { nId = n; }
+ VclSimpleEvent( ULONG n ) { nId = n; }
TYPEINFO();
- sal_uLong GetId() const { return nId; }
+ ULONG GetId() const { return nId; }
};
class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent
@@ -214,7 +214,7 @@ private:
void* pData;
public:
- VclWindowEvent( Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
+ VclWindowEvent( Window* pWin, 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, sal_uLong n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
+ VclMouseEvent( Window* pWin, 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;
- sal_uInt16 mnPos;
+ USHORT mnPos;
public:
- VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
+ VclMenuEvent( Menu* pM, ULONG n, USHORT nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
TYPEINFO();
Menu* GetMenu() const { return pMenu; }
- sal_uInt16 GetItemPos() const { return mnPos; }
+ USHORT GetItemPos() const { return mnPos; }
};
class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
{
public:
- VclAccessibleEvent( sal_uLong n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+ VclAccessibleEvent( 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;
@@ -260,19 +260,15 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
};
-class VCL_DLLPUBLIC VclEventListeners
+class VCL_DLLPUBLIC VclEventListeners : public std::list<Link>
{
public:
void Call( VclSimpleEvent* pEvent ) const;
// stops notifying when any handler has processed the event
- // 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:
- std::list<Link> m_aListeners;
+ // and returns TRUE in that case
+ // a handler must return TRUE to signal that it has processed the event
+ BOOL Process( VclSimpleEvent* pEvent ) const;
};
class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier
@@ -283,7 +279,7 @@ class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier
{
std::list< Link >::iterator m_aIt;
bool m_bWasInvalidated;
-
+
ListenerIt(const std::list<Link>::iterator& rIt)
: m_aIt(rIt)
, m_bWasInvalidated( false )
@@ -291,15 +287,15 @@ class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier
};
std::vector< ListenerIt > m_aIterators;
-
-
+
+
public:
VclEventListeners2();
~VclEventListeners2();
-
+
void addListener( const Link& );
void removeListener( const Link& );
-
+
void callListeners( VclSimpleEvent* );
};
diff --git a/vcl/inc/vcl/virdev.hxx b/vcl/inc/vcl/virdev.hxx
index 79b8233cf964..c73713cc6788 100644
--- a/vcl/inc/vcl/virdev.hxx
+++ b/vcl/inc/vcl/virdev.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,35 +47,35 @@ class VCL_DLLPUBLIC VirtualDevice : public OutputDevice
friend class OutputDevice;
private:
- SalVirtualDevice* mpVirDev;
- VirtualDevice* mpPrev;
- VirtualDevice* mpNext;
- sal_uInt16 mnBitCount;
- sal_Bool mbScreenComp;
- sal_Int8 mnAlphaDepth;
- sal_uInt8 meRefDevMode;
+ SalVirtualDevice* mpVirDev;
+ VirtualDevice* mpPrev;
+ VirtualDevice* mpNext;
+ USHORT mnBitCount;
+ BOOL mbScreenComp;
+ sal_Int8 mnAlphaDepth;
+ BYTE meRefDevMode;
- 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 );
+ 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 );
// Copy assignment is forbidden and not implemented.
VirtualDevice (const VirtualDevice &);
VirtualDevice & operator= (const VirtualDevice &);
- /** Used for alpha VDev, to set areas to opaque
+ /** Used for alpha VDev, to set areas to opaque
@since #i32109#
*/
- SAL_DLLPRIVATE void ImplFillOpaqueRectangle( const Rectangle& rRect );
+ SAL_DLLPRIVATE void ImplFillOpaqueRectangle( const Rectangle& rRect );
// TODO: add extra member for refdev backward compatibility options
#define REFDEV_FORCE_ZERO_EXTLEAD 0x80
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
- VirtualDevice( sal_uInt16 nBitCount = 0 );
+ VirtualDevice( USHORT nBitCount = 0 );
VirtualDevice( const OutputDevice& rCompDev,
- sal_uInt16 nBitCount = 0 );
+ USHORT 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,
- sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount );
+ USHORT nBitCount, USHORT 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, sal_uInt16 nBitCount );
+ VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount );
- virtual ~VirtualDevice();
+ virtual ~VirtualDevice();
- sal_Bool SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase = sal_True );
- sal_Bool SetOutputSize( const Size& rNewSize, sal_Bool bErase = sal_True )
+ BOOL SetOutputSizePixel( const Size& rNewSize, BOOL bErase = TRUE );
+ BOOL SetOutputSize( const Size& rNewSize, BOOL bErase = TRUE )
{ return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
// reference device modes for different compatibility levels
@@ -119,7 +119,7 @@ public:
void SetReferenceDevice( RefDevMode );
void Compat_ZeroExtleadBug(); // enable workaround for #i60495#
-
+
void SetReferenceDevice( sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
private:
diff --git a/vcl/inc/vcl/waitobj.hxx b/vcl/inc/vcl/waitobj.hxx
index 1bbdd04506e9..ee9874569f02 100644
--- a/vcl/inc/vcl/waitobj.hxx
+++ b/vcl/inc/vcl/waitobj.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx
index 66a2a11038ed..e69314ade2f4 100644
--- a/vcl/inc/vcl/wall.hxx
+++ b/vcl/inc/vcl/wall.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,37 +42,37 @@ class ImplWallpaper;
// - Wallpaper-Types -
// -------------------
-#define WALLPAPER_NULL WallpaperStyle_NULL
-#define WALLPAPER_TILE WallpaperStyle_TILE
-#define WALLPAPER_CENTER WallpaperStyle_CENTER
-#define WALLPAPER_SCALE WallpaperStyle_SCALE
-#define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
-#define WALLPAPER_TOP WallpaperStyle_TOP
-#define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
-#define WALLPAPER_LEFT WallpaperStyle_LEFT
-#define WALLPAPER_RIGHT WallpaperStyle_RIGHT
-#define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
-#define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
-#define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
-#define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
-#define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
+#define WALLPAPER_NULL WallpaperStyle_NULL
+#define WALLPAPER_TILE WallpaperStyle_TILE
+#define WALLPAPER_CENTER WallpaperStyle_CENTER
+#define WALLPAPER_SCALE WallpaperStyle_SCALE
+#define WALLPAPER_TOPLEFT WallpaperStyle_TOPLEFT
+#define WALLPAPER_TOP WallpaperStyle_TOP
+#define WALLPAPER_TOPRIGHT WallpaperStyle_TOPRIGHT
+#define WALLPAPER_LEFT WallpaperStyle_LEFT
+#define WALLPAPER_RIGHT WallpaperStyle_RIGHT
+#define WALLPAPER_BOTTOMLEFT WallpaperStyle_BOTTOMLEFT
+#define WALLPAPER_BOTTOM WallpaperStyle_BOTTOM
+#define WALLPAPER_BOTTOMRIGHT WallpaperStyle_BOTTOMRIGHT
+#define WALLPAPER_APPLICATIONGRADIENT WallpaperStyle_APPLICATIONGRADIENT
+#define WALLPAPER_FORCE_EQUAL_SIZE WallpaperStyle_FORCE_EQUAL_SIZE
#ifndef ENUM_WALLPAPERSTYLE_DECLARED
#define ENUM_WALLPAPERSTYLE_DECLARED
-enum WallpaperStyle
+enum WallpaperStyle
{
- WALLPAPER_NULL,
+ WALLPAPER_NULL,
WALLPAPER_TILE,
WALLPAPER_CENTER,
WALLPAPER_SCALE,
- WALLPAPER_TOPLEFT,
- WALLPAPER_TOP,
+ WALLPAPER_TOPLEFT,
+ WALLPAPER_TOP,
WALLPAPER_TOPRIGHT,
- WALLPAPER_LEFT,
+ WALLPAPER_LEFT,
WALLPAPER_RIGHT,
- WALLPAPER_BOTTOMLEFT,
- WALLPAPER_BOTTOM,
+ WALLPAPER_BOTTOMLEFT,
+ WALLPAPER_BOTTOM,
WALLPAPER_BOTTOMRIGHT,
WALLPAPER_APPLICATIONGRADIENT, // defines a gradient that internally covers the whole application
// and uses a color derived from the face color
@@ -88,9 +88,9 @@ enum WallpaperStyle
class VCL_DLLPUBLIC Wallpaper
{
private:
- ImplWallpaper* mpImplWallpaper;
+ ImplWallpaper* mpImplWallpaper;
- SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
+ SAL_DLLPRIVATE void ImplMakeUnique( BOOL bReleaseCache = TRUE );
SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
public:
@@ -105,41 +105,41 @@ public:
Wallpaper( const Gradient& rGradient );
~Wallpaper();
- void SetColor( const Color& rColor );
- const Color& GetColor() const;
+ void SetColor( const Color& rColor );
+ const Color& GetColor() const;
- void SetStyle( WallpaperStyle eStyle );
- WallpaperStyle GetStyle() const;
+ void SetStyle( WallpaperStyle eStyle );
+ WallpaperStyle GetStyle() const;
- void SetBitmap( const BitmapEx& rBitmap );
- void SetBitmap();
- BitmapEx GetBitmap() const;
- sal_Bool IsBitmap() const;
+ void SetBitmap( const BitmapEx& rBitmap );
+ void SetBitmap();
+ BitmapEx GetBitmap() const;
+ BOOL IsBitmap() const;
- void SetGradient( const Gradient& rGradient );
- void SetGradient();
- Gradient GetGradient() const;
- sal_Bool IsGradient() const;
+ void SetGradient( const Gradient& rGradient );
+ void SetGradient();
+ Gradient GetGradient() const;
+ BOOL IsGradient() const;
- void SetRect( const Rectangle& rRect );
- void SetRect();
- Rectangle GetRect() const;
- sal_Bool IsRect() const;
+ void SetRect( const Rectangle& rRect );
+ void SetRect();
+ Rectangle GetRect() const;
+ BOOL IsRect() const;
- sal_Bool IsFixed() const;
- sal_Bool IsScrollable() const;
+ BOOL IsFixed() const;
+ BOOL IsScrollable() const;
- Wallpaper& operator=( const Wallpaper& rWallpaper );
- sal_Bool operator==( const Wallpaper& rWallpaper ) const;
- sal_Bool operator!=( const Wallpaper& rWallpaper ) const
+ Wallpaper& operator=( const Wallpaper& rWallpaper );
+ BOOL operator==( const Wallpaper& rWallpaper ) const;
+ BOOL operator!=( const Wallpaper& rWallpaper ) const
{ return !(Wallpaper::operator==( rWallpaper )); }
- sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
+ BOOL IsSameInstance( const Wallpaper& rWallpaper ) const
{ return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper );
};
-#endif // _SV_WALL_HXX
+#endif // _SV_WALL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/wall2.hxx b/vcl/inc/vcl/wall2.hxx
index 162614262095..df95c48e6385 100644
--- a/vcl/inc/vcl/wall2.hxx
+++ b/vcl/inc/vcl/wall2.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,13 +36,13 @@ class ImplWallpaper
friend class Wallpaper;
private:
- Color maColor;
- BitmapEx* mpBitmap;
- Gradient* mpGradient;
- Rectangle* mpRect;
- WallpaperStyle meStyle;
- sal_uLong mnRefCount;
- BitmapEx* mpCache;
+ Color maColor;
+ BitmapEx* mpBitmap;
+ Gradient* mpGradient;
+ Rectangle* mpRect;
+ WallpaperStyle meStyle;
+ ULONG mnRefCount;
+ BitmapEx* mpCache;
friend SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper );
friend SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper );
@@ -52,12 +52,12 @@ public:
ImplWallpaper( const ImplWallpaper& rImplWallpaper );
~ImplWallpaper();
- void ImplSetCachedBitmap( BitmapEx& rBmp );
- const BitmapEx* ImplGetCachedBitmap() { return mpCache; }
- void ImplReleaseCachedBitmap();
+ void ImplSetCachedBitmap( BitmapEx& rBmp );
+ const BitmapEx* ImplGetCachedBitmap() { return mpCache; }
+ void ImplReleaseCachedBitmap();
};
-#endif // _SV_WALL2_HXX
+#endif // _SV_WALL2_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/windata.hxx b/vcl/inc/vcl/windata.hxx
new file mode 100644
index 000000000000..65a8acadbb92
--- /dev/null
+++ b/vcl/inc/vcl/windata.hxx
@@ -0,0 +1,52 @@
+/* -*- 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 12f6eedc2906..8958a1e7e2a7 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,7 +39,7 @@
#ifndef _SV_POINTR_HXX
#include <vcl/pointr.hxx>
#endif
-#include <tools/wintypes.hxx>
+#include <vcl/wintypes.hxx>
#include <vcl/vclevent.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
@@ -57,6 +57,7 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
+class SmartId;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -99,24 +100,10 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl {
- struct ControlLayoutData;
- struct ExtWindowImpl;
-}
-
+namespace vcl { struct ControlLayoutData; }
-// --------------
-// - 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 -
@@ -125,15 +112,17 @@ long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, sal_uInt16 nEvent, co
struct ImplWinData
{
UniString* mpExtOldText;
- sal_uInt16* mpExtOldAttrAry;
+ USHORT* mpExtOldAttrAry;
Rectangle* mpCursorRect;
long mnCursorExtWidth;
Rectangle* mpFocusRect;
Rectangle* mpTrackRect;
- sal_uInt16 mnTrackFlags;
- sal_uInt16 mnIsTopWindow;
- sal_Bool mbMouseOver; // tracks mouse over for native widget paint effect
- sal_Bool mbEnableNativeWidget; // toggle native widget rendering
+ USHORT mnTrackFlags;
+ USHORT mnIsTopWindow;
+ BOOL mbMouseOver; // tracks mouse over for native widget paint effect
+ BOOL mbEnableNativeWidget; // toggle native widget rendering
+ SmartId* mpSmartHelpId;
+ SmartId* mpSmartUniqueId;
::std::list< Window* >
maTopWindowChildren;
};
@@ -147,9 +136,9 @@ struct ImplOverlapData
VirtualDevice* mpSaveBackDev; // Gesicherte Hintergrund-Bitmap
Region* mpSaveBackRgn; // Gesicherte Region, was invalidiert werden muss
Window* mpNextBackWin; // Naechstes Fenster mit Hintergrund-Sicherung
- sal_uIntPtr mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
- sal_Bool mbSaveBack; // sal_True: Background sichern
- sal_uInt8 mnTopLevel; // Level for Overlap-Window
+ ULONG mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
+ BOOL mbSaveBack; // TRUE: Background sichern
+ BYTE mnTopLevel; // Level for Overlap-Window
};
// -----------------
@@ -159,7 +148,7 @@ struct ImplOverlapData
struct ImplFrameData
{
Timer maPaintTimer; // paint timer
- Timer maResizeTimer; // resize timer
+ Timer maResizeTimer; // resize timer
InputContext maOldInputContext; // Last set Input Context
Window* mpNextFrame; // next frame window
Window* mpFirstOverlap; // first overlap window
@@ -173,9 +162,9 @@ struct ImplFrameData
sal_Int32 mnDPIX; // Original Screen Resolution
sal_Int32 mnDPIY; // Original Screen Resolution
ImplMapRes maMapUnitRes; // for LogicUnitToPixel
- sal_uIntPtr mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
- sal_uIntPtr mnFocusId; // FocusId for PostUserLink
- sal_uIntPtr mnMouseMoveId; // MoveId for PostUserLink
+ ULONG mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
+ ULONG mnFocusId; // FocusId for PostUserLink
+ ULONG mnMouseMoveId; // MoveId for PostUserLink
long mnLastMouseX; // last x mouse position
long mnLastMouseY; // last y mouse position
long mnBeforeLastMouseX; // last but one x mouse position
@@ -184,23 +173,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
- 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
+ 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
MapUnit meMapUnit; // last MapUnit for LogicUnitToPixel
- 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
+ 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
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > mxDragSource;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
@@ -208,27 +197,9 @@ 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;
- sal_Bool mbInternalDragGestureRecognizer;
+ BOOL mbInternalDragGestureRecognizer;
};
-// -----------------------
-// - ImplAccessibleInfos -
-// -----------------------
-
-struct ImplAccessibleInfos
-{
- sal_uInt16 nAccessibleRole;
- String* pAccessibleName;
- String* pAccessibleDescription;
- Window* pLabeledByWindow;
- Window* pLabelForWindow;
- Window* pMemberOfWindow;
-
- ImplAccessibleInfos();
- ~ImplAccessibleInfos();
-};
-
-
// ---------------
// - WindowImpl -
// ---------------
@@ -265,11 +236,10 @@ public:
VclEventListeners maChildEventListeners;
// The canvas interface for this VCL window. Is persistent after the first GetCanvas() call
- ::com::sun::star::uno::WeakReference< ::com::sun::star::rendering::XCanvas > mxCanvas;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::rendering::XCanvas > mxCanvas;
ImplDelData* mpFirstDel;
void* mpUserData;
- vcl::ExtWindowImpl* mpExtImpl;
Cursor* mpCursor;
Pointer maPointer;
Fraction maZoom;
@@ -285,8 +255,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- rtl::OString maHelpId;
- rtl::OString maUniqId;
+ ULONG mnHelpId;
+ ULONG mnUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
@@ -305,15 +275,15 @@ public:
WinBits mnPrevExtendedStyle;
WindowType mnType;
ControlPart mnNativeBackground;
- sal_uInt16 mnWaitCount;
- sal_uInt16 mnPaintFlags;
- sal_uInt16 mnGetFocusFlags;
- sal_uInt16 mnParentClipMode;
- sal_uInt16 mnActivateMode;
- sal_uInt16 mnDlgCtrlFlags;
- sal_uInt16 mnLockCount;
+ USHORT mnWaitCount;
+ USHORT mnPaintFlags;
+ USHORT mnGetFocusFlags;
+ USHORT mnParentClipMode;
+ USHORT mnActivateMode;
+ USHORT mnDlgCtrlFlags;
+ USHORT mnLockCount;
AlwaysInputMode meAlwaysInputMode;
- sal_Bool mbFrame:1,
+ BOOL mbFrame:1,
mbBorderWin:1,
mbOverlapWin:1,
mbSysWin:1,
@@ -386,8 +356,7 @@ public:
mbDisableAccessibleLabelForRelation:1,
mbDisableAccessibleLabeledByRelation:1,
mbHelpTextDynamic:1,
- mbFakeFocusSet:1,
- mbInterceptChildWindowKeyDown:1;
+ mbFakeFocusSet:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
@@ -396,9 +365,9 @@ public:
// - Hilfsmethoden -
// -----------------
-long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
- long nX, long nY, sal_uIntPtr nMsgTime,
- sal_uInt16 nCode, sal_uInt16 nMode );
+long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
+ long nX, long nY, ULONG nMsgTime,
+ USHORT nCode, USHORT 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 df82b7870854..32c5621f2c59 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,7 +34,7 @@
#include <vcl/outdev.hxx>
#include <tools/resid.hxx>
#include <vcl/pointr.hxx>
-#include <tools/wintypes.hxx>
+#include <vcl/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 <boost/shared_ptr.hpp>
+#include <vcl/smartid.hxx>
class VirtualDevice;
struct ImplDelData;
@@ -90,13 +90,6 @@ namespace accessibility {
namespace com {
namespace sun {
namespace star {
-namespace beans {
- struct PropertyValue;
-}}}}
-
-namespace com {
-namespace sun {
-namespace star {
namespace rendering {
class XCanvas;
class XSpriteCanvas;
@@ -124,11 +117,7 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl {
- struct ControlLayoutData;
- class WindowArranger;
- struct ExtWindowImpl;
-}
+namespace vcl { struct ControlLayoutData; }
namespace svt { class PopupWindowControllerImpl; }
@@ -137,113 +126,113 @@ namespace svt { class PopupWindowControllerImpl; }
// ---------------
// Type fuer GetWindow()
-#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)
+#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)
// Flags for SetPosSizePixel()
-#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_X ((USHORT)0x0001)
+#define WINDOW_POSSIZE_Y ((USHORT)0x0002)
+#define WINDOW_POSSIZE_WIDTH ((USHORT)0x0004)
+#define WINDOW_POSSIZE_HEIGHT ((USHORT)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 ((sal_uInt16)0x0010)
+#define WINDOW_POSSIZE_DROPDOWN ((USHORT)0x0010)
// Flags for Show()
-#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001)
-#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002)
-#define SHOW_NOACTIVATE ((sal_uInt16)0x0004)
-#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008)
+#define SHOW_NOPARENTUPDATE ((USHORT)0x0001)
+#define SHOW_NOFOCUSCHANGE ((USHORT)0x0002)
+#define SHOW_NOACTIVATE ((USHORT)0x0004)
+#define SHOW_FOREGROUNDTASK ((USHORT)0x0008)
// Flags for SetZOrder()
-#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)
+#define WINDOW_ZORDER_BEFOR ((USHORT)0x0001)
+#define WINDOW_ZORDER_BEHIND ((USHORT)0x0002)
+#define WINDOW_ZORDER_FIRST ((USHORT)0x0004)
+#define WINDOW_ZORDER_LAST ((USHORT)0x0008)
// Activate-Flags
-#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
+#define ACTIVATE_MODE_GRABFOCUS ((USHORT)0x0001)
// ToTop-Flags
-#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
-#define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
-#define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004)
-#define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008)
+#define TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
+#define TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
+#define TOTOP_NOGRABFOCUS ((USHORT)0x0004)
+#define TOTOP_GRABFOCUSONLY ((USHORT)0x0008)
// Flags for Invalidate
-#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)
+#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)
// Temporaer fuer Kompatibilitaet
#define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT
// Flags for Validate
-#define VALIDATE_CHILDREN ((sal_uInt16)0x0001)
-#define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+#define VALIDATE_CHILDREN ((USHORT)0x0001)
+#define VALIDATE_NOCHILDREN ((USHORT)0x0002)
// Flags for Scroll
-#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)
+#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)
// Flags for ParentClipMode
-#define PARENTCLIPMODE_CLIP ((sal_uInt16)0x0001)
-#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
+#define PARENTCLIPMODE_CLIP ((USHORT)0x0001)
+#define PARENTCLIPMODE_NOCLIP ((USHORT)0x0002)
// Flags for Invert()
-#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001)
-#define INVERT_50 ((sal_uInt16)0x0002)
+#define INVERT_HIGHLIGHT ((USHORT)0x0001)
+#define INVERT_50 ((USHORT)0x0002)
// Flags for ShowTracking()
-#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)
+#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)
// Flags for StartTracking()
-#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)
+#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)
// Flags for StartAutoScroll()
-#define AUTOSCROLL_VERT ((sal_uInt16)0x0001)
-#define AUTOSCROLL_HORZ ((sal_uInt16)0x0002)
+#define AUTOSCROLL_VERT ((USHORT)0x0001)
+#define AUTOSCROLL_HORZ ((USHORT)0x0002)
// Flags for StateChanged()
-typedef sal_uInt16 StateChangedType;
+typedef USHORT StateChangedType;
#define STATE_CHANGE_INITSHOW ((StateChangedType)1)
#define STATE_CHANGE_VISIBLE ((StateChangedType)2)
#define STATE_CHANGE_UPDATEMODE ((StateChangedType)3)
@@ -266,49 +255,49 @@ typedef sal_uInt16 StateChangedType;
#define STATE_CHANGE_USER ((StateChangedType)10000)
// GetFocusFlags
-#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)
+#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)
// Draw-Flags fuer Draw()
-#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)
+#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)
// Border-Styles fuer SetBorder()
-#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)
+#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)
// DialogControl-Flags
-#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)
+#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)
// GetWindowClipRegionPixel-Flags
-#define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001)
-#define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
+#define WINDOW_GETCLIPREGION_NULL ((USHORT)0x0001)
+#define WINDOW_GETCLIPREGION_NOCHILDREN ((USHORT)0x0002)
// EndExtTextInput-Flags
-#define EXTTEXTINPUT_END_COMPLETE ((sal_uInt16)0x0001)
-#define EXTTEXTINPUT_END_CANCEL ((sal_uInt16)0x0002)
+#define EXTTEXTINPUT_END_COMPLETE ((USHORT)0x0001)
+#define EXTTEXTINPUT_END_CANCEL ((USHORT)0x0002)
#define IMPL_MINSIZE_BUTTON_WIDTH 70
#define IMPL_MINSIZE_BUTTON_HEIGHT 22
@@ -328,7 +317,7 @@ typedef sal_uInt16 StateChangedType;
#define DLGWINDOW_NEXT 1
#define DLGWINDOW_FIRST 2
-enum WindowSizeType {
+enum WindowSizeType {
WINDOWSIZE_MINIMUM,
WINDOWSIZE_PREFERRED,
WINDOWSIZE_MAXIMUM
@@ -391,9 +380,9 @@ public:
SAL_DLLPRIVATE WinBits ImplInitRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplWindowRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent );
+ SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent );
SAL_DLLPRIVATE void ImplInsertWindow( Window* pParent );
- SAL_DLLPRIVATE void ImplRemoveWindow( sal_Bool bRemoveFrameData );
+ SAL_DLLPRIVATE void ImplRemoveWindow( BOOL bRemoveFrameData );
SAL_DLLPRIVATE Window* ImplGetWindow();
SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
SAL_DLLPRIVATE SalFrame* ImplGetFrame() const;
@@ -401,26 +390,26 @@ public:
SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
SAL_DLLPRIVATE void ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
SAL_DLLPRIVATE Window* ImplFindWindow( const Point& rFramePos );
- SAL_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rFramePos );
+ SAL_DLLPRIVATE USHORT 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 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 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 Window* ImplGetSameParent( const Window* pWindow ) const;
- 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 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 int ImplTestMousePointerSet();
SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
SAL_DLLPRIVATE void ImplResetReallyVisible();
@@ -435,20 +424,20 @@ public:
SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
SAL_DLLPRIVATE void ImplOutputToFrame( Rectangle& rRect );
SAL_DLLPRIVATE void ImplFrameToOutput( Rectangle& rRect );
- SAL_DLLPRIVATE sal_Bool ImplSysObjClip( const Region* pOldRegion );
+ SAL_DLLPRIVATE BOOL ImplSysObjClip( const Region* pOldRegion );
SAL_DLLPRIVATE void ImplUpdateSysObjChildsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjClip();
- 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 BOOL ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller = FALSE );
+ SAL_DLLPRIVATE BOOL ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller = FALSE );
+ SAL_DLLPRIVATE BOOL ImplSetClipFlag( BOOL bSysObjOnlySmaller = 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, sal_Bool bThis, sal_Bool bOverlaps );
- SAL_DLLPRIVATE sal_Bool ImplClipChilds( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps );
+ SAL_DLLPRIVATE BOOL ImplClipChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipAllChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipSiblings( Region& rRegion );
SAL_DLLPRIVATE void ImplInitWinClipRegion();
@@ -458,30 +447,26 @@ 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,
- sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings );
- SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags );
+ BOOL bChilds, BOOL bParent, BOOL bSiblings );
+ SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, USHORT nPaintFlags );
SAL_DLLPRIVATE void ImplCallOverlapPaint();
SAL_DLLPRIVATE void ImplPostPaint();
- SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags );
SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const Region& rRegion );
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( Region& rRegion );
- 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 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 ImplUpdateWindowPtr( Window* pWindow );
SAL_DLLPRIVATE void ImplUpdateWindowPtr();
- SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame );
- SAL_DLLPRIVATE sal_Bool ImplUpdatePos();
+ SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( BOOL bNewFrame );
+ SAL_DLLPRIVATE 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
@@ -495,35 +480,35 @@ public:
<TRUE/> if the font can be used as UI font
<FALSE/> if the font is unsuitable as UI font
*/
- SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont );
- SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True );
+ SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont );
+ SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl = TRUE );
SAL_DLLPRIVATE void ImplAlignChilds();
- SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
SAL_DLLPRIVATE void ImplToBottomChild();
SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
SAL_DLLPRIVATE void ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData );
- 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 ImplToTop( USHORT nFlags );
+ SAL_DLLPRIVATE void ImplStartToTop( USHORT nFlags );
+ SAL_DLLPRIVATE void ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible );
SAL_DLLPRIVATE void ImplShowAllOverlaps();
SAL_DLLPRIVATE void ImplHideAllOverlaps();
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
- SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False );
+ SAL_DLLPRIVATE void ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged = FALSE );
SAL_DLLPRIVATE void ImplGenerateMouseMove();
- SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplGrabFocus( USHORT nFlags );
SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect );
- 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 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 ImplDlgCtrlNextWindow();
- SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus );
+ SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, 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 sal_Bool ImplIsWindowInFront( const Window* pTestWindow ) const;
+ SAL_DLLPRIVATE BOOL ImplIsWindowInFront( const Window* pTestWindow ) const;
SAL_DLLPRIVATE void ImplSaveOverlapBackground();
- SAL_DLLPRIVATE sal_Bool ImplRestoreOverlapBackground( Region& rInvRegion );
+ SAL_DLLPRIVATE BOOL ImplRestoreOverlapBackground( Region& rInvRegion );
SAL_DLLPRIVATE void ImplDeleteOverlapBackground();
SAL_DLLPRIVATE void ImplInvalidateAllOverlapBackgrounds();
SAL_DLLPRIVATE static void ImplNewInputContext();
@@ -539,15 +524,14 @@ public:
SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
SAL_DLLPRIVATE void ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
- 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 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 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;
@@ -559,17 +543,17 @@ public:
SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList();
SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow();
- 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 Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const;
+ SAL_DLLPRIVATE void ImplNotifyIconifiedState( 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 void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos );
- SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList();
- SAL_DLLPRIVATE void ImplIsInTaskPaneList( sal_Bool mbIsInTaskList );
- SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
+ SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList();
+ SAL_DLLPRIVATE void ImplIsInTaskPaneList( BOOL mbIsInTaskList );
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const;
private:
@@ -584,10 +568,10 @@ protected:
// Single argument ctors shall be explicit.
explicit Window( WindowType nType );
- void SetCompoundControl( sal_Bool bCompound );
+ void SetCompoundControl( BOOL bCompound );
- void ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL );
- void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
+ void ImplCallEventListeners( ULONG nEvent, void* pData = NULL );
+ void CallEventListeners( ULONG nEvent, void* pData = NULL );
void FireVclEvent( VclSimpleEvent* pEvent );
// FIXME: this is a hack to workaround missing layout functionality
@@ -606,9 +590,7 @@ public:
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void PrePaint();
virtual void Paint( const Rectangle& rRect );
-
- virtual void PostPaint();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Move();
virtual void Resize();
virtual void Activate();
@@ -618,7 +600,7 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Command( const CommandEvent& rCEvt );
virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void UserEvent( sal_uLong nEvent, void* pEventData );
+ virtual void UserEvent( ULONG nEvent, void* pEventData );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
@@ -630,16 +612,16 @@ public:
/*virtual*/ void AddChildEventListener( const Link& rEventListener );
/*virtual*/ void RemoveChildEventListener( const Link& rEventListener );
- 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 );
+ 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 );
void PostStateChanged( StateChangedType nState );
void IncrementLockCount();
void DecrementLockCount();
- sal_Bool IsLocked( sal_Bool bChilds = sal_False ) const;
+ BOOL IsLocked( BOOL bChilds = FALSE ) const;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -653,64 +635,64 @@ public:
WinBits GetPrevExtendedStyle() const;
void SetType( WindowType nType );
WindowType GetType() const;
- sal_Bool IsSystemWindow() const;
- sal_Bool IsDialog() const;
- sal_Bool IsMenuFloatingWindow() const;
- sal_Bool IsToolbarFloatingWindow() const;
- sal_Bool IsTopWindow() const;
+ BOOL IsSystemWindow() const;
+ BOOL IsDialog() const;
+ BOOL IsMenuFloatingWindow() const;
+ BOOL IsToolbarFloatingWindow() const;
+ BOOL IsTopWindow() const;
SystemWindow* GetSystemWindow() const;
- void EnableAllResize( sal_Bool bEnable = sal_True );
- sal_Bool IsAllResizeEnabled() const;
+ void EnableAllResize( BOOL bEnable = TRUE );
+ BOOL IsAllResizeEnabled() const;
- void SetBorderStyle( sal_uInt16 nBorderStyle );
- sal_uInt16 GetBorderStyle() const;
+ void SetBorderStyle( USHORT nBorderStyle );
+ USHORT 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( sal_Bool bClipSiblings = sal_True );
- sal_Bool IsClipSiblingsEnabled() const;
+ void EnableClipSiblings( BOOL bClipSiblings = TRUE );
+ BOOL IsClipSiblingsEnabled() const;
- void EnableChildTransparentMode( sal_Bool bEnable = sal_True );
- sal_Bool IsChildTransparentModeEnabled() const;
+ void EnableChildTransparentMode( BOOL bEnable = TRUE );
+ BOOL IsChildTransparentModeEnabled() 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;
+ 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;
struct PointerState
{
- sal_uLong mnState; // the button state
+ ULONG mnState; // the button state
Point maPos; // mouse position in output coordinates
};
PointerState GetPointerState();
- sal_Bool IsMouseOver();
+ BOOL IsMouseOver();
- sal_uLong GetCurrentModButtons();
+ ULONG GetCurrentModButtons();
void SetInputContext( const InputContext& rInputContext );
const InputContext& GetInputContext() const;
- void EndExtTextInput( sal_uInt16 nFlags );
- sal_Bool IsExtTextInput() const;
+ void EndExtTextInput( USHORT nFlags );
+ BOOL IsExtTextInput() const;
void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 );
const Rectangle* GetCursorRect() const;
long GetCursorExtTextInputWidth() const;
- void EnableChildNotify( sal_Bool bEnable );
- sal_Bool IsChildNotify() const;
+ void EnableChildNotify( BOOL bEnable );
+ BOOL IsChildNotify() const;
using OutputDevice::SetSettings;
virtual void SetSettings( const AllSettings& rSettings );
- virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild );
- void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False );
+ virtual void SetSettings( const AllSettings& rSettings, BOOL bChild );
+ void UpdateSettings( const AllSettings& rSettings, BOOL bChild = FALSE );
void NotifyAllChilds( DataChangedEvent& rDCEvt );
void SetPointFont( const Font& rFont );
@@ -718,134 +700,135 @@ public:
void SetZoomedPointFont( const Font& rFont );
long GetDrawPixel( OutputDevice* pDev, long nPixels ) const;
Font GetDrawPixelFont( OutputDevice* pDev ) const;
+ void GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const;
void SetControlFont();
void SetControlFont( const Font& rFont );
Font GetControlFont() const;
- sal_Bool IsControlFont() const;
+ BOOL IsControlFont() const;
void SetControlForeground();
void SetControlForeground( const Color& rColor );
Color GetControlForeground() const;
- sal_Bool IsControlForeground() const;
+ BOOL IsControlForeground() const;
void SetControlBackground();
void SetControlBackground( const Color& rColor );
Color GetControlBackground() const;
- sal_Bool IsControlBackground() const;
+ BOOL IsControlBackground() const;
- void SetParentClipMode( sal_uInt16 nMode = 0 );
- sal_uInt16 GetParentClipMode() const;
+ void SetParentClipMode( USHORT nMode = 0 );
+ USHORT GetParentClipMode() const;
void SetWindowRegionPixel();
void SetWindowRegionPixel( const Region& rRegion );
const Region& GetWindowRegionPixel() const;
- sal_Bool IsWindowRegionPixel() const;
- Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
+ BOOL IsWindowRegionPixel() const;
+ Region GetWindowClipRegionPixel( USHORT nFlags = 0 ) const;
Region GetPaintRegion() const;
- sal_Bool IsInPaint() const;
+ 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
- void ExpandPaintClipRegion( const Region& rRegion );
+ void ExpandPaintClipRegion( const Region& rRegion );
void SetParent( Window* pNewParent );
Window* GetParent() 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;
+ void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 );
+ void Hide( USHORT nFlags = 0 ) { Show( FALSE, nFlags ); }
+ BOOL IsVisible() const;
+ BOOL IsReallyVisible() const;
// Do not use this function, use IsReallyVisible()
- sal_Bool IsParentPathVisible() const;
- sal_Bool IsReallyShown() const;
- sal_Bool IsInInitShow() const;
+ BOOL IsParentPathVisible() const;
+ BOOL IsReallyShown() const;
+ BOOL IsInInitShow() const;
void Enable( bool bEnable = true, bool bChild = true );
void Disable( bool bChild = true ) { Enable( false, bChild ); }
- sal_Bool IsEnabled() const;
+ BOOL IsEnabled() const;
- void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True );
- void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
+ void EnableInput( BOOL bEnable = TRUE, BOOL bChild = TRUE );
+ void EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
const Window* pExcludeWindow = NULL );
- sal_Bool IsInputEnabled() const;
-
+ BOOL IsInputEnabled() const;
+
/** Override <code>EnableInput</code>. This can be necessary due to other people
using EnableInput for whole window hierarchies.
-
-
+
+
<code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
mutually exclusive; the last setter wins.
@param bAlways
sets always enabled flag
-
+
@param bChild
if true children are recursively set to AlwaysEnableInput
*/
- void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
+ void AlwaysEnableInput( BOOL bAlways, BOOL bChild = TRUE );
/** returns the current AlwaysEnableInput state
@return
true if window is in AlwaysEnableInput state
*/
- sal_Bool IsAlwaysEnableInput() const;
+ 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
for whole window hierarchies.
-
+
<code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
mutually exclusive; the last setter wins.
-
+
@param bAlways
sets always disable flag
-
+
@param bChild
if true children are recursively set to AlwaysDisableInput
*/
- void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
+ void AlwaysDisableInput( BOOL bAlways, BOOL bChild = TRUE );
/** returns the current AlwaysDisableInput state
@return
true if window is in AlwaysEnableInput state
*/
- sal_Bool IsAlwaysDisableInput() const;
+ 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
not evaluate events but still react to those events externally. In these
rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler
called anyway.
-
+
Currently only mouse events get this special treatment.
-
+
Use this sparingly, chances are if you want to use it you're wroking around
the real problem.
-
+
@param bCall
Enable/Disable calling event handlers for this disabled, modal or input disabled window.
This call is implicity done recursively for possible child windows.
*/
void SetCallHandlersOnInputDisabled( bool bCall );
/** get state of SetCallHandlersOnInputDisabled
-
+
@returns whether handlers are called regardless of input enabled state
*/
bool IsCallHandlersOnInputDisabled() const;
/** A window is in modal mode if one of its children or subchildren
is a running modal window (a modal dialog)
-
- @returns sal_True if a child or subchild is a running modal window
+
+ @returns TRUE if a child or subchild is a running modal window
*/
- sal_Bool IsInModalMode() const;
+ BOOL IsInModalMode() const;
- void SetActivateMode( sal_uInt16 nMode );
- sal_uInt16 GetActivateMode() const;
+ void SetActivateMode( USHORT nMode );
+ USHORT GetActivateMode() 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;
+ void ToTop( USHORT nFlags = 0 );
+ void SetZOrder( Window* pRefWindow, USHORT nFlags );
+ void EnableAlwaysOnTop( BOOL bEnable = TRUE );
+ BOOL IsAlwaysOnTopEnabled() const;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ USHORT nFlags = WINDOW_POSSIZE_ALL );
virtual void SetPosPixel( const Point& rNewPos );
virtual Point GetPosPixel() const;
virtual void SetSizePixel( const Size& rNewSize );
@@ -853,8 +836,8 @@ public:
virtual void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize );
virtual void SetOutputSizePixel( const Size& rNewSize );
- sal_Bool IsDefaultPos() const;
- sal_Bool IsDefaultSize() const;
+ BOOL IsDefaultPos() const;
+ BOOL IsDefaultSize() const;
// those conversion routines might deliver different results during UI mirroring
Point OutputToScreenPixel( const Point& rPos ) const;
@@ -870,86 +853,86 @@ public:
// window extents of the client window, coordinates to be used in SetPosPixel
Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const;
- virtual sal_Bool IsScrollable() const;
+ virtual BOOL IsScrollable() const;
virtual void Scroll( long nHorzScroll, long nVertScroll,
- sal_uInt16 nFlags = 0 );
+ USHORT nFlags = 0 );
virtual void Scroll( long nHorzScroll, long nVertScroll,
- 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;
+ 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;
void Update();
void Flush();
void Sync();
// toggles new docking support, enabled via toolkit
- void EnableDocking( sal_Bool bEnable = sal_True );
+ void EnableDocking( BOOL bEnable = TRUE );
// retrieves the single dockingmanager instance
static DockingManager* GetDockingManager();
- 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 EnablePaint( BOOL bEnable );
+ BOOL IsPaintEnabled() const;
+ void SetUpdateMode( BOOL bUpdate );
+ BOOL IsUpdateMode() const;
+ void SetParentUpdateMode( BOOL bUpdate );
+ BOOL IsParentUpdateMode() const;
void GrabFocus();
- 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();
-
- /**
- * Set this when you need to act as if the window has focus even if it
+ BOOL HasFocus() const;
+ BOOL HasChildPathFocus( BOOL bSystemWindow = FALSE ) const;
+ BOOL IsActive() const;
+ BOOL HasActiveChildFrame();
+ USHORT GetGetFocusFlags() const;
+ void GrabFocusToDocument();
+
+ /**
+ * Set this when you need to act as if the window has focus even if it
* doesn't. This is necessary for implementing tab stops inside floating
* windows, but floating windows don't get focus from the system.
*/
void SetFakeFocus( bool bFocus );
- sal_Bool IsCompoundControl() const;
- sal_Bool HasCompoundControlFocus() const;
+ BOOL IsCompoundControl() const;
+ BOOL HasCompoundControlFocus() const;
static sal_uIntPtr SaveFocus();
- static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
+ static BOOL EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore = TRUE );
void CaptureMouse();
void ReleaseMouse();
- sal_Bool IsMouseCaptured() const;
+ BOOL IsMouseCaptured() const;
void SetPointer( const Pointer& rPointer );
const Pointer& GetPointer() const;
- void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True );
- sal_Bool IsChildPointerOverwrite() const;
+ void EnableChildPointerOverwrite( BOOL bOverwrite = TRUE );
+ BOOL IsChildPointerOverwrite() const;
void SetPointerPosPixel( const Point& rPos );
Point GetPointerPosPixel();
Point GetLastPointerPosPixel();
- void ShowPointer( sal_Bool bVisible );
- sal_Bool IsPointerVisible() const;
+ void ShowPointer( BOOL bVisible );
+ BOOL IsPointerVisible() const;
void EnterWait();
void LeaveWait();
- sal_Bool IsWait() const;
+ BOOL IsWait() const;
void SetCursor( Cursor* pCursor );
Cursor* GetCursor() const;
void SetZoom( const Fraction& rZoom );
const Fraction& GetZoom() const;
- sal_Bool IsZoom() const;
+ BOOL IsZoom() const;
long CalcZoom( long n ) const;
virtual void SetText( const XubString& rStr );
- virtual String GetText() const;
+ virtual String GetText() const;
// return the actual text displayed
// this may have e.g. accellerators removed or portions
// replaced by ellipsis
- virtual String GetDisplayText() const;
+ virtual String GetDisplayText() const;
// gets the visible background color. for transparent windows
// this may be the parent's background color; for controls
// this may be a child's background color (e.g. ListBox)
@@ -961,55 +944,61 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( const rtl::OString& );
- const rtl::OString& GetHelpId() const;
+ void SetHelpId( ULONG nHelpId ); /// deprecated
+ ULONG GetHelpId() const; /// deprecated
+ void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
+ SmartId GetSmartHelpId() const;
- void SetUniqueId( const rtl::OString& );
- const rtl::OString& GetUniqueId() const;
- const rtl::OString& GetUniqueOrHelpId() 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;
Window* FindWindow( const Point& rPos ) 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;
+ 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;
void SetData( void* pNewData );
void* GetData() const;
- Bitmap SnapShot( sal_Bool bBorder = sal_True ) const;
+ // Should be merged in the next top level build !!!
+ Bitmap SnapShot( BOOL bBorder ) const;
+ Bitmap SnapShot() const;
void ShowFocus( const Rectangle& rRect );
void HideFocus();
- void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
- void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
+ void Invert( const Rectangle& rRect, USHORT nFlags = 0 );
+ void Invert( const Polygon& rPoly, USHORT nFlags = 0 );
// transparent background for selected or checked items in toolboxes etc.
- void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly );
+ void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly );
// the same, but fills a passed Color with a text color complementing the selection background
- void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor );
+ void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor );
// support rounded edges in the selection rect
- void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
+ void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
void ShowTracking( const Rectangle& rRect,
- sal_uInt16 nFlags = SHOWTRACK_SMALL );
+ USHORT nFlags = SHOWTRACK_SMALL );
void HideTracking();
void InvertTracking( const Rectangle& rRect,
- sal_uInt16 nFlags = SHOWTRACK_SMALL );
- void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
+ USHORT nFlags = SHOWTRACK_SMALL );
+ void InvertTracking( const Polygon& rPoly, USHORT nFlags = 0 );
- void StartTracking( sal_uInt16 nFlags = 0 );
- void EndTracking( sal_uInt16 nFlags = 0 );
- sal_Bool IsTracking() const;
+ void StartTracking( USHORT nFlags = 0 );
+ void EndTracking( USHORT nFlags = 0 );
+ BOOL IsTracking() const;
- void StartAutoScroll( sal_uInt16 nFlags );
+ void StartAutoScroll( USHORT nFlags );
void EndAutoScroll();
- sal_Bool IsAutoScroll() const;
+ BOOL IsAutoScroll() const;
- sal_Bool HandleScrollCommand( const CommandEvent& rCmd,
+ BOOL HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl = NULL,
ScrollBar* pVScrl = NULL );
@@ -1020,20 +1009,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( sal_Bool bCreate = sal_True );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( BOOL bCreate = 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( sal_Bool bCreate = sal_True );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( BOOL bCreate = 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;
- sal_uInt16 GetAccessibleChildWindowCount();
- Window* GetAccessibleChildWindow( sal_uInt16 n );
+ USHORT GetAccessibleChildWindowCount();
+ Window* GetAccessibleChildWindow( USHORT n );
- void SetAccessibleRole( sal_uInt16 nRole );
- sal_uInt16 GetAccessibleRole() const;
+ void SetAccessibleRole( USHORT nRole );
+ USHORT GetAccessibleRole() const;
void SetAccessibleName( const String& rName );
String GetAccessibleName() const;
@@ -1041,48 +1030,38 @@ 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
- sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
- void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
+ BOOL IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath = TRUE );
/// request XCanvas render interface for this window
- ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCanvas > GetCanvas() const;
/// request XSpriteCanvas render interface for this window
- ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSpriteCanvas > GetSpriteCanvas() const;
/// request fullscreen XSpriteCanvas render interface for this window
- ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSpriteCanvas > GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const;
/* records all DrawText operations within the passed rectangle;
* a synchronous paint is sent to achieve this
*/
- void RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect );
+ void RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect );
// Setzen und Abfragen fuer das Toolkit
VCLXWindow* GetWindowPeer() const;
void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow );
// Merken, ob vom Toolkit erzeugt
- sal_Bool IsCreatedWithToolkit() const;
- void SetCreatedWithToolkit( sal_Bool b );
+ BOOL IsCreatedWithToolkit() const;
+ void SetCreatedWithToolkit( BOOL b );
- // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
- virtual Window* GetParentLabelFor( const Window* pLabel ) const;
- virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
- KeyEvent GetActivationKey() const;
+ Window* GetLabelFor() const;
+ Window* GetLabeledBy() const;
+ virtual Window* GetParentLabelFor( const Window* pLabel ) const;
+ virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
+ KeyEvent GetActivationKey() const;
// Drag and Drop interfaces
virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > GetDropTarget();
@@ -1103,12 +1082,12 @@ public:
//-------------------------------------
// form controls must never use native widgets, this can be toggled here
- void EnableNativeWidget( sal_Bool bEnable = sal_True );
- sal_Bool IsNativeWidgetEnabled() const;
+ void EnableNativeWidget( BOOL bEnable = TRUE );
+ BOOL IsNativeWidgetEnabled() const;
// a helper method for a Control's Draw method
void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize );
-
+
/* mark Window for deletion in top of event queue
*/
void doLazyDelete();
@@ -1125,64 +1104,12 @@ public:
INDICATOR_NUM_LOCK
INDICATOR_SCROLL_LOCK
*/
- sal_uInt16 GetIndicatorState() const;
-
- void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
+ USHORT GetIndicatorState() const;
- // let the window intercept the KeyDown messages of the system children
- void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+ void SimulateKeyPress( USHORT nKeyCode ) const;
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
new file mode 100644
index 000000000000..2252ff9d2e4e
--- /dev/null
+++ b/vcl/inc/vcl/wintypes.hxx
@@ -0,0 +1,35 @@
+/* -*- 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/wrkwin.hxx b/vcl/inc/vcl/wrkwin.hxx
index c58f6971ffc0..c188e30cd170 100644
--- a/vcl/inc/vcl/wrkwin.hxx
+++ b/vcl/inc/vcl/wrkwin.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,9 @@ struct SystemParentData;
// ----------------------
// Presentation Flags
-#define PRESENTATION_HIDEALLAPPS ((sal_uInt16)0x0001)
-#define PRESENTATION_NOFULLSCREEN ((sal_uInt16)0x0002)
-#define PRESENTATION_NOAUTOSHOW ((sal_uInt16)0x0004)
+#define PRESENTATION_HIDEALLAPPS ((USHORT)0x0001)
+#define PRESENTATION_NOFULLSCREEN ((USHORT)0x0002)
+#define PRESENTATION_NOAUTOSHOW ((USHORT)0x0004)
// --------------
// - WorkWindow -
@@ -52,8 +52,8 @@ struct SystemParentData;
class VCL_DLLPUBLIC WorkWindow : public SystemWindow
{
private:
- sal_uInt16 mnPresentationFlags;
- sal_Bool mbPresentationMode:1,
+ USHORT mnPresentationFlags;
+ 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( sal_uLong aFrameState );
+ SAL_DLLPRIVATE void ImplSetFrameState( ULONG aFrameState );
public:
WorkWindow( Window* pParent, const ResId& rResId );
@@ -78,7 +78,7 @@ public:
WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
~WorkWindow();
- virtual sal_Bool Close();
+ virtual 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( sal_Bool bFullScreenMode = sal_True, sal_Int32 nDisplay = -1 );
- void EndFullScreenMode() { ShowFullScreenMode( sal_False ); }
- sal_Bool IsFullScreenMode() const { return mbFullScreenMode; }
+ void ShowFullScreenMode( BOOL bFullScreenMode = TRUE, sal_Int32 nDisplay = -1 );
+ void EndFullScreenMode() { ShowFullScreenMode( FALSE ); }
+ BOOL IsFullScreenMode() const { return mbFullScreenMode; }
- 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; }
+ void StartPresentationMode( BOOL bPresentation = TRUE, USHORT nFlags = 0, sal_Int32 nDisplay = 0 );
+ void EndPresentationMode() { StartPresentationMode( FALSE ); }
+ BOOL IsPresentationMode() const { return mbPresentationMode; }
- sal_Bool IsMinimized() const;
+ BOOL IsMinimized() const;
- sal_Bool SetPluginParent( SystemParentData* pParent );
+ BOOL SetPluginParent( SystemParentData* pParent );
void Minimize();
void Restore();
- void Maximize( sal_Bool bMaximize = sal_True );
- sal_Bool IsMaximized() const;
+ void Maximize( BOOL bMaximize = TRUE );
+ BOOL IsMaximized() const;
};
#endif // _SV_WRKWIN_HXX
diff --git a/vcl/inc/vcl/xconnection.hxx b/vcl/inc/vcl/xconnection.hxx
index bd3270fa24c7..c8faa3bbb659 100644
--- a/vcl/inc/vcl/xconnection.hxx
+++ b/vcl/inc/vcl/xconnection.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,12 +29,11 @@
#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
@@ -42,23 +41,21 @@
namespace vcl {
class DisplayConnection :
- public DisplayConnectionDispatch
+ public ::cppu::WeakImplHelper1< ::com::sun::star::awt::XDisplayConnection >
{
- ::osl::Mutex m_aMutex;
+ ::osl::Mutex m_aMutex;
::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
m_aHandlers;
::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
m_aErrorHandlers;
- ::com::sun::star::uno::Any m_aAny;
+ ::com::sun::star::uno::Any m_aAny;
public:
DisplayConnection();
virtual ~DisplayConnection();
- void start();
- void terminate();
-
- virtual bool dispatchEvent( void* pData, int nBytes );
- virtual bool dispatchErrorEvent( void* pData, int nBytes );
+ static bool dispatchEvent( void* pThis, void* pData, int nBytes );
+ static bool dispatchErrorEvent( void* pThis, void* pData, int nBytes );
+ void dispatchDowningEvent();
// 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/salbmp.h b/vcl/os2/inc/salbmp.h
index 50ba652c051b..5b40fa564b79 100644
--- a/vcl/os2/inc/salbmp.h
+++ b/vcl/os2/inc/salbmp.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,8 +50,8 @@ class Os2SalBitmap : public SalBitmap
private:
Size maSize;
- HANDLE mhDIB;
- HANDLE mhDIB1Subst;
+ HANDLE mhDIB;
+ HANDLE mhDIB1Subst;
HBITMAP mhDDB;
USHORT mnBitCount;
@@ -59,19 +59,19 @@ public:
HANDLE ImplGethDIB() const { return mhDIB; }
HBITMAP ImplGethDDB() const { return mhDDB; }
- HANDLE ImplGethDIB1Subst() const { return mhDIB1Subst; }
+ HANDLE ImplGethDIB1Subst() const { return mhDIB1Subst; }
- void ImplReplacehDIB1Subst( HANDLE hDIB1Subst );
+ void ImplReplacehDIB1Subst( HANDLE hDIB1Subst );
static HANDLE ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
- static HANDLE ImplCreateDIB4FromDIB1( HANDLE hDIB1 );
+ static HANDLE ImplCreateDIB4FromDIB1( HANDLE hDIB1 );
static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, BOOL bDIB );
static USHORT ImplGetDIBColorCount( HANDLE hDIB );
static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, BOOL bRLE4 );
//BOOL Create( HANDLE hBitmap, BOOL bDIB, BOOL bCopyHandle );
-
+
public:
Os2SalBitmap();
@@ -89,8 +89,8 @@ public:
//Size GetSize() const { return maSize; }
//USHORT GetBitCount() const { return mnBitCount; }
- //BitmapBuffer* AcquireBuffer( bool bReadOnly );
- //void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
+ //BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ //void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmpImpl );
@@ -102,7 +102,7 @@ public:
virtual Size GetSize() const { return maSize; }
virtual USHORT GetBitCount() const { return mnBitCount; }
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
virtual bool GetSystemData( BitmapSystemData& rData );
};
diff --git a/vcl/os2/inc/saldata.hxx b/vcl/os2/inc/saldata.hxx
index 2b2e3f03da7c..347989d9f85a 100644
--- a/vcl/os2/inc/saldata.hxx
+++ b/vcl/os2/inc/saldata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -66,19 +66,19 @@ typedef APIRET (APIENTRY ImQueryIMModeFunc)( HIMI himi, PULONG pulInputMode, PUL
struct SalIMEData
{
- HMODULE mhModIME;
- ImAssociateInstanceFunc* mpAssocIME;
- ImGetInstanceFunc* mpGetIME;
- ImReleaseInstanceFunc* mpReleaseIME;
- ImSetConversionFontFunc* mpSetConversionFont;
- ImSetConversionFontSizeFunc* mpSetConversionFontSize;
- ImGetConversionStringFunc* mpGetConversionString;
- ImGetResultStringFunc* mpGetResultString;
- ImSetCandidateWindowPosFunc* mpSetCandidateWin;
- ImQueryIMEPropertyFunc* mpQueryIMEProperty;
- ImRequestIMEFunc* mpRequestIME;
- ImSetIMModeFunc* mpSetIMEMode;
- ImQueryIMModeFunc* mpQueryIMEMode;
+ HMODULE mhModIME;
+ ImAssociateInstanceFunc* mpAssocIME;
+ ImGetInstanceFunc* mpGetIME;
+ ImReleaseInstanceFunc* mpReleaseIME;
+ ImSetConversionFontFunc* mpSetConversionFont;
+ ImSetConversionFontSizeFunc* mpSetConversionFontSize;
+ ImGetConversionStringFunc* mpGetConversionString;
+ ImGetResultStringFunc* mpGetResultString;
+ ImSetCandidateWindowPosFunc* mpSetCandidateWin;
+ ImQueryIMEPropertyFunc* mpQueryIMEProperty;
+ ImRequestIMEFunc* mpRequestIME;
+ ImSetIMModeFunc* mpSetIMEMode;
+ ImQueryIMModeFunc* mpQueryIMEMode;
};
#endif
@@ -102,31 +102,31 @@ struct SalIcon
struct SalData
{
- HAB mhAB; // anchor block handle
- HMQ mhMQ; // handle of os2 message queue
- int mnArgc; // commandline param count
- char** mpArgv; // commandline
- ULONG mnNewTimerMS; // Neue Zeit, mit dem der Timer gestartet werden soll
- ULONG mnTimerMS; // Current Time (in MS) of the Timer
- ULONG mnTimerOrgMS; // Current Original Time (in MS)
- ULONG mnNextTimerTime;
- ULONG mnLastEventTime;
- ULONG mnTimerId; // os2 timer id
- BOOL mbInTimerProc; // timer event is currently being dispatched
- //SALTIMERPROC mpTimerProc; // timer callback proc
- HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message
- AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test
- Os2SalInstance* mpFirstInstance; // pointer of first instance
- Os2SalFrame* mpFirstFrame; // pointer of first frame
- Os2SalFrame* mpCreateFrame; // Create-Frame for WM_CREATE
- Os2SalObject* mpFirstObject; // pointer of first object window
- ULONG mnAppThreadId; // Id from Applikation-Thread
- ULONG mnFontMetricCount; // number of entries in the font list
- PFONTMETRICS mpFontMetrics; // cached font list
- BOOL mbObjClassInit; // Ist SALOBJECTCLASS initialised
+ HAB mhAB; // anchor block handle
+ HMQ mhMQ; // handle of os2 message queue
+ int mnArgc; // commandline param count
+ char** mpArgv; // commandline
+ ULONG mnNewTimerMS; // Neue Zeit, mit dem der Timer gestartet werden soll
+ ULONG mnTimerMS; // Current Time (in MS) of the Timer
+ ULONG mnTimerOrgMS; // Current Original Time (in MS)
+ ULONG mnNextTimerTime;
+ ULONG mnLastEventTime;
+ ULONG mnTimerId; // os2 timer id
+ BOOL mbInTimerProc; // timer event is currently being dispatched
+ //SALTIMERPROC mpTimerProc; // timer callback proc
+ HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message
+ AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test
+ Os2SalInstance* mpFirstInstance; // pointer of first instance
+ Os2SalFrame* mpFirstFrame; // pointer of first frame
+ Os2SalFrame* mpCreateFrame; // Create-Frame for WM_CREATE
+ Os2SalObject* mpFirstObject; // pointer of first object window
+ ULONG mnAppThreadId; // Id from Applikation-Thread
+ ULONG mnFontMetricCount; // number of entries in the font list
+ PFONTMETRICS mpFontMetrics; // cached font list
+ BOOL mbObjClassInit; // Ist SALOBJECTCLASS initialised
#ifdef ENABLE_IME
- SalIMEData* mpIMEData; // SalIME-Data
- BOOL mbIMEInit; // SalIME-Data-Init
+ SalIMEData* mpIMEData; // SalIME-Data
+ BOOL mbIMEInit; // SalIME-Data-Init
#endif
SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none
@@ -141,15 +141,15 @@ inline SalData* GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData
// - SalShlData -
// --------------
-#define OS2_VER_211 211
-#define OS2_VER_WARP3 230
-#define OS2_VER_WARP4 240
+#define OS2_VER_211 211
+#define OS2_VER_WARP3 230
+#define OS2_VER_WARP4 240
struct SalShlData
{
- HMODULE mhMod; // Module handle of SAL-DLL
- USHORT mnVersion; // 211 = OS2 2.11; 230 = OS2 3.0; 240 = OS2 4.0
- PFNWP mpFrameProc; // old frame proc
+ HMODULE mhMod; // Module handle of SAL-DLL
+ USHORT mnVersion; // 211 = OS2 2.11; 230 = OS2 3.0; 240 = OS2 4.0
+ PFNWP mpFrameProc; // old frame proc
};
extern SalShlData aSalShlData;
@@ -205,46 +205,46 @@ void ImplReleaseSALIMEData();
// - Defines -
// -----------
-#define SAL_PROFILE_APPNAME ((PSZ)"StarOffice")
-#define SAL_PROFILE_USEDJP ((PSZ)"UseDJP")
-#define SAL_PROFILE_PRINTDJP ((PSZ)"PrintDJP")
-#define SAL_PROFILE_PRINTRAW ((PSZ)"PrintRAW")
+#define SAL_PROFILE_APPNAME ((PSZ)"StarOffice")
+#define SAL_PROFILE_USEDJP ((PSZ)"UseDJP")
+#define SAL_PROFILE_PRINTDJP ((PSZ)"PrintDJP")
+#define SAL_PROFILE_PRINTRAW ((PSZ)"PrintRAW")
-#define SAL_FRAME_WNDEXTRA sizeof(ULONG)
-#define SAL_FRAME_THIS 0
-#define SAL_FRAME_CLASSNAME "SALFRAME"
-#define SAL_SUBFRAME_CLASSNAME "SALSUBFRAME"
-#define SAL_OBJECT_WNDEXTRA sizeof(ULONG)
-#define SAL_OBJECT_THIS 0
-#define SAL_OBJECT_CLASSNAME "SALOBJECT"
-#define SAL_OBJECT_CHILDCLASSNAME "SALOBJECTCHILD"
-#define SAL_OBJECT_CLIPCLASSNAME "SALOBJECTCLIP"
-#define SAL_COM_CLASSNAME "SALCOMWND"
+#define SAL_FRAME_WNDEXTRA sizeof(ULONG)
+#define SAL_FRAME_THIS 0
+#define SAL_FRAME_CLASSNAME "SALFRAME"
+#define SAL_SUBFRAME_CLASSNAME "SALSUBFRAME"
+#define SAL_OBJECT_WNDEXTRA sizeof(ULONG)
+#define SAL_OBJECT_THIS 0
+#define SAL_OBJECT_CLASSNAME "SALOBJECT"
+#define SAL_OBJECT_CHILDCLASSNAME "SALOBJECTCHILD"
+#define SAL_OBJECT_CLIPCLASSNAME "SALOBJECTCLIP"
+#define SAL_COM_CLASSNAME "SALCOMWND"
-#define SAL_MOUSELEAVE_TIMEOUT 300
+#define SAL_MOUSELEAVE_TIMEOUT 300
// MP1 == 0; MP2 == pData
-#define SAL_MSG_USEREVENT (WM_USER+111)
+#define SAL_MSG_USEREVENT (WM_USER+111)
// MP1 == 0; MP2 == MousePosition relativ to upper left of screen
-#define SAL_MSG_MOUSELEAVE (WM_USER+112)
+#define SAL_MSG_MOUSELEAVE (WM_USER+112)
// MP1 == hDC; MP2 == 0
-#define SAL_MSG_PRINTABORTJOB (WM_USER+113)
+#define SAL_MSG_PRINTABORTJOB (WM_USER+113)
// MP1 == 0; MP2 == 0
-#define SAL_MSG_STARTTIMER (WM_USER+114)
+#define SAL_MSG_STARTTIMER (WM_USER+114)
// MP1 == nFrameStyle; MP2 == pParent; lResult pFrame
-#define SAL_MSG_CREATEFRAME (WM_USER+115)
+#define SAL_MSG_CREATEFRAME (WM_USER+115)
// MP1 == 0; MP2 == pParent; lResult pObject
-#define SAL_MSG_CREATEOBJECT (WM_USER+116)
+#define SAL_MSG_CREATEOBJECT (WM_USER+116)
// MP1 == bWait; MP2 == pMutex
-#define SAL_MSG_THREADYIELD (WM_USER+117)
+#define SAL_MSG_THREADYIELD (WM_USER+117)
// MP1 == 0; MP2 == 0
-#define SAL_MSG_RELEASEWAITYIELD (WM_USER+118)
+#define SAL_MSG_RELEASEWAITYIELD (WM_USER+118)
// MP1 == 0; MP2 == pData
-#define SAL_MSG_SYSPROCESSMENU (WM_USER+119)
+#define SAL_MSG_SYSPROCESSMENU (WM_USER+119)
// POSTFOCUS-Message; MP1 == nMP1; MP2 == nMP2 (SHORT1( bFocus ), 0)
-#define SAL_MSG_POSTFOCUS (WM_USER+120)
+#define SAL_MSG_POSTFOCUS (WM_USER+120)
// POSTSIZE-Message; MP1 == nMP1; MP2 == nMP2
-#define SAL_MSG_POSTSIZE (WM_USER+121)
+#define SAL_MSG_POSTSIZE (WM_USER+121)
// wParam == wParam; lParam == lParam
#define SAL_MSG_POSTMOVE (WM_USER+136)
@@ -256,9 +256,9 @@ void ImplReleaseSALIMEData();
#define SAL_MSG_SHOW (WM_USER+143)
// SysChild-ToTop; nMP1 = 0; nMP2 = 0
-#define SALOBJ_MSG_TOTOP (WM_USER+150)
+#define SALOBJ_MSG_TOTOP (WM_USER+150)
// POSTFOCUS-Message; MP1 == nMP1; MP2 == nMP2 (SHORT1( bFocus ), 0)
-#define SALOBJ_MSG_POSTFOCUS (WM_USER+151)
+#define SALOBJ_MSG_POSTFOCUS (WM_USER+151)
// wParam == 0; lParam == 0
#define SAL_MSG_DESTROYFRAME (WM_USER+160)
@@ -276,7 +276,7 @@ void ImplReleaseSALIMEData();
#define SAL_MSG_RECREATEHWND (WM_USER+166)
// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd
#define SAL_MSG_RECREATECHILDHWND (WM_USER+167)
-// wParam == 0; lParam == HWND;
+// wParam == 0; lParam == HWND;
#define SAL_MSG_DESTROYHWND (WM_USER+168)
// POSTTIMER-Message; wparam = 0, lParam == time
#define SAL_MSG_POSTTIMER (WM_USER+169)
@@ -305,6 +305,6 @@ inline Os2SalObject* GetSalObjWindowPtr( HWND hWnd )
return (Os2SalObject*)WinQueryWindowULong( hWnd, SAL_OBJECT_THIS );
}
-#endif // _SV_SALDATA_HXX
+#endif // _SV_SALDATA_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/os2/inc/salframe.h b/vcl/os2/inc/salframe.h
index cd3d910a7d30..2098050d1481 100644
--- a/vcl/os2/inc/salframe.h
+++ b/vcl/os2/inc/salframe.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,28 +61,28 @@ class Os2SalGraphics;
class Os2SalFrame : public SalFrame
{
public:
- HWND mhWndFrame; // HWND-Frame
- HWND mhWndClient; // HWND-Client
- HAB mhAB; // HAB
- HPOINTER mhPointer; // Current MousePointer
- void* mpInst; // VCL-Instance
- //SALFRAMEPROC mpProc; // VCL-Proc
- Os2SalGraphics* mpGraphics; // current frame graphics
- Os2SalFrame* mpNextFrame; // pointer to next frame
- SystemEnvData maSysData; // system data
- SalFrameState maState; // frame state
+ HWND mhWndFrame; // HWND-Frame
+ HWND mhWndClient; // HWND-Client
+ HAB mhAB; // HAB
+ HPOINTER mhPointer; // Current MousePointer
+ void* mpInst; // VCL-Instance
+ //SALFRAMEPROC mpProc; // VCL-Proc
+ Os2SalGraphics* mpGraphics; // current frame graphics
+ Os2SalFrame* mpNextFrame; // pointer to next frame
+ SystemEnvData maSysData; // system data
+ SalFrameState maState; // frame state
int mnShowState; // show state
- ULONG mnStyle; // SalFrameStyle
- long mnWidth; // Window-Witdth
- long mnHeight; // Window-Height
- SWP maFullScreenRect; // WindowRect befor FullScreenMode
- BOOL mbGraphics; // is Graphics used
- BOOL mbAllwayOnTop; // Allways on top modus
- BOOL mbVisible; // Visible Show/Hide-Status
- BOOL mbMinHide; // hide called from OS2
- BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages
- BOOL mbConversionMode; // TRUE: Wir befinden uns im Conversion-Modus
- BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
+ ULONG mnStyle; // SalFrameStyle
+ long mnWidth; // Window-Witdth
+ long mnHeight; // Window-Height
+ SWP maFullScreenRect; // WindowRect befor FullScreenMode
+ BOOL mbGraphics; // is Graphics used
+ BOOL mbAllwayOnTop; // Allways on top modus
+ BOOL mbVisible; // Visible Show/Hide-Status
+ BOOL mbMinHide; // hide called from OS2
+ BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages
+ BOOL mbConversionMode; // TRUE: Wir befinden uns im Conversion-Modus
+ BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
BOOL mbCaption; // has window a caption
BOOL mbBorder; // has window a border
BOOL mbFixBorder; // has window a fixed border
@@ -108,62 +108,62 @@ public:
static BOOL mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
private:
- Os2SalFrame* mpParentFrame; // parent frame pointer
+ Os2SalFrame* mpParentFrame; // parent frame pointer
public:
Os2SalFrame();
virtual ~Os2SalFrame();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
- virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual BOOL PostEvent( void* pData );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT 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( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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 GetClientSize( long& rWidth, long& rHeight );
- virtual void GetWorkArea( RECTL& rRect );
- 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 void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
- virtual void SetPointerPos( long nX, long nY );
- 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 void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void GetClientSize( long& rWidth, long& rHeight );
+ virtual void GetWorkArea( RECTL& rRect );
+ 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 void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( BOOL bMouse );
+ virtual void SetPointerPos( long nX, long nY );
+ 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 LanguageType GetInputLanguage();
- virtual SalBitmap* SnapShot();
- virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Beep( SoundType eSoundType );
- virtual const SystemEnvData* GetSystemData() const;
- virtual SalPointerState GetPointerState();
+ virtual LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
+ virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
virtual void SimulateKeyPress( USHORT nKeyCode );
- virtual void SetParent( SalFrame* pNewParent );
- virtual bool SetPluginParent( SystemParentData* pNewParent );
+ 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 UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual void EndSetClipRegion();
+ virtual void ResetClipRegion();
+ virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
};
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index 3c72695bc2f2..621451d18178 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
-#include <boost/unordered_set.hpp>
+#include <hash_set>
class ImplOs2FontEntry;
@@ -75,7 +75,7 @@ public:
bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; }
bool AliasSymbolsLow() const { return mbAliasSymbolsLow; }
- const ImplFontCharMap* GetImplFontCharMap() const;
+ ImplFontCharMap* GetImplFontCharMap() const;
private:
sal_IntPtr mnId;
@@ -83,7 +83,7 @@ private:
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
- mutable const ImplFontCharMap* mpUnicodeMap;
+ mutable 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)
@@ -101,7 +101,7 @@ private:
#ifdef GNG_VERT_HACK
void ReadGsubTable( HDC ) const;
- typedef boost::unordered_set<int> IntHashSet;
+ typedef std::hash_set<int> IntHashSet;
mutable IntHashSet maGsubTable;
mutable bool mbGsubRead;
public:
@@ -119,131 +119,137 @@ public:
class Os2SalGraphics : public SalGraphics
{
public:
- HPS mhPS; // HPS
- HDC mhDC; // HDC
- HWND mhWnd; // HWND
- LONG mnHeight; // Height of frame Window
- ULONG mnClipElementCount; // number of clip rects in clip rect array
- RECTL* mpClipRectlAry; // clip rect array
- ULONG mnFontMetricCount; // number of entries in the font list
- PFONTMETRICS mpFontMetrics; // cached font list
- LONG mnOrientationX; // X-Font orientation
- LONG mnOrientationY; // Y-Font orientation
- BOOL mbLine; // draw lines
- BOOL mbFill; // fill areas
- BOOL mbPrinter; // is Printer
- BOOL mbVirDev; // is VirDev
- BOOL mbWindow; // is Window
- BOOL mbScreen; // is Screen compatible
- bool mbXORMode; // _every_ output with RasterOp XOR
- ULONG mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
- const ImplOs2FontData* mpOs2FontData[ MAX_FALLBACK ]; // pointer to the most recent font face
- ImplOs2FontEntry* mpOs2FontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
- ULONG mhDefFont; // DefaultFont
- float mfFontScale; // allows metrics emulation of huge font sizes
- BOOL mbFontKernInit; // FALSE: FontKerns must be queried
- KERNINGPAIRS* mpFontKernPairs; // Kerning Pairs of the current Font
- ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font
-
- USHORT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, int );
+ HPS mhPS; // HPS
+ HDC mhDC; // HDC
+ HWND mhWnd; // HWND
+ LONG mnHeight; // Height of frame Window
+ ULONG mnClipElementCount; // number of clip rects in clip rect array
+ RECTL* mpClipRectlAry; // clip rect array
+ ULONG mnFontMetricCount; // number of entries in the font list
+ PFONTMETRICS mpFontMetrics; // cached font list
+ LONG mnOrientationX; // X-Font orientation
+ LONG mnOrientationY; // Y-Font orientation
+ BOOL mbLine; // draw lines
+ BOOL mbFill; // fill areas
+ BOOL mbPrinter; // is Printer
+ BOOL mbVirDev; // is VirDev
+ BOOL mbWindow; // is Window
+ BOOL mbScreen; // is Screen compatible
+ bool mbXORMode; // _every_ output with RasterOp XOR
+ ULONG mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
+ const ImplOs2FontData* mpOs2FontData[ MAX_FALLBACK ]; // pointer to the most recent font face
+ ImplOs2FontEntry* mpOs2FontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
+ ULONG mhDefFont; // DefaultFont
+ float mfFontScale; // allows metrics emulation of huge font sizes
+ BOOL mbFontKernInit; // FALSE: FontKerns must be queried
+ KERNINGPAIRS* mpFontKernPairs; // Kerning Pairs of the current Font
+ ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font
+
+ USHORT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, int );
public:
Os2SalGraphics();
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 );
- 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 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 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 drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
+ 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 );
// CopyArea --> No RasterOp, but ClipRegion
- virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
long nSrcHeight, USHORT nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
- virtual SalColor getPixel( long nX, long nY );
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
+ virtual SalColor getPixel( long nX, long nY );
// 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( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
+ virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
- virtual bool drawAlphaBitmap( const SalTwoRect&,
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
- virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
public:
// public SalGraphics methods, the interface to teh independent vcl part
// get device resolution
- virtual void GetResolution( long& rDPIX, long& rDPIY );
+ virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual USHORT GetBitCount() const;
+ virtual USHORT GetBitCount();
// get the width of the device
- virtual long GetGraphicsWidth() const;
+ virtual long GetGraphicsWidth() const;
// set the clip region to empty
- virtual void ResetClipRegion();
- virtual bool setClipRegion( const Region& );
+ 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();
+ virtual void SetLineColor();
// set the line color to a specific color
- virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetLineColor( SalColor nSalColor );
// set the fill color to transparent (= don't fill)
- virtual void SetFillColor();
+ virtual void SetFillColor();
// set the fill color to a specific color, shapes will be
// filled accordingly
- virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetFillColor( SalColor nSalColor );
// enable/disable XOR drawing
- virtual void SetXORMode( bool bSet, bool );
+ virtual void SetXORMode( bool bSet, bool );
// set line color for raster operations
- virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPLineColor( SalROPColor nROPColor );
// set fill color for raster operations
- virtual void SetROPFillColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
// set the text color to a specific color
- virtual void SetTextColor( SalColor nSalColor );
+ virtual void SetTextColor( SalColor nSalColor );
// set the font
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ 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 ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
virtual ImplFontCharMap* GetImplFontCharMap() const;
// graphics must fill supplied font list
- virtual void GetDevFontList( ImplDevFontList* );
+ virtual void GetDevFontList( ImplDevFontList* );
// graphics should call ImplAddDevFontSubstitute on supplied
// OutputDevice for all its device specific preferred font substitutions
- virtual void GetDevFontSubstList( OutputDevice* );
- virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
+ virtual void GetDevFontSubstList( OutputDevice* );
+ virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
// 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
@@ -256,7 +262,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 BOOL CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -281,13 +287,13 @@ public:
// pWidths MUST support at least 256 members;
// rInfo: additional outgoing information
// pDataLen: out parameter, contains the byte length of the returned buffer
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
// frees the font data again
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData* pFont,
bool bVertical,
@@ -298,7 +304,7 @@ public:
virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
- virtual void DrawServerFontLayout( const ServerFontLayout& );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
@@ -316,11 +322,11 @@ void ImplSalDeInitGraphics( Os2SalGraphics* mpData );
// - Defines -
// -----------
-#define RGBCOLOR(r,g,b) ((ULONG)(((BYTE)(b)|((USHORT)(g)<<8))|(((ULONG)(BYTE)(r))<<16)))
-#define TY( y ) (mnHeight-(y)-1)
+#define RGBCOLOR(r,g,b) ((ULONG)(((BYTE)(b)|((USHORT)(g)<<8))|(((ULONG)(BYTE)(r))<<16)))
+#define TY( y ) (mnHeight-(y)-1)
// offset for lcid field, used for fallback font selection
-#define LCID_BASE 100
+#define LCID_BASE 100
// -----------
// - Inlines -
diff --git a/vcl/os2/inc/salids.hrc b/vcl/os2/inc/salids.hrc
index b5f2260d307f..7a8dcc8c0568 100644
--- a/vcl/os2/inc/salids.hrc
+++ b/vcl/os2/inc/salids.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -29,74 +29,74 @@
#define _SV_SALIDS_HRC
// Pointer
-#define SAL_RESID_POINTER_NULL 10000
-#define SAL_RESID_POINTER_HELP 10001
-#define SAL_RESID_POINTER_CROSS 10002
-#define SAL_RESID_POINTER_MOVE 10003
-#define SAL_RESID_POINTER_HSPLIT 10004
-#define SAL_RESID_POINTER_VSPLIT 10005
-#define SAL_RESID_POINTER_HSIZEBAR 10006
-#define SAL_RESID_POINTER_VSIZEBAR 10007
-#define SAL_RESID_POINTER_HAND 10008
-#define SAL_RESID_POINTER_REFHAND 10009
-#define SAL_RESID_POINTER_PEN 10010
-#define SAL_RESID_POINTER_MAGNIFY 10011
-#define SAL_RESID_POINTER_FILL 10012
-#define SAL_RESID_POINTER_ROTATE 10013
-#define SAL_RESID_POINTER_HSHEAR 10014
-#define SAL_RESID_POINTER_VSHEAR 10015
-#define SAL_RESID_POINTER_MIRROR 10016
-#define SAL_RESID_POINTER_CROOK 10017
-#define SAL_RESID_POINTER_CROP 10018
-#define SAL_RESID_POINTER_MOVEPOINT 10019
-#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10020
-#define SAL_RESID_POINTER_MOVEDATA 10021
-#define SAL_RESID_POINTER_COPYDATA 10022
-#define SAL_RESID_POINTER_LINKDATA 10023
-#define SAL_RESID_POINTER_MOVEDATALINK 10024
-#define SAL_RESID_POINTER_COPYDATALINK 10025
-#define SAL_RESID_POINTER_MOVEFILE 10026
-#define SAL_RESID_POINTER_COPYFILE 10027
-#define SAL_RESID_POINTER_LINKFILE 10028
-#define SAL_RESID_POINTER_MOVEFILELINK 10029
-#define SAL_RESID_POINTER_COPYFILELINK 10030
-#define SAL_RESID_POINTER_MOVEFILES 10031
-#define SAL_RESID_POINTER_COPYFILES 10032
-#define SAL_RESID_POINTER_DRAW_LINE 10033
-#define SAL_RESID_POINTER_DRAW_RECT 10034
-#define SAL_RESID_POINTER_DRAW_POLYGON 10035
-#define SAL_RESID_POINTER_DRAW_BEZIER 10036
-#define SAL_RESID_POINTER_DRAW_ARC 10037
-#define SAL_RESID_POINTER_DRAW_PIE 10038
-#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10039
-#define SAL_RESID_POINTER_DRAW_ELLIPSE 10040
-#define SAL_RESID_POINTER_DRAW_FREEHAND 10041
-#define SAL_RESID_POINTER_DRAW_CONNECT 10042
-#define SAL_RESID_POINTER_DRAW_TEXT 10043
-#define SAL_RESID_POINTER_DRAW_CAPTION 10044
-#define SAL_RESID_POINTER_CHART 10045
-#define SAL_RESID_POINTER_DETECTIVE 10046
-#define SAL_RESID_POINTER_PIVOT_COL 10047
-#define SAL_RESID_POINTER_PIVOT_ROW 10048
-#define SAL_RESID_POINTER_PIVOT_FIELD 10049
-#define SAL_RESID_POINTER_CHAIN 10050
-#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10051
-#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10052
-#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10053
-#define SAL_RESID_POINTER_AUTOSCROLL_N 10054
-#define SAL_RESID_POINTER_AUTOSCROLL_S 10055
-#define SAL_RESID_POINTER_AUTOSCROLL_W 10056
-#define SAL_RESID_POINTER_AUTOSCROLL_E 10057
-#define SAL_RESID_POINTER_AUTOSCROLL_NW 10058
-#define SAL_RESID_POINTER_AUTOSCROLL_NE 10059
-#define SAL_RESID_POINTER_AUTOSCROLL_SW 10060
-#define SAL_RESID_POINTER_AUTOSCROLL_SE 10061
-#define SAL_RESID_POINTER_AUTOSCROLL_NS 10062
-#define SAL_RESID_POINTER_AUTOSCROLL_WE 10063
-#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10064
+#define SAL_RESID_POINTER_NULL 10000
+#define SAL_RESID_POINTER_HELP 10001
+#define SAL_RESID_POINTER_CROSS 10002
+#define SAL_RESID_POINTER_MOVE 10003
+#define SAL_RESID_POINTER_HSPLIT 10004
+#define SAL_RESID_POINTER_VSPLIT 10005
+#define SAL_RESID_POINTER_HSIZEBAR 10006
+#define SAL_RESID_POINTER_VSIZEBAR 10007
+#define SAL_RESID_POINTER_HAND 10008
+#define SAL_RESID_POINTER_REFHAND 10009
+#define SAL_RESID_POINTER_PEN 10010
+#define SAL_RESID_POINTER_MAGNIFY 10011
+#define SAL_RESID_POINTER_FILL 10012
+#define SAL_RESID_POINTER_ROTATE 10013
+#define SAL_RESID_POINTER_HSHEAR 10014
+#define SAL_RESID_POINTER_VSHEAR 10015
+#define SAL_RESID_POINTER_MIRROR 10016
+#define SAL_RESID_POINTER_CROOK 10017
+#define SAL_RESID_POINTER_CROP 10018
+#define SAL_RESID_POINTER_MOVEPOINT 10019
+#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10020
+#define SAL_RESID_POINTER_MOVEDATA 10021
+#define SAL_RESID_POINTER_COPYDATA 10022
+#define SAL_RESID_POINTER_LINKDATA 10023
+#define SAL_RESID_POINTER_MOVEDATALINK 10024
+#define SAL_RESID_POINTER_COPYDATALINK 10025
+#define SAL_RESID_POINTER_MOVEFILE 10026
+#define SAL_RESID_POINTER_COPYFILE 10027
+#define SAL_RESID_POINTER_LINKFILE 10028
+#define SAL_RESID_POINTER_MOVEFILELINK 10029
+#define SAL_RESID_POINTER_COPYFILELINK 10030
+#define SAL_RESID_POINTER_MOVEFILES 10031
+#define SAL_RESID_POINTER_COPYFILES 10032
+#define SAL_RESID_POINTER_DRAW_LINE 10033
+#define SAL_RESID_POINTER_DRAW_RECT 10034
+#define SAL_RESID_POINTER_DRAW_POLYGON 10035
+#define SAL_RESID_POINTER_DRAW_BEZIER 10036
+#define SAL_RESID_POINTER_DRAW_ARC 10037
+#define SAL_RESID_POINTER_DRAW_PIE 10038
+#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10039
+#define SAL_RESID_POINTER_DRAW_ELLIPSE 10040
+#define SAL_RESID_POINTER_DRAW_FREEHAND 10041
+#define SAL_RESID_POINTER_DRAW_CONNECT 10042
+#define SAL_RESID_POINTER_DRAW_TEXT 10043
+#define SAL_RESID_POINTER_DRAW_CAPTION 10044
+#define SAL_RESID_POINTER_CHART 10045
+#define SAL_RESID_POINTER_DETECTIVE 10046
+#define SAL_RESID_POINTER_PIVOT_COL 10047
+#define SAL_RESID_POINTER_PIVOT_ROW 10048
+#define SAL_RESID_POINTER_PIVOT_FIELD 10049
+#define SAL_RESID_POINTER_CHAIN 10050
+#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10051
+#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10052
+#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10053
+#define SAL_RESID_POINTER_AUTOSCROLL_N 10054
+#define SAL_RESID_POINTER_AUTOSCROLL_S 10055
+#define SAL_RESID_POINTER_AUTOSCROLL_W 10056
+#define SAL_RESID_POINTER_AUTOSCROLL_E 10057
+#define SAL_RESID_POINTER_AUTOSCROLL_NW 10058
+#define SAL_RESID_POINTER_AUTOSCROLL_NE 10059
+#define SAL_RESID_POINTER_AUTOSCROLL_SW 10060
+#define SAL_RESID_POINTER_AUTOSCROLL_SE 10061
+#define SAL_RESID_POINTER_AUTOSCROLL_NS 10062
+#define SAL_RESID_POINTER_AUTOSCROLL_WE 10063
+#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10064
#define SAL_RESID_POINTER_AIRBRUSH 10070
-#define SAL_RESID_POINTER_TEXT_VERTICAL 10071
-#define SAL_RESID_POINTER_PIVOT_DELETE 10072
+#define SAL_RESID_POINTER_TEXT_VERTICAL 10071
+#define SAL_RESID_POINTER_PIVOT_DELETE 10072
#define SAL_RESID_POINTER_TAB_SELECT_S 10073
#define SAL_RESID_POINTER_TAB_SELECT_E 10074
#define SAL_RESID_POINTER_TAB_SELECT_SE 10075
@@ -104,6 +104,6 @@
#define SAL_RESID_POINTER_TAB_SELECT_SW 10077
#define SAL_RESID_POINTER_PAINTBRUSH 10078
-#define SAL_RESID_ICON_DEFAULT 1
+#define SAL_RESID_ICON_DEFAULT 1
#endif // _SV_SALIDS_HRC
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index 4d98b803dfba..aec53974e1f6 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,58 +39,61 @@
class SalYieldMutex;
-#define SAL_COMMANDLINENOINIT ((USHORT)0xFFFF)
-#define SAL_MAXPARAM 40
+#define SAL_COMMANDLINENOINIT ((USHORT)0xFFFF)
+#define SAL_MAXPARAM 40
class Os2SalInstance : public SalInstance
{
public:
- HAB mhAB; // anchor block handle
- HMQ mhMQ; // handle of os2 message queue
- HPOINTER mhAppIcon; // app icon
- int mnArgc; // commandline param count
- char** mpArgv; // commandline
- HWND mhComWnd; // window, for communication (between threads and the main thread)
- SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
+ HAB mhAB; // anchor block handle
+ HMQ mhMQ; // handle of os2 message queue
+ HPOINTER mhAppIcon; // app icon
+ int mnArgc; // commandline param count
+ char** mpArgv; // commandline
+ 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
+ USHORT mnYieldWaitCount; // Wait-Count
public:
Os2SalInstance();
virtual ~Os2SalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
- virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
- virtual void DestroyObject( SalObject* pObject );
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual void DestroyObject( SalObject* pObject );
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
USHORT nBitCount, const SystemGraphicsData *pData );
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
virtual String GetDefaultPrinter();
- virtual SalTimer* CreateSalTimer();
- virtual SalI18NImeStatus* CreateI18NImeStatus();
- virtual SalSystem* CreateSalSystem();
- virtual SalBitmap* CreateSalBitmap();
+ virtual SalTimer* CreateSalTimer();
+ virtual SalI18NImeStatus* CreateI18NImeStatus();
+ virtual SalSystem* CreateSalSystem();
+ virtual SalBitmap* CreateSalBitmap();
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 ULONG ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( ULONG nCount );
+ 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);
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+ virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
};
SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
diff --git a/vcl/os2/inc/sallang.hxx b/vcl/os2/inc/sallang.hxx
index f9122cf2b3a4..05025044f021 100644
--- a/vcl/os2/inc/sallang.hxx
+++ b/vcl/os2/inc/sallang.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,28 +36,28 @@
// --------------------
// --- Key-Namen ---
-#define LSTR_KEY_SHIFT 0
-#define LSTR_KEY_CTRL 1
-#define LSTR_KEY_ALT 2
-#define LSTR_KEY_UP 3
-#define LSTR_KEY_DOWN 4
-#define LSTR_KEY_LEFT 5
-#define LSTR_KEY_RIGHT 6
-#define LSTR_KEY_HOME 7
-#define LSTR_KEY_END 8
-#define LSTR_KEY_PAGEUP 9
-#define LSTR_KEY_PAGEDOWN 10
-#define LSTR_KEY_RETURN 11
-#define LSTR_KEY_ESC 12
-#define LSTR_KEY_TAB 13
-#define LSTR_KEY_BACKSPACE 14
-#define LSTR_KEY_SPACE 15
-#define LSTR_KEY_INSERT 16
-#define LSTR_KEY_DELETE 17
+#define LSTR_KEY_SHIFT 0
+#define LSTR_KEY_CTRL 1
+#define LSTR_KEY_ALT 2
+#define LSTR_KEY_UP 3
+#define LSTR_KEY_DOWN 4
+#define LSTR_KEY_LEFT 5
+#define LSTR_KEY_RIGHT 6
+#define LSTR_KEY_HOME 7
+#define LSTR_KEY_END 8
+#define LSTR_KEY_PAGEUP 9
+#define LSTR_KEY_PAGEDOWN 10
+#define LSTR_KEY_RETURN 11
+#define LSTR_KEY_ESC 12
+#define LSTR_KEY_TAB 13
+#define LSTR_KEY_BACKSPACE 14
+#define LSTR_KEY_SPACE 15
+#define LSTR_KEY_INSERT 16
+#define LSTR_KEY_DELETE 17
// --- Anzahl der Texte ---
-#define LSTR_COUNT 18
+#define LSTR_COUNT 18
// --------------------------------------------
// - Methoden zum Abfragen der Sprach-Strings -
diff --git a/vcl/os2/inc/sallayout.h b/vcl/os2/inc/sallayout.h
index d08c36420405..d8bd3c4eae41 100644
--- a/vcl/os2/inc/sallayout.h
+++ b/vcl/os2/inc/sallayout.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/os2/inc/salmenu.h b/vcl/os2/inc/salmenu.h
index 8c46b638f063..d87384326219 100644
--- a/vcl/os2/inc/salmenu.h
+++ b/vcl/os2/inc/salmenu.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h
index 467c4537dc2a..2712a1f2371e 100644
--- a/vcl/os2/inc/salobj.h
+++ b/vcl/os2/inc/salobj.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,33 +39,32 @@
class Os2SalObject : public SalObject
{
public:
- HWND mhWnd; // Window handle
- HWND mhWndChild; // Child Window handle
- HWND mhLastFocusWnd; // Child-Window, welches als letztes den Focus hatte
- SystemChildData maSysData; // SystemEnvData
- HWND mhLastClipWnd; // LastClip-Window
- HWND mhOldLastClipWnd; // LastClip-Window befor BeginSetClipRegion
- long mnHeight; // Fenster-Hoehe fuer Positionsumrechnung
- Os2SalObject* mpNextObject; // pointer to next object
- void* mpInst; // instance handle for callback
- SALOBJECTPROC mpProc; // callback proc
+ HWND mhWnd; // Window handle
+ HWND mhWndChild; // Child Window handle
+ HWND mhLastFocusWnd; // Child-Window, welches als letztes den Focus hatte
+ SystemChildData maSysData; // SystemEnvData
+ HWND mhLastClipWnd; // LastClip-Window
+ HWND mhOldLastClipWnd; // LastClip-Window befor BeginSetClipRegion
+ long mnHeight; // Fenster-Hoehe fuer Positionsumrechnung
+ Os2SalObject* mpNextObject; // pointer to next object
+ void* mpInst; // instance handle for callback
+ SALOBJECTPROC mpProc; // callback proc
Os2SalObject();
virtual ~Os2SalObject();
- virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( 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 GrabFocus();
- virtual void SetBackground();
- virtual void SetBackground( SalColor nSalColor );
- virtual const SystemEnvData* GetSystemData() const;
- virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( 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 GrabFocus();
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
+ virtual const SystemEnvData* GetSystemData() const;
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/os2/inc/salprn.h b/vcl/os2/inc/salprn.h
index 1bcd47465aab..9f66d240cc9e 100644
--- a/vcl/os2/inc/salprn.h
+++ b/vcl/os2/inc/salprn.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,39 +48,39 @@ typedef ImplTrayInfo* PIMPLTRAYINFO;
class Os2SalInfoPrinter : public SalInfoPrinter
{
public:
- Os2SalGraphics* mpGraphics; // Graphics
- HDC mhDC; // printer hdc
- HPS mhPS; // printer hps
- ByteString maPrinterName; // pszPrinters
- ByteString maName; // pszName bzw. LogAdress
- ByteString maDriverName; // pszDriverName nach .
- ByteString maDeviceName; // pszDriverName bis .
- ByteString maJobSetupDeviceName; // DeviceName aus pDriverData
- PIMPLFORMINFO* mpFormArray; // PaperForm-Names
- USHORT mnFormCount; // PaperForm-Count
- PIMPLTRAYINFO* mpTrayArray; // PaperTray-Names
- USHORT mnTrayCount; // PaperTray-Count
- BOOL mbDJPSupported; // is driver DJP enabled
- BOOL mbGraphics; // is Graphics used
+ Os2SalGraphics* mpGraphics; // Graphics
+ HDC mhDC; // printer hdc
+ HPS mhPS; // printer hps
+ ByteString maPrinterName; // pszPrinters
+ ByteString maName; // pszName bzw. LogAdress
+ ByteString maDriverName; // pszDriverName nach .
+ ByteString maDeviceName; // pszDriverName bis .
+ ByteString maJobSetupDeviceName; // DeviceName aus pDriverData
+ PIMPLFORMINFO* mpFormArray; // PaperForm-Names
+ USHORT mnFormCount; // PaperForm-Count
+ PIMPLTRAYINFO* mpTrayArray; // PaperTray-Names
+ USHORT mnTrayCount; // PaperTray-Count
+ BOOL mbDJPSupported; // is driver DJP enabled
+ BOOL mbGraphics; // is Graphics used
public:
Os2SalInfoPrinter();
virtual ~Os2SalInfoPrinter();
- 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 void GetPageInfo( const ImplJobSetup* pSetupData,
+ 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 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 void InitPaperFormats( const ImplJobSetup* pSetupData );
- virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
+ virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
+ virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
// ------------------
@@ -90,16 +90,16 @@ public:
class SalPrinterData00
{
public:
- Os2SalGraphics* mpGraphics; // current Printer graphics
- SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
- HDC mhDC; // printer hdc
- HPS mhPS; // printer hps
- ULONG mnError; // Error Code
- BOOL mbFirstPage; // IsFirstPage
- BOOL mbAbort; // JobAborted
- BOOL mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
- char maCommentBuf[33]; // Comment
- char maCopyBuf[10]; // Kopien
+ Os2SalGraphics* mpGraphics; // current Printer graphics
+ SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
+ HDC mhDC; // printer hdc
+ HPS mhPS; // printer hps
+ ULONG mnError; // Error Code
+ BOOL mbFirstPage; // IsFirstPage
+ BOOL mbAbort; // JobAborted
+ BOOL mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
+ char maCommentBuf[33]; // Comment
+ char maCopyBuf[10]; // Kopien
};
// -----------------
@@ -109,39 +109,39 @@ public:
class Os2SalPrinter : public SalPrinter
{
public:
- Os2SalGraphics* mpGraphics; // current Printer graphics
- Os2SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
- Os2SalPrinter* mpNextPrinter; // next printing printer
- HDC mhDC; // printer hdc
- HPS mhPS; // printer hps
- ULONG mnError; // Error Code
- BOOL mbFirstPage; // IsFirstPage
- BOOL mbAbort; // JobAborted
- BOOL mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
- char maCommentBuf[33]; // Comment
- char maCopyBuf[16]; // Kopien
- //HDC mhDC; // printer hdc
- //ULONG mnError; // Error Code
- //ULONG mnCopies; // Kopien
- //BOOL mbCollate; // Sortierte Kopien
- //BOOL mbAbort; // Job Aborted
+ Os2SalGraphics* mpGraphics; // current Printer graphics
+ Os2SalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
+ Os2SalPrinter* mpNextPrinter; // next printing printer
+ HDC mhDC; // printer hdc
+ HPS mhPS; // printer hps
+ ULONG mnError; // Error Code
+ BOOL mbFirstPage; // IsFirstPage
+ BOOL mbAbort; // JobAborted
+ BOOL mbPrintDJPSupported; // is driver PrintDJP enabled (DEVESC_NEWFRAME_WPROP)
+ char maCommentBuf[33]; // Comment
+ char maCopyBuf[16]; // Kopien
+ //HDC mhDC; // printer hdc
+ //ULONG mnError; // Error Code
+ //ULONG mnCopies; // Kopien
+ //BOOL mbCollate; // Sortierte Kopien
+ //BOOL mbAbort; // Job Aborted
public:
Os2SalPrinter();
virtual ~Os2SalPrinter();
- virtual BOOL StartJob( const XubString* pFileName,
+ virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
ULONG 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 BOOL EndJob();
+ virtual BOOL AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
+ virtual BOOL EndPage();
+ virtual ULONG GetErrorCode();
};
#endif // _SV_SALPRN_H
diff --git a/vcl/os2/inc/salsound.h b/vcl/os2/inc/salsound.h
index 2445bbe3c1a0..27a7a9aa1aff 100644
--- a/vcl/os2/inc/salsound.h
+++ b/vcl/os2/inc/salsound.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,50 +46,50 @@
class Os2SalSound : public SalSound
{
private:
-
- static HMODULE mhMCILib;
- static ULONG mnSoundState;
- static void* mpMCIFnc;
- SALSOUNDPROC mpProc;
- void* mpInst;
- ULONG mnStartTime;
- ULONG mnPlayLen;
- HWND mhSoundWnd;
- USHORT mnDeviceId;
- BOOL mbLoop;
- BOOL mbPaused;
+
+ static HMODULE mhMCILib;
+ static ULONG mnSoundState;
+ static void* mpMCIFnc;
+ SALSOUNDPROC mpProc;
+ void* mpInst;
+ ULONG mnStartTime;
+ ULONG mnPlayLen;
+ HWND mhSoundWnd;
+ USHORT mnDeviceId;
+ BOOL mbLoop;
+ BOOL mbPaused;
public:
void ImplSetError( ULONG nMciErr );
- void ImplNotify( SoundNotification eNotification, ULONG nError );
+ void ImplNotify( SoundNotification eNotification, ULONG nError );
-public:
+public:
- BOOL Create();
- //static BOOL IsValid() { return( SOUND_STATE_VALID == Os2SalSound::mnSoundState ); }
- //BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen );
- //BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen );
+ BOOL Create();
+ //static BOOL IsValid() { return( SOUND_STATE_VALID == Os2SalSound::mnSoundState ); }
+ //BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen );
+ //BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen );
- void SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
+ void SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
{ mpInst = pInst; mpProc = pProc; }
public:
Os2SalSound();
virtual ~Os2SalSound();
+
+ virtual bool IsValid();
+ virtual bool Init( const String& rSoundName, ULONG& rSoundLen );
+ virtual void Play( ULONG nStartTime, ULONG nPlayTime, bool bLoop );
+ virtual void Stop();
+ virtual void Pause();
+ virtual void Continue();
+ virtual bool IsLoopMode() const;
+ virtual bool IsPlaying() const;
+ virtual bool IsPaused() const;
- virtual bool IsValid();
- virtual bool Init( const String& rSoundName, ULONG& rSoundLen );
- virtual void Play( ULONG nStartTime, ULONG nPlayTime, bool bLoop );
- virtual void Stop();
- virtual void Pause();
- virtual void Continue();
- virtual bool IsLoopMode() const;
- virtual bool IsPlaying() const;
- virtual bool IsPaused() const;
-
- bool ImplCreate();
- void ImplDestroy();
- static void Release();
+ bool ImplCreate();
+ void ImplDestroy();
+ static void Release();
};
#endif // _SV_SALSOUND_H
diff --git a/vcl/os2/inc/salsound.hxx b/vcl/os2/inc/salsound.hxx
index e46e3e666a2c..3007a861b1f0 100644
--- a/vcl/os2/inc/salsound.hxx
+++ b/vcl/os2/inc/salsound.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,40 +43,40 @@
class SalSound
{
private:
-
- static HMODULE mhMCILib;
- static ULONG mnSoundState;
- static void* mpMCIFnc;
- SALSOUNDPROC mpProc;
- void* mpInst;
- ULONG mnStartTime;
- ULONG mnPlayLen;
- HWND mhSoundWnd;
- USHORT mnDeviceId;
- BOOL mbLoop;
- BOOL mbPaused;
+
+ static HMODULE mhMCILib;
+ static ULONG mnSoundState;
+ static void* mpMCIFnc;
+ SALSOUNDPROC mpProc;
+ void* mpInst;
+ ULONG mnStartTime;
+ ULONG mnPlayLen;
+ HWND mhSoundWnd;
+ USHORT mnDeviceId;
+ BOOL mbLoop;
+ BOOL mbPaused;
public:
void ImplSetError( ULONG nMciErr );
- void ImplNotify( SoundNotification eNotification, ULONG nError );
-
-public:
+ void ImplNotify( SoundNotification eNotification, ULONG nError );
+public:
+
SalSound();
~SalSound();
- BOOL Create();
- static void Release();
- static BOOL IsValid() { return( SOUND_STATE_VALID == SalSound::mnSoundState ); }
+ BOOL Create();
+ static void Release();
+ static BOOL IsValid() { return( SOUND_STATE_VALID == SalSound::mnSoundState ); }
- BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen );
- BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen );
- void Play( ULONG nStartTime, ULONG nPlayTime, BOOL bLoop );
- void Stop();
- void Pause();
+ BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen );
+ BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen );
+ void Play( ULONG nStartTime, ULONG nPlayTime, BOOL bLoop );
+ void Stop();
+ void Pause();
- void SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
+ void SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
{ mpInst = pInst; mpProc = pProc; }
};
diff --git a/vcl/os2/inc/salsys.h b/vcl/os2/inc/salsys.h
index 24472a4c43d4..ac17c26991c9 100644
--- a/vcl/os2/inc/salsys.h
+++ b/vcl/os2/inc/salsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/os2/inc/saltimer.h b/vcl/os2/inc/saltimer.h
index de150fcfb10c..09e618bb6613 100644
--- a/vcl/os2/inc/saltimer.h
+++ b/vcl/os2/inc/saltimer.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,8 +38,8 @@ public:
virtual ~Os2SalTimer();
// overload all pure virtual methods
- void Start( ULONG nMS );
- void Stop();
+ void Start( ULONG nMS );
+ void Stop();
};
#endif
diff --git a/vcl/os2/inc/salvd.h b/vcl/os2/inc/salvd.h
index b5250c913c7e..d613215290e9 100644
--- a/vcl/os2/inc/salvd.h
+++ b/vcl/os2/inc/salvd.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,21 +42,21 @@ class Os2SalGraphics;
class Os2SalVirtualDevice : public SalVirtualDevice
{
public:
- HPS mhPS; // HPS
- HDC mhDC; // HDC
- HBITMAP mhBmp; // Memory Bitmap
- HBITMAP mhDefBmp; // Default Bitmap
- Os2SalGraphics* mpGraphics; // current VirDev graphics
- USHORT mnBitCount; // BitCount (0 or 1)
- BOOL mbGraphics; // is Graphics used
+ HPS mhPS; // HPS
+ HDC mhDC; // HDC
+ HBITMAP mhBmp; // Memory Bitmap
+ HBITMAP mhDefBmp; // Default Bitmap
+ Os2SalGraphics* mpGraphics; // current VirDev graphics
+ USHORT mnBitCount; // BitCount (0 or 1)
+ BOOL mbGraphics; // is Graphics used
Os2SalVirtualDevice();
virtual ~Os2SalVirtualDevice();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
virtual BOOL SetSize( long nNewDX, long nNewDY );
- virtual void GetSize( long& rWidth, long& rHeight );
+ virtual void GetSize( long& rWidth, long& rHeight );
};
// Help-Functions
diff --git a/vcl/os2/inc/svsys.h b/vcl/os2/inc/svsys.h
index 354f53fb6d3a..d87dab98d707 100644
--- a/vcl/os2/inc/svsys.h
+++ b/vcl/os2/inc/svsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/os2/inc/wingdi.h b/vcl/os2/inc/wingdi.h
index c6cf93964df7..67e508afb89c 100644
--- a/vcl/os2/inc/wingdi.h
+++ b/vcl/os2/inc/wingdi.h
@@ -39,11 +39,11 @@ typedef struct tagTTPOLYGONHEADER
typedef struct
{
- UINT gmBlackBoxX;
- UINT gmBlackBoxY;
- POINT gmptGlyphOrigin;
- SHORT gmCellIncX;
- SHORT gmCellIncY;
+ UINT gmBlackBoxX;
+ UINT gmBlackBoxY;
+ POINT gmptGlyphOrigin;
+ SHORT gmCellIncX;
+ SHORT gmCellIncY;
} GLYPHMETRICS, *LPGLYPHMETRICS;
#define GGO_METRICS 0
diff --git a/vcl/os2/source/app/makefile.mk b/vcl/os2/source/app/makefile.mk
index 9f3bfd7e89d8..80aeb7f568fb 100644
--- a/vcl/os2/source/app/makefile.mk
+++ b/vcl/os2/source/app/makefile.mk
@@ -32,9 +32,12 @@ TARGET=salapp
# --- Settings -----------------------------------------------------
+#.INCLUDE : svpre.mk
.INCLUDE : settings.mk
+#.INCLUDE : sv.mk
.INCLUDE : $(PRJ)$/util$/makefile2.pmk
+
# --- Files --------------------------------------------------------
YD00_CXXFILES=\
diff --git a/vcl/os2/source/app/salinfo.cxx b/vcl/os2/source/app/salinfo.cxx
index 08ca8b031982..3eca27b13b92 100644
--- a/vcl/os2/source/app/salinfo.cxx
+++ b/vcl/os2/source/app/salinfo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -131,7 +131,7 @@ int Os2SalSystem::ShowNativeMessageBox(const String& rTitle, const String& rMess
pSVData->mpIntroWindow->Hide();
return WinMessageBox(
- HWND_DESKTOP, HWND_DESKTOP,
+ HWND_DESKTOP, HWND_DESKTOP,
(PSZ)CHAR_POINTER(rMessage),
(PSZ)CHAR_POINTER(rTitle),
0, nFlags);
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index e4fd783ccb27..632263733a46 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/apptypes.hxx>
+#include <vcl/salatype.hxx>
#include <saldata.hxx>
#include <salinst.h>
#include <salframe.h>
@@ -85,9 +85,9 @@ MRESULT EXPENTRY SalComWndProc( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nMP2
class SalYieldMutex : public vcl::SolarMutexObject
{
public:
- Os2SalInstance* mpInstData;
- ULONG mnCount;
- ULONG mnThreadId;
+ Os2SalInstance* mpInstData;
+ ULONG mnCount;
+ ULONG mnThreadId;
public:
SalYieldMutex( Os2SalInstance* pInstData );
@@ -96,16 +96,16 @@ public:
virtual void SAL_CALL release();
virtual sal_Bool SAL_CALL tryToAcquire();
- ULONG GetAcquireCount( ULONG nThreadId );
+ ULONG GetAcquireCount( ULONG nThreadId );
};
// -----------------------------------------------------------------------
SalYieldMutex::SalYieldMutex( Os2SalInstance* pInstData )
{
- mpInstData = pInstData;
- mnCount = 0;
- mnThreadId = 0;
+ mpInstData = pInstData;
+ mnCount = 0;
+ mnThreadId = 0;
}
// -----------------------------------------------------------------------
@@ -295,11 +295,12 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-bool Os2SalInstance::CheckYieldMutex()
+#ifdef DBG_UTIL
+
+void ImplDbgTestSolarMutex()
{
- bool bRet = true;
- SalData* pSalData = GetSalData();
- ULONG nCurThreadId = GetCurrentThreadId();
+ SalData* pSalData = GetSalData();
+ ULONG nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
{
if ( pSalData->mpFirstInstance )
@@ -307,7 +308,7 @@ bool Os2SalInstance::CheckYieldMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- bRet = false;
+ DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
}
}
}
@@ -318,13 +319,14 @@ bool Os2SalInstance::CheckYieldMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- bRet = false;
+ DBG_ERROR( "SolarMutex not locked in the main thread" );
}
}
}
- return bRet;
}
+#endif
+
// =======================================================================
void InitSalData()
@@ -354,7 +356,7 @@ void InitSalMain()
HAB hAB;
HMQ hMQ;
SalData* pData = GetAppSalData();
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL>0
printf("InitSalMain\n");
#endif
@@ -387,7 +389,7 @@ printf("InitSalMain\n");
void DeInitSalMain()
{
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL>0
printf("DeInitSalMain\n");
#endif
@@ -402,7 +404,7 @@ printf("DeInitSalMain\n");
SalInstance* CreateSalInstance()
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
// determine the os2 version
ULONG nMayor;
@@ -441,18 +443,18 @@ SalInstance* CreateSalInstance()
if ( !hComWnd )
return NULL;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("CreateSalInstance hComWnd %x\n", hComWnd);
#endif
Os2SalInstance* pInst = new Os2SalInstance;
// init instance (only one instance in this version !!!)
- pSalData->mpFirstInstance = pInst;
- pInst->mhAB = pSalData->mhAB;
- pInst->mhMQ = pSalData->mhMQ;
- pInst->mnArgc = pSalData->mnArgc;
- pInst->mpArgv = pSalData->mpArgv;
- pInst->mhComWnd = hComWnd;
+ pSalData->mpFirstInstance = pInst;
+ pInst->mhAB = pSalData->mhAB;
+ pInst->mhMQ = pSalData->mhMQ;
+ pInst->mnArgc = pSalData->mnArgc;
+ pInst->mpArgv = pSalData->mpArgv;
+ pInst->mhComWnd = hComWnd;
// AppIcon ermitteln
ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, pInst->mhAppIcon);
@@ -469,7 +471,7 @@ void DestroySalInstance( SalInstance* pInst )
{
SalData* pSalData = GetSalData();
- // (only one instance in this version !!!)
+ // (only one instance in this version !!!)
ImplFreeSalGDI();
#ifdef ENABLE_IME
@@ -489,9 +491,9 @@ void DestroySalInstance( SalInstance* pInst )
Os2SalInstance::Os2SalInstance()
{
- mhComWnd = 0;
- mpSalYieldMutex = new SalYieldMutex( this );
- mpSalWaitMutex = new osl::Mutex;
+ mhComWnd = 0;
+ mpSalYieldMutex = new SalYieldMutex( this );
+ mpSalWaitMutex = new osl::Mutex;
mnYieldWaitCount = 0;
mpSalYieldMutex->acquire();
::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
@@ -532,7 +534,7 @@ void Os2SalInstance::AcquireYieldMutex( ULONG nCount )
static void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
- QMSG aMsg;
+ QMSG aMsg;
bool bWasMsg = false, bOneEvent = false;
bool bQuit = false;
@@ -577,11 +579,11 @@ static void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
void Os2SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
- SalYieldMutex* pYieldMutex = mpSalYieldMutex;
- SalData* pSalData = GetSalData();
- ULONG nCurThreadId = GetCurrentThreadId();
- ULONG nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
- ULONG n = nCount;
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ SalData* pSalData = GetSalData();
+ ULONG nCurThreadId = GetCurrentThreadId();
+ ULONG nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
+ ULONG n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -662,7 +664,7 @@ MRESULT EXPENTRY SalComWndProc( HWND hWnd, ULONG nMsg,
//in the structure (GetWindowPtr()).
if (WinDestroyWindow((HWND)nMP2) == 0)
{
- OSL_FAIL("DestroyWindow failed!");
+ OSL_ENSURE(0, "DestroyWindow failed!");
//Failure: We remove the SalFrame from the window structure. So we avoid that
// the window structure may contain an invalid pointer, once the SalFrame is deleted.
SetWindowPtr((HWND)nMP2, 0);
@@ -695,7 +697,7 @@ MRESULT EXPENTRY SalComWndProc( HWND hWnd, ULONG nMsg,
bool Os2SalInstance::AnyInput( USHORT nType )
{
SalData* pSalData = GetSalData();
- QMSG aQMSG;
+ QMSG aQMSG;
if ( (nType & (INPUT_ANY)) == INPUT_ANY )
{
@@ -801,8 +803,8 @@ void Os2SalInstance::DestroyObject( SalObject* pObject )
void* Os2SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
{
- rReturnedBytes = 1;
- rReturnedType = AsciiCString;
+ rReturnedBytes = 1;
+ rReturnedType = AsciiCString;
return (void*) "";
}
diff --git a/vcl/os2/source/app/sallang.cxx b/vcl/os2/source/app/sallang.cxx
index b93787013bbb..1701343a634d 100644
--- a/vcl/os2/source/app/sallang.cxx
+++ b/vcl/os2/source/app/sallang.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/os2/source/app/salshl.cxx b/vcl/os2/source/app/salshl.cxx
index 5974fbde8bd9..917f81b37595 100644
--- a/vcl/os2/source/app/salshl.cxx
+++ b/vcl/os2/source/app/salshl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,16 +41,16 @@ static HMODULE mhMod = ImplGetModule();
// =======================================================================
-APIRET APIENTRY DosQueryModFromEIP (HMODULE *phMod, ULONG *pObjNum,
- ULONG BuffLen, PCHAR pBuff, ULONG *pOffset, ULONG Address);
+APIRET APIENTRY DosQueryModFromEIP (HMODULE *phMod, ULONG *pObjNum,
+ ULONG BuffLen, PCHAR pBuff, ULONG *pOffset, ULONG Address);
HMODULE ImplGetModule(void)
{
- HMODULE hMod;
- ULONG ObjNum;
- CHAR Buff[2*_MAX_PATH];
- ULONG Offset;
- APIRET rc;
+ HMODULE hMod;
+ ULONG ObjNum;
+ CHAR Buff[2*_MAX_PATH];
+ ULONG Offset;
+ APIRET rc;
// get module handle (and name)
rc = DosQueryModFromEIP( &hMod, &ObjNum, sizeof( Buff), Buff, &Offset, (ULONG)ImplGetModule);
@@ -70,7 +70,7 @@ HPOINTER ImplLoadSalCursor( int nId )
HPOINTER hPointer = WinLoadPointer( HWND_DESKTOP, aSalShlData.mhMod, nId );
DBG_ASSERT( hPointer, "pointer not found in sal resource" );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
if (!hPointer)
debug_printf( "ImplLoadSalCursor: pointer %d not found in sal resource\n", nId);
#endif
diff --git a/vcl/os2/source/app/saltimer.cxx b/vcl/os2/source/app/saltimer.cxx
index a27458edd793..c46e954dcfd8 100644
--- a/vcl/os2/source/app/saltimer.cxx
+++ b/vcl/os2/source/app/saltimer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,14 +36,14 @@
// =======================================================================
// Maximale Periode
-#define MAX_SYSPERIOD 65533
-#define IDTIMER 10
+#define MAX_SYSPERIOD 65533
+#define IDTIMER 10
// =======================================================================
void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
// Periode darf nicht zu gross sein, da OS2 2.11 mit USHORT arbeitet
// Remenber the time of the timer
@@ -91,7 +91,7 @@ void Os2SalTimer::Start( ULONG nMS )
void Os2SalTimer::Stop()
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
// Exitstiert ein Timer, dann diesen zerstoeren
if ( pSalData->mnTimerId ) {
diff --git a/vcl/os2/source/gdi/os2layout.cxx b/vcl/os2/source/gdi/os2layout.cxx
index a6574c3a2171..4724c9bb5185 100644
--- a/vcl/os2/source/gdi/os2layout.cxx
+++ b/vcl/os2/source/gdi/os2layout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -26,6 +26,8 @@
*
************************************************************************/
+#include <tools/svwin.h>
+
#include <rtl/ustring.hxx>
#include <osl/module.h>
#include <salgdi.h>
@@ -47,11 +49,13 @@
// for GetMirroredChar
#include <vcl/svapp.hxx>
-#include <boost/unordered_map.hpp>
-typedef boost::unordered_map<int,int> IntMap;
+#include <hash_map>
+typedef std::hash_map<int,int> IntMap;
#define DROPPED_OUTGLYPH 0xFFFF
+using namespace rtl;
+
// =======================================================================
// OS/2 specific physical font instance
@@ -70,7 +74,7 @@ public:
void SetKernData( int, const KERNINGPAIRS* );
int GetKerning( sal_Unicode, sal_Unicode ) const;
private:
- KERNINGPAIRS* mpKerningPairs;
+ KERNINGPAIRS* mpKerningPairs;
int mnKerningPairs;
#endif // GCP_KERN_HACK
@@ -107,8 +111,8 @@ public:
float GetFontScale() const { return mfFontScale; }
protected:
- HPS mhPS; // OS2 device handle
- FATTRS mhFont;
+ HPS mhPS; // OS2 device handle
+ FATTRS mhFont;
int mnBaseAdv; // x-offset relative to Layout origin
float mfFontScale; // allows metrics emulation of huge font sizes
@@ -330,7 +334,7 @@ bool Os2SalLayout::LayoutText( ImplLayoutArgs& rArgs )
nGcpOption |= GCP_USEKERNING;
#endif // GCP_KERN_HACK
- LONG lLcid = Ft2QueryCharSet( mhPS);
+ LONG lLcid = Ft2QueryCharSet( mhPS);
for( i = 0; i < mnGlyphCount; ++i )
mpOutGlyphs[i] = pBidiStr[ i ];
@@ -368,7 +372,7 @@ bool Os2SalLayout::LayoutText( ImplLayoutArgs& rArgs )
if (Ft2FontSupportsUnicodeChar( mhPS, lLcid, TRUE, nCharCode))
continue;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalLayout::LayoutText font does not support unicode char\n");
#endif
// request glyph fallback at this position in the string
@@ -566,9 +570,9 @@ void Os2SalLayout::DrawText( SalGraphics& rGraphics ) const
if( mnGlyphCount <= 0 )
return;
- Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- POINTL aPt;
- APIRET rc;
+ Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
+ POINTL aPt;
+ APIRET rc;
aPt.x = aPos.X();
aPt.y = static_cast<Os2SalGraphics&>(rGraphics).mnHeight - aPos.Y();
@@ -579,23 +583,23 @@ void Os2SalLayout::DrawText( SalGraphics& rGraphics ) const
// convert to codepage
ByteString str( mpOutGlyphs, gsl_getSystemTextEncoding() );
// gliph size is not recalculated, so it could be wrong!
- rc = Ft2CharStringPosAtA( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
- &aPt, NULL, CHS_VECTOR, mnGlyphCount, (PSZ)str.GetBuffer(),
+ rc = Ft2CharStringPosAtA( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
+ &aPt, NULL, CHS_VECTOR, mnGlyphCount, (PSZ)str.GetBuffer(),
(LONG*)mpGlyphAdvances, 0);
} else {
// try unicode rendering to screen
- rc = Ft2CharStringPosAtW( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
- &aPt, NULL, CHS_VECTOR, mnGlyphCount, (LPWSTR)mpOutGlyphs,
+ rc = Ft2CharStringPosAtW( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
+ &aPt, NULL, CHS_VECTOR, mnGlyphCount, (LPWSTR)mpOutGlyphs,
(LONG*)mpGlyphAdvances, 0);
if (rc == GPI_ERROR) {
// if *W fails, convert to codepage and use *A (fallback to GPI into ft2)
ByteString str( mpOutGlyphs, gsl_getSystemTextEncoding() );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf("Os2SalLayout::DrawText HPS %08x PosAtW failed '%s'!\n",static_cast<Os2SalGraphics&>(rGraphics).mhPS,str.GetBuffer());
#endif
// gliph size is not recalculated, so it could be wrong!
- rc = Ft2CharStringPosAtA( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
- &aPt, NULL, CHS_VECTOR, mnGlyphCount, (PSZ)str.GetBuffer(),
+ rc = Ft2CharStringPosAtA( static_cast<Os2SalGraphics&>(rGraphics).mhPS,
+ &aPt, NULL, CHS_VECTOR, mnGlyphCount, (PSZ)str.GetBuffer(),
(LONG*)mpGlyphAdvances, 0);
}
}
@@ -949,6 +953,9 @@ SalLayout* Os2SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
}
#endif // GCP_KERN_HACK
+ //BYTE eCharSet = ANSI_CHARSET;
+ //if( mpLogFont )
+ // eCharSet = mpLogFont->lfCharSet;
pLayout = new Os2SalLayout( mhPS, 0, rFontFace, rFontInstance );
}
@@ -1032,6 +1039,7 @@ ImplFontData* ImplOs2FontData::Clone() const
ImplFontEntry* ImplOs2FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const
{
+ //debug_printf("ImplOs2FontData::CreateFontInstance\n");
ImplFontEntry* pEntry = new ImplOs2FontEntry( rFSD );
return pEntry;
}
diff --git a/vcl/os2/source/gdi/salbmp.cxx b/vcl/os2/source/gdi/salbmp.cxx
index c6ee24011212..414371847e17 100644
--- a/vcl/os2/source/gdi/salbmp.cxx
+++ b/vcl/os2/source/gdi/salbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -182,11 +182,11 @@ bool Os2SalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
if( rSalBmp.mhDIB )
{
- HPS hPS = pGraphics->mhPS;
- HBITMAP hNewDDB;
- BITMAPINFOHEADER2 aInfoHeader;
- const Size aSize( rSalBmp.GetSize() );
- long nFormat[ 2 ];
+ HPS hPS = pGraphics->mhPS;
+ HBITMAP hNewDDB;
+ BITMAPINFOHEADER2 aInfoHeader;
+ const Size aSize( rSalBmp.GetSize() );
+ long nFormat[ 2 ];
memset( &aInfoHeader, 0, sizeof( aInfoHeader ) );
aInfoHeader.cbFix = 16;
@@ -206,8 +206,8 @@ bool Os2SalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
// BitCount == 1 ist wegen aller moeglichen Treiberfehler nicht moeglich
if( rSalBmp.GetBitCount() == 1 )
{
- HANDLE hTmp = ImplCreateDIB4FromDIB1( rSalBmp.mhDIB );
- PBYTE pBits = (PBYTE) hTmp + *(ULONG*) hTmp + ImplGetDIBColorCount( hTmp ) * sizeof( RGB2 );
+ HANDLE hTmp = ImplCreateDIB4FromDIB1( rSalBmp.mhDIB );
+ PBYTE pBits = (PBYTE) hTmp + *(ULONG*) hTmp + ImplGetDIBColorCount( hTmp ) * sizeof( RGB2 );
hNewDDB = GpiCreateBitmap( hPS, &aInfoHeader, CBM_INIT, pBits, (PBITMAPINFO2) hTmp );
rtl_freeMemory( (void*)hTmp );
@@ -349,16 +349,16 @@ HANDLE Os2SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const Bitma
if ( rSize.Width() && rSize.Height() && ( nBits == 1 || nBits == 4 || nBits == 8 || nBits == 24 ) )
{
- const ULONG nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
- const USHORT nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
+ const ULONG nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
+ const USHORT nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
hDIB = (HANDLE) rtl_allocateZeroMemory( sizeof( BITMAPINFOHEADER2 ) + nColors * sizeof( RGB2 ) + nImageSize );
if( hDIB )
{
// bitmap infos can be found at the beginning of the memory
- PBITMAPINFO2 pBI = (PBITMAPINFO2) hDIB;
- PBITMAPINFOHEADER2 pBIH = (PBITMAPINFOHEADER2) pBI;
+ PBITMAPINFO2 pBI = (PBITMAPINFO2) hDIB;
+ PBITMAPINFOHEADER2 pBIH = (PBITMAPINFOHEADER2) pBI;
pBIH->cbFix = sizeof( BITMAPINFOHEADER2 );
pBIH->cx = rSize.Width();
diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx
index efd913c251b2..c5fc42c6efa3 100644
--- a/vcl/os2/source/gdi/salgdi.cxx
+++ b/vcl/os2/source/gdi/salgdi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,6 @@
#include <salframe.h>
#include <tools/poly.hxx>
#include <rtl/strbuf.hxx>
-#include "vcl/region.h"
#ifndef __H_FT2LIB
#include <wingdi.h>
@@ -49,7 +48,7 @@
// -----------
// ClipRegions funktionieren immer noch nicht auf allen getesteten Druckern
-#define SAL_PRINTER_CLIPPATH 1
+#define SAL_PRINTER_CLIPPATH 1
// #define SAL_PRINTER_POLYPATH 1
// =======================================================================
@@ -62,7 +61,7 @@ void ImplInitSalGDI()
void ImplFreeSalGDI()
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
// delete icon cache
SalIcon* pIcon = pSalData->mpFirstIcon;
@@ -102,19 +101,19 @@ Os2SalGraphics::Os2SalGraphics()
mfFontScale = 1.0;
- mhPS = 0;
- mhDC = 0;
- mbLine = FALSE;
- mbFill = FALSE;
- mbXORMode = FALSE;
- mnFontMetricCount = 0;
- mpFontMetrics = NULL;
- mpClipRectlAry = NULL;
+ mhPS = 0;
+ mhDC = 0;
+ mbLine = FALSE;
+ mbFill = FALSE;
+ mbXORMode = FALSE;
+ mnFontMetricCount = 0;
+ mpFontMetrics = NULL;
+ mpClipRectlAry = NULL;
- mhDefFont = 0;
- mpFontKernPairs = NULL;
- mnFontKernPairCount = 0;
- mbFontKernInit = FALSE;
+ mhDefFont = 0;
+ mpFontKernPairs = NULL;
+ mnFontKernPairCount = 0;
+ mbFontKernInit = FALSE;
}
@@ -166,7 +165,7 @@ void Os2SalGraphics::GetResolution( long& rDPIX, long& rDPIY )
// -----------------------------------------------------------------------
-USHORT Os2SalGraphics::GetBitCount() const
+USHORT Os2SalGraphics::GetBitCount()
{
LONG nBitCount;
DevQueryCaps( mhDC, CAPS_COLOR_BITCOUNT, 1, &nBitCount );
@@ -217,29 +216,38 @@ void Os2SalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-bool Os2SalGraphics::setClipRegion( const Region& i_rClip )
+void Os2SalGraphics::BeginSetClipRegion( ULONG nCount )
{
- ULONG nCount = i_rClip.GetRectCount();
-
- mpClipRectlAry = new RECTL[ nCount ];
+ mpClipRectlAry = new RECTL[ nCount ];
mnClipElementCount = 0;
+}
- 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 );
- }
+// -----------------------------------------------------------------------
+
+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()
+{
#ifdef SAL_PRINTER_CLIPPATH
if ( mbPrinter )
{
@@ -278,8 +286,6 @@ bool Os2SalGraphics::setClipRegion( const Region& i_rClip )
}
delete [] mpClipRectlAry;
-
- return true;
}
// -----------------------------------------------------------------------
@@ -487,11 +493,11 @@ void Os2SalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
void Os2SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
{
// convert all points to sys orientation
- POINTL* pOS2PtAry = new POINTL[ nPoints ];
- POINTL* pTempOS2PtAry = pOS2PtAry;
- const SalPoint* pTempPtAry = pPtAry;
- ULONG nTempPoints = nPoints;
- long nHeight = mnHeight - 1;
+ POINTL* pOS2PtAry = new POINTL[ nPoints ];
+ POINTL* pTempOS2PtAry = pOS2PtAry;
+ const SalPoint* pTempPtAry = pPtAry;
+ ULONG nTempPoints = nPoints;
+ long nHeight = mnHeight - 1;
while( nTempPoints-- )
{
@@ -517,10 +523,10 @@ void Os2SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
aPolygon.ulPoints = nPoints;
// convert all points to sys orientation
- POINTL* pTempOS2PtAry = aPolygon.aPointl;
- const SalPoint* pTempPtAry = pPtAry;
- ULONG nTempPoints = nPoints;
- long nHeight = mnHeight - 1;
+ POINTL* pTempOS2PtAry = aPolygon.aPointl;
+ const SalPoint* pTempPtAry = pPtAry;
+ ULONG nTempPoints = nPoints;
+ long nHeight = mnHeight - 1;
while( nTempPoints-- )
{
@@ -579,9 +585,9 @@ void Os2SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
void Os2SalGraphics::drawPolyPolygon( ULONG nPoly, const ULONG* pPoints,
PCONSTSALPOINT* pPtAry )
{
- ULONG i;
- long nHeight = mnHeight - 1;
- PM_POLYGON* aPolygonAry = new PM_POLYGON[ nPoly ];
+ ULONG i;
+ long nHeight = mnHeight - 1;
+ PM_POLYGON* aPolygonAry = new PM_POLYGON[ nPoly ];
for( i = 0; i < nPoly; i++ )
{
@@ -664,7 +670,7 @@ bool Os2SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /
bool Os2SalGraphics::drawPolyLine(
const basegfx::B2DPolygon& /*rPolygon*/,
double /*fTransparency*/,
- const basegfx::B2DVector& /*rLineWidths*/,
+ const basegfx::B2DVector& /*rLineWidths*/,
basegfx::B2DLineJoin /*eLineJoin*/)
{
// TODO: implement
@@ -696,15 +702,15 @@ sal_Bool Os2SalGraphics::drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoint
// =======================================================================
// MAXIMUM BUFSIZE EQ 0xFFFF
-#define POSTSCRIPT_BUFSIZE 0x4000
+#define POSTSCRIPT_BUFSIZE 0x4000
// we only try to get the BoundingBox in the first 4096 bytes
-#define POSTSCRIPT_BOUNDINGSEARCH 0x1000
+#define POSTSCRIPT_BOUNDINGSEARCH 0x1000
static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ ULONG i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -720,7 +726,7 @@ static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSi
static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
{
- BOOL bRetValue = FALSE;
+ BOOL bRetValue = FALSE;
BYTE* pDest = ImplSearchEntry( pSource, (BYTE*)"%%BoundingBox:", nSize, 14 );
if ( pDest )
{
@@ -729,15 +735,15 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
int nSizeLeft = nSize - ( pDest - pSource );
if ( nSizeLeft > 100 )
- nSizeLeft = 100; // only 100 bytes following the bounding box will be checked
+ nSizeLeft = 100; // only 100 bytes following the bounding box will be checked
int i;
for ( i = 0; ( i < 4 ) && nSizeLeft; i++ )
{
- int nDivision = 1;
- BOOL bDivision = FALSE;
- BOOL bNegative = FALSE;
- BOOL bValid = TRUE;
+ int nDivision = 1;
+ BOOL bDivision = FALSE;
+ BOOL bNegative = FALSE;
+ BOOL bValid = TRUE;
while ( ( --nSizeLeft ) && ( *pDest == ' ' ) || ( *pDest == 0x9 ) ) pDest++;
BYTE nByte = *pDest;
@@ -756,7 +762,7 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
break;
default :
if ( ( nByte < '0' ) || ( nByte > '9' ) )
- nSizeLeft = 1; // error parsing the bounding box values
+ nSizeLeft = 1; // error parsing the bounding box values
else if ( bValid )
{
if ( bDivision )
@@ -791,18 +797,18 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
if ( !mbPrinter )
return FALSE;
- BOOL bRet = FALSE;
- LONG nLong = 0;
+ BOOL bRet = FALSE;
+ LONG nLong = 0;
if ( !(DevQueryCaps( mhDC, CAPS_TECHNOLOGY, 1, &nLong ) &&
(CAPS_TECH_POSTSCRIPT == nLong)) )
return FALSE;
- BYTE* pBuf = new BYTE[ POSTSCRIPT_BUFSIZE ];
- double nBoundingBox[4];
+ BYTE* pBuf = new BYTE[ POSTSCRIPT_BUFSIZE ];
+ double nBoundingBox[4];
if ( pBuf && ImplGetBoundingBox( nBoundingBox, (BYTE*)pPtr, nSize ) )
{
- LONG pOS2DXAry[4]; // hack -> print always 2 white space
+ LONG pOS2DXAry[4]; // hack -> print always 2 white space
POINTL aPt;
aPt.x = 0;
aPt.y = 0;
@@ -812,7 +818,7 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
Ft2CharStringPosAt( mhPS, &aPt, NULL, 0, 2, (PCH)pStr,(PLONG)&pOS2DXAry[0] );
OStringBuffer aBuf( POSTSCRIPT_BUFSIZE );
-
+
// reserve place for a USHORT
aBuf.append( "aa" );
@@ -852,7 +858,7 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
//Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
DevEscape( mhDC, DEVESC_RAWDATA, aBuf.getLength(),
(PBYTE)aBuf.getStr(), 0, NULL );
-
+
double dM11 = nWidth / ( nBoundingBox[2] - nBoundingBox[0] );
double dM22 = - ( nHeight / (nBoundingBox[1] - nBoundingBox[3] ) );
@@ -893,7 +899,7 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
if ( DevEscape( mhDC, DEVESC_RAWDATA, 9, (PBYTE)pBuf,
0, NULL ) == DEV_OK ) bRet = TRUE;
}
-
+
// #107797# Write out EPS encapsulation footer
// ----------------------------------------------------------------------------------
// reserve a USHORT again
@@ -906,7 +912,7 @@ BOOL Os2SalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
DevEscape( mhDC, DEVESC_RAWDATA, aBuf.getLength(),
(PBYTE)aBuf.getStr(), 0, NULL );
bRet = TRUE;
-
+
}
}
delete [] pBuf;
diff --git a/vcl/os2/source/gdi/salgdi2.cxx b/vcl/os2/source/gdi/salgdi2.cxx
index 2ab59b8a3c46..6dd54a15e384 100644
--- a/vcl/os2/source/gdi/salgdi2.cxx
+++ b/vcl/os2/source/gdi/salgdi2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,7 +49,7 @@ BOOL bFastTransparent = FALSE;
// -----------
#define RGBCOLOR( r, g, b ) ((ULONG)(((BYTE)(b)|((USHORT)(g)<<8))|(((ULONG)(BYTE)(r))<<16)))
-#define TY( y ) (mnHeight-(y)-1)
+#define TY( y ) (mnHeight-(y)-1)
// ---------------
// - SalGraphics -
@@ -63,9 +63,9 @@ bool Os2SalGraphics::supportsOperation( OutDevSupportType ) const
void Os2SalGraphics::copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics )
{
- HPS hSrcPS;
- POINTL thePoints[4];
- long nSrcHeight;
+ HPS hSrcPS;
+ POINTL thePoints[4];
+ long nSrcHeight;
if ( pSrcGraphics )
{
@@ -132,39 +132,39 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
if ( (nFlags & SAL_COPYAREA_WINDOWINVALIDATE) && mbWindow )
{
// Overlap-Bereich berechnen und invalidieren
- Point aVCLSrcPos( nSrcX, nSrcY );
- Size aVCLSrcSize( nSrcWidth, nSrcHeight );
- Rectangle aVCLSrcRect( aVCLSrcPos, aVCLSrcSize );
- Rectangle aVCLClipRect;
- SWP aSWP;
+ Point aVCLSrcPos( nSrcX, nSrcY );
+ Size aVCLSrcSize( nSrcWidth, nSrcHeight );
+ Rectangle aVCLSrcRect( aVCLSrcPos, aVCLSrcSize );
+ Rectangle aVCLClipRect;
+ SWP aSWP;
WinQueryWindowPos( mhWnd, &aSWP );
- aVCLClipRect.Right() = aSWP.cx-1;
- aVCLClipRect.Bottom() = aSWP.cy-1;
+ aVCLClipRect.Right() = aSWP.cx-1;
+ aVCLClipRect.Bottom() = aSWP.cy-1;
if ( !aVCLSrcRect.Intersection( aVCLClipRect ).IsEmpty() )
{
- RECTL aSrcRect;
- RECTL aTempRect;
- HRGN hInvalidateRgn;
- HRGN hTempRgn;
- HWND hWnd;
- long nRgnType;
-
- long nVCLScrHeight = aVCLSrcRect.GetHeight();
- aSrcRect.xLeft = aVCLSrcRect.Left();
- aSrcRect.yBottom = TY( aVCLSrcRect.Top()+nVCLScrHeight-1 );
- aSrcRect.xRight = aSrcRect.xLeft+aVCLSrcRect.GetWidth();
- aSrcRect.yTop = aSrcRect.yBottom+nVCLScrHeight;
+ RECTL aSrcRect;
+ RECTL aTempRect;
+ HRGN hInvalidateRgn;
+ HRGN hTempRgn;
+ HWND hWnd;
+ long nRgnType;
+
+ long nVCLScrHeight = aVCLSrcRect.GetHeight();
+ aSrcRect.xLeft = aVCLSrcRect.Left();
+ aSrcRect.yBottom = TY( aVCLSrcRect.Top()+nVCLScrHeight-1 );
+ aSrcRect.xRight = aSrcRect.xLeft+aVCLSrcRect.GetWidth();
+ aSrcRect.yTop = aSrcRect.yBottom+nVCLScrHeight;
// Rechteck in Screen-Koordinaaten umrechnen
- POINTL aPt;
- long nScreenDX = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
- long nScreenDY = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
+ POINTL aPt;
+ long nScreenDX = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
+ long nScreenDY = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
aPt.x = 0;
aPt.y = 0;
WinMapWindowPoints( mhWnd, HWND_DESKTOP, &aPt, 1 );
- aSrcRect.xLeft += aPt.x;
- aSrcRect.yTop += aPt.y;
+ aSrcRect.xLeft += aPt.x;
+ aSrcRect.yTop += aPt.y;
aSrcRect.xRight += aPt.x;
aSrcRect.yBottom += aPt.y;
hInvalidateRgn = 0;
@@ -173,10 +173,10 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
{
if ( !hInvalidateRgn )
hInvalidateRgn = GpiCreateRegion( mhPS, 1, &aSrcRect );
- aTempRect.xLeft = -31999;
- aTempRect.yBottom = 0;
- aTempRect.xRight = 0;
- aTempRect.yTop = 31999;
+ aTempRect.xLeft = -31999;
+ aTempRect.yBottom = 0;
+ aTempRect.xRight = 0;
+ aTempRect.yTop = 31999;
hTempRgn = GpiCreateRegion( mhPS, 1, &aTempRect );
GpiCombineRegion( mhPS, hInvalidateRgn, hInvalidateRgn, hTempRgn, CRGN_DIFF );
GpiDestroyRegion( mhPS, hTempRgn );
@@ -185,10 +185,10 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
{
if ( !hInvalidateRgn )
hInvalidateRgn = GpiCreateRegion( mhPS, 1, &aSrcRect );
- aTempRect.xLeft = 0;
- aTempRect.yBottom = -31999;
- aTempRect.xRight = 31999;
- aTempRect.yTop = 0;
+ aTempRect.xLeft = 0;
+ aTempRect.yBottom = -31999;
+ aTempRect.xRight = 31999;
+ aTempRect.yTop = 0;
hTempRgn = GpiCreateRegion( mhPS, 1, &aTempRect );
GpiCombineRegion( mhPS, hInvalidateRgn, hInvalidateRgn, hTempRgn, CRGN_DIFF );
GpiDestroyRegion( mhPS, hTempRgn );
@@ -197,10 +197,10 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
{
if ( !hInvalidateRgn )
hInvalidateRgn = GpiCreateRegion( mhPS, 1, &aSrcRect );
- aTempRect.xLeft = nScreenDX;
- aTempRect.yBottom = 0;
- aTempRect.xRight = 31999;
- aTempRect.yTop = 31999;
+ aTempRect.xLeft = nScreenDX;
+ aTempRect.yBottom = 0;
+ aTempRect.xRight = 31999;
+ aTempRect.yTop = 31999;
hTempRgn = GpiCreateRegion( mhPS, 1, &aTempRect );
GpiCombineRegion( mhPS, hInvalidateRgn, hInvalidateRgn, hTempRgn, CRGN_DIFF );
GpiDestroyRegion( mhPS, hTempRgn );
@@ -209,10 +209,10 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
{
if ( !hInvalidateRgn )
hInvalidateRgn = GpiCreateRegion( mhPS, 1, &aSrcRect );
- aTempRect.xLeft = 0;
- aTempRect.yBottom = nScreenDY;
- aTempRect.xRight = 31999;
- aTempRect.yTop = 31999;
+ aTempRect.xLeft = 0;
+ aTempRect.yBottom = nScreenDY;
+ aTempRect.xRight = 31999;
+ aTempRect.yTop = 31999;
hTempRgn = GpiCreateRegion( mhPS, 1, &aTempRect );
GpiCombineRegion( mhPS, hInvalidateRgn, hInvalidateRgn, hTempRgn, CRGN_DIFF );
GpiDestroyRegion( mhPS, hTempRgn );
@@ -237,10 +237,10 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
{
if ( !hInvalidateRgn )
hInvalidateRgn = GpiCreateRegion( mhPS, 1, &aSrcRect );
- aTempRect.xLeft = aSWP.x;
- aTempRect.yBottom = aSWP.y;
- aTempRect.xRight = aTempRect.xLeft+aSWP.cx;
- aTempRect.yTop = aTempRect.yBottom+aSWP.cy;
+ aTempRect.xLeft = aSWP.x;
+ aTempRect.yBottom = aSWP.y;
+ aTempRect.xRight = aTempRect.xLeft+aSWP.cx;
+ aTempRect.yTop = aTempRect.yBottom+aSWP.cy;
hTempRgn = GpiCreateRegion( mhPS, 1, &aTempRect );
GpiCombineRegion( mhPS, hInvalidateRgn, hInvalidateRgn, hTempRgn, CRGN_DIFF );
GpiDestroyRegion( mhPS, hTempRgn );
@@ -267,8 +267,8 @@ void Os2SalGraphics::copyArea( long nDestX, long nDestY,
// MainThread ist, damit es beim Bearbeiten der
// Paint-Message keinen Deadlock gibt, da der
// SolarMutex durch diesen Thread schon gelockt ist
- SalData* pSalData = GetSalData();
- ULONG nCurThreadId = GetCurrentThreadId();
+ SalData* pSalData = GetSalData();
+ ULONG nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId == nCurThreadId )
WinUpdateWindow( mhWnd );
}
@@ -290,11 +290,11 @@ void ImplDrawBitmap( HPS hPS, long nScreenHeight,
{
if( hPS )
{
- HANDLE hDrawDIB;
- HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
- Os2SalBitmap* pTmpSalBmp = NULL;
- BOOL bPrintDDB = ( bPrinter && hDrawDDB );
- BOOL bDrawDDB1 = ( ( rSalBitmap.GetBitCount() == 1 ) && hDrawDDB );
+ HANDLE hDrawDIB;
+ HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
+ Os2SalBitmap* pTmpSalBmp = NULL;
+ BOOL bPrintDDB = ( bPrinter && hDrawDDB );
+ BOOL bDrawDDB1 = ( ( rSalBitmap.GetBitCount() == 1 ) && hDrawDDB );
if( bPrintDDB || bDrawDDB1 )
{
@@ -307,13 +307,13 @@ void ImplDrawBitmap( HPS hPS, long nScreenHeight,
if( hDrawDIB )
{
- HANDLE hSubst = rSalBitmap.ImplGethDIB1Subst();
- POINTL pts[ 4 ];
- BITMAPINFO2* pBI = (BITMAPINFO2*) hDrawDIB;
- BITMAPINFOHEADER2* pBIH = (BITMAPINFOHEADER2*) pBI;
- const long nHeight = pBIH->cy;
- long nInfoSize = *(ULONG*) pBI + rSalBitmap.ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGB2 );
- BYTE* pBits = (BYTE*) pBI + nInfoSize;
+ HANDLE hSubst = rSalBitmap.ImplGethDIB1Subst();
+ POINTL pts[ 4 ];
+ BITMAPINFO2* pBI = (BITMAPINFO2*) hDrawDIB;
+ BITMAPINFOHEADER2* pBIH = (BITMAPINFOHEADER2*) pBI;
+ const long nHeight = pBIH->cy;
+ long nInfoSize = *(ULONG*) pBI + rSalBitmap.ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGB2 );
+ BYTE* pBits = (BYTE*) pBI + nInfoSize;
pts[0].x = pPosAry->mnDestX;
pts[0].y = nScreenHeight - pPosAry->mnDestY - pPosAry->mnDestHeight;
@@ -352,12 +352,12 @@ void ImplDrawBitmap( HPS hPS, long nScreenHeight,
// have problems to print these DIB's (strange)
if( pBIH->cBitCount == 8 && pBIH->ulCompression == BCA_UNCOMP )
{
- const long nWidth = pBIH->cx;
- const long nHeight = pBIH->cy;
- const long nWidthAl8 = AlignedWidth4Bytes( nWidth * 8 );
- const long nWidthAl24 = AlignedWidth4Bytes( nWidth * 24 );
- const long nNewImageSize = nHeight * nWidthAl24;
- BITMAPINFOHEADER2* pNewInfo;
+ const long nWidth = pBIH->cx;
+ const long nHeight = pBIH->cy;
+ const long nWidthAl8 = AlignedWidth4Bytes( nWidth * 8 );
+ const long nWidthAl24 = AlignedWidth4Bytes( nWidth * 24 );
+ const long nNewImageSize = nHeight * nWidthAl24;
+ BITMAPINFOHEADER2* pNewInfo;
pDummy = new BYTE[ sizeof( BITMAPINFO2 ) + nNewImageSize ];
memset( pDummy, 0, sizeof( BITMAPINFO2 ) );
@@ -466,7 +466,7 @@ void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
const Os2SalBitmap& rTransparentBitmap = static_cast<const Os2SalBitmap&>(rSTransparentBitmap);
-
+
if( bFastTransparent )
{
ImplDrawBitmap( mhPS, mnHeight, pPosAry, rTransparentBitmap, FALSE, ROP_SRCAND );
@@ -474,25 +474,25 @@ void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
}
else
{
- SalTwoRect aPosAry = *pPosAry;
- int nDstX = (int) aPosAry.mnDestX;
- int nDstY = (int) aPosAry.mnDestY;
- int nDstWidth = (int) aPosAry.mnDestWidth;
- int nDstHeight = (int) aPosAry.mnDestHeight;
- HAB hAB = GetSalData()->mhAB;
- HPS hPS = mhPS;
- DEVOPENSTRUC aDevOpenStruc = { NULL, (PSZ)"DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
- SIZEL aSizeL = { nDstWidth, nDstHeight };
- POINTL aPtL[ 3 ];
-
- HDC hMemDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
- HPS hMemPS = Ft2CreatePS( hAB, hMemDC, &aSizeL, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
- HBITMAP hMemBitmap = ImplCreateVirDevBitmap( hMemDC, hMemPS, nDstWidth, nDstHeight, 0 );
- HBITMAP hMemOld = (HBITMAP) Ft2SetBitmap( hMemPS, hMemBitmap );
- HDC hMaskDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
- HPS hMaskPS = Ft2CreatePS( hAB, hMaskDC, &aSizeL, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
- HBITMAP hMaskBitmap = ImplCreateVirDevBitmap( hMaskDC, hMaskPS, nDstWidth, nDstHeight, 0 );
- HBITMAP hMaskOld = (HBITMAP) Ft2SetBitmap( hMaskPS, hMaskBitmap );
+ SalTwoRect aPosAry = *pPosAry;
+ int nDstX = (int) aPosAry.mnDestX;
+ int nDstY = (int) aPosAry.mnDestY;
+ int nDstWidth = (int) aPosAry.mnDestWidth;
+ int nDstHeight = (int) aPosAry.mnDestHeight;
+ HAB hAB = GetSalData()->mhAB;
+ HPS hPS = mhPS;
+ DEVOPENSTRUC aDevOpenStruc = { NULL, (PSZ)"DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+ SIZEL aSizeL = { nDstWidth, nDstHeight };
+ POINTL aPtL[ 3 ];
+
+ HDC hMemDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
+ HPS hMemPS = Ft2CreatePS( hAB, hMemDC, &aSizeL, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
+ HBITMAP hMemBitmap = ImplCreateVirDevBitmap( hMemDC, hMemPS, nDstWidth, nDstHeight, 0 );
+ HBITMAP hMemOld = (HBITMAP) Ft2SetBitmap( hMemPS, hMemBitmap );
+ HDC hMaskDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
+ HPS hMaskPS = Ft2CreatePS( hAB, hMaskDC, &aSizeL, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
+ HBITMAP hMaskBitmap = ImplCreateVirDevBitmap( hMaskDC, hMaskPS, nDstWidth, nDstHeight, 0 );
+ HBITMAP hMaskOld = (HBITMAP) Ft2SetBitmap( hMaskPS, hMaskBitmap );
/*
HPS hMemPS = ImplGetCachedPS( CACHED_HPS_1, 0 );
HPS hMaskPS = ImplGetCachedPS( CACHED_HPS_2, 0 );
@@ -543,7 +543,7 @@ void Os2SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
// -----------------------------------------------------------------------
bool Os2SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
- const SalBitmap& rSrcBitmap,
+ const SalBitmap& rSrcBitmap,
const SalBitmap& rAlphaBmp )
{
// TODO(P3) implement alpha blending
@@ -552,7 +552,7 @@ bool Os2SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
// -----------------------------------------------------------------------
-bool Os2SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
+bool Os2SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
// TODO(P3) implement alpha blending
@@ -566,13 +566,13 @@ void Os2SalGraphics::drawMask( const SalTwoRect* pPosAry,
SalColor nMaskColor )
{
DBG_ASSERT( !mbPrinter, "No transparency print possible!" );
-
+
const Os2SalBitmap& rSalBitmap = static_cast<const Os2SalBitmap&>(rSSalBitmap);
- SalTwoRect aPosAry = *pPosAry;
- HPS hPS = mhPS;
+ SalTwoRect aPosAry = *pPosAry;
+ HPS hPS = mhPS;
IMAGEBUNDLE aBundle, aOldBundle;
- AREABUNDLE aAreaBundle, aOldAreaBundle;
+ AREABUNDLE aAreaBundle, aOldAreaBundle;
const ULONG nColor = RGBCOLOR( SALCOLOR_RED( nMaskColor ),
SALCOLOR_GREEN( nMaskColor ),
SALCOLOR_BLUE( nMaskColor ) );
@@ -603,16 +603,16 @@ void Os2SalGraphics::drawMask( const SalTwoRect* pPosAry,
SalBitmap* Os2SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
{
- HAB hAB = GetSalData()->mhAB;
- SIZEL size = { nDX, nDY };
- Os2SalBitmap* pSalBitmap = NULL;
+ HAB hAB = GetSalData()->mhAB;
+ SIZEL size = { nDX, nDY };
+ Os2SalBitmap* pSalBitmap = NULL;
// create device context (at this time allways display compatible)
- DEVOPENSTRUC aDevOpenStruc = { NULL, (PSZ)"DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
- HDC hMemDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
- HPS hMemPS = Ft2CreatePS( hAB, hMemDC, &size, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
- HBITMAP hMemBmp = ImplCreateVirDevBitmap( hMemDC, hMemPS, nDX, nDY, 0 );
- HBITMAP hMemOld = Ft2SetBitmap( hMemPS, hMemBmp );
+ DEVOPENSTRUC aDevOpenStruc = { NULL, (PSZ)"DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+ HDC hMemDC = DevOpenDC( hAB, OD_MEMORY, (PSZ)"*", 5L, (PDEVOPENDATA)&aDevOpenStruc, 0 );
+ HPS hMemPS = Ft2CreatePS( hAB, hMemDC, &size, GPIT_MICRO | GPIA_ASSOC | PU_PELS );
+ HBITMAP hMemBmp = ImplCreateVirDevBitmap( hMemDC, hMemPS, nDX, nDY, 0 );
+ HBITMAP hMemOld = Ft2SetBitmap( hMemPS, hMemBmp );
// creation successfull?
if( hMemDC && hMemPS && hMemBmp )
@@ -666,8 +666,8 @@ SalBitmap* Os2SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
SalColor Os2SalGraphics::getPixel( long nX, long nY )
{
- POINTL aPt = { nX, TY( nY ) };
- LONG nColor = Ft2QueryPel( mhPS, &aPt );
+ POINTL aPt = { nX, TY( nY ) };
+ LONG nColor = Ft2QueryPel( mhPS, &aPt );
return MAKE_SALCOLOR( (BYTE) ( nColor >> 16 ), (BYTE) ( nColor >> 8 ), (BYTE) nColor );
}
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 63fd79b8fa2e..751abc4eadad 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,6 +36,7 @@
#include <svpm.h>
#define _SV_SALGDI3_CXX
+#include <tools/svwin.h>
#include <rtl/tencinfo.h>
#include <osl/file.hxx>
#include <osl/thread.hxx>
@@ -95,7 +96,7 @@ inline int IntTimes256FromFixed(W32FIXED f)
// -----------
// this is a special codepage code, used to identify OS/2 symbol font.
-#define SYMBOL_CHARSET 65400
+#define SYMBOL_CHARSET 65400
// =======================================================================
@@ -336,7 +337,7 @@ static ImplDevFontAttributes Os2Font2DevFontAttributes( const PFONTMETRICS pFont
|| aDFA.maName.EqualsAscii( "ZapfChancery" )
|| aDFA.maName.EqualsAscii( "ZapfDingbats" ) )
aDFA.mnQuality += 500;
- }
+ }
aDFA.meEmbeddedBitmap = EMBEDDEDBITMAP_DONTKNOW;
aDFA.meAntiAlias = ANTIALIAS_DONTKNOW;
@@ -354,7 +355,7 @@ static ImplDevFontAttributes Os2Font2DevFontAttributes( const PFONTMETRICS pFont
ImplOs2FontData::ImplOs2FontData( PFONTMETRICS _pFontMetric,
int nHeight, BYTE nPitchAndFamily )
-: ImplFontData( Os2Font2DevFontAttributes(_pFontMetric), 0 ),
+: ImplFontData( Os2Font2DevFontAttributes(_pFontMetric), 0 ),
pFontMetric( _pFontMetric ),
meOs2CharSet( _pFontMetric->usCodePage),
mnPitchAndFamily( nPitchAndFamily ),
@@ -400,8 +401,8 @@ void ImplOs2FontData::UpdateFromHPS( HPS hPS ) const
// even if the font works some fonts have problems with the glyph API
// => the heuristic below tries to figure out which fonts have the problem
- DWORD fontType = Ft2QueryFontType( 0, pFontMetric->szFacename);
- if( fontType != FT2_FONTTYPE_TRUETYPE
+ DWORD fontType = Ft2QueryFontType( 0, pFontMetric->szFacename);
+ if( fontType != FT2_FONTTYPE_TRUETYPE
&& (pFontMetric->fsDefn & FM_DEFN_GENERIC) == 0)
mbDisableGlyphApi = true;
}
@@ -426,8 +427,9 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
// -----------------------------------------------------------------------
-const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
+ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
{
+ mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -560,7 +562,6 @@ void ImplOs2FontData::ReadCmapTable( HPS hPS ) const
aResult.mpPairCodes, aResult.mpStartGlyphs );
else
mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
- mpUnicodeMap->AddReference();
}
// =======================================================================
@@ -586,21 +587,21 @@ void Os2SalGraphics::SetTextColor( SalColor nSalColor )
USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, int nFallbackLevel)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf( "Os2SalGraphics::ImplDoSetFont\n");
#endif
ImplOs2FontData* pFontData = (ImplOs2FontData*)i_pFont->mpFontData;
- PFONTMETRICS pFontMetric = NULL;
- FATTRS aFAttrs;
- BOOL bOutline = FALSE;
- APIRET rc;
+ PFONTMETRICS pFontMetric = NULL;
+ FATTRS aFAttrs;
+ BOOL bOutline = FALSE;
+ APIRET rc;
memset( &aFAttrs, 0, sizeof( FATTRS ) );
aFAttrs.usRecordLength = sizeof( FATTRS );
aFAttrs.lMaxBaselineExt = i_pFont->mnHeight;
- aFAttrs.lAveCharWidth = i_pFont->mnWidth;
+ aFAttrs.lAveCharWidth = i_pFont->mnWidth;
// do we have a pointer to the FONTMETRICS of the selected font? -> use it!
if ( pFontData )
@@ -610,9 +611,9 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
bOutline = (pFontMetric->fsDefn & FM_DEFN_OUTLINE) != 0;
// use match&registry fields to get correct match
- aFAttrs.lMatch = pFontMetric->lMatch;
- aFAttrs.idRegistry = pFontMetric->idRegistry;
- aFAttrs.usCodePage = pFontMetric->usCodePage;
+ aFAttrs.lMatch = pFontMetric->lMatch;
+ aFAttrs.idRegistry = pFontMetric->idRegistry;
+ aFAttrs.usCodePage = pFontMetric->usCodePage;
if ( bOutline )
{
@@ -623,14 +624,14 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
else
{
aFAttrs.lMaxBaselineExt = pFontMetric->lMaxBaselineExt;
- aFAttrs.lAveCharWidth = pFontMetric->lAveCharWidth;
+ aFAttrs.lAveCharWidth = pFontMetric->lAveCharWidth;
}
}
// use family name for outline fonts
if ( mbPrinter ) {
- // use font face name for printers because otherwise ft2lib will fail
+ // use font face name for printers because otherwise ft2lib will fail
// to select the correct font for GPI (ticket#117)
strncpy( (char*)(aFAttrs.szFacename), pFontMetric->szFacename, sizeof( aFAttrs.szFacename ) );
} else if ( !pFontMetric) {
@@ -650,7 +651,7 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
if ( i_pFont->meWeight > WEIGHT_MEDIUM )
aFAttrs.fsSelection |= FATTR_SEL_BOLD;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>1
if (pFontMetric->szFacename[0] == 'A') {
debug_printf( "Os2SalGraphics::SetFont hps %x lMatch '%d'\n", mhPS, pFontMetric->lMatch);
debug_printf( "Os2SalGraphics::SetFont hps %x fontmetrics facename '%s'\n", mhPS, pFontMetric->szFacename);
@@ -660,7 +661,7 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
Ft2DeleteSetId( mhPS, nFallbackLevel + LCID_BASE);
if ( (rc=Ft2CreateLogFont( mhPS, NULL, nFallbackLevel + LCID_BASE, &aFAttrs)) == GPI_ERROR ) {
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>1
ERRORID nLastError = WinGetLastError( GetSalData()->mhAB );
debug_printf( "Os2SalGraphics::SetFont hps %x Ft2CreateLogFont failed err %x\n", mhPS, nLastError );
#endif
@@ -707,7 +708,7 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
{
nAttrs |= CBB_ANGLE;
double alpha = (double)(i_pFont->mnOrientation);
- alpha *= 0.0017453292; // *PI / 1800
+ alpha *= 0.0017453292; // *PI / 1800
mnOrientationY = (long) (1000.0 * sin( alpha ));
mnOrientationX = (long) (1000.0 * cos( alpha ));
aBundle.ptlAngle.x = mnOrientationX;
@@ -733,7 +734,7 @@ USHORT Os2SalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFon
rc = Ft2SetAttrs( mhPS, PRIM_CHAR, nAttrs, nAttrsDefault, &aBundle );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>1
FONTMETRICS aOS2Metric = {0};
Ft2QueryFontMetrics( mhPS, sizeof( aOS2Metric ), &aOS2Metric );
#endif
@@ -752,7 +753,7 @@ USHORT Os2SalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
return 0;
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf( "Os2SalGraphics::SetFont\n");
#endif
@@ -813,7 +814,7 @@ void Os2SalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
FONTMETRICS aOS2Metric;
Ft2QueryFontMetrics( mhPS, sizeof( aOS2Metric ), &aOS2Metric );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>1
debug_printf( "Os2SalGraphics::GetFontMetric hps %x\n", mhPS);
if (aOS2Metric.szFacename[0] == 'A') {
debug_printf( "Os2SalGraphics::GetFontMetric hps %x fontmetrics facename '%s'\n", mhPS, aOS2Metric.szFacename);
@@ -821,8 +822,8 @@ void Os2SalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
}
#endif
- pMetric->maName = UniString( aOS2Metric.szFamilyname, gsl_getSystemTextEncoding());
- pMetric->maStyleName = ImpStyleNameToSal( aOS2Metric.szFamilyname,
+ pMetric->maName = UniString( aOS2Metric.szFamilyname, gsl_getSystemTextEncoding());
+ pMetric->maStyleName = ImpStyleNameToSal( aOS2Metric.szFamilyname,
aOS2Metric.szFacename,
strlen( aOS2Metric.szFamilyname ) );
@@ -854,17 +855,17 @@ void Os2SalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// transformation dependend font metrics
if ( aOS2Metric.fsDefn & FM_DEFN_OUTLINE )
{
- pMetric->mnWidth = aOS2Metric.lEmInc;
+ pMetric->mnWidth = aOS2Metric.lEmInc;
}
else
{
- pMetric->mnWidth = aOS2Metric.lAveCharWidth;
+ pMetric->mnWidth = aOS2Metric.lAveCharWidth;
pMetric->mnOrientation = 0;
}
- pMetric->mnIntLeading = aOS2Metric.lInternalLeading;
- pMetric->mnExtLeading = aOS2Metric.lExternalLeading;
- pMetric->mnAscent = aOS2Metric.lMaxAscender;
- pMetric->mnDescent = aOS2Metric.lMaxDescender;
+ pMetric->mnIntLeading = aOS2Metric.lInternalLeading;
+ pMetric->mnExtLeading = aOS2Metric.lExternalLeading;
+ pMetric->mnAscent = aOS2Metric.lMaxAscender;
+ pMetric->mnDescent = aOS2Metric.lMaxDescender;
// #107888# improved metric compatibility for Asian fonts...
// TODO: assess workaround below for CWS >= extleading
@@ -953,10 +954,10 @@ ULONG Os2SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-static const ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
+static ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
static const sal_uInt32 pOs2DefaultRangeCodes[] = {0x0020,0x00FF};
-const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
+ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
{
if( !mpOs2FontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -968,7 +969,7 @@ const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
bool Os2SalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
const String& rFontFileURL, const String& rFontName )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalGraphics::AddTempDevFont\n");
#endif
return false;
@@ -978,20 +979,22 @@ bool Os2SalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
void Os2SalGraphics::GetDevFontList( ImplDevFontList* pList )
{
- PFONTMETRICS pFontMetrics;
- ULONG nFontMetricCount;
- SalData* pSalData;
+ PFONTMETRICS pFontMetrics;
+ ULONG nFontMetricCount;
+ SalData* pSalData;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalGraphics::GetDevFontList\n");
#endif
// install OpenSymbol
HMODULE hMod;
- ULONG ObjNum, Offset, rc;
- CHAR Buff[2*_MAX_PATH];
+ ULONG ObjNum, Offset, rc;
+ CHAR Buff[2*_MAX_PATH];
+ char drive[_MAX_DRIVE], dir[_MAX_DIR];
+ char fname[_MAX_FNAME], ext[_MAX_EXT];
// get module handle (and name)
- rc = DosQueryModFromEIP( &hMod, &ObjNum, sizeof( Buff), Buff,
+ rc = DosQueryModFromEIP( &hMod, &ObjNum, sizeof( Buff), Buff,
&Offset, (ULONG)ImplSalGetUniString);
DosQueryModuleName(hMod, sizeof(Buff), Buff);
// replace module path with font path
@@ -1008,20 +1011,20 @@ void Os2SalGraphics::GetDevFontList( ImplDevFontList* pList )
// dies im unabhaengigen Teil auch so gemacht wird und wir
// ansonsten auf geloeschten Systemdaten arbeiten koennten
pSalData = GetSalData();
- nFontMetricCount = pSalData->mnFontMetricCount;
- pFontMetrics = pSalData->mpFontMetrics;
+ nFontMetricCount = pSalData->mnFontMetricCount;
+ pFontMetrics = pSalData->mpFontMetrics;
// Bei Bildschirm-Devices holen wir uns die Fontliste jedesmal neu
if ( pFontMetrics )
{
delete pFontMetrics;
- pFontMetrics = NULL;
- nFontMetricCount = 0;
+ pFontMetrics = NULL;
+ nFontMetricCount = 0;
}
}
else
{
- nFontMetricCount = mnFontMetricCount;
- pFontMetrics = mpFontMetrics;
+ nFontMetricCount = mnFontMetricCount;
+ pFontMetrics = mpFontMetrics;
}
// do we have to create the cached font list first?
@@ -1051,13 +1054,13 @@ void Os2SalGraphics::GetDevFontList( ImplDevFontList* pList )
if ( !mbPrinter )
{
- pSalData->mnFontMetricCount = nFontMetricCount;
- pSalData->mpFontMetrics = pFontMetrics;
+ pSalData->mnFontMetricCount = nFontMetricCount;
+ pSalData->mpFontMetrics = pFontMetrics;
}
else
{
- mnFontMetricCount = nFontMetricCount;
- mpFontMetrics = pFontMetrics;
+ mnFontMetricCount = nFontMetricCount;
+ mpFontMetrics = pFontMetrics;
}
}
@@ -1072,7 +1075,7 @@ void Os2SalGraphics::GetDevFontList( ImplDevFontList* pList )
continue;
// skip bitmap fonts (but keep WarpSans)
- if ( (pFontMetric->fsDefn & FM_DEFN_OUTLINE) == 0
+ if ( (pFontMetric->fsDefn & FM_DEFN_OUTLINE) == 0
&& strncmp( pFontMetric->szFacename, "WarpSans", 8) )
// Font nicht aufnehmen
continue;
@@ -1083,7 +1086,7 @@ void Os2SalGraphics::GetDevFontList( ImplDevFontList* pList )
*dash++ = ' ';
// create new font list element
- ImplOs2FontData* pData = new ImplOs2FontData( pFontMetric, 0, 0 );
+ ImplOs2FontData* pData = new ImplOs2FontData( pFontMetric, 0, 0 );
// add font list element to font list
pList->Add( pData );
@@ -1130,7 +1133,7 @@ BOOL Os2SalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
BOOL Os2SalGraphics::GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalGraphics::GetGlyphOutline\n");
#endif
rB2DPolyPoly.clear();
@@ -1313,7 +1316,7 @@ BOOL Os2SalGraphics::GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& rB
const double fFactor((1.0/256) * mfFontScale);
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
-
+
return bRet;
}
@@ -1394,7 +1397,7 @@ BOOL Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
ScopedFont aOldFont(*this);
SetFont( &aIFSD, 0 );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 100
// get font metrics
TEXTMETRICA aWinMetric;
if( !::GetTextMetricsA( mhDC, &aWinMetric ) )
@@ -1415,8 +1418,8 @@ BOOL Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// open font file
sal_uInt32 nFaceNum = 0;
- if( !*xRawFontData.get() ) // TTC candidate
- nFaceNum = ~0U; // indicate "TTC font extracts only"
+ if( !*xRawFontData.get() ) // TTC candidate
+ nFaceNum = ~0U; // indicate "TTC font extracts only"
ScopedTrueTypeFont aSftTTF;
int nRC = aSftTTF.open( xRawFontData.get(), nFontSize1, nFaceNum );
@@ -1425,18 +1428,18 @@ BOOL Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
TTGlobalFontInfo aTTInfo;
::GetTTGlobalFontInfo( aSftTTF.get(), &aTTInfo );
- rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;
- rInfo.m_aPSName = ImplSalGetUniString( aTTInfo.psname );
- rInfo.m_nAscent = +aTTInfo.winAscent;
- rInfo.m_nDescent = -aTTInfo.winDescent;
- rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
+ rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;
+ rInfo.m_aPSName = ImplSalGetUniString( aTTInfo.psname );
+ rInfo.m_nAscent = +aTTInfo.winAscent;
+ rInfo.m_nDescent = -aTTInfo.winDescent;
+ rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
Point( aTTInfo.xMax, aTTInfo.yMax ) );
- rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
+ rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
// subset glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- USHORT aShortIDs[ 256 ];
+ USHORT aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef=-1, i;
@@ -1481,9 +1484,9 @@ BOOL Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
::GetTTSimpleGlyphMetrics( aSftTTF.get(), aShortIDs, nGlyphCount, aIFSD.mbVertical );
if( !pMetrics )
return FALSE;
- sal_uInt16 nNotDefAdv = pMetrics[0].adv;
- pMetrics[0].adv = pMetrics[nNotDef].adv;
- pMetrics[nNotDef].adv = nNotDefAdv;
+ sal_uInt16 nNotDefAdv = pMetrics[0].adv;
+ pMetrics[0].adv = pMetrics[nNotDef].adv;
+ pMetrics[nNotDef].adv = nNotDefAdv;
for( i = 0; i < nOrigCount; ++i )
pGlyphWidths[i] = pMetrics[i].adv;
free( pMetrics );
@@ -1522,18 +1525,18 @@ const void* Os2SalGraphics::GetEmbedFontData( const ImplFontData* pFont,
DWORD nFontSize2 = Ft2GetFontData( mhPS, 0, 0, pData, nFontSize1 );
if( nFontSize1 != nFontSize2 )
*pDataLen = 0;
-
+
// get important font properties
FONTMETRICS aOS2Metric;
if (Ft2QueryFontMetrics( mhPS, sizeof( aOS2Metric ), &aOS2Metric ) == GPI_ERROR)
*pDataLen = 0;
- rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;
- rInfo.m_aPSName = ImplSalGetUniString( aOS2Metric.szFacename );
- rInfo.m_nAscent = +aOS2Metric.lMaxAscender;
- rInfo.m_nDescent = -aOS2Metric.lMaxDescender;
- rInfo.m_aFontBBox = Rectangle( Point( 0, -aOS2Metric.lMaxDescender ),
+ rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;
+ rInfo.m_aPSName = ImplSalGetUniString( aOS2Metric.szFacename );
+ rInfo.m_nAscent = +aOS2Metric.lMaxAscender;
+ rInfo.m_nDescent = -aOS2Metric.lMaxDescender;
+ rInfo.m_aFontBBox = Rectangle( Point( 0, -aOS2Metric.lMaxDescender ),
Point( aOS2Metric.lMaxCharInc, aOS2Metric.lMaxAscender+aOS2Metric.lExternalLeading ) );
- rInfo.m_nCapHeight = aOS2Metric.lMaxAscender; // Well ...
+ rInfo.m_nCapHeight = aOS2Metric.lMaxAscender; // Well ...
// get individual character widths
for( int i = 0; i < 256; ++i )
@@ -1591,10 +1594,10 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
// TODO: much better solution: move SetFont and restoration of old font to caller
ScopedFont aOldFont(*this);
-
+
float fScale = 0.0;
ImplDoSetFont( &aIFSD, fScale, 0);
-
+
if( pFont->IsSubsettable() )
{
// get raw font file data
@@ -1610,12 +1613,12 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
sal_uInt32 nFaceNum = 0;
if( !*xRawFontData.get() ) // TTC candidate
nFaceNum = ~0U; // indicate "TTC font extracts only"
-
+
ScopedTrueTypeFont aSftTTF;
int nRC = aSftTTF.open( xRawFontData.get(), nFontSize1, nFaceNum );
if( nRC != SF_OK )
return;
-
+
int nGlyphs = GetTTGlyphCount( aSftTTF.get() );
if( nGlyphs > 0 )
{
@@ -1635,7 +1638,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplOs2FontData* pWinFont = static_cast<const ImplOs2FontData*>(pFont);
- const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
int nCharCount = pMap->GetCharCount();
@@ -1669,7 +1672,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rWidths.push_back( nCharWidth );
}
}
- }
+ }
}
//--------------------------------------------------------------------------
@@ -1685,14 +1688,14 @@ SystemFontData Os2SalGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
-
+
aSysFontData.nSize = sizeof( SystemFontData );
- aSysFontData.hFont = mhFonts[nFallbacklevel];
+ aSysFontData.hFont = mhFonts[nFallbacklevel];
aSysFontData.bFakeBold = false;
aSysFontData.bFakeItalic = false;
aSysFontData.bAntialias = true;
aSysFontData.bVerticalCharacterType = false;
-
+
return aSysFontData;
}
diff --git a/vcl/os2/source/gdi/salprn.cxx b/vcl/os2/source/gdi/salprn.cxx
index 7290cdbcb9fe..62613011c0f5 100644
--- a/vcl/os2/source/gdi/salprn.cxx
+++ b/vcl/os2/source/gdi/salprn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -68,10 +68,10 @@
struct ImplFormInfo
{
- long mnPaperWidth;
- long mnPaperHeight;
+ long mnPaperWidth;
+ long mnPaperHeight;
#ifndef NO_DJP
- DJPT_PAPERSIZE mnId;
+ DJPT_PAPERSIZE mnId;
#endif
};
@@ -83,12 +83,12 @@ struct ImplFormInfo
struct ImplTrayInfo
{
- CHAR maName[32];
- CHAR maDisplayName[64];
- DJPT_TRAYTYPE mnId;
+ CHAR maName[32];
+ CHAR maDisplayName[64];
+ DJPT_TRAYTYPE mnId;
ImplTrayInfo( const char* pTrayName,
- const char* pTrayDisplayName )
+ const char* pTrayDisplayName )
{
strcpy( maName, pTrayName);
strcpy( maDisplayName, pTrayDisplayName);
@@ -99,12 +99,12 @@ struct ImplTrayInfo
struct ImplQueueSalSysData
{
- ByteString maPrinterName; // pszPrinters
- ByteString maName; // pszName bzw. LogAddress
- ByteString maOrgDriverName; // pszDriverName (maDriverName.maDeviceName)
- ByteString maDriverName; // pszDriverName bis .
- ByteString maDeviceName; // pszDriverName nach .
- PDRIVDATA mpDrivData;
+ ByteString maPrinterName; // pszPrinters
+ ByteString maName; // pszName bzw. LogAddress
+ ByteString maOrgDriverName; // pszDriverName (maDriverName.maDeviceName)
+ ByteString maDriverName; // pszDriverName bis .
+ ByteString maDeviceName; // pszDriverName nach .
+ PDRIVDATA mpDrivData;
ImplQueueSalSysData( const ByteString& rPrinterName,
const ByteString& rName,
@@ -187,11 +187,11 @@ void Os2SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
ByteString aOrgDriverName( pPrqInfo->pszDriverName);
ByteString aName( pPrqInfo->pszName);
- pInfo->maDriver = ::rtl::OStringToOUString (aOrgDriverName, gsl_getSystemTextEncoding());
+ pInfo->maDriver = ::rtl::OStringToOUString (aOrgDriverName, gsl_getSystemTextEncoding());
pInfo->maPrinterName = ::rtl::OStringToOUString (pPrqInfo->pszComment, gsl_getSystemTextEncoding());
- pInfo->maLocation = ::rtl::OStringToOUString (aName, gsl_getSystemTextEncoding());
- pInfo->mnStatus = ImplPMQueueStatusToSal( pPrqInfo->fsStatus );
- pInfo->mnJobs = pPrqInfo->cJobs;
+ pInfo->maLocation = ::rtl::OStringToOUString (aName, gsl_getSystemTextEncoding());
+ pInfo->mnStatus = ImplPMQueueStatusToSal( pPrqInfo->fsStatus );
+ pInfo->mnJobs = pPrqInfo->cJobs;
// pInfo->maComment = !!!
// Feststellen, ob Name doppelt
@@ -214,7 +214,7 @@ void Os2SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
if ( (pDriverName = strchr( pPrqInfo->pszDriverName, '.' )) != 0 )
{
*pDriverName = 0;
- pDeviceName = pDriverName + 1;
+ pDeviceName = pDriverName + 1;
}
else
pDeviceName = NULL;
@@ -280,7 +280,7 @@ void Os2SalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
pSysData->maOrgDriverName.Equals( pPrqInfo->pszDriverName ) )
{
pInfo->mnStatus = ImplPMQueueStatusToSal( pPrqInfo->fsStatus );
- pInfo->mnJobs = pPrqInfo->cJobs;
+ pInfo->mnJobs = pPrqInfo->cJobs;
break;
}
@@ -303,12 +303,12 @@ void Os2SalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString Os2SalInstance::GetDefaultPrinter()
{
- APIRET rc;
- ULONG nNeeded;
- ULONG nReturned;
- ULONG nTotal;
- char szQueueName[255];
- XubString aDefaultName;
+ APIRET rc;
+ ULONG nNeeded;
+ ULONG nReturned;
+ ULONG nTotal;
+ char szQueueName[255];
+ XubString aDefaultName;
// query default queue
if ( !PrfQueryProfileString( HINI_PROFILE, SPL_INI_SPOOLER, "QUEUE", 0, szQueueName, sizeof( szQueueName ) ) )
@@ -510,11 +510,11 @@ static void ImplFormatInputList( PDJP_ITEM pDJP, PQUERYTUPLE pTuple )
BOOL fContinue = TRUE;
do
{
- pDJP->cb = sizeof (DJP_ITEM);
- pDJP->ulProperty = pTuple->ulProperty;
- pDJP->lType = pTuple->lType;
+ pDJP->cb = sizeof (DJP_ITEM);
+ pDJP->ulProperty = pTuple->ulProperty;
+ pDJP->lType = pTuple->lType;
pDJP->ulNumReturned = 0;
- pDJP->ulValue = DJP_NONE;
+ pDJP->ulValue = DJP_NONE;
// at EOL?
fContinue = DJP_NONE != pTuple->ulProperty;
@@ -555,19 +555,19 @@ static void ImplGetFormAndTrayList( Os2SalInfoPrinter* pOs2SalInfoPrinter, const
LONG alQuery[] =
{
- 0, 0, // First two members of QUERYSIZE
- DJP_CJ_FORM, DJP_ALL,
- DJP_CJ_TRAYNAME, DJP_ALL,
- DJP_NONE, DJP_NONE // EOL marker
+ 0, 0, // First two members of QUERYSIZE
+ DJP_CJ_FORM, DJP_ALL,
+ DJP_CJ_TRAYNAME, DJP_ALL,
+ DJP_NONE, DJP_NONE // EOL marker
};
- APIRET rc;
- PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
- PBYTE pBuffer = NULL;
- LONG nAlloc = 0;
- PDRIVDATA pCopyDrivData = ImplPrnDrivData( pSetupData );
- LONG nDrivDataSize = pCopyDrivData->cb;
- PBYTE pDrivData = (PBYTE)pCopyDrivData;
+ APIRET rc;
+ PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
+ PBYTE pBuffer = NULL;
+ LONG nAlloc = 0;
+ PDRIVDATA pCopyDrivData = ImplPrnDrivData( pSetupData );
+ LONG nDrivDataSize = pCopyDrivData->cb;
+ PBYTE pDrivData = (PBYTE)pCopyDrivData;
// find out how many bytes to allocate
pQuerySize->cb = sizeof( alQuery );
@@ -616,10 +616,10 @@ static void ImplGetFormAndTrayList( Os2SalInfoPrinter* pOs2SalInfoPrinter, const
pOs2SalInfoPrinter->mpFormArray = new PIMPLFORMINFO[pOs2SalInfoPrinter->mnFormCount];
for( int i = 0; i < pDJP->ulNumReturned; i++, pElm++ )
{
- ImplFormInfo* pInfo = new ImplFormInfo;
- pInfo->mnPaperWidth = pElm->hcInfo.cx;
- pInfo->mnPaperHeight = pElm->hcInfo.cy;
- pInfo->mnId = pElm->djppsFormID;
+ ImplFormInfo* pInfo = new ImplFormInfo;
+ pInfo->mnPaperWidth = pElm->hcInfo.cx;
+ pInfo->mnPaperHeight = pElm->hcInfo.cy;
+ pInfo->mnId = pElm->djppsFormID;
pOs2SalInfoPrinter->mpFormArray[i] = pInfo;
}
}
@@ -634,8 +634,8 @@ static void ImplGetFormAndTrayList( Os2SalInfoPrinter* pOs2SalInfoPrinter, const
pOs2SalInfoPrinter->mpTrayArray = new PIMPLTRAYINFO[pOs2SalInfoPrinter->mnTrayCount];
for( int i = 0; i < pDJP->ulNumReturned; i++, pElm++ )
{
- ImplTrayInfo* pInfo = new ImplTrayInfo( pElm->szTrayname, pElm->szDisplayTrayname );
- pInfo->mnId = pElm->djpttTrayID;
+ ImplTrayInfo* pInfo = new ImplTrayInfo( pElm->szTrayname, pElm->szDisplayTrayname );
+ pInfo->mnId = pElm->djpttTrayID;
pOs2SalInfoPrinter->mpTrayArray[i] = pInfo;
}
}
@@ -659,20 +659,20 @@ static BOOL ImplGetCurrentSettings( Os2SalInfoPrinter* pOs2SalInfoPrinter, ImplJ
LONG alQuery[] =
{
- 0, 0, // First two members of QUERYSIZE
- DJP_SJ_ORIENTATION, DJP_CURRENT,
- DJP_CJ_FORM, DJP_CURRENT,
- DJP_NONE, DJP_NONE // EOL marker
+ 0, 0, // First two members of QUERYSIZE
+ DJP_SJ_ORIENTATION, DJP_CURRENT,
+ DJP_CJ_FORM, DJP_CURRENT,
+ DJP_NONE, DJP_NONE // EOL marker
};
- APIRET rc;
- PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
- PBYTE pBuffer = NULL;
- LONG nAlloc = 0;
- PDRIVDATA pCopyDrivData = ImplPrnDrivData( pSetupData );
- LONG nDrivDataSize = pCopyDrivData->cb;
- PBYTE pDrivData = (PBYTE)pCopyDrivData;
- BOOL bResult;
+ APIRET rc;
+ PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
+ PBYTE pBuffer = NULL;
+ LONG nAlloc = 0;
+ PDRIVDATA pCopyDrivData = ImplPrnDrivData( pSetupData );
+ LONG nDrivDataSize = pCopyDrivData->cb;
+ PBYTE pDrivData = (PBYTE)pCopyDrivData;
+ BOOL bResult;
// find out how many bytes to allocate
pQuerySize->cb = sizeof( alQuery );
@@ -770,8 +770,8 @@ static BOOL ImplGetCurrentSettings( Os2SalInfoPrinter* pOs2SalInfoPrinter, ImplJ
}
// Wir suchen zuerst ueber den Namen/Id und dann ueber die Id
- BOOL bTrayFound = FALSE;
- USHORT j;
+ BOOL bTrayFound = FALSE;
+ USHORT j;
for ( j = 0; j < pOs2SalInfoPrinter->mnTrayCount; j++ )
{
if ( (pOs2SalInfoPrinter->mpTrayArray[j]->mnId == pElm->djpttTrayID) &&
@@ -825,16 +825,16 @@ static BOOL ImplSetOrientation( HDC hPrinterDC, PDRIVDATA pDriverData,
{
LONG alQuery[] =
{
- 0, 0, // First two members of QUERYSIZE
- DJP_SJ_ORIENTATION, DJP_CURRENT,
- DJP_NONE, DJP_NONE // EOL marker
+ 0, 0, // First two members of QUERYSIZE
+ DJP_SJ_ORIENTATION, DJP_CURRENT,
+ DJP_NONE, DJP_NONE // EOL marker
};
- APIRET rc;
- PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
- PBYTE pBuffer = NULL;
- LONG nAlloc = 0;
- LONG nDrivDataSize = pDriverData->cb;
+ APIRET rc;
+ PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
+ PBYTE pBuffer = NULL;
+ LONG nAlloc = 0;
+ LONG nDrivDataSize = pDriverData->cb;
// find out how many bytes to allocate
pQuerySize->cb = sizeof( alQuery );
@@ -855,10 +855,10 @@ static BOOL ImplSetOrientation( HDC hPrinterDC, PDRIVDATA pDriverData,
PDJP_ITEM pDJP = (PDJP_ITEM)pBuffer;
ImplFormatInputList( pDJP, pQuerySize->aTuples );
- pDJP->cb = sizeof( DJP_ITEM );
+ pDJP->cb = sizeof( DJP_ITEM );
pDJP->ulProperty = DJP_SJ_ORIENTATION;
- pDJP->lType = DJP_CURRENT;
- pDJP->ulValue = (eOrientation == ORIENTATION_PORTRAIT)
+ pDJP->lType = DJP_CURRENT;
+ pDJP->ulValue = (eOrientation == ORIENTATION_PORTRAIT)
? DJP_ORI_PORTRAIT
: DJP_ORI_LANDSCAPE;
@@ -882,16 +882,16 @@ static BOOL ImplSetPaperSize( HDC hPrinterDC, PDRIVDATA pDriverData,
{
LONG alQuery[] =
{
- 0, 0, // First two members of QUERYSIZE
- DJP_SJ_PAPERSIZE, DJP_CURRENT,
- DJP_NONE, DJP_NONE // EOL marker
+ 0, 0, // First two members of QUERYSIZE
+ DJP_SJ_PAPERSIZE, DJP_CURRENT,
+ DJP_NONE, DJP_NONE // EOL marker
};
- APIRET rc;
- PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
- PBYTE pBuffer = NULL;
- LONG nAlloc = 0;
- LONG nDrivDataSize = pDriverData->cb;
+ APIRET rc;
+ PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
+ PBYTE pBuffer = NULL;
+ LONG nAlloc = 0;
+ LONG nDrivDataSize = pDriverData->cb;
// find out how many bytes to allocate
pQuerySize->cb = sizeof( alQuery );
@@ -914,10 +914,10 @@ static BOOL ImplSetPaperSize( HDC hPrinterDC, PDRIVDATA pDriverData,
ImplFormatInputList( pDJP, pQuerySize->aTuples );
// Neue Daten zuweisen
- pDJP->cb = sizeof( DJP_ITEM );
+ pDJP->cb = sizeof( DJP_ITEM );
pDJP->ulProperty = DJP_SJ_PAPERSIZE;
- pDJP->lType = DJP_CURRENT;
- pDJP->ulValue = nOS2PaperFormat;
+ pDJP->lType = DJP_CURRENT;
+ pDJP->ulValue = nOS2PaperFormat;
// und setzen
rc = DevEscape( hPrinterDC,
@@ -939,16 +939,16 @@ static BOOL ImplSetPaperBin( HDC hPrinterDC, PDRIVDATA pDriverData,
{
LONG alQuery[] =
{
- 0, 0, // First two members of QUERYSIZE
- DJP_SJ_TRAYTYPE, DJP_CURRENT,
- DJP_NONE, DJP_NONE // EOL marker
+ 0, 0, // First two members of QUERYSIZE
+ DJP_SJ_TRAYTYPE, DJP_CURRENT,
+ DJP_NONE, DJP_NONE // EOL marker
};
- APIRET rc;
- PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
- PBYTE pBuffer = NULL;
- LONG nAlloc = 0;
- LONG nDrivDataSize = pDriverData->cb;
+ APIRET rc;
+ PQUERYSIZE pQuerySize = (PQUERYSIZE)alQuery;
+ PBYTE pBuffer = NULL;
+ LONG nAlloc = 0;
+ LONG nDrivDataSize = pDriverData->cb;
// find out how many bytes to allocate
pQuerySize->cb = sizeof( alQuery );
@@ -970,10 +970,10 @@ static BOOL ImplSetPaperBin( HDC hPrinterDC, PDRIVDATA pDriverData,
ImplFormatInputList( pDJP, pQuerySize->aTuples );
// Neue Daten zuweisen
- pDJP->cb = sizeof( DJP_ITEM );
+ pDJP->cb = sizeof( DJP_ITEM );
pDJP->ulProperty = DJP_SJ_TRAYTYPE;
- pDJP->lType = DJP_CURRENT;
- pDJP->ulValue = pTrayInfo->mnId;
+ pDJP->lType = DJP_CURRENT;
+ pDJP->ulValue = pTrayInfo->mnId;
// und setzen
rc = DevEscape( hPrinterDC,
@@ -998,10 +998,10 @@ static BOOL ImplSalCreateInfoPrn( Os2SalInfoPrinter* pPrinter, PDRIVDATA pDriver
// create info context
DEVOPENSTRUC devOpenStruc;
memset( &devOpenStruc, 0, sizeof( devOpenStruc ) );
- devOpenStruc.pszLogAddress = (char*)pPrinter->maName.GetBuffer();
- devOpenStruc.pszDriverName = (char*)pPrinter->maDriverName.GetBuffer();
- devOpenStruc.pdriv = pDriverData;
- devOpenStruc.pszDataType = "PM_Q_STD";
+ devOpenStruc.pszLogAddress = (char*)pPrinter->maName.GetBuffer();
+ devOpenStruc.pszDriverName = (char*)pPrinter->maDriverName.GetBuffer();
+ devOpenStruc.pdriv = pDriverData;
+ devOpenStruc.pszDataType = "PM_Q_STD";
HDC hDC = DevOpenDC( pSalData->mhAB, OD_INFO, "*",
4, (PDEVOPENDATA)&devOpenStruc, (HDC)NULL);
@@ -1041,15 +1041,15 @@ SalInfoPrinter* Os2SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
{
ImplQueueSalSysData* pSysQueueData = (ImplQueueSalSysData*)(pQueueInfo->mpSysData);
Os2SalInfoPrinter* pPrinter = new Os2SalInfoPrinter;
- pPrinter->maPrinterName = pSysQueueData->maPrinterName;
- pPrinter->maName = pSysQueueData->maName;
- pPrinter->maDriverName = pSysQueueData->maDriverName;
- pPrinter->maDeviceName = pSysQueueData->maDeviceName;
+ pPrinter->maPrinterName = pSysQueueData->maPrinterName;
+ pPrinter->maName = pSysQueueData->maName;
+ pPrinter->maDriverName = pSysQueueData->maDriverName;
+ pPrinter->maDeviceName = pSysQueueData->maDeviceName;
// Nur Setup-Daten uebernehmen, wenn Treiber und Laenge der Treiberdaten
// uebereinstimmt
- PDRIVDATA pDriverData;
- BOOL bUpdateDriverData;
+ PDRIVDATA pDriverData;
+ BOOL bUpdateDriverData;
if ( pSetupData->mpDriverData && pSysQueueData->mpDrivData &&
(pSetupData->mnSystem == JOBSETUP_SYSTEM_OS2) &&
(pSetupData->mnDriverDataLen == pSysQueueData->mpDrivData->cb) &&
@@ -1077,16 +1077,16 @@ SalInfoPrinter* Os2SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
// create graphics object for output
Os2SalGraphics* pGraphics = new Os2SalGraphics;
- pGraphics->mhDC = pPrinter->mhDC;
- pGraphics->mhPS = pPrinter->mhPS;
- pGraphics->mhWnd = 0;
- pGraphics->mbPrinter = TRUE;
- pGraphics->mbVirDev = FALSE;
- pGraphics->mbWindow = FALSE;
- pGraphics->mbScreen = FALSE;
+ pGraphics->mhDC = pPrinter->mhDC;
+ pGraphics->mhPS = pPrinter->mhPS;
+ pGraphics->mhWnd = 0;
+ pGraphics->mbPrinter = TRUE;
+ pGraphics->mbVirDev = FALSE;
+ pGraphics->mbWindow = FALSE;
+ pGraphics->mbScreen = FALSE;
ImplSalInitGraphics( pGraphics );
- pPrinter->mpGraphics = pGraphics;
+ pPrinter->mpGraphics = pGraphics;
// check printer driver for DJP support
pPrinter->mbDJPSupported = ImplIsDriverDJPEnabled( pPrinter->mhDC );
@@ -1119,15 +1119,15 @@ void Os2SalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
Os2SalInfoPrinter::Os2SalInfoPrinter()
{
- mhDC = 0;
- mhPS = 0;
- mpGraphics = NULL;
- mbGraphics = FALSE;
- mbDJPSupported = FALSE;
- mnFormCount = 0;
- mpFormArray = NULL;
- mnTrayCount = 0;
- mpTrayArray = NULL;
+ mhDC = 0;
+ mhPS = 0;
+ mpGraphics = NULL;
+ mbGraphics = FALSE;
+ mbDJPSupported = FALSE;
+ mnFormCount = 0;
+ mpFormArray = NULL;
+ mnTrayCount = 0;
+ mpTrayArray = NULL;
}
// -----------------------------------------------------------------------
@@ -1317,8 +1317,8 @@ BOOL Os2SalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
{
nOS2PaperFormat = DJP_PSI_NONE;
// OS2 rechnet in Millimetern
- long nPaperWidth = pSetupData->mnPaperWidth / 100;
- long nPaperHeight = pSetupData->mnPaperHeight / 100;
+ long nPaperWidth = pSetupData->mnPaperWidth / 100;
+ long nPaperHeight = pSetupData->mnPaperHeight / 100;
// Ansonsten ueber die Papiergroesse suchen
for( int i = 0; i < mnFormCount; i++ )
{
@@ -1453,7 +1453,7 @@ void Os2SalInfoPrinter::GetPageInfo( const ImplJobSetup*,
HDC hDC = mhDC;
// search current form
- HCINFO aInfo;
+ HCINFO aInfo;
int nForms = DevQueryHardcopyCaps( hDC, 0, 0, &aInfo );
for( int i = 0; i < nForms; i++ )
{
@@ -1466,12 +1466,12 @@ void Os2SalInfoPrinter::GetPageInfo( const ImplJobSetup*,
long nYResolution;
DevQueryCaps( hDC, CAPS_HORIZONTAL_RESOLUTION, 1, &nXResolution );
DevQueryCaps( hDC, CAPS_VERTICAL_RESOLUTION, 1, &nYResolution );
- rPageOffX = aInfo.xLeftClip * nXResolution / 1000;
- rPageOffY = (aInfo.cy-aInfo.yTopClip) * nYResolution / 1000;
- rPageWidth = aInfo.cx * nXResolution / 1000;
+ rPageOffX = aInfo.xLeftClip * nXResolution / 1000;
+ rPageOffY = (aInfo.cy-aInfo.yTopClip) * nYResolution / 1000;
+ rPageWidth = aInfo.cx * nXResolution / 1000;
rPageHeight = aInfo.cy * nYResolution / 1000;
- rOutWidth = aInfo.xPels;
- rOutHeight = aInfo.yPels;
+ rOutWidth = aInfo.xPels;
+ rOutHeight = aInfo.yPels;
return;
}
}
@@ -1482,11 +1482,11 @@ void Os2SalInfoPrinter::GetPageInfo( const ImplJobSetup*,
long lCapsHeight = 0;
DevQueryCaps( hDC, CAPS_WIDTH, 1L, &lCapsWidth );
DevQueryCaps( hDC, CAPS_HEIGHT, 1L, &lCapsHeight );
- rPageOffX = 0;
- rPageOffY = 0;
- rOutWidth = lCapsWidth;
- rOutHeight = lCapsHeight;
- rPageWidth = rOutWidth;
+ rPageOffX = 0;
+ rPageOffY = 0;
+ rOutWidth = lCapsWidth;
+ rOutHeight = lCapsHeight;
+ rPageWidth = rOutWidth;
rPageHeight = rOutHeight;
}
@@ -1539,11 +1539,11 @@ void Os2SalInstance::DestroyPrinter( SalPrinter* pPrinter )
Os2SalPrinter::Os2SalPrinter()
{
- mhDC = 0;
- mhPS = 0;
- mpGraphics = NULL;
- mbAbort = FALSE;
- mbPrintDJPSupported = FALSE;
+ mhDC = 0;
+ mhPS = 0;
+ mpGraphics = NULL;
+ mbAbort = FALSE;
+ mbPrintDJPSupported = FALSE;
}
// -----------------------------------------------------------------------
@@ -1562,9 +1562,9 @@ BOOL Os2SalPrinter::StartJob( const XubString* pFileName,
bool bDirect,
ImplJobSetup* pSetupData )
{
- DEVOPENSTRUC aDevOpenStruc;
- LONG lType;
- APIRET rc;
+ DEVOPENSTRUC aDevOpenStruc;
+ LONG lType;
+ APIRET rc;
// prepare queue information
memset( &aDevOpenStruc, 0, sizeof( aDevOpenStruc ) );
@@ -1601,8 +1601,8 @@ BOOL Os2SalPrinter::StartJob( const XubString* pFileName,
}
// open device context
- SalData* pSalData = GetSalData();
- HAB hAB = pSalData->mhAB;
+ SalData* pSalData = GetSalData();
+ HAB hAB = pSalData->mhAB;
aDevOpenStruc.pdriv = (PDRIVDATA)pSetupData->mpDriverData;
mhDC = DevOpenDC( hAB,
lType,
@@ -1721,20 +1721,20 @@ SalGraphics* Os2SalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobSet
mbFirstPage = FALSE;
else
{
- PBYTE pJobData;
- LONG nJobDataSize;
- LONG nEscape;
+ PBYTE pJobData;
+ LONG nJobDataSize;
+ LONG nEscape;
if ( mbPrintDJPSupported && bNewJobSetup )
{
- nEscape = DEVESC_NEWFRAME_WPROP;
- nJobDataSize = ((PDRIVDATA)(pSetupData->mpDriverData))->cb;
- pJobData = (PBYTE)(pSetupData->mpDriverData);
+ nEscape = DEVESC_NEWFRAME_WPROP;
+ nJobDataSize = ((PDRIVDATA)(pSetupData->mpDriverData))->cb;
+ pJobData = (PBYTE)(pSetupData->mpDriverData);
}
else
{
- nEscape = DEVESC_NEWFRAME;
- nJobDataSize = 0;
- pJobData = NULL;
+ nEscape = DEVESC_NEWFRAME;
+ nJobDataSize = 0;
+ pJobData = NULL;
}
rc = DevEscape( mhDC,
nEscape,
@@ -1754,23 +1754,23 @@ SalGraphics* Os2SalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobSet
// create SalGraphics with copy of hPS
Os2SalGraphics* pGraphics = new Os2SalGraphics;
- pGraphics->mhDC = mhDC;
- pGraphics->mhPS = mhPS;
- pGraphics->mhWnd = 0;
- pGraphics->mbPrinter = TRUE;
- pGraphics->mbVirDev = FALSE;
- pGraphics->mbWindow = FALSE;
- pGraphics->mbScreen = FALSE;
- pGraphics->mnHeight = 0;
+ pGraphics->mhDC = mhDC;
+ pGraphics->mhPS = mhPS;
+ pGraphics->mhWnd = 0;
+ pGraphics->mbPrinter = TRUE;
+ pGraphics->mbVirDev = FALSE;
+ pGraphics->mbWindow = FALSE;
+ pGraphics->mbScreen = FALSE;
+ pGraphics->mnHeight = 0;
// search current form for actual page height
- HCINFO aInfo;
- int nForms = DevQueryHardcopyCaps( mhDC, 0, 0, &aInfo );
+ HCINFO aInfo;
+ int nForms = DevQueryHardcopyCaps( mhDC, 0, 0, &aInfo );
for( int i = 0; i < nForms; i++ )
{
if ( DevQueryHardcopyCaps( mhDC, i, 1, &aInfo ) >= 0 )
{
if ( aInfo.flAttributes & HCAPS_CURRENT )
- pGraphics->mnHeight = aInfo.yPels;
+ pGraphics->mnHeight = aInfo.yPels;
}
}
// use device caps if no form selected/found
diff --git a/vcl/os2/source/gdi/salvd.cxx b/vcl/os2/source/gdi/salvd.cxx
index 5f7ab7bb0cf0..15ad701ea8a9 100644
--- a/vcl/os2/source/gdi/salvd.cxx
+++ b/vcl/os2/source/gdi/salvd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -60,9 +60,9 @@ HBITMAP ImplCreateVirDevBitmap( HDC hDC, HPS hPS, long nDX, long nDY,
HBITMAP hBitmap;
BITMAPINFOHEADER2 aBitmapInfo;
memset( &aBitmapInfo, 0, sizeof( BITMAPINFOHEADER2 ) );
- aBitmapInfo.cbFix = sizeof( BITMAPINFOHEADER2 );
- aBitmapInfo.cx = nDX;
- aBitmapInfo.cy = nDY;
+ aBitmapInfo.cbFix = sizeof( BITMAPINFOHEADER2 );
+ aBitmapInfo.cx = nDX;
+ aBitmapInfo.cy = nDY;
aBitmapInfo.cPlanes = nPlanes;
aBitmapInfo.cBitCount = (nBitCount < 4) ? 4 : nBitCount;
hBitmap = GpiCreateBitmap( hPS, &aBitmapInfo, 0, NULL, NULL );
@@ -77,8 +77,8 @@ SalVirtualDevice* Os2SalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
const SystemGraphicsData* pData )
{
Os2SalGraphics* pGraphics = static_cast<Os2SalGraphics*>(pSGraphics);
- HAB hAB = GetSalData()->mhAB;
- SIZEL size;
+ HAB hAB = GetSalData()->mhAB;
+ SIZEL size;
// create device context (at this time allways display compatible)
DEVOPENSTRUC aDevOpenStruc = { NULL, "DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL };
@@ -106,26 +106,26 @@ SalVirtualDevice* Os2SalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
}
// init data
- Os2SalVirtualDevice* pVDev = new Os2SalVirtualDevice;
- Os2SalGraphics* pVirGraphics = new Os2SalGraphics;
-
- pVirGraphics->mhDC = hDC;
- pVirGraphics->mhPS = hPS;
- pVirGraphics->mhWnd = 0;
- pVirGraphics->mnHeight = nDY;
- pVirGraphics->mbPrinter = FALSE;
- pVirGraphics->mbVirDev = TRUE;
- pVirGraphics->mbWindow = FALSE;
- pVirGraphics->mbScreen = pGraphics->mbScreen;
+ Os2SalVirtualDevice* pVDev = new Os2SalVirtualDevice;
+ Os2SalGraphics* pVirGraphics = new Os2SalGraphics;
+
+ pVirGraphics->mhDC = hDC;
+ pVirGraphics->mhPS = hPS;
+ pVirGraphics->mhWnd = 0;
+ pVirGraphics->mnHeight = nDY;
+ pVirGraphics->mbPrinter = FALSE;
+ pVirGraphics->mbVirDev = TRUE;
+ pVirGraphics->mbWindow = FALSE;
+ pVirGraphics->mbScreen = pGraphics->mbScreen;
ImplSalInitGraphics( pVirGraphics );
- pVDev->mhDC = hDC;
- pVDev->mhPS = hPS;
- pVDev->mhBmp = hBmp;
- pVDev->mhDefBmp = Ft2SetBitmap( hPS, hBmp );
- pVDev->mpGraphics = pVirGraphics;
- pVDev->mnBitCount = nBitCount;
- pVDev->mbGraphics = FALSE;
+ pVDev->mhDC = hDC;
+ pVDev->mhPS = hPS;
+ pVDev->mhBmp = hBmp;
+ pVDev->mhDefBmp = Ft2SetBitmap( hPS, hBmp );
+ pVDev->mpGraphics = pVirGraphics;
+ pVDev->mnBitCount = nBitCount;
+ pVDev->mbGraphics = FALSE;
return pVDev;
}
diff --git a/vcl/os2/source/window/makefile.mk b/vcl/os2/source/window/makefile.mk
index 560d35880b21..f4a6ad0cb870 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)$/salobj.obj $(SLO)$/salmenu.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index ebc557faafb2..dc54c6ba5f56 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,7 +52,7 @@
#include <vcl/keycodes.hxx>
#include <saltimer.h>
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
extern "C" int debug_printf(const char *f, ...);
static BOOL _bCapture;
@@ -83,10 +83,10 @@ ULONG Os2SalFrame::mnInputLang = 0;
// =======================================================================
// define a new flag
-#define SWP_CENTER (SWP_NOAUTOCLOSE<<4)
-#define SWP_SHOWMAXIMIZED (SWP_ACTIVATE | SWP_SHOW | SWP_MAXIMIZE)
-#define SWP_SHOWMINIMIZED (SWP_ACTIVATE | SWP_SHOW | SWP_MINIMIZE)
-#define SWP_SHOWNORMAL (SWP_ACTIVATE | SWP_SHOW | SWP_RESTORE)
+#define SWP_CENTER (SWP_NOAUTOCLOSE<<4)
+#define SWP_SHOWMAXIMIZED (SWP_ACTIVATE | SWP_SHOW | SWP_MAXIMIZE)
+#define SWP_SHOWMINIMIZED (SWP_ACTIVATE | SWP_SHOW | SWP_MINIMIZE)
+#define SWP_SHOWNORMAL (SWP_ACTIVATE | SWP_SHOW | SWP_RESTORE)
static LONG nScreenHeight = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN);
static LONG nScreenWidth = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
@@ -112,8 +112,8 @@ BOOL APIENTRY _WinQueryWindowPos( Os2SalFrame* pFrame, PSWP pswp)
SWP swpOwner;
BOOL rc = WinQueryWindowPos( pFrame->mhWndFrame, pswp);
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( "> WinQueryWindowPos hwnd %x at %d,%d (%dx%d)\n",
+#if OSL_DEBUG_LEVEL>1
+ debug_printf( "> WinQueryWindowPos hwnd %x at %d,%d (%dx%d)\n",
pFrame->mhWndFrame, pswp->x, pswp->y, pswp->cx, pswp->cy);
#endif
@@ -123,11 +123,11 @@ BOOL APIENTRY _WinQueryWindowPos( Os2SalFrame* pFrame, PSWP pswp)
if ( pParentFrame )
{
POINTL ptlOwner = {0};
-
- // coords are relative to screen, map to parent frame client area
+
+ // coords are relative to screen, map to parent frame client area
ptlOwner.x = pswp->x;
ptlOwner.y = pswp->y;
- WinMapWindowPoints( HWND_DESKTOP, pParentFrame->mhWndClient, &ptlOwner, 1);
+ WinMapWindowPoints( HWND_DESKTOP, pParentFrame->mhWndClient, &ptlOwner, 1);
pswp->x = ptlOwner.x;
pswp->y = ptlOwner.y;
// get parent client area size
@@ -142,8 +142,8 @@ BOOL APIENTRY _WinQueryWindowPos( Os2SalFrame* pFrame, PSWP pswp)
// invert Y coordinate
pswp->y = swpOwner.cy - (pswp->y + pswp->cy);
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( "< WinQueryWindowPos hwnd %x at %d,%d (%dx%d)\n",
+#if OSL_DEBUG_LEVEL>1
+ debug_printf( "< WinQueryWindowPos hwnd %x at %d,%d (%dx%d)\n",
pFrame->mhWndFrame, pswp->x, pswp->y, pswp->cx, pswp->cy);
#endif
return rc;
@@ -152,32 +152,32 @@ BOOL APIENTRY _WinQueryWindowPos( Os2SalFrame* pFrame, PSWP pswp)
BOOL APIENTRY _WinSetWindowPos( Os2SalFrame* pFrame, HWND hwndInsertBehind, LONG x, LONG y,
LONG cx, LONG cy, ULONG fl)
{
- SWP swpOwner = {0};
- POINTL ptlOwner = {0};
- HWND hParent = NULL;
+ SWP swpOwner = {0};
+ POINTL ptlOwner = {0};
+ HWND hParent = NULL;
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( ">WinSetWindowPos hwnd %x at %d,%d (%dx%d) fl 0x%08x\n",
+#if OSL_DEBUG_LEVEL>1
+ debug_printf( ">WinSetWindowPos hwnd %x at %d,%d (%dx%d) fl 0x%08x\n",
pFrame->mhWndFrame, x, y, cx, cy, fl);
#endif
// first resize window if requested
- if ( (fl & SWP_SIZE) ) {
- ULONG flag = SWP_SIZE;
- LONG nX = 0, nY = 0;
- LONG frameFrameX, frameFrameY, frameCaptionY;
+ if ( (fl & SWP_SIZE) ) {
+ ULONG flag = SWP_SIZE;
+ LONG nX = 0, nY = 0;
+ LONG frameFrameX, frameFrameY, frameCaptionY;
ImplSalCalcFrameSize( pFrame, frameFrameX, frameFrameY, frameCaptionY );
// if we change y size, we need to move the window down
// because os2 window origin is lower left corner
if (pFrame->maGeometry.nHeight != cy) {
- SWP aSWP;
+ SWP aSWP;
WinQueryWindowPos( pFrame->mhWndFrame, &aSWP);
nX = aSWP.x;
nY = aSWP.y - (cy + 2*frameFrameY + frameCaptionY - aSWP.cy);
flag |= SWP_MOVE;
}
- WinSetWindowPos( pFrame->mhWndFrame, NULL, nX, nY,
+ WinSetWindowPos( pFrame->mhWndFrame, NULL, nX, nY,
cx+2*frameFrameX, cy+2*frameFrameY+frameCaptionY, flag);
fl = fl & ~SWP_SIZE;
}
@@ -200,42 +200,42 @@ BOOL APIENTRY _WinSetWindowPos( Os2SalFrame* pFrame, HWND hwndInsertBehind, LONG
WinQueryWindowPos( hParent, &swpOwner);
//YD adjust to owner coordinates only when moving and not centering
- //if (!(fl & SWP_CENTER) && (fl & SWP_MOVE))
- if ((fl & SWP_MOVE))
+ //if (!(fl & SWP_CENTER) && (fl & SWP_MOVE))
+ if ((fl & SWP_MOVE))
{
// if SWP_CENTER is specified, change position to parent center
if (fl & SWP_CENTER) {
ptlOwner.x = (swpOwner.cx - cx) / 2;
ptlOwner.y = (swpOwner.cy - cy) / 2;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf( "_WinSetWindowPos SWP_CENTER\n");
#endif
fl = fl & ~SWP_CENTER;
- } else {
- // coords are relative to parent frame client area, map to screen
+ } else {
+ // coords are relative to parent frame client area, map to screen
// map Y to OS/2 system coordinates
ptlOwner.x = x;
ptlOwner.y = swpOwner.cy - (y + cy);
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( "_WinSetWindowPos owner 0x%x at %d,%d (%dx%d) OS2\n",
+#if OSL_DEBUG_LEVEL>0
+ debug_printf( "_WinSetWindowPos owner 0x%x at %d,%d (%dx%d) OS2\n",
hParent, ptlOwner.x, ptlOwner.y, swpOwner.cx, swpOwner.cy);
#endif
}
// map from client area to screen
- WinMapWindowPoints( hParent, HWND_DESKTOP, &ptlOwner, 1);
+ WinMapWindowPoints( hParent, HWND_DESKTOP, &ptlOwner, 1);
x = ptlOwner.x;
y = ptlOwner.y;
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( "_WinSetWindowPos owner 0x%x at %d,%d (%dx%d) MAPPED OS2\n",
+#if OSL_DEBUG_LEVEL>0
+ debug_printf( "_WinSetWindowPos owner 0x%x at %d,%d (%dx%d) MAPPED OS2\n",
hParent, ptlOwner.x, ptlOwner.y, swpOwner.cx, swpOwner.cy);
#endif
}
-#if OSL_DEBUG_LEVEL > 1
- debug_printf( "<WinSetWindowPos hwnd %x at %d,%d (%dx%d) fl=%x\n",
+#if OSL_DEBUG_LEVEL>0
+ debug_printf( "<WinSetWindowPos hwnd %x at %d,%d (%dx%d) fl=%x\n",
pFrame->mhWndFrame, x, y, cx, cy, fl);
#endif
return WinSetWindowPos( pFrame->mhWndFrame, hwndInsertBehind, x, y, 0, 0, fl);
@@ -243,12 +243,12 @@ BOOL APIENTRY _WinSetWindowPos( Os2SalFrame* pFrame, HWND hwndInsertBehind, LONG
// =======================================================================
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
static void dumpWindowInfo( char* fnc, HWND hwnd)
{
SWP aSWP;
- HWND hwnd2;
- char szTitle[256];
+ HWND hwnd2;
+ char szTitle[256];
}
#endif
@@ -348,7 +348,7 @@ static void ImplSaveFrameState( Os2SalFrame* pFrame )
if ( aSWP.fl & SWP_MINIMIZE )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::GetWindowState %08x SAL_FRAMESTATE_MINIMIZED\n",
pFrame->mhWndFrame);
#endif
@@ -358,7 +358,7 @@ static void ImplSaveFrameState( Os2SalFrame* pFrame )
}
else if ( aSWP.fl & SWP_MAXIMIZE )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::GetWindowState %08x SAL_FRAMESTATE_MAXIMIZED\n",
pFrame->mhWndFrame);
#endif
@@ -384,7 +384,7 @@ static void ImplSaveFrameState( Os2SalFrame* pFrame )
pFrame->maState.mnY = nScreenHeight - (aSWP.y+aSWP.cy)+nTopDeco;
pFrame->maState.mnWidth = aSWP.cx-nLeftDeco-nRightDeco;
pFrame->maState.mnHeight = aSWP.cy-nTopDeco-nBottomDeco;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::GetWindowState %08x (%dx%d) at %d,%d VCL\n",
pFrame->mhWndFrame,
pFrame->maState.mnWidth,pFrame->maState.mnHeight,pFrame->maState.mnX,pFrame->maState.mnY);
@@ -392,6 +392,9 @@ static void ImplSaveFrameState( Os2SalFrame* pFrame )
if ( bVisible )
pFrame->mnShowState = SWP_SHOWNORMAL;
pFrame->mbRestoreMaximize = FALSE;
+ //debug_printf( "ImplSaveFrameState: window %08x at %d,%d (size %dx%d)\n",
+ // pFrame->mhWndFrame,
+ // pFrame->maState.mnX, pFrame->maState.mnY, pFrame->maState.mnWidth, pFrame->maState.mnHeight);
}
}
}
@@ -441,8 +444,9 @@ static void ImplSalCalcFrameSize( const Os2SalFrame* pFrame,
nCaptionY = WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR );
else
nCaptionY = 0;
-
-#if OSL_DEBUG_LEVEL > 1
+
+#if OSL_DEBUG_LEVEL>0
+ //if (_bCapture)
debug_printf("ImplSalCalcFrameSize 0x%08x x=%d y=%d t=%d\n", pFrame->mhWndFrame, nFrameX, nFrameY, nCaptionY);
#endif
}
@@ -557,16 +561,16 @@ static USHORT aImplTranslateKeyTab[KEY_TAB_SIZE] =
SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle )
{
- SalData* pSalData = GetSalData();
- Os2SalFrame* pFrame = new Os2SalFrame;
- HWND hWndFrame;
- HWND hWndClient;
- ULONG nFrameFlags = FCF_NOBYTEALIGN | FCF_SCREENALIGN;
- ULONG nFrameStyle = 0;
- ULONG nClientStyle = WS_CLIPSIBLINGS;
- BOOL bSubFrame = FALSE;
+ SalData* pSalData = GetSalData();
+ Os2SalFrame* pFrame = new Os2SalFrame;
+ HWND hWndFrame;
+ HWND hWndClient;
+ ULONG nFrameFlags = FCF_NOBYTEALIGN | FCF_SCREENALIGN;
+ ULONG nFrameStyle = 0;
+ ULONG nClientStyle = WS_CLIPSIBLINGS;
+ BOOL bSubFrame = FALSE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf(">ImplSalCreateFrame hWndParent 0x%x, nSalFrameStyle 0x%x\n", hWndParent, nSalFrameStyle);
#endif
@@ -603,7 +607,7 @@ SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSal
nFrameFlags |= FCF_TASKLIST;
}
}
-
+
if( nSalFrameStyle & SAL_FRAME_STYLE_TOOLWINDOW )
{
pFrame->mbNoIcon = TRUE;
@@ -612,8 +616,12 @@ SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSal
if ( nSalFrameStyle & SAL_FRAME_STYLE_FLOAT )
{
+ //nExSysStyle |= WS_EX_TOOLWINDOW;
pFrame->mbFloatWin = TRUE;
}
+ //if( nSalFrameStyle & SAL_FRAME_STYLE_TOOLTIP )
+ // nExSysStyle |= WS_EX_TOPMOST;
+
// init frame data
pFrame->mnStyle = nSalFrameStyle;
@@ -623,12 +631,12 @@ SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSal
// create frame
//YD FIXME this is a potential bug with multiple threads and cuncurrent
//window creation, because this field is accessed in
- //WM_CREATE to get window data,
+ //WM_CREATE to get window data,
pSalData->mpCreateFrame = pFrame;
//YD FIXME if SAL_FRAME_CHILD is specified, use hWndParent as parent handle...
hWndFrame = WinCreateStdWindow( HWND_DESKTOP, nFrameStyle, &nFrameFlags,
- (PSZ)(bSubFrame ? SAL_SUBFRAME_CLASSNAME : SAL_FRAME_CLASSNAME),
+ (PSZ)(bSubFrame ? SAL_SUBFRAME_CLASSNAME : SAL_FRAME_CLASSNAME),
NULL,
nClientStyle, 0, 0, &hWndClient );
debug_printf("ImplSalCreateFrame hWndParent 0x%x, hWndFrame 0x%x, hWndClient 0x%x\n", hWndParent, hWndFrame, hWndClient);
@@ -639,7 +647,7 @@ SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSal
}
// Parent setzen (Owner)
- if ( hWndParent != 0 && hWndParent != HWND_DESKTOP )
+ if ( hWndParent != 0 && hWndParent != HWND_DESKTOP )
WinSetOwner( hWndFrame, hWndParent );
Os2SalFrame* pParentFrame = GetWindowPtr( hWndParent );
@@ -682,7 +690,7 @@ SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSal
// init OS/2 frame data
pFrame->mhAB = pInst->mhAB;
- // YD 18/08 under OS/2, invisible frames have size 0,0 at 0,0, so
+ // YD 18/08 under OS/2, invisible frames have size 0,0 at 0,0, so
// we need to set an initial size/position manually
SWP aSWP;
memset( &aSWP, 0, sizeof( aSWP ) );
@@ -754,6 +762,7 @@ Os2SalFrame::Os2SalFrame()
mbConversionMode = FALSE;
mbCandidateMode = FALSE;
mbCaption = FALSE;
+ //mhDefIMEContext = 0;
mpGraphics = NULL;
mnShowState = SWP_SHOWNORMAL;
mnWidth = 0;
@@ -770,17 +779,24 @@ Os2SalFrame::Os2SalFrame()
mbFixBorder = FALSE;
mbSizeBorder = FALSE;
mbFullScreen = FALSE;
+ //mbPresentation = FALSE;
mbInShow = FALSE;
mbRestoreMaximize = FALSE;
mbInMoveMsg = FALSE;
mbInSizeMsg = FALSE;
+ //mbFullScreenToolWin = FALSE;
mbDefPos = TRUE;
mbOverwriteState = TRUE;
+ //mbIME = FALSE;
mbHandleIME = FALSE;
+ //mbSpezIME = FALSE;
+ //mbAtCursorIME = FALSE;
mbCandidateMode = FALSE;
mbFloatWin = FALSE;
mbNoIcon = FALSE;
- mpParentFrame = NULL;
+ //mSelectedhMenu = 0;
+ //mLastActivatedhMenu = 0;
+ mpParentFrame = NULL;
memset( &maState, 0, sizeof( SalFrameState ) );
maSysData.nSize = sizeof( SystemEnvData );
@@ -928,7 +944,7 @@ static void ImplSalShow( HWND hWnd, ULONG bVisible, ULONG bNoActivate )
pFrame->mbOverwriteState = TRUE;
pFrame->mbInShow = TRUE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
debug_printf( "ImplSalShow hwnd %x visible flag %d, no activate: flag %d\n", hWnd, bVisible, bNoActivate);
#endif
@@ -948,7 +964,7 @@ static void ImplSalShow( HWND hWnd, ULONG bVisible, ULONG bNoActivate )
}
else
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
debug_printf( "ImplSalShow hwnd %x HIDE\n");
#endif
WinSetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_HIDE);
@@ -1005,10 +1021,11 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
USHORT nFlags )
{
// calculation frame size
- USHORT nEvent = 0;
- ULONG nPosFlags = 0;
+ USHORT nEvent = 0;
+ ULONG nPosFlags = 0;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
+ //dumpWindowInfo( "-Os2SalFrame::SetPosSize", mhWndFrame);
debug_printf( ">Os2SalFrame::SetPosSize go to %d,%d (%dx%d) VCL\n",nX,nY,nWidth,nHeight);
#endif
@@ -1030,20 +1047,21 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
if ( (nFlags & (SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y)) ) {
nPosFlags |= SWP_MOVE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
debug_printf( "-Os2SalFrame::SetPosSize MOVE to %d,%d\n", nX, nY);
#endif
+ //DBG_ASSERT( nX && nY, " Windowposition of (0,0) requested!" );
nEvent = SALEVENT_MOVE;
}
if ( (nFlags & (SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT)) ) {
nPosFlags |= SWP_SIZE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
debug_printf( "-Os2SalFrame::SetPosSize SIZE to %d,%d\n", nWidth,nHeight);
#endif
nEvent = (nEvent == SALEVENT_MOVE) ? SALEVENT_MOVERESIZE : SALEVENT_RESIZE;
}
-
+
// Default-Position, dann zentrieren, ansonsten Position beibehalten
if ( mbDefPos && !(nPosFlags & SWP_MOVE))
{
@@ -1051,7 +1069,7 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
mbDefPos = FALSE;
nPosFlags |= SWP_MOVE | SWP_CENTER;
nEvent = SALEVENT_MOVERESIZE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 10
debug_printf( "-Os2SalFrame::SetPosSize CENTER\n");
debug_printf( "-Os2SalFrame::SetPosSize default position to %d,%d\n", nX, nY);
#endif
@@ -1085,6 +1103,11 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
nY = 0;
}
+ // bring floating windows always to top
+ // do not change zorder, otherwise tooltips will bring main window to top (ticket:14)
+ //if( (mnStyle & SAL_FRAME_STYLE_FLOAT) )
+ // nPosFlags |= SWP_ZORDER; // do not change z-order
+
// set new position
_WinSetWindowPos( this, HWND_TOP, nX, nY, nWidth, nHeight, nPosFlags); // | SWP_RESTORE
@@ -1094,7 +1117,7 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
if( nEvent )
CallCallback( nEvent, NULL );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
dumpWindowInfo( "<Os2SalFrame::SetPosSize (exit)", mhWndFrame);
#endif
@@ -1105,13 +1128,15 @@ void Os2SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
void Os2SalFrame::SetParent( SalFrame* pNewParent )
{
APIRET rc;
-#if OSL_DEBUG_LEVEL > 1
- debug_printf("Os2SalFrame::SetParent mhWndFrame 0x%08x to 0x%08x\n",
+#if OSL_DEBUG_LEVEL>0
+ debug_printf("Os2SalFrame::SetParent mhWndFrame 0x%08x to 0x%08x\n",
static_cast<Os2SalFrame*>(this)->mhWndFrame,
static_cast<Os2SalFrame*>(pNewParent)->mhWndClient);
#endif
Os2SalFrame::mbInReparent = TRUE;
- rc = WinSetOwner(static_cast<Os2SalFrame*>(this)->mhWndFrame,
+ //rc = WinSetParent(static_cast<Os2SalFrame*>(this)->mhWndFrame,
+ // static_cast<Os2SalFrame*>(pNewParent)->mhWndClient, TRUE);
+ rc = WinSetOwner(static_cast<Os2SalFrame*>(this)->mhWndFrame,
static_cast<Os2SalFrame*>(pNewParent)->mhWndClient);
mpParentFrame = static_cast<Os2SalFrame*>(pNewParent);
Os2SalFrame::mbInReparent = FALSE;
@@ -1126,7 +1151,7 @@ bool Os2SalFrame::SetPluginParent( SystemParentData* pNewParent )
}
Os2SalFrame::mbInReparent = TRUE;
- rc = WinSetOwner(static_cast<Os2SalFrame*>(this)->mhWndFrame,
+ rc = WinSetOwner(static_cast<Os2SalFrame*>(this)->mhWndFrame,
pNewParent->hWnd);
Os2SalFrame::mbInReparent = FALSE;
return true;
@@ -1166,13 +1191,13 @@ void Os2SalFrame::GetClientSize( long& rWidth, long& rHeight )
void Os2SalFrame::SetWindowState( const SalFrameState* pState )
{
- LONG nX;
- LONG nY;
- LONG nWidth;
- LONG nHeight;
- ULONG nPosSize = 0;
+ LONG nX;
+ LONG nY;
+ LONG nWidth;
+ LONG nHeight;
+ ULONG nPosSize = 0;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::SetWindowState\n");
debug_printf("Os2SalFrame::SetWindowState %08x (%dx%d) at %d,%d VCL\n",
mhWndFrame,
@@ -1182,7 +1207,7 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
BOOL bVisible = WinIsWindowVisible( mhWndFrame );
// get screen coordinates
- SWP aSWP;
+ SWP aSWP;
WinQueryWindowPos( mhWndFrame, &aSWP );
LONG nFrameX, nFrameY, nCaptionY;
ImplSalCalcFrameSize( this, nFrameX, nFrameY, nCaptionY );
@@ -1217,8 +1242,8 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
nHeight = (int)pState->mnHeight + nTopDeco + nBottomDeco;
else
nHeight = aSWP.cy;
-
-#if OSL_DEBUG_LEVEL > 1
+
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::SetWindowState (%dx%d) at %d,%d\n", nWidth,nHeight,nX,nY);
#endif
@@ -1226,6 +1251,9 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
// if it does not fit into the screen do nothing, ie default pos/size will be used
// if there is an overlap with the screen border move the window while keeping its size
+ //if( nWidth > nScreenWidth || nHeight > nScreenHeight )
+ // nPosSize |= (SWP_NOMOVE | SWP_NOSIZE);
+
if ( nX+nWidth > nScreenWidth )
nX = (nScreenWidth) - nWidth;
if ( nY+nHeight > nScreenHeight )
@@ -1268,6 +1296,8 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
{
if ( pState->mnState & SAL_FRAMESTATE_MINIMIZED )
{
+ //if ( pState->mnState & SAL_FRAMESTATE_MAXIMIZED )
+ // aPlacement.flags |= WPF_RESTORETOMAXIMIZED;
aPlacement.fl = SWP_SHOWMINIMIZED;
}
else if ( pState->mnState & SAL_FRAMESTATE_MAXIMIZED )
@@ -1280,8 +1310,8 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
// Wenn Fenster nicht minimiert/maximiert ist oder nicht optisch
// umgesetzt werden muss, dann SetWindowPos() benutzen, da
// SetWindowPlacement() die TaskBar mit einrechnet
- if ( !(aPlacement.fl & SWP_MINIMIZE)
- && !( aPlacement.fl & SWP_MAXIMIZE )
+ if ( !(aPlacement.fl & SWP_MINIMIZE)
+ && !( aPlacement.fl & SWP_MAXIMIZE )
&& (!bVisible || (aPlacement.fl == SWP_RESTORE)) )
{
if( bUpdateHiddenFramePos )
@@ -1291,7 +1321,7 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
SetMaximizedFrameGeometry( mhWndFrame, this );
}
else
- WinSetWindowPos( mhWndFrame, 0, nX,
+ WinSetWindowPos( mhWndFrame, 0, nX,
nScreenHeight - (nY+nHeight), nWidth, nHeight, nPosSize);
}
else
@@ -1303,11 +1333,11 @@ void Os2SalFrame::SetWindowState( const SalFrameState* pState )
aPlacement.cx = nWidth;
aPlacement.cy = nHeight;
}
- WinSetWindowPos( mhWndFrame, 0, aPlacement.x, aPlacement.y,
+ WinSetWindowPos( mhWndFrame, 0, aPlacement.x, aPlacement.y,
aPlacement.cx, aPlacement.cy, aPlacement.fl );
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalFrame::SetWindowState DONE\n");
#endif
}
@@ -1319,6 +1349,9 @@ BOOL Os2SalFrame::GetWindowState( SalFrameState* pState )
if ( maState.mnWidth && maState.mnHeight )
{
*pState = maState;
+ // #94144# allow Minimize again, should be masked out when read from configuration
+ // 91625 - Don't save minimize
+ //if ( !(pState->mnState & SAL_FRAMESTATE_MAXIMIZED) )
if ( !(pState->mnState & (SAL_FRAMESTATE_MINIMIZED | SAL_FRAMESTATE_MAXIMIZED)) )
pState->mnState |= SAL_FRAMESTATE_NORMAL;
return TRUE;
@@ -1379,6 +1412,7 @@ void Os2SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
void Os2SalFrame::StartPresentation( BOOL bStart )
{
+ // SysSetObjectData("<WP_DESKTOP>","Autolockup=no"); oder OS2.INI: PM_Lockup
}
// -----------------------------------------------------------------------
@@ -1394,7 +1428,7 @@ void Os2SalFrame::SetAlwaysOnTop( BOOL bOnTop )
static void ImplSalToTop( HWND hWnd, ULONG nFlags )
{
Os2SalFrame* pFrame = GetWindowPtr( hWnd );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf("ImplSalToTop hWnd %08x, nFlags %x\n", hWnd, nFlags);
#endif
@@ -1409,7 +1443,7 @@ static void ImplSalToTop( HWND hWnd, ULONG nFlags )
if ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
{
- ULONG nStyle;
+ ULONG nStyle;
if ( pFrame->mbRestoreMaximize )
nStyle = SWP_MAXIMIZE;
else
@@ -1424,7 +1458,7 @@ static void ImplSalToTop( HWND hWnd, ULONG nFlags )
void Os2SalFrame::ToTop( USHORT nFlags )
{
- nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
+ nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
// We post this message to avoid deadlocks
@@ -1440,7 +1474,7 @@ void Os2SalFrame::SetPointer( PointerStyle ePointerStyle )
{
struct ImplPtrData
{
- HPOINTER mhPointer;
+ HPOINTER mhPointer;
ULONG mnSysId;
ULONG mnOwnId;
};
@@ -1553,6 +1587,8 @@ void Os2SalFrame::SetPointer( PointerStyle ePointerStyle )
#error New Pointer must be defined!
#endif
+ //debug_printf("Os2SalFrame::SetPointer\n");
+
// Mousepointer loaded ?
if ( !aImplPtrTab[ePointerStyle].mhPointer )
{
@@ -1578,7 +1614,7 @@ void Os2SalFrame::SetPointer( PointerStyle ePointerStyle )
void Os2SalFrame::CaptureMouse( BOOL bCapture )
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
_bCapture=bCapture;
debug_printf("Os2SalFrame::CaptureMouse bCapture %d\n", bCapture);
#endif
@@ -1633,6 +1669,8 @@ void Os2SalFrame::SetInputContext( SalInputContext* pContext )
nInputMode &= ~IMI_IM_IME_DISABLE;
if ( pContext->mnOptions & SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF )
nInputMode &= ~IMI_IM_IME_ON;
+// !!! Da derzeit ueber das OS2-IME-UI der IME-Mode nicht einschaltbar ist !!!
+// if ( SAL_INPUTCONTEXT_EXTTEXTINPUT_ON )
nInputMode |= IMI_IM_IME_ON;
}
else
@@ -1782,7 +1820,7 @@ XubString Os2SalFrame::GetKeyName( USHORT nCode )
case KEY_DELETE:
aCode = pLangTab[LSTR_KEY_DELETE];
break;
-
+
case KEY_ADD:
aCode += '+';
break;
@@ -1953,7 +1991,7 @@ static BOOL ImplOS2NameFontToVCLFont( const char* pFontName, Font& rFont )
rFont.SetItalic( ITALIC_NONE );
// search for a style embedded in the name, e.g. 'WarpSans Bold'
// because we need to split the style from the family name
- if (strstr( pFontName, " Bold")
+ if (strstr( pFontName, " Bold")
|| strstr( pFontName, " Italic")
|| strstr( pFontName, "-Normal"))
{
@@ -1976,13 +2014,13 @@ static BOOL ImplOS2NameFontToVCLFont( const char* pFontName, Font& rFont )
// store family name
rFont.SetName( ::rtl::OStringToOUString ( fontName, gsl_getSystemTextEncoding()) );
free( fontName);
- }
+ }
else
{
rFont.SetName( ::rtl::OStringToOUString (pFontName, gsl_getSystemTextEncoding()) );
rFont.SetStyleName( ::rtl::OStringToOUString ("", gsl_getSystemTextEncoding()) );
}
-
+
rFont.SetSize( Size( 0, nFontHeight ) );
return TRUE;
}
@@ -2018,6 +2056,8 @@ 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;
@@ -2039,26 +2079,32 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// Size settings
aStyleSettings.SetScrollBarSize( WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL ) );
- aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
+ if ( bCompBorder )
+ {
+ aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
+ }
// Color settings
- 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 ) ) );
+ 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.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetRadioCheckTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetGroupTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWSTATICTEXT, 0 ) ) );
@@ -2075,8 +2121,11 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
Color aMenuHighColor = ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0 ) );
if ( ImplSalIsSameColor( aMenuHighColor, aStyleSettings.GetMenuColor() ) )
{
- aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
- aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
+ if ( bCompBorder )
+ {
+ aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
+ aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
+ }
}
else
{
@@ -2402,8 +2451,9 @@ static long ImplHandleMouseMsg( HWND hWnd,
// and sent a mouse leave message to the application which killed the help window, ie ourself
if( !WinIsWindow( pFrame->mhAB, hWnd ) )
return 0;
-
-#if OSL_DEBUG_LEVEL > 1
+
+#if OSL_DEBUG_LEVEL>10
+ //if (_bCapture)
debug_printf("ImplHandleMouseMsg mouse %d,%d\n",aMouseEvt.mnX,aMouseEvt.mnY);
#endif
@@ -2412,6 +2462,10 @@ static long ImplHandleMouseMsg( HWND hWnd,
if ( nEvent == SALEVENT_MOUSEBUTTONDOWN )
WinUpdateWindow( pFrame->mhWndClient );
+ // --- RTL --- (mirror mouse pos)
+ //if( Application::GetSettings().GetLayoutRTL() )
+ // aMouseEvt.mnX = pFrame->maGeometry.nWidth-1-aMouseEvt.mnX;
+
nRet = pFrame->CallCallback( nEvent, &aMouseEvt );
if ( nMsg == WM_MOUSEMOVE )
{
@@ -2444,13 +2498,13 @@ static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, MPARAM nMP1, MPARAM nMP2 )
aPt.y = pFrame->mnHeight - aPt.y - 1;
SalWheelMouseEvent aWheelEvt;
- aWheelEvt.mnTime = WinQueryMsgTime( pFrame->mhAB );
- aWheelEvt.mnX = aPt.x;
- aWheelEvt.mnY = aPt.y;
- aWheelEvt.mnCode = 0;
+ aWheelEvt.mnTime = WinQueryMsgTime( pFrame->mhAB );
+ aWheelEvt.mnX = aPt.x;
+ aWheelEvt.mnY = aPt.y;
+ aWheelEvt.mnCode = 0;
bool bNeg = (SHORT2FROMMP(nMP2) == SB_LINEDOWN || SHORT2FROMMP(nMP2) == SB_PAGEDOWN );
- aWheelEvt.mnDelta = bNeg ? -120 : 120;
- aWheelEvt.mnNotchDelta = bNeg ? -1 : 1;
+ aWheelEvt.mnDelta = bNeg ? -120 : 120;
+ aWheelEvt.mnNotchDelta = bNeg ? -1 : 1;
if (SHORT2FROMMP(nMP2) == SB_PAGEUP || SHORT2FROMMP(nMP2) == SB_PAGEDOWN)
aWheelEvt.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
else
@@ -2484,7 +2538,7 @@ static USHORT ImplSalGetKeyCode( Os2SalFrame* pFrame, MPARAM aMP1, MPARAM aMP2 )
UCHAR nCharCode = (UCHAR)SHORT1FROMMP( aMP2 );
USHORT nKeyCode = (UCHAR)SHORT2FROMMP( aMP2 );
UCHAR nScanCode = (UCHAR)CHAR4FROMMP( aMP1 );
- USHORT rSVCode = 0;
+ USHORT rSVCode = 0;
// Ist virtueller KeyCode gesetzt und befindet sich der KeyCode in der
// Tabelle, dann mappen
@@ -2544,7 +2598,7 @@ static USHORT ImplSalGetKeyCode( Os2SalFrame* pFrame, MPARAM aMP1, MPARAM aMP2 )
rSVCode = KEY_COMMA;
if ( nCharCode == '.' )
rSVCode = KEY_POINT;
-
+
return rSVCode;
}
@@ -2552,15 +2606,15 @@ static USHORT ImplSalGetKeyCode( Os2SalFrame* pFrame, MPARAM aMP1, MPARAM aMP2 )
static void ImplUpdateInputLang( Os2SalFrame* pFrame )
{
- BOOL bLanguageChange = FALSE;
- ULONG nLang = 0;
- APIRET rc;
+ BOOL bLanguageChange = FALSE;
+ ULONG nLang = 0;
+ APIRET rc;
UconvObject uconv_object = NULL;
LocaleObject locale_object = NULL;
- UniChar *pinfo_item;
+ UniChar *pinfo_item;
- // we do not support change of input language while working,
- // so exit if already defined (mnInputLang is a static class field)
+ // we do not support change of input language while working,
+ // so exit if already defined (mnInputLang is a static class field)
if (pFrame->mnInputLang)
return;
@@ -2571,7 +2625,7 @@ static void ImplUpdateInputLang( Os2SalFrame* pFrame )
// convert uni string to integer
rc = UniStrtoul(locale_object, pinfo_item, &pinfo_item, 16, &nLang);
rc = UniFreeMem(pinfo_item);
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf("ImplUpdateInputLang nLang %04x\n", nLang);
char char_buffer[256];
rc = UniCreateUconvObject((UniChar *)L"", &uconv_object);
@@ -2583,19 +2637,19 @@ static void ImplUpdateInputLang( Os2SalFrame* pFrame )
rc = UniFreeLocaleObject(locale_object);
// keep input lang up-to-date
-#if OSL_DEBUG_LEVEL > 1
- debug_printf("ImplUpdateInputLang pFrame %08x lang changed from %d to %d\n",
+#if OSL_DEBUG_LEVEL>10
+ debug_printf("ImplUpdateInputLang pFrame %08x lang changed from %d to %d\n",
pFrame, pFrame->mnInputLang, nLang);
#endif
pFrame->mnInputLang = nLang;
}
-static sal_Unicode ImplGetCharCode( Os2SalFrame* pFrame, USHORT nKeyFlags,
+static sal_Unicode ImplGetCharCode( Os2SalFrame* pFrame, USHORT nKeyFlags,
sal_Char nCharCode, UCHAR nScanCode )
{
ImplUpdateInputLang( pFrame );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf("ImplGetCharCode nCharCode %c, %04x\n", nCharCode, nCharCode);
#endif
return OUString( &nCharCode, 1, gsl_getSystemTextEncoding()).toChar();
@@ -2630,7 +2684,7 @@ static sal_Unicode ImplConvertKey( Os2SalFrame* pFrame, MPARAM aMP1, MPARAM aMP2
UCHAR nCharCode = (UCHAR)SHORT1FROMMP( aMP2 );
USHORT nKeyCode = (UCHAR)SHORT2FROMMP( aMP2 );
UCHAR nScanCode = (UCHAR)CHAR4FROMMP( aMP1 );
- sal_Unicode rSVCharCode = 0;
+ sal_Unicode rSVCharCode = 0;
// Ist Character-Code gesetzt
// !!! Bei CTRL/ALT ist KC_CHAR nicht gesetzt, jedoch moechten wir
@@ -2655,7 +2709,7 @@ static long ImplHandleKeyMsg( HWND hWnd,
USHORT nModCode = 0;
USHORT nSVCode = 0;
USHORT nOS2KeyCode = (UCHAR)SHORT2FROMMP( nMP2 );
- sal_Unicode nSVCharCode = 0;
+ sal_Unicode nSVCharCode = 0;
long nRet = 0;
Os2SalFrame* pFrame = GetWindowPtr( hWnd );
@@ -2677,7 +2731,7 @@ static long ImplHandleKeyMsg( HWND hWnd,
SalKeyModEvent aModEvt;
aModEvt.mnTime = WinQueryMsgTime( pFrame->mhAB );
aModEvt.mnCode = nModCode;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf("SALEVENT_KEYMODCHANGE\n");
#endif
nRet = pFrame->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
@@ -2686,7 +2740,7 @@ static long ImplHandleKeyMsg( HWND hWnd,
{
nSVCode = ImplSalGetKeyCode( pFrame, nMP1, nMP2 );
nSVCharCode = ImplConvertKey( pFrame, nMP1, nMP2 );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf("nSVCode %04x nSVCharCode %04x\n",nSVCode,nSVCharCode );
#endif
@@ -2723,7 +2777,7 @@ static long ImplHandleKeyMsg( HWND hWnd,
aKeyEvt.mnCharCode = nSVCharCode;
aKeyEvt.mnRepeat = nRepeat;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
debug_printf( (nFlags & KC_KEYUP) ? "SALEVENT_KEYUP\n" : "SALEVENT_KEYINPUT\n");
#endif
nRet = pFrame->CallCallback( (nFlags & KC_KEYUP) ? SALEVENT_KEYUP : SALEVENT_KEYINPUT,
@@ -2828,17 +2882,17 @@ static void UpdateFrameGeometry( HWND hWnd, Os2SalFrame* pFrame )
if( !pFrame )
return;
- //SalFrame has a
- //maGeometry member that holds absolute screen positions (and needs to be
+ //SalFrame has a
+ //maGeometry member that holds absolute screen positions (and needs to be
//updated if the window is moved by the way).
-
+
// reset data
memset(&pFrame->maGeometry, 0, sizeof(SalFrameGeometry) );
- SWP swp;
+ SWP swp;
LONG nFrameX, nFrameY, nCaptionY;
-
- // get frame size
+
+ // get frame size
WinQueryWindowPos(pFrame->mhWndFrame, &swp);
if (swp.fl & SWP_MINIMIZE)
return;
@@ -2860,7 +2914,7 @@ static void UpdateFrameGeometry( HWND hWnd, Os2SalFrame* pFrame )
// clamp to zero
pFrame->maGeometry.nHeight = nHeight < 0 ? 0 : nHeight;
pFrame->maGeometry.nWidth = nWidth < 0 ? 0 : nWidth;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf( "UpdateFrameGeometry: hwnd %x, frame %x at %d,%d (%dx%d)\n",
hWnd, pFrame->mhWndFrame,
pFrame->maGeometry.nX, pFrame->maGeometry.nY,
@@ -2891,16 +2945,16 @@ static void ImplHandleMoveMsg( HWND hWnd)
ImplSalFrameFullScreenPos( pFrame );
pFrame->mbInMoveMsg = FALSE;
}
-
+
// Status merken
ImplSaveFrameState( pFrame );
-
+
// Call Hdl
//#93851 if we call this handler, VCL floating windows are not updated correctly
//ImplCallMoveHdl( hWnd );
}
-
+
ImplSalYieldMutexRelease();
}
else
@@ -2984,6 +3038,7 @@ static int SalImplHandleProcessMenu( Os2SalFrame* pFrame, ULONG nMsg, MPARAM nMP
{
long nRet = 0;
debug_printf("SalImplHandleProcessMenu\n");
+ //return (nRet != 0);
return (nRet == 0);
}
@@ -3033,6 +3088,28 @@ static long ImplHandleIMEStartConversion( Os2SalFrame* pFrame )
}
if ( pFrame->mbHandleIME )
{
+/* Windows-Code, der noch nicht angepasst wurde !!!
+ // Cursor-Position ermitteln und aus der die Default-Position fuer
+ // das Composition-Fenster berechnen
+ SalCursorPosEvent aCursorPosEvt;
+ pFrame->CallCallback( pFrame->mpInst, pFrame,
+ SALEVENT_CURSORPOS, (void*)&aCursorPosEvt );
+ COMPOSITIONFORM aForm;
+ memset( &aForm, 0, sizeof( aForm ) );
+ if ( !aCursorPosEvt.mnWidth || !aCursorPosEvt.mnHeight )
+ aForm.dwStyle |= CFS_DEFAULT;
+ else
+ {
+ aForm.dwStyle |= CFS_POINT;
+ aForm.ptCurrentPos.x = aCursorPosEvt.mnX;
+ aForm.ptCurrentPos.y = aCursorPosEvt.mnY;
+ }
+ ImmSetCompositionWindow( hIMC, &aForm );
+
+ // Den InputContect-Font ermitteln und diesem dem Composition-Fenster
+ // bekannt machen
+*/
+
pFrame->mbConversionMode = TRUE;
pFrame->CallCallback( SALEVENT_STARTEXTTEXTINPUT, (void*)NULL );
nRet = TRUE;
@@ -3105,6 +3182,24 @@ static long ImplHandleIMEConversion( Os2SalFrame* pFrame, MPARAM nMP2Param )
pIMEData->mpGetConversionString( hIMI, IMR_CONV_CONVERSIONATTR, pAttrBuf, &nAttrBufLen );
}
+/* !!! Wir bekommen derzeit nur falsche Daten, deshalb zeigen wir derzeit
+ !!! auch keine Cursor an
+ ULONG nTempBufLen;
+ ULONG nCursorPos = 0;
+ ULONG nCursorAttr = 0;
+ ULONG nChangePos = 0;
+ nTempBufLen = sizeof( ULONG );
+ pIMEData->mpGetConversionString( hIMI, IMR_CONV_CURSORPOS, &nCursorPos, &nTempBufLen );
+ nTempBufLen = sizeof( ULONG );
+ pIMEData->mpGetConversionString( hIMI, IMR_CONV_CURSORATTR, &nCursorAttr, &nTempBufLen );
+ nTempBufLen = sizeof( ULONG );
+ pIMEData->mpGetConversionString( hIMI, IMR_CONV_CHANGESTART, &nChangePos, &nTempBufLen );
+
+ aEvt.mnCursorPos = nCursorPos;
+ aEvt.mnDeltaStart = nChangePos;
+ if ( nCursorAttr & CP_CURSORATTR_INVISIBLE )
+ aEvt.mbCursorVisible = FALSE;
+*/
aEvt.mnCursorPos = 0;
aEvt.mnDeltaStart = 0;
aEvt.mbCursorVisible = FALSE;
@@ -3196,6 +3291,11 @@ static void ImplHandleIMEOpenCandidate( Os2SalFrame* pFrame )
pIMEData->mpGetConversionString( hIMI, IMR_CONV_CONVERSIONSTRING, 0, &nBufLen );
if ( nBufLen > 0 )
{
+/* !!! Wir bekommen derzeit nur falsche Daten steht der Cursor immer bei 0
+ ULONG nTempBufLen = sizeof( ULONG );
+ ULONG nCursorPos = 0;
+ pIMEData->mpGetConversionString( hIMI, IMR_CONV_CURSORPOS, &nCursorPos, &nTempBufLen );
+*/
ULONG nCursorPos = 0;
SalExtTextInputPosEvent aEvt;
@@ -3264,12 +3364,12 @@ inline void ImplHandleIMECloseCandidate( Os2SalFrame* pFrame )
MRESULT EXPENTRY SalFrameWndProc( HWND hWnd, ULONG nMsg,
MPARAM nMP1, MPARAM nMP2 )
{
- Os2SalFrame* pFrame = (Os2SalFrame*)GetWindowPtr( hWnd );
- MRESULT nRet = (MRESULT)0;
- BOOL bDef = TRUE;
- bool bCheckTimers= false;
+ Os2SalFrame* pFrame = (Os2SalFrame*)GetWindowPtr( hWnd );
+ MRESULT nRet = (MRESULT)0;
+ BOOL bDef = TRUE;
+ bool bCheckTimers= false;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>10
if (nMsg!=WM_TIMER && nMsg!=WM_MOUSEMOVE)
debug_printf( "SalFrameWndProc hWnd 0x%x nMsg 0x%x\n", hWnd, nMsg);
#endif
diff --git a/vcl/os2/source/window/salmenu.cxx b/vcl/os2/source/window/salmenu.cxx
new file mode 100644
index 000000000000..92834fadfb9d
--- /dev/null
+++ b/vcl/os2/source/window/salmenu.cxx
@@ -0,0 +1,134 @@
+/* -*- 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 5c1e9ed03358..3b7c9b0b3266 100644
--- a/vcl/os2/source/window/salobj.cxx
+++ b/vcl/os2/source/window/salobj.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,8 +56,8 @@ static BOOL ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
static Os2SalObject* ImplFindOs2SalObject( HWND hWndChild )
{
- SalData* pSalData = GetSalData();
- Os2SalObject* pObject = pSalData->mpFirstObject;
+ SalData* pSalData = GetSalData();
+ Os2SalObject* pObject = pSalData->mpFirstObject;
while ( pObject )
{
if ( ImplIsSysWindowOrChild( pObject->mhWndChild, hWndChild ) )
@@ -77,8 +77,8 @@ BOOL EXPENTRY SalSysMsgProc( HAB /* hAB */, QMSG* pMsg, ULONG /* fs */ )
(pMsg->msg == WM_BUTTON2DOWN) ||
(pMsg->msg == WM_BUTTON3DOWN) )
{
- SalData* pSalData = GetSalData();
- Os2SalObject* pObject = ImplFindOs2SalObject( pMsg->hwnd );
+ SalData* pSalData = GetSalData();
+ Os2SalObject* pObject = ImplFindOs2SalObject( pMsg->hwnd );
if ( pObject )
WinPostMsg( pObject->mhWnd, SALOBJ_MSG_TOTOP, 0, 0 );
}
@@ -95,11 +95,11 @@ BOOL EXPENTRY SalSysMsgProc( HAB /* hAB */, QMSG* pMsg, ULONG /* fs */ )
MRESULT EXPENTRY SalSysObjWndProc( HWND hWnd, ULONG nMsg,
MPARAM nMP1, MPARAM nMP2 )
{
- Os2SalObject* pSysObj;
- MRESULT nRet = 0;
- int bDef = TRUE;
+ Os2SalObject* pSysObj;
+ MRESULT nRet = 0;
+ int bDef = TRUE;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL>0
debug_printf( "SalSysObjWndProc hWnd 0x%x nMsg %d\n", hWnd, nMsg);
#endif
@@ -111,8 +111,8 @@ MRESULT EXPENTRY SalSysObjWndProc( HWND hWnd, ULONG nMsg,
break;
case WM_PAINT:
{
- HPS hPS;
- RECTL aRect;
+ HPS hPS;
+ RECTL aRect;
hPS = WinBeginPaint( hWnd, NULLHANDLE, &aRect );
WinEndPaint( hPS );
bDef = FALSE;
@@ -194,19 +194,24 @@ MRESULT EXPENTRY SalSysObjWndProc( HWND hWnd, ULONG nMsg,
MRESULT EXPENTRY SalSysObjChildWndProc( HWND hWnd, ULONG nMsg,
MPARAM nMP1, MPARAM nMP2 )
{
- MRESULT nRet = 0;
- int bDef = TRUE;
+ MRESULT nRet = 0;
+ int bDef = TRUE;
debug_printf( "SalSysObjChildWndProc hWnd 0x%x nMsg %d\n", hWnd, nMsg);
switch( nMsg )
{
case WM_ERASEBACKGROUND:
+ // Wegen PlugIn's loeschen wir erstmal den Hintergrund
+/*
+ nRet = (MRESULT)FALSE;
+ bDef = FALSE;
+*/
break;
case WM_PAINT:
{
- HPS hPS;
- RECTL aRect;
+ HPS hPS;
+ RECTL aRect;
hPS = WinBeginPaint( hWnd, NULLHANDLE, &aRect );
WinEndPaint( hPS );
bDef = FALSE;
@@ -224,8 +229,8 @@ MRESULT EXPENTRY SalSysObjChildWndProc( HWND hWnd, ULONG nMsg,
MRESULT EXPENTRY SalSysObjClipWndProc( HWND hWnd, ULONG nMsg,
MPARAM nMP1, MPARAM nMP2 )
{
- MRESULT nRet = 0;
- int bDef = TRUE;
+ MRESULT nRet = 0;
+ int bDef = TRUE;
debug_printf( "SalSysObjClipWndProc hWnd 0x%x nMsg %d\n", hWnd, nMsg);
@@ -278,8 +283,8 @@ MRESULT EXPENTRY SalSysObjClipWndProc( HWND hWnd, ULONG nMsg,
break;
case WM_PAINT:
{
- HPS hPS;
- RECTL aRect;
+ HPS hPS;
+ RECTL aRect;
hPS = WinBeginPaint( hWnd, NULLHANDLE, &aRect );
WinEndPaint( hPS );
bDef = FALSE;
@@ -379,15 +384,15 @@ Os2SalObject::Os2SalObject()
{
SalData* pSalData = GetSalData();
- mhLastClipWnd = HWND_TOP;
+ mhLastClipWnd = HWND_TOP;
- mhWnd = 0;
- mhWndChild = 0;
- mhLastFocusWnd = 0;
- maSysData.nSize = sizeof( SystemEnvData );
- mnHeight = 0;
- mpInst = NULL;
- mpProc = ImplSalObjCallbackDummy;
+ mhWnd = 0;
+ mhWndChild = 0;
+ mhLastFocusWnd = 0;
+ maSysData.nSize = sizeof( SystemEnvData );
+ mnHeight = 0;
+ mpInst = NULL;
+ mpProc = ImplSalObjCallbackDummy;
// Hook installieren, wenn es das erste Os2SalObject ist
if ( !pSalData->mpFirstObject )
@@ -551,9 +556,3 @@ 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 ea3c074103ab..e6f636522acb 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : TRANSLATIONS:translations 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 : 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 SO:print_header cpputools shell svl 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,10 +48,3 @@ 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 00b703cf43b9..b0e1aa2cd807 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -12,19 +12,17 @@ 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
@@ -43,10 +41,10 @@ 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
-..\inc\vcl\fontcapabilities.hxx %_DEST%\inc%_EXT%\vcl\fontcapabilities.hxx
..\inc\vcl\fontcvt.hxx %_DEST%\inc%_EXT%\vcl\fontcvt.hxx
..\inc\vcl\gdimtf.hxx %_DEST%\inc%_EXT%\vcl\gdimtf.hxx
..\inc\vcl\gfxlink.hxx %_DEST%\inc%_EXT%\vcl\gfxlink.hxx
@@ -59,7 +57,6 @@ 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
@@ -72,6 +69,7 @@ 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
@@ -79,7 +77,6 @@ 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
@@ -131,6 +128,7 @@ 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
@@ -146,6 +144,7 @@ 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,7 +154,3 @@ 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 a089a1c99f54..0e61cf22c3e7 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -32,35 +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 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.*;
+import util.WriterTools;
+import util.utils;
/**
- * Documents are opened and exported with StarOffice. The memory usage of
+ * Documents are opened and exported with StarOffice. The memory usage of
* StarOffice is monitored and if the usage exceeds the allowed kilobytes,
- * the test is failed. Used for monitoring the StarOffice process is the
+ * the test is failed. Used for monitoring the StarOffice process is the
* command line tool 'pmap', available on Solaris or Linux. This test will not
- * run on Windows.<br>Test procedure: every given document type is searched in
- * the source directory
+ * run on Windows.<br>Test procedure: every given document type is searched in
+ * the source directory
* Needed paramters:
* <ul>
* <li>"TestDocumentPath" - the path where test documents are located.</li>
@@ -74,141 +66,95 @@ import static org.junit.Assert.*;
* All parameters are used for iteration over the test document path.
* </ul>
*/
-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 */
-
-{
-
+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 sProcessIdCommand = null;
- TempDir m_aTempDir;
- // private String sFS = null;
- // private String sMemoryMap1 = null;
- // private String sMemoryMap2 = null;
- // private String sDocumentPath = "";
+ 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[][] 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.
*/
- @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
-
+ public void before() {
// test does definitely not run on Windows.
- 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);
+ 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.");
}
-
-
+
// 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");
- m_aTempDir = new TempDir(util.utils.getOfficeTemp/*Dir*/(xMsf));
+ sTempDir = System.getProperty("java.io.tmpdir");
+ sProcessIdCommand = sTempDir + "getPS";
+ sOfficeMemoryCommand = sTempDir + "getPmap";
// get the file extension, export filter connection
Enumeration keys = param.keys();
- Vector<String> v = new Vector<String>();
- while (keys.hasMoreElements())
- {
- String key = (String) keys.nextElement();
- if (key.startsWith("FileExportFilter"))
- {
- v.add((String) param.get(key));
+ Vector v = new Vector();
+ while(keys.hasMoreElements()) {
+ String key = (String)keys.nextElement();
+ if (key.startsWith("FileExportFilter")) {
+ v.add(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
+ // 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
- 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;
+ StringTokenizer t = new StringTokenizer((String)v.get(i), ",");
+ sDocTypeExportFilter[i][0] = t.nextToken();
+ sDocTypeExportFilter[i][1] = t.nextToken();
}
// get files to load and export
-// 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");
+ sDocumentPath = (String)param.get("TestDocumentPath");
+ File f = new File(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++)
- {
- // final String sDocument = FileHelper.appendPath(sDocumentPath, doc[i]);
- // sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
- sDocuments[j][i] = TestDocument.getUrl(doc[i]);
+ 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]);
}
}
}
@@ -216,323 +162,141 @@ public class CheckMemoryUsage /* extends ComplexTestCase */
/**
* delete all created files on disk
*/
- @After
- public void after()
- {
+ public void after() {
// delete the constructed files.
-// 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();
+ 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();
}
-
+
/**
- * The test function: load documents and save them using the given filters
+ * Thet etst function: load documents and save them using the given filters
* for each given document type.
*/
- @Test
- public void loadAndSaveDocuments()
- {
- int nOk = 0;
- int nRunThrough = 0;
-
- // 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
+ public void loadAndSaveDocuments() {
+ int storageBefore = getOfficeMemoryUsage();
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF();
// 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++)
- {
-
- 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();
- }
-
- 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++;
+ 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.");
+ }
}
- 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);
+ // 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);
+
}
-
+
/**
- * Checks how much memory should consum
- * @param storageBefore
- * @return 1 if consum is ok, else 0
+ * Get the process ID from the Office
+ * @return the Id as String
*/
- 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;
+ 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;
}
-
+
/**
- * load and save exact one document
+ * Get the memory usage of the Office in KByte.
+ * @return The memory used by the Office.
*/
- 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.");
- }
-
+ 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);
+ }
+ 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();
}
-
-// -----------------------------------------------------------------------------
- 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();
+
+ /**
+ * 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);
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();
- }
-
- /**
- * 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)
- {
- }
+ catch(java.io.IOException e) {
}
}
@@ -540,36 +304,27 @@ public class CheckMemoryUsage /* extends ComplexTestCase */
* Let this thread sleep for some time
* @param milliSeconds time to wait in milliseconds.
*/
- public static void shortWait(int milliSeconds)
- {
- System.out.println("Wait for: " + milliSeconds + "ms");
- try
- {
+ private void shortWait(int milliSeconds) {
+ try {
Thread.sleep(milliSeconds);
}
- catch (java.lang.InterruptedException e)
- { // ignore
- }
+ catch(java.lang.InterruptedException e) { // ignore
+ }
}
-
+
/**
* 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.
@@ -577,32 +332,9 @@ 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
deleted file mode 100644
index 21ce46185b4a..000000000000
--- a/vcl/qa/complex/memCheck/FileHelper.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-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
deleted file mode 100644
index 8ca9f7b71192..000000000000
--- a/vcl/qa/complex/memCheck/TestDocument.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-************************************************************************/
-
-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 4a809e71e50e..d1d4b5c08c98 100755
--- a/vcl/qa/complex/memCheck/makefile.mk
+++ b/vcl/qa/complex/memCheck/makefile.mk
@@ -25,107 +25,65 @@
#
#*************************************************************************
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
+PRJ = ..$/..$/..
+TARGET = MemoryCheck
+PRJNAME = $(TARGET)
+PACKAGE = complex$/memCheck
-PRJ = ../../..
-PRJNAME = vcl
-TARGET = qa_complex_memCheck
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/memCheck
-# here store only Files which contain a @Test
-JAVATESTFILES = \
- CheckMemoryUsage.java
+#----- compile .java files -----------------------------------------
-# put here all other files
-JAVAFILES = $(JAVATESTFILES) \
- FileHelper.java \
- TestDocument.java
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = CheckMemoryUsage.java
+#----- make a jar from compiled files ------------------------------
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
+MAXLINELENGTH = 100000
-# Sample how to debug
-# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
-.END
+# --- Parameters for the test --------------------------------------
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
+# 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
-ALLTAR : javatest
+# test base is java complex
+CT_TESTBASE = -TestBase java_complex
-.END
+# replace $/ with . in package name
+CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+# start the runner application
+CT_APP = org.openoffice.Runner
+# --- Targets ------------------------------------------------------
-#
-#
-#
-# 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
+.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/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
index ea28c41f65f7..c7c3b6a045b0 100644
--- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java
+++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -34,9 +34,13 @@ 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;
/**
@@ -55,7 +59,7 @@ public class DocumentHandle {
/**
* Constructor
- * @param xCompLoader A loader to load a document
+ * @param xComponentLoader A loader to load a document
*/
public DocumentHandle(XComponentLoader xCompLoader) {
this.xCompLoader = xCompLoader;
@@ -67,7 +71,6 @@ 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{
@@ -88,13 +91,13 @@ public class DocumentHandle {
}
// get the current active window
- XFrame xCurFrame = UnoRuntime.queryInterface(XFrame.class, xCompLoader);
+ XFrame xCurFrame = (XFrame)UnoRuntime.queryInterface(XFrame.class, xCompLoader);
// create a new frame
XFrame xFrame = xCurFrame.findFrame("_blank", FrameSearchFlag.CREATE);
// load document in this frame
- XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
+ XComponentLoader xFrameLoader = (XComponentLoader)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 898324504b4e..1e5d3a8e7a2c 100644
--- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
+++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -26,27 +26,31 @@
************************************************************************/
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 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.*;
+import complexlib.ComplexTestCase;
+import helper.OfficeProvider;
+import complex.persistent_window_states.DocumentHandle;
/**
* Parameters:
@@ -54,11 +58,10 @@ import static org.junit.Assert.*;
* <li>NoOffice=yes - StarOffice is not started initially.</li>
* </ul>
*/
-public class PersistentWindowTest
-{
+public class PersistentWindowTest extends ComplexTestCase {
- // private XMultiServiceFactory xMSF;
-// private OfficeProvider oProvider;
+ private XMultiServiceFactory xMSF;
+ private OfficeProvider oProvider;
private int iOfficeCloseTime = 0;
/**
@@ -66,18 +69,9 @@ public class PersistentWindowTest
* Right now, it's only 'checkPersistentWindowState'.
* @return All test methods.
*/
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "checkPersistentWindowState"
-// };
-// }
-
- /**
- * The test parameters
- */
- // private static TestParameters param = null;
+ public String[] getTestMethodNames() {
+ return new String[]{"checkPersistentWindowState"};
+ }
/**
* Test if all available document types change the
@@ -100,32 +94,42 @@ public class PersistentWindowTest
* - close office
* - Test finished
*/
- @Test public void checkPersistentWindowState()
+ public void checkPersistentWindowState()
{
- // 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
+ 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;
+ }
- try
- {
+ if (!connect()) return;
- // At first we are already connected
- // if (!connect())
- // {
- // return;
- // }
+ // 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;
+ }
- // fetch the multi service factory for setup
- // XMultiServiceFactory xCP = getMSF();
+ // fetch the multi service factory for setup
+ XMultiServiceFactory xCP = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
- // create the configuration reader
- // ConfigurationRead cfgRead = new ConfigurationRead(xCP);
+ // 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",
@@ -134,98 +138,92 @@ public class PersistentWindowTest
"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");
-
- 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;
- }
+ // 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;
+ }
- // start an office
- connect();
+ // start an office
+ if (!connect()) return;
- // 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];
+ // get configuration
+ String[] settings = getConfigurationAndLoader(xMSF, els[i]);
+ if (settings == null) {
+ log.println("Skipping document type " + els[i]);
+ disconnect();
+ continue;
+ }
+ String cfg = settings[1];
- // load a document
- DocumentHandle handle = loadDocument(getMSF(), settings[0]);
+ // load a document
+ DocumentHandle handle = loadDocument(xMSF, 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
- disconnect();
+ // disposeManager and start a new office
+ if (!disconnect()) return;
- connect();
+ if (!connect()) return;
- // get configuration
- settings = getConfigurationAndLoader(getMSF(), els[i]);
+ // get configuration
+ settings = getConfigurationAndLoader(xMSF, els[i]);
- String newCfg = settings[1];
+ String newCfg = settings[1];
- // load a document
- handle = loadDocument(getMSF(), settings[0]);
+ // load a document
+ handle = loadDocument(xMSF, settings[0]);
- Rectangle newRect = handle.getDocumentPosSize();
+ Rectangle newRect = handle.getDocumentPosSize();
- // print the settings and window sizes
- System.out.println("----------------------------");
- System.out.println("Initial Config String : " + cfg);
- System.out.println("Config String after restart: " + newCfg);
+ // print the settings and window sizes
+ log.println("----------------------------");
+ log.println("Initial Config String : " + cfg);
+ log.println("Config String after restart: " + newCfg);
- 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);
+ 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);
- // 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("----------------------------");
+ // 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("----------------------------");
- // disposeManager
- disconnect();
+ // disposeManager
+ if (!disconnect()) return;
- System.out.println("\tFinish test for document type " + i + ": " + els[i]);
+ log.println("\tFinish test for document type " + i + ": " + els[i]);
- }
}
- catch (Exception e)
- {
+ }
+ catch(Exception e) {
e.printStackTrace();
}
}
@@ -237,17 +235,16 @@ public class PersistentWindowTest
* @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 = UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ XMultiServiceFactory xCP = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
// create the configuration reader
ConfigurationRead cfgRead = new ConfigurationRead(xCP);
@@ -256,28 +253,22 @@ public class PersistentWindowTest
String loader = getStringFromObject(
cfgRead.getByHierarchicalName(cfgString + "/ooSetupFactoryEmptyDocumentURL"));
- if (loader == null)
- {
- return null;
- }
- System.out.println("\tLoader: " + loader);
+ if (loader == null) return null;
+ log.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;
}
@@ -288,105 +279,97 @@ public class PersistentWindowTest
* @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 = UnoRuntime.queryInterface(XComponentLoader.class, xMSF.createInstance("com.sun.star.frame.Desktop"));
- XFramesSupplier xFrameSupp = UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
+ XComponentLoader xCompLoader = (XComponentLoader)
+ UnoRuntime.queryInterface(
+ XComponentLoader.class, xMSF.createInstance(
+ "com.sun.star.frame.Desktop"));
+ XFramesSupplier xFrameSupp = (XFramesSupplier)UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
// close all existing frames
XFrames xFrames = xFrameSupp.getFrames();
- 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)
- {
+ 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 ) {
xClose.close(false);
}
- else
- {
- fail("Could not query frame for XCloseable!");
+ else {
+ failed("Could not query frame for XCloseable!");
}
}
- catch (com.sun.star.uno.Exception e)
- {
- e.printStackTrace();
- 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!");
}
}
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
- {
- connection.setUp();
- }
- catch (java.lang.InterruptedException e)
- {
- fail("can't connect.");
+ private boolean connect() {
+ try {
+ xMSF = (XMultiServiceFactory)oProvider.getManager(param);
+ try {
+ Thread.sleep(10000);
+ }
+ catch(java.lang.InterruptedException e) {}
}
- catch (Exception 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;
}
return true;
}
- private boolean disconnect()
- {
- try
- {
- connection.tearDown();
- }
- catch (java.lang.InterruptedException e)
- {
- fail("can't disconnect.");
+ 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) {}
}
- catch (Exception e)
- {
- fail("can't disconnect.");
+ catch (java.lang.Exception e) {
+ e.printStackTrace();
+ failed("Cannot dispose the Office.");
+ return false;
}
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)
- {
- System.out.println("Got a void css.uno.Any as loading string.");
+ if (value == null) {
+ log.println("Got a void css.uno.Any as loading string.");
}
}
- catch (Exception e)
- {
- System.out.println("This document type cannot be opened directly.");
+ catch(Exception e) {
+ log.println("This document type cannot be opened directly.");
}
}
return value;
@@ -399,37 +382,12 @@ public class PersistentWindowTest
* @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 e4d9f6b514a0..4c61d8969b8d 100644
--- a/vcl/qa/complex/persistent_window_states/makefile.mk
+++ b/vcl/qa/complex/persistent_window_states/makefile.mk
@@ -24,44 +24,58 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-PRJ = ../../..
-PRJNAME = vcl
-TARGET = qa_complex_persistent_window_states
+PRJ = ..$/..$/..
+TARGET = PersistentWindowTest
+PRJNAME = $(TARGET)
+PACKAGE = complex$/persistent_window_states
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/persistent_window_states
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
-# here store only Files which contain a @Test
-JAVATESTFILES = \
- PersistentWindowTest.java
+#----- compile .java files -----------------------------------------
-# put here all other files
-JAVAFILES = $(JAVATESTFILES) \
-DocumentHandle.java
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = PersistentWindowTest.java DocumentHandle.java
+#----- make a jar from compiled files ------------------------------
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
+MAXLINELENGTH = 100000
-# Sample how to debug
-# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
-.END
+# --- Parameters for the test --------------------------------------
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
+# test base is java complex
+CT_TESTBASE = -TestBase java_complex
-ALLTAR : javatest
+# test looks something like the.full.package.TestName
+CT_TEST = -o $(PACKAGE:s\$/\.\).$(TARGET)
-.END
+# start the runner application
+CT_APP = org.openoffice.Runner
+# --- Targets ------------------------------------------------------
+$(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/qa/complex/memCheck/testdocuments/CalcDoc.sxc b/vcl/qa/testdocuments/CalcDoc.sxc
index 4b2b572085dc..4b2b572085dc 100644..100755
--- a/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
+++ b/vcl/qa/testdocuments/CalcDoc.sxc
Binary files differ
diff --git a/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi b/vcl/qa/testdocuments/ImpressDoc.sxi
index efcdf9b6a25e..efcdf9b6a25e 100644..100755
--- a/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
+++ b/vcl/qa/testdocuments/ImpressDoc.sxi
Binary files differ
diff --git a/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw b/vcl/qa/testdocuments/WriterDoc.sxw
index 1b2c2cb2dab6..1b2c2cb2dab6 100644..100755
--- a/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
+++ b/vcl/qa/testdocuments/WriterDoc.sxw
Binary files differ
diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx
index 1657be61c4ff..0a6e9241e3a2 100644
--- a/vcl/source/app/brand.cxx
+++ b/vcl/source/app/brand.cxx
@@ -58,7 +58,7 @@ bool Application::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
{
// TODO - if we want more flexibility we could add a branding path
// in an rc file perhaps fallback to "about.bmp"
- rtl::OUString aBaseName = ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ rtl::OUString aBaseName = ( rtl::OUString::createFromAscii( "/" ) +
rtl::OUString::createFromAscii( pName ) );
rtl::OUString aPng( RTL_CONSTASCII_USTRINGPARAM(".png") );
@@ -67,9 +67,9 @@ bool Application::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
rtl::OLocale aLoc( pLoc );
rtl::OUString aName = aBaseName + aPng;
- rtl::OUString aLocaleName = ( aBaseName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("-")) +
+ rtl::OUString aLocaleName = ( aBaseName + rtl::OUString::createFromAscii ("-") +
aLoc.getLanguage() +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("_")) +
+ rtl::OUString::createFromAscii ("_") +
aLoc.getCountry() + aPng );
return ( loadPng ("$BRAND_BASE_DIR/program/edition", aLocaleName, rBitmap) ||
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 0380e9e58044..9bfb6d2d5bab 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,33 +38,32 @@
#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>
@@ -347,8 +346,8 @@ static const sal_Char* pDbgHelpText[] =
"Attempt to activate the debugger and produce the message there, in order to "
"always obtain the corresponding stack trace in the debugger.\n",
"\n",
-"Abort\n",
-"Aborts the application\n",
+"CoreDump\n",
+"Causes a crash\n",
"\n",
"\n",
"Reroute osl messages - Checkbox\n",
@@ -412,7 +411,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"char& String::operator [] ( sal_uInt16 nIndex )\n",
+"char& String::operator [] ( USHORT nIndex )\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_ASSERT( nIndex <= pData->nLen, \"String::[] : nIndex > Len\" );\n",
@@ -420,7 +419,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"sal_uInt16 String::Search( const String& rStr, sal_uInt16 nIndex ) const\n",
+"USHORT String::Search( const String& rStr, USHORT nIndex ) const\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_CHKOBJ( &rStr, String, DbgCheckString );\n",
@@ -452,19 +451,19 @@ namespace
++channel
)
{
- sal_uInt16 nEntryPos = rList.InsertEntry( channel->first );
+ USHORT nEntryPos = rList.InsertEntry( channel->first );
rList.SetEntryData( nEntryPos, reinterpret_cast< void* >( channel->second ) );
}
}
// -------------------------------------------------------------------
- void ImplSelectChannel( ListBox& rList, sal_uLong nChannelToSelect, sal_uInt16 nPositionOffset )
+ void ImplSelectChannel( ListBox& rList, ULONG nChannelToSelect, USHORT nPositionOffset )
{
if ( nChannelToSelect < DBG_OUT_USER_CHANNEL_0 )
- rList.SelectEntryPos( (sal_uInt16)( nChannelToSelect - nPositionOffset ) );
+ rList.SelectEntryPos( (USHORT)( nChannelToSelect - nPositionOffset ) );
else
{
- for ( sal_uInt16 pos = 0; pos < rList.GetEntryCount(); ++pos )
+ for ( USHORT pos = 0; pos < rList.GetEntryCount(); ++pos )
{
DbgChannelId nChannelId = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( pos )) );
if ( nChannelId == nChannelToSelect )
@@ -476,9 +475,9 @@ namespace
}
}
// -------------------------------------------------------------------
- DbgChannelId ImplGetChannelId( const ListBox& rList, sal_uInt16 nPositionOffset )
+ DbgChannelId ImplGetChannelId( const ListBox& rList, USHORT nPositionOffset )
{
- sal_uInt16 nSelectedChannelPos = rList.GetSelectEntryPos();
+ USHORT nSelectedChannelPos = rList.GetSelectEntryPos();
DbgChannelId nSelectedChannel = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( nSelectedChannelPos )) );
if ( nSelectedChannel == 0)
return (DbgChannelId)( nSelectedChannelPos + nPositionOffset );
@@ -502,14 +501,14 @@ private:
public:
DbgWindow();
- virtual sal_Bool Close();
+ virtual BOOL Close();
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
void InsertLine( const XubString& rLine );
void Update() { WorkWindow::Update(); maLstBox.Update(); }
private:
- void GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast );
+ void GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast );
};
// -----------------
@@ -521,10 +520,10 @@ class DbgInfoDialog : public ModalDialog
private:
ListBox maListBox;
OKButton maOKButton;
- sal_Bool mbHelpText;
+ BOOL mbHelpText;
public:
- DbgInfoDialog( Window* pParent, sal_Bool bHelpText = sal_False );
+ DbgInfoDialog( Window* pParent, BOOL bHelpText = FALSE );
void SetInfoText( const XubString& rStr );
};
@@ -583,7 +582,7 @@ private:
CancelButton maCancelButton;
PushButton maInfoButton;
HelpButton maHelpButton;
- sal_uInt16 mnErrorOff;
+ USHORT mnErrorOff;
public:
DbgDialog();
@@ -622,14 +621,14 @@ DbgWindow::DbgWindow() :
// -----------------------------------------------------------------------
-sal_Bool DbgWindow::Close()
+BOOL DbgWindow::Close()
{
// remember window position
ByteString aState( GetWindowState() );
DbgData* pData = DbgGetData();
- strncpy( pData->aDbgWinState,
- aState.GetBuffer(),
- std::min( sizeof( pData->aDbgWinState ),
+ strncpy( pData->aDbgWinState,
+ aState.GetBuffer(),
+ std::min( sizeof( pData->aDbgWinState ),
size_t(aState.Len() + 1U )) );
pData->aDbgWinState[ sizeof( pData->aDbgWinState ) - 1 ] = 0;
// and save for next session
@@ -637,7 +636,7 @@ sal_Bool DbgWindow::Close()
delete this;
ImplGetSVData()->maWinData.mpDbgWin = NULL;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -649,7 +648,7 @@ void DbgWindow::Resize()
// -----------------------------------------------------------------------
-void DbgWindow::GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast )
+void DbgWindow::GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast )
{
nFirst = nInbetweenEntry;
while ( nFirst > 0 )
@@ -658,7 +657,7 @@ void DbgWindow::GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16&
break;
--nFirst;
}
- sal_uInt16 nEntryCount = maLstBox.GetEntryCount();
+ USHORT nEntryCount = maLstBox.GetEntryCount();
nLast = nInbetweenEntry + 1;
while ( nLast < nEntryCount )
{
@@ -690,12 +689,12 @@ long DbgWindow::PreNotify( NotifyEvent& rNEvt )
Rectangle aEntryRect( maLstBox.GetBoundingRectangle( maLstBox.GetSelectEntryPos() ) );
aPos = aEntryRect.Center();
}
- sal_uInt16 nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
+ USHORT nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
if ( nSelected == 1 )
{
// search all entries which belong to this assertion
- sal_uInt16 nAssertionFirst = 0;
- sal_uInt16 nAssertionLast = 0;
+ USHORT nAssertionFirst = 0;
+ USHORT nAssertionLast = 0;
GetAssertionEntryRange( maLstBox.GetSelectEntryPos(), nAssertionFirst, nAssertionLast );
// build the string to copy to the clipboard
@@ -724,23 +723,23 @@ void DbgWindow::InsertLine( const XubString& rLine )
XubString aStr = rLine;
aStr.ConvertLineEnd( LINEEND_LF );
xub_StrLen nPos = aStr.Search( _LF );
- sal_Bool bFirstEntry = sal_True;
+ BOOL bFirstEntry = TRUE;
while ( nPos != STRING_NOTFOUND )
{
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
+ USHORT nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
- bFirstEntry = sal_False;
+ bFirstEntry = FALSE;
aStr.Erase( 0, nPos+1 );
nPos = aStr.Search( _LF );
}
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr );
+ USHORT nInsertionPos = maLstBox.InsertEntry( aStr );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
maLstBox.SetTopEntry( DBGWIN_MAXLINES-1 );
@@ -803,7 +802,7 @@ DbgDialog::DbgDialog() :
maXtorThis.Show();
maXtorThis.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "T~his" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_THIS )
- maXtorThis.Check( sal_True );
+ maXtorThis.Check( TRUE );
maXtorThis.SetPosSizePixel( LogicToPixel( Point( 10, 15 ), aAppMap ),
aButtonSize );
}
@@ -812,7 +811,7 @@ DbgDialog::DbgDialog() :
maXtorFunc.Show();
maXtorFunc.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Function" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_FUNC )
- maXtorFunc.Check( sal_True );
+ maXtorFunc.Check( TRUE );
maXtorFunc.SetPosSizePixel( LogicToPixel( Point( 75, 15 ), aAppMap ),
aButtonSize );
}
@@ -821,7 +820,7 @@ DbgDialog::DbgDialog() :
maXtorExit.Show();
maXtorExit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "E~xit" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_EXIT )
- maXtorExit.Check( sal_True );
+ maXtorExit.Check( TRUE );
maXtorExit.SetPosSizePixel( LogicToPixel( Point( 140, 15 ), aAppMap ),
aButtonSize );
}
@@ -830,7 +829,7 @@ DbgDialog::DbgDialog() :
maXtorReport.Show();
maXtorReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_REPORT )
- maXtorReport.Check( sal_True );
+ maXtorReport.Check( TRUE );
maXtorReport.SetPosSizePixel( LogicToPixel( Point( 205, 15 ), aAppMap ),
aButtonSize );
}
@@ -839,7 +838,7 @@ DbgDialog::DbgDialog() :
maXtorTrace.Show();
maXtorTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_TRACE )
- maXtorTrace.Check( sal_True );
+ maXtorTrace.Check( TRUE );
maXtorTrace.SetPosSizePixel( LogicToPixel( Point( 270, 15 ), aAppMap ),
aButtonSize );
}
@@ -855,7 +854,7 @@ DbgDialog::DbgDialog() :
maMemInit.Show();
maMemInit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Initialize" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_INIT )
- maMemInit.Check( sal_True );
+ maMemInit.Check( TRUE );
maMemInit.SetPosSizePixel( LogicToPixel( Point( 10, 50 ), aAppMap ),
aButtonSize );
}
@@ -864,7 +863,7 @@ DbgDialog::DbgDialog() :
maMemOverwrite.Show();
maMemOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Overwrite" )) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITE )
- maMemOverwrite.Check( sal_True );
+ maMemOverwrite.Check( TRUE );
maMemOverwrite.SetPosSizePixel( LogicToPixel( Point( 75, 50 ), aAppMap ),
aButtonSize );
}
@@ -873,7 +872,7 @@ DbgDialog::DbgDialog() :
maMemOverwriteFree.Show();
maMemOverwriteFree.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Free" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITEFREE )
- maMemOverwriteFree.Check( sal_True );
+ maMemOverwriteFree.Check( TRUE );
maMemOverwriteFree.SetPosSizePixel( LogicToPixel( Point( 140, 50 ), aAppMap ),
aButtonSize );
}
@@ -882,7 +881,7 @@ DbgDialog::DbgDialog() :
maMemPtr.Show();
maMemPtr.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Pointer" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_POINTER )
- maMemPtr.Check( sal_True );
+ maMemPtr.Check( TRUE );
maMemPtr.SetPosSizePixel( LogicToPixel( Point( 205, 50 ), aAppMap ),
aButtonSize );
}
@@ -891,7 +890,7 @@ DbgDialog::DbgDialog() :
maMemReport.Show();
maMemReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_REPORT )
- maMemReport.Check( sal_True );
+ maMemReport.Check( TRUE );
maMemReport.SetPosSizePixel( LogicToPixel( Point( 270, 50 ), aAppMap ),
aButtonSize );
}
@@ -900,7 +899,7 @@ DbgDialog::DbgDialog() :
maMemTrace.Show();
maMemTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_TRACE )
- maMemTrace.Check( sal_True );
+ maMemTrace.Check( TRUE );
maMemTrace.SetPosSizePixel( LogicToPixel( Point( 10, 65 ), aAppMap ),
aButtonSize );
}
@@ -909,7 +908,7 @@ DbgDialog::DbgDialog() :
maMemLeakReport.Show();
maMemLeakReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Leak-Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_LEAKREPORT )
- maMemLeakReport.Check( sal_True );
+ maMemLeakReport.Check( TRUE );
maMemLeakReport.SetPosSizePixel( LogicToPixel( Point( 75, 65 ), aAppMap ),
aButtonSize );
}
@@ -918,7 +917,7 @@ DbgDialog::DbgDialog() :
maMemNewDel.Show();
maMemNewDel.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~New/Delete" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_NEWDEL )
- maMemNewDel.Check( sal_True );
+ maMemNewDel.Check( TRUE );
maMemNewDel.SetPosSizePixel( LogicToPixel( Point( 140, 65 ), aAppMap ),
aButtonSize );
}
@@ -927,7 +926,7 @@ DbgDialog::DbgDialog() :
maMemXtor.Show();
maMemXtor.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Ob~ject Test" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_XTOR )
- maMemXtor.Check( sal_True );
+ maMemXtor.Check( TRUE );
maMemXtor.SetPosSizePixel( LogicToPixel( Point( 205, 65 ), aAppMap ),
aButtonSize );
}
@@ -943,7 +942,7 @@ DbgDialog::DbgDialog() :
maProf.Show();
maProf.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Profiling" ) ) );
if ( pData->nTestFlags & DBG_TEST_PROFILING )
- maProf.Check( sal_True );
+ maProf.Check( TRUE );
maProf.SetPosSizePixel( LogicToPixel( Point( 10, 95 ), aAppMap ),
aButtonSize );
}
@@ -952,7 +951,7 @@ DbgDialog::DbgDialog() :
maRes.Show();
maRes.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Resourcen" ) ) );
if ( pData->nTestFlags & DBG_TEST_RESOURCE )
- maRes.Check( sal_True );
+ maRes.Check( TRUE );
maRes.SetPosSizePixel( LogicToPixel( Point( 75, 95 ), aAppMap ),
aButtonSize );
}
@@ -961,7 +960,7 @@ DbgDialog::DbgDialog() :
maDialog.Show();
maDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Dialog" ) ) );
if ( pData->nTestFlags & DBG_TEST_DIALOG )
- maDialog.Check( sal_True );
+ maDialog.Check( TRUE );
maDialog.SetPosSizePixel( LogicToPixel( Point( 140, 95 ), aAppMap ),
aButtonSize );
}
@@ -970,7 +969,7 @@ DbgDialog::DbgDialog() :
maBoldAppFont.Show();
maBoldAppFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Bold AppFont" ) ) );
if ( pData->nTestFlags & DBG_TEST_BOLDAPPFONT )
- maBoldAppFont.Check( sal_True );
+ maBoldAppFont.Check( TRUE );
maBoldAppFont.SetPosSizePixel( LogicToPixel( Point( 205, 95 ), aAppMap ),
aButtonSize );
maBoldAppFont.SaveValue();
@@ -995,16 +994,16 @@ DbgDialog::DbgDialog() :
maOverwrite.Show();
maOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Overwrite ~File" ) ) );
if ( pData->bOverwrite )
- maOverwrite.Check( sal_True );
+ maOverwrite.Check( TRUE );
maOverwrite.SetPosSizePixel( LogicToPixel( Point( 205, 130 ), aAppMap ),
aButtonSize );
}
-
+
{
maHookOSLBox.Show();
maHookOSLBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Reroute osl debug ~messages" ) ) );
if ( pData->bHookOSLAssert )
- maHookOSLBox.Check( sal_True );
+ maHookOSLBox.Check( TRUE );
maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
LogicToPixel( Size( 100, 12 ), aAppMap ) );
}
@@ -1084,7 +1083,7 @@ DbgDialog::DbgDialog() :
maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) );
ImplAppendUserDefinedChannels( maTraceBox );
ImplSelectChannel( maTraceBox, pData->nTraceOut, 0 );
maTraceBox.Show();
@@ -1107,7 +1106,7 @@ DbgDialog::DbgDialog() :
maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) );
ImplAppendUserDefinedChannels( maWarningBox );
ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 );
maWarningBox.Show();
@@ -1136,7 +1135,7 @@ DbgDialog::DbgDialog() :
maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) );
maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) );
maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) );
- maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) );
+ maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) );
ImplAppendUserDefinedChannels( maErrorBox );
ImplSelectChannel( maErrorBox, pData->nErrorOut, mnErrorOff );
maErrorBox.Show();
@@ -1207,8 +1206,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() ? sal_True : sal_False;
- aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? sal_True : sal_False;
+ aData.bOverwrite = maOverwrite.IsChecked() ? TRUE : FALSE;
+ aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? TRUE : FALSE;
if ( maXtorThis.IsChecked() )
aData.nTestFlags |= DBG_TEST_XTOR_THIS;
@@ -1302,7 +1301,7 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
) ) );
aBox.Execute();
}
- EndDialog( sal_True );
+ EndDialog( TRUE );
}
else if ( pButton == &maInfoButton )
{
@@ -1325,7 +1324,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
{
if ( rHEvt.GetMode() & HELPMODE_CONTEXT )
{
- DbgInfoDialog aInfoDialog( this, sal_True );
+ DbgInfoDialog aInfoDialog( this, TRUE );
XubString aHelpText;
const sal_Char** pHelpStrs = pDbgHelpText;
while ( *pHelpStrs )
@@ -1341,7 +1340,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
// =======================================================================
-DbgInfoDialog::DbgInfoDialog( Window* pParent, sal_Bool bHelpText ) :
+DbgInfoDialog::DbgInfoDialog( Window* pParent, BOOL bHelpText ) :
ModalDialog( pParent, WB_STDMODAL ),
maListBox( this, WB_BORDER | WB_AUTOHSCROLL ),
maOKButton( this, WB_DEFBUTTON )
@@ -1368,12 +1367,12 @@ DbgInfoDialog::DbgInfoDialog( Window* pParent, sal_Bool bHelpText ) :
void DbgInfoDialog::SetInfoText( const XubString& rStr )
{
- maListBox.SetUpdateMode( sal_False );
+ maListBox.SetUpdateMode( FALSE );
maListBox.Clear();
XubString aStr = rStr;
aStr.ConvertLineEnd( LINEEND_LF );
- sal_uInt16 nStrIndex = 0;
- sal_uInt16 nFoundIndex;
+ USHORT nStrIndex = 0;
+ USHORT nFoundIndex;
do
{
nFoundIndex = aStr.Search( _LF, nStrIndex );
@@ -1381,8 +1380,8 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
if ( mbHelpText )
{
long nMaxWidth = maListBox.GetOutputSizePixel().Width()-30;
- sal_uInt16 nLastIndex = 0;
- sal_uInt16 nIndex = aTextParagraph.Search( ' ' );
+ USHORT nLastIndex = 0;
+ USHORT nIndex = aTextParagraph.Search( ' ' );
while ( nIndex != STRING_NOTFOUND )
{
if ( maListBox.GetTextWidth( aTextParagraph, 0, nIndex ) > nMaxWidth )
@@ -1412,15 +1411,15 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
nStrIndex = nFoundIndex+1;
}
while ( nFoundIndex != STRING_NOTFOUND );
- maListBox.SetUpdateMode( sal_True );
+ maListBox.SetUpdateMode( TRUE );
}
// =======================================================================
void DbgDialogTest( Window* pWindow )
{
- sal_Bool aAccelBuf[65536];
- sal_uInt16 nChildCount = pWindow->GetChildCount();
+ BOOL aAccelBuf[65536];
+ USHORT nChildCount = pWindow->GetChildCount();
Window* pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
Window* pChild;
Point aTabPos;
@@ -1434,9 +1433,9 @@ void DbgDialogTest( Window* pWindow )
if ( pWindow->IsDialog() )
{
- sal_Bool bOKCancelButton = sal_False;
- sal_Bool bDefPushButton = sal_False;
- sal_Bool bButton = sal_False;
+ BOOL bOKCancelButton = FALSE;
+ BOOL bDefPushButton = FALSE;
+ BOOL bButton = FALSE;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1444,11 +1443,11 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->ImplIsPushButton() )
{
- bButton = sal_True;
+ bButton = TRUE;
if ( (pChild->GetType() == WINDOW_OKBUTTON) || (pChild->GetType() == WINDOW_CANCELBUTTON) )
- bOKCancelButton = sal_True;
+ bOKCancelButton = TRUE;
if ( pChild->GetStyle() & WB_DEFBUTTON )
- bDefPushButton = sal_True;
+ bDefPushButton = TRUE;
}
pGetChild = pGetChild->GetWindow( WINDOW_NEXT );
@@ -1463,7 +1462,7 @@ void DbgDialogTest( Window* pWindow )
}
}
- sal_uInt16 i = 0;
+ USHORT i = 0;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1475,7 +1474,7 @@ void DbgDialogTest( Window* pWindow )
{
XubString aText = pChild->GetText();
XubString aErrorText = aText;
- sal_uInt16 nAccelPos = STRING_NOTFOUND;
+ USHORT nAccelPos = STRING_NOTFOUND;
xub_Unicode cAccel = 0;
if ( aErrorText.Len() > 128 )
{
@@ -1496,7 +1495,7 @@ void DbgDialogTest( Window* pWindow )
if ( aAccelBuf[cAccel] )
DbgOutTypef( DBG_OUT_ERROR, "Double mnemonic char: %c", cAccel );
else
- aAccelBuf[cAccel] = sal_True;
+ aAccelBuf[cAccel] = TRUE;
}
}
}
@@ -1527,7 +1526,7 @@ void DbgDialogTest( Window* pWindow )
"%s should have a mnemonic char (~): %s",
pClass,
ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
-
+
// check text width
int aWidth=0;
switch( pChild->GetType() )
@@ -1576,7 +1575,7 @@ void DbgDialogTest( Window* pWindow )
int aWidth=0;
if( nAccelPos != STRING_NOTFOUND )
{
- aWidth = pChild->GetTextWidth( aText, 0, nAccelPos ) +
+ aWidth = pChild->GetTextWidth( aText, 0, nAccelPos ) +
pChild->GetTextWidth( aText, nAccelPos+1, aText.Len() - nAccelPos - 1);
}
else
@@ -1649,66 +1648,66 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->IsVisible() )
{
- sal_Bool bMaxWarning = sal_False;
+ BOOL bMaxWarning = FALSE;
if ( pChild->GetType() == WINDOW_NUMERICFIELD )
{
NumericField* pField = (NumericField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_METRICFIELD )
{
MetricField* pField = (MetricField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_CURRENCYFIELD )
{
CurrencyField* pField = (CurrencyField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_TIMEFIELD )
{
TimeField* pField = (TimeField*)pChild;
if ( pField->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_DATEFIELD )
{
DateField* pField = (DateField*)pChild;
if ( pField->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_NUMERICBOX )
{
NumericBox* pBox = (NumericBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_METRICBOX )
{
MetricBox* pBox = (MetricBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_CURRENCYBOX )
{
CurrencyBox* pBox = (CurrencyBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_TIMEBOX )
{
TimeBox* pBox = (TimeBox*)pChild;
if ( pBox->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
else if ( pChild->GetType() == WINDOW_DATEBOX )
{
DateBox* pBox = (DateBox*)pChild;
if ( pBox->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = sal_True;
+ bMaxWarning = TRUE;
}
if ( bMaxWarning )
{
@@ -1762,7 +1761,7 @@ void DbgDialogTest( Window* pWindow )
aTabPos = aNewPos;
}
- for ( sal_uInt16 j = 0; j < i; j++ )
+ for ( USHORT j = 0; j < i; j++ )
{
if ( ((pRectAry[j].Right() != 0) || (pRectAry[j].Bottom() != 0)) &&
aChildRect.IsOver( pRectAry[j] ) )
@@ -1800,7 +1799,7 @@ class DbgMessageBox : public ErrorBox
SetText( String( RTL_CONSTASCII_USTRINGPARAM("Debug Output") ) );
AddButton( String( RTL_CONSTASCII_USTRINGPARAM( "Copy" ) ), COPY_BUTTON_ID, 0 );
}
-
+
virtual void Click()
{
if( GetCurButtonId() == COPY_BUTTON_ID )
@@ -1840,8 +1839,8 @@ long SolarMessageBoxExecutor::doIt()
#if ! defined USE_VCL_MSGBOX
#ifdef WNT
- sal_Bool bOldCallTimer = pSVData->mbNoCallTimer;
- pSVData->mbNoCallTimer = sal_True;
+ BOOL bOldCallTimer = pSVData->mbNoCallTimer;
+ pSVData->mbNoCallTimer = TRUE;
MessageBeep( MB_ICONHAND );
nResult = MessageBoxW( 0, (LPWSTR)m_sDebugMessage.GetBuffer(), L"Debug Output",
MB_TASKMODAL | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONSTOP );
@@ -1860,7 +1859,7 @@ long SolarMessageBoxExecutor::doIt()
}
#endif // WNT
#else
- sal_uInt16 nOldMode = Application::GetSystemWindowMode();
+ USHORT nOldMode = Application::GetSystemWindowMode();
Application::SetSystemWindowMode( nOldMode & ~SYSTEMWINDOW_MODE_NOAUTOMODE );
DbgMessageBox aBox( m_sDebugMessage );
Application::SetSystemWindowMode( nOldMode );
@@ -1946,12 +1945,12 @@ long SolarWindowPrinter::doIt()
void DbgPrintWindow( const char* pLine )
{
- static sal_Bool bIn = sal_False;
+ static BOOL bIn = FALSE;
// keine rekursiven Traces
if ( bIn )
return;
- bIn = sal_True;
+ bIn = TRUE;
SolarWindowPrinter aPrinter( String( pLine, RTL_TEXTENCODING_UTF8 ) );
TimeValue aTimeout; aTimeout.Seconds = 2; aTimeout.Nanosec = 0;
@@ -1960,24 +1959,14 @@ void DbgPrintWindow( const char* pLine )
if ( aPrinter.didTimeout() )
DbgPrintShell( pLine );
- bIn = sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-void DbgAbort( char const * i_message )
-{
- ::rtl::OUString const message( i_message, strlen( i_message ), osl_getThreadTextEncoding() );
- Application::Abort( message );
+ bIn = FALSE;
}
// =======================================================================
-void ImplDbgTestSolarMutex()
-{
- bool bCheck = ImplGetSVData()->mpDefInst->CheckYieldMutex();
- OSL_ENSURE( bCheck, "SolarMutex not locked" );
-}
+#ifdef WNT
+void ImplDbgTestSolarMutex();
+#endif
// =======================================================================
@@ -1985,8 +1974,9 @@ void DbgGUIInit()
{
DbgSetPrintMsgBox( DbgPrintMsgBox );
DbgSetPrintWindow( DbgPrintWindow );
+#ifdef WNT
DbgSetTestSolarMutex( ImplDbgTestSolarMutex );
- DbgSetAbort( DbgAbort );
+#endif
}
// -----------------------------------------------------------------------
@@ -1995,8 +1985,9 @@ void DbgGUIDeInit()
{
DbgSetPrintMsgBox( NULL );
DbgSetPrintWindow( NULL );
+#ifdef WNT
DbgSetTestSolarMutex( NULL );
- DbgSetAbort( NULL );
+#endif
DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
if ( pDbgWindow )
@@ -2013,7 +2004,7 @@ void DbgGUIStart()
{
DbgDialog* pDialog = new DbgDialog;
// Fuer den Debug-Dialog schalten wir Dialogtests aus
- sal_uLong nOldFlags = pData->nTestFlags;
+ ULONG nOldFlags = pData->nTestFlags;
pData->nTestFlags &= ~DBG_TEST_DIALOG;
if ( !pDialog->Execute() )
pData->nTestFlags |= (nOldFlags & DBG_TEST_DIALOG);
@@ -2028,7 +2019,7 @@ void DbgGUIStart()
// -----------------------------------------------------------------------
-sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
+USHORT DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
{
DbgChannelId nChannelId = DbgRegisterUserChannel( pProc );
UserDefinedChannels& rChannels = ImplDbgGetUserDefinedChannels();
diff --git a/vcl/source/app/dndhelp.cxx b/vcl/source/app/dndhelp.cxx
index ceaa8f904816..46a0eac19d4a 100644
--- a/vcl/source/app/dndhelp.cxx
+++ b/vcl/source/app/dndhelp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -91,7 +91,7 @@ vcl::unohelper::DragAndDropWrapper::DragAndDropWrapper( DragAndDropClient* pClie
vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper()
{
}
-
+
// uno::XInterface
uno::Any vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
{
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 41263675840f..c6fc815854d0 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,20 +37,19 @@
#include "vcl/help.hxx"
#include "vcl/helpwin.hxx"
#include "tools/debug.hxx"
-#include "tools/diagnose_ex.h"
#include "tools/time.hxx"
// =======================================================================
-#define HELPWINSTYLE_QUICK 0
-#define HELPWINSTYLE_BALLOON 1
+#define HELPWINSTYLE_QUICK 0
+#define HELPWINSTYLE_BALLOON 1
-#define HELPTEXTMARGIN_QUICK 3
-#define HELPTEXTMARGIN_BALLOON 6
+#define HELPTEXTMARGIN_QUICK 3
+#define HELPTEXTMARGIN_BALLOON 6
-#define HELPDELAY_NORMAL 1
-#define HELPDELAY_SHORT 2
-#define HELPDELAY_NONE 3
+#define HELPDELAY_NORMAL 1
+#define HELPDELAY_SHORT 2
+#define HELPDELAY_NONE 3
// =======================================================================
@@ -64,20 +63,27 @@ Help::~Help()
// -----------------------------------------------------------------------
-void Help::OpenHelpAgent( const rtl::OString& )
+BOOL Help::Start( ULONG, const Window* )
+{
+ return FALSE;
+}
+
+void Help::OpenHelpAgent( ULONG )
{
}
// -----------------------------------------------------------------------
-sal_Bool Help::Start( const XubString&, const Window* )
+BOOL Help::Start( const XubString&, const Window* )
{
- return sal_False;
+ return FALSE;
}
-sal_Bool Help::SearchKeyword( const XubString& )
+// -----------------------------------------------------------------------
+
+XubString Help::GetHelpText( ULONG, const Window* )
{
- return sal_False;
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
@@ -91,26 +97,26 @@ XubString Help::GetHelpText( const String&, const Window* )
void Help::EnableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = sal_True;
+ ImplGetSVData()->maHelpData.mbContextHelp = TRUE;
}
// -----------------------------------------------------------------------
void Help::DisableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = sal_False;
+ ImplGetSVData()->maHelpData.mbContextHelp = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::IsContextHelpEnabled()
+BOOL Help::IsContextHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbContextHelp;
}
// -----------------------------------------------------------------------
-sal_Bool Help::StartContextHelp()
+BOOL Help::StartContextHelp()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -119,77 +125,77 @@ sal_Bool Help::StartContextHelp()
Window* pWindow = pSVData->maWinData.mpFocusWin;
if ( pWindow )
{
- Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() );
- HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT );
+ Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() );
+ HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT );
pWindow->RequestHelp( aHelpEvent );
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
void Help::EnableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = sal_True;
+ ImplGetSVData()->maHelpData.mbExtHelp = TRUE;
}
// -----------------------------------------------------------------------
void Help::DisableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = sal_False;
+ ImplGetSVData()->maHelpData.mbExtHelp = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::IsExtHelpEnabled()
+BOOL Help::IsExtHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbExtHelp;
}
// -----------------------------------------------------------------------
-sal_Bool Help::StartExtHelp()
+BOOL Help::StartExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && !pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = sal_True;
+ pSVData->maHelpData.mbExtHelpMode = TRUE;
pSVData->maHelpData.mbOldBalloonMode = pSVData->maHelpData.mbBalloonHelp;
- pSVData->maHelpData.mbBalloonHelp = sal_True;
+ pSVData->maHelpData.mbBalloonHelp = TRUE;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::EndExtHelp()
+BOOL Help::EndExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = sal_False;
+ pSVData->maHelpData.mbExtHelpMode = FALSE;
pSVData->maHelpData.mbBalloonHelp = pSVData->maHelpData.mbOldBalloonMode;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::IsExtHelpActive()
+BOOL Help::IsExtHelpActive()
{
return ImplGetSVData()->maHelpData.mbExtHelpMode;
}
@@ -198,115 +204,101 @@ sal_Bool Help::IsExtHelpActive()
void Help::EnableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = TRUE;
}
// -----------------------------------------------------------------------
void Help::DisableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = sal_False;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::IsBalloonHelpEnabled()
+BOOL Help::IsBalloonHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbBalloonHelp;
}
// -----------------------------------------------------------------------
-sal_Bool Help::ShowBalloon( Window* pParent,
+BOOL Help::ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::ShowBalloon( Window* pParent,
+BOOL Help::ShowBalloon( Window* pParent,
const Point& rScreenPos, const Rectangle& rRect,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos, &rRect );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
void Help::EnableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = sal_True;
+ ImplGetSVData()->maHelpData.mbQuickHelp = TRUE;
}
// -----------------------------------------------------------------------
void Help::DisableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = sal_False;
+ ImplGetSVData()->maHelpData.mbQuickHelp = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Help::IsQuickHelpEnabled()
+BOOL Help::IsQuickHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbQuickHelp;
}
// -----------------------------------------------------------------------
-sal_Bool Help::ShowQuickHelp( Window* pParent,
+BOOL Help::ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle,
rHelpText, rLongHelpText,
pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect,
- const XubString& rText, sal_uInt16 nStyle )
+ULONG Help::ShowTip( Window* pParent, const Rectangle& rRect,
+ const XubString& rText, USHORT nStyle )
{
- sal_uInt16 nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
+ USHORT nHelpWinStyle = 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, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
-
- pHelpWin->SetHelpText( rText );
+ ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle,
+ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rRect );
+ pHelpWin->ShowHelp( HELPDELAY_NONE );
+ return (ULONG)pHelpWin;
}
// -----------------------------------------------------------------------
-void Help::HideTip( sal_uLong nId )
+void Help::HideTip( ULONG nId )
{
HelpTextWindow* pHelpWin = (HelpTextWindow*)nId;
Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
@@ -320,17 +312,17 @@ void Help::HideTip( sal_uLong nId )
// =======================================================================
-HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle ) :
+HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT nHelpWinStyle, USHORT 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( sal_True );
+ ImplSetMouseTransparent( TRUE );
mnHelpWinStyle = nHelpWinStyle;
mnStyle = nStyle;
// on windows this will raise the application window, because help windows are system windows now
-// EnableAlwaysOnTop();
+// EnableAlwaysOnTop();
EnableSaveBackground();
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -339,9 +331,9 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uIn
SetTextAlign( ALIGN_TOP );
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
@@ -354,7 +346,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uIn
if( mnStyle & QUICKHELP_BIDI_RTL )
{
- sal_uLong nLayoutMode = GetLayoutMode();
+ ULONG nLayoutMode = GetLayoutMode();
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
SetLayoutMode( nLayoutMode );
}
@@ -363,7 +355,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uIn
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbSetKeyboardHelp )
- pSVData->maHelpData.mbKeyboardHelp = sal_True;
+ pSVData->maHelpData.mbKeyboardHelp = TRUE;
const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
maShowTimer.SetTimeoutHdl( LINK( this, HelpTextWindow, TimerHdl ) );
@@ -380,6 +372,12 @@ HelpTextWindow::~HelpTextWindow()
if( this == ImplGetSVData()->maHelpData.mpHelpWin )
ImplGetSVData()->maHelpData.mpHelpWin = NULL;
+
+ if ( maStatusText.Len() )
+ {
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpApp->HideHelpStatusText();
+ }
}
// -----------------------------------------------------------------------
@@ -399,14 +397,14 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
}
else // HELPWINSTYLE_BALLOON
{
- Point aTmpPoint;
- sal_uInt16 nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
- XubString aXXX;
+ Point aTmpPoint;
+ USHORT 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 );
- sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
+ USHORT nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
TEXT_DRAW_LEFT | TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -428,7 +426,12 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
void HelpTextWindow::ImplShow()
{
ImplDelData aDogTag( this );
- Show( sal_True, SHOW_NOACTIVATE );
+ if ( maStatusText.Len() )
+ {
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpApp->ShowHelpStatusText( maStatusText );
+ }
+ Show( TRUE, SHOW_NOACTIVATE );
if( !aDogTag.IsDelete() )
Update();
}
@@ -458,7 +461,7 @@ void HelpTextWindow::Paint( const Rectangle& )
}
else // HELPWINSTYLE_BALLOON
{
- sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
+ USHORT nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
TEXT_DRAW_LEFT|TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -484,9 +487,9 @@ void HelpTextWindow::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void HelpTextWindow::ShowHelp( sal_uInt16 nDelayMode )
+void HelpTextWindow::ShowHelp( USHORT nDelayMode )
{
- sal_uLong nTimeout = 0;
+ ULONG nTimeout = 0;
if ( nDelayMode != HELPDELAY_NONE )
{
// Im ExtendedHelp-Fall die Hilfe schneller anzeigen
@@ -567,9 +570,9 @@ String HelpTextWindow::GetText() const
// -----------------------------------------------------------------------
-sal_Bool HelpTextWindow::RegisterAccessibleParent()
+BOOL HelpTextWindow::RegisterAccessibleParent()
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -580,7 +583,7 @@ void HelpTextWindow::RevokeAccessibleParent()
// =======================================================================
-void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
+void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
const XubString& rHelpText, const XubString& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea )
{
@@ -590,19 +593,15 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
return;
HelpTextWindow* pHelpWin = pSVData->maHelpData.mpHelpWin;
- sal_uInt16 nDelayMode = HELPDELAY_NORMAL;
+ USHORT 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
@@ -614,8 +613,8 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
}
else
{
- bool const bTextChanged = rHelpText != pHelpWin->GetHelpText();
- if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) )
+ bool bTextChanged = rHelpText != pHelpWin->GetHelpText();
+ if( bTextChanged )
{
Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
@@ -633,12 +632,10 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
if ( !pHelpWin && rHelpText.Len() )
{
- sal_uLong nCurTime = Time::GetSystemTicks();
- if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
- || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 )
- )
+ ULONG nCurTime = Time::GetSystemTicks();
+ if( (nCurTime - pSVData->maHelpData.mnLastHelpHideTime) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
nDelayMode = HELPDELAY_NONE;
-
+
DBG_ASSERT( !pHelpWin, "Noch ein HelpWin ?!" );
pHelpWin = new HelpTextWindow( pParent, rHelpText, nHelpWinStyle, nStyle );
pSVData->maHelpData.mpHelpWin = pHelpWin;
@@ -646,7 +643,7 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
if ( pHelpArea )
pHelpWin->SetHelpArea( *pHelpArea );
- // positioning
+ // positioning
Size aSz = pHelpWin->CalcOutSize();
pHelpWin->SetOutputSizePixel( aSz );
ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, pHelpArea );
@@ -671,7 +668,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
if( pHelpWin->IsVisible() )
pWindow->Invalidate( aInvRect );
pSVData->maHelpData.mpHelpWin = NULL;
- pSVData->maHelpData.mbKeyboardHelp = sal_False;
+ pSVData->maHelpData.mbKeyboardHelp = FALSE;
pHelpWin->Hide();
delete pHelpWin;
if( bUpdateHideTime )
@@ -681,12 +678,12 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
// -----------------------------------------------------------------------
-void ImplSetHelpWindowPos( Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWin, USHORT nHelpWinStyle, USHORT nStyle,
const Point& rPos, const Rectangle* pHelpArea )
{
- Point aPos = rPos;
- Size aSz = pHelpWin->GetSizePixel();
- Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
+ Point aPos = rPos;
+ Size aSz = pHelpWin->GetSizePixel();
+ Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
aPos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aPos );
// get mouse screen coords
Point mPos( pHelpWin->GetParent()->ImplGetFrameWindow()->GetPointerPosPixel() );
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 0f9a8df94255..c5cd3e796bb6 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -87,16 +87,16 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const
return *mpLocaleDataWrapper;
}
-const ::com::sun::star::lang::Locale& vcl::I18nHelper::getLocale() const
+const ::com::sun::star::lang::Locale& vcl::I18nHelper::getLocale() const
{
- return maLocale;
+ return maLocale;
}
inline bool is_formatting_mark( sal_Unicode c )
{
- if( (c >= 0x200B) && (c <= 0x200F) ) // BiDi and zero-width-markers
+ if( (c >= 0x200B) && (c <= 0x200F) ) // BiDi and zero-width-markers
return true;
- if( (c >= 0x2028) && (c <= 0x202E) ) // BiDi and paragraph-markers
+ if( (c >= 0x2028) && (c <= 0x202E) ) // BiDi and paragraph-markers
return true;
return false;
}
@@ -105,7 +105,7 @@ inline bool is_formatting_mark( sal_Unicode c )
the transliteration. The real solution would have been an additional TransliterationModule
to ignore these marks during transliteration; however changin the code in i18npool that actually
implements this could produce unwanted side effects.
-
+
Of course this copying around is not really good, but looking at i18npool, one more time
will not hurt.
*/
@@ -131,12 +131,12 @@ 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 = sal_False;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = FALSE;
delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
-
+
String aStr1( filterFormattingChars(rStr1) );
String aStr2( filterFormattingChars(rStr2) );
return ImplGetTransliterationWrapper().compareString( aStr1, aStr2 );
@@ -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 = sal_True;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = 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 );
- sal_Bool bEqual = sal_False;
- sal_uInt16 n = rString.Search( '~' );
+ BOOL bEqual = FALSE;
+ USHORT 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, sal_uInt16 nDecimals, sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const
+String vcl::I18nHelper::GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep, 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 cc6502a74896..c90dc4cd297c 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <tools/list.hxx>
#include <vcl/idlemgr.hxx>
#include <vcl/svapp.hxx>
@@ -36,17 +37,19 @@
struct ImplIdleData
{
Link maIdleHdl;
- sal_uInt16 mnPriority;
- sal_Bool mbTimeout;
+ USHORT mnPriority;
+ BOOL mbTimeout;
};
+DECLARE_LIST( ImplIdleList, ImplIdleData* )
+
#define IMPL_IDLETIMEOUT 350
// =======================================================================
ImplIdleMgr::ImplIdleMgr()
{
- mpIdleList = new ImplIdleList();
+ mpIdleList = new ImplIdleList( 8, 8, 8 );
maTimer.SetTimeout( IMPL_IDLETIMEOUT );
maTimer.SetTimeoutHdl( LINK( this, ImplIdleMgr, TimeoutHdl ) );
@@ -57,63 +60,71 @@ ImplIdleMgr::ImplIdleMgr()
ImplIdleMgr::~ImplIdleMgr()
{
// Liste loeschen
- for ( size_t i = 0, n = mpIdleList->size(); i < n; ++i ) {
- delete (*mpIdleList)[ i ];
+ ImplIdleData* pIdleData = mpIdleList->First();
+ while ( pIdleData )
+ {
+ delete pIdleData;
+ pIdleData = mpIdleList->Next();
}
- mpIdleList->clear();
+
delete mpIdleList;
}
// -----------------------------------------------------------------------
-sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
+BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT 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 sal_False;
- }
- if ( nPriority <= (*mpIdleList)[ i ]->mnPriority ) {
- nPos = i;
- }
+ ULONG nPos = LIST_APPEND;
+ ImplIdleData* pIdleData = mpIdleList->First();
+ while ( pIdleData )
+ {
+ // Wenn Link schon existiert, dann gebe FALSE zurueck
+ if ( pIdleData->maIdleHdl == rLink )
+ return FALSE;
+
+ // Nach Prioritaet sortieren
+ if ( nPriority <= pIdleData->mnPriority )
+ nPos = mpIdleList->GetCurPos();
+
+ // Schleife nicht beenden, da noch
+ // geprueft werden muss, ob sich der Link
+ // schon in der Liste befindet
+
+ pIdleData = mpIdleList->Next();
}
- ImplIdleData* pIdleData = new ImplIdleData;
+ pIdleData = new ImplIdleData;
pIdleData->maIdleHdl = rLink;
pIdleData->mnPriority = nPriority;
- pIdleData->mbTimeout = sal_False;
-
- if ( nPos < mpIdleList->size() ) {
- ImplIdleList::iterator it = mpIdleList->begin();
- ::std::advance( it, nPos );
- mpIdleList->insert( it, pIdleData );
- } else {
- mpIdleList->push_back( pIdleData );
- }
+ pIdleData->mbTimeout = FALSE;
+ mpIdleList->Insert( pIdleData, nPos );
// Wenn Timer noch nicht gestartet ist, dann starten
if ( !maTimer.IsActive() )
maTimer.Start();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
{
- for ( ImplIdleList::iterator it = mpIdleList->begin(); it < mpIdleList->end(); ++it ) {
- if ( (*it)->maIdleHdl == rLink ) {
- delete *it;
- mpIdleList->erase( it );
+ ImplIdleData* pIdleData = mpIdleList->First();
+ while ( pIdleData )
+ {
+ if ( pIdleData->maIdleHdl == rLink )
+ {
+ mpIdleList->Remove();
+ delete pIdleData;
break;
}
+
+ pIdleData = mpIdleList->Next();
}
// keine Handdler mehr da
- if ( mpIdleList->empty() )
+ if ( !mpIdleList->Count() )
maTimer.Stop();
}
@@ -121,19 +132,19 @@ void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
IMPL_LINK( ImplIdleMgr, TimeoutHdl, Timer*, EMPTYARG )
{
- for ( size_t i = 0; i < mpIdleList->size(); ++i ) {
- ImplIdleData* pIdleData = (*mpIdleList)[ i ];
- if ( !pIdleData->mbTimeout ) {
- pIdleData->mbTimeout = sal_True;
+ ImplIdleData* pIdleData = mpIdleList->First();
+ while ( pIdleData )
+ {
+ if ( !pIdleData->mbTimeout )
+ {
+ pIdleData->mbTimeout = 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 = sal_False;
- break;
- }
- }
+ // Kann im Handler entfernt worden sein
+ if ( mpIdleList->GetPos( pIdleData ) != LIST_ENTRY_NOTFOUND )
+ pIdleData->mbTimeout = FALSE;
}
+
+ pIdleData = mpIdleList->Next();
}
return 0;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 8cbd1d816f8c..78de44aae9c8 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,6 +39,7 @@
#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
@@ -74,29 +75,6 @@ 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()
{
}
@@ -117,10 +95,10 @@ SalPrinter::~SalPrinter()
{
}
-sal_Bool SalPrinter::StartJob( const String*, const String&, const String&,
+BOOL SalPrinter::StartJob( const String*, const String&, const String&,
ImplJobSetup*, vcl::PrinterController& )
{
- return sal_False;
+ return FALSE;
}
SalInfoPrinter::~SalInfoPrinter()
@@ -139,7 +117,7 @@ SalMenu::~SalMenu()
{
}
-bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, sal_uLong )
+bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, ULONG )
{
return false;
}
@@ -149,11 +127,11 @@ bool SalMenu::AddMenuBarButton( const SalMenuButtonItem& )
return false;
}
-void SalMenu::RemoveMenuBarButton( sal_uInt16 )
+void SalMenu::RemoveMenuBarButton( USHORT )
{
}
-Rectangle SalMenu::GetMenuBarButtonRectPixel( sal_uInt16, SalFrame* )
+Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
{
return Rectangle();
}
@@ -161,5 +139,8 @@ Rectangle SalMenu::GetMenuBarButtonRectPixel( sal_uInt16, 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 89aaf9026312..c3a36fb1c537 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,17 +40,10 @@
#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;
-
-using ::rtl::OUString;
+using namespace rtl;
SalSession::~SalSession()
{
@@ -60,12 +53,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
{
struct Listener
{
- css::uno::Reference< XSessionManagerListener > m_xListener;
- bool m_bInteractionRequested;
- bool m_bInteractionDone;
- bool m_bSaveDone;
+ Reference< XSessionManagerListener > m_xListener;
+ bool m_bInteractionRequested;
+ bool m_bInteractionDone;
+ bool m_bSaveDone;
- Listener( const css::uno::Reference< XSessionManagerListener >& xListener )
+ Listener( const Reference< XSessionManagerListener >& xListener )
: m_xListener( xListener ),
m_bInteractionRequested( false ),
m_bInteractionDone( false ),
@@ -73,13 +66,13 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
{}
};
- std::list< Listener > m_aListeners;
- SalSession* m_pSession;
- osl::Mutex m_aMutex;
- bool m_bInteractionRequested;
- bool m_bInteractionGranted;
- bool m_bInteractionDone;
- bool m_bSaveDone;
+ std::list< Listener > m_aListeners;
+ SalSession* m_pSession;
+ osl::Mutex m_aMutex;
+ bool m_bInteractionRequested;
+ bool m_bInteractionGranted;
+ bool m_bInteractionDone;
+ bool m_bSaveDone;
static void SalSessionEventProc( SalSessionEvent* pEvent );
static VCLSession* pOneInstance;
@@ -91,12 +84,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
public:
VCLSession();
virtual ~VCLSession();
-
- 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 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 sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException );
};
@@ -143,7 +136,7 @@ void VCLSession::callSaveRequested( bool bShutdown, bool bCancelable )
// without session we assume UI is always possible,
// so it was reqeusted and granted
m_bInteractionRequested = m_bInteractionGranted = m_pSession ? false : true;
-
+
// answer the session manager even if no listeners available anymore
DBG_ASSERT( ! aListeners.empty(), "saveRequested but no listeners !" );
if( aListeners.empty() )
@@ -154,7 +147,7 @@ void VCLSession::callSaveRequested( bool bShutdown, bool bCancelable )
}
}
- sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
+ 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 );
@@ -182,10 +175,10 @@ void VCLSession::callInteractionGranted( bool bInteractionGranted )
}
}
- sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
+ ULONG nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->approveInteraction( bInteractionGranted );
-
+
Application::AcquireSolarMutex( nAcquireCount );
}
@@ -200,7 +193,7 @@ void VCLSession::callShutdownCancelled()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
+ ULONG nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->shutdownCanceled();
Application::AcquireSolarMutex( nAcquireCount );
@@ -217,10 +210,10 @@ void VCLSession::callQuit()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
+ ULONG nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
{
- css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
+ Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
if( xListener2.is() )
xListener2->doQuit();
}
@@ -252,14 +245,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
}
}
-void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::addSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
-
+
m_aListeners.push_back( Listener( xListener ) );
}
-void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -273,10 +266,10 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Referenc
}
else
++it;
- }
+ }
}
-void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
if( m_bInteractionGranted )
{
@@ -297,13 +290,13 @@ void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionMa
{
if( it->m_xListener == xListener )
{
- it->m_bInteractionRequested = true;
- it->m_bInteractionDone = false;
+ it->m_bInteractionRequested = true;
+ it->m_bInteractionDone = false;
}
}
}
-void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
int nRequested = 0, nDone = 0;
@@ -326,7 +319,7 @@ void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionMa
}
}
-void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -367,13 +360,13 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
return aRet;
}
-css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
+Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
{
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->xSMClient.is() )
pSVData->xSMClient = new VCLSession();
-
- return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
+
+ return 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 75fd77bbaf73..ddcaf0d6bbaf 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
#include "tools/debug.hxx"
#include "i18npool/mslangid.hxx"
#include "vcl/svapp.hxx"
@@ -48,7 +47,14 @@
#include "unotools/confignode.hxx"
#include <unotools/syslocaleoptions.hxx>
-using ::rtl::OUString;
+#ifdef WNT
+#include "tools/prewin.h"
+#include <windows.h>
+#include "tools/postwin.h"
+#endif
+
+using namespace rtl;
+
// =======================================================================
DBG_NAME( AllSettings )
@@ -144,18 +150,18 @@ void MachineSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool MachineSettings::operator ==( const MachineSettings& rSet ) const
+BOOL MachineSettings::operator ==( const MachineSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnScreenOptions == rSet.mpData->mnScreenOptions) &&
(mpData->mnPrintOptions == rSet.mpData->mnPrintOptions) &&
(mpData->mnScreenRasterFontDeviation == rSet.mpData->mnScreenRasterFontDeviation) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -175,7 +181,7 @@ ImplMouseData::ImplMouseData()
mnDragLinkCode = KEY_SHIFT | KEY_MOD1;
mnContextMenuCode = MOUSE_RIGHT;
mnContextMenuClicks = 1;
- mbContextMenuDown = sal_True;
+ mbContextMenuDown = TRUE;
mnMiddleButtonAction = MOUSE_MIDDLE_AUTOSCROLL;
mnScrollRepeat = 100;
mnButtonStartRepeat = 370;
@@ -277,10 +283,10 @@ void MouseSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
+BOOL MouseSettings::operator ==( const MouseSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnDoubleClkTime == rSet.mpData->mnDoubleClkTime) &&
@@ -303,9 +309,9 @@ sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
(mpData->mnMenuDelay == rSet.mpData->mnMenuDelay) &&
(mpData->mnFollow == rSet.mpData->mnFollow) &&
(mpData->mnWheelBehavior == rSet.mpData->mnWheelBehavior ) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -387,15 +393,15 @@ void KeyboardSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
+BOOL KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -414,20 +420,21 @@ ImplStyleData::ImplStyleData()
mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME;
mnScreenZoom = 100;
mnScreenFontZoom = 100;
+ mnRadioButtonStyle = 0;
+ mnCheckBoxStyle = 0;
+ mnPushButtonStyle = 0;
+ mnTabControlStyle = 0;
mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME;
- mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE |
- DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE |
- DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT |
- DRAGFULL_OPTION_SCROLL;
+ mnDragFullOptions = 0;
mnAnimationOptions = 0;
mnSelectionOptions = 0;
mnDisplayOptions = 0;
mnOptions = 0;
- mnAutoMnemonic = 1;
- mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
- mnSymbolsStyle = STYLE_SYMBOLS_AUTO;
- mnUseImagesInMenus = STYLE_MENUIMAGES_AUTO;
- mnPreferredSymbolsStyle = STYLE_SYMBOLS_AUTO;
+ mnAutoMnemonic = 1;
+ mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
+ mnSymbolsStyle = STYLE_SYMBOLS_AUTO;
+ mnUseImagesInMenus = STYLE_MENUIMAGES_AUTO;
+ mnPreferredSymbolsStyle = STYLE_SYMBOLS_AUTO;
mpFontOptions = NULL;
SetStandardStyles();
@@ -515,23 +522,27 @@ 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;
mnSelectionOptions = rData.mnSelectionOptions;
mnDisplayOptions = rData.mnDisplayOptions;
mnOptions = rData.mnOptions;
- mnHighContrast = rData.mnHighContrast;
- mnUseSystemUIFonts = rData.mnUseSystemUIFonts;
- mnUseFlatBorders = rData.mnUseFlatBorders;
- mnUseFlatMenues = rData.mnUseFlatMenues;
- mnAutoMnemonic = rData.mnAutoMnemonic;
- mnUseImagesInMenus = rData.mnUseImagesInMenus;
- mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
- mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus;
- mnToolbarIconSize = rData.mnToolbarIconSize;
- mnSymbolsStyle = rData.mnSymbolsStyle;
- mnPreferredSymbolsStyle = rData.mnPreferredSymbolsStyle;
+ mnHighContrast = rData.mnHighContrast;
+ mnUseSystemUIFonts = rData.mnUseSystemUIFonts;
+ mnUseFlatBorders = rData.mnUseFlatBorders;
+ mnUseFlatMenues = rData.mnUseFlatMenues;
+ mnAutoMnemonic = rData.mnAutoMnemonic;
+ mnUseImagesInMenus = rData.mnUseImagesInMenus;
+ mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
+ mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus;
+ mnToolbarIconSize = rData.mnToolbarIconSize;
+ mnSymbolsStyle = rData.mnSymbolsStyle;
+ mnPreferredSymbolsStyle = rData.mnPreferredSymbolsStyle;
mpFontOptions = rData.mpFontOptions;
}
@@ -604,19 +615,25 @@ void ImplStyleData::SetStandardStyles()
maLinkColor = Color( COL_BLUE );
maVisitedLinkColor = Color( 0x00, 0x00, 0xCC );
maHighlightLinkColor = Color( COL_LIGHTBLUE );
- maFontColor = Color( COL_BLACK );
+ 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;
mnTearOffTitleHeight = 8;
mnMenuBarHeight = 14;
- mnHighContrast = 0;
- mnUseSystemUIFonts = 1;
- mnUseFlatBorders = 0;
- mnUseFlatMenues = 0;
- mbPreferredUseImagesInMenus = sal_True;
- mnSkipDisabledInMenus = (sal_uInt16)sal_False;
+ mnHighContrast = 0;
+ mnUseSystemUIFonts = 1;
+ mnUseFlatBorders = 0;
+ mnUseFlatMenues = 0;
+ mbPreferredUseImagesInMenus = TRUE;
+ mnSkipDisabledInMenus = (USHORT)FALSE;
Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
maWorkspaceGradient = Wallpaper( aGrad );
@@ -666,13 +683,13 @@ void StyleSettings::Set3DColors( const Color& rColor )
mpData->maShadowColor = rColor;
mpData->maLightColor.IncreaseLuminance( 64 );
mpData->maShadowColor.DecreaseLuminance( 64 );
- 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) );
+ 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) );
}
else
{
@@ -684,7 +701,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-::rtl::OUString StyleSettings::ImplSymbolsStyleToName( sal_uLong nStyle ) const
+::rtl::OUString StyleSettings::ImplSymbolsStyleToName( ULONG nStyle ) const
{
switch ( nStyle )
{
@@ -703,7 +720,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-sal_uLong StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
+ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
{
if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default")) )
return STYLE_SYMBOLS_DEFAULT;
@@ -747,22 +764,22 @@ void StyleSettings::SetPreferredSymbolsStyleName( const ::rtl::OUString &rName )
// -----------------------------------------------------------------------
-sal_uLong StyleSettings::GetCurrentSymbolsStyle() const
+ULONG StyleSettings::GetCurrentSymbolsStyle() const
{
// style selected in Tools -> Options... -> OpenOffice.org -> View
- sal_uLong nStyle = GetSymbolsStyle();
+ 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
- sal_uLong nPreferredStyle = GetPreferredSymbolsStyle();
+ 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 sal_uLong snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
+ static ULONG snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
if ( !sbFallbackDesktopChecked )
{
@@ -784,10 +801,10 @@ sal_uLong StyleSettings::GetCurrentSymbolsStyle() const
// -----------------------------------------------------------------------
-sal_uLong StyleSettings::GetAutoSymbolsStyle() const
+ULONG StyleSettings::GetAutoSymbolsStyle() const
{
const ::rtl::OUString& rDesktopEnvironment = Application::GetDesktopEnvironment();
- sal_uLong nRet = STYLE_SYMBOLS_DEFAULT;
+ ULONG nRet = STYLE_SYMBOLS_DEFAULT;
bool bCont = true;
try
@@ -818,9 +835,9 @@ sal_uLong StyleSettings::GetAutoSymbolsStyle() const
// falback to any existing style
if ( ! CheckSymbolStyle (nRet) )
{
- for ( sal_uLong n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
+ for ( ULONG n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
{
- sal_uLong nStyleToCheck = n;
+ ULONG nStyleToCheck = n;
// auto is not a real theme => can't be fallback
if ( nStyleToCheck == STYLE_SYMBOLS_AUTO )
@@ -845,7 +862,7 @@ sal_uLong StyleSettings::GetAutoSymbolsStyle() const
// -----------------------------------------------------------------------
-bool StyleSettings::CheckSymbolStyle( sal_uLong nStyle ) const
+bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
{
if ( nStyle == STYLE_SYMBOLS_INDUSTRIAL )
return false; // industrial is dead
@@ -856,15 +873,15 @@ bool StyleSettings::CheckSymbolStyle( sal_uLong nStyle ) const
// -----------------------------------------------------------------------
-sal_Bool StyleSettings::GetUseImagesInMenus() const
+BOOL StyleSettings::GetUseImagesInMenus() const
{
// icon mode selected in Tools -> Options... -> OpenOffice.org -> View
- sal_uInt16 nStyle = mpData->mnUseImagesInMenus;
+ USHORT nStyle = mpData->mnUseImagesInMenus;
if ( nStyle == STYLE_MENUIMAGES_AUTO )
return GetPreferredUseImagesInMenus();
- return (sal_Bool)nStyle;
+ return (BOOL)nStyle;
}
// -----------------------------------------------------------------------
@@ -877,12 +894,40 @@ 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)
- sal_uInt16 h, s, b;
+ USHORT h, s, b;
GetFaceColor().RGBtoHSB( h, s, b );
if( s > 1) s=1;
if( b < 98) b=98;
@@ -894,7 +939,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)
- sal_uInt16 h, s, b;
+ USHORT h, s, b;
GetShadowColor().RGBtoHSB( h, s, b );
b += b/4;
s -= s/4;
@@ -935,15 +980,15 @@ void StyleSettings::CopyData()
// -----------------------------------------------------------------------
-inline sal_Bool ImplIsBackOrWhite( const Color& rColor )
+inline BOOL ImplIsBackOrWhite( const Color& rColor )
{
- sal_uInt8 nLuminance = rColor.GetLuminance();
+ UINT8 nLuminance = rColor.GetLuminance();
return ( nLuminance < 8 ) || ( nLuminance > 250 );
}
-sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const
+BOOL StyleSettings::IsHighContrastBlackAndWhite() const
{
- sal_Bool bBWOnly = sal_True;
+ BOOL bBWOnly = 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,
@@ -952,44 +997,44 @@ sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const
// Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000)
if ( !ImplIsBackOrWhite( GetFaceColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetWindowColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetDialogColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetFieldColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetMenuColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) )
- bBWOnly = sal_False;
+ bBWOnly = FALSE;
return bBWOnly;
}
// -----------------------------------------------------------------------
-sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
+BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
- (mpData->mnAutoMnemonic == rSet.mpData->mnAutoMnemonic) &&
+ (mpData->mnAutoMnemonic == rSet.mpData->mnAutoMnemonic) &&
(mpData->mnLogoDisplayTime == rSet.mpData->mnLogoDisplayTime) &&
(mpData->mnDragFullOptions == rSet.mpData->mnDragFullOptions) &&
(mpData->mnAnimationOptions == rSet.mpData->mnAnimationOptions) &&
@@ -1011,12 +1056,14 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnAntialiasedMin == rSet.mpData->mnAntialiasedMin) &&
(mpData->mnScreenZoom == rSet.mpData->mnScreenZoom) &&
(mpData->mnScreenFontZoom == rSet.mpData->mnScreenFontZoom) &&
- (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->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->maFaceColor == rSet.mpData->maFaceColor) &&
(mpData->maCheckedColor == rSet.mpData->maCheckedColor) &&
(mpData->maLightColor == rSet.mpData->maLightColor) &&
@@ -1073,14 +1120,14 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maRadioCheckFont == rSet.mpData->maRadioCheckFont) &&
(mpData->maPushButtonFont == rSet.mpData->maPushButtonFont) &&
(mpData->maFieldFont == rSet.mpData->maFieldFont) &&
- (mpData->maIconFont == rSet.mpData->maIconFont) &&
- (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
+ (mpData->maIconFont == rSet.mpData->maIconFont) &&
+ (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
(mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
- (mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
- (mpData->maFontColor == rSet.mpData->maFontColor ))
- return sal_True;
+ (mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
+ (mpData->maFontColor == rSet.mpData->maFontColor ))
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -1088,10 +1135,10 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
ImplMiscData::ImplMiscData()
{
mnRefCount = 1;
- mnEnableATT = sal::static_int_cast<sal_uInt16>(~0U);
- mnDisablePrinting = sal::static_int_cast<sal_uInt16>(~0U);
+ mnEnableATT = sal::static_int_cast<USHORT>(~0U);
+ mnDisablePrinting = sal::static_int_cast<USHORT>(~0U);
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
- mbEnableLocalizedDecimalSep = (pEnv != NULL) ? sal_True : sal_False;
+ mbEnableLocalizedDecimalSep = (pEnv != NULL) ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
@@ -1099,8 +1146,8 @@ ImplMiscData::ImplMiscData()
ImplMiscData::ImplMiscData( const ImplMiscData& rData )
{
mnRefCount = 1;
- mnEnableATT = rData.mnEnableATT;
- mnDisablePrinting = rData.mnDisablePrinting;
+ mnEnableATT = rData.mnEnableATT;
+ mnDisablePrinting = rData.mnDisablePrinting;
mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep;
}
@@ -1167,24 +1214,24 @@ void MiscSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool MiscSettings::operator ==( const MiscSettings& rSet ) const
+BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
- if ( (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
- (mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) &&
+ if ( (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
+ (mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) &&
(mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool MiscSettings::GetDisablePrinting() const
+BOOL MiscSettings::GetDisablePrinting() const
{
- if( mpData->mnDisablePrinting == (sal_uInt16)~0 )
+ if( mpData->mnDisablePrinting == (USHORT)~0 )
{
rtl::OUString aEnable =
vcl::SettingsConfigItem::get()->
@@ -1193,15 +1240,15 @@ sal_Bool MiscSettings::GetDisablePrinting() const
mpData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (sal_Bool)mpData->mnDisablePrinting;
+ return (BOOL)mpData->mnDisablePrinting;
}
// -----------------------------------------------------------------------
-sal_Bool MiscSettings::GetEnableATToolSupport() const
+BOOL MiscSettings::GetEnableATToolSupport() const
{
#ifdef WNT
- if( mpData->mnEnableATT == (sal_uInt16)~0 )
+ if( mpData->mnEnableATT == (USHORT)~0 )
{
// Check in the Windows registry if an AT tool wants Accessibility support to
// be activated ..
@@ -1212,7 +1259,7 @@ sal_Bool MiscSettings::GetEnableATToolSupport() const
&hkey) )
{
DWORD dwType;
- sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
@@ -1224,7 +1271,7 @@ sal_Bool MiscSettings::GetEnableATToolSupport() const
mpData->mnEnableATT = ((0 == stricmp((const char *) Data, "1")) || (0 == stricmp((const char *) Data, "true")));
break;
case REG_DWORD:
- mpData->mnEnableATT = (sal_uInt16) (((DWORD *) Data)[0]);
+ mpData->mnEnableATT = (USHORT) (((DWORD *) Data)[0]);
break;
default:
// Unsupported registry type
@@ -1237,7 +1284,7 @@ sal_Bool MiscSettings::GetEnableATToolSupport() const
}
#endif
- if( mpData->mnEnableATT == (sal_uInt16)~0 )
+ if( mpData->mnEnableATT == (USHORT)~0 )
{
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( !pEnv || !*pEnv )
@@ -1254,30 +1301,30 @@ sal_Bool MiscSettings::GetEnableATToolSupport() const
}
}
- return (sal_Bool)mpData->mnEnableATT;
+ return (BOOL)mpData->mnEnableATT;
}
// -----------------------------------------------------------------------
-void MiscSettings::SetDisablePrinting( sal_Bool bEnable )
+void MiscSettings::SetDisablePrinting( BOOL bEnable )
{
if ( bEnable != mpData->mnDisablePrinting )
{
vcl::SettingsConfigItem::get()->
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DesktopManagement" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisablePrinting" ) ),
- bEnable ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false" )) );
+ rtl::OUString::createFromAscii( bEnable ? "true" : "false" ) );
mpData->mnDisablePrinting = bEnable ? 1 : 0;
}
}
// -----------------------------------------------------------------------
-void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
+void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
{
if ( bEnable != mpData->mnEnableATT )
{
- sal_Bool bDummy;
+ BOOL bDummy;
if( bEnable && !ImplInitAccessBridge(false, bDummy) )
return;
@@ -1290,24 +1337,24 @@ void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
&hkey) )
{
DWORD dwType;
- sal_uInt8 Data[6]; // possible values: "true", "false", 1, 0
+ WIN_BYTE Data[6]; // possible values: "true", "false", 1, 0
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
- NULL, &dwType, Data, &cbData) )
+ NULL, &dwType, Data, &cbData) )
{
switch (dwType)
{
case REG_SZ:
RegSetValueEx(hkey, "SupportAssistiveTechnology",
NULL, dwType,
- bEnable ? (sal_uInt8 *) "true" : (sal_uInt8 *) "false",
+ bEnable ? (WIN_BYTE *) "true" : (WIN_BYTE *) "false",
bEnable ? sizeof("true") : sizeof("false"));
break;
case REG_DWORD:
((DWORD *) Data)[0] = bEnable ? 1 : 0;
RegSetValueEx(hkey, "SupportAssistiveTechnology",
- NULL, dwType, Data, sizeof(DWORD));
+ NULL, dwType, Data, sizeof(DWORD));
break;
default:
// Unsupported registry type
@@ -1322,18 +1369,18 @@ void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
vcl::SettingsConfigItem::get()->
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Accessibility" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableATToolSupport" ) ),
- bEnable ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false" )) );
+ rtl::OUString::createFromAscii( bEnable ? "true" : "false" ) );
mpData->mnEnableATT = bEnable ? 1 : 0;
}
}
-void MiscSettings::SetEnableLocalizedDecimalSep( sal_Bool bEnable )
+void MiscSettings::SetEnableLocalizedDecimalSep( BOOL bEnable )
{
CopyData();
mpData->mbEnableLocalizedDecimalSep = bEnable;
}
-sal_Bool MiscSettings::GetEnableLocalizedDecimalSep() const
+BOOL MiscSettings::GetEnableLocalizedDecimalSep() const
{
return mpData->mbEnableLocalizedDecimalSep;
}
@@ -1417,15 +1464,15 @@ void NotificationSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool NotificationSettings::operator ==( const NotificationSettings& rSet ) const
+BOOL NotificationSettings::operator ==( const NotificationSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -1513,18 +1560,18 @@ void HelpSettings::CopyData()
// -----------------------------------------------------------------------
-sal_Bool HelpSettings::operator ==( const HelpSettings& rSet ) const
+BOOL HelpSettings::operator ==( const HelpSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->mnOptions == rSet.mpData->mnOptions ) &&
(mpData->mnTipDelay == rSet.mpData->mnTipDelay ) &&
(mpData->mnTipTimeout == rSet.mpData->mnTipTimeout ) &&
(mpData->mnBalloonDelay == rSet.mpData->mnBalloonDelay ) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -1538,6 +1585,8 @@ ImplAllSettingsData::ImplAllSettingsData()
meUILanguage = LANGUAGE_SYSTEM;
mpLocaleDataWrapper = NULL;
mpUILocaleDataWrapper = NULL;
+ mpCollatorWrapper = NULL;
+ mpUICollatorWrapper = NULL;
mpI18nHelper = NULL;
mpUII18nHelper = NULL;
maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() );
@@ -1563,6 +1612,8 @@ ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
// called
mpLocaleDataWrapper = NULL;
mpUILocaleDataWrapper = NULL;
+ mpCollatorWrapper = NULL;
+ mpUICollatorWrapper = NULL;
mpI18nHelper = NULL;
mpUII18nHelper = NULL;
}
@@ -1575,6 +1626,10 @@ ImplAllSettingsData::~ImplAllSettingsData()
delete mpLocaleDataWrapper;
if ( mpUILocaleDataWrapper )
delete mpUILocaleDataWrapper;
+ if ( mpCollatorWrapper )
+ delete mpCollatorWrapper;
+ if ( mpUICollatorWrapper )
+ delete mpUICollatorWrapper;
if ( mpI18nHelper )
delete mpI18nHelper;
if ( mpUII18nHelper )
@@ -1653,12 +1708,12 @@ void AllSettings::CopyData()
// -----------------------------------------------------------------------
-sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
+ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- sal_uLong nChangeFlags = 0;
+ ULONG nChangeFlags = 0;
if ( nFlags & SETTINGS_MACHINE )
{
@@ -1755,12 +1810,12 @@ sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
// -----------------------------------------------------------------------
-sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
+ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- sal_uLong nChangeFlags = 0;
+ ULONG nChangeFlags = 0;
if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
nChangeFlags |= SETTINGS_MACHINE;
@@ -1791,13 +1846,13 @@ sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
// -----------------------------------------------------------------------
-sal_Bool AllSettings::operator ==( const AllSettings& rSet ) const
+BOOL AllSettings::operator ==( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
if ( mpData == rSet.mpData )
- return sal_True;
+ return TRUE;
if ( (mpData->maMachineSettings == rSet.mpData->maMachineSettings) &&
(mpData->maMouseSettings == rSet.mpData->maMouseSettings) &&
@@ -1807,13 +1862,13 @@ sal_Bool AllSettings::operator ==( const AllSettings& rSet ) const
(mpData->maNotificationSettings == rSet.mpData->maNotificationSettings) &&
(mpData->maHelpSettings == rSet.mpData->maHelpSettings) &&
(mpData->mnSystemUpdate == rSet.mpData->mnSystemUpdate) &&
- (mpData->maLocale == rSet.mpData->maLocale) &&
+ (mpData->maLocale == rSet.mpData->maLocale) &&
(mpData->mnWindowUpdate == rSet.mpData->mnWindowUpdate) )
{
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1879,7 +1934,7 @@ void AllSettings::SetUILanguage( LanguageType )
// -----------------------------------------------------------------------
-sal_Bool AllSettings::GetLayoutRTL() const
+BOOL AllSettings::GetLayoutRTL() const
{
static const char* pEnv = getenv("SAL_RTL_ENABLED" );
static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
@@ -1888,7 +1943,7 @@ sal_Bool AllSettings::GetLayoutRTL() const
if( pEnv )
return true;
- sal_Bool bRTL = sal_False;
+ BOOL bRTL = FALSE;
if( nUIMirroring == -1 )
{
@@ -1898,7 +1953,7 @@ sal_Bool AllSettings::GetLayoutRTL() const
OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/I18N/CTL")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
- sal_Bool bTmp = sal_Bool();
+ BOOL bTmp = BOOL();
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("UIMirroring")) );
if( aValue >>= bTmp )
{
@@ -2002,13 +2057,39 @@ const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
return *mpData->mpUII18nHelper;
}
+
+// -----------------------------------------------------------------------
+/*
+const CollatorWrapper& AllSettings::GetCollatorWrapper() const
+{
+ if ( !mpData->mpCollatorWrapper )
+ {
+ ((AllSettings*)this)->mpData->mpCollatorWrapper = new CollatorWrapper( vcl::unohelper::GetMultiServiceFactory() );
+ ((AllSettings*)this)->mpData->mpCollatorWrapper->loadDefaultCollator( GetLocale(), 0 );
+ }
+ return *mpData->mpCollatorWrapper;
+}
+*/
+// -----------------------------------------------------------------------
+/*
+const CollatorWrapper& AllSettings::GetUICollatorWrapper() const
+{
+ if ( !mpData->mpUICollatorWrapper )
+ {
+ ((AllSettings*)this)->mpData->mpUICollatorWrapper = new CollatorWrapper( vcl::unohelper::GetMultiServiceFactory() );
+ ((AllSettings*)this)->mpData->mpUICollatorWrapper->loadDefaultCollator( GetUILocale(), 0 );
+ }
+ return *mpData->mpUICollatorWrapper;
+}
+*/
+
void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
{
AllSettings aAllSettings( Application::GetSettings() );
if ( nHint & SYSLOCALEOPTIONS_HINT_DECSEP )
{
MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
- sal_Bool bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
+ 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 13f832339977..30ecf5c3a3a4 100644
--- a/vcl/source/app/sound.cxx
+++ b/vcl/source/app/sound.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,6 @@
#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>
@@ -43,10 +42,6 @@
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 3fc2e67cc488..ba8d69abbd3e 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@
// =======================================================================
-XubString GetStandardText( sal_uInt16 nStdText )
+XubString GetStandardText( USHORT nStdText )
{
ResMgr* pResMgr = ImplGetResMgr();
XubString aText;
@@ -50,7 +50,7 @@ XubString GetStandardText( sal_uInt16 nStdText )
// =======================================================================
void ShowServiceNotAvailableError( Window* pParent,
- const XubString& rServiceName, sal_Bool bError )
+ const XubString& rServiceName, 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 e4cf7bf32330..b86477f32fb4 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,6 +44,7 @@
#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"
@@ -81,12 +82,12 @@ using namespace ::com::sun::star::uno;
class ImplReservedKey
{
public:
- ImplReservedKey( KeyCode aKeyCode, sal_uInt16 nResId ) :
+ ImplReservedKey( KeyCode aKeyCode, USHORT nResId ) :
mKeyCode(aKeyCode), mnResId( nResId)
{}
KeyCode mKeyCode;
- sal_uInt16 mnResId;
+ USHORT mnResId;
};
typedef std::pair<ImplReservedKey*, size_t> ReservedKeys;
@@ -182,16 +183,16 @@ struct ImplEventHook
struct ImplPostEventData
{
- sal_uLong mnEvent;
- const Window* mpWin;
- sal_uLong mnEventId;
- KeyEvent maKeyEvent;
- MouseEvent maMouseEvent;
-
+ ULONG mnEvent;
+ const Window* mpWin;
+ ULONG mnEventId;
+ KeyEvent maKeyEvent;
+ MouseEvent maMouseEvent;
+
- ImplPostEventData( sal_uLong nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
+ ImplPostEventData( ULONG nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maKeyEvent( rKeyEvent ) {}
- ImplPostEventData( sal_uLong nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
+ ImplPostEventData( ULONG nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maMouseEvent( rMouseEvent ) {}
~ImplPostEventData() {}
@@ -240,7 +241,7 @@ void Application::InitAppRes( const ResId& )
// -----------------------------------------------------------------------
-sal_Bool Application::QueryExit()
+BOOL Application::QueryExit()
{
WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
@@ -248,12 +249,12 @@ sal_Bool Application::QueryExit()
if ( pAppWin )
return pAppWin->Close();
else
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-void Application::UserEvent( sal_uLong, void* )
+void Application::UserEvent( ULONG, void* )
{
}
@@ -265,6 +266,12 @@ void Application::ShowStatusText( const XubString& )
// -----------------------------------------------------------------------
+void Application::ShowHelpStatusText( const XubString& )
+{
+}
+
+// -----------------------------------------------------------------------
+
void Application::ActivateExtHelp()
{
}
@@ -283,6 +290,12 @@ void Application::HideStatusText()
// -----------------------------------------------------------------------
+void Application::HideHelpStatusText()
+{
+}
+
+// -----------------------------------------------------------------------
+
void Application::FocusChanged()
{
}
@@ -318,7 +331,7 @@ sal_uInt16 Application::GetCommandLineParamCount()
// -----------------------------------------------------------------------
-XubString Application::GetCommandLineParam( sal_uInt16 nParam )
+XubString Application::GetCommandLineParam( USHORT nParam )
{
rtl::OUString aParam;
osl_getCommandArg( nParam, &aParam.pData );
@@ -355,7 +368,7 @@ const XubString& Application::GetAppFileName()
// -----------------------------------------------------------------------
-sal_uInt16 Application::Exception( sal_uInt16 nError )
+USHORT Application::Exception( USHORT nError )
{
switch ( nError & EXC_MAJORTYPE )
{
@@ -397,12 +410,12 @@ void Application::Abort( const XubString& rErrorText )
// -----------------------------------------------------------------------
-sal_uLong Application::GetReservedKeyCodeCount()
+ULONG Application::GetReservedKeyCodeCount()
{
return ImplReservedKeys::get()->second;
}
-const KeyCode* Application::GetReservedKeyCode( sal_uLong i )
+const KeyCode* Application::GetReservedKeyCode( ULONG i )
{
if( i >= GetReservedKeyCodeCount() )
return NULL;
@@ -410,7 +423,7 @@ const KeyCode* Application::GetReservedKeyCode( sal_uLong i )
return &ImplReservedKeys::get()->first[i].mKeyCode;
}
-String Application::GetReservedKeyCodeDescription( sal_uLong i )
+String Application::GetReservedKeyCodeDescription( ULONG i )
{
ResMgr* pResMgr = ImplGetResMgr();
if( ! pResMgr )
@@ -429,12 +442,12 @@ void Application::Execute()
DBG_STARTAPPEXECUTE();
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maAppData.mbInAppExecute = sal_True;
+ pSVData->maAppData.mbInAppExecute = TRUE;
while ( !pSVData->maAppData.mbAppQuit )
Application::Yield();
- pSVData->maAppData.mbInAppExecute = sal_False;
+ pSVData->maAppData.mbInAppExecute = FALSE;
DBG_ENDAPPEXECUTE();
}
@@ -444,7 +457,7 @@ void Application::Execute()
inline void ImplYield( bool i_bWait, bool i_bAllEvents )
{
ImplSVData* pSVData = ImplGetSVData();
-
+
// run timers that have timed out
if ( !pSVData->mbNoCallTimer )
while ( pSVData->mbNotAllTimerCalled )
@@ -461,7 +474,7 @@ inline void ImplYield( bool i_bWait, bool i_bAllEvents )
// flush lazy deleted objects
if( pSVData->maAppData.mnDispatchLevel == 0 )
vcl::LazyDelete::flush();
-
+
// the system timer events will not necesseraly come in in non waiting mode
// e.g. on aqua; need to trigger timer checks manually
if( pSVData->maAppData.mbNoYield && !pSVData->mbNoCallTimer )
@@ -496,7 +509,7 @@ void Application::Yield( bool i_bAllEvents )
IMPL_STATIC_LINK_NOINSTANCE( ImplSVAppData, ImplQuitMsg, void*, EMPTYARG )
{
- ImplGetSVData()->maAppData.mbAppQuit = sal_True;
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
return 0;
}
@@ -524,7 +537,7 @@ oslThreadIdentifier Application::GetMainThreadIdentifier()
// -----------------------------------------------------------------------
-sal_uLong Application::ReleaseSolarMutex()
+ULONG Application::ReleaseSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return pSVData->mpDefInst->ReleaseYieldMutex();
@@ -532,7 +545,7 @@ sal_uLong Application::ReleaseSolarMutex()
// -----------------------------------------------------------------------
-void Application::AcquireSolarMutex( sal_uLong nCount )
+void Application::AcquireSolarMutex( ULONG nCount )
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpDefInst->AcquireYieldMutex( nCount );
@@ -540,56 +553,56 @@ void Application::AcquireSolarMutex( sal_uLong nCount )
// -----------------------------------------------------------------------
-sal_Bool Application::IsInMain()
+BOOL Application::IsInMain()
{
return ImplGetSVData()->maAppData.mbInAppMain;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsInExecute()
+BOOL Application::IsInExecute()
{
return ImplGetSVData()->maAppData.mbInAppExecute;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsShutDown()
+BOOL Application::IsShutDown()
{
return ImplGetSVData()->maAppData.mbAppQuit;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsInModalMode()
+BOOL Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
}
// -----------------------------------------------------------------------
-sal_uInt16 Application::GetModalModeCount()
+USHORT Application::GetModalModeCount()
{
return ImplGetSVData()->maAppData.mnModalMode;
}
// -----------------------------------------------------------------------
-sal_uInt16 Application::GetDispatchLevel()
+USHORT Application::GetDispatchLevel()
{
return ImplGetSVData()->maAppData.mnDispatchLevel;
}
// -----------------------------------------------------------------------
-sal_Bool Application::AnyInput( sal_uInt16 nType )
+BOOL Application::AnyInput( USHORT nType )
{
- return (sal_Bool)ImplGetSVData()->mpDefInst->AnyInput( nType );
+ return (BOOL)ImplGetSVData()->mpDefInst->AnyInput( nType );
}
// -----------------------------------------------------------------------
-sal_uLong Application::GetLastInputInterval()
+ULONG Application::GetLastInputInterval()
{
return (Time::GetSystemTicks()-ImplGetSVData()->maAppData.mnLastInputTime);
}
@@ -598,7 +611,7 @@ sal_uLong Application::GetLastInputInterval()
extern int nImplSysDialog;
-sal_Bool Application::IsUICaptured()
+BOOL Application::IsUICaptured()
{
ImplSVData* pSVData = ImplGetSVData();
// Wenn Mouse gecaptured, oder im TrackingModus oder im Auswahlmodus
@@ -607,37 +620,37 @@ sal_Bool Application::IsUICaptured()
// D&D aktive !!!
if ( pSVData->maWinData.mpCaptureWin || pSVData->maWinData.mpTrackWin ||
pSVData->maWinData.mpFirstFloat || nImplSysDialog )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsUserActive( sal_uInt16 nTest )
+BOOL Application::IsUserActive( USHORT nTest )
{
if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) )
{
if ( IsUICaptured() )
- return sal_True;
+ return TRUE;
}
if ( nTest & USERACTIVE_INPUT )
{
if ( GetLastInputInterval() < 500 )
- return sal_True;
+ return TRUE;
if ( AnyInput( INPUT_KEYBOARD ) )
- return sal_True;
+ return TRUE;
}
if ( nTest & USERACTIVE_MODALDIALOG )
{
if ( ImplGetSVData()->maAppData.mnModalDialog )
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -661,10 +674,10 @@ void Application::MergeSystemSettings( AllSettings& rSettings )
{
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
- pSVData->maAppData.mbSettingsInit = sal_True;
+ pSVData->maAppData.mbSettingsInit = TRUE;
}
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
- pWindow->ImplUpdateGlobalSettings( rSettings, sal_False );
+ pWindow->ImplUpdateGlobalSettings( rSettings, FALSE );
}
}
@@ -694,7 +707,7 @@ void Application::SetSettings( const AllSettings& rSettings )
{
GetSettings();
*pSVData->maAppData.mpSettings = rSettings;
- ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
+ ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
}
else
{
@@ -704,9 +717,9 @@ void Application::SetSettings( const AllSettings& rSettings )
delete pSVData->mpResMgr;
pSVData->mpResMgr = NULL;
}
- ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
+ ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
*pSVData->maAppData.mpSettings = rSettings;
- sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
+ ULONG nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
if ( nChangeFlags )
{
DataChangedEvent aDCEvt( DATACHANGED_SETTINGS, &aOldSettings, nChangeFlags );
@@ -737,7 +750,7 @@ void Application::SetSettings( const AllSettings& rSettings )
Window* pClientWin = pFrame;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, sal_True );
+ pClientWin->UpdateSettings( rSettings, TRUE );
Window* pTempWin = pFrame->mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
@@ -747,7 +760,7 @@ void Application::SetSettings( const AllSettings& rSettings )
pClientWin = pTempWin;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, sal_True );
+ pClientWin->UpdateSettings( rSettings, TRUE );
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
}
@@ -826,13 +839,14 @@ void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void Application::ImplCallEventListeners( sal_uLong nEvent, Window *pWin, void* pData )
+void Application::ImplCallEventListeners( ULONG nEvent, Window *pWin, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
VclWindowEvent aEvent( pWin, nEvent, pData );
if ( pSVData->maAppData.mpEventListeners )
- pSVData->maAppData.mpEventListeners->Call( &aEvent );
+ if ( !pSVData->maAppData.mpEventListeners->empty() )
+ pSVData->maAppData.mpEventListeners->Call( &aEvent );
}
// -----------------------------------------------------------------------
@@ -842,7 +856,8 @@ void Application::ImplCallEventListeners( VclSimpleEvent* pEvent )
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mpEventListeners )
- pSVData->maAppData.mpEventListeners->Call( pEvent );
+ if ( !pSVData->maAppData.mpEventListeners->empty() )
+ pSVData->maAppData.mpEventListeners->Call( pEvent );
}
// -----------------------------------------------------------------------
@@ -852,7 +867,7 @@ void Application::AddEventListener( const Link& rEventListener )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->maAppData.mpEventListeners )
pSVData->maAppData.mpEventListeners = new VclEventListeners;
- pSVData->maAppData.mpEventListeners->addListener( rEventListener );
+ pSVData->maAppData.mpEventListeners->push_back( rEventListener );
}
// -----------------------------------------------------------------------
@@ -861,7 +876,7 @@ void Application::RemoveEventListener( const Link& rEventListener )
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->maAppData.mpEventListeners )
- pSVData->maAppData.mpEventListeners->removeListener( rEventListener );
+ pSVData->maAppData.mpEventListeners->remove( rEventListener );
}
// -----------------------------------------------------------------------
@@ -870,7 +885,7 @@ void Application::AddKeyListener( const Link& rKeyListener )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->maAppData.mpKeyListeners )
pSVData->maAppData.mpKeyListeners = new VclEventListeners;
- pSVData->maAppData.mpKeyListeners->addListener( rKeyListener );
+ pSVData->maAppData.mpKeyListeners->push_back( rKeyListener );
}
// -----------------------------------------------------------------------
@@ -879,45 +894,46 @@ void Application::RemoveKeyListener( const Link& rKeyListener )
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->maAppData.mpKeyListeners )
- pSVData->maAppData.mpKeyListeners->removeListener( rKeyListener );
+ pSVData->maAppData.mpKeyListeners->remove( rKeyListener );
}
// -----------------------------------------------------------------------
-sal_Bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
+BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
// let listeners process the key event
VclWindowEvent aEvent( pWin, nEvent, (void *) pKeyEvent );
ImplSVData* pSVData = ImplGetSVData();
- sal_Bool bProcessed = sal_False;
+ BOOL bProcessed = FALSE;
if ( pSVData->maAppData.mpKeyListeners )
- bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
+ if ( !pSVData->maAppData.mpKeyListeners->empty() )
+ bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
return bProcessed;
}
// -----------------------------------------------------------------------------
-sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
+ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
const SolarMutexGuard aGuard;
- sal_uLong nEventId = 0;
-
+ ULONG nEventId = 0;
+
if( pWin && pKeyEvent )
{
ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, *pKeyEvent );
-
+
PostUserEvent( nEventId,
STATIC_LINK( NULL, Application, PostEventHandler ),
pPostEventData );
-
+
if( nEventId )
{
pPostEventData->mnEventId = nEventId;
aPostedEventList.push_back( ImplPostEventPair( pWin, pPostEventData ) );
- }
+ }
else
delete pPostEventData;
}
@@ -927,32 +943,32 @@ sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* p
// -----------------------------------------------------------------------------
-sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
+ULONG Application::PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent )
{
const SolarMutexGuard aGuard;
- sal_uLong nEventId = 0;
-
+ ULONG nEventId = 0;
+
if( pWin && pMouseEvent )
{
Point aTransformedPos( pMouseEvent->GetPosPixel() );
-
+
aTransformedPos.X() += pWin->mnOutOffX;
aTransformedPos.Y() += pWin->mnOutOffY;
-
+
const MouseEvent aTransformedEvent( aTransformedPos, pMouseEvent->GetClicks(), pMouseEvent->GetMode(),
pMouseEvent->GetButtons(), pMouseEvent->GetModifier() );
ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, aTransformedEvent );
-
+
PostUserEvent( nEventId,
STATIC_LINK( NULL, Application, PostEventHandler ),
pPostEventData );
-
+
if( nEventId )
{
pPostEventData->mnEventId = nEventId;
aPostedEventList.push_back( ImplPostEventPair( pWin, pPostEventData ) );
- }
+ }
else
delete pPostEventData;
}
@@ -965,35 +981,35 @@ sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEven
IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
{
const SolarMutexGuard aGuard;
- ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
- const void* pEventData;
- sal_uLong nEvent;
- const sal_uLong nEventId = pData->mnEventId;
-
+ ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
+ const void* pEventData;
+ ULONG nEvent;
+ const ULONG nEventId = pData->mnEventId;
+
switch( pData->mnEvent )
{
- case VCLEVENT_WINDOW_MOUSEMOVE:
+ case VCLEVENT_WINDOW_MOUSEMOVE:
nEvent = SALEVENT_EXTERNALMOUSEMOVE;
- pEventData = &pData->maMouseEvent;
+ pEventData = &pData->maMouseEvent;
break;
-
- case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
+
+ case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
nEvent = SALEVENT_EXTERNALMOUSEBUTTONDOWN;
pEventData = &pData->maMouseEvent;
break;
-
- case VCLEVENT_WINDOW_MOUSEBUTTONUP:
- nEvent = SALEVENT_EXTERNALMOUSEBUTTONUP;
+
+ case VCLEVENT_WINDOW_MOUSEBUTTONUP:
+ nEvent = SALEVENT_EXTERNALMOUSEBUTTONUP;
pEventData = &pData->maMouseEvent;
break;
- case VCLEVENT_WINDOW_KEYINPUT:
- nEvent = SALEVENT_EXTERNALKEYINPUT;
+ case VCLEVENT_WINDOW_KEYINPUT:
+ nEvent = SALEVENT_EXTERNALKEYINPUT;
pEventData = &pData->maKeyEvent;
break;
-
- case VCLEVENT_WINDOW_KEYUP:
- nEvent = SALEVENT_EXTERNALKEYUP;
+
+ case VCLEVENT_WINDOW_KEYUP:
+ nEvent = SALEVENT_EXTERNALKEYUP;
pEventData = &pData->maKeyEvent;
break;
@@ -1004,11 +1020,11 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
};
if( pData->mpWin && pData->mpWin->mpWindowImpl->mpFrameWindow && pEventData )
- ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (sal_uInt16) nEvent, pEventData );
-
+ ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (USHORT) nEvent, pEventData );
+
// remove this event from list of posted events, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
-
+
while( aIter != aPostedEventList.end() )
{
if( nEventId == (*aIter).second->mnEventId )
@@ -1019,7 +1035,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
else
++aIter;
}
-
+
return 0;
}
@@ -1031,14 +1047,14 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
// remove all events for specific window, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
-
+
while( aIter != aPostedEventList.end() )
{
if( pWin == (*aIter).first )
{
if( (*aIter).second->mnEventId )
RemoveUserEvent( (*aIter).second->mnEventId );
-
+
delete (*aIter).second;
aIter = aPostedEventList.erase( aIter );
}
@@ -1049,89 +1065,89 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
// -----------------------------------------------------------------------
-sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId )
+BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
{
const SolarMutexGuard aGuard;
// find event
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
-
+
while( aIter != aPostedEventList.end() )
{
if( (*aIter).second->mnEventId == nEventId )
- return sal_False;
-
+ return FALSE;
+
else
++aIter;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData )
+ULONG Application::PostUserEvent( ULONG nEvent, void* pEventData )
{
- sal_uLong nEventId;
+ ULONG nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller )
+ULONG Application::PostUserEvent( const Link& rLink, void* pCaller )
{
- sal_uLong nEventId;
+ ULONG nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-sal_Bool Application::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
+BOOL Application::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
{
ImplSVEvent* pSVEvent = new ImplSVEvent;
pSVEvent->mnEvent = nEvent;
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = NULL;
- pSVEvent->mbCall = sal_True;
- rEventId = (sal_uLong)pSVEvent;
+ pSVEvent->mbCall = TRUE;
+ rEventId = (ULONG)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return sal_True;
+ return TRUE;
else
{
rEventId = 0;
delete pSVEvent;
- return sal_False;
+ return FALSE;
}
}
// -----------------------------------------------------------------------
-sal_Bool Application::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
+BOOL Application::PostUserEvent( 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 = sal_True;
- rEventId = (sal_uLong)pSVEvent;
+ pSVEvent->mbCall = TRUE;
+ rEventId = (ULONG)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return sal_True;
+ return TRUE;
else
{
rEventId = 0;
delete pSVEvent;
- return sal_False;
+ return FALSE;
}
}
// -----------------------------------------------------------------------
-void Application::RemoveUserEvent( sal_uLong nUserEvent )
+void Application::RemoveUserEvent( ULONG nUserEvent )
{
if(nUserEvent)
{
@@ -1149,13 +1165,13 @@ void Application::RemoveUserEvent( sal_uLong nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = sal_False;
+ pSVEvent->mbCall = FALSE;
}
}
// -----------------------------------------------------------------------
-sal_Bool Application::InsertIdleHdl( const Link& rLink, sal_uInt16 nPrio )
+BOOL Application::InsertIdleHdl( const Link& rLink, USHORT nPrio )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1393,8 +1409,8 @@ unsigned int Application::GetBestScreen( const Rectangle& i_rRect )
{
if( IsMultiDisplay() )
return GetDefaultDisplayNumber();
-
- const unsigned int nScreens = GetScreenCount();
+
+ const unsigned int nScreens = GetScreenCount();
unsigned int nBestMatchScreen = 0;
unsigned long nOverlap = 0;
for( unsigned int i = 0; i < nScreens; i++ )
@@ -1417,7 +1433,7 @@ unsigned int Application::GetBestScreen( const Rectangle& i_rRect )
}
if( nOverlap > 0 )
return nBestMatchScreen;
-
+
// finally the screen which center is nearest to the rect is the best
const Point aCenter( (i_rRect.Left() + i_rRect.Right())/2,
(i_rRect.Top() + i_rRect.Bottom())/2 );
@@ -1437,7 +1453,7 @@ unsigned int Application::GetBestScreen( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-sal_Bool Application::InsertAccel( Accelerator* pAccel )
+BOOL Application::InsertAccel( Accelerator* pAccel )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1468,17 +1484,17 @@ void Application::FlushAccel()
// -----------------------------------------------------------------------
-sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
+BOOL Application::CallAccel( const KeyCode& rKeyCode, USHORT nRepeat )
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mpAccelMgr )
{
if ( pSVData->maAppData.mpAccelMgr->IsAccelKey( rKeyCode, nRepeat ) )
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1497,21 +1513,21 @@ Help* Application::GetHelp()
// -----------------------------------------------------------------------
-void Application::EnableAutoHelpId( sal_Bool bEnabled )
+void Application::EnableAutoHelpId( BOOL bEnabled )
{
ImplGetSVData()->maHelpData.mbAutoHelpId = bEnabled;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsAutoHelpIdEnabled()
+BOOL Application::IsAutoHelpIdEnabled()
{
return ImplGetSVData()->maHelpData.mbAutoHelpId;
}
// -----------------------------------------------------------------------
-void Application::EnableAutoMnemonic( sal_Bool bEnabled )
+void Application::EnableAutoMnemonic( BOOL bEnabled )
{
AllSettings aSettings = GetSettings();
StyleSettings aStyle = aSettings.GetStyleSettings();
@@ -1522,7 +1538,7 @@ void Application::EnableAutoMnemonic( sal_Bool bEnabled )
// -----------------------------------------------------------------------
-sal_Bool Application::IsAutoMnemonicEnabled()
+BOOL Application::IsAutoMnemonicEnabled()
{
return GetSettings().GetStyleSettings().GetAutoMnemonic();
}
@@ -1560,7 +1576,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( sal_False && pSVData->maWinData.mpDefDialogParent != NULL )
+ if( FALSE && pSVData->maWinData.mpDefDialogParent != NULL )
return pSVData->maWinData.mpDefDialogParent;
else
{
@@ -1580,14 +1596,14 @@ Window* Application::GetDefDialogParent()
// check for corrupted window hierarchy, #122232#, may be we now crash somewhere else
if( !pWin->mpWindowImpl )
{
- OSL_FAIL( "Window hierarchy corrupted!" );
+ DBG_ERROR( "Window hierarchy corrupted!" );
pSVData->maWinData.mpFocusWin = NULL; // avoid further access
- return NULL;
+ return NULL;
}
-
+
// MAV: before the implementation has used only decorated windows,
// but it is not true in case of ActiveX or plugin scenario,
- // so this check is commented out
+ // so this check is commented out
// if( pWin->mpWindowImpl->mpFrameWindow->GetStyle() & (WB_MOVEABLE | WB_SIZEABLE) )
return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
// else
@@ -1624,28 +1640,28 @@ Window* Application::GetDefDialogParent()
// -----------------------------------------------------------------------
-void Application::EnableDialogCancel( sal_Bool bDialogCancel )
+void Application::EnableDialogCancel( BOOL bDialogCancel )
{
ImplGetSVData()->maAppData.mbDialogCancel = bDialogCancel;
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsDialogCancelEnabled()
+BOOL Application::IsDialogCancelEnabled()
{
return ImplGetSVData()->maAppData.mbDialogCancel;
}
// -----------------------------------------------------------------------
-void Application::SetSystemWindowMode( sal_uInt16 nMode )
+void Application::SetSystemWindowMode( USHORT nMode )
{
ImplGetSVData()->maAppData.mnSysWinMode = nMode;
}
// -----------------------------------------------------------------------
-sal_uInt16 Application::GetSystemWindowMode()
+USHORT Application::GetSystemWindowMode()
{
return ImplGetSVData()->maAppData.mnSysWinMode;
}
@@ -1695,7 +1711,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( sal_True );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( TRUE );
if ( pWrapper )
xT = pWrapper->GetVCLToolkit();
return xT;
@@ -1705,13 +1721,13 @@ UniqueItemId Application::CreateUniqueId()
extern "C" { static void SAL_CALL thisModule() {} }
-UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist )
+UnoWrapperBase* Application::GetUnoWrapper( BOOL bCreateIfNotExist )
{
ImplSVData* pSVData = ImplGetSVData();
- static sal_Bool bAlreadyTriedToCreate = sal_False;
+ static BOOL bAlreadyTriedToCreate = FALSE;
if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
{
- ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", sal_True );
+ ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", TRUE );
oslModule hTkLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hTkLib )
@@ -1724,7 +1740,7 @@ UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist )
}
}
DBG_ASSERT( pSVData->mpUnoWrapper, "UnoWrapper could not be created!" );
- bAlreadyTriedToCreate = sal_True;
+ bAlreadyTriedToCreate = TRUE;
}
return pSVData->mpUnoWrapper;
}
@@ -1745,12 +1761,9 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->mxDisplayConnection.is() )
- {
pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection );
- pSVData->mxDisplayConnection->start();
- }
- return pSVData->mxDisplayConnection.get();
+ return pSVData->mxDisplayConnection;
}
// -----------------------------------------------------------------------
@@ -1769,7 +1782,7 @@ const Link& Application::GetFilterHdl()
// -----------------------------------------------------------------------
-sal_Bool ImplCallHotKey( const KeyCode& rKeyCode )
+BOOL ImplCallHotKey( const KeyCode& rKeyCode )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey;
@@ -1778,13 +1791,13 @@ sal_Bool ImplCallHotKey( const KeyCode& rKeyCode )
if ( pHotKeyData->maKeyCode.IsDefinedKeyCodeEqual( rKeyCode ) )
{
pHotKeyData->maLink.Call( pHotKeyData->mpUserData );
- return sal_True;
+ return TRUE;
}
pHotKeyData = pHotKeyData->mpNext;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1806,7 +1819,7 @@ void ImplFreeHotKeyData()
// -----------------------------------------------------------------------
-sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
+ULONG Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = new ImplHotKey;
@@ -1815,12 +1828,12 @@ sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink,
pHotKeyData->maLink = rLink;
pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey;
pSVData->maAppData.mpFirstHotKey = pHotKeyData;
- return (sal_uIntPtr)pHotKeyData;
+ return (ULONG)pHotKeyData;
}
// -----------------------------------------------------------------------
-void Application::RemoveHotKey( sal_uIntPtr nId )
+void Application::RemoveHotKey( ULONG nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId;
@@ -1864,7 +1877,7 @@ void ImplFreeEventHookData()
// -----------------------------------------------------------------------
-sal_uIntPtr Application::AddEventHook( VCLEventHookProc pProc, void* pData )
+ULONG Application::AddEventHook( VCLEventHookProc pProc, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pEventHookData = new ImplEventHook;
@@ -1872,12 +1885,12 @@ sal_uIntPtr Application::AddEventHook( VCLEventHookProc pProc, void* pData )
pEventHookData->mpProc = pProc;
pEventHookData->mpNext = pSVData->maAppData.mpFirstEventHook;
pSVData->maAppData.mpFirstEventHook = pEventHookData;
- return (sal_uIntPtr)pEventHookData;
+ return (ULONG)pEventHookData;
}
// -----------------------------------------------------------------------
-void Application::RemoveEventHook( sal_uIntPtr nId )
+void Application::RemoveEventHook( ULONG nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pFindEventHookData = (ImplEventHook*)nId;
@@ -1945,14 +1958,14 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
// -----------------------------------------------------------------------
-void Application::EnableHeadlessMode( sal_Bool bEnable )
+void Application::EnableHeadlessMode( BOOL bEnable )
{
EnableDialogCancel( bEnable );
}
// -----------------------------------------------------------------------
-sal_Bool Application::IsHeadlessModeEnabled()
+BOOL Application::IsHeadlessModeEnabled()
{
return IsDialogCancelEnabled();
}
@@ -2013,14 +2026,14 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
}
-sal_Bool Application::IsAccessibilityEnabled()
+BOOL Application::IsAccessibilityEnabled()
{
- return sal_False;
+ return FALSE;
}
-sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
+BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
{
- sal_Bool bRet = true;
+ BOOL bRet = true;
// Disable Java bridge on UNIX
#if defined UNX
@@ -2028,13 +2041,13 @@ sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
(void) rCancelled; // unused
#else
bRet = ImplInitAccessBridge( bShowCancel, rCancelled );
-
+
if( !bRet && bShowCancel && !rCancelled )
{
// disable accessibility if the user chooses to continue
AllSettings aSettings = Application::GetSettings();
MiscSettings aMisc = aSettings.GetMiscSettings();
- aMisc.SetEnableATToolSupport( sal_False );
+ aMisc.SetEnableATToolSupport( FALSE );
aSettings.SetMiscSettings( aMisc );
Application::SetSettings( aSettings );
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index ee46f14acae0..269ca4700cab 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,65 +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/file.hxx>
#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>
-
-namespace {
-namespace css = com::sun::star;
+#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 <stdio.h>
+#include <vcl/salsys.hxx>
+#include <vcl/svids.hrc>
+#include <rtl/instance.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::awt;
-using ::rtl::OUString;
+using namespace rtl;
// =======================================================================
namespace
{
- struct private_aImplSVData :
+ struct private_aImplSVData :
public rtl::Static<ImplSVData, private_aImplSVData> {};
}
@@ -129,15 +118,12 @@ void ImplInitSVData()
{
rtl::OUString aArg;
osl_getCommandArg( i, &aArg.pData );
- if( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-enableautomation" ) ) )
+ if( aArg.equalsAscii( "-enableautomation" ) )
{
pImplSVData->mbIsTestTool = true;
break;
}
}
-
- // mark default layout border as unitialized
- pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
}
// -----------------------------------------------------------------------
@@ -173,13 +159,6 @@ 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;
}
// -----------------------------------------------------------------------
@@ -199,7 +178,7 @@ Window* ImplGetDefaultWindow()
// First test if we already have a default window.
// Don't only place a single if..else inside solar mutex lockframe
- // because then we might have to wait for the solar mutex what is not neccessary
+ // because then we might have to wait for the solar mutex what is not neccessary
// if we already have a default window.
if ( !pSVData->mpDefaultWin )
@@ -232,7 +211,7 @@ ResMgr* ImplGetResMgr()
{
::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
pSVData->mpResMgr = ResMgr::SearchCreateResMgr( VCL_CREATERESMGR_NAME( vcl ), aLocale );
-
+
static bool bMessageOnce = false;
if( !pSVData->mpResMgr && ! bMessageOnce )
{
@@ -253,56 +232,10 @@ ResId VclResId( sal_Int32 nId )
ResMgr* pMgr = ImplGetResMgr();
if( ! pMgr )
throw std::bad_alloc();
-
+
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();
@@ -318,7 +251,7 @@ public:
AccessBridgeCurrentContext(
const com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > &context ) :
m_prevContext( context ) {}
-
+
// XCurrentContext
virtual com::sun::star::uno::Any SAL_CALL getValueByName( const rtl::OUString& Name )
throw (com::sun::star::uno::RuntimeException);
@@ -330,7 +263,7 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
throw (com::sun::star::uno::RuntimeException)
{
com::sun::star::uno::Any ret;
- if( Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "java-vm.interaction-handler" ) ) )
+ if( Name.equalsAscii( "java-vm.interaction-handler" ) )
{
// Currently, for accessbility no interaction handler shall be offered.
// There may be introduced later on a handler using native toolkits
@@ -344,16 +277,16 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
}
-bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
+bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
{
- rCancelled = sal_False;
+ rCancelled = FALSE;
bool bErrorMessage = true;
// Note:
- // if bAllowCancel is sal_True we were called from application startup
+ // if bAllowCancel is 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 sal_False we were called from Tools->Options
+ // if bAllowCancel is 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
@@ -370,12 +303,12 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() )
{
- css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
+ Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
if( xFactory.is() )
{
- css::uno::Reference< XExtendedToolkit > xToolkit =
- css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
+ Reference< XExtendedToolkit > xToolkit =
+ Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
Sequence< Any > arguments(1);
arguments[0] = makeAny(xToolkit);
@@ -384,30 +317,30 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
// for a disabled user. Use native message boxes which are accessible without java support.
// No need to do this when activated by Tools-Options dialog ..
if( bAllowCancel )
- {
+ {
// customize the java-not-available-interaction-handler entry within the
// current context when called at startup.
com::sun::star::uno::ContextLayer layer(
new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessBridge")),
- arguments
+ OUString::createFromAscii( "com.sun.star.accessibility.AccessBridge" ),
+ arguments
);
}
else
{
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessBridge")),
- arguments
+ OUString::createFromAscii( "com.sun.star.accessibility.AccessBridge" ),
+ arguments
);
}
-
+
if( !pSVData->mxAccessBridge.is() )
bSuccess = false;
}
}
-
+
return bSuccess;
}
@@ -430,9 +363,9 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = sal_True;
+ rCancelled = TRUE;
}
-
+
return false;
}
@@ -455,9 +388,9 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = sal_True;
+ rCancelled = TRUE;
}
-
+
return false;
}
@@ -480,9 +413,9 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = sal_True;
+ rCancelled = TRUE;
}
-
+
return false;
}
@@ -505,9 +438,9 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = sal_True;
+ rCancelled = TRUE;
}
-
+
return false;
}
@@ -520,11 +453,11 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
String aTitle;
String aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr));
- if( 0 == e.Message.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassNotFound")), 13) )
+ if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("ClassNotFound"), 13) )
{
aTitle = String(ResId(SV_ACCESSERROR_MISSING_BRIDGE, *pResMgr));
}
- else if( 0 == e.Message.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NoSuchMethod")), 12) )
+ else if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("NoSuchMethod"), 12) )
{
aTitle = String(ResId(SV_ACCESSERROR_WRONG_VERSION, *pResMgr));
}
@@ -540,28 +473,28 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr));
int ret = ImplGetSalSystem()->ShowNativeMessageBox(
- aTitle,
- ReplaceJavaErrorMessages(aMessage),
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = sal_True;
+ rCancelled = TRUE;
}
else
{
// The user tried to activate accessibility support using Tools-Options dialog,
// so we don't offer to terminate here !
ImplGetSalSystem()->ShowNativeMessageBox(
- aTitle,
- ReplaceJavaErrorMessages(aMessage),
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK,
SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK);
}
}
}
-
+
return false;
}
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 655bb0393563..4f76193d4b90 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -30,9 +30,10 @@
#include "precompiled_vcl.hxx"
#ifdef WNT
-#include <svsys.h>
+#include <tools/prewin.h>
#include <process.h> // for _beginthreadex
#include <ole2.h> // for _beginthreadex
+#include <tools/postwin.h>
#endif
// [ed 5/14/02 Add in explicit check for quartz graphics. OS X will define
@@ -89,8 +90,11 @@
#include "rtl/strbuf.hxx"
#endif
-using ::rtl::OUString;
-using namespace ::com::sun::star;
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+
+
// =======================================================================
@@ -152,7 +156,7 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
}
// =======================================================================
-int ImplSVMain()
+BOOL ImplSVMain()
{
// The 'real' SVMain()
RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::SVMain" );
@@ -161,23 +165,26 @@ int ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
- uno::Reference<lang::XMultiServiceFactory> xMS;
+ Reference<XMultiServiceFactory> xMS;
- int nReturn = EXIT_FAILURE;
- sal_Bool bInit = InitVCL( xMS );
+ BOOL bInit = InitVCL( xMS );
if( bInit )
{
// Application-Main rufen
- pSVData->maAppData.mbInAppMain = sal_True;
- nReturn = pSVData->mpApp->Main();
- pSVData->maAppData.mbInAppMain = sal_False;
+ pSVData->maAppData.mbInAppMain = TRUE;
+ pSVData->mpApp->Main();
+ pSVData->maAppData.mbInAppMain = FALSE;
}
if( pSVData->mxDisplayConnection.is() )
{
- pSVData->mxDisplayConnection->terminate();
+ vcl::DisplayConnection* pConnection =
+ dynamic_cast<vcl::DisplayConnection*>(pSVData->mxDisplayConnection.get());
+
+ if( pConnection )
+ pConnection->dispatchDowningEvent();
pSVData->mxDisplayConnection.clear();
}
@@ -186,27 +193,27 @@ 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 ..
- uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY);
+ Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
if( xComponent.is() )
{
- sal_uLong nCount = Application::ReleaseSolarMutex();
+ ULONG nCount = Application::ReleaseSolarMutex();
xComponent->dispose();
Application::AcquireSolarMutex(nCount);
pSVData->mxAccessBridge.clear();
}
DeInitVCL();
- return nReturn;
+ return bInit;
}
-int SVMain()
+BOOL SVMain()
{
// #i47888# allow for alternative initialization as required for e.g. MacOSX
- extern sal_Bool ImplSVMainHook( int* );
+ extern BOOL ImplSVMainHook( BOOL* );
- int nRet;
- if( ImplSVMainHook( &nRet ) )
- return nRet;
+ BOOL bInit;
+ if( ImplSVMainHook( &bInit ) )
+ return bInit;
else
return ImplSVMain();
}
@@ -219,7 +226,7 @@ oslSignalHandler pExceptionHandler = NULL;
class Application_Impl : public Application
{
public:
- int Main() { return EXIT_SUCCESS; };
+ void Main(){};
};
class DesktopEnvironmentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >
@@ -236,13 +243,13 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > m_xNextContext;
};
-uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (uno::RuntimeException)
+Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (RuntimeException)
{
- uno::Any retVal;
+ Any retVal;
- if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("system.desktop-environment")))
+ if ( 0 == Name.compareToAscii( "system.desktop-environment" ) )
{
- retVal = uno::makeAny( Application::GetDesktopEnvironment() );
+ retVal = makeAny( Application::GetDesktopEnvironment() );
}
else if( m_xNextContext.is() )
{
@@ -252,12 +259,12 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString
return retVal;
}
-sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
+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 sal_False;
+ return FALSE;
if( ! ImplGetSVData() )
ImplInitSVData();
@@ -286,7 +293,7 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ ::CreateSalInstance" );
pSVData->mpDefInst = CreateSalInstance();
if ( !pSVData->mpDefInst )
- return sal_False;
+ return FALSE;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} ::CreateSalInstance" );
// Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible)
@@ -311,7 +318,7 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
// Initialize global data
pSVData->maGDIData.mpScreenFontList = new ImplDevFontList;
- pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( sal_False );
+ pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( FALSE );
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
// Exception-Handler setzen
@@ -320,40 +327,13 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
// Debug-Daten initialisieren
DBGGUI_INIT();
- return sal_True;
-}
-
-namespace
-{
-
-/** Serves for destroying the VCL UNO wrapper as late as possible. This avoids
- crash at exit in some special cases when a11y is enabled (e.g., when
- a bundled extension is registered/deregistered during startup, forcing exit
- while the app is still in splash screen.)
- */
-class VCLUnoWrapperDeleter : public cppu::WeakImplHelper1<com::sun::star::lang::XEventListener>
-{
- virtual void SAL_CALL disposing(lang::EventObject const& rSource) throw(uno::RuntimeException);
-};
-
-void
-VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
- throw(uno::RuntimeException)
-{
- ImplSVData* const pSVData = ImplGetSVData();
- if (pSVData && pSVData->mpUnoWrapper)
- {
- pSVData->mpUnoWrapper->Destroy();
- pSVData->mpUnoWrapper = NULL;
- }
-}
-
+ return TRUE;
}
void DeInitVCL()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->mbDeInit = sal_True;
+ pSVData->mbDeInit = TRUE;
vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit();
@@ -412,6 +392,11 @@ void DeInitVCL()
delete pSVData->maWinData.mpMsgBoxImgList;
pSVData->maWinData.mpMsgBoxImgList = NULL;
}
+ if ( pSVData->maWinData.mpMsgBoxHCImgList )
+ {
+ delete pSVData->maWinData.mpMsgBoxHCImgList;
+ pSVData->maWinData.mpMsgBoxHCImgList = NULL;
+ }
if ( pSVData->maCtrlData.mpCheckImgList )
{
delete pSVData->maCtrlData.mpCheckImgList;
@@ -452,32 +437,32 @@ void DeInitVCL()
delete pSVData->maCtrlData.mpDisclosurePlus;
pSVData->maCtrlData.mpDisclosurePlus = NULL;
}
+ if ( pSVData->maCtrlData.mpDisclosurePlusHC )
+ {
+ delete pSVData->maCtrlData.mpDisclosurePlusHC;
+ pSVData->maCtrlData.mpDisclosurePlusHC = NULL;
+ }
if ( pSVData->maCtrlData.mpDisclosureMinus )
{
delete pSVData->maCtrlData.mpDisclosureMinus;
pSVData->maCtrlData.mpDisclosureMinus = NULL;
}
+ if ( pSVData->maCtrlData.mpDisclosureMinusHC )
+ {
+ delete pSVData->maCtrlData.mpDisclosureMinusHC;
+ pSVData->maCtrlData.mpDisclosureMinusHC = NULL;
+ }
if ( pSVData->mpDefaultWin )
{
delete pSVData->mpDefaultWin;
pSVData->mpDefaultWin = NULL;
}
+ // #114285# Moved here from ImplDeInitSVData...
if ( pSVData->mpUnoWrapper )
{
- try
- {
- uno::Reference<lang::XComponent> const xDesktop(
- comphelper::createProcessComponent(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
- uno::UNO_QUERY_THROW)
- ;
- xDesktop->addEventListener(new VCLUnoWrapperDeleter());
- }
- catch (uno::Exception const&)
- {
- // ignore
- }
+ pSVData->mpUnoWrapper->Destroy();
+ pSVData->mpUnoWrapper = NULL;
}
pSVData->maAppData.mxMSF.clear();
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index dd446125a7aa..8b6e5fe61255 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,9 +32,9 @@
#ifndef MACOSX
-sal_Bool ImplSVMainHook( int * )
+BOOL ImplSVMainHook( BOOL * )
{
- return sal_False; // indicate that ImplSVMainHook is not implemented
+ return FALSE; // indicate that ImplSVMainHook is not implemented
}
#else
@@ -46,7 +46,7 @@ sal_Bool ImplSVMainHook( int * )
#include <postmac.h>
#include <unistd.h>
-extern sal_Bool ImplSVMain();
+extern BOOL ImplSVMain();
// ============================================================================
@@ -57,7 +57,7 @@ static void SourceContextCallBack( void *pInfo )
struct ThreadContext
{
- int* pRet;
+ BOOL* pRet;
CFRunLoopRef* pRunLoopRef;
};
@@ -69,14 +69,14 @@ static void RunSVMain(void *pData)
// running
while (!CFRunLoopIsWaiting(*tcx->pRunLoopRef))
usleep(100);
-
+
*tcx->pRet = ImplSVMain();
// Force exit since some JVMs won't shutdown when only exit() is invoked
_exit( 0 );
}
-sal_Bool ImplSVMainHook( int *pnInit )
+BOOL ImplSVMainHook( BOOL *pbInit )
{
// 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
@@ -87,7 +87,7 @@ sal_Bool ImplSVMainHook( int *pnInit )
CFRunLoopRef runLoopRef = CFRunLoopGetCurrent();
ThreadContext tcx;
- tcx.pRet = pnInit; // the return value
+ tcx.pRet = pbInit; // the return value
tcx.pRunLoopRef = &runLoopRef;
oslThread hThreadID = osl_createThread(RunSVMain, &tcx);
@@ -110,7 +110,7 @@ sal_Bool ImplSVMainHook( int *pnInit )
osl_joinWithThread( hThreadID );
osl_destroyThread( hThreadID );
- return sal_True; // indicate that ImplSVMainHook is implemented
+ return TRUE; // indicate that ImplSVMainHook is implemented
}
#endif // MACOSX
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 6c2d08b18659..80b1f1047e63 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,7 +42,7 @@
// =======================================================================
-#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
+#define MAX_TIMER_PERIOD ((ULONG)0xFFFFFFFF)
// ---------------------
// - TimeManager-Types -
@@ -50,20 +50,20 @@
struct ImplTimerData
{
- ImplTimerData* mpNext; // Pointer to the next Instance
- Timer* mpSVTimer; // Pointer to SV Timer instance
- 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
+ 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
};
// =======================================================================
void Timer::ImplDeInitTimer()
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplTimerData* pTimerData = pSVData->mpFirstTimerData;
+ ImplSVData* pSVData = ImplGetSVData();
+ ImplTimerData* pTimerData = pSVData->mpFirstTimerData;
if ( pTimerData )
{
@@ -72,7 +72,7 @@ void Timer::ImplDeInitTimer()
ImplTimerData* pTempTimerData = pTimerData;
if ( pTimerData->mpSVTimer )
{
- pTimerData->mpSVTimer->mbActive = sal_False;
+ pTimerData->mpSVTimer->mbActive = FALSE;
pTimerData->mpSVTimer->mpTimerData = NULL;
}
pTimerData = pTimerData->mpNext;
@@ -80,8 +80,8 @@ void Timer::ImplDeInitTimer()
}
while ( pTimerData );
- pSVData->mpFirstTimerData = NULL;
- pSVData->mnTimerPeriod = 0;
+ pSVData->mpFirstTimerData = NULL;
+ pSVData->mnTimerPeriod = 0;
delete pSVData->mpSalTimer;
pSVData->mpSalTimer = NULL;
}
@@ -89,7 +89,7 @@ void Timer::ImplDeInitTimer()
// -----------------------------------------------------------------------
-static void ImplStartTimer( ImplSVData* pSVData, sal_uLong nMS )
+static void ImplStartTimer( ImplSVData* pSVData, ULONG nMS )
{
if ( !nMS )
nMS = 1;
@@ -105,18 +105,18 @@ static void ImplStartTimer( ImplSVData* pSVData, sal_uLong nMS )
void Timer::ImplTimerCallbackProc()
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplTimerData* pTimerData;
- ImplTimerData* pPrevTimerData;
- sal_uLong nMinPeriod = MAX_TIMER_PERIOD;
- sal_uLong nDeltaTime;
- sal_uLong nTime = Time::GetSystemTicks();
+ ImplSVData* pSVData = ImplGetSVData();
+ ImplTimerData* pTimerData;
+ ImplTimerData* pPrevTimerData;
+ ULONG nMinPeriod = MAX_TIMER_PERIOD;
+ ULONG nDeltaTime;
+ ULONG nTime = Time::GetSystemTicks();
if ( pSVData->mbNoCallTimer )
return;
pSVData->mnTimerUpdate++;
- pSVData->mbNotAllTimerCalled = sal_True;
+ pSVData->mbNotAllTimerCalled = 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 = sal_False;
- pTimerData->mbDelete = sal_True;
+ pTimerData->mpSVTimer->mbActive = FALSE;
+ pTimerData->mbDelete = TRUE;
}
// call Timeout
- pTimerData->mbInTimeout = sal_True;
+ pTimerData->mbInTimeout = TRUE;
pTimerData->mpSVTimer->Timeout();
- pTimerData->mbInTimeout = sal_False;
+ pTimerData->mbInTimeout = FALSE;
}
}
@@ -152,7 +152,7 @@ void Timer::ImplTimerCallbackProc()
}
// Neue Zeit ermitteln
- sal_uLong nNewTime = Time::GetSystemTicks();
+ ULONG nNewTime = Time::GetSystemTicks();
pPrevTimerData = NULL;
pTimerData = pSVData->mpFirstTimerData;
while ( pTimerData )
@@ -213,28 +213,28 @@ void Timer::ImplTimerCallbackProc()
ImplStartTimer( pSVData, nMinPeriod );
pSVData->mnTimerUpdate--;
- pSVData->mbNotAllTimerCalled = sal_False;
+ pSVData->mbNotAllTimerCalled = FALSE;
}
// =======================================================================
Timer::Timer()
{
- mpTimerData = NULL;
- mnTimeout = 1;
- mbAuto = sal_False;
- mbActive = sal_False;
+ mpTimerData = NULL;
+ mnTimeout = 1;
+ mbAuto = FALSE;
+ mbActive = FALSE;
}
// -----------------------------------------------------------------------
Timer::Timer( const Timer& rTimer )
{
- mpTimerData = NULL;
- mnTimeout = rTimer.mnTimeout;
- mbAuto = sal_False;
- mbActive = sal_False;
- maTimeoutHdl = rTimer.maTimeoutHdl;
+ mpTimerData = NULL;
+ mnTimeout = rTimer.mnTimeout;
+ mbAuto = FALSE;
+ mbActive = FALSE;
+ maTimeoutHdl = rTimer.maTimeoutHdl;
if ( rTimer.IsActive() )
Start();
@@ -246,7 +246,7 @@ Timer::~Timer()
{
if ( mpTimerData )
{
- mpTimerData->mbDelete = sal_True;
+ mpTimerData->mbDelete = TRUE;
mpTimerData->mpSVTimer = NULL;
}
}
@@ -260,7 +260,7 @@ void Timer::Timeout()
// -----------------------------------------------------------------------
-void Timer::SetTimeout( sal_uLong nNewTimeout )
+void Timer::SetTimeout( ULONG nNewTimeout )
{
mnTimeout = nNewTimeout;
@@ -277,7 +277,7 @@ void Timer::SetTimeout( sal_uLong nNewTimeout )
void Timer::Start()
{
- mbActive = sal_True;
+ mbActive = TRUE;
ImplSVData* pSVData = ImplGetSVData();
if ( !mpTimerData )
@@ -293,12 +293,12 @@ void Timer::Start()
}
// insert timer and start
- mpTimerData = new ImplTimerData;
- mpTimerData->mpSVTimer = this;
- mpTimerData->mnUpdateTime = Time::GetSystemTicks();
- mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = sal_False;
- mpTimerData->mbInTimeout = sal_False;
+ mpTimerData = new ImplTimerData;
+ mpTimerData->mpSVTimer = this;
+ mpTimerData->mnUpdateTime = Time::GetSystemTicks();
+ mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
+ mpTimerData->mbDelete = FALSE;
+ mpTimerData->mbInTimeout = FALSE;
// !!!!! Wegen SFX hinten einordnen !!!!!
ImplTimerData* pPrev = NULL;
@@ -319,13 +319,13 @@ void Timer::Start()
}
else if( !mpTimerData->mpSVTimer ) // TODO: remove when guilty found
{
- OSL_FAIL( "Timer::Start() on a destroyed Timer!" );
+ DBG_ERROR( "Timer::Start() on a destroyed Timer!" );
}
else
{
- mpTimerData->mnUpdateTime = Time::GetSystemTicks();
- mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = sal_False;
+ mpTimerData->mnUpdateTime = Time::GetSystemTicks();
+ mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
+ mpTimerData->mbDelete = FALSE;
}
}
@@ -333,10 +333,10 @@ void Timer::Start()
void Timer::Stop()
{
- mbActive = sal_False;
+ mbActive = FALSE;
if ( mpTimerData )
- mpTimerData->mbDelete = sal_True;
+ mpTimerData->mbDelete = TRUE;
}
// -----------------------------------------------------------------------
@@ -346,9 +346,9 @@ Timer& Timer::operator=( const Timer& rTimer )
if ( IsActive() )
Stop();
- mbActive = sal_False;
- mnTimeout = rTimer.mnTimeout;
- maTimeoutHdl = rTimer.maTimeoutHdl;
+ mbActive = FALSE;
+ mnTimeout = rTimer.mnTimeout;
+ maTimeoutHdl = rTimer.maTimeoutHdl;
if ( rTimer.IsActive() )
Start();
@@ -360,14 +360,14 @@ Timer& Timer::operator=( const Timer& rTimer )
AutoTimer::AutoTimer()
{
- mbAuto = sal_True;
+ mbAuto = TRUE;
}
// -----------------------------------------------------------------------
AutoTimer::AutoTimer( const AutoTimer& rTimer ) : Timer( rTimer )
{
- mbAuto = sal_True;
+ mbAuto = TRUE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index 00fbaaeef3c4..d49f5f888acb 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,6 +39,7 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
#include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -57,13 +58,13 @@
using namespace ::com::sun::star;
using namespace ::rtl;
-#define DOSTRING( x ) #x
-#define STRING( x ) DOSTRING( x )
+#define DOSTRING( x ) #x
+#define STRING( x ) DOSTRING( x )
struct VCLRegServiceInfo
{
- const sal_Char* pLibName;
- sal_Bool bHasSUPD;
+ const sal_Char* pLibName;
+ sal_Bool bHasSUPD;
};
static VCLRegServiceInfo aVCLComponentsArray[] =
@@ -105,8 +106,8 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact
{
pSVData->maAppData.mxMSF = ::cppu::createRegistryServiceFactory( aTempFileName, rtl::OUString(), sal_False );
uno::Reference < registry::XImplementationRegistration > xReg(
- pSVData->maAppData.mxMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration"))), uno::UNO_QUERY );
-
+ pSVData->maAppData.mxMSF->createInstance( OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" )), uno::UNO_QUERY );
+
if( xReg.is() )
{
sal_Int32 nCompCount = 0;
@@ -118,7 +119,7 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact
try
{
xReg->registerImplementation(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),aComponentPathString, NULL );
+ OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),aComponentPathString, NULL );
}
catch( ::com::sun::star::uno::Exception & )
{
@@ -144,7 +145,7 @@ uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator()
uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
if ( xMSF.is() )
{
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
+ uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
if ( xI.is() )
{
uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
@@ -160,7 +161,7 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte
uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
if ( xMSF.is() )
{
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.CharacterClassification")) );
+ uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.CharacterClassification" ) );
if ( xI.is() )
{
uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) );
@@ -170,6 +171,22 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte
return xB;
}
+uno::Reference < i18n::XCollator > vcl::unohelper::CreateCollator()
+{
+ uno::Reference < i18n::XCollator > xB;
+ uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
+ if ( xMSF.is() )
+ {
+ uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.Collator" ) );
+ if ( xI.is() )
+ {
+ uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCollator >*)0) );
+ x >>= xB;
+ }
+ }
+ return xB;
+}
+
::rtl::OUString vcl::unohelper::CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD )
{
// create variable library name suffixes
@@ -217,7 +234,7 @@ void vcl::unohelper::NotifyAccessibleStateEventGlobally( const ::com::sun::star:
if ( nType == ::com::sun::star::accessibility::AccessibleStateType::FOCUSED )
xExtToolkit->fireFocusLost( rEventObject.Source );
}
-
+
}
}
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 1fe4158433a0..15e8aec9063d 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ namespace vcl { namespace unohelper {
TextDataObject::~TextDataObject()
{
}
-
+
void TextDataObject::CopyStringTo( const String& rContent,
const uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
{
@@ -85,7 +85,7 @@ namespace vcl { namespace unohelper {
{
uno::Any aAny;
- sal_uLong nT = SotExchange::GetFormat( rFlavor );
+ ULONG nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetString();
@@ -106,10 +106,10 @@ namespace vcl { namespace unohelper {
sal_Bool TextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- sal_uLong nT = SotExchange::GetFormat( rFlavor );
+ ULONG nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
-}} // namespace vcl::unohelper
+}} // namespace vcl::unohelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index f7614c99046b..65a490b5563b 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@ TYPEINIT0(VclSimpleEvent);
TYPEINIT1(VclWindowEvent, VclSimpleEvent);
TYPEINIT1(VclMenuEvent, VclSimpleEvent);
-VclAccessibleEvent::VclAccessibleEvent( sal_uLong n, const Reference<XAccessible>& rxAccessible ) :
+VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference<XAccessible>& rxAccessible ) :
VclSimpleEvent(n),
mxAccessible(rxAccessible)
{
@@ -58,11 +58,8 @@ Reference<XAccessible> VclAccessibleEvent::GetAccessible() const
void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
{
- if ( m_aListeners.empty() )
- return;
-
// Copy the list, because this can be destroyed when calling a Link...
- std::list<Link> aCopy( m_aListeners );
+ std::list<Link> aCopy( *this );
std::list<Link>::iterator aIter( aCopy.begin() );
if( pEvent->IsA( VclWindowEvent::StaticType() ) )
{
@@ -84,20 +81,17 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
}
}
-sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
+BOOL VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
- if ( m_aListeners.empty() )
- return sal_False;
-
- sal_Bool bProcessed = sal_False;
+ BOOL bProcessed = FALSE;
// Copy the list, because this can be destroyed when calling a Link...
- std::list<Link> aCopy( m_aListeners );
+ std::list<Link> aCopy( *this );
std::list<Link>::iterator aIter( aCopy.begin() );
while ( aIter != aCopy.end() )
{
if( (*aIter).Call( pEvent ) != 0 )
{
- bProcessed = sal_True;
+ bProcessed = TRUE;
break;
}
aIter++;
@@ -105,16 +99,6 @@ sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
return bProcessed;
}
-void VclEventListeners::addListener( const Link& rListener )
-{
- m_aListeners.push_back( rListener );
-}
-
-void VclEventListeners::removeListener( const Link& rListener )
-{
- m_aListeners.remove( rListener );
-}
-
VclEventListeners2::VclEventListeners2()
{
}
@@ -122,7 +106,7 @@ VclEventListeners2::VclEventListeners2()
VclEventListeners2::~VclEventListeners2()
{
}
-
+
void VclEventListeners2::addListener( const Link& i_rLink )
{
// ensure uniqueness
@@ -151,7 +135,7 @@ void VclEventListeners2::removeListener( const Link& i_rLink )
void VclEventListeners2::callListeners( VclSimpleEvent* i_pEvent )
{
vcl::DeletionListener aDel( this );
-
+
m_aIterators.push_back(ListenerIt(m_aListeners.begin()));
size_t nIndex = m_aIterators.size() - 1;
while( ! aDel.isDeleted() && m_aIterators[ nIndex ].m_aIt != m_aListeners.end() )
diff --git a/vcl/source/components/display.cxx b/vcl/source/components/display.cxx
index 39f2613ac6b5..7e150205f71b 100644
--- a/vcl/source/components/display.cxx
+++ b/vcl/source/components/display.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -180,7 +180,7 @@ Sequence< OUString > SAL_CALL DisplayInfo::getSupportedServiceNames( ) throw (R
}
// ====================================================================
-
+
class DisplayAccess : public ::cppu::WeakAggImplHelper4< XPropertySet, XPropertySetInfo, XIndexAccess, XServiceInfo >
{
public:
@@ -284,7 +284,7 @@ Property SAL_CALL DisplayAccess::getPropertyByName( const OUString& aName ) thro
{
if( aName.equalsAscii( pMultiDisplayName ) )
return Property( aName, 0, ::getCppuType( (sal_Bool const *)0 ), PropertyAttribute::READONLY );
-
+
if( aName.equalsAscii( pDefaultDisplayName ) )
return Property( aName, 0, ::getCppuType( (sal_Int32 const *)0 ), PropertyAttribute::READONLY );
throw UnknownPropertyException();
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index cd1fbec0502b..1d19dea6952e 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -92,7 +92,7 @@ public:
* XServiceInfo
*/
- virtual rtl::OUString SAL_CALL getImplementationName() throw( RuntimeException );
+ virtual rtl::OUString SAL_CALL getImplementationName() throw( RuntimeException );
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( RuntimeException );
virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( RuntimeException );
@@ -103,16 +103,16 @@ public:
* XClipboard
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ virtual 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 )
+ virtual void SAL_CALL setContents(
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(RuntimeException);
- virtual ::rtl::OUString SAL_CALL getName()
- throw(RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getName()
+ throw(RuntimeException);
/*
* XClipboardEx
@@ -124,13 +124,13 @@ public:
/*
* XClipboardNotifier
*/
- virtual void SAL_CALL addClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ virtual void SAL_CALL addClipboardListener(
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
- virtual void SAL_CALL removeClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
- throw(RuntimeException);
+ virtual void SAL_CALL removeClipboardListener(
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ throw(RuntimeException);
};
GenericClipboard::~GenericClipboard()
@@ -145,7 +145,7 @@ rtl::OUString GenericClipboard::getImplementationName_static()
Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames_static()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
return aRet;
}
@@ -175,9 +175,9 @@ Reference< ::com::sun::star::datatransfer::XTransferable > GenericClipboard::get
{
return m_aContents;
}
-
-void GenericClipboard::setContents(
- const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+
+void GenericClipboard::setContents(
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw( RuntimeException )
{
@@ -192,7 +192,7 @@ void GenericClipboard::setContents(
aEv.Contents = m_aContents;
aGuard.clear();
-
+
if( xOldOwner.is() && xOldOwner != xClipboardOwner )
xOldOwner->lostOwnership( this, xOldContents );
for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it =
@@ -224,7 +224,7 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c
throw( RuntimeException )
{
osl::ClearableMutexGuard aGuard( m_aMutex );
-
+
m_aListeners.remove( listener );
}
@@ -282,7 +282,7 @@ Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Seq
Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
return aRet;
}
@@ -318,11 +318,11 @@ class GenericDragSource : public cppu::WeakComponentImplHelper2<
public:
GenericDragSource() : cppu::WeakComponentImplHelper2< datatransfer::dnd::XDragSource, XInitialization >( m_aMutex ) {}
virtual ~GenericDragSource();
-
+
// XDragSource
- virtual sal_Bool SAL_CALL isDragImageSupported() throw();
- virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
- virtual void SAL_CALL startDrag(
+ virtual sal_Bool SAL_CALL isDragImageSupported() throw();
+ virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
+ virtual void SAL_CALL startDrag(
const datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
const Reference< datatransfer::XTransferable >& transferable,
@@ -330,18 +330,18 @@ public:
) throw();
// XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
-
+ virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
+
static Sequence< OUString > getSupportedServiceNames_static()
{
Sequence< OUString > aRet( 1 );
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.GenericDragSource"));
+ aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDragSource" );
return aRet;
}
-
+
static OUString getImplementationName_static()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.VclGenericDragSource"));
+ return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDragSource" );
}
};
@@ -434,26 +434,26 @@ public:
virtual ~GenericDropTarget();
// XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( Exception );
+ virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( 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 sal_Bool SAL_CALL isActive() throw();
- virtual void SAL_CALL setActive( sal_Bool active ) throw();
- virtual sal_Int8 SAL_CALL getDefaultActions() throw();
- virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
+ 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 sal_Bool SAL_CALL isActive() throw();
+ virtual void SAL_CALL setActive( sal_Bool active ) throw();
+ virtual sal_Int8 SAL_CALL getDefaultActions() throw();
+ virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
static Sequence< OUString > getSupportedServiceNames_static()
{
Sequence< OUString > aRet( 1 );
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.GenericDropTarget"));
+ aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDropTarget" );
return aRet;
}
static OUString getImplementationName_static()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.VclGenericDropTarget"));
+ return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDropTarget" );
}
};
@@ -534,7 +534,7 @@ Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMu
} // namespace vcl
/*
-* SalInstance generic
+* SalInstance generic
*/
Reference< XInterface > SalInstance::CreateClipboard( const Sequence< Any >& )
{
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 9325c047b5d7..096b5941ea6d 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,10 +59,6 @@ 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 > & );
@@ -85,6 +81,62 @@ 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,
@@ -117,12 +169,6 @@ 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/fontident.cxx b/vcl/source/components/fontident.cxx
index e411dcf49aba..6559df8a1081 100644
--- a/vcl/source/components/fontident.cxx
+++ b/vcl/source/components/fontident.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -71,10 +71,10 @@ FontIdentificator() {}
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);
-
+
// XInitialization
virtual void SAL_CALL initialize( const Sequence< Any >& ) throw (Exception, RuntimeException);
-
+
// XMaterialHolder
virtual Any SAL_CALL getMaterial() throw(RuntimeException);
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
index 982687104c01..e30975dbc099 100644
--- a/vcl/source/components/makefile.mk
+++ b/vcl/source/components/makefile.mk
@@ -39,10 +39,9 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/display.obj \
- $(SLO)$/dtranscomp.obj \
- $(SLO)$/fontident.obj \
- $(SLO)$/stringmirror.obj \
+SLOFILES= $(SLO)$/display.obj \
+ $(SLO)$/dtranscomp.obj \
+ $(SLO)$/fontident.obj \
$(SLO)$/factory.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx
deleted file mode 100644
index 78806914a7c4..000000000000
--- a/vcl/source/components/stringmirror.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// 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 7926ee339bc7..7110598386c2 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -77,11 +77,13 @@ class ImplCommonButtonData
public:
Rectangle maFocusRect;
Rectangle maSymbolRect;
- sal_uInt16 mnButtonState;
- sal_Bool mbSmallSymbol;
+ USHORT mnButtonState;
+ BOOL mbSmallSymbol;
Image maImage;
+ Image maImageHC;
BitmapEx* mpBitmapEx;
+ BitmapEx* mpBitmapExHC;
ImageAlign meImageAlign;
SymbolAlign meSymbolAlign;
@@ -94,9 +96,10 @@ public:
ImplCommonButtonData::ImplCommonButtonData()
{
mnButtonState = 0;
- mbSmallSymbol = sal_False;
+ mbSmallSymbol = FALSE;
mpBitmapEx = NULL;
+ mpBitmapExHC = NULL;
meImageAlign = IMAGEALIGN_TOP;
meSymbolAlign = SYMBOLALIGN_LEFT;
}
@@ -105,6 +108,7 @@ ImplCommonButtonData::ImplCommonButtonData()
ImplCommonButtonData::~ImplCommonButtonData()
{
delete mpBitmapEx;
+ delete mpBitmapExHC;
}
// =======================================================================
@@ -180,20 +184,12 @@ XubString Button::GetStandardText( StandardButtonType eButton )
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
{
- sal_uInt32 nResId = aResIdAry[(sal_uInt16)eButton].nResId;
- ResId aResId( nResId, *pResMgr );
+ ResId aResId( aResIdAry[(USHORT)eButton].nResId, *pResMgr );
aText = String( aResId );
-
- // Windows (apparently) has some magic auto-accelerator evil around
- // ok / cancel so add this only for Unix
-#ifdef UNX
- if( nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL )
- aText.Insert( String::CreateFromAscii("~"), 0 );
-#endif
}
else
{
- ByteString aT( aResIdAry[(sal_uInt16)eButton].pDefText );
+ ByteString aT( aResIdAry[(USHORT)eButton].pDefText );
aText = String( aT, RTL_TEXTENCODING_ASCII_US );
}
return aText;
@@ -207,28 +203,55 @@ XubString Button::GetStandardHelpText( StandardButtonType /* eButton */ )
return aHelpText;
}
// -----------------------------------------------------------------------
-sal_Bool Button::SetModeImage( const Image& rImage )
+BOOL Button::SetModeImage( const Image& rImage, BmpColorMode eMode )
{
- if ( rImage != mpButtonData->maImage )
+ if( eMode == BMP_COLOR_NORMAL )
{
- delete mpButtonData->mpBitmapEx;
+ if ( rImage != mpButtonData->maImage )
+ {
+ delete mpButtonData->mpBitmapEx;
- mpButtonData->mpBitmapEx = NULL;
- mpButtonData->maImage = rImage;
+ mpButtonData->mpBitmapEx = NULL;
+ mpButtonData->maImage = rImage;
- StateChanged( STATE_CHANGE_DATA );
+ StateChanged( STATE_CHANGE_DATA );
+ }
}
- return sal_True;
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ if( rImage != mpButtonData->maImageHC )
+ {
+ delete mpButtonData->mpBitmapExHC;
+
+ mpButtonData->mpBitmapExHC = NULL;
+ mpButtonData->maImageHC = rImage;
+
+ StateChanged( STATE_CHANGE_DATA );
+ }
+ }
+ else
+ return FALSE;
+
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Image Button::GetModeImage( ) const
+const Image Button::GetModeImage( BmpColorMode eMode ) const
{
- return mpButtonData->maImage;
+ if( eMode == BMP_COLOR_NORMAL )
+ {
+ return mpButtonData->maImage;
+ }
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ return mpButtonData->maImageHC;
+ }
+ else
+ return Image();
}
// -----------------------------------------------------------------------
-sal_Bool Button::HasImage() const
+BOOL Button::HasImage() const
{
return !!(mpButtonData->maImage);
}
@@ -250,24 +273,43 @@ ImageAlign Button::GetImageAlign() const
}
// -----------------------------------------------------------------------
-sal_Bool Button::SetModeBitmap( const BitmapEx& rBitmap )
+BOOL Button::SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode )
{
- if ( SetModeImage( rBitmap ) )
+ if ( SetModeImage( rBitmap, eMode ) )
{
- if ( !mpButtonData->mpBitmapEx )
- mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
- return sal_True;
+ if( eMode == BMP_COLOR_NORMAL )
+ {
+ if ( !mpButtonData->mpBitmapEx )
+ mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
+ }
+ else if ( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ if ( !mpButtonData->mpBitmapExHC )
+ mpButtonData->mpBitmapExHC = new BitmapEx( rBitmap );
+ }
+ else
+ return FALSE;
+
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-BitmapEx Button::GetModeBitmap( ) const
+BitmapEx Button::GetModeBitmap( BmpColorMode eMode ) const
{
BitmapEx aBmp;
- if ( mpButtonData->mpBitmapEx )
- aBmp = *( mpButtonData->mpBitmapEx );
+ if ( eMode == BMP_COLOR_NORMAL )
+ {
+ if ( mpButtonData->mpBitmapEx )
+ aBmp = *( mpButtonData->mpBitmapEx );
+ }
+ else if ( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ if ( mpButtonData->mpBitmapExHC )
+ aBmp = *( mpButtonData->mpBitmapExHC );
+ }
return aBmp;
}
@@ -298,11 +340,11 @@ void Button::ImplSetSymbolRect( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-sal_uInt16 Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
- sal_uLong nDrawFlags )
+USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
+ ULONG nDrawFlags )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
+ USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
@@ -329,15 +371,15 @@ sal_uInt16 Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
// -----------------------------------------------------------------------
void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
- Size& rSize, sal_Bool bLayout,
- sal_uLong nImageSep, sal_uLong nDrawFlags,
- sal_uInt16 nTextStyle, Rectangle *pSymbolRect,
+ Size& rSize, BOOL bLayout,
+ ULONG nImageSep, ULONG nDrawFlags,
+ USHORT nTextStyle, Rectangle *pSymbolRect,
bool bAddImageSep )
{
XubString aText( GetText() );
- 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;
+ BOOL bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
+ BOOL bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
+ BOOL bHasSymbol = pSymbolRect ? TRUE : FALSE;
// No text and no image => nothing to do => return
if ( !bDrawImage && !bDrawText && !bHasSymbol )
@@ -359,7 +401,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
-
+
// Drawing text or symbol only is simple, use style and output rectangle
if ( bHasSymbol && !bDrawImage && !bDrawText )
{
@@ -381,6 +423,15 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Image *pImage = &(mpButtonData->maImage);
BitmapEx *pBitmapEx = mpButtonData->mpBitmapEx;
+ if( !!(mpButtonData->maImageHC) )
+ {
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ pImage = &(mpButtonData->maImageHC);
+ pBitmapEx = mpButtonData->mpBitmapExHC;
+ }
+ }
+
if ( pBitmapEx && ( pDev->GetOutDevType() == OUTDEV_PRINTER ) )
{
// Die Groesse richtet sich nach dem Bildschirm, soll auf
@@ -432,21 +483,21 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
if ( bDrawText )
{
- if ( ( eImageAlign == IMAGEALIGN_LEFT_TOP ) ||
- ( eImageAlign == IMAGEALIGN_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_LEFT_BOTTOM ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT_TOP ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT_BOTTOM ) )
+ if ( ( eImageAlign == IMAGEALIGN_LEFT_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_LEFT_BOTTOM ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT_BOTTOM ) )
{
aRect.Right() -= ( aImageSize.Width() + nImageSep );
}
- else if ( ( eImageAlign == IMAGEALIGN_TOP_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_TOP ) ||
- ( eImageAlign == IMAGEALIGN_TOP_RIGHT ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM_RIGHT ) )
+ else if ( ( eImageAlign == IMAGEALIGN_TOP_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_TOP_RIGHT ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM_RIGHT ) )
{
aRect.Bottom() -= ( aImageSize.Height() + nImageSep );
}
@@ -458,7 +509,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
if ( aTSSize.Height() < aTextSize.Height() )
aTSSize.Height() = aTextSize.Height();
-
+
if( bAddImageSep && bDrawImage )
{
long nDiff = (aImageSize.Height() - aTextSize.Height()) / 3;
@@ -467,7 +518,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- aMax.Width() = aTSSize.Width() > aImageSize.Width() ? aTSSize.Width() : aImageSize.Width();
+ aMax.Width() = aTSSize.Width() > aImageSize.Width() ? aTSSize.Width() : aImageSize.Width();
aMax.Height() = aTSSize.Height() > aImageSize.Height() ? aTSSize.Height() : aImageSize.Height();
// Now calculate the output area for the image and the text acording to the image align flags
@@ -588,7 +639,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
if ( ! ( nDrawFlags & WINDOW_DRAW_NODISABLE ) &&
! IsEnabled() )
@@ -633,9 +684,9 @@ void Button::ImplSetFocusRect( const Rectangle &rFocusRect )
aFocusRect.Bottom()++;
}
- if ( aFocusRect.Left() < aOutputRect.Left() ) aFocusRect.Left() = aOutputRect.Left();
- if ( aFocusRect.Top() < aOutputRect.Top() ) aFocusRect.Top() = aOutputRect.Top();
- if ( aFocusRect.Right() > aOutputRect.Right() ) aFocusRect.Right() = aOutputRect.Right();
+ if ( aFocusRect.Left() < aOutputRect.Left() ) aFocusRect.Left() = aOutputRect.Left();
+ if ( aFocusRect.Top() < aOutputRect.Top() ) aFocusRect.Top() = aOutputRect.Top();
+ if ( aFocusRect.Right() > aOutputRect.Right() ) aFocusRect.Right() = aOutputRect.Right();
if ( aFocusRect.Bottom() > aOutputRect.Bottom() ) aFocusRect.Bottom() = aOutputRect.Bottom();
mpButtonData->maFocusRect = aFocusRect;
@@ -648,13 +699,13 @@ const Rectangle& Button::ImplGetFocusRect() const
}
// -----------------------------------------------------------------------
-sal_uInt16& Button::ImplGetButtonState()
+USHORT& Button::ImplGetButtonState()
{
return mpButtonData->mnButtonState;
}
// -----------------------------------------------------------------------
-sal_uInt16 Button::ImplGetButtonState() const
+USHORT Button::ImplGetButtonState() const
{
return mpButtonData->mnButtonState;
}
@@ -674,15 +725,14 @@ SymbolAlign Button::ImplGetSymbolAlign() const
{
return mpButtonData->meSymbolAlign;
}
-
// -----------------------------------------------------------------------
-void Button::ImplSetSmallSymbol( sal_Bool bSmall )
+void Button::ImplSetSmallSymbol( BOOL bSmall )
{
mpButtonData->mbSmallSymbol = bSmall;
}
// -----------------------------------------------------------------------
-void Button::EnableImageDisplay( sal_Bool bEnable )
+void Button::EnableImageDisplay( BOOL bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOIMAGE;
@@ -691,13 +741,13 @@ void Button::EnableImageDisplay( sal_Bool bEnable )
}
// -----------------------------------------------------------------------
-sal_Bool Button::IsImageDisplayEnabled()
+BOOL Button::IsImageDisplayEnabled()
{
return (mpButtonData->mnButtonState & BUTTON_DRAW_NOIMAGE) == 0;
}
// -----------------------------------------------------------------------
-void Button::EnableTextDisplay( sal_Bool bEnable )
+void Button::EnableTextDisplay( BOOL bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOTEXT;
@@ -706,12 +756,53 @@ void Button::EnableTextDisplay( sal_Bool bEnable )
}
// -----------------------------------------------------------------------
-sal_Bool Button::IsTextDisplayEnabled()
+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);
@@ -726,14 +817,14 @@ bool Button::IsSmallSymbol () const
void PushButton::ImplInitPushButtonData()
{
- mpWindowImpl->mbPushButton = sal_True;
+ mpWindowImpl->mbPushButton = TRUE;
meSymbol = SYMBOL_NOSYMBOL;
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
mnDDStyle = 0;
- mbPressed = sal_False;
- mbInUserDraw = sal_False;
+ mbPressed = FALSE;
+ mbInUserDraw = FALSE;
}
// -----------------------------------------------------------------------
@@ -746,7 +837,7 @@ void PushButton::ImplInit( Window* pParent, WinBits nStyle )
if ( nStyle & WB_NOLIGHTBORDER )
ImplGetButtonState() |= BUTTON_DRAW_NOLIGHTBORDER;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -764,10 +855,10 @@ WinBits PushButton::ImplInitStyle( const Window* pPrevWindow, WinBits nStyle )
if ( !(nStyle & WB_NOGROUP) &&
(!pPrevWindow ||
- ((pPrevWindow->GetType() != WINDOW_PUSHBUTTON ) &&
- (pPrevWindow->GetType() != WINDOW_OKBUTTON ) &&
+ ((pPrevWindow->GetType() != WINDOW_PUSHBUTTON) &&
+ (pPrevWindow->GetType() != WINDOW_OKBUTTON) &&
(pPrevWindow->GetType() != WINDOW_CANCELBUTTON) &&
- (pPrevWindow->GetType() != WINDOW_HELPBUTTON )) ) )
+ (pPrevWindow->GetType() != WINDOW_HELPBUTTON)) ) )
nStyle |= WB_GROUP;
return nStyle;
}
@@ -787,8 +878,8 @@ const Color& PushButton::GetCanonicalTextColor( const StyleSettings& _rStyle ) c
// -----------------------------------------------------------------------
-void PushButton::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void PushButton::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -798,21 +889,20 @@ void PushButton::ImplInitSettings( sal_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 ) ||
- (GetStyle() & WB_FLATBUTTON) != 0 )
+ if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON)
? false
: ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
}
}
}
@@ -820,13 +910,132 @@ void PushButton::ImplInitSettings( sal_Bool bFont,
// -----------------------------------------------------------------------
void PushButton::ImplDrawPushButtonFrame( Window* pDev,
- Rectangle& rRect, sal_uInt16 nStyle )
+ Rectangle& rRect, USHORT 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 );
@@ -847,22 +1056,36 @@ void PushButton::ImplDrawPushButtonFrame( Window* pDev,
// -----------------------------------------------------------------------
-sal_Bool PushButton::ImplHitTestPushButton( Window* pDev,
+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 );
}
// -----------------------------------------------------------------------
-sal_uInt16 PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
+USHORT PushButton::ImplGetTextStyle( ULONG nDrawFlags ) const
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
+ USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
if ( ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) ||
( nDrawFlags & WINDOW_DRAW_MONO ) )
@@ -897,7 +1120,7 @@ sal_uInt16 PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
long nX, long nY,
- Color& rColor, sal_Bool bBlack )
+ Color& rColor, BOOL bBlack )
{
Color aOldLineColor = pDev->GetLineColor();
Color aOldFillColor = pDev->GetFillColor();
@@ -923,18 +1146,16 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
// -----------------------------------------------------------------------
-void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
+void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
const Rectangle& rRect,
- bool bLayout,
- bool bMenuBtnSep
- )
+ bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aInRect = rRect;
Color aColor;
XubString aText = PushButton::GetText(); // PushButton:: wegen MoreButton
- sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
- sal_uInt16 nStyle;
+ USHORT nTextStyle = ImplGetTextStyle( nDrawFlags );
+ USHORT nStyle;
if( aInRect.nRight < aInRect.nLeft || aInRect.nBottom < aInRect.nTop )
aInRect.SetEmpty();
@@ -961,7 +1182,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
Size aSize = rRect.GetSize();
Point aPos = rRect.TopLeft();
- sal_uLong nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
+ ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
if( nImageSep < 1 )
nImageSep = 1;
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
@@ -975,22 +1196,19 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
aSize.Width() -= ( 5 + nSymbolSize );
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
- nDrawFlags, nTextStyle, NULL, true );
+ nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
}
else
ImplCalcSymbolRect( aInRect );
if( ! bLayout )
{
- long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
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 );
- }
+ 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 );
aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
aInRect.Left() -= 2*nDistance;
ImplSetSymbolRect( aInRect );
@@ -1002,7 +1220,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
// 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, true );
+ nTextStyle, IsSymbol() ? &aSymbolRect : NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
if ( IsSymbol() && ! bLayout )
{
@@ -1013,7 +1231,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
{
- sal_Bool bBlack = sal_False;
+ BOOL bBlack = FALSE;
Color aArrowColor( COL_BLACK );
if ( !(nDrawFlags & WINDOW_DRAW_MONO) )
@@ -1023,7 +1241,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
else
{
aArrowColor = Color( COL_LIGHTGREEN );
- bBlack = sal_True;
+ bBlack = TRUE;
}
}
@@ -1051,13 +1269,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
if( !bLayout )
HideFocus();
- sal_uInt16 nButtonStyle = ImplGetButtonState();
+ USHORT nButtonStyle = ImplGetButtonState();
Point aPoint;
Size aOutSz( GetOutputSizePixel() );
Rectangle aRect( aPoint, aOutSz );
Rectangle aInRect = aRect;
Rectangle aTextRect;
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
// adjust style if button should be rendered 'pressed'
if ( mbPressed )
@@ -1087,7 +1305,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
break;
}
- sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX ) )
{
@@ -1098,11 +1316,11 @@ void PushButton::ImplDrawPushButton( bool bLayout )
{
Edit* pEdit = static_cast<Edit*>(GetParent());
if( pEdit->ImplUseNativeBorder( pEdit->GetStyle() ) )
- bNativeOK = sal_True;
+ bNativeOK = TRUE;
}
else if( GetParent()->IsNativeControlSupported( aCtrlType, HAS_BACKGROUND_TEXTURE) )
{
- bNativeOK = sal_True;
+ bNativeOK = TRUE;
}
if( !bNativeOK && GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN ) )
{
@@ -1112,11 +1330,11 @@ void PushButton::ImplDrawPushButton( bool bLayout )
ImplControlValue aControlValue;
ControlState nState = 0;
- if ( mbPressed ) nState |= CTRL_STATE_PRESSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
- if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
- if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( mbPressed ) nState |= CTRL_STATE_PRESSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
@@ -1131,27 +1349,21 @@ void PushButton::ImplDrawPushButton( bool bLayout )
return;
bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
- bool bDrawMenuSep = true;
- if( (GetStyle() & WB_FLATBUTTON) )
- {
- if( ! bRollOver && ! HasFocus() )
- bDrawMenuSep = false;
- }
- if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
PushButtonValue aControlValue;
- Rectangle aCtrlRegion( aInRect );
- ControlState nState = 0;
+ Rectangle aCtrlRegion( aInRect );
+ ControlState nState = 0;
if ( mbPressed || IsChecked() ) nState |= CTRL_STATE_PRESSED;
if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
- if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
- if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
if ( bRollOver )
nState |= CTRL_STATE_ROLLOVER;
-
+
if( GetStyle() & WB_BEVELBUTTON )
aControlValue.mbBevelButton = true;
@@ -1166,7 +1378,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
aInRect.Bottom()-=4;
aInRect.Left()+=4;
aInRect.Right()-=4;
-
+
// prepare single line hint (needed on mac to decide between normal push button and
// rectangular bevel button look)
Size aFontSize( Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetSize() );
@@ -1187,13 +1399,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, bDrawMenuSep );
+ aInRect, bLayout );
if ( HasFocus() )
ShowFocus( ImplGetFocusRect() );
}
- if ( bNativeOK == sal_False )
+ if ( bNativeOK == FALSE )
{
// draw PushButtonFrame, aInRect has content size afterwards
if( (GetStyle() & WB_FLATBUTTON) )
@@ -1213,7 +1425,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
}
// draw content
- ImplDrawPushButtonContent( this, 0, aInRect, bLayout, bDrawMenuSep );
+ ImplDrawPushButtonContent( this, 0, aInRect, bLayout );
if( ! bLayout && HasFocus() )
{
@@ -1224,21 +1436,21 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// -----------------------------------------------------------------------
-void PushButton::ImplSetDefButton( sal_Bool bSet )
+void PushButton::ImplSetDefButton( BOOL bSet )
{
Size aSize( GetSizePixel() );
Point aPos( GetPosPixel() );
int dLeft(0), dRight(0), dTop(0), dBottom(0);
- sal_Bool bSetPos = sal_False;
+ BOOL bSetPos = FALSE;
- if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
+ if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
Rectangle aBound, aCont;
Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
// will not work if the theme has dynamic adornment sizes
ImplControlValue aControlValue;
- Rectangle aCtrlRegion( aCtrlRect );
- ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
+ Rectangle aCtrlRegion( aCtrlRect );
+ ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
// get native size of a 'default' button
// and adjust the VCL button if more space for adornment is required
@@ -1284,7 +1496,7 @@ void PushButton::ImplSetDefButton( sal_Bool bSet )
// -----------------------------------------------------------------------
-sal_Bool PushButton::ImplIsDefButton() const
+BOOL PushButton::ImplIsDefButton() const
{
return (ImplGetButtonState() & BUTTON_DRAW_DEFAULT) != 0;
}
@@ -1334,7 +1546,7 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() &&
ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
{
- sal_uInt16 nTrackFlags = 0;
+ USHORT nTrackFlags = 0;
if ( ( GetStyle() & WB_REPEAT ) &&
! ( GetStyle() & WB_TOGGLE ) )
@@ -1367,11 +1579,11 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
{
if ( IsChecked() )
{
- Check( sal_False );
+ Check( FALSE );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( sal_True );
+ Check( TRUE );
}
}
else
@@ -1456,11 +1668,11 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
{
if ( IsChecked() )
{
- Check( sal_False );
+ Check( FALSE );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( sal_True );
+ Check( TRUE );
Toggle();
}
@@ -1495,7 +1707,7 @@ void PushButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1527,14 +1739,14 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextFillColor();
DecorationView aDecoView( pDev );
- sal_uInt16 nButtonStyle = 0;
+ USHORT 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, true );
+ ImplDrawPushButtonContent( pDev, nFlags, aRect, false );
pDev->Pop();
}
@@ -1599,17 +1811,17 @@ void PushButton::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -1625,7 +1837,7 @@ void PushButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -1667,7 +1879,7 @@ long PushButton::PreNotify( NotifyEvent& rNEvt )
break;
}
- sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, PART_ENTIRE_CONTROL) &&
!GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
@@ -1730,7 +1942,7 @@ SymbolAlign PushButton::GetSymbolAlign() const
// -----------------------------------------------------------------------
-void PushButton::SetDropDown( sal_uInt16 nStyle )
+void PushButton::SetDropDown( USHORT nStyle )
{
if ( mnDDStyle != nStyle )
{
@@ -1766,7 +1978,7 @@ void PushButton::SetState( TriState eState )
// -----------------------------------------------------------------------
-void PushButton::SetPressed( sal_Bool bPressed )
+void PushButton::SetPressed( BOOL bPressed )
{
if ( mbPressed != bPressed )
{
@@ -1807,7 +2019,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
aSize = GetModeImage().GetSizePixel();
if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
- sal_uLong nDrawFlags = 0;
+ 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 );
@@ -1822,7 +2034,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
}
return CalcWindowSize( aSize );
-}
+}
Size PushButton::GetOptimalSize(WindowSizeType eType) const
{
@@ -1880,7 +2092,7 @@ void OKButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( sal_True );
+ ((Dialog*)pParent)->EndDialog( TRUE );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -1946,7 +2158,7 @@ void CancelButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( sal_False );
+ ((Dialog*)pParent)->EndDialog( FALSE );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -2020,10 +2232,10 @@ void HelpButton::Click()
void RadioButton::ImplInitRadioButtonData()
{
- mbChecked = sal_False;
- mbSaveValue = sal_False;
- mbRadioCheck = sal_True;
- mbStateChanged = sal_False;
+ mbChecked = FALSE;
+ mbSaveValue = FALSE;
+ mbRadioCheck = TRUE;
+ mbStateChanged = FALSE;
}
// -----------------------------------------------------------------------
@@ -2033,7 +2245,7 @@ void RadioButton::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -2068,8 +2280,8 @@ const Color& RadioButton::GetCanonicalTextColor( const StyleSettings& _rStyle )
// -----------------------------------------------------------------------
-void RadioButton::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void RadioButton::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -2079,18 +2291,18 @@ void RadioButton::ImplInitSettings( sal_Bool bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -2100,6 +2312,9 @@ void RadioButton::ImplInitSettings( sal_Bool bFont,
}
}
+//---------------------------------------------------------------------
+//--- 12.03.2003 18:46:14 ---------------------------------------------
+
void RadioButton::DrawRadioButtonState( )
{
ImplDrawRadioButtonState( );
@@ -2123,19 +2338,20 @@ void RadioButton::ImplInvalidateOrDrawRadioButtonState()
void RadioButton::ImplDrawRadioButtonState()
{
- sal_Bool bNativeOK = sal_False;
+ USHORT nButtonStyle = 0;
+ BOOL bNativeOK = FALSE;
// no native drawing for image radio buttons
- if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
+ if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
- ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
- Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
- ControlState nState = 0;
+ ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+ Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
+ ControlState nState = 0;
- if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
- if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
- if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
@@ -2145,12 +2361,12 @@ void RadioButton::ImplDrawRadioButtonState()
}
-if ( bNativeOK == sal_False )
+if ( bNativeOK == FALSE )
{
// kein Image-RadioButton
if ( !maImage )
{
- sal_uInt16 nStyle = ImplGetButtonState();
+ USHORT nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( mbChecked )
@@ -2169,13 +2385,13 @@ if ( bNativeOK == sal_False )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
- sal_Bool bEnabled = IsEnabled();
- sal_uInt16 nButtonStyle = FRAME_DRAW_DOUBLEIN;
+ BOOL bEnabled = IsEnabled();
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
// Border und Selektionsstatus ausgeben
+ nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageRect = aDecoView.DrawFrame( aImageRect, nButtonStyle );
if ( (ImplGetButtonState() & BUTTON_DRAW_PRESSED) || !bEnabled )
SetFillColor( rStyleSettings.GetFaceColor() );
@@ -2189,7 +2405,13 @@ if ( bNativeOK == sal_False )
if ( !bEnabled )
nButtonStyle |= IMAGE_DRAW_DISABLE;
+ // check for HC mode
Image *pImage = &maImage;
+ if( !!maImageHC )
+ {
+ if( rStyleSettings.GetHighContrastMode() )
+ pImage = &maImageHC;
+ }
Point aImagePos( aImageRect.TopLeft() );
aImagePos.X() += (aImageRect.GetWidth()-aImageSize.Width())/2;
@@ -2233,7 +2455,7 @@ if ( bNativeOK == sal_False )
// -----------------------------------------------------------------------
-void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
@@ -2241,8 +2463,8 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
Rectangle aRect( rPos, rSize );
- MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
pDev->Push( PUSH_CLIPREGION );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
@@ -2253,7 +2475,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -2327,7 +2549,7 @@ da im Writer ansonsten die Images noch weiter oben haengen
}
else
{
- sal_Bool bTopImage = (nWinStyle & WB_TOP) != 0;
+ BOOL bTopImage = (nWinStyle & WB_TOP) != 0;
Size aImageSize = maImage.GetSizePixel();
Rectangle aImageRect( rPos, rSize );
long nTextHeight = pDev->GetTextHeight();
@@ -2389,7 +2611,7 @@ void RadioButton::ImplDrawRadioButton( bool bLayout )
ImplDraw( this, 0, Point(), GetOutputSizePixel(),
aImageSize, maStateRect, maMouseRect, bLayout );
- if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==sal_True) )
+ if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==TRUE) )
{
if ( !maImage && HasFocus() )
ShowFocus( ImplGetFocusRect() );
@@ -2404,7 +2626,7 @@ void RadioButton::GetRadioButtonGroup( std::vector< RadioButton* >& io_rGroup, b
{
// empty the list
io_rGroup.clear();
-
+
// go back to first in group;
Window* pFirst = const_cast<RadioButton*>(this);
while( ( pFirst->GetStyle() & WB_GROUP ) == 0 )
@@ -2449,7 +2671,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( sal_False );
+ ((RadioButton*)pWindow)->SetState( FALSE );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2480,7 +2702,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( sal_False );
+ ((RadioButton*)pWindow)->SetState( FALSE );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2496,10 +2718,10 @@ void RadioButton::ImplUncheckAllOther()
// -----------------------------------------------------------------------
-void RadioButton::ImplCallClick( sal_Bool bGrabFocus, sal_uInt16 nFocusFlags )
+void RadioButton::ImplCallClick( BOOL bGrabFocus, USHORT nFocusFlags )
{
mbStateChanged = !mbChecked;
- mbChecked = sal_True;
+ mbChecked = TRUE;
mpWindowImpl->mnStyle |= WB_TABSTOP;
ImplInvalidateOrDrawRadioButtonState();
ImplDelData aDelData;
@@ -2520,7 +2742,7 @@ void RadioButton::ImplCallClick( sal_Bool bGrabFocus, sal_uInt16 nFocusFlags )
if ( aDelData.IsDelete() )
return;
ImplRemoveDel( &aDelData );
- mbStateChanged = sal_False;
+ mbStateChanged = FALSE;
}
// -----------------------------------------------------------------------
@@ -2554,9 +2776,9 @@ void RadioButton::ImplLoadRes( const ResId& rResId )
Button::ImplLoadRes( rResId );
//anderer Wert als Default ?
- sal_uInt16 nChecked = ReadShortRes();
+ USHORT nChecked = ReadShortRes();
if ( nChecked )
- SetState( sal_True );
+ SetState( TRUE );
}
// -----------------------------------------------------------------------
@@ -2677,7 +2899,7 @@ void RadioButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
if ( !maImage )
{
@@ -2747,7 +2969,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
}
else
{
- OSL_FAIL( "RadioButton::Draw() - not implemented for RadioButton with Image" );
+ DBG_ERROR( "RadioButton::Draw() - not implemented for RadioButton with Image" );
}
}
@@ -2816,17 +3038,17 @@ void RadioButton::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -2842,7 +3064,7 @@ void RadioButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -2885,26 +3107,43 @@ void RadioButton::Toggle()
// -----------------------------------------------------------------------
-sal_Bool RadioButton::SetModeRadioImage( const Image& rImage )
+BOOL RadioButton::SetModeRadioImage( const Image& rImage, BmpColorMode eMode )
+{
+ if( eMode == BMP_COLOR_NORMAL )
{
if ( rImage != maImage )
{
maImage = rImage;
StateChanged( STATE_CHANGE_DATA );
}
- return sal_True;
+}
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ if( maImageHC != rImage )
+ {
+ maImageHC = rImage;
+ StateChanged( STATE_CHANGE_DATA );
+ }
+ }
+ else
+ return FALSE;
+
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Image& RadioButton::GetModeRadioImage( ) const
+const Image& RadioButton::GetModeRadioImage( BmpColorMode eMode ) const
{
- return maImage;
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maImageHC;
+ else
+ return maImage;
}
// -----------------------------------------------------------------------
-void RadioButton::SetState( sal_Bool bCheck )
+void RadioButton::SetState( BOOL bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -2922,7 +3161,7 @@ void RadioButton::SetState( sal_Bool bCheck )
// -----------------------------------------------------------------------
-void RadioButton::Check( sal_Bool bCheck )
+void RadioButton::Check( BOOL bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -2968,8 +3207,8 @@ Size RadioButton::ImplGetRadioImageSize() const
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
- Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
- ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
+ Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
+ ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
Rectangle aBoundingRgn, aContentRgn;
// get native size of a radio button
@@ -2988,7 +3227,7 @@ Size RadioButton::ImplGetRadioImageSize() const
static void LoadThemedImageList (const StyleSettings &rStyleSettings,
ImageList *pList, const ResId &rResId,
- sal_uInt16 nImages)
+ USHORT nImages)
{
Color aColorAry1[6];
Color aColorAry2[6];
@@ -3008,15 +3247,15 @@ static void LoadThemedImageList (const StyleSettings &rStyleSettings,
Color aMaskColor(0x00, 0x00, 0xFF );
DBG_ASSERT( sizeof(aColorAry1) == sizeof(aColorAry2), "aColorAry1 must match aColorAry2" );
// FIXME: do we want the mask for the checkbox ?
- pList->InsertFromHorizontalBitmap (rResId, nImages, &aMaskColor,
+ pList->InsertFromHorizontalBitmap (rResId, nImages, &aMaskColor,
aColorAry1, aColorAry2, sizeof(aColorAry1) / sizeof(Color));
}
-Image RadioButton::GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags )
+Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = rStyleSettings.GetRadioButtonStyle() & STYLE_RADIOBUTTON_STYLE;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_RADIOBUTTON_MONO;
@@ -3052,14 +3291,13 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlag
ResMgr* pResMgr = ImplGetResMgr();
pSVData->maCtrlData.mpRadioImgList = new ImageList();
if( pResMgr )
- LoadThemedImageList( rStyleSettings,
+ LoadThemedImageList( rStyleSettings,
pSVData->maCtrlData.mpRadioImgList,
- ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ), 6
- );
- pSVData->maCtrlData.mnRadioStyle = nStyle;
+ ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ), 6 );
+ pSVData->maCtrlData.mnRadioStyle = nStyle;
}
- sal_uInt16 nId;
+ USHORT nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_CHECKED )
@@ -3095,21 +3333,21 @@ void RadioButton::ImplSetMinimumNWFSize()
Size aCurSize( GetSizePixel() );
Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
Rectangle aBoundingRgn, aContentRgn;
-
+
// get native size of a radiobutton
if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
Size aSize = aContentRgn.GetSize();
-
+
if( aSize.Height() > aCurSize.Height() )
{
aCurSize.Height() = aSize.Height();
SetSizePixel( aCurSize );
}
}
-
+
Pop();
}
@@ -3140,13 +3378,13 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const
if ( aSize.Height() < aTextSize.Height() )
aSize.Height() = aTextSize.Height();
}
-// else if ( !maImage )
-// {
+ else if ( !maImage )
+ {
/* da ansonsten im Writer die Control zu weit oben haengen
aSize.Width() += 2;
aSize.Height() += 2;
*/
-// }
+ }
return CalcWindowSize( aSize );
}
@@ -3169,7 +3407,7 @@ void CheckBox::ImplInitCheckBoxData()
{
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
- mbTriState = sal_False;
+ mbTriState = FALSE;
}
// -----------------------------------------------------------------------
@@ -3179,7 +3417,7 @@ void CheckBox::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -3209,8 +3447,8 @@ const Color& CheckBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void CheckBox::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void CheckBox::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -3220,18 +3458,18 @@ void CheckBox::ImplInitSettings( sal_Bool bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -3249,10 +3487,10 @@ void CheckBox::ImplLoadRes( const ResId& rResId )
if ( rResId.GetRT() != RSC_TRISTATEBOX )
{
- sal_uInt16 nChecked = ReadShortRes();
+ USHORT nChecked = ReadShortRes();
//anderer Wert als Default ?
if( nChecked )
- Check( sal_True );
+ Check( TRUE );
}
}
@@ -3274,18 +3512,18 @@ void CheckBox::ImplInvalidateOrDrawCheckBoxState()
void CheckBox::ImplDrawCheckBoxState()
{
- bool bNativeOK = sal_True;
+ bool bNativeOK = TRUE;
- if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == sal_True )
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == TRUE )
{
ImplControlValue aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRegion( maStateRect );
ControlState nState = 0;
- if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
- if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
- if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
+ if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
if ( meState == STATE_CHECK )
aControlValue.setTristateVal( BUTTONVALUE_ON );
@@ -3299,9 +3537,9 @@ void CheckBox::ImplDrawCheckBoxState()
aControlValue, rtl::OUString() );
}
- if ( bNativeOK == sal_False )
+ if ( bNativeOK == FALSE )
{
- sal_uInt16 nStyle = ImplGetButtonState();
+ USHORT nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( meState == STATE_DONTKNOW )
@@ -3318,14 +3556,14 @@ void CheckBox::ImplDrawCheckBoxState()
// -----------------------------------------------------------------------
-void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
{
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
-
+
pDev->Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
@@ -3333,7 +3571,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -3399,12 +3637,12 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
ImplSetFocusRect( rStateRect );
}
-
+
const int nLineSpace = 4;
if( (GetStyle() & WB_CBLINESTYLE) != 0 &&
rMouseRect.Right()-1-nLineSpace < rPos.X()+rSize.Width() )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
SetLineColor( Color( COL_BLACK ) );
else
@@ -3607,7 +3845,7 @@ void CheckBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
MapMode aResMapMode( MAP_100TH_MM );
Point aPos = pDev->LogicToPixel( rPos );
@@ -3797,17 +4035,17 @@ void CheckBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -3823,7 +4061,7 @@ void CheckBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -3842,9 +4080,9 @@ long CheckBox::PreNotify( NotifyEvent& rNEvt )
// trigger redraw if mouse over state has changed
if( IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
{
- if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
+ if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
!maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
- ( maMouseRect.IsInside( GetLastPointerPosPixel()) &&
+ ( maMouseRect.IsInside( GetLastPointerPosPixel()) &&
!maMouseRect.IsInside( GetPointerPosPixel()) ) ||
pMouseEvt->IsLeaveWindow() || pMouseEvt->IsEnterWindow() )
{
@@ -3881,7 +4119,7 @@ void CheckBox::SetState( TriState eState )
// -----------------------------------------------------------------------
-void CheckBox::EnableTriState( sal_Bool bTriState )
+void CheckBox::EnableTriState( BOOL bTriState )
{
if ( mbTriState != bTriState )
{
@@ -3913,10 +4151,10 @@ Size CheckBox::ImplGetCheckImageSize() const
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
- Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
- ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
+ Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
+ ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
Rectangle aBoundingRgn, aContentRgn;
-
+
// get native size of a check box
if( pThis->GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, rtl::OUString(),
@@ -3926,16 +4164,16 @@ Size CheckBox::ImplGetCheckImageSize() const
bDefaultSize = false;
}
}
- if( bDefaultSize )
+ if( bDefaultSize )
aSize = GetCheckImage( GetSettings(), 0 ).GetSizePixel();
return aSize;
}
-Image CheckBox::GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags )
+Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = rStyleSettings.GetCheckBoxStyle() & STYLE_CHECKBOX_STYLE;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_CHECKBOX_MONO;
@@ -3962,7 +4200,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags )
pSVData->maCtrlData.mnCheckStyle = nStyle;
}
- sal_uInt16 nId;
+ USHORT nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_DONTKNOW )
@@ -4004,21 +4242,21 @@ void CheckBox::ImplSetMinimumNWFSize()
Size aCurSize( GetSizePixel() );
Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
Rectangle aBoundingRgn, aContentRgn;
-
+
// get native size of a radiobutton
if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
Size aSize = aContentRgn.GetSize();
-
+
if( aSize.Height() > aCurSize.Height() )
{
aCurSize.Height() = aSize.Height();
SetSizePixel( aCurSize );
}
}
-
+
Pop();
}
@@ -4090,7 +4328,7 @@ ImageButton::ImageButton( Window* pParent, WinBits nStyle ) :
ImageButton::ImageButton( Window* pParent, const ResId& rResId ) :
PushButton( pParent, rResId.SetRT( RSC_IMAGEBUTTON ) )
{
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( RSC_IMAGEBUTTON_IMAGE & nObjMask )
{
@@ -4139,7 +4377,7 @@ ImageRadioButton::ImageRadioButton( Window* pParent, WinBits nStyle ) :
ImageRadioButton::ImageRadioButton( Window* pParent, const ResId& rResId ) :
RadioButton( pParent, rResId.SetRT( RSC_IMAGERADIOBUTTON ) )
{
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( RSC_IMAGERADIOBUTTON_IMAGE & nObjMask )
{
@@ -4159,7 +4397,7 @@ ImageRadioButton::~ImageRadioButton()
TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
CheckBox( pParent, nStyle )
{
- EnableTriState( sal_True );
+ EnableTriState( TRUE );
}
// -----------------------------------------------------------------------
@@ -4167,15 +4405,15 @@ TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
TriStateBox::TriStateBox( Window* pParent, const ResId& rResId ) :
CheckBox( pParent, rResId.SetRT( RSC_TRISTATEBOX ) )
{
- EnableTriState( sal_True );
+ EnableTriState( TRUE );
- sal_uLong nTriState = ReadLongRes();
- sal_uInt16 bDisableTriState = ReadShortRes();
+ ULONG nTriState = ReadLongRes();
+ USHORT bDisableTriState = ReadShortRes();
//anderer Wert als Default ?
if ( (TriState)nTriState != STATE_NOCHECK )
SetState( (TriState)nTriState );
if ( bDisableTriState )
- EnableTriState( sal_False );
+ EnableTriState( FALSE );
}
// -----------------------------------------------------------------------
@@ -4208,16 +4446,16 @@ void DisclosureButton::ImplDrawCheckBoxState()
would have to be overloaded for DisclosureButton; also GetNativeControlRegion
for CTRL_LISTNODE would have to be implemented and taken into account
*/
-
+
Rectangle aStateRect( GetStateRect() );
-
+
ImplControlValue aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRegion( aStateRect );
ControlState nState = 0;
- if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
- if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
- if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
if ( IsMouseOver() && GetMouseRect().IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
@@ -4227,20 +4465,27 @@ void DisclosureButton::ImplDrawCheckBoxState()
ImplSVCtrlData& rCtrlData( ImplGetSVData()->maCtrlData );
if( ! rCtrlData.mpDisclosurePlus )
rCtrlData.mpDisclosurePlus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS ) ) );
+ if( ! rCtrlData.mpDisclosurePlusHC )
+ rCtrlData.mpDisclosurePlusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS_HC ) ) );
if( ! rCtrlData.mpDisclosureMinus )
rCtrlData.mpDisclosureMinus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS ) ) );
-
+ if( ! rCtrlData.mpDisclosureMinusHC )
+ rCtrlData.mpDisclosureMinusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS_HC ) ) );
+
Image* pImg = NULL;
- pImg = IsChecked() ? rCtrlData.mpDisclosureMinus : rCtrlData.mpDisclosurePlus;
-
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImg = IsChecked() ? rCtrlData.mpDisclosureMinusHC : rCtrlData.mpDisclosurePlusHC;
+ else
+ pImg = IsChecked() ? rCtrlData.mpDisclosureMinus : rCtrlData.mpDisclosurePlus;
+
DBG_ASSERT( pImg, "no disclosure image" );
if( ! pImg )
return;
-
- sal_uInt16 nStyle = 0;
+
+ USHORT nStyle = 0;
if( ! IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
-
+
Size aSize( aStateRect.GetSize() );
Size aImgSize( pImg->GetSizePixel() );
Point aOff( (aSize.Width() - aImgSize.Width())/2,
@@ -4267,4 +4512,5 @@ void DisclosureButton::KeyInput( const KeyEvent& rKEvt )
Button::KeyInput( rKEvt );
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 9881edd62ca3..178974de59c7 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -46,7 +46,7 @@
// =======================================================================
-inline sal_uLong ImplCreateKey( sal_uInt16 nPos )
+inline ULONG ImplCreateKey( USHORT 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( ' ' );
- sal_uInt16 nPos = pEntryList->FindEntry( aToken );
+ USHORT nPos = pEntryList->FindEntry( aToken );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
rSelectedPos.Insert( ImplCreateKey( nPos ), (void*)sal_IntPtr(1L) );
}
@@ -116,16 +116,16 @@ ComboBox::~ComboBox()
void ComboBox::ImplInitComboBoxData()
{
- mpSubEdit = NULL;
- mpBtn = NULL;
- mpImplLB = NULL;
- mpFloatWin = NULL;
+ mpSubEdit = NULL;
+ mpBtn = NULL;
+ mpImplLB = NULL;
+ mpFloatWin = NULL;
- mnDDHeight = 0;
- mbDDAutoSize = sal_True;
- mbSyntheticModify = sal_False;
- mbMatchCase = sal_False;
- mcMultiSep = ';';
+ mnDDHeight = 0;
+ mbDDAutoSize = TRUE;
+ mbSyntheticModify = FALSE;
+ mbMatchCase = FALSE;
+ mcMultiSep = ';';
}
// -----------------------------------------------------------------------
@@ -134,7 +134,7 @@ void ComboBox::ImplCalcEditHeight()
{
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- mnDDHeight = (sal_uInt16)(mpSubEdit->GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (USHORT)(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<sal_uInt16>( nNCHeight );
+ mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight );
}
}
@@ -160,7 +160,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
{
ImplInitStyle( nStyle );
- sal_Bool bNoBorder = ( nStyle & WB_NOBORDER ) ? sal_True : sal_False;
+ BOOL bNoBorder = ( nStyle & WB_NOBORDER ) ? TRUE : 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( sal_True );
+ mpFloatWin->SetAutoWidth( 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( sal_False );
+ mpSubEdit->EnableRTL( FALSE );
SetSubEdit( mpSubEdit );
mpSubEdit->SetPosPixel( Point() );
- EnableAutocomplete( sal_True );
+ EnableAutocomplete( 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( sal_True );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
ImplCalcEditHeight();
- SetCompoundControl( sal_True );
+ SetCompoundControl( TRUE );
}
// -----------------------------------------------------------------------
@@ -249,11 +249,11 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
{
Edit::ImplLoadRes( rResId );
- sal_uLong nNumber = ReadLongRes();
+ ULONG nNumber = ReadLongRes();
if( nNumber )
{
- for( sal_uInt16 i = 0; i < nNumber; i++ )
+ for( USHORT i = 0; i < nNumber; i++ )
{
InsertEntry( ReadStringRes(), LISTBOX_APPEND );
}
@@ -262,7 +262,7 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ComboBox::EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase )
+void ComboBox::EnableAutocomplete( BOOL bEnable, BOOL bMatchCase )
{
mbMatchCase = bMatchCase;
@@ -274,7 +274,7 @@ void ComboBox::EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase )
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsAutocompleteEnabled() const
+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 , sal_True );
- mpBtn->SetPressed( sal_True );
+ mpImplLB->SelectEntry( 0 , TRUE );
+ mpBtn->SetPressed( TRUE );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( sal_True );
+ mpFloatWin->StartFloat( 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(), sal_True );
- sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( sal_True );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
+ BOOL bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( TRUE );
Select();
mpImplLB->SetTravelSelect( bTravelSelect );
}
@@ -321,7 +321,7 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplLB )
mpImplLB->GetMainWindow()->ImplClearLayoutData();
- mpBtn->SetPressed( sal_False );
+ mpBtn->SetPressed( FALSE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -330,8 +330,8 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
{
- Selection aSel = pEdit->GetSelection();
- AutocompleteAction eAction = pEdit->GetAutocompleteAction();
+ Selection aSel = pEdit->GetSelection();
+ AutocompleteAction eAction = pEdit->GetAutocompleteAction();
/* If there is no current selection do not auto complete on
Tab/Shift-Tab since then we would not cycle to the next field.
@@ -339,38 +339,38 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
if ( aSel.Len() ||
((eAction != AUTOCOMPLETE_TABFORWARD) && (eAction != AUTOCOMPLETE_TABBACKWARD)) )
{
- XubString aFullText = pEdit->GetText();
- XubString aStartText = aFullText.Copy( 0, (xub_StrLen)aSel.Max() );
- sal_uInt16 nStart = mpImplLB->GetCurrentPos();
+ XubString aFullText = pEdit->GetText();
+ XubString aStartText = aFullText.Copy( 0, (xub_StrLen)aSel.Max() );
+ USHORT nStart = mpImplLB->GetCurrentPos();
if ( nStart == LISTBOX_ENTRY_NOTFOUND )
nStart = 0;
- sal_Bool bForward = sal_True;
+ BOOL bForward = TRUE;
if ( eAction == AUTOCOMPLETE_TABFORWARD )
nStart++;
else if ( eAction == AUTOCOMPLETE_TABBACKWARD )
{
- bForward = sal_False;
+ bForward = FALSE;
nStart = nStart ? nStart - 1 : mpImplLB->GetEntryList()->GetEntryCount()-1;
}
- sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
if( ! mbMatchCase )
{
// Try match case insensitive from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_True );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, 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, sal_True );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, TRUE );
}
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match full from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_False );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, FALSE );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Match full, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_False );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, FALSE );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
@@ -387,8 +387,8 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
{
- sal_Bool bPopup = IsInDropDown();
- sal_Bool bCallSelect = sal_False;
+ BOOL bPopup = IsInDropDown();
+ BOOL bCallSelect = FALSE;
if ( mpImplLB->IsSelectionChanged() || bPopup )
{
XubString aText;
@@ -400,11 +400,11 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
xub_StrLen nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
{
- xub_StrLen nPrevIndex = nIndex;
- XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex );
- xub_StrLen nTokenLen = aToken.Len();
+ xub_StrLen nPrevIndex = nIndex;
+ XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex );
+ xub_StrLen nTokenLen = aToken.Len();
aToken.EraseLeadingAndTrailingChars( ' ' );
- sal_uInt16 nP = mpImplLB->GetEntryList()->FindEntry( aToken );
+ USHORT 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() );
- sal_uInt16 nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
- for ( sal_uInt16 n = 0; n < nSelectedEntries; n++ )
+ USHORT nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
+ for ( USHORT n = 0; n < nSelectedEntries; n++ )
{
- sal_uInt16 nP = mpImplLB->GetEntryList()->GetSelectEntryPos( n );
+ USHORT 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 = sal_True;
+ bCallSelect = 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 = sal_True;
+ mbSyntheticModify = TRUE;
Modify();
- mbSyntheticModify = sal_False;
+ mbSyntheticModify = 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() )
{
- sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
+ USHORT nChanged = (USHORT)(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 , sal_True );
+ mpImplLB->SelectEntry( 0 , TRUE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( sal_True );
+ mpBtn->SetPressed( TRUE );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( sal_True );
+ mpFloatWin->StartFloat( TRUE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -548,7 +548,7 @@ void ComboBox::DoubleClick()
// -----------------------------------------------------------------------
-void ComboBox::EnableAutoSize( sal_Bool bAuto )
+void ComboBox::EnableAutoSize( BOOL bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -562,7 +562,7 @@ void ComboBox::EnableAutoSize( sal_Bool bAuto )
// -----------------------------------------------------------------------
-void ComboBox::EnableDDAutoWidth( sal_Bool b )
+void ComboBox::EnableDDAutoWidth( BOOL b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -570,15 +570,15 @@ void ComboBox::EnableDDAutoWidth( sal_Bool b )
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsDDAutoWidthEnabled() const
+BOOL ComboBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
}
// -----------------------------------------------------------------------
-void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
+void ComboBox::SetDropDownLineCount( USHORT nLines )
{
if ( mpFloatWin )
mpFloatWin->SetDropDownLineCount( nLines );
@@ -586,9 +586,9 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetDropDownLineCount() const
+USHORT ComboBox::GetDropDownLineCount() const
{
- sal_uInt16 nLines = 0;
+ USHORT nLines = 0;
if ( mpFloatWin )
nLines = mpFloatWin->GetDropDownLineCount();
return nLines;
@@ -597,7 +597,7 @@ sal_uInt16 ComboBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
void ComboBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -625,8 +625,8 @@ void ComboBox::Resize()
if( IsDropDownBox() )
{
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
- long nTop = 0;
- long nBottom = aOutSz.Height();
+ long nTop = 0;
+ long nBottom = aOutSz.Height();
Window *pBorder = GetWindow( WINDOW_BORDER );
ImplControlValue aControlValue;
@@ -758,7 +758,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? sal_True : sal_False );
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
}
else if( nType == STATE_CHANGE_MIRRORING )
{
@@ -813,7 +813,7 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
&& !IsReadOnly() )
{
KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
- sal_uInt16 nKeyCode = aKeyEvt.GetKeyCode().GetCode();
+ USHORT 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( sal_True );
+ mpBtn->SetPressed( TRUE );
if ( mpImplLB->GetEntryList()->GetMRUCount() )
- mpImplLB->SelectEntry( 0 , sal_True );
+ mpImplLB->SelectEntry( 0 , TRUE );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( sal_False );
+ mpFloatWin->StartFloat( 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( sal_True ) )
+ else if ( mpFloatWin->IsInPopupMode() && !HasChildPathFocus( TRUE ) )
mpFloatWin->EndPopupMode();
}
else if( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpSubEdit) )
{
- sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ USHORT 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( sal_False );
+ mpImplLB->SetCallSelectionChangedHdl( FALSE );
if ( !IsMultiSelectionEnabled() )
{
- XubString aSearchStr( mpSubEdit->GetText() );
- sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
- sal_Bool bSelect = sal_True;
+ XubString aSearchStr( mpSubEdit->GetText() );
+ USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
+ BOOL bSelect = 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 = sal_False;
+ bSelect = 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, sal_False );
+ mpImplLB->SelectEntry( nSelect, FALSE );
mpImplLB->ResetCurrentPos();
}
}
@@ -964,28 +964,28 @@ void ComboBox::ImplUpdateFloatSelection()
{
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, mpSubEdit->GetText(), mcMultiSep, mpImplLB->GetEntryList() );
- for ( sal_uInt16 n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
+ for ( USHORT n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
mpImplLB->SelectEntry( n, aSelInText.IsKeyValid( ImplCreateKey( n ) ) );
}
- mpImplLB->SetCallSelectionChangedHdl( sal_True );
+ mpImplLB->SetCallSelectionChangedHdl( TRUE );
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
+USHORT ComboBox::InsertEntry( const XubString& rStr, USHORT nPos )
{
- sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
+USHORT ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
{
- sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<USHORT>(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( sal_uInt16 nPos )
+void ComboBox::RemoveEntry( USHORT 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( sal_uInt16 nPos ) const
+Image ComboBox::GetEntryImage( USHORT nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1023,70 +1023,70 @@ Image ComboBox::GetEntryImage( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetEntryPos( const XubString& rStr ) const
+USHORT ComboBox::GetEntryPos( const XubString& rStr ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetEntryPos( const void* pData ) const
+USHORT ComboBox::GetEntryPos( const void* pData ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ComboBox::GetEntry( sal_uInt16 nPos ) const
+XubString ComboBox::GetEntry( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetEntryCount() const
+USHORT ComboBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsTravelSelect() const
+BOOL ComboBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsInDropDown() const
+BOOL ComboBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-void ComboBox::EnableMultiSelection( sal_Bool bMulti )
+void ComboBox::EnableMultiSelection( BOOL bMulti )
{
- mpImplLB->EnableMultiSelection( bMulti, sal_False );
- mpImplLB->SetMultiSelectionSimpleMode( sal_True );
+ mpImplLB->EnableMultiSelection( bMulti, FALSE );
+ mpImplLB->SetMultiSelectionSimpleMode( TRUE );
}
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsMultiSelectionEnabled() const
+BOOL ComboBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
// -----------------------------------------------------------------------
-long ComboBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
+long ComboBox::CalcWindowSizePixel( USHORT nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
@@ -1153,7 +1153,7 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
+Size ComboBox::CalcSize( USHORT nColumns, USHORT nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
@@ -1193,28 +1193,28 @@ Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
// -----------------------------------------------------------------------
-void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
+void ComboBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
- rnLines = (sal_uInt16)(aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
+ rnLines = (USHORT)(aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpSubEdit->GetOutputSizePixel();
- rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
+ rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
// -----------------------------------------------------------------------
-void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
+ mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, 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, s
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ 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, s
long nOnePixel = GetDrawPixel( pDev, 1 );
long nTextHeight = pDev->GetTextHeight();
long nEditHeight = nTextHeight + 6*nOnePixel;
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ USHORT 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, s
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
- sal_uInt16 nLines = (sal_uInt16) ( (aSize.Height()-nEditHeight) / nTextHeight );
+ USHORT nLines = (USHORT) ( (aSize.Height()-nEditHeight) / nTextHeight );
if ( !nLines )
nLines = 1;
- sal_uInt16 nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
+ USHORT nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
Rectangle aTextRect( aPos, aSize );
@@ -1297,7 +1297,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, s
aTextRect.Bottom() = aTextRect.Top() + nTextHeight;
// the drawing starts here
- for ( sal_uInt16 n = 0; n < nLines; n++ )
+ for ( USHORT 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( sal_Bool bUserDraw )
+void ComboBox::EnableUserDraw( BOOL bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
}
// -----------------------------------------------------------------------
-sal_Bool ComboBox::IsUserDrawEnabled() const
+BOOL ComboBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ComboBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
+void ComboBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, 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, sal_Bool bDrawImage, sal_Bo
// -----------------------------------------------------------------------
-void ComboBox::SetSeparatorPos( sal_uInt16 n )
+void ComboBox::SetSeparatorPos( USHORT n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1382,7 +1382,7 @@ void ComboBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetSeparatorPos() const
+USHORT ComboBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1403,58 +1403,58 @@ XubString ComboBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ComboBox::SetMaxMRUCount( sal_uInt16 n )
+void ComboBox::SetMaxMRUCount( USHORT n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetMaxMRUCount() const
+USHORT ComboBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetDisplayLineCount() const
+USHORT ComboBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
// -----------------------------------------------------------------------
-void ComboBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
+void ComboBox::SetEntryData( USHORT nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ComboBox::GetEntryData( sal_uInt16 nPos ) const
+void* ComboBox::GetEntryData( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::SetTopEntry( sal_uInt16 nPos )
+void ComboBox::SetTopEntry( USHORT nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::ShowProminentEntry( sal_uInt16 nPos )
+void ComboBox::ShowProminentEntry( USHORT nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-sal_uInt16 ComboBox::GetTopEntry() const
+USHORT ComboBox::GetTopEntry() const
{
- sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ USHORT 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;
}
// -----------------------------------------------------------------------------
-sal_uInt16 ComboBox::GetSelectEntryCount() const
+USHORT ComboBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------------
-sal_uInt16 ComboBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
+USHORT ComboBox::GetSelectEntryPos( USHORT nIndex ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ USHORT 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<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------------
-sal_Bool ComboBox::IsEntryPosSelected( sal_uInt16 nPos ) const
+BOOL ComboBox::IsEntryPosSelected( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------------
-void ComboBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect)
+void ComboBox::SelectEntryPos( USHORT nPos, 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( sal_uInt16 nItem ) const
+Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1547,7 +1547,7 @@ Rectangle ComboBox::GetBoundingRectangle( sal_uInt16 nItem ) const
}
// -----------------------------------------------------------------------------
-void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
+void ComboBox::SetBorderStyle( USHORT nBorderStyle )
{
Window::SetBorderStyle( nBorderStyle );
if ( !IsDropDownBox() )
@@ -1558,7 +1558,7 @@ void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
}
// -----------------------------------------------------------------------------
-long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
+long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -1578,7 +1578,7 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ USHORT 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 99cd6b3cba60..7be3ad1b1a54 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,7 +48,7 @@ using namespace vcl;
void Control::ImplInitControlData()
{
- mbHasFocus = sal_False;
+ mbHasFocus = FALSE;
mpControlData = new ImplControlData;
}
@@ -215,7 +215,7 @@ long Control::GetLineCount() const
Pair ControlLayoutData::GetLineStartEnd( long nLine ) const
{
Pair aPair( -1, -1 );
-
+
int nDisplayLines = m_aLineIndices.size();
if( nLine >= 0 && nLine < nDisplayLines )
{
@@ -304,10 +304,10 @@ long Control::Notify( NotifyEvent& rNEvt )
{
if ( !mbHasFocus )
{
- mbHasFocus = sal_True;
+ mbHasFocus = TRUE;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) )
// been destroyed within the handler
- return sal_True;
+ return TRUE;
}
}
else
@@ -317,10 +317,10 @@ long Control::Notify( NotifyEvent& rNEvt )
Window* pFocusWin = Application::GetFocusWindow();
if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
{
- mbHasFocus = sal_False;
+ mbHasFocus = FALSE;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) )
// been destroyed within the handler
- return sal_True;
+ return TRUE;
}
}
}
@@ -332,11 +332,11 @@ long Control::Notify( NotifyEvent& rNEvt )
void Control::StateChanged( StateChangedType nStateChange )
{
- if( nStateChange == STATE_CHANGE_INITSHOW ||
- nStateChange == STATE_CHANGE_VISIBLE ||
- nStateChange == STATE_CHANGE_FORMAT ||
- nStateChange == STATE_CHANGE_ZOOM ||
- nStateChange == STATE_CHANGE_BORDER ||
+ if( nStateChange == STATE_CHANGE_INITSHOW ||
+ nStateChange == STATE_CHANGE_VISIBLE ||
+ nStateChange == STATE_CHANGE_FORMAT ||
+ nStateChange == STATE_CHANGE_ZOOM ||
+ nStateChange == STATE_CHANGE_BORDER ||
nStateChange == STATE_CHANGE_CONTROLFONT
)
{
@@ -373,7 +373,7 @@ void Control::AppendLayoutData( const Control& rSubControl ) const
// -----------------------------------------------------------------
-sal_Bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Link& rHandler, void* pCaller )
+BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHandler, void* pCaller )
{
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -386,10 +386,10 @@ sal_Bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Lin
if ( !aCheckDelete.IsDelete() )
{
ImplRemoveDel( &aCheckDelete );
- return sal_False;
+ return FALSE;
}
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------
@@ -442,14 +442,14 @@ void Control::DataChanged( const DataChangedEvent& rDCEvt)
{
// we don't want to loose some style settings for controls created with the
// toolkit
- if ( IsCreatedWithToolkit() &&
+ if ( IsCreatedWithToolkit() &&
(rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
AllSettings aSettings = GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- sal_uLong nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
- sal_uLong nNewOptions = aStyleSettings.GetOptions();
+ ULONG nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
+ 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 sal_Bool _bFont, const sal_Bool _bForeground )
+void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -545,7 +545,7 @@ void Control::ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForegrou
// -----------------------------------------------------------------
void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const XubString& _rStr,
- sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
+ USHORT _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 41d5ca198cf2..cc4e3017a9a8 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -95,37 +95,35 @@ static FncGetSpecialChars pImplFncGetSpecialChars = NULL;
// =======================================================================
-#define EDIT_ALIGN_LEFT 1
-#define EDIT_ALIGN_CENTER 2
-#define EDIT_ALIGN_RIGHT 3
+#define EDIT_ALIGN_LEFT 1
+#define EDIT_ALIGN_CENTER 2
+#define EDIT_ALIGN_RIGHT 3
-#define EDIT_DEL_LEFT 1
-#define EDIT_DEL_RIGHT 2
+#define EDIT_DEL_LEFT 1
+#define EDIT_DEL_RIGHT 2
-#define EDIT_DELMODE_SIMPLE 11
-#define EDIT_DELMODE_RESTOFWORD 12
-#define EDIT_DELMODE_RESTOFCONTENT 13
+#define EDIT_DELMODE_SIMPLE 11
+#define EDIT_DELMODE_RESTOFWORD 12
+#define EDIT_DELMODE_RESTOFCONTENT 13
// =======================================================================
struct DDInfo
{
- Cursor aCursor;
+ Cursor aCursor;
Selection aDndStartSel;
- xub_StrLen nDropPos;
- sal_Bool bStarterOfDD;
- sal_Bool bDroppedInMe;
- sal_Bool bVisCursor;
- sal_Bool bIsStringSupported;
+ xub_StrLen nDropPos;
+ BOOL bStarterOfDD;
+ BOOL bDroppedInMe;
+ BOOL bVisCursor;
DDInfo()
{
aCursor.SetStyle( CURSOR_SHADOW );
nDropPos = 0;
- bStarterOfDD = sal_False;
- bDroppedInMe = sal_False;
- bVisCursor = sal_False;
- bIsStringSupported = sal_False;
+ bStarterOfDD = FALSE;
+ bDroppedInMe = FALSE;
+ bVisCursor = FALSE;
}
};
@@ -134,17 +132,17 @@ struct DDInfo
struct Impl_IMEInfos
{
String aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
- xub_StrLen nPos;
- xub_StrLen nLen;
- sal_Bool bCursor;
- sal_Bool bWasCursorOverwrite;
+ USHORT* pAttribs;
+ xub_StrLen nPos;
+ xub_StrLen nLen;
+ BOOL bCursor;
+ BOOL bWasCursorOverwrite;
Impl_IMEInfos( xub_StrLen nPos, const String& rOldTextAfterStartPos );
~Impl_IMEInfos();
- void CopyAttribs( const xub_StrLen* pA, xub_StrLen nL );
- void DestroyAttribs();
+ void CopyAttribs( const xub_StrLen* pA, xub_StrLen nL );
+ void DestroyAttribs();
};
// -----------------------------------------------------------------------
@@ -154,9 +152,9 @@ Impl_IMEInfos::Impl_IMEInfos( xub_StrLen nP, const String& rOldTextAfterStartPos
{
nPos = nP;
nLen = 0;
- bCursor = sal_True;
+ bCursor = TRUE;
pAttribs = NULL;
- bWasCursorOverwrite = sal_False;
+ bWasCursorOverwrite = FALSE;
}
// -----------------------------------------------------------------------
@@ -172,8 +170,8 @@ void Impl_IMEInfos::CopyAttribs( const xub_StrLen* pA, xub_StrLen nL )
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new sal_uInt16[ nL ];
- rtl_copyMemory( pAttribs, pA, nL*sizeof(sal_uInt16) );
+ pAttribs = new USHORT[ nL ];
+ rtl_copyMemory( pAttribs, pA, nL*sizeof(USHORT) );
}
// -----------------------------------------------------------------------
@@ -230,7 +228,7 @@ Edit::Edit( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabeled
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabeledByRelation )
- ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = sal_True;
+ ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = TRUE;
// Derived MultiLineEdit takes care to call Show only after MultiLineEdit
// ctor has already started:
@@ -277,27 +275,27 @@ Edit::~Edit()
void Edit::ImplInitEditData()
{
- mpSubEdit = NULL;
- mpUpdateDataTimer = NULL;
- mnXOffset = 0;
- mnAlign = EDIT_ALIGN_LEFT;
- mnMaxTextLen = EDIT_NOLIMIT;
- meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- 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;
+ mpSubEdit = NULL;
+ mpUpdateDataTimer = NULL;
+ mnXOffset = 0;
+ 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;
+ 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( sal_False );
+ EnableRTL( FALSE );
vcl::unohelper::DragAndDropWrapper* pDnDWrapper = new vcl::unohelper::DragAndDropWrapper( this );
mxDnDListener = pDnDWrapper;
@@ -334,7 +332,7 @@ void Edit::ImplInit( Window* pParent, WinBits nStyle )
// --- RTL --- hack: right align until keyinput and cursor travelling works
if( IsRTLEnabled() )
- mnAlign = EDIT_ALIGN_RIGHT;
+ mnAlign = EDIT_ALIGN_RIGHT;
if ( nStyle & WB_RIGHT )
mnAlign = EDIT_ALIGN_RIGHT;
@@ -344,7 +342,7 @@ void Edit::ImplInit( Window* pParent, WinBits nStyle )
SetCursor( new Cursor );
SetPointer( Pointer( POINTER_TEXT ) );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL( mxDnDListener, uno::UNO_QUERY );
uno::Reference< datatransfer::dnd::XDragGestureRecognizer > xDGR = GetDragGestureRecognizer();
@@ -372,7 +370,7 @@ WinBits Edit::ImplInitStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-sal_Bool Edit::IsCharInput( const KeyEvent& rKeyEvent )
+BOOL Edit::IsCharInput( const KeyEvent& rKeyEvent )
{
// In the future we must use new Unicode functions for this
xub_Unicode cCharCode = rKeyEvent.GetCharCode();
@@ -386,13 +384,13 @@ sal_Bool Edit::IsCharInput( const KeyEvent& rKeyEvent )
void Edit::ImplModified()
{
- mbModified = sal_True;
+ mbModified = TRUE;
Modify();
}
// -----------------------------------------------------------------------
-void Edit::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
+void Edit::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -455,7 +453,7 @@ XubString Edit::ImplGetText() const
{
if ( mcEchoChar || (GetStyle() & WB_PASSWORD) )
{
- XubString aText;
+ XubString aText;
xub_Unicode cEchoChar;
if ( mcEchoChar )
cEchoChar = mcEchoChar;
@@ -505,9 +503,9 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
nStart = 0;
nEnd = aText.Len();
- sal_Int32 nDXBuffer[256];
- sal_Int32* pDXBuffer = NULL;
- sal_Int32* pDX = nDXBuffer;
+ sal_Int32 nDXBuffer[256];
+ sal_Int32* pDXBuffer = NULL;
+ sal_Int32* pDX = nDXBuffer;
if( aText.Len() )
{
@@ -520,8 +518,8 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
GetCaretPositions( aText, pDX, nStart, nEnd );
}
- long nTH = GetTextHeight();
- Point aPos( mnXOffset, ImplGetTextYPosition() );
+ long nTH = GetTextHeight();
+ Point aPos( mnXOffset, ImplGetTextYPosition() );
if( bLayout )
{
@@ -539,7 +537,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
}
Cursor* pCursor = GetCursor();
- sal_Bool bVisCursor = pCursor ? pCursor->IsVisible() : sal_False;
+ BOOL bVisCursor = pCursor ? pCursor->IsVisible() : FALSE;
if ( pCursor )
pCursor->Hide();
@@ -547,7 +545,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsEnabled() )
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
else
SetTextColor( rStyleSettings.GetDisableColor() );
@@ -568,7 +566,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
- sal_Bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
+ BOOL bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
@@ -658,7 +656,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
for( i = 0; i < mpIMEInfos->nLen; )
{
- sal_uInt16 nAttr = mpIMEInfos->pAttribs[i];
+ USHORT nAttr = mpIMEInfos->pAttribs[i];
Region aClip;
int nIndex = i;
while( nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it
@@ -714,7 +712,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
// -----------------------------------------------------------------------
-void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode )
+void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode )
{
XubString aText = ImplGetText();
@@ -774,7 +772,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI
maSelection.Min() = aSelection.Min();
maSelection.Max() = aSelection.Min();
ImplAlignAndPaint();
- mbInternModified = sal_True;
+ mbInternModified = TRUE;
}
// -----------------------------------------------------------------------
@@ -789,19 +787,19 @@ String Edit::ImplGetValidString( const String& rString ) const
}
// -----------------------------------------------------------------------
-uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
+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!
- uno::Reference < i18n::XBreakIterator > xBI;
+ Reference < i18n::XBreakIterator > xBI;
// if ( !xBI.is() )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
+ Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
x >>= xBI;
}
}
@@ -809,19 +807,19 @@ uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
}
// -----------------------------------------------------------------------
-uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
+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!
- uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
+ Reference < i18n::XExtendedInputSequenceChecker > xISC;
// if ( !xISC.is() )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
+ Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.InputSequenceChecker" ) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XExtendedInputSequenceChecker >*)0) );
x >>= xISC;
}
}
@@ -880,24 +878,24 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// determine if input-sequence-checking should be applied or not
//
- static OUString sModule( RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/I18N") );
- static OUString sRelNode( RTL_CONSTASCII_USTRINGPARAM("CTL") );
- static OUString sCTLSequenceChecking( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceChecking") );
- static OUString sCTLSequenceCheckingRestricted( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingRestricted") );
- static OUString sCTLSequenceCheckingTypeAndReplace( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingTypeAndReplace") );
- static OUString sCTLFont( RTL_CONSTASCII_USTRINGPARAM("CTLFont") );
+ static OUString sModule( OUString::createFromAscii( "/org.openoffice.Office.Common/I18N" ) );
+ static OUString sRelNode( OUString::createFromAscii( "CTL" ) );
+ static OUString sCTLSequenceChecking( OUString::createFromAscii( "CTLSequenceChecking" ) );
+ static OUString sCTLSequenceCheckingRestricted( OUString::createFromAscii( "CTLSequenceCheckingRestricted" ) );
+ static OUString sCTLSequenceCheckingTypeAndReplace( OUString::createFromAscii( "CTLSequenceCheckingTypeAndReplace" ) );
+ static OUString sCTLFont( OUString::createFromAscii( "CTLFont" ) );
//
sal_Bool bCTLSequenceChecking = sal_False;
sal_Bool bCTLSequenceCheckingRestricted = sal_False;
sal_Bool bCTLSequenceCheckingTypeAndReplace = sal_False;
- sal_Bool bCTLFontEnabled = sal_False;
- sal_Bool bIsInputSequenceChecking = sal_False;
+ sal_Bool bCTLFontEnabled = sal_False;
+ sal_Bool bIsInputSequenceChecking = sal_False;
//
// get access to the configuration of this office module
try
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
+ Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
xMSF,
sModule,
::comphelper::ConfigurationHelper::E_READONLY ),
@@ -917,7 +915,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
}
catch(...)
{
- bIsInputSequenceChecking = sal_False; // continue with inserting the new text
+ bIsInputSequenceChecking = sal_False; // continue with inserting the new text
}
//
uno::Reference < i18n::XBreakIterator > xBI( ImplGetBreakIterator(), UNO_QUERY );
@@ -963,7 +961,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
if (aChgText.Len())
{
aNewText = aChgText;
- aSelection.Min() = nChgPos; // position for new text to be inserted
+ aSelection.Min() = nChgPos; // position for new text to be inserted
}
else
aNewText = String::EmptyString();
@@ -997,7 +995,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
}
ImplAlignAndPaint();
- mbInternModified = sal_True;
+ mbInternModified = TRUE;
}
// -----------------------------------------------------------------------
@@ -1021,7 +1019,7 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
ImplAlign();
if ( pNewSelection )
- ImplSetSelection( *pNewSelection, sal_False );
+ ImplSetSelection( *pNewSelection, FALSE );
if ( mnXOffset && !pNewSelection )
maSelection.Max() = 0;
@@ -1159,19 +1157,19 @@ void Edit::ImplClearBackground( long nXStart, long nXEnd )
// -----------------------------------------------------------------------
-void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
+void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
{
if ( !IsUpdateMode() || ( bOnlyIfVisible && !IsReallyVisible() ) )
return;
- Cursor* pCursor = GetCursor();
- XubString aText = ImplGetText();
+ Cursor* pCursor = GetCursor();
+ XubString aText = ImplGetText();
long nTextPos = 0;
- sal_Int32 nDXBuffer[256];
- sal_Int32* pDXBuffer = NULL;
- sal_Int32* pDX = nDXBuffer;
+ sal_Int32 nDXBuffer[256];
+ sal_Int32* pDXBuffer = NULL;
+ sal_Int32* pDX = nDXBuffer;
if( aText.Len() )
{
@@ -1222,7 +1220,7 @@ void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
}
nCursorPosX = nTextPos + mnXOffset + ImplGetExtraOffset();
- if ( nCursorPosX == aOutSize.Width() ) // dann nicht sichtbar...
+ if ( nCursorPosX == aOutSize.Width() ) // dann nicht sichtbar...
nCursorPosX--;
if ( mnXOffset != nOldXOffset )
@@ -1274,7 +1272,7 @@ void Edit::ImplAlign()
else if( mnAlign == EDIT_ALIGN_CENTER )
{
// Mit Abfrage schoener, wenn gescrollt, dann aber nicht zentriert im gescrollten Zustand...
-// if ( nTextWidth < nOutWidth )
+// if ( nTextWidth < nOutWidth )
mnXOffset = (nOutWidth - nTextWidth) / 2;
}
}
@@ -1296,9 +1294,9 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
xub_StrLen nIndex = STRING_LEN;
String aText = ImplGetText();
- sal_Int32 nDXBuffer[256];
- sal_Int32* pDXBuffer = NULL;
- sal_Int32* pDX = nDXBuffer;
+ sal_Int32 nDXBuffer[256];
+ sal_Int32* pDXBuffer = NULL;
+ sal_Int32* pDX = nDXBuffer;
if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
@@ -1352,7 +1350,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
// -----------------------------------------------------------------------
-void Edit::ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect )
+void Edit::ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect )
{
Selection aSelection( maSelection );
aSelection.Max() = nChar;
@@ -1444,7 +1442,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() < 4 )
{
- mbClickedInSelection = sal_False;
+ mbClickedInSelection = FALSE;
if ( rMEvt.GetClicks() == 3 )
{
ImplSetSelection( Selection( 0, 0xFFFF ) );
@@ -1459,7 +1457,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
ImplCopyToSelectionClipboard();
}
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) )
- mbClickedInSelection = sal_True;
+ mbClickedInSelection = TRUE;
else if ( rMEvt.IsLeft() )
ImplSetCursorPos( nChar, rMEvt.IsShift() );
@@ -1467,9 +1465,9 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
StartTracking( STARTTRACK_SCROLLREPEAT );
}
- mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren
+ mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren
GrabFocus();
- mbInMBDown = sal_False;
+ mbInMBDown = FALSE;
}
// -----------------------------------------------------------------------
@@ -1479,8 +1477,8 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt )
if ( mbClickedInSelection && rMEvt.IsLeft() )
{
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() );
- ImplSetCursorPos( nChar, sal_False );
- mbClickedInSelection = sal_False;
+ ImplSetCursorPos( nChar, FALSE );
+ mbClickedInSelection = FALSE;
}
else if ( rMEvt.IsMiddle() && !mbReadOnly &&
( GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION ) )
@@ -1500,8 +1498,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if ( mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, sal_False );
- mbClickedInSelection = sal_False;
+ ImplSetCursorPos( nChar, FALSE );
+ mbClickedInSelection = FALSE;
}
else if ( rTEvt.GetMouseEvent().IsLeft() )
{
@@ -1513,7 +1511,7 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if( !mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, sal_True );
+ ImplSetCursorPos( nChar, TRUE );
}
}
@@ -1523,13 +1521,13 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
+BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
- sal_Bool bDone = sal_False;
- sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
+ BOOL bDone = FALSE;
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
- mbInternModified = sal_False;
+ mbInternModified = FALSE;
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -1541,7 +1539,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
Cut();
ImplModified();
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1551,7 +1549,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !(GetStyle() & WB_PASSWORD) )
{
Copy();
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1561,7 +1559,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Paste();
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1571,7 +1569,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Undo();
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1586,13 +1584,13 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( nCode == KEY_A )
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = sal_True;
+ bDone = TRUE;
}
else if ( rKEvt.GetKeyCode().IsShift() && (nCode == KEY_S) )
{
if ( pImplFncGetSpecialChars )
{
- Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
+ Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
XubString aChars = pImplFncGetSpecialChars( this, GetFont() );
SetSelection( aSaveSel );
if ( aChars.Len() )
@@ -1600,7 +1598,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplInsertText( aChars );
ImplModified();
}
- bDone = sal_True;
+ bDone = TRUE;
}
}
}
@@ -1612,10 +1610,10 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case com::sun::star::awt::Key::SELECT_ALL:
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = sal_True;
+ bDone = TRUE;
}
break;
-
+
case KEY_LEFT:
case KEY_RIGHT:
case KEY_HOME:
@@ -1649,7 +1647,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
bool bGoRight = (nCode == KEY_RIGHT);
bool bGoHome = (nCode == KEY_HOME);
bool bGoEnd = (nCode == KEY_END);
-
+
switch( nCode )
{
case com::sun::star::awt::Key::MOVE_WORD_FORWARD:
@@ -1681,7 +1679,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
default:
break;
};
-
+
// Range wird in ImplSetSelection geprueft...
if ( bGoLeft && aSel.Max() )
{
@@ -1738,7 +1736,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
}
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1752,8 +1750,8 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
- sal_uInt8 nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
- sal_uInt8 nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
+ BYTE nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
+ BYTE nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
if ( (nMode == EDIT_DELMODE_RESTOFWORD) && rKEvt.GetKeyCode().IsShift() )
nMode = EDIT_DELMODE_RESTOFCONTENT;
switch( nCode )
@@ -1780,7 +1778,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplDelete( maSelection, nDel, nMode );
if ( maText.Len() != nOldLen )
ImplModified();
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
@@ -1790,14 +1788,11 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mpIMEInfos && !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
SetInsertMode( !mbInsertMode );
- bDone = sal_True;
+ bDone = 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() &&
@@ -1815,17 +1810,16 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
// Wurde nichts veraendert, dann TAB fuer DialogControl
if ( GetSelection().Len() )
- bDone = sal_True;
+ bDone = TRUE;
}
}
break;
- */
default:
{
if ( IsCharInput( rKEvt ) )
{
- bDone = sal_True; // Auch bei ReadOnly die Zeichen schlucken.
+ bDone = TRUE; // Auch bei ReadOnly die Zeichen schlucken.
if ( !mbReadOnly )
{
ImplInsertText( rKEvt.GetCharCode(), 0, sal_True );
@@ -1893,9 +1887,9 @@ void Edit::Resize()
// -----------------------------------------------------------------------
-void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1910,8 +1904,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_u
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1942,12 +1936,12 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_u
}
}
- XubString aText = ImplGetText();
- long nTextHeight = pDev->GetTextHeight();
- long nTextWidth = pDev->GetTextWidth( aText );
- long nOnePixel = GetDrawPixel( pDev, 1 );
- long nOffX = 3*nOnePixel;
- long nOffY = (aSize.Height() - nTextHeight) / 2;
+ XubString aText = ImplGetText();
+ long nTextHeight = pDev->GetTextHeight();
+ long nTextWidth = pDev->GetTextWidth( aText );
+ long nOnePixel = GetDrawPixel( pDev, 1 );
+ long nOffX = 3*nOnePixel;
+ long nOffY = (aSize.Height() - nTextHeight) / 2;
// Clipping?
if ( (nOffY < 0) ||
@@ -2003,7 +1997,7 @@ void Edit::GetFocus()
{
maUndoText = maText;
- sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) )
&& ( GetGetFocusFlags() & (GETFOCUS_INIT|GETFOCUS_TAB|GETFOCUS_CURSOR|GETFOCUS_MNEMONIC) ) )
{
@@ -2081,7 +2075,7 @@ void Edit::LoseFocus()
}
if ( !mbActivePopup && !( GetStyle() & WB_NOHIDESELECTION ) && maSelection.Len() )
- ImplInvalidateOrRepaint(); // Selektion malen
+ ImplInvalidateOrRepaint(); // Selektion malen
}
Control::LoseFocus();
@@ -2100,22 +2094,22 @@ void Edit::Command( const CommandEvent& rCEvt )
if ( !maSelection.Len() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
- pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
}
if ( IsReadOnly() )
{
- 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 );
+ 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 );
}
else
{
// Paste nur, wenn Text im Clipboard
- sal_Bool bData = sal_False;
+ BOOL bData = FALSE;
uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetClipboard();
if ( xClipboard.is() )
{
@@ -2133,18 +2127,18 @@ void Edit::Command( const CommandEvent& rCEvt )
}
if ( maUndoText == maText )
- pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
- pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
if ( !pImplFncGetSpecialChars )
{
- sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
- mbActivePopup = sal_True;
- Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
+ mbActivePopup = TRUE;
+ Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
@@ -2152,7 +2146,7 @@ void Edit::Command( const CommandEvent& rCEvt )
Size aSize = GetOutputSizePixel();
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
- sal_uInt16 n = pPopup->Execute( this, aPos );
+ USHORT n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
SetSelection( aSaveSel );
switch ( n )
@@ -2191,7 +2185,7 @@ void Edit::Command( const CommandEvent& rCEvt )
}
break;
}
- mbActivePopup = sal_False;
+ mbActivePopup = FALSE;
}
else if ( rCEvt.GetCommand() == COMMAND_VOICE )
{
@@ -2222,7 +2216,7 @@ void Edit::Command( const CommandEvent& rCEvt )
break;
case DICTATIONCOMMAND_DEL:
{
- ImplHandleKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, KEY_MOD1|KEY_SHIFT ) ) );
+ ImplHandleKeyEvent( KeyEvent( 0, KeyCode( KEY_LEFT, KEY_MOD1|KEY_SHIFT ) ) );
DeleteSelected();
}
break;
@@ -2239,12 +2233,12 @@ void Edit::Command( const CommandEvent& rCEvt )
}
else if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
{
- sal_Bool bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
+ BOOL bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
delete mpIMEInfos;
mpIMEInfos = NULL;
// Font wieder ohne Attribute einstellen, wird jetzt im Repaint nicht
// mehr neu initialisiert
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
SetInsertMode( bInsertMode );
@@ -2268,20 +2262,20 @@ void Edit::Command( const CommandEvent& rCEvt )
maText.Insert( pData->GetText(), mpIMEInfos->nPos );
if ( mpIMEInfos->bWasCursorOverwrite )
{
- sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen;
- sal_uInt16 nNewIMETextLen = pData->GetText().Len();
+ USHORT nOldIMETextLen = mpIMEInfos->nLen;
+ USHORT nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
+ USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
maText.Insert( mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ), mpIMEInfos->nPos + nNewIMETextLen );
}
else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
maText.Erase( mpIMEInfos->nPos + nNewIMETextLen, nOverwrite );
@@ -2313,7 +2307,7 @@ void Edit::Command( const CommandEvent& rCEvt )
{
if ( mpIMEInfos )
{
- xub_StrLen nCursorPos = (sal_uInt16)GetSelection().Max();
+ xub_StrLen nCursorPos = (USHORT)GetSelection().Max();
SetCursorRect( NULL, GetTextWidth(
maText, nCursorPos, mpIMEInfos->nPos+mpIMEInfos->nLen-nCursorPos ) );
}
@@ -2340,13 +2334,13 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
+ mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
ImplAlign();
if ( !mpSubEdit )
- ImplShowCursor( sal_False );
+ ImplShowCursor( FALSE );
}
// update background (eventual SetPaintTransparent)
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
}
else if ( nType == STATE_CHANGE_ENABLE )
{
@@ -2365,7 +2359,7 @@ void Edit::StateChanged( StateChangedType nType )
SetStyle( nStyle );
}
- sal_uInt16 nOldAlign = mnAlign;
+ USHORT nOldAlign = mnAlign;
mnAlign = EDIT_ALIGN_LEFT;
// --- RTL --- hack: right align until keyinput and cursor travelling works
@@ -2374,7 +2368,7 @@ void Edit::StateChanged( StateChangedType nType )
if( mbIsSubEdit && GetParent()->IsRTLEnabled() )
{
if( GetParent()->GetStyle() & WB_LEFT )
- mnAlign = EDIT_ALIGN_RIGHT;
+ mnAlign = EDIT_ALIGN_RIGHT;
if ( nType == STATE_CHANGE_MIRRORING )
SetLayoutMode( TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT );
}
@@ -2399,8 +2393,8 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
- ImplShowCursor( sal_True );
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplShowCursor( TRUE );
Invalidate();
}
}
@@ -2408,7 +2402,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
ImplShowCursor();
Invalidate();
}
@@ -2417,7 +2411,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
}
@@ -2425,7 +2419,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -2444,8 +2438,8 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( !mpSubEdit )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
- ImplShowCursor( sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplShowCursor( TRUE );
Invalidate();
}
}
@@ -2466,7 +2460,7 @@ void Edit::ImplShowDDCursor()
mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() );
mpDDInfo->aCursor.SetSize( aCursorRect.GetSize() );
mpDDInfo->aCursor.Show();
- mpDDInfo->bVisCursor = sal_True;
+ mpDDInfo->bVisCursor = TRUE;
}
}
@@ -2477,7 +2471,7 @@ void Edit::ImplHideDDCursor()
if ( mpDDInfo && mpDDInfo->bVisCursor )
{
mpDDInfo->aCursor.Hide();
- mpDDInfo->bVisCursor = sal_False;
+ mpDDInfo->bVisCursor = FALSE;
}
}
@@ -2529,7 +2523,7 @@ IMPL_LINK( Edit, ImplUpdateDataHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-void Edit::EnableUpdateData( sal_uLong nTimeout )
+void Edit::EnableUpdateData( ULONG nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -2556,7 +2550,7 @@ void Edit::SetEchoChar( xub_Unicode c )
// -----------------------------------------------------------------------
-void Edit::SetReadOnly( sal_Bool bReadOnly )
+void Edit::SetReadOnly( BOOL bReadOnly )
{
if ( mbReadOnly != bReadOnly )
{
@@ -2579,7 +2573,7 @@ void Edit::SetAutocompleteHdl( const Link& rHdl )
// -----------------------------------------------------------------------
-void Edit::SetInsertMode( sal_Bool bInsert )
+void Edit::SetInsertMode( BOOL bInsert )
{
if ( bInsert != mbInsertMode )
{
@@ -2593,7 +2587,7 @@ void Edit::SetInsertMode( sal_Bool bInsert )
// -----------------------------------------------------------------------
-sal_Bool Edit::IsInsertMode() const
+BOOL Edit::IsInsertMode() const
{
if ( mpSubEdit )
return mpSubEdit->IsInsertMode();
@@ -2632,7 +2626,7 @@ void Edit::SetSelection( const Selection& rSelection )
// -----------------------------------------------------------------------
-void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint )
+void Edit::ImplSetSelection( const Selection& rSelection, BOOL bPaint )
{
if ( mpSubEdit )
mpSubEdit->ImplSetSelection( rSelection );
@@ -2770,10 +2764,10 @@ void Edit::Undo()
void Edit::SetText( const XubString& rStr )
{
if ( mpSubEdit )
- mpSubEdit->SetText( rStr ); // Nicht direkt ImplSetText, falls SetText ueberladen
+ mpSubEdit->SetText( rStr ); // Nicht direkt ImplSetText, falls SetText ueberladen
else
{
- Selection aNewSel( 0, 0 ); // Damit nicht gescrollt wird
+ Selection aNewSel( 0, 0 ); // Damit nicht gescrollt wird
ImplSetText( rStr, &aNewSel );
}
}
@@ -2803,9 +2797,9 @@ XubString Edit::GetText() const
void Edit::SetModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = sal_True;
+ mpSubEdit->mbModified = TRUE;
else
- mbModified = sal_True;
+ mbModified = TRUE;
}
// -----------------------------------------------------------------------
@@ -2813,9 +2807,9 @@ void Edit::SetModifyFlag()
void Edit::ClearModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = sal_False;
+ mpSubEdit->mbModified = FALSE;
else
- mbModified = sal_False;
+ mbModified = FALSE;
}
// -----------------------------------------------------------------------
@@ -2825,8 +2819,8 @@ void Edit::SetSubEdit( Edit* pEdit )
mpSubEdit = pEdit;
if ( mpSubEdit )
{
- SetPointer( POINTER_ARROW ); // Nur das SubEdit hat den BEAM...
- mpSubEdit->mbIsSubEdit = sal_True;
+ SetPointer( POINTER_ARROW ); // Nur das SubEdit hat den BEAM...
+ mpSubEdit->mbIsSubEdit = TRUE;
mpSubEdit->SetReadOnly( mbReadOnly );
}
@@ -2844,7 +2838,7 @@ Size Edit::CalcMinimumSize() const
aSize.Width() = aMinSize.Width();
// add some space between text entry and border
aSize.Height() += 4;
-
+
aSize = CalcWindowSize( aSize );
// ask NWF what if it has an opinion, too
@@ -2861,14 +2855,6 @@ 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
@@ -2938,8 +2924,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, 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 ) );
+ 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 ) );
return pPopup;
}
@@ -2956,7 +2942,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
SolarMutexGuard aVclGuard;
if ( !IsTracking() && maSelection.Len() &&
- !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == sal_False) ) // Kein Mehrfach D&D
+ !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == FALSE) ) // Kein Mehrfach D&D
{
Selection aSel( maSelection );
aSel.Justify();
@@ -2969,12 +2955,12 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
if ( !mpDDInfo )
mpDDInfo = new DDInfo;
- mpDDInfo->bStarterOfDD = sal_True;
+ mpDDInfo->bStarterOfDD = TRUE;
mpDDInfo->aDndStartSel = aSel;
if ( IsTracking() )
- EndTracking(); // Vor D&D Tracking ausschalten
+ EndTracking(); // Vor D&D Tracking ausschalten
::vcl::unohelper::TextDataObject* pDataObj = new ::vcl::unohelper::TextDataObject( GetSelected() );
sal_Int8 nActions = datatransfer::dnd::DNDConstants::ACTION_COPY;
@@ -3019,7 +3005,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
{
SolarMutexGuard aVclGuard;
- sal_Bool bChanges = sal_False;
+ BOOL bChanges = FALSE;
if ( !mbReadOnly && mpDDInfo )
{
ImplHideDDCursor();
@@ -3030,7 +3016,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 = sal_True;
+ mpDDInfo->bDroppedInMe = TRUE;
aSel.Min() = mpDDInfo->nDropPos;
aSel.Max() = mpDDInfo->nDropPos;
@@ -3047,7 +3033,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
::rtl::OUString aText;
aData >>= aText;
ImplInsertText( aText );
- bChanges = sal_True;
+ bChanges = TRUE;
ImplModified();
}
}
@@ -3062,26 +3048,17 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
rDTDE.Context->dropComplete( bChanges );
}
-void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
+void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& ) throw (::com::sun::star::uno::RuntimeException)
{
if ( !mpDDInfo )
{
mpDDInfo = new DDInfo;
}
- // 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;
- }
- }
+// 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();
}
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
@@ -3113,7 +3090,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 ) || ! mpDDInfo->bIsStringSupported )
+ if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) )
{
ImplHideDDCursor();
rDTDE.Context->rejectDrag();
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 2cd6b4bc9e0c..1f0f7af61a92 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -52,6 +52,8 @@
using namespace ::com::sun::star;
+static ResStringArray *strAllUnits = NULL;
+
// -----------------------------------------------------------------------
#define FORMAT_NUMERIC 1
@@ -60,9 +62,9 @@ using namespace ::com::sun::star;
// -----------------------------------------------------------------------
-static sal_Int64 ImplPower10( sal_uInt16 n )
+static sal_Int64 ImplPower10( USHORT n )
{
- sal_uInt16 i;
+ USHORT i;
sal_Int64 nValue = 1;
for ( i=0; i < n; i++ )
@@ -73,16 +75,16 @@ static sal_Int64 ImplPower10( sal_uInt16 n )
// -----------------------------------------------------------------------
-static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- sal_Bool bStrictFormat, sal_Bool bThousandSep,
+static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ BOOL bStrictFormat, BOOL bThousandSep,
const LocaleDataWrapper& rLocaleDataWrappper )
{
if ( !bStrictFormat )
- return sal_False;
+ return FALSE;
else
{
xub_Unicode cChar = rKEvt.GetCharCode();
- sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
+ USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -90,28 +92,28 @@ static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(cChar == rLocaleDataWrappper.getNumDecimalSep() ) ||
(bThousandSep && (cChar == rLocaleDataWrappper.getNumThousandSep())) ||
(cChar == '-') )
- return sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
}
// -----------------------------------------------------------------------
-static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
- sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
- sal_Bool bCurrency = sal_False )
+static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
+ USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
+ BOOL bCurrency = FALSE )
{
XubString aStr = rStr;
XubString aStr1;
XubString aStr2;
- sal_Bool bNegative = sal_False;
+ BOOL bNegative = FALSE;
xub_StrLen nDecPos;
xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return sal_False;
+ return FALSE;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -130,7 +132,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -139,14 +141,14 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = sal_True;
+ bNegative = TRUE;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- sal_uInt16 nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
+ USHORT nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
@@ -156,7 +158,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = sal_True;
+ bNegative = TRUE;
break;
}
}
@@ -166,7 +168,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -186,7 +188,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return sal_False;
+ return FALSE;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -194,11 +196,11 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- sal_Bool bRound = sal_False;
+ BOOL bRound = FALSE;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = sal_True;
+ bRound = TRUE;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -219,43 +221,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
rValue = nValue;
- 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();
+ return TRUE;
}
static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep,
@@ -267,25 +233,29 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
if( bChangeDec || bChangeTh )
{
- sal_Bool bUpdateMode = pEdit->IsUpdateMode();
- pEdit->SetUpdateMode( sal_False );
+ BOOL bUpdateMode = pEdit->IsUpdateMode();
+ pEdit->SetUpdateMode( FALSE );
String aText = pEdit->GetText();
- ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
+ if( bChangeDec )
+ aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
+ if( bChangeTh )
+ aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
pEdit->SetText( aText );
ComboBox* pCombo = dynamic_cast<ComboBox*>(pEdit);
if( pCombo )
{
// update box entries
- sal_uInt16 nEntryCount = pCombo->GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ USHORT nEntryCount = pCombo->GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
aText = pCombo->GetEntry( i );
- void* pEntryData = pCombo->GetEntryData( i );
- ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
+ if( bChangeDec )
+ aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
+ if( bChangeTh )
+ aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
pCombo->RemoveEntry( i );
pCombo->InsertEntry( aText, i );
- pCombo->SetEntryData( i, pEntryData );
}
}
if( bUpdateMode )
@@ -299,11 +269,11 @@ FormatterBase::FormatterBase( Edit* pField )
{
mpField = pField;
mpLocaleDataWrapper = NULL;
- mbReformat = sal_False;
- mbStrictFormat = sal_False;
- mbEmptyFieldValue = sal_False;
- mbEmptyFieldValueEnabled = sal_False;
- mbDefaultLocale = sal_True;
+ mbReformat = FALSE;
+ mbStrictFormat = FALSE;
+ mbEmptyFieldValue = FALSE;
+ mbEmptyFieldValueEnabled = FALSE;
+ mbDefaultLocale = TRUE;
}
// -----------------------------------------------------------------------
@@ -344,7 +314,7 @@ void FormatterBase::ReformatAll()
// -----------------------------------------------------------------------
-void FormatterBase::SetStrictFormat( sal_Bool bStrict )
+void FormatterBase::SetStrictFormat( BOOL bStrict )
{
if ( bStrict != mbStrictFormat )
{
@@ -359,7 +329,7 @@ void FormatterBase::SetStrictFormat( sal_Bool bStrict )
void FormatterBase::SetLocale( const lang::Locale& rLocale )
{
ImplGetLocaleDataWrapper().setLocale( rLocale );
- mbDefaultLocale = sal_False;
+ mbDefaultLocale = FALSE;
ReformatAll();
}
@@ -390,7 +360,7 @@ const AllSettings& FormatterBase::GetFieldSettings() const
// -----------------------------------------------------------------------
-void FormatterBase::SetFieldText( const XubString& rText, sal_Bool bKeepSelection )
+void FormatterBase::SetFieldText( const XubString& rText, BOOL bKeepSelection )
{
if ( mpField )
{
@@ -417,7 +387,7 @@ void FormatterBase::ImplSetText( const XubString& rText, Selection* pNewSelectio
mpField->SetText( rText, aSel );
}
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
}
}
@@ -427,23 +397,23 @@ void FormatterBase::SetEmptyFieldValue()
{
if ( mpField )
mpField->SetText( ImplGetSVEmptyStr() );
- mbEmptyFieldValue = sal_True;
+ mbEmptyFieldValue = TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool FormatterBase::IsEmptyFieldValue() const
+BOOL FormatterBase::IsEmptyFieldValue() const
{
return (!mpField || !mpField->GetText().Len());
}
// -----------------------------------------------------------------------
-sal_Bool NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
+BOOL NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
XubString& rOutStr )
{
if ( !ImplNumericGetValue( rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
- return sal_True;
+ return TRUE;
else
{
double nTempVal = rValue;
@@ -459,14 +429,14 @@ sal_Bool NumericFormatter::ImplNumericReformat( const XubString& rStr, double& r
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return sal_False;
+ return FALSE;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return sal_True;
+ return TRUE;
}
}
@@ -481,8 +451,8 @@ void NumericFormatter::ImplInit()
mnCorrectedValue = 0;
mnDecimalDigits = 2;
mnType = FORMAT_NUMERIC;
- mbThousandSep = sal_True;
- mbShowTrailingZeros = sal_True;
+ mbThousandSep = TRUE;
+ mbShowTrailingZeros = TRUE;
// for fields
mnSpinSize = 1;
@@ -507,7 +477,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
+ ULONG nMask = pMgr->ReadLong();
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
@@ -516,7 +486,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
mnMax = pMgr->ReadLong();
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
+ SetStrictFormat( (BOOL)pMgr->ReadShort() );
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
@@ -532,7 +502,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
}
if ( NUMERICFORMATTER_NOTHOUSANDSEP & nMask )
- SetUseThousandSep( !(sal_Bool)pMgr->ReadShort() );
+ SetUseThousandSep( !(BOOL)pMgr->ReadShort() );
}
}
@@ -562,7 +532,7 @@ void NumericFormatter::SetMax( sal_Int64 nNewMax )
// -----------------------------------------------------------------------
-void NumericFormatter::SetUseThousandSep( sal_Bool b )
+void NumericFormatter::SetUseThousandSep( BOOL b )
{
mbThousandSep = b;
ReformatAll();
@@ -570,7 +540,7 @@ void NumericFormatter::SetUseThousandSep( sal_Bool b )
// -----------------------------------------------------------------------
-void NumericFormatter::SetDecimalDigits( sal_uInt16 nDigits )
+void NumericFormatter::SetDecimalDigits( USHORT nDigits )
{
mnDecimalDigits = nDigits;
ReformatAll();
@@ -578,7 +548,7 @@ void NumericFormatter::SetDecimalDigits( sal_uInt16 nDigits )
// -----------------------------------------------------------------------
-void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros )
+void NumericFormatter::SetShowTrailingZeros( BOOL bShowTrailingZeros )
{
if ( mbShowTrailingZeros != bShowTrailingZeros )
{
@@ -589,7 +559,7 @@ void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros )
// -----------------------------------------------------------------------
-sal_uInt16 NumericFormatter::GetDecimalDigits() const
+USHORT NumericFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
@@ -600,7 +570,7 @@ void NumericFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( sal_False );
+ SetEmptyFieldValueData( FALSE );
}
// -----------------------------------------------------------------------
@@ -656,14 +626,14 @@ sal_Int64 NumericFormatter::GetValue() const
// -----------------------------------------------------------------------
-sal_Bool NumericFormatter::IsValueModified() const
+BOOL NumericFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyFieldValue();
else if ( GetValue() != mnFieldValue )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -720,7 +690,7 @@ void NumericFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- sal_Bool bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
+ BOOL bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
return;
@@ -840,7 +810,7 @@ void NumericField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
NumericFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- sal_uLong nMask = ReadLongRes();
+ ULONG nMask = ReadLongRes();
if ( NUMERICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -876,7 +846,7 @@ long NumericField::PreNotify( NotifyEvent& rNEvt )
long NumericField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -909,7 +879,7 @@ void NumericField::DataChanged( const DataChangedEvent& rDCEvt )
void NumericField::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -995,7 +965,7 @@ long NumericBox::PreNotify( NotifyEvent& rNEvt )
long NumericBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1028,7 +998,7 @@ void NumericBox::DataChanged( const DataChangedEvent& rDCEvt )
void NumericBox::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -1038,21 +1008,21 @@ void NumericBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
ImplNumericReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
NumericFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void NumericBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
+void NumericBox::InsertValue( sal_Int64 nValue, USHORT nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -1066,7 +1036,7 @@ void NumericBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 NumericBox::GetValue( sal_uInt16 nPos ) const
+sal_Int64 NumericBox::GetValue( USHORT nPos ) const
{
double nValue = 0;
ImplNumericGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -1075,19 +1045,19 @@ sal_Int64 NumericBox::GetValue( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 NumericBox::GetValuePos( sal_Int64 nValue ) const
+USHORT NumericBox::GetValuePos( sal_Int64 nValue ) const
{
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
}
// -----------------------------------------------------------------------
-static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static BOOL ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
@@ -1113,7 +1083,7 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
/*
// MT: #90545# Preparation for translated strings...
String aMetricText;
- for ( sal_uInt16 n = rStr.Len(); n; )
+ for ( USHORT n = rStr.Len(); n; )
{
sal_Unicode c = rStr.GetChar( --n );
sal_Int32 nType = xCharClass->getStringType( rStr, n, 1, rLocale );
@@ -1135,37 +1105,38 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
// #104355# support localized mesaurements
-static const String& ImplMetricToString( FieldUnit rUnit )
+static String ImplMetricToString( FieldUnit rUnit )
{
- FieldUnitStringList* pList = ImplGetFieldUnits();
- if( pList )
+ if( !strAllUnits )
{
- // 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;
- }
+ ResMgr* pResMgr = ImplGetResMgr();
+ strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
}
+ // 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::EmptyString();
+ return String();
}
static FieldUnit ImplStringToMetric( const String &rMetricString )
{
- FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
- if( pList )
+ if( !strAllUnits )
{
- // 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;
- }
+ ResMgr* pResMgr = ImplGetResMgr();
+ strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
}
+ // 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;
}
@@ -1241,7 +1212,7 @@ static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits )
case MAP_TWIP :
return FUNIT_TWIP;
default:
- OSL_FAIL( "default eInUnit" );
+ DBG_ERROR( "default eInUnit" );
break;
}
return FUNIT_NONE;
@@ -1254,7 +1225,7 @@ static double nonValueDoubleToValueDouble( double nValue )
return rtl::math::isFinite( nValue ) ? nValue : 0.0;
}
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
double nDouble = nonValueDoubleToValueDouble( ConvertDoubleValue(
@@ -1273,7 +1244,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sa
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1283,7 +1254,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1293,7 +1264,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
if ( eInUnit != eOutUnit )
@@ -1305,7 +1276,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sa
if ( (mnBaseValue <= 0) || (nValue <= 0) )
return nValue;
nDiv = 100;
- for ( sal_uInt16 i=0; i < nDecDigits; i++ )
+ for ( USHORT i=0; i < nDecDigits; i++ )
nDiv *= 10;
nMult = mnBaseValue;
@@ -1344,7 +1315,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sa
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
+double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
if ( eOutUnit == FUNIT_PERCENT ||
@@ -1355,7 +1326,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
eInUnit == MAP_APPFONT ||
eInUnit == MAP_RELATIVE )
{
- OSL_FAIL( "invalid parameters" );
+ DBG_ERROR( "invalid parameters" );
return nValue;
}
@@ -1401,7 +1372,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
+double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
if ( eInUnit == FUNIT_PERCENT ||
@@ -1412,7 +1383,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
eOutUnit == MAP_APPFONT ||
eOutUnit == MAP_RELATIVE )
{
- OSL_FAIL( "invalid parameters" );
+ DBG_ERROR( "invalid parameters" );
return nValue;
}
@@ -1431,6 +1402,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
{
while ( nDecDigits )
{
+ nValue += 5;
nValue /= 10;
nDecDigits--;
}
@@ -1457,12 +1429,12 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
// -----------------------------------------------------------------------
-static sal_Bool ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
- sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
+static BOOL ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
+ USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
{
// Zahlenwert holen
if ( !ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper ) )
- return sal_False;
+ return FALSE;
// Einheit rausfinden
FieldUnit eEntryUnit = ImplMetricGetUnit( rStr );
@@ -1470,15 +1442,15 @@ static sal_Bool ImplMetricGetValue( const XubString& rStr, double& rValue, sal_I
// Einheiten umrechnen
rValue = MetricField::ConvertDoubleValue( rValue, nBaseValue, nDecDigits, eEntryUnit, eUnit );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
+BOOL MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
{
if ( !ImplMetricGetValue( rStr, rValue, mnBaseValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), meUnit ) )
- return sal_True;
+ return TRUE;
else
{
double nTempVal = rValue;
@@ -1494,14 +1466,14 @@ sal_Bool MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rVa
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return sal_False;
+ return FALSE;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return sal_True;
+ return TRUE;
}
}
@@ -1530,7 +1502,7 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
+ ULONG nMask = pMgr->ReadLong();
if ( METRICFORMATTER_UNIT & nMask )
meUnit = (FieldUnit)pMgr->ReadLong();
@@ -1704,7 +1676,7 @@ void MetricFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- sal_Bool bOK = ImplMetricReformat( aText, nTemp, aStr );
+ BOOL bOK = ImplMetricReformat( aText, nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
@@ -1761,7 +1733,7 @@ void MetricField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
MetricFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- sal_uLong nMask = ReadLongRes();
+ ULONG nMask = ReadLongRes();
if ( METRICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -1853,7 +1825,7 @@ long MetricField::PreNotify( NotifyEvent& rNEvt )
long MetricField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1886,7 +1858,7 @@ void MetricField::DataChanged( const DataChangedEvent& rDCEvt )
void MetricField::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -1979,7 +1951,7 @@ long MetricBox::PreNotify( NotifyEvent& rNEvt )
long MetricBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2012,7 +1984,7 @@ void MetricBox::DataChanged( const DataChangedEvent& rDCEvt )
void MetricBox::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -2022,16 +1994,16 @@ void MetricBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
ImplMetricReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
MetricFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
@@ -2043,7 +2015,7 @@ void MetricBox::CustomConvert()
// -----------------------------------------------------------------------
-void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPos )
+void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, USHORT nPos )
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2063,7 +2035,7 @@ void MetricBox::RemoveValue( sal_Int64 nValue, FieldUnit eInUnit )
// -----------------------------------------------------------------------
-sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
+sal_Int64 MetricBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
{
double nValue = 0;
ImplMetricGetValue( ComboBox::GetEntry( nPos ), nValue, mnBaseValue,
@@ -2078,7 +2050,7 @@ sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
// -----------------------------------------------------------------------
-sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
+USHORT MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2104,31 +2076,31 @@ sal_Int64 MetricBox::GetValue() const
// -----------------------------------------------------------------------
-static sal_Bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static BOOL ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
-inline sal_Bool ImplCurrencyGetValue( const XubString& rStr, double& rValue,
- sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper )
+inline BOOL ImplCurrencyGetValue( const XubString& rStr, double& rValue,
+ USHORT nDecDigits, const LocaleDataWrapper& rWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, sal_True );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, TRUE );
}
// -----------------------------------------------------------------------
-sal_Bool CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
+BOOL CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
XubString& rOutStr )
{
double nValue;
- if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), sal_True ) )
- return sal_True;
+ if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), TRUE ) )
+ return TRUE;
else
{
double nTempVal = nValue;
@@ -2144,14 +2116,14 @@ sal_Bool CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return sal_False;
+ return FALSE;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (long)nTempVal );
- return sal_True;
+ return TRUE;
}
}
@@ -2196,7 +2168,7 @@ void CurrencyFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( sal_False );
+ SetEmptyFieldValueData( FALSE );
}
// -----------------------------------------------------------------------
@@ -2235,7 +2207,7 @@ void CurrencyFormatter::Reformat()
return;
XubString aStr;
- sal_Bool bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
+ BOOL bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
@@ -2282,7 +2254,7 @@ void CurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
CurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- sal_uLong nMask = ReadLongRes();
+ ULONG nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -2320,7 +2292,7 @@ long CurrencyField::PreNotify( NotifyEvent& rNEvt )
long CurrencyField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2353,7 +2325,7 @@ void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyField::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -2439,7 +2411,7 @@ long CurrencyBox::PreNotify( NotifyEvent& rNEvt )
long CurrencyBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2472,7 +2444,7 @@ void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyBox::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -2481,21 +2453,21 @@ void CurrencyBox::Modify()
void CurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
ImplCurrencyReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
CurrencyFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void CurrencyBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
+void CurrencyBox::InsertValue( sal_Int64 nValue, USHORT nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -2509,7 +2481,7 @@ void CurrencyBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 CurrencyBox::GetValue( sal_uInt16 nPos ) const
+sal_Int64 CurrencyBox::GetValue( USHORT nPos ) const
{
double nValue = 0;
ImplCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -2518,7 +2490,7 @@ sal_Int64 CurrencyBox::GetValue( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 CurrencyBox::GetValuePos( sal_Int64 nValue ) const
+USHORT 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 65e8c8d91f82..8833f2b6a92d 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -92,7 +92,7 @@ static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const String& rStr )
// -----------------------------------------------------------------------
-static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLen )
+static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, ULONG nNumber, int nMinLen )
{
// fill temp buffer with digits
sal_Unicode aTempBuf[30];
@@ -129,15 +129,15 @@ static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLe
// -----------------------------------------------------------------------
-static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, sal_Bool& rbError )
+static USHORT ImplGetNum( const sal_Unicode*& rpBuf, BOOL& rbError )
{
if ( !*rpBuf )
{
- rbError = sal_True;
+ rbError = TRUE;
return 0;
}
- sal_uInt16 nNumber = 0;
+ USHORT nNumber = 0;
while( ( *rpBuf >= '0' ) && ( *rpBuf <= '9' ) )
{
nNumber *= 10;
@@ -152,7 +152,7 @@ static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, sal_Bool& rbError )
static void ImplSkipDelimiters( const sal_Unicode*& rpBuf )
{
- while( ( *rpBuf == ',' ) || ( *rpBuf == '.' ) || ( *rpBuf == ';' ) ||
+ while( ( *rpBuf == ',' ) || ( *rpBuf == '.' ) || ( *rpBuf == ';' ) ||
( *rpBuf == ':' ) || ( *rpBuf == '-' ) || ( *rpBuf == '/' ) )
{
rpBuf++;
@@ -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 sal_False;
+ return FALSE;
}
if ( (cEditMask == EDITMASK_ALPHA) || (cEditMask == EDITMASK_UPPERALPHA) )
{
if( !CharClass::isLetterType( nType ) )
- return sal_False;
+ return FALSE;
}
else if ( cEditMask == EDITMASK_NUM )
{
if( !CharClass::isNumericType( nType ) )
- return sal_False;
+ return FALSE;
}
else if ( (cEditMask == EDITMASK_ALPHANUM) || (cEditMask == EDITMASK_UPPERALPHANUM) )
{
if( !CharClass::isLetterNumericType( nType ) )
- return sal_False;
+ return FALSE;
}
else if ( (cEditMask == EDITMASK_ALLCHAR) || (cEditMask == EDITMASK_UPPERALLCHAR) )
{
if ( cChar < 32 )
- return sal_False;
+ return FALSE;
}
else if ( cEditMask == EDITMASK_NUMSPACE )
{
if ( !CharClass::isNumericType( nType ) && ( cChar != ' ' ) )
- return sal_False;
+ return FALSE;
}
else
- return sal_False;
+ return FALSE;
- return sal_True;
+ return 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 sal_True;
+ return TRUE;
else if ( ((c1 == '.') || (c1 == ',')) &&
((c2 == '.') || (c2 == ',')) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return 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,
- sal_uInt16 nFormatFlags )
+ USHORT 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,
- sal_uInt16 nFormatFlags, sal_Bool bSameMask,
- sal_uInt16 nCursorPos, sal_uInt16& rPos )
+ USHORT nFormatFlags, BOOL bSameMask,
+ USHORT nCursorPos, USHORT& 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,
- sal_uInt16 nFormatFlags, sal_Bool bSameMask )
+ USHORT nFormatFlags, 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();
- sal_uLong nMaxSel = Max( aSel.Min(), aSel.Max() );
+ 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,
- sal_uInt16 nFormatFlags, sal_Bool bSameMask,
+ USHORT nFormatFlags, 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 sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- sal_Bool bStrictFormat,
- sal_uInt16 nFormatFlags,
- sal_Bool bSameMask,
- sal_Bool& rbInKeyInput )
+ BOOL bStrictFormat,
+ USHORT nFormatFlags,
+ BOOL bSameMask,
+ BOOL& rbInKeyInput )
{
if ( !rEditMask.Len() || !bStrictFormat )
- return sal_False;
+ return FALSE;
Selection aOldSel = pEdit->GetSelection();
KeyCode aCode = rKEvt.GetKeyCode();
xub_Unicode cChar = rKEvt.GetCharCode();
- sal_uInt16 nKeyCode = aCode.GetCode();
- sal_Bool bShift = aCode.IsShift();
+ USHORT nKeyCode = aCode.GetCode();
+ BOOL bShift = aCode.IsShift();
xub_StrLen nCursorPos = (xub_StrLen)aOldSel.Max();
xub_StrLen nNewPos;
xub_StrLen nTempPos;
@@ -511,7 +511,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return sal_True;
+ return TRUE;
}
else if ( nKeyCode == KEY_RIGHT )
{
@@ -527,7 +527,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return sal_True;
+ return TRUE;
}
else if ( nKeyCode == KEY_HOME )
{
@@ -543,7 +543,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return sal_True;
+ return TRUE;
}
else if ( nKeyCode == KEY_END )
{
@@ -565,7 +565,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return sal_True;
+ return TRUE;
}
else if ( (nKeyCode == KEY_BACKSPACE) || (nKeyCode == KEY_DELETE) )
{
@@ -616,16 +616,16 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( bSameMask )
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
- rbInKeyInput = sal_True;
+ rbInKeyInput = TRUE;
pEdit->SetText( aStr, Selection( nNewPos ) );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = sal_False;
+ rbInKeyInput = FALSE;
}
else
pEdit->SetSelection( Selection( nNewPos ) );
- return sal_True;
+ return TRUE;
}
else if ( nKeyCode == KEY_INSERT )
{
@@ -635,13 +635,13 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( !bSameMask )
{
Sound::Beep();
- return sal_True;
+ return TRUE;
}
}
}
if ( rKEvt.GetKeyCode().IsMod2() || (cChar < 32) || (cChar == 127) )
- return sal_False;
+ return FALSE;
Selection aSel = aOldSel;
aSel.Justify();
@@ -679,7 +679,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( nTempPos > nNewPos )
{
pEdit->SetSelection( Selection( nTempPos ) );
- return sal_True;
+ return TRUE;
}
}
break;
@@ -696,7 +696,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( cChar )
{
XubString aStr = pEdit->GetText();
- sal_Bool bError = sal_False;
+ BOOL bError = FALSE;
if ( bSameMask && pEdit->IsInsertMode() )
{
// Text um Spacezeichen und Literale am Ende kuerzen, bis zur
@@ -727,7 +727,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
}
else
- bError = sal_True;
+ bError = TRUE;
}
else
{
@@ -748,18 +748,18 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
Sound::Beep();
else
{
- rbInKeyInput = sal_True;
+ rbInKeyInput = TRUE;
Selection aNewSel( ImplPatternRightPos( aStr, rEditMask, nFormatFlags, bSameMask, nNewPos ) );
pEdit->SetText( aStr, aNewSel );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = sal_False;
+ rbInKeyInput = FALSE;
}
}
else
Sound::Beep();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -769,7 +769,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
{
maEditMask = rEditMask;
maLiteralMask = rLiteralMask;
- mbSameMask = sal_True;
+ mbSameMask = TRUE;
if ( maEditMask.Len() != maLiteralMask.Len() )
{
@@ -794,14 +794,14 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
(cTemp == EDITMASK_UPPERALLCHAR) ||
(cTemp == EDITMASK_NUMSPACE) )
{
- mbSameMask = sal_False;
+ mbSameMask = FALSE;
break;
}
if ( i < rLiteralMask.Len() )
{
if ( rLiteralMask.GetChar( i ) != ' ' )
{
- mbSameMask = sal_False;
+ mbSameMask = FALSE;
break;
}
}
@@ -809,7 +809,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
c = cTemp;
if ( cTemp != c )
{
- mbSameMask = sal_False;
+ mbSameMask = FALSE;
break;
}
}
@@ -822,8 +822,8 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
PatternFormatter::PatternFormatter()
{
mnFormatFlags = 0;
- mbSameMask = sal_True;
- mbInPattKeyInput = sal_False;
+ mbSameMask = TRUE;
+ mbInPattKeyInput = FALSE;
}
// -----------------------------------------------------------------------
@@ -835,17 +835,17 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
-
+ ULONG nMask = pMgr->ReadLong();
+
if ( PATTERNFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
-
+ SetStrictFormat( (BOOL)pMgr->ReadShort() );
+
if ( PATTERNFORMATTER_EDITMASK & nMask )
aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US );
-
+
if ( PATTERNFORMATTER_LITTERALMASK & nMask )
aLiteralMask = pMgr->ReadString();
-
+
if ( (PATTERNFORMATTER_EDITMASK | PATTERNFORMATTER_LITTERALMASK) & nMask )
ImplSetMask( aEditMask, aLiteralMask );
}
@@ -874,7 +874,7 @@ void PatternFormatter::SetString( const XubString& rStr )
if ( GetField() )
{
GetField()->SetText( rStr );
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
}
}
@@ -896,7 +896,7 @@ void PatternFormatter::Reformat()
{
ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) );
if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() )
- GetField()->SetInsertMode( sal_False );
+ GetField()->SetInsertMode( FALSE );
}
}
@@ -967,7 +967,7 @@ long PatternField::PreNotify( NotifyEvent& rNEvt )
long PatternField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( 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( sal_True );
+ MarkToBeReformatted( TRUE );
}
SpinField::Modify();
@@ -1045,7 +1045,7 @@ long PatternBox::PreNotify( NotifyEvent& rNEvt )
long PatternBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( 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( sal_True );
+ MarkToBeReformatted( TRUE );
}
ComboBox::Modify();
@@ -1075,21 +1075,21 @@ void PatternBox::Modify()
void PatternBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
aStr = ImplPatternReformat( GetEntry( i ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
PatternFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void PatternBox::InsertString( const XubString& rStr, sal_uInt16 nPos )
+void PatternBox::InsertString( const XubString& rStr, USHORT nPos )
{
ComboBox::InsertEntry( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ), nPos );
}
@@ -1103,14 +1103,14 @@ void PatternBox::RemoveString( const XubString& rStr )
// -----------------------------------------------------------------------
-XubString PatternBox::GetString( sal_uInt16 nPos ) const
+XubString PatternBox::GetString( USHORT nPos ) const
{
return ImplPatternReformat( ComboBox::GetEntry( nPos ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
}
// -----------------------------------------------------------------------
-sal_uInt16 PatternBox::GetStringPos( const XubString& rStr ) const
+USHORT PatternBox::GetStringPos( const XubString& rStr ) const
{
return ComboBox::GetEntryPos( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ) );
}
@@ -1129,7 +1129,7 @@ static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld )
// -----------------------------------------------------------------------
-static sal_uInt16 ImplCutNumberFromString( XubString& rStr )
+static USHORT ImplCutNumberFromString( XubString& rStr )
{
// Nach Zahl suchen
while ( rStr.Len() && !(rStr.GetChar( 0 ) >= '0' && rStr.GetChar( 0 ) <= '9') )
@@ -1142,28 +1142,28 @@ static sal_uInt16 ImplCutNumberFromString( XubString& rStr )
aNumStr.Insert( rStr.GetChar( 0 ) );
rStr.Erase( 0, 1 );
}
- return (sal_uInt16)aNumStr.ToInt32();
+ return (USHORT)aNumStr.ToInt32();
}
// -----------------------------------------------------------------------
-static sal_Bool ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
+static BOOL ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
{
- sal_uInt16 nPos = rStr.Search( _rLookupMonthName );
+ USHORT nPos = rStr.Search( _rLookupMonthName );
if ( nPos != STRING_NOTFOUND )
{
rStr.Erase( 0, nPos + _rLookupMonthName.Len() );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-static sal_uInt16 ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
+static USHORT ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
{
// search for a month' name
- for ( sal_uInt16 i=1; i <= 12; i++ )
+ for ( USHORT 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 sal_Bool ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
+static BOOL ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
- sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
+ USHORT 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 sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
+static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper,
const AllSettings& )
{
- sal_uInt16 nDay = 0;
- sal_uInt16 nMonth = 0;
- sal_uInt16 nYear = 0;
- sal_Bool bYear = sal_True;
- sal_Bool bError = sal_False;
+ USHORT nDay = 0;
+ USHORT nMonth = 0;
+ USHORT nYear = 0;
+ BOOL bYear = TRUE;
+ BOOL bError = FALSE;
String aStr( rStr );
if ( eDateFormat == XTDATEF_SYSTEM_LONG )
@@ -1245,13 +1245,13 @@ static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFie
{
// Check if year is present:
String aDateSep = ImplGetDateSep( rLocaleDataWrapper, eDateFormat );
- sal_uInt16 nSepPos = aStr.Search( aDateSep );
+ USHORT nSepPos = aStr.Search( aDateSep );
if ( nSepPos == STRING_NOTFOUND )
- return sal_False;
+ return FALSE;
nSepPos = aStr.Search( aDateSep, nSepPos+1 );
if ( ( nSepPos == STRING_NOTFOUND ) || ( nSepPos == (aStr.Len()-1) ) )
{
- bYear = sal_False;
+ bYear = FALSE;
nYear = Date().GetYear();
}
@@ -1298,31 +1298,31 @@ static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFie
default:
{
- OSL_FAIL( "DateFormat???" );
+ DBG_ERROR( "DateFormat???" );
}
}
}
if ( bError || !nDay || !nMonth )
- return sal_False;
+ return FALSE;
Date aNewDate( nDay, nMonth, nYear );
DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() );
if ( aNewDate.IsValid() )
{
rDate = aNewDate;
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
+BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
{
Date aDate( 0, 0, 0 );
- if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
- return sal_True;
+ if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ return TRUE;
Date aTempDate = aDate;
if ( aTempDate > GetMax() )
@@ -1336,7 +1336,7 @@ sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOut
if( !GetErrorHdl().Call( this ) )
{
maCorrectedDate = Date();
- return sal_False;
+ return FALSE;
}
else
maCorrectedDate = Date();
@@ -1344,7 +1344,7 @@ sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOut
rOutStr = ImplGetDateAsText( aTempDate, rSettings );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1352,7 +1352,7 @@ sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOut
XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
const AllSettings& ) const
{
- sal_Bool bShowCentury = sal_False;
+ BOOL bShowCentury = 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 = sal_True;
+ bShowCentury = TRUE;
}
break;
default:
{
- bShowCentury = sal_False;
+ bShowCentury = FALSE;
}
}
if ( !bShowCentury )
{
// Check if I have to use force showing the century
- sal_uInt16 nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
- sal_uInt16 nYear = rDate.GetYear();
+ USHORT nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
+ USHORT nYear = rDate.GetYear();
// Wenn Jahr nicht im 2stelligen Grenzbereich liegt,
if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
- bShowCentury = sal_True;
+ bShowCentury = TRUE;
}
sal_Unicode aBuf[128];
sal_Unicode* pBuf = aBuf;
- 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;
+ String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), GetExtDateFormat( TRUE ) );
+ USHORT nDay = rDate.GetDay();
+ USHORT nMonth = rDate.GetMonth();
+ USHORT nYear = rDate.GetYear();
+ USHORT nYearLen = bShowCentury ? 4 : 2;
if ( !bShowCentury )
nYear %= 100;
- switch ( GetExtDateFormat( sal_True ) )
+ switch ( GetExtDateFormat( TRUE ) )
{
case XTDATEF_SYSTEM_LONG:
{
- return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !bShowCentury );
+ return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !bShowCentury );
}
case XTDATEF_SHORT_DDMMYY:
case XTDATEF_SHORT_DDMMYYYY:
@@ -1434,16 +1434,16 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
break;
default:
{
- OSL_FAIL( "DateFormat???" );
+ DBG_ERROR( "DateFormat???" );
}
}
- return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ return String( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp )
+static void ImplDateIncrementDay( Date& rDate, BOOL bUp )
{
DateFormatter::ExpandCentury( rDate );
@@ -1461,12 +1461,12 @@ static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp )
// -----------------------------------------------------------------------
-static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp )
+static void ImplDateIncrementMonth( Date& rDate, BOOL bUp )
{
DateFormatter::ExpandCentury( rDate );
- sal_uInt16 nMonth = rDate.GetMonth();
- sal_uInt16 nYear = rDate.GetYear();
+ USHORT nMonth = rDate.GetMonth();
+ USHORT nYear = rDate.GetYear();
if ( bUp )
{
if ( (nMonth == 12) && (nYear < 9999) )
@@ -1494,18 +1494,18 @@ static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp )
}
}
- sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
+ USHORT nDaysInMonth = rDate.GetDaysInMonth();
if ( rDate.GetDay() > nDaysInMonth )
rDate.SetDay( nDaysInMonth );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
+static void ImplDateIncrementYear( Date& rDate, BOOL bUp )
{
DateFormatter::ExpandCentury( rDate );
- sal_uInt16 nYear = rDate.GetYear();
+ USHORT nYear = rDate.GetYear();
if ( bUp )
{
if ( nYear < 9999 )
@@ -1519,14 +1519,14 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
}
// -----------------------------------------------------------------------
-sal_Bool DateFormatter::ImplAllowMalformedInput() const
+BOOL DateFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void DateField::ImplDateSpinArea( sal_Bool bUp )
+void DateField::ImplDateSpinArea( BOOL bUp )
{
// Wenn alles selektiert ist, Tage hochzaehlen
if ( GetField() )
@@ -1541,7 +1541,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
{
xub_StrLen nDateArea = 0;
- ExtDateFieldFormat eFormat = GetExtDateFormat( sal_True );
+ ExtDateFieldFormat eFormat = GetExtDateFormat( TRUE );
if ( eFormat == XTDATEF_SYSTEM_LONG )
{
eFormat = ImplGetExtFormat( ImplGetLocaleDataWrapper().getLongDateFormat() );
@@ -1555,7 +1555,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
for ( xub_StrLen i = 1; i <= 3; i++ )
{
nPos = aText.Search( aDateSep, nPos );
- if ( nPos >= (sal_uInt16)aSelection.Max() )
+ if ( nPos >= (USHORT)aSelection.Max() )
{
nDateArea = i;
break;
@@ -1564,7 +1564,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
nPos++;
}
}
-
+
switch( eFormat )
{
@@ -1607,7 +1607,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
}
break;
default:
- OSL_FAIL( "invalid conversion" );
+ DBG_ERROR( "invalid conversion" );
break;
}
}
@@ -1620,8 +1620,8 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
void DateFormatter::ImplInit()
{
- mbLongFormat = sal_False;
- mbShowDateCentury = sal_True;
+ mbLongFormat = FALSE;
+ mbShowDateCentury = 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( sal_True )
+ mbEnforceValidValue( TRUE )
{
ImplInit();
}
@@ -1646,8 +1646,8 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
-
+ ULONG nMask = pMgr->ReadLong();
+
if ( DATEFORMATTER_MIN & nMask )
{
maMin = Date( ResId( (RSHEADER_TYPE *)pMgr->GetClass(), *pMgr ) );
@@ -1659,11 +1659,11 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE*)pMgr->GetClass() ) );
}
if ( DATEFORMATTER_LONGFORMAT & nMask )
- mbLongFormat = (sal_Bool)pMgr->ReadShort();
-
+ mbLongFormat = (BOOL)pMgr->ReadShort();
+
if ( DATEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
-
+ SetStrictFormat( (BOOL)pMgr->ReadShort() );
+
if ( DATEFORMATTER_VALUE & nMask )
{
maFieldDate = Date( ResId( (RSHEADER_TYPE *)pMgr->GetClass(), *pMgr ) );
@@ -1718,13 +1718,13 @@ void DateFormatter::SetExtDateFormat( ExtDateFieldFormat eFormat )
// -----------------------------------------------------------------------
-ExtDateFieldFormat DateFormatter::GetExtDateFormat( sal_Bool bResolveSystemFormat ) const
+ExtDateFieldFormat DateFormatter::GetExtDateFormat( BOOL bResolveSystemFormat ) const
{
ExtDateFieldFormat eDateFormat = (ExtDateFieldFormat)mnExtDateFormat;
if ( bResolveSystemFormat && ( eDateFormat <= XTDATEF_SYSTEM_SHORT_YYYY ) )
{
- sal_Bool bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY);
+ 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( sal_Bool bLong )
+void DateFormatter::SetLongFormat( BOOL bLong )
{
mbLongFormat = bLong;
@@ -1786,7 +1786,7 @@ void DateFormatter::SetLongFormat( sal_Bool bLong )
// -----------------------------------------------------------------------
-void DateFormatter::SetShowDateCentury( sal_Bool bShowDateCentury )
+void DateFormatter::SetShowDateCentury( BOOL bShowDateCentury )
{
mbShowDateCentury = bShowDateCentury;
@@ -1902,7 +1902,7 @@ Date DateFormatter::GetDate() const
if ( GetField() )
{
- if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(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(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
if ( ImplAllowMalformedInput() )
aDate = GetInvalidDate();
}
@@ -1959,20 +1959,20 @@ void DateFormatter::SetEmptyDate()
// -----------------------------------------------------------------------
-sal_Bool DateFormatter::IsEmptyDate() const
+BOOL DateFormatter::IsEmptyDate() const
{
- sal_Bool bEmpty = FormatterBase::IsEmptyFieldValue();
+ BOOL bEmpty = FormatterBase::IsEmptyFieldValue();
if ( GetField() && MustBeReformatted() && IsEmptyFieldValueEnabled() )
{
if ( !GetField()->GetText().Len() )
{
- bEmpty = sal_True;
+ bEmpty = TRUE;
}
else if ( !maLastDate.GetDate() )
{
Date aDate;
- bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
}
return bEmpty;
@@ -1980,14 +1980,14 @@ sal_Bool DateFormatter::IsEmptyDate() const
// -----------------------------------------------------------------------
-sal_Bool DateFormatter::IsDateModified() const
+BOOL DateFormatter::IsDateModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyDate();
else if ( GetDate() != maFieldDate )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -2001,14 +2001,14 @@ void DateFormatter::Reformat()
return;
XubString aStr;
- sal_Bool bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
+ BOOL bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
if( !bOK )
return;
if ( aStr.Len() )
{
ImplSetText( aStr );
- ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
else
{
@@ -2019,7 +2019,7 @@ void DateFormatter::Reformat()
else
{
ImplSetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( sal_True );
+ SetEmptyFieldValueData( TRUE );
}
}
}
@@ -2033,12 +2033,12 @@ void DateFormatter::ExpandCentury( Date& rDate )
// -----------------------------------------------------------------------
-void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart )
+void DateFormatter::ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart )
{
- sal_uInt16 nDateYear = rDate.GetYear();
+ USHORT nDateYear = rDate.GetYear();
if ( nDateYear < 100 )
{
- sal_uInt16 nCentury = nTwoDigitYearStart / 100;
+ USHORT nCentury = nTwoDigitYearStart / 100;
if ( nDateYear < (nTwoDigitYearStart % 100) )
nCentury++;
rDate.SetYear( nDateYear + (nCentury*100) );
@@ -2083,13 +2083,13 @@ DateField::DateField( Window* pParent, const ResId& rResId ) :
void DateField::ImplLoadRes( const ResId& rResId )
{
SpinField::ImplLoadRes( rResId );
-
+
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
DateFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
-
- sal_uLong nMask = ReadLongRes();
+
+ 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( sal_True ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( TRUE ), ImplGetLocaleDataWrapper() ) )
return 1;
}
@@ -2131,7 +2131,7 @@ long DateField::PreNotify( NotifyEvent& rNEvt )
long DateField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( 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
- sal_Bool bTextLen = GetText().Len() != 0;
+ 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(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetText(), aDate, GetExtDateFormat(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( sal_True );
+ SetEmptyFieldValueData( TRUE );
}
}
}
@@ -2184,7 +2184,7 @@ void DateField::DataChanged( const DataChangedEvent& rDCEvt )
void DateField::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -2192,7 +2192,7 @@ void DateField::Modify()
void DateField::Up()
{
- ImplDateSpinArea( sal_True );
+ ImplDateSpinArea( TRUE );
SpinField::Up();
}
@@ -2200,7 +2200,7 @@ void DateField::Up()
void DateField::Down()
{
- ImplDateSpinArea( sal_False );
+ ImplDateSpinArea( 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( sal_True ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( 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( sal_False );
+ MarkToBeReformatted( FALSE );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() )
{
- sal_Bool bTextLen = GetText().Len() != 0;
+ BOOL bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
Reformat();
else if ( !bTextLen && IsEmptyFieldValueEnabled() )
{
ResetLastDate();
- SetEmptyFieldValueData( sal_True );
+ SetEmptyFieldValueData( TRUE );
}
}
}
@@ -2313,7 +2313,7 @@ long DateBox::Notify( NotifyEvent& rNEvt )
void DateBox::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -2322,21 +2322,21 @@ void DateBox::Modify()
void DateBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
ImplDateReformat( GetEntry( i ), aStr, GetFieldSettings() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
DateFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void DateBox::InsertDate( const Date& rDate, sal_uInt16 nPos )
+void DateBox::InsertDate( const Date& rDate, USHORT nPos )
{
Date aDate = rDate;
if ( aDate > GetMax() )
@@ -2356,20 +2356,20 @@ void DateBox::RemoveDate( const Date& rDate )
// -----------------------------------------------------------------------
-Date DateBox::GetDate( sal_uInt16 nPos ) const
+Date DateBox::GetDate( USHORT nPos ) const
{
Date aDate( 0, 0, 0 );
- ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
+ ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
return aDate;
}
// -----------------------------------------------------------------------
-sal_uInt16 DateBox::GetDatePos( const Date& rDate ) const
+USHORT DateBox::GetDatePos( const Date& rDate ) const
{
XubString aStr;
if ( IsLongFormat() )
- aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !IsShowDateCentury() );
+ aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !IsShowDateCentury() );
else
aStr = ImplGetLocaleDataWrapper().getDate( rDate );
return ComboBox::GetEntryPos( aStr );
@@ -2377,18 +2377,18 @@ sal_uInt16 DateBox::GetDatePos( const Date& rDate ) const
// -----------------------------------------------------------------------
-static sal_Bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- sal_Bool bStrictFormat, sal_Bool bDuration,
+static BOOL ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ BOOL bStrictFormat, BOOL bDuration,
TimeFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
if ( !bStrictFormat )
- return sal_False;
+ return FALSE;
else
{
- sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
+ USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
@@ -2400,55 +2400,55 @@ static sal_Bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
((eFormat == TIMEF_100TH_SEC) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
((eFormat == TIMEF_SEC_CS) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
(bDuration && (cChar == '-')) )
- return sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
}
// -----------------------------------------------------------------------
-static sal_Bool ImplIsOnlyDigits( const String& _rStr )
+static 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 sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-static sal_Bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const String& _rStr )
+static BOOL ImplIsValidTimePortion( BOOL _bSkipInvalidCharacters, const String& _rStr )
{
if ( !_bSkipInvalidCharacters )
{
if ( ( _rStr.Len() > 2 ) || ( _rStr.Len() < 1 ) || !ImplIsOnlyDigits( _rStr ) )
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-static sal_Bool ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, sal_Bool _bSkipInvalidCharacters, short* _pPortion )
+static BOOL ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, BOOL _bSkipInvalidCharacters, short* _pPortion )
{
String sPortion = _rStr.Copy( 0, _nSepPos );
_rStr.Erase( 0, _nSepPos + 1 );
if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
- return sal_False;
+ return FALSE;
*_pPortion = (short)sPortion.ToInt32();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
- TimeFieldFormat eFormat, sal_Bool bDuration,
- const LocaleDataWrapper& rLocaleDataWrapper, sal_Bool _bSkipInvalidCharacters = sal_True )
+static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
+ TimeFieldFormat eFormat, BOOL bDuration,
+ const LocaleDataWrapper& rLocaleDataWrapper, BOOL _bSkipInvalidCharacters = TRUE )
{
XubString aStr = rStr;
short nHour = 0;
@@ -2458,7 +2458,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
Time aTime( 0, 0, 0 );
if ( !rStr.Len() )
- return sal_False;
+ return FALSE;
// Nach Separatoren suchen
if ( rLocaleDataWrapper.getTimeSep().Len() )
@@ -2480,34 +2480,34 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
}
- sal_Bool bNegative = sal_False;
+ BOOL bNegative = FALSE;
xub_StrLen nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( eFormat != TIMEF_SEC_CS )
{
if ( nSepPos == STRING_NOTFOUND )
nSepPos = aStr.Len();
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nHour ) )
- return sal_False;
+ return FALSE;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nMinute ) )
- return sal_False;
+ return FALSE;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) )
- return sal_False;
+ return FALSE;
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
n100Sec = (short)aStr.ToInt32();
}
else
@@ -2531,7 +2531,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( nSepPos != STRING_NOTFOUND )
{
nMinute = nSecond;
@@ -2540,7 +2540,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( nSepPos != STRING_NOTFOUND )
{
nHour = nMinute;
@@ -2592,7 +2592,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
if ( (nMinute > 59) || (nSecond > 59) || (n100Sec > 100) )
- return sal_False;
+ return FALSE;
if ( eFormat == TIMEF_NONE )
nSecond = n100Sec = 0;
@@ -2603,7 +2603,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
- return sal_False;
+ return FALSE;
aStr.ToUpperAscii();
XubString aAM( rLocaleDataWrapper.getTimeAM() );
@@ -2619,39 +2619,39 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
if ( (nHour == 12) && ( ( aStr.Search( aAM ) != STRING_NOTFOUND ) || ( aStr.Search( aAM2 ) != STRING_NOTFOUND ) ) )
nHour = 0;
- aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
- (sal_uInt16)n100Sec );
+ aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
+ (USHORT)n100Sec );
}
else
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
{
- bNegative = sal_True;
+ bNegative = TRUE;
nHour = nHour < 0 ? -nHour : nHour;
nMinute = nMinute < 0 ? -nMinute : nMinute;
nSecond = nSecond < 0 ? -nSecond : nSecond;
n100Sec = n100Sec < 0 ? -n100Sec : n100Sec;
}
- aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
- (sal_uInt16)n100Sec );
+ aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
+ (USHORT)n100Sec );
if ( bNegative )
aTime = -aTime;
}
rTime = aTime;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
+BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
{
Time aTime( 0, 0, 0 );
if ( !ImplTimeGetValue( rStr, aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
- return sal_True;
+ return TRUE;
Time aTempTime = aTime;
if ( aTempTime > GetMax() )
@@ -2665,22 +2665,22 @@ sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOut
if ( !GetErrorHdl().Call( this ) )
{
maCorrectedTime = Time();
- return sal_False;
+ return FALSE;
}
else
maCorrectedTime = Time();
}
- sal_Bool bSecond = sal_False;
- sal_Bool b100Sec = sal_False;
+ BOOL bSecond = FALSE;
+ BOOL b100Sec = FALSE;
if ( meFormat != TIMEF_NONE )
- bSecond = sal_True;
+ bSecond = TRUE;
if ( meFormat == TIMEF_100TH_SEC )
- b100Sec = sal_True;
+ b100Sec = TRUE;
if ( meFormat == TIMEF_SEC_CS )
{
- sal_uLong n = aTempTime.GetHour() * 3600L;
+ ULONG n = aTempTime.GetHour() * 3600L;
n += aTempTime.GetMin() * 60L;
n += aTempTime.GetSec();
rOutStr = String::CreateFromInt32( n );
@@ -2710,18 +2710,18 @@ sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOut
}
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool TimeFormatter::ImplAllowMalformedInput() const
+BOOL TimeFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void TimeField::ImplTimeSpinArea( sal_Bool bUp )
+void TimeField::ImplTimeSpinArea( BOOL bUp )
{
if ( GetField() )
{
@@ -2792,7 +2792,7 @@ void TimeField::ImplTimeSpinArea( sal_Bool bUp )
void TimeFormatter::ImplInit()
{
meFormat = TIMEF_NONE;
- mbDuration = sal_False;
+ mbDuration = 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( sal_True ),
+ mbEnforceValidValue( TRUE ),
maFieldTime( 0, 0 )
{
ImplInit();
@@ -2815,29 +2815,29 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
-
+ ULONG nMask = pMgr->ReadLong();
+
if ( TIMEFORMATTER_MIN & nMask )
{
SetMin( Time( ResId( (RSHEADER_TYPE *)pMgr->GetClass(), *pMgr ) ) );
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE *)pMgr->GetClass() ) );
}
-
+
if ( TIMEFORMATTER_MAX & nMask )
{
SetMax( Time( ResId( (RSHEADER_TYPE *)pMgr->GetClass(), *pMgr ) ) );
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE *)pMgr->GetClass() ) );
}
-
+
if ( TIMEFORMATTER_TIMEFIELDFORMAT & nMask )
meFormat = (TimeFieldFormat)pMgr->ReadLong();
-
+
if ( TIMEFORMATTER_DURATION & nMask )
- mbDuration = (sal_Bool)pMgr->ReadShort();
-
+ mbDuration = (BOOL)pMgr->ReadShort();
+
if ( TIMEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
-
+ SetStrictFormat( (BOOL)pMgr->ReadShort() );
+
if ( TIMEFORMATTER_VALUE & nMask )
{
maFieldTime = Time( ResId( (RSHEADER_TYPE *)pMgr->GetClass(), *pMgr ) );
@@ -2846,7 +2846,7 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
if ( maFieldTime < GetMin() )
maFieldTime = GetMin();
maLastTime = maFieldTime;
-
+
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE *)pMgr->GetClass() ) );
}
}
@@ -2887,7 +2887,7 @@ void TimeFormatter::SetMax( const Time& rNewMax )
void TimeFormatter::SetTimeFormat( TimeFormatter::TimeFormat eNewFormat )
{
- mnTimeFormat = sal::static_int_cast<sal_uInt16>(eNewFormat);
+ mnTimeFormat = sal::static_int_cast<USHORT>(eNewFormat);
}
// -----------------------------------------------------------------------
@@ -2907,7 +2907,7 @@ void TimeFormatter::SetFormat( TimeFieldFormat eNewFormat )
// -----------------------------------------------------------------------
-void TimeFormatter::SetDuration( sal_Bool bNewDuration )
+void TimeFormatter::SetDuration( BOOL bNewDuration )
{
mbDuration = bNewDuration;
ReformatAll();
@@ -2919,7 +2919,7 @@ void TimeFormatter::SetTime( const Time& rNewTime )
{
SetUserTime( rNewTime );
maFieldTime = maLastTime;
- SetEmptyFieldValueData( sal_False );
+ SetEmptyFieldValueData( FALSE );
}
// -----------------------------------------------------------------------
@@ -2966,15 +2966,15 @@ void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelect
if ( GetField() )
{
XubString aStr;
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
+ BOOL bSec = FALSE;
+ BOOL b100Sec = FALSE;
if ( meFormat != TIMEF_NONE )
- bSec = sal_True;
+ bSec = TRUE;
if ( meFormat == TIMEF_100TH_SEC || meFormat == TIMEF_SEC_CS )
- b100Sec = sal_True;
+ b100Sec = TRUE;
if ( meFormat == TIMEF_SEC_CS )
{
- sal_uLong n = aNewTime.GetHour() * 3600L;
+ 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() )
{
- sal_Bool bAllowMailformed = ImplAllowMalformedInput();
+ 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() )
{
- sal_Bool bAllowMailformed = ImplAllowMalformedInput();
+ BOOL bAllowMailformed = ImplAllowMalformedInput();
if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
if ( bAllowMailformed )
aTime = GetInvalidTime();
@@ -3064,14 +3064,14 @@ Time TimeFormatter::GetRealTime() const
// -----------------------------------------------------------------------
-sal_Bool TimeFormatter::IsTimeModified() const
+BOOL TimeFormatter::IsTimeModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyTime();
else if ( GetTime() != maFieldTime )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -3085,7 +3085,7 @@ void TimeFormatter::Reformat()
return;
XubString aStr;
- sal_Bool bOK = ImplTimeReformat( GetField()->GetText(), aStr );
+ 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, sal_False, sal_False ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, 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, sal_False, sal_False ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
ImplLoadRes( rResId );
if ( !(nStyle & WB_HIDE ) )
@@ -3137,9 +3137,9 @@ void TimeField::ImplLoadRes( const ResId& rResId )
if( pMgr )
{
TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
-
- sal_uLong nMask = ReadLongRes();
-
+
+ ULONG nMask = ReadLongRes();
+
if ( TIMEFIELD_FIRST & nMask )
{
maFirst = Time( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
@@ -3151,7 +3151,7 @@ void TimeField::ImplLoadRes( const ResId& rResId )
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
}
}
-
+
Reformat();
}
@@ -3179,7 +3179,7 @@ long TimeField::PreNotify( NotifyEvent& rNEvt )
long TimeField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( 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(), sal_False ) )
+ if ( ImplTimeGetValue( GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), 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( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -3226,7 +3226,7 @@ void TimeField::Modify()
void TimeField::Up()
{
- ImplTimeSpinArea( sal_True );
+ ImplTimeSpinArea( TRUE );
SpinField::Up();
}
@@ -3234,7 +3234,7 @@ void TimeField::Up()
void TimeField::Down()
{
- ImplTimeSpinArea( sal_False );
+ ImplTimeSpinArea( FALSE );
SpinField::Down();
}
@@ -3263,44 +3263,44 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
case EXTTIMEF_24H_SHORT:
{
SetTimeFormat( HOUR_24 );
- SetDuration( sal_False );
+ SetDuration( FALSE );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_24H_LONG:
{
SetTimeFormat( HOUR_24 );
- SetDuration( sal_False );
+ SetDuration( FALSE );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_12H_SHORT:
{
SetTimeFormat( HOUR_12 );
- SetDuration( sal_False );
+ SetDuration( FALSE );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_12H_LONG:
{
SetTimeFormat( HOUR_12 );
- SetDuration( sal_False );
+ SetDuration( FALSE );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_DURATION_SHORT:
{
- SetDuration( sal_True );
+ SetDuration( TRUE );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_DURATION_LONG:
{
- SetDuration( sal_True );
+ SetDuration( TRUE );
SetFormat( TIMEF_SEC );
}
break;
- default: OSL_FAIL( "ExtTimeFieldFormat unknown!" );
+ default: DBG_ERROR( "ExtTimeFieldFormat unknown!" );
}
if ( GetField() && GetField()->GetText().Len() )
@@ -3314,7 +3314,7 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, 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, sal_False, sal_False ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, 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( sal_False );
+ MarkToBeReformatted( 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( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -3399,21 +3399,21 @@ void TimeBox::Modify()
void TimeBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT i=0; i < nEntryCount; i++ )
{
ImplTimeReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
TimeFormatter::Reformat();
- SetUpdateMode( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
+void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
{
Time aTime = rTime;
if ( aTime > GetMax() )
@@ -3421,12 +3421,12 @@ void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
else if ( aTime < GetMin() )
aTime = GetMin();
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
+ BOOL bSec = FALSE;
+ BOOL b100Sec = FALSE;
if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
+ bSec = TRUE;
if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
+ bSec = b100Sec = TRUE;
ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos );
}
@@ -3434,18 +3434,18 @@ void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
void TimeBox::RemoveTime( const Time& rTime )
{
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
+ BOOL bSec = FALSE;
+ BOOL b100Sec = FALSE;
if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
+ bSec = TRUE;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
+ bSec = b100Sec = TRUE;
ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
// -----------------------------------------------------------------------
-Time TimeBox::GetTime( sal_uInt16 nPos ) const
+Time TimeBox::GetTime( USHORT nPos ) const
{
Time aTime( 0, 0, 0 );
ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() );
@@ -3454,14 +3454,14 @@ Time TimeBox::GetTime( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const
+USHORT TimeBox::GetTimePos( const Time& rTime ) const
{
- sal_Bool bSec = sal_False;
- sal_Bool b100Sec = sal_False;
+ BOOL bSec = FALSE;
+ BOOL b100Sec = FALSE;
if ( GetFormat() == TIMEF_SEC )
- bSec = sal_True;
+ bSec = TRUE;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = sal_True;
+ bSec = b100Sec = TRUE;
return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
diff --git a/vcl/source/control/fixbrd.cxx b/vcl/source/control/fixbrd.cxx
index 4efbbe2deee1..664c42394a0d 100644
--- a/vcl/source/control/fixbrd.cxx
+++ b/vcl/source/control/fixbrd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,8 +39,8 @@
void FixedBorder::ImplInit( Window* pParent, WinBits nStyle )
{
- mnType = FIXEDBORDER_TYPE_DOUBLEOUT;
- mbTransparent = sal_True;
+ mnType = FIXEDBORDER_TYPE_DOUBLEOUT;
+ mbTransparent = TRUE;
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
@@ -65,18 +65,18 @@ void FixedBorder::ImplInitSettings()
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() && mbTransparent )
{
- SetMouseTransparent( sal_True );
- EnableChildTransparentMode( sal_True );
+ SetMouseTransparent( TRUE );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- SetMouseTransparent( sal_False );
- EnableChildTransparentMode( sal_False );
+ SetMouseTransparent( FALSE );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -115,12 +115,12 @@ FixedBorder::~FixedBorder()
// -----------------------------------------------------------------------
-void FixedBorder::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void FixedBorder::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- Rectangle aRect( rPos, rSize );
- sal_uInt16 nBorderStyle = mnType;
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Rectangle aRect( rPos, rSize );
+ USHORT nBorderStyle = mnType;
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
@@ -143,7 +143,7 @@ void FixedBorder::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
else
*/
{
- DecorationView aDecoView( pDev );
+ DecorationView aDecoView( pDev );
aDecoView.DrawFrame( aRect, nBorderStyle );
}
}
@@ -158,10 +158,10 @@ void FixedBorder::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBorder::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
- Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
pDev->Push();
pDev->SetMapMode();
@@ -213,7 +213,7 @@ void FixedBorder::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void FixedBorder::SetTransparent( sal_Bool bTransparent )
+void FixedBorder::SetTransparent( BOOL bTransparent )
{
if ( mbTransparent != bTransparent )
{
@@ -225,7 +225,7 @@ void FixedBorder::SetTransparent( sal_Bool bTransparent )
// -----------------------------------------------------------------------
-void FixedBorder::SetBorderType( sal_uInt16 nType )
+void FixedBorder::SetBorderType( USHORT nType )
{
if ( mnType != nType )
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 1828ded64a14..c0588e941df1 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,31 +28,31 @@
// 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>
// =======================================================================
-#define FIXEDLINE_TEXT_BORDER 4
+#define FIXEDLINE_TEXT_BORDER 4
-#define FIXEDTEXT_VIEW_STYLE (WB_3DLOOK | \
- WB_LEFT | WB_CENTER | WB_RIGHT | \
- WB_TOP | WB_VCENTER | WB_BOTTOM | \
- WB_WORDBREAK | WB_NOLABEL | \
+#define FIXEDTEXT_VIEW_STYLE (WB_3DLOOK | \
+ WB_LEFT | WB_CENTER | WB_RIGHT | \
+ WB_TOP | WB_VCENTER | WB_BOTTOM | \
+ WB_WORDBREAK | WB_NOLABEL | \
WB_INFO | WB_PATHELLIPSIS)
-#define FIXEDLINE_VIEW_STYLE (WB_3DLOOK | WB_NOLABEL)
-#define FIXEDBITMAP_VIEW_STYLE (WB_3DLOOK | \
- WB_LEFT | WB_CENTER | WB_RIGHT | \
- WB_TOP | WB_VCENTER | WB_BOTTOM | \
+#define FIXEDLINE_VIEW_STYLE (WB_3DLOOK | WB_NOLABEL)
+#define FIXEDBITMAP_VIEW_STYLE (WB_3DLOOK | \
+ WB_LEFT | WB_CENTER | WB_RIGHT | \
+ WB_TOP | WB_VCENTER | WB_BOTTOM | \
WB_SCALE)
-#define FIXEDIMAGE_VIEW_STYLE (WB_3DLOOK | \
- WB_LEFT | WB_CENTER | WB_RIGHT | \
- WB_TOP | WB_VCENTER | WB_BOTTOM | \
+#define FIXEDIMAGE_VIEW_STYLE (WB_3DLOOK | \
+ WB_LEFT | WB_CENTER | WB_RIGHT | \
+ WB_TOP | WB_VCENTER | WB_BOTTOM | \
WB_SCALE)
// =======================================================================
@@ -60,8 +60,8 @@
static Point ImplCalcPos( WinBits nStyle, const Point& rPos,
const Size& rObjSize, const Size& rWinSize )
{
- long nX;
- long nY;
+ long nX;
+ long nY;
if ( nStyle & WB_LEFT )
nX = 0;
@@ -95,7 +95,7 @@ void FixedText::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -122,8 +122,8 @@ const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedText::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void FixedText::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -132,16 +132,16 @@ void FixedText::ImplInitSettings( sal_Bool bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( 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 = sal_True;
+ ImplGetWindowImpl()->mbDisableAccessibleLabelForRelation = TRUE;
if ( !(nStyle & WB_HIDE) )
Show();
@@ -191,9 +191,9 @@ FixedText::FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessi
// -----------------------------------------------------------------------
-sal_uInt16 FixedText::ImplGetTextStyle( WinBits nWinStyle )
+USHORT FixedText::ImplGetTextStyle( WinBits nWinStyle )
{
- sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
+ USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
if( ! (nWinStyle & WB_NOMULTILINE) )
nTextStyle |= TEXT_DRAW_MULTILINE;
@@ -224,15 +224,15 @@ sal_uInt16 FixedText::ImplGetTextStyle( WinBits nWinStyle )
// -----------------------------------------------------------------------
-void FixedText::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
bool bFillLayout
) const
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- WinBits nWinStyle = GetStyle();
- XubString aText( GetText() );
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ WinBits nWinStyle = GetStyle();
+ XubString aText( GetText() );
+ USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
Point aPos = rPos;
if ( nWinStyle & WB_EXTRAOFFSET )
@@ -280,13 +280,13 @@ void FixedText::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
- Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = GetDrawPixelFont( pDev );
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Font aFont = GetDrawPixelFont( pDev );
pDev->Push();
pDev->SetMapMode();
@@ -297,8 +297,8 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextColor( GetTextColor() );
pDev->SetTextFillColor();
- sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ 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( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -377,7 +377,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -386,7 +386,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth )
{
- sal_uInt16 nStyle = ImplGetTextStyle( pControl->GetStyle() );
+ USHORT 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( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -462,8 +462,8 @@ const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedLine::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void FixedLine::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -472,16 +472,16 @@ void FixedLine::ImplInitSettings( sal_Bool bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -495,57 +495,37 @@ void FixedLine::ImplInitSettings( sal_Bool bFont,
void FixedLine::ImplDraw( bool bLayout )
{
- Size aOutSize = GetOutputSizePixel();
- String aText = GetText();
- WinBits nWinStyle = GetStyle();
- MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
+ Size aOutSize = GetOutputSizePixel();
+ String aText = GetText();
+ WinBits nWinStyle = GetStyle();
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() )
+ if ( !aText.Len() || (nWinStyle & WB_VERT) )
{
if( !pVector )
{
+ long nX = 0;
+ long nY = 0;
+
if ( nWinStyle & WB_VERT )
{
- long nX = (aOutSize.Width()-1)/2;
+ nX = (aOutSize.Width()-1)/2;
aDecoView.DrawSeparator( Point( nX, 0 ), Point( nX, aOutSize.Height()-1 ) );
}
else
{
- long nY = (aOutSize.Height()-1)/2;
+ nY = (aOutSize.Height()-1)/2;
aDecoView.DrawSeparator( Point( 0, nY ), Point( aOutSize.Width()-1, nY ), false );
}
}
}
- 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
{
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
- Rectangle aRect( 0, 0, aOutSize.Width(), aOutSize.Height() );
+ USHORT 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;
@@ -560,8 +540,6 @@ 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 );
}
}
}
@@ -607,7 +585,7 @@ void FixedLine::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void FixedLine::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
+void FixedLine::Draw( OutputDevice*, const Point&, const Size&, ULONG )
{
}
@@ -639,21 +617,21 @@ void FixedLine::StateChanged( StateChangedType nType )
(GetStyle() & FIXEDLINE_VIEW_STYLE) )
Invalidate();
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_STYLE) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -669,7 +647,7 @@ void FixedLine::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -711,16 +689,16 @@ void FixedBitmap::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -735,7 +713,7 @@ void FixedBitmap::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( RSC_FIXEDBITMAP_BITMAP & nObjMask )
{
@@ -774,12 +752,17 @@ FixedBitmap::~FixedBitmap()
// -----------------------------------------------------------------------
-void FixedBitmap::ImplDraw( OutputDevice* pDev, sal_uLong /* nDrawFlags */,
+void FixedBitmap::ImplDraw( OutputDevice* pDev, ULONG /* nDrawFlags */,
const Point& rPos, const Size& rSize )
{
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
+ if( !!maBitmapHC )
+ {
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pBitmap = &maBitmapHC;
+ }
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
{
@@ -822,11 +805,11 @@ void FixedBitmap::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
- Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
- Rectangle aRect( aPos, aSize );
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
pDev->Push();
pDev->SetMapMode();
@@ -901,17 +884,28 @@ void FixedBitmap::SetBitmap( const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-sal_Bool FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
+BOOL FixedBitmap::SetModeBitmap( const Bitmap& rBitmap, BmpColorMode eMode )
{
- SetBitmap( rBitmap );
- return sal_True;
+ if( eMode == BMP_COLOR_NORMAL )
+ SetBitmap( rBitmap );
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ maBitmapHC = rBitmap;
+ StateChanged( STATE_CHANGE_DATA );
+ }
+ else
+ return FALSE;
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Bitmap& FixedBitmap::GetModeBitmap( ) const
+const Bitmap& FixedBitmap::GetModeBitmap( BmpColorMode eMode) const
{
- return maBitmap;
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maBitmapHC;
+ else
+ return maBitmap;
}
// =======================================================================
@@ -919,7 +913,7 @@ const Bitmap& FixedBitmap::GetModeBitmap( ) const
void FixedImage::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
- mbInUserDraw = sal_False;
+ mbInUserDraw = FALSE;
Control::ImplInit( pParent, nStyle, NULL );
ImplInitSettings();
}
@@ -940,16 +934,16 @@ void FixedImage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -964,7 +958,7 @@ void FixedImage::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( RSC_FIXEDIMAGE_IMAGE & nObjMask )
{
@@ -1003,10 +997,10 @@ FixedImage::~FixedImage()
// -----------------------------------------------------------------------
-void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize )
{
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
@@ -1015,6 +1009,11 @@ void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
Image *pImage = &maImage;
Color aCol;
+ if( !!maImageHC )
+ {
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImage = &maImageHC;
+ }
// Haben wir ueberhaupt ein Image
if ( !(!(*pImage)) )
@@ -1028,10 +1027,10 @@ void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
}
}
- mbInUserDraw = sal_True;
+ mbInUserDraw = TRUE;
UserDrawEvent aUDEvt( pDev, Rectangle( rPos, rSize ), 0, nStyle );
UserDraw( aUDEvt );
- mbInUserDraw = sal_False;
+ mbInUserDraw = FALSE;
}
// -----------------------------------------------------------------------
@@ -1045,7 +1044,7 @@ void FixedImage::Paint( const Rectangle& )
Size FixedImage::GetOptimalSize( WindowSizeType ) const
{
- const Image* pImage = &maImage;
+ const Image* pImage = GetSettings().GetStyleSettings().GetHighContrastMode() ? &maImageHC : &maImage;
return pImage->GetSizePixel();
}
@@ -1058,11 +1057,11 @@ void FixedImage::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
- Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
- Rectangle aRect( aPos, aSize );
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
pDev->Push();
pDev->SetMapMode();
@@ -1140,17 +1139,31 @@ void FixedImage::SetImage( const Image& rImage )
// -----------------------------------------------------------------------
-sal_Bool FixedImage::SetModeImage( const Image& rImage )
+BOOL FixedImage::SetModeImage( const Image& rImage, BmpColorMode eMode )
{
- SetImage( rImage );
- return sal_True;
+ if( eMode == BMP_COLOR_NORMAL )
+ SetImage( rImage );
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ {
+ if( maImageHC != rImage )
+ {
+ maImageHC = rImage;
+ StateChanged( STATE_CHANGE_DATA );
+ }
+ }
+ else
+ return FALSE;
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Image& FixedImage::GetModeImage( ) const
+const Image& FixedImage::GetModeImage( BmpColorMode eMode ) const
{
- return maImage;
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maImageHC;
+ else
+ return maImage;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 52dd061e317e..9922b458717d 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,10 +38,10 @@
// =======================================================================
-#define GROUP_BORDER 12
-#define GROUP_TEXT_BORDER 2
+#define GROUP_BORDER 12
+#define GROUP_TEXT_BORDER 2
-#define GROUP_VIEW_STYLE (WB_3DLOOK | WB_NOLABEL)
+#define GROUP_VIEW_STYLE (WB_3DLOOK | WB_NOLABEL)
// =======================================================================
@@ -49,8 +49,8 @@ void GroupBox::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- SetMouseTransparent( sal_True );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ SetMouseTransparent( TRUE );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
@@ -77,8 +77,8 @@ const Color& GroupBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void GroupBox::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void GroupBox::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -89,16 +89,16 @@ void GroupBox::ImplInitSettings( sal_Bool bFont,
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -132,16 +132,15 @@ GroupBox::GroupBox( Window* pParent, const ResId& rResId ) :
// -----------------------------------------------------------------------
-void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout )
{
- OSL_TRACE("GroupBox::ImplDraw Y %d, X %d", rPos.Y(), rPos.X() );
- long nTop;
- long nTextOff;
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- XubString aText( GetText() );
- Rectangle aRect( rPos, rSize );
- sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
+ long nTop;
+ long nTextOff;
+ 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;
if ( GetStyle() & WB_NOLABEL )
nTextStyle &= ~TEXT_DRAW_MNEMONIC;
@@ -186,7 +185,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
pDev->SetLineColor( Color( COL_BLACK ) );
else
pDev->SetLineColor( rStyleSettings.GetShadowColor() );
-
+
if ( !aText.Len() )
pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) );
else
@@ -228,7 +227,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
void GroupBox::FillLayoutData() const
{
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
- const_cast<GroupBox*>(this)-> ImplDraw( const_cast<GroupBox*>(this), 0, Point(), GetOutputSizePixel(), true );
+ const_cast<GroupBox*>(this)-> ImplDraw( const_cast<GroupBox*>(this), 0, Point(), GetOutputSizePixel(), true );
}
// -----------------------------------------------------------------------
@@ -241,11 +240,11 @@ void GroupBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void GroupBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- sal_uLong nFlags )
+ ULONG nFlags )
{
- Point aPos = pDev->LogicToPixel( rPos );
- Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = GetDrawPixelFont( pDev );
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Font aFont = GetDrawPixelFont( pDev );
pDev->Push();
pDev->SetMapMode();
@@ -288,20 +287,20 @@ void GroupBox::StateChanged( StateChangedType nType )
(GetStyle() & GROUP_VIEW_STYLE) )
Invalidate();
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -317,7 +316,7 @@ void GroupBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 55e2d0ae0a3a..5c8f4229fa88 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,22 +40,19 @@
#include <vcl/i18nhelp.hxx>
#include <vcl/controldata.hxx>
#include <vcl/unohelp.hxx>
+#include <com/sun/star/i18n/XCollator.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#include <rtl/instance.hxx>
-#include <comphelper/string.hxx>
-#include <comphelper/processfactory.hxx>
-
#define MULTILINE_ENTRY_DRAW_FLAGS ( TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE | TEXT_DRAW_VCENTER )
using namespace ::com::sun::star;
// =======================================================================
-void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
+void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -106,7 +103,7 @@ ImplEntryList::ImplEntryList( Window* pWindow )
mnLastSelected = LISTBOX_ENTRY_NOTFOUND;
mnSelectionAnchor = LISTBOX_ENTRY_NOTFOUND;
mnImages = 0;
- mbCallSelectionChangedHdl = sal_True;
+ mbCallSelectionChangedHdl = TRUE;
mnMRUCount = 0;
mnMaxMRUCount = 0;
@@ -124,7 +121,7 @@ ImplEntryList::~ImplEntryList()
void ImplEntryList::Clear()
{
mnImages = 0;
- for ( sal_uInt16 n = GetEntryCount(); n; )
+ for ( USHORT n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
delete pImplEntry;
@@ -134,7 +131,7 @@ void ImplEntryList::Clear()
// -----------------------------------------------------------------------
-void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
+void ImplEntryList::SelectEntry( USHORT nPos, BOOL bSelect )
{
ImplEntryType* pImplEntry = GetEntry( nPos );
if ( pImplEntry &&
@@ -147,32 +144,20 @@ void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
}
}
-namespace
-{
- struct theSorter
- : public rtl::StaticWithInit< comphelper::string::NaturalStringSorter, theSorter >
- {
- comphelper::string::NaturalStringSorter operator () ()
- {
- return comphelper::string::NaturalStringSorter(
- ::comphelper::getProcessComponentContext(),
- Application::GetSettings().GetLocale());
- }
- };
-}
+// -----------------------------------------------------------------------
-namespace vcl
+uno::Reference< i18n::XCollator > ImplGetCollator (lang::Locale &rLocale)
{
- namespace unohelper
- {
- const comphelper::string::NaturalStringSorter& getNaturalStringSorterForAppLocale()
- {
- return theSorter::get();
- }
- }
+ static uno::Reference< i18n::XCollator > xCollator;
+ if ( !xCollator.is() )
+ xCollator = vcl::unohelper::CreateCollator();
+ if( xCollator.is() )
+ xCollator->loadDefaultCollator (rLocale, 0);
+
+ return xCollator;
}
-sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort )
+USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL bSort )
{
if ( !!pNewEntry->maImage )
mnImages++;
@@ -183,20 +168,23 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
}
else
{
- const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
+ lang::Locale aLocale = Application::GetSettings().GetLocale();
+ uno::Reference< i18n::XCollator > xCollator = ImplGetCollator(aLocale);
const XubString& rStr = pNewEntry->maStr;
- sal_uLong nLow, nHigh, nMid;
+ ULONG nLow, nHigh, nMid;
nHigh = Count();
- ImplEntryType* pTemp = GetEntry( (sal_uInt16)(nHigh-1) );
+ ImplEntryType* pTemp = GetEntry( (USHORT)(nHigh-1) );
try
{
// XXX even though XCollator::compareString returns a sal_Int32 the only
// defined values are {-1, 0, 1} which is compatible with StringCompare
- StringCompare eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
+ StringCompare eComp = xCollator.is() ?
+ (StringCompare)xCollator->compareString (rStr, pTemp->maStr)
+ : COMPARE_EQUAL;
// Schnelles Einfuegen bei sortierten Daten
if ( eComp != COMPARE_LESS )
@@ -206,12 +194,12 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
else
{
nLow = mnMRUCount;
- pTemp = (ImplEntryType*)GetEntry( (sal_uInt16)nLow );
+ pTemp = (ImplEntryType*)GetEntry( (USHORT)nLow );
- eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
+ eComp = (StringCompare)xCollator->compareString (rStr, pTemp->maStr);
if ( eComp != COMPARE_GREATER )
{
- Insert( pNewEntry, (sal_uLong)0 );
+ Insert( pNewEntry, (ULONG)0 );
}
else
{
@@ -222,7 +210,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
nMid = (nLow + nHigh) / 2;
pTemp = (ImplEntryType*)GetObject( nMid );
- eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
+ eComp = (StringCompare)xCollator->compareString (rStr, pTemp->maStr);
if ( eComp == COMPARE_LESS )
nHigh = nMid-1;
@@ -245,21 +233,21 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
}
catch (uno::RuntimeException& )
{
- // XXX this is arguable, if the exception occurred because pNewEntry is
- // garbage you wouldn't insert it. If the exception occurred because the
+ // XXX this is arguable, if the exception occured because pNewEntry is
+ // garbage you wouldn't insert it. If the exception occured because the
// Collator implementation is garbage then give the user a chance to see
// his stuff
- Insert( pNewEntry, (sal_uLong)0 );
+ Insert( pNewEntry, (ULONG)0 );
}
}
- return (sal_uInt16)GetPos( pNewEntry );
+ return (USHORT)GetPos( pNewEntry );
}
// -----------------------------------------------------------------------
-void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
+void ImplEntryList::RemoveEntry( USHORT nPos )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::Remove( nPos );
if ( pImplEntry )
@@ -273,10 +261,10 @@ void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchMRUArea ) const
+USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea ) const
{
- sal_uInt16 nEntries = GetEntryCount();
- for ( sal_uInt16 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
+ USHORT nEntries = GetEntryCount();
+ for ( USHORT n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) );
@@ -288,21 +276,21 @@ sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchM
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart, sal_Bool bForward, sal_Bool bLazy ) const
+USHORT ImplEntryList::FindMatchingEntry( const XubString& rStr, USHORT nStart, BOOL bForward, BOOL bLazy ) const
{
- sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
- sal_uInt16 nEntryCount = GetEntryCount();
+ USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
+ USHORT nEntryCount = GetEntryCount();
if ( !bForward )
- nStart++; // wird sofort dekrementiert
+ nStart++; // wird sofort dekrementiert
const vcl::I18nHelper& rI18nHelper = mpWindow->GetSettings().GetLocaleI18nHelper();
- for ( sal_uInt16 n = nStart; bForward ? ( n < nEntryCount ) : n; )
+ for ( USHORT n = nStart; bForward ? ( n < nEntryCount ) : n; )
{
if ( !bForward )
n--;
ImplEntryType* pImplEntry = GetEntry( n );
- sal_Bool bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
+ BOOL bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
if ( bMatch )
{
nPos = n;
@@ -318,10 +306,10 @@ sal_uInt16 ImplEntryList::FindMatchingEntry( const XubString& rStr, sal_uInt16 n
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::FindEntry( const void* pData ) const
+USHORT ImplEntryList::FindEntry( const void* pData ) const
{
- sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
- for ( sal_uInt16 n = GetEntryCount(); n; )
+ USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
+ for ( USHORT n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mpUserData == pData )
@@ -335,12 +323,12 @@ sal_uInt16 ImplEntryList::FindEntry( const void* pData ) const
// -----------------------------------------------------------------------
-long ImplEntryList::GetAddedHeight( sal_uInt16 i_nEndIndex, sal_uInt16 i_nBeginIndex, long i_nBeginHeight ) const
+long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, long i_nBeginHeight ) const
{
long nHeight = i_nBeginHeight;
- 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();
+ USHORT nStart = i_nEndIndex > i_nBeginIndex ? i_nBeginIndex : i_nEndIndex;
+ USHORT nStop = i_nEndIndex > i_nBeginIndex ? i_nEndIndex : i_nBeginIndex;
+ USHORT nEntryCount = GetEntryCount();
if( nStop != LISTBOX_ENTRY_NOTFOUND && nEntryCount != 0 )
{
// sanity check
@@ -348,8 +336,8 @@ long ImplEntryList::GetAddedHeight( sal_uInt16 i_nEndIndex, sal_uInt16 i_nBeginI
nStop = nEntryCount-1;
if( nStart > nEntryCount-1 )
nStart = nEntryCount-1;
-
- sal_uInt16 nIndex = nStart;
+
+ USHORT nIndex = nStart;
while( nIndex != LISTBOX_ENTRY_NOTFOUND && nIndex < nStop )
{
nHeight += GetEntryPtr( nIndex )-> mnHeight;
@@ -363,7 +351,7 @@ long ImplEntryList::GetAddedHeight( sal_uInt16 i_nEndIndex, sal_uInt16 i_nBeginI
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryHeight( sal_uInt16 nPos ) const
+long ImplEntryList::GetEntryHeight( USHORT nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? pImplEntry->mnHeight : 0;
@@ -371,7 +359,7 @@ long ImplEntryList::GetEntryHeight( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
+XubString ImplEntryList::GetEntryText( USHORT nPos ) const
{
XubString aEntryText;
ImplEntryType* pImplEntry = GetEntry( nPos );
@@ -382,9 +370,9 @@ XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
+BOOL ImplEntryList::HasEntryImage( USHORT nPos ) const
{
- sal_Bool bImage = sal_False;
+ BOOL bImage = FALSE;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
bImage = !!pImplEntry->maImage;
@@ -393,7 +381,7 @@ sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
+Image ImplEntryList::GetEntryImage( USHORT nPos ) const
{
Image aImage;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
@@ -404,7 +392,7 @@ Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
+void ImplEntryList::SetEntryData( USHORT nPos, void* pNewData )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -413,7 +401,7 @@ void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
// -----------------------------------------------------------------------
-void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
+void* ImplEntryList::GetEntryData( USHORT nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mpUserData : NULL;
@@ -421,7 +409,7 @@ void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
+void ImplEntryList::SetEntryFlags( USHORT nPos, long nFlags )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -430,7 +418,7 @@ void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const
+long ImplEntryList::GetEntryFlags( USHORT nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mnFlags : 0;
@@ -438,10 +426,10 @@ long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::GetSelectEntryCount() const
+USHORT ImplEntryList::GetSelectEntryCount() const
{
- sal_uInt16 nSelCount = 0;
- for ( sal_uInt16 n = GetEntryCount(); n; )
+ USHORT nSelCount = 0;
+ for ( USHORT n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mbIsSelected )
@@ -452,20 +440,20 @@ sal_uInt16 ImplEntryList::GetSelectEntryCount() const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetSelectEntry( sal_uInt16 nIndex ) const
+XubString ImplEntryList::GetSelectEntry( USHORT nIndex ) const
{
return GetEntryText( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::GetSelectEntryPos( sal_uInt16 nIndex ) const
+USHORT ImplEntryList::GetSelectEntryPos( USHORT nIndex ) const
{
- sal_uInt16 nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
- sal_uInt16 nSel = 0;
- sal_uInt16 nEntryCount = GetEntryCount();
+ USHORT nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
+ USHORT nSel = 0;
+ USHORT nEntryCount = GetEntryCount();
- for ( sal_uInt16 n = 0; n < nEntryCount; n++ )
+ for ( USHORT n = 0; n < nEntryCount; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
if ( pImplEntry->mbIsSelected )
@@ -484,22 +472,22 @@ sal_uInt16 ImplEntryList::GetSelectEntryPos( sal_uInt16 nIndex ) const
// -----------------------------------------------------------------------
-sal_Bool ImplEntryList::IsEntrySelected( const XubString& rStr ) const
+BOOL ImplEntryList::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( FindEntry( rStr ) );
}
// -----------------------------------------------------------------------
-sal_Bool ImplEntryList::IsEntryPosSelected( sal_uInt16 nIndex ) const
+BOOL ImplEntryList::IsEntryPosSelected( USHORT nIndex ) const
{
ImplEntryType* pImplEntry = GetEntry( nIndex );
- return pImplEntry ? pImplEntry->mbIsSelected : sal_False;
+ return pImplEntry ? pImplEntry->mbIsSelected : FALSE;
}
// -----------------------------------------------------------------------
-bool ImplEntryList::IsEntrySelectable( sal_uInt16 nPos ) const
+bool ImplEntryList::IsEntrySelectable( USHORT nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0) : true;
@@ -507,7 +495,7 @@ bool ImplEntryList::IsEntrySelectable( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 ImplEntryList::FindFirstSelectable( sal_uInt16 nPos, bool bForward /* = true */ )
+USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true */ )
{
if( IsEntrySelectable( nPos ) )
return nPos;
@@ -536,47 +524,49 @@ sal_uInt16 ImplEntryList::FindFirstSelectable( sal_uInt16 nPos, bool bForward /*
// =======================================================================
ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, 0 ),
- maQuickSelectionEngine( *this )
-{
- mpEntryList = new ImplEntryList( this );
-
- mnTop = 0;
- mnLeft = 0;
- mnBorder = 1;
- mnSelectModifier = 0;
- mnUserDrawEntry = LISTBOX_ENTRY_NOTFOUND;
- 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;
+ Control( pParent, 0 )
+{
+ mpEntryList = new ImplEntryList( this );
+
+ mnTop = 0;
+ mnLeft = 0;
+ 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;
// pb: #106948# explicit mirroring for calc
- mbMirroring = sal_False;
+ mbMirroring = FALSE;
- mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
+ mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
- mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND;
+ mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND;
meProminentType = PROMINENT_TOP;
SetLineColor();
SetTextFillColor();
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ maSearchTimeout.SetTimeout( 2500 );
+ maSearchTimeout.SetTimeoutHdl( LINK( this, ImplListBoxWindow, SearchStringTimeout ) );
+
+ ImplInitSettings( TRUE, TRUE, TRUE );
ImplCalcMetrics();
}
@@ -584,12 +574,13 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
ImplListBoxWindow::~ImplListBoxWindow()
{
+ maSearchTimeout.Stop();
delete mpEntryList;
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
+void ImplListBoxWindow::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
{
ImplInitFieldSettings( this, bFont, bForeground, bBackground );
}
@@ -598,22 +589,22 @@ void ImplListBoxWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground,
void ImplListBoxWindow::ImplCalcMetrics()
{
- mnMaxWidth = 0;
- mnMaxTxtWidth = 0;
- mnMaxImgWidth = 0;
+ mnMaxWidth = 0;
+ mnMaxTxtWidth = 0;
+ mnMaxImgWidth = 0;
mnMaxImgTxtWidth= 0;
- mnMaxImgHeight = 0;
+ mnMaxImgHeight = 0;
- mnTextHeight = (sal_uInt16)GetTextHeight();
+ mnTextHeight = (USHORT)GetTextHeight();
mnMaxTxtHeight = mnTextHeight + mnBorder;
mnMaxHeight = mnMaxTxtHeight;
if ( maUserItemSize.Height() > mnMaxHeight )
- mnMaxHeight = (sal_uInt16) maUserItemSize.Height();
+ mnMaxHeight = (USHORT) maUserItemSize.Height();
if ( maUserItemSize.Width() > mnMaxWidth )
- mnMaxWidth= (sal_uInt16) maUserItemSize.Width();
+ mnMaxWidth= (USHORT) maUserItemSize.Width();
- for ( sal_uInt16 n = mpEntryList->GetEntryCount(); n; )
+ for ( USHORT n = mpEntryList->GetEntryCount(); n; )
{
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( --n );
ImplUpdateEntryMetrics( *pEntry );
@@ -628,23 +619,30 @@ void ImplListBoxWindow::ImplCalcMetrics()
// -----------------------------------------------------------------------
+IMPL_LINK( ImplListBoxWindow, SearchStringTimeout, Timer*, EMPTYARG )
+{
+ maSearchStr.Erase();
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+
void ImplListBoxWindow::Clear()
{
mpEntryList->Clear();
- mnMaxHeight = mnMaxTxtHeight;
- mnMaxWidth = 0;
- mnMaxTxtWidth = 0;
+ mnMaxHeight = mnMaxTxtHeight;
+ mnMaxWidth = 0;
+ mnMaxTxtWidth = 0;
mnMaxImgTxtWidth= 0;
- mnMaxImgWidth = 0;
- mnMaxImgHeight = 0;
- mnTop = 0;
- mnLeft = 0;
- mbImgsDiffSz = sal_False;
+ mnMaxImgWidth = 0;
+ mnMaxImgHeight = 0;
+ mnTop = 0;
+ mnLeft = 0;
+ mbImgsDiffSz = FALSE;
ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
- maQuickSelectionEngine.Reset();
Invalidate();
}
@@ -660,13 +658,13 @@ void ImplListBoxWindow::SetUserItemSize( const Size& rSz )
struct ImplEntryMetrics
{
- sal_Bool bText;
- sal_Bool bImage;
- long nEntryWidth;
- long nEntryHeight;
- long nTextWidth;
- long nImgWidth;
- long nImgHeight;
+ BOOL bText;
+ BOOL bImage;
+ long nEntryWidth;
+ long nEntryHeight;
+ long nTextWidth;
+ long nImgWidth;
+ long nImgHeight;
};
// -----------------------------------------------------------------------
@@ -674,7 +672,7 @@ struct ImplEntryMetrics
void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
{
ImplEntryMetrics aMetrics;
- aMetrics.bText = rEntry.maStr.Len() ? sal_True : sal_False;
+ aMetrics.bText = rEntry.maStr.Len() ? TRUE : FALSE;
aMetrics.bImage = !!rEntry.maImage;
aMetrics.nEntryWidth = 0;
aMetrics.nEntryHeight = 0;
@@ -702,7 +700,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
else
{
// normal single line case
- aMetrics.nTextWidth = (sal_uInt16)GetTextWidth( rEntry.maStr );
+ aMetrics.nTextWidth = (USHORT)GetTextWidth( rEntry.maStr );
if( aMetrics.nTextWidth > mnMaxTxtWidth )
mnMaxTxtWidth = aMetrics.nTextWidth;
aMetrics.nEntryWidth = mnMaxTxtWidth;
@@ -712,13 +710,13 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
if ( aMetrics.bImage )
{
Size aImgSz = rEntry.maImage.GetSizePixel();
- aMetrics.nImgWidth = (sal_uInt16) CalcZoom( aImgSz.Width() );
- aMetrics.nImgHeight = (sal_uInt16) CalcZoom( aImgSz.Height() );
+ aMetrics.nImgWidth = (USHORT) CalcZoom( aImgSz.Width() );
+ aMetrics.nImgHeight = (USHORT) CalcZoom( aImgSz.Height() );
if( mnMaxImgWidth && ( aMetrics.nImgWidth != mnMaxImgWidth ) )
- mbImgsDiffSz = sal_True;
+ mbImgsDiffSz = TRUE;
else if ( mnMaxImgHeight && ( aMetrics.nImgHeight != mnMaxImgHeight ) )
- mbImgsDiffSz = sal_True;
+ mbImgsDiffSz = TRUE;
if( aMetrics.nImgWidth > mnMaxImgWidth )
mnMaxImgWidth = aMetrics.nImgWidth;
@@ -727,7 +725,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
mnMaxImgTxtWidth = Max( mnMaxImgTxtWidth, aMetrics.nTextWidth );
aMetrics.nEntryHeight = Max( aMetrics.nImgHeight, aMetrics.nEntryHeight );
-
+
}
if ( IsUserDrawEnabled() || aMetrics.bImage )
{
@@ -749,7 +747,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
mnMaxWidth = aMetrics.nEntryWidth;
if ( aMetrics.nEntryHeight > mnMaxHeight )
mnMaxHeight = aMetrics.nEntryHeight;
-
+
rEntry.mnHeight = aMetrics.nEntryHeight;
}
@@ -760,19 +758,19 @@ void ImplListBoxWindow::ImplCallSelect()
if ( !IsTravelSelect() && GetEntryList()->GetMaxMRUCount() )
{
// Insert the selected entry as MRU, if not allready first MRU
- sal_uInt16 nSelected = GetEntryList()->GetSelectEntryPos( 0 );
- sal_uInt16 nMRUCount = GetEntryList()->GetMRUCount();
+ USHORT nSelected = GetEntryList()->GetSelectEntryPos( 0 );
+ USHORT nMRUCount = GetEntryList()->GetMRUCount();
String aSelected = GetEntryList()->GetEntryText( nSelected );
- sal_uInt16 nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, sal_True );
+ USHORT nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, TRUE );
if ( nFirstMatchingEntryPos || !nMRUCount )
{
- sal_Bool bSelectNewEntry = sal_False;
+ BOOL bSelectNewEntry = FALSE;
if ( nFirstMatchingEntryPos < nMRUCount )
{
RemoveEntry( nFirstMatchingEntryPos );
nMRUCount--;
if ( nFirstMatchingEntryPos == nSelected )
- bSelectNewEntry = sal_True;
+ bSelectNewEntry = TRUE;
}
else if ( nMRUCount == GetEntryList()->GetMaxMRUCount() )
{
@@ -784,7 +782,7 @@ void ImplListBoxWindow::ImplCallSelect()
ImplEntryType* pNewEntry = new ImplEntryType( aSelected );
pNewEntry->mbIsSelected = bSelectNewEntry;
- GetEntryList()->InsertEntry( 0, pNewEntry, sal_False );
+ GetEntryList()->InsertEntry( 0, pNewEntry, FALSE );
ImplUpdateEntryMetrics( *pNewEntry );
GetEntryList()->SetMRUCount( ++nMRUCount );
SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 );
@@ -793,26 +791,26 @@ void ImplListBoxWindow::ImplCallSelect()
}
maSelectHdl.Call( NULL );
- mbSelectionChanged = sal_False;
+ mbSelectionChanged = FALSE;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBoxWindow::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry )
+USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
{
ImplClearLayoutData();
- sal_uInt16 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
+ USHORT nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
if( (GetStyle() & WB_WORDBREAK) )
pNewEntry->mnFlags |= LISTBOX_ENTRY_FLAG_MULTILINE;
-
+
ImplUpdateEntryMetrics( *pNewEntry );
return nNewPos;
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::RemoveEntry( sal_uInt16 nPos )
+void ImplListBoxWindow::RemoveEntry( USHORT nPos )
{
ImplClearLayoutData();
mpEntryList->RemoveEntry( nPos );
@@ -823,7 +821,7 @@ void ImplListBoxWindow::RemoveEntry( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetEntryFlags( sal_uInt16 nPos, long nFlags )
+void ImplListBoxWindow::SetEntryFlags( USHORT nPos, long nFlags )
{
mpEntryList->SetEntryFlags( nPos, nFlags );
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( nPos );
@@ -838,7 +836,7 @@ void ImplListBoxWindow::ImplShowFocusRect()
if ( mbHasFocusRect )
HideFocus();
ShowFocus( maFocusRect );
- mbHasFocusRect = sal_True;
+ mbHasFocusRect = TRUE;
}
// -----------------------------------------------------------------------
@@ -848,18 +846,18 @@ void ImplListBoxWindow::ImplHideFocusRect()
if ( mbHasFocusRect )
{
HideFocus();
- mbHasFocusRect = sal_False;
+ mbHasFocusRect = FALSE;
}
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
+USHORT ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
{
long nY = mnBorder;
-
- sal_uInt16 nSelect = mnTop;
+
+ USHORT nSelect = mnTop;
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nSelect );
while( pEntry && rPoint.Y() > pEntry->mnHeight + nY )
{
@@ -874,39 +872,39 @@ sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
// -----------------------------------------------------------------------
-sal_Bool ImplListBoxWindow::IsVisible( sal_uInt16 i_nEntry ) const
+BOOL ImplListBoxWindow::IsVisible( USHORT i_nEntry ) const
{
- sal_Bool bRet = sal_False;
-
+ BOOL bRet = FALSE;
+
if( i_nEntry >= mnTop )
{
if( mpEntryList->GetAddedHeight( i_nEntry, mnTop ) <
PixelToLogic( GetSizePixel() ).Height() )
{
- bRet = sal_True;
+ bRet = TRUE;
}
}
-
+
return bRet;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBoxWindow::GetLastVisibleEntry() const
+USHORT ImplListBoxWindow::GetLastVisibleEntry() const
{
- sal_uInt16 nPos = mnTop;
+ USHORT nPos = mnTop;
long nWindowHeight = GetSizePixel().Height();
- sal_uInt16 nCount = mpEntryList->GetEntryCount();
+ USHORT nCount = mpEntryList->GetEntryCount();
long nDiff;
for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) )
nPos++;
-
+
if( nDiff > nWindowHeight && nPos > mnTop )
nPos--;
-
+
if( nPos >= nCount )
nPos = nCount-1;
-
+
return nPos;
}
@@ -914,14 +912,14 @@ sal_uInt16 ImplListBoxWindow::GetLastVisibleEntry() const
void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbMouseMoveSelect = sal_False; // Nur bis zum ersten MouseButtonDown
- maQuickSelectionEngine.Reset();
+ mbMouseMoveSelect = FALSE; // Nur bis zum ersten MouseButtonDown
+ maSearchStr.Erase();
if ( !IsReadOnly() )
{
if( rMEvt.GetClicks() == 1 )
{
- sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
@@ -930,9 +928,9 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
mnCurrentPos = nSelect;
- mbTrackingSelect = sal_True;
+ mbTrackingSelect = TRUE;
SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() );
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = FALSE;
if ( mbGrabFocus )
GrabFocus();
@@ -965,10 +963,10 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
SetTopEntry( 0 );
if ( mbStackMode ) // #87072#, #92323#
{
- mbTravelSelect = sal_True;
+ mbTravelSelect = TRUE;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = sal_False;
+ mbTravelSelect = FALSE;
}
}
@@ -982,28 +980,28 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
{
if ( IsMouseMoveSelect() )
{
- sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect == LISTBOX_ENTRY_NOTFOUND )
nSelect = mpEntryList->GetEntryCount() - 1;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
// Select only visible Entries with MouseMove, otherwise Tracking...
- if ( IsVisible( nSelect ) &&
+ if ( IsVisible( nSelect ) &&
mpEntryList->IsEntrySelectable( nSelect ) &&
( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() || ( nSelect != GetEntryList()->GetSelectEntryPos( 0 ) ) ) )
{
- mbTrackingSelect = sal_True;
- if ( SelectEntries( nSelect, LET_TRACKING, sal_False, sal_False ) )
+ mbTrackingSelect = TRUE;
+ if ( SelectEntries( nSelect, LET_TRACKING, FALSE, FALSE ) )
{
if ( mbStackMode ) // #87072#
{
- mbTravelSelect = sal_True;
+ mbTravelSelect = TRUE;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = sal_False;
+ mbTravelSelect = FALSE;
}
}
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = FALSE;
}
}
@@ -1031,14 +1029,14 @@ void ImplListBoxWindow::DeselectAll()
{
while ( GetEntryList()->GetSelectEntryCount() )
{
- sal_uInt16 nS = GetEntryList()->GetSelectEntryPos( 0 );
- SelectEntry( nS, sal_False );
+ USHORT nS = GetEntryList()->GetSelectEntryPos( 0 );
+ SelectEntry( nS, FALSE );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
+void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
{
if( (mpEntryList->IsEntryPosSelected( nPos ) != bSelect) && mpEntryList->IsEntrySelectable( nPos ) )
{
@@ -1048,16 +1046,16 @@ void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
if( !mbMulti )
{
// Selektierten Eintrag deselektieren
- sal_uInt16 nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
+ USHORT nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
if( nDeselect != LISTBOX_ENTRY_NOTFOUND )
{
- //SelectEntryPos( nDeselect, sal_False );
- GetEntryList()->SelectEntry( nDeselect, sal_False );
+ //SelectEntryPos( nDeselect, FALSE );
+ GetEntryList()->SelectEntry( nDeselect, FALSE );
if ( IsUpdateMode() && IsReallyVisible() )
- ImplPaint( nDeselect, sal_True );
+ ImplPaint( nDeselect, TRUE );
}
}
- mpEntryList->SelectEntry( nPos, sal_True );
+ mpEntryList->SelectEntry( nPos, TRUE );
mnCurrentPos = nPos;
if ( ( nPos != LISTBOX_ENTRY_NOTFOUND ) && IsUpdateMode() )
{
@@ -1065,7 +1063,7 @@ void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
if ( !IsVisible( nPos ) )
{
ImplClearLayoutData();
- sal_uInt16 nVisibleEntries = GetLastVisibleEntry()-mnTop;
+ USHORT nVisibleEntries = GetLastVisibleEntry()-mnTop;
if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
Resize();
@@ -1080,46 +1078,46 @@ void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
}
else
{
- mpEntryList->SelectEntry( nPos, sal_False );
- ImplPaint( nPos, sal_True );
+ mpEntryList->SelectEntry( nPos, FALSE );
+ ImplPaint( nPos, TRUE );
}
- mbSelectionChanged = sal_True;
+ mbSelectionChanged = TRUE;
}
}
// -----------------------------------------------------------------------
-sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl )
+BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL bShift, BOOL bCtrl )
{
- sal_Bool bFocusChanged = sal_False;
- sal_Bool bSelectionChanged = sal_False;
+ BOOL bFocusChanged = FALSE;
+ BOOL bSelectionChanged = FALSE;
if( IsEnabled() && mpEntryList->IsEntrySelectable( nSelect ) )
{
// Hier (Single-ListBox) kann nur ein Eintrag deselektiert werden
if( !mbMulti )
{
- sal_uInt16 nDeselect = mpEntryList->GetSelectEntryPos( 0 );
+ USHORT nDeselect = mpEntryList->GetSelectEntryPos( 0 );
if( nSelect != nDeselect )
{
- SelectEntry( nSelect, sal_True );
+ SelectEntry( nSelect, TRUE );
mpEntryList->SetLastSelected( nSelect );
- bFocusChanged = sal_True;
- bSelectionChanged = sal_True;
+ bFocusChanged = TRUE;
+ bSelectionChanged = TRUE;
}
}
// MultiListBox ohne Modifier
else if( mbSimpleMode && !bCtrl && !bShift )
{
- sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
- for ( sal_uInt16 nPos = 0; nPos < nEntryCount; nPos++ )
+ USHORT nEntryCount = mpEntryList->GetEntryCount();
+ for ( USHORT nPos = 0; nPos < nEntryCount; nPos++ )
{
- sal_Bool bSelect = nPos == nSelect;
+ BOOL bSelect = nPos == nSelect;
if ( mpEntryList->IsEntryPosSelected( nPos ) != bSelect )
{
SelectEntry( nPos, bSelect );
- bFocusChanged = sal_True;
- bSelectionChanged = sal_True;
+ bFocusChanged = TRUE;
+ bSelectionChanged = TRUE;
}
}
mpEntryList->SetLastSelected( nSelect );
@@ -1131,20 +1129,20 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE
// Space fuer Selektionswechsel
if( !bShift && ( ( eLET == LET_KEYSPACE ) || ( eLET == LET_MBDOWN ) ) )
{
- sal_Bool bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? sal_True : !mpEntryList->IsEntryPosSelected( nSelect );
+ BOOL bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? TRUE : !mpEntryList->IsEntryPosSelected( nSelect );
if ( mbStackMode )
{
- sal_uInt16 n;
+ USHORT n;
if ( bSelect )
{
// All entries before nSelect must be selected...
for ( n = 0; n < nSelect; n++ )
- SelectEntry( n, sal_True );
+ SelectEntry( n, TRUE );
}
if ( !bSelect )
{
for ( n = nSelect+1; n < mpEntryList->GetEntryCount(); n++ )
- SelectEntry( n, sal_False );
+ SelectEntry( n, FALSE );
}
}
SelectEntry( nSelect, bSelect );
@@ -1152,16 +1150,16 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE
mpEntryList->SetSelectionAnchor( mbStackMode ? 0 : nSelect );
if ( !mpEntryList->IsEntryPosSelected( nSelect ) )
mpEntryList->SetSelectionAnchor( LISTBOX_ENTRY_NOTFOUND );
- bFocusChanged = sal_True;
- bSelectionChanged = sal_True;
+ bFocusChanged = TRUE;
+ bSelectionChanged = TRUE;
}
else if( ( ( eLET == LET_TRACKING ) && ( nSelect != mnCurrentPos ) ) ||
( (bShift||mbStackMode) && ( ( eLET == LET_KEYMOVE ) || ( eLET == LET_MBDOWN ) ) ) )
{
mnCurrentPos = nSelect;
- bFocusChanged = sal_True;
+ bFocusChanged = TRUE;
- sal_uInt16 nAnchor = mpEntryList->GetSelectionAnchor();
+ USHORT nAnchor = mpEntryList->GetSelectionAnchor();
if( ( nAnchor == LISTBOX_ENTRY_NOTFOUND ) && ( mpEntryList->GetSelectEntryCount() || mbStackMode ) )
{
nAnchor = mbStackMode ? 0 : mpEntryList->GetSelectEntryPos( mpEntryList->GetSelectEntryCount() - 1 );
@@ -1169,40 +1167,40 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE
if( nAnchor != LISTBOX_ENTRY_NOTFOUND )
{
// Alle Eintraege vom Anchor bis nSelect muessen selektiert sein
- sal_uInt16 nStart = Min( nSelect, nAnchor );
- sal_uInt16 nEnd = Max( nSelect, nAnchor );
- for ( sal_uInt16 n = nStart; n <= nEnd; n++ )
+ USHORT nStart = Min( nSelect, nAnchor );
+ USHORT nEnd = Max( nSelect, nAnchor );
+ for ( USHORT n = nStart; n <= nEnd; n++ )
{
if ( !mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, sal_True );
- bSelectionChanged = sal_True;
+ SelectEntry( n, TRUE );
+ bSelectionChanged = TRUE;
}
}
// Ggf. muss noch was deselektiert werden...
- sal_uInt16 nLast = mpEntryList->GetLastSelected();
+ USHORT nLast = mpEntryList->GetLastSelected();
if ( nLast != LISTBOX_ENTRY_NOTFOUND )
{
if ( ( nLast > nSelect ) && ( nLast > nAnchor ) )
{
- for ( sal_uInt16 n = nSelect+1; n <= nLast; n++ )
+ for ( USHORT n = nSelect+1; n <= nLast; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, sal_False );
- bSelectionChanged = sal_True;
+ SelectEntry( n, FALSE );
+ bSelectionChanged = TRUE;
}
}
}
else if ( ( nLast < nSelect ) && ( nLast < nAnchor ) )
{
- for ( sal_uInt16 n = nLast; n < nSelect; n++ )
+ for ( USHORT n = nLast; n < nSelect; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, sal_False );
- bSelectionChanged = sal_True;
+ SelectEntry( n, FALSE );
+ bSelectionChanged = TRUE;
}
}
}
@@ -1213,17 +1211,17 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE
else if( eLET != LET_TRACKING )
{
ImplHideFocusRect();
- ImplPaint( nSelect, sal_True );
- bFocusChanged = sal_True;
+ ImplPaint( nSelect, TRUE );
+ bFocusChanged = TRUE;
}
}
else if( bShift )
{
- bFocusChanged = sal_True;
+ bFocusChanged = TRUE;
}
if( bSelectionChanged )
- mbSelectionChanged = sal_True;
+ mbSelectionChanged = TRUE;
if( bFocusChanged )
{
@@ -1246,7 +1244,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
Point aPoint;
Rectangle aRect( aPoint, GetOutputSizePixel() );
- sal_Bool bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
+ BOOL bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
if( rTEvt.IsTrackingCanceled() || rTEvt.IsTrackingEnded() ) // MouseButtonUp
{
@@ -1260,9 +1258,9 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
maCancelHdl.Call( NULL );
if ( !mbMulti )
{
- mbTrackingSelect = sal_True;
- SelectEntry( mnTrackingSaveSelection, sal_True );
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = TRUE;
+ SelectEntry( mnTrackingSaveSelection, TRUE );
+ mbTrackingSelect = FALSE;
if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND )
{
long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop, 0 );
@@ -1275,23 +1273,23 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
}
}
- mbTrack = sal_False;
+ mbTrack = FALSE;
}
else
{
- sal_Bool bTrackOrQuickClick = mbTrack;
+ BOOL bTrackOrQuickClick = mbTrack;
if( !mbTrack )
{
if ( bInside )
{
- mbTrack = sal_True;
+ mbTrack = TRUE;
}
// Folgender Fall tritt nur auf, wenn man ganz kurz die Maustaste drueckt
if( rTEvt.IsTrackingEnded() && mbTrack )
{
- bTrackOrQuickClick = sal_True;
- mbTrack = sal_False;
+ bTrackOrQuickClick = TRUE;
+ mbTrack = FALSE;
}
}
@@ -1299,10 +1297,10 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
MouseEvent aMEvt = rTEvt.GetMouseEvent();
Point aPt( aMEvt.GetPosPixel() );
- sal_Bool bShift = aMEvt.IsShift();
- sal_Bool bCtrl = aMEvt.IsMod1();
+ BOOL bShift = aMEvt.IsShift();
+ BOOL bCtrl = aMEvt.IsMod1();
- sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
+ USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
if( aPt.Y() < 0 )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
@@ -1316,43 +1314,43 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
{
- nSelect = Min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) );
+ nSelect = Min( (USHORT)(mnCurrentPos+1), (USHORT)(mpEntryList->GetEntryCount()-1) );
if( nSelect >= GetLastVisibleEntry() )
SetTopEntry( mnTop+1 );
}
}
else
{
- nSelect = (sal_uInt16) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (sal_uInt16) mnTop;
+ nSelect = (USHORT) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (USHORT) mnTop;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
}
if ( bInside )
{
if ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = sal_True;
+ mbTrackingSelect = TRUE;
if ( SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ) )
{
if ( mbStackMode ) // #87734# (#87072#)
{
- mbTravelSelect = sal_True;
+ mbTravelSelect = TRUE;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = sal_False;
+ mbTravelSelect = FALSE;
}
}
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = FALSE;
}
}
else
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = sal_True;
- SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), sal_False );
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = TRUE;
+ SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), FALSE );
+ mbTrackingSelect = FALSE;
}
else if ( mbStackMode )
{
@@ -1360,32 +1358,32 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 ) || ( rTEvt.GetMouseEvent().GetPosPixel().Y() > GetOutputSizePixel().Height() ) )
{
- sal_Bool bSelectionChanged = sal_False;
+ BOOL bSelectionChanged = FALSE;
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 )
&& !mnCurrentPos )
{
if ( mpEntryList->IsEntryPosSelected( 0 ) )
{
- SelectEntry( 0, sal_False );
- bSelectionChanged = sal_True;
+ SelectEntry( 0, FALSE );
+ bSelectionChanged = TRUE;
nSelect = LISTBOX_ENTRY_NOTFOUND;
}
}
else
{
- mbTrackingSelect = sal_True;
+ mbTrackingSelect = TRUE;
bSelectionChanged = SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl );
- mbTrackingSelect = sal_False;
+ mbTrackingSelect = FALSE;
}
if ( bSelectionChanged )
{
- mbSelectionChanged = sal_True;
- mbTravelSelect = sal_True;
+ mbSelectionChanged = TRUE;
+ mbTravelSelect = TRUE;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = sal_False;
+ mbTravelSelect = FALSE;
}
}
}
@@ -1419,25 +1417,25 @@ void ImplListBoxWindow::KeyInput( const KeyEvent& rKEvt )
// -----------------------------------------------------------------------
-#define IMPL_SELECT_NODIRECTION 0
-#define IMPL_SELECT_UP 1
-#define IMPL_SELECT_DOWN 2
+#define IMPL_SELECT_NODIRECTION 0
+#define IMPL_SELECT_UP 1
+#define IMPL_SELECT_DOWN 2
-sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
+BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
// zu selektierender Eintrag
- sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
+ USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
LB_EVENT_TYPE eLET = LET_KEYMOVE;
KeyCode aKeyCode = rKEvt.GetKeyCode();
- sal_Bool bShift = aKeyCode.IsShift();
- sal_Bool bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
- sal_Bool bMod2 = aKeyCode.IsMod2();
- sal_Bool bDone = sal_False;
+ BOOL bShift = aKeyCode.IsShift();
+ BOOL bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
+ BOOL bMod2 = aKeyCode.IsMod2();
+ BOOL bDone = FALSE;
switch( aKeyCode.GetCode() )
- {
+ {
case KEY_UP:
{
if ( IsReadOnly() )
@@ -1460,9 +1458,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect < mnTop ) )
SetTopEntry( mnTop-1 );
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1487,9 +1485,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect >= GetLastVisibleEntry() ) )
SetTopEntry( mnTop+1 );
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1497,7 +1495,7 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if ( IsReadOnly() )
{
- sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
+ USHORT nCurVis = GetLastVisibleEntry() - mnTop +1;
SetTopEntry( ( mnTop > nCurVis ) ?
(mnTop-nCurVis) : 0 );
}
@@ -1511,16 +1509,16 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if( mnCurrentPos == mnTop )
{
- sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
+ USHORT 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 = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1538,23 +1536,23 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- sal_uInt16 nCount = mpEntryList->GetEntryCount();
- sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop;
- sal_uInt16 nTmp = Min( nCurVis, nCount );
+ USHORT nCount = mpEntryList->GetEntryCount();
+ USHORT nCurVis = GetLastVisibleEntry() - mnTop;
+ USHORT 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 = (sal_uInt16)(nTmp2+(nCurVis-1) );
- SetTopEntry( (sal_uInt16)nTmp2 );
+ nTmp = (USHORT)(nTmp2+(nCurVis-1) );
+ SetTopEntry( (USHORT)nTmp2 );
}
// find first selectable starting from nTmp looking backwards
nSelect = mpEntryList->FindFirstSelectable( nTmp, false );
}
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1572,10 +1570,10 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( mnTop != 0 )
SetTopEntry( 0 );
- bDone = sal_True;
+ bDone = TRUE;
}
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1593,15 +1591,15 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- sal_uInt16 nCount = mpEntryList->GetEntryCount();
+ USHORT nCount = mpEntryList->GetEntryCount();
nSelect = mpEntryList->FindFirstSelectable( nCount - 1, false );
- sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop + 1;
+ USHORT nCurVis = GetLastVisibleEntry() - mnTop + 1;
if( nCount > nCurVis )
SetTopEntry( nCount - nCurVis );
}
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1610,9 +1608,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( -HORZ_SCROLL );
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1621,9 +1619,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( HORZ_SCROLL );
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1633,9 +1631,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- bDone = sal_False; // RETURN nicht abfangen.
+ bDone = FALSE; // RETURN nicht abfangen.
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1648,9 +1646,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
nSelect = mnCurrentPos;
eLET = LET_KEYSPACE;
}
- bDone = sal_True;
+ bDone = TRUE;
}
- maQuickSelectionEngine.Reset();
+ maSearchStr.Erase();
}
break;
@@ -1659,32 +1657,63 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( bCtrl && mbMulti )
{
// paint only once
- sal_Bool bUpdates = IsUpdateMode();
- SetUpdateMode( sal_False );
-
- sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
- for( sal_uInt16 i = 0; i < nEntryCount; i++ )
- SelectEntry( i, sal_True );
+ BOOL bUpdates = IsUpdateMode();
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = mpEntryList->GetEntryCount();
+ for( USHORT i = 0; i < nEntryCount; i++ )
+ SelectEntry( i, TRUE );
+
// restore update mode
SetUpdateMode( bUpdates );
Invalidate();
-
- maQuickSelectionEngine.Reset();
-
- bDone = sal_True;
+
+ maSearchStr.Erase();
+
+ bDone = TRUE;
break;
}
}
// fall through intentional
default:
{
- if ( !IsReadOnly() )
+ xub_Unicode c = rKEvt.GetCharCode();
+
+ if ( !IsReadOnly() && (c >= 32) && (c != 127) && !rKEvt.GetKeyCode().IsMod2() )
{
- bDone = maQuickSelectionEngine.HandleKeyEvent( rKEvt );
+ 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;
}
- }
- break;
+ }
}
if ( ( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -1699,10 +1728,10 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
mnCurrentPos = nSelect;
if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) )
{
- mbTravelSelect = sal_True;
+ mbTravelSelect = TRUE;
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- mbTravelSelect = sal_False;
+ mbTravelSelect = FALSE;
}
}
@@ -1710,77 +1739,11 @@ sal_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 );
- // ::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 )
+void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
+
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nPos );
if( ! pEntry )
return;
@@ -1800,7 +1763,7 @@ void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayou
}
else
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
if( !IsEnabled() )
SetTextColor( rStyleSettings.GetDisableColor() );
SetTextFillColor();
@@ -1811,30 +1774,30 @@ void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayou
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = sal_True;
+ mbInUserDraw = TRUE;
mnUserDrawEntry = nPos;
aRect.Left() -= mnLeft;
if ( nPos < GetEntryList()->GetMRUCount() )
nPos = GetEntryList()->FindEntry( GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<sal_uInt16>(nPos - GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - GetEntryList()->GetMRUCount());
UserDrawEvent aUDEvt( this, aRect, nPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = sal_False;
+ mbInUserDraw = FALSE;
}
else
{
- DrawEntry( nPos, sal_True, sal_True, sal_False, bLayout );
+ DrawEntry( nPos, TRUE, TRUE, FALSE, bLayout );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
+void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nPos );
if( ! pEntry )
- return;
-
+ return;
+
// Bei Aenderungen in dieser Methode ggf. auch ImplWin::DrawEntry() anpassen.
if ( mbInUserDraw )
@@ -1903,12 +1866,12 @@ void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Boo
aTextRect.Left() -= ( aImgSz.Width() + IMG_TXT_DISTANCE );
}
- sal_uInt16 nDrawStyle = ImplGetTextStyle();
+ USHORT nDrawStyle = ImplGetTextStyle();
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) )
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_DRAW_DISABLED) )
nDrawStyle |= TEXT_DRAW_DISABLE;
-
+
DrawText( aTextRect, aStr, nDrawStyle, pVector, pDisplayText );
}
}
@@ -1944,22 +1907,22 @@ void ImplListBoxWindow::FillLayoutData() const
void ImplListBoxWindow::ImplDoPaint( const Rectangle& rRect, bool bLayout )
{
- sal_uInt16 nCount = mpEntryList->GetEntryCount();
+ USHORT nCount = mpEntryList->GetEntryCount();
- sal_Bool bShowFocusRect = mbHasFocusRect;
+ BOOL bShowFocusRect = mbHasFocusRect;
if ( mbHasFocusRect && ! bLayout )
ImplHideFocusRect();
long nY = 0; // + mnBorder;
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- for( sal_uInt16 i = (sal_uInt16)mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++ )
+ for( USHORT i = (USHORT)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, sal_False, bLayout );
+ ImplPaint( i, FALSE, bLayout );
}
nY += pEntry->mnHeight;
}
@@ -1981,13 +1944,13 @@ void ImplListBoxWindow::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBoxWindow::GetDisplayLineCount() const
+USHORT ImplListBoxWindow::GetDisplayLineCount() const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
-
- sal_uInt16 nCount = mpEntryList->GetEntryCount();
+
+ USHORT nCount = mpEntryList->GetEntryCount();
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- sal_uInt16 nEntries = static_cast< sal_uInt16 >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
+ USHORT nEntries = static_cast< USHORT >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
if( nEntries > nCount-mnTop )
nEntries = nCount-mnTop;
@@ -2000,7 +1963,7 @@ void ImplListBoxWindow::Resize()
{
Control::Resize();
- sal_Bool bShowFocusRect = mbHasFocusRect;
+ BOOL bShowFocusRect = mbHasFocusRect;
if ( bShowFocusRect )
ImplHideFocusRect();
@@ -2020,7 +1983,7 @@ void ImplListBoxWindow::Resize()
void ImplListBoxWindow::GetFocus()
{
- sal_uInt16 nPos = mnCurrentPos;
+ USHORT nPos = mnCurrentPos;
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
long nHeightDiff = mpEntryList->GetAddedHeight( nPos, mnTop, 0 );
@@ -2053,20 +2016,20 @@ void ImplListBoxWindow::RequestHelp( const HelpEvent& rHEvt )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
+void ImplListBoxWindow::SetTopEntry( USHORT nTop )
{
if( mpEntryList->GetEntryCount() == 0 )
return;
-
+
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
-
- sal_uInt16 nLastEntry = mpEntryList->GetEntryCount()-1;
+
+ USHORT nLastEntry = mpEntryList->GetEntryCount()-1;
if( nTop > nLastEntry )
nTop = nLastEntry;
const ImplEntryType* pLast = mpEntryList->GetEntryPtr( nLastEntry );
while( nTop > 0 && mpEntryList->GetAddedHeight( nLastEntry, nTop-1 ) + pLast->mnHeight <= nWHeight )
nTop--;
-
+
if ( nTop != mnTop )
{
ImplClearLayoutData();
@@ -2076,6 +2039,8 @@ void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
mnTop = nTop;
Scroll( 0, nDiff );
Update();
+ maFocusRect.Top() += nDiff;
+ maFocusRect.Bottom() += nDiff;
if( HasFocus() )
ImplShowFocusRect();
maScrollHdl.Call( this );
@@ -2084,11 +2049,11 @@ void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ShowProminentEntry( sal_uInt16 nEntryPos )
+void ImplListBoxWindow::ShowProminentEntry( USHORT nEntryPos )
{
if( meProminentType == PROMINENT_MIDDLE )
{
- sal_uInt16 nPos = nEntryPos;
+ USHORT nPos = nEntryPos;
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
while( nEntryPos > 0 && mpEntryList->GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 )
nEntryPos--;
@@ -2126,7 +2091,7 @@ void ImplListBoxWindow::ScrollHorz( long n )
if ( nDiff )
{
ImplClearLayoutData();
- mnLeft = sal::static_int_cast<sal_uInt16>(mnLeft + nDiff);
+ mnLeft = sal::static_int_cast<USHORT>(mnLeft + nDiff);
Update();
ImplHideFocusRect();
Scroll( -nDiff, 0 );
@@ -2139,20 +2104,20 @@ void ImplListBoxWindow::ScrollHorz( long n )
// -----------------------------------------------------------------------
-Size ImplListBoxWindow::CalcSize( sal_uInt16 nMaxLines ) const
+Size ImplListBoxWindow::CalcSize( USHORT nMaxLines ) const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
-
+
Size aSz;
-// sal_uInt16 nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
- aSz.Height() = nMaxLines * mnMaxHeight;
+// USHORT nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
+ aSz.Height() = nMaxLines * mnMaxHeight;
aSz.Width() = mnMaxWidth + 2*mnBorder;
return aSz;
}
// -----------------------------------------------------------------------
-Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const
+Rectangle ImplListBoxWindow::GetBoundingRectangle( USHORT nItem ) const
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem );
Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() );
@@ -2170,7 +2135,7 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
if ( nType == STATE_CHANGE_ZOOM )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
ImplCalcMetrics();
Invalidate();
}
@@ -2181,18 +2146,18 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
ImplCalcMetrics();
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
ImplClearLayoutData();
@@ -2210,7 +2175,7 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
ImplClearLayoutData();
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
ImplCalcMetrics();
Invalidate();
}
@@ -2218,9 +2183,9 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBoxWindow::ImplGetTextStyle() const
+USHORT ImplListBoxWindow::ImplGetTextStyle() const
{
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ USHORT nTextStyle = TEXT_DRAW_VCENTER;
if ( mpEntryList->HasImages() )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -2243,17 +2208,17 @@ ImplListBox::ImplListBox( Window* pParent, WinBits nWinStyle ) :
// for native widget rendering we must be able to detect this window type
SetType( WINDOW_LISTBOXWINDOW );
- mpVScrollBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG );
- mpHScrollBar = new ScrollBar( this, WB_HSCROLL | WB_DRAG );
- mpScrollBarBox = new ScrollBarBox( this );
+ mpVScrollBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG );
+ mpHScrollBar = new ScrollBar( this, WB_HSCROLL | WB_DRAG );
+ mpScrollBarBox = new ScrollBarBox( this );
Link aLink( LINK( this, ImplListBox, ScrollBarHdl ) );
mpVScrollBar->SetScrollHdl( aLink );
mpHScrollBar->SetScrollHdl( aLink );
- mbVScroll = sal_False;
- mbHScroll = sal_False;
- mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? sal_True : sal_False;
+ mbVScroll = FALSE;
+ mbHScroll = FALSE;
+ mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? TRUE : FALSE;
maLBWindow.SetScrollHdl( LINK( this, ImplListBox, LBWindowScrolled ) );
maLBWindow.SetMRUChangedHdl( LINK( this, ImplListBox, MRUChanged ) );
@@ -2286,37 +2251,37 @@ void ImplListBox::Clear()
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr )
+USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr );
- sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const Image& rImage )
+USHORT ImplListBox::InsertEntry( USHORT nPos, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rImage );
- sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage )
+USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr, rImage );
- sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-void ImplListBox::RemoveEntry( sal_uInt16 nPos )
+void ImplListBox::RemoveEntry( USHORT nPos )
{
maLBWindow.RemoveEntry( nPos );
StateChanged( STATE_CHANGE_DATA );
@@ -2324,21 +2289,21 @@ void ImplListBox::RemoveEntry( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-void ImplListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
+void ImplListBox::SetEntryFlags( USHORT nPos, long nFlags )
{
maLBWindow.SetEntryFlags( nPos, nFlags );
}
// -----------------------------------------------------------------------
-long ImplListBox::GetEntryFlags( sal_uInt16 nPos ) const
+long ImplListBox::GetEntryFlags( USHORT nPos ) const
{
return maLBWindow.GetEntryList()->GetEntryFlags( nPos );
}
// -----------------------------------------------------------------------
-void ImplListBox::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
+void ImplListBox::SelectEntry( USHORT nPos, BOOL bSelect )
{
maLBWindow.SelectEntry( nPos, bSelect );
}
@@ -2386,11 +2351,7 @@ 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 );
@@ -2402,7 +2363,7 @@ IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
{
- sal_uInt16 nPos = (sal_uInt16) pSB->GetThumbPos();
+ USHORT nPos = (USHORT) pSB->GetThumbPos();
if( pSB == mpVScrollBar )
SetTopEntry( nPos );
else if( pSB == mpHScrollBar )
@@ -2415,38 +2376,34 @@ IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
void ImplListBox::ImplCheckScrollBars()
{
- sal_Bool bArrange = sal_False;
+ BOOL bArrange = FALSE;
Size aOutSz = GetOutputSizePixel();
- sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
- sal_uInt16 nMaxVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
+ USHORT nEntries = GetEntryList()->GetEntryCount();
+ USHORT nMaxVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
// vert. ScrollBar
if( nEntries > nMaxVisEntries )
{
if( !mbVScroll )
- bArrange = sal_True;
- mbVScroll = sal_True;
+ bArrange = TRUE;
+ mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- if( GetEntryList()->GetSelectEntryCount() == 1 &&
- GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
- ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
- else
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
else
{
if( mbVScroll )
- bArrange = sal_True;
- mbVScroll = sal_False;
+ bArrange = TRUE;
+ mbVScroll = FALSE;
SetTopEntry( 0 );
}
// horz. ScrollBar
if( mbAutoHScroll )
{
- long nWidth = (sal_uInt16) aOutSz.Width();
+ long nWidth = (USHORT) aOutSz.Width();
if ( mbVScroll )
nWidth -= mpVScrollBar->GetSizePixel().Width();
@@ -2454,36 +2411,32 @@ void ImplListBox::ImplCheckScrollBars()
if( nWidth < nMaxWidth )
{
if( !mbHScroll )
- bArrange = sal_True;
- mbHScroll = sal_True;
+ bArrange = TRUE;
+ mbHScroll = TRUE;
- if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen
+ if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen
{
- nMaxVisEntries = (sal_uInt16) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
+ nMaxVisEntries = (USHORT) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
if( nEntries > nMaxVisEntries )
{
- bArrange = sal_True;
- mbVScroll = sal_True;
+ bArrange = TRUE;
+ mbVScroll = TRUE;
// Ueberpruefung des rausgescrollten Bereichs
- if( GetEntryList()->GetSelectEntryCount() == 1 &&
- GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
- ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
- else
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
}
// Ueberpruefung des rausgescrollten Bereichs
- sal_uInt16 nMaxLI = (sal_uInt16) (nMaxWidth - nWidth);
+ USHORT nMaxLI = (USHORT) (nMaxWidth - nWidth);
if ( nMaxLI < GetLeftIndent() )
SetLeftIndent( nMaxLI );
}
else
{
if( mbHScroll )
- bArrange = sal_True;
- mbHScroll = sal_False;
+ bArrange = TRUE;
+ mbHScroll = FALSE;
SetLeftIndent( 0 );
}
}
@@ -2502,8 +2455,8 @@ void ImplListBox::ImplInitScrollBars()
if ( mbVScroll )
{
- sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
- sal_uInt16 nVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
+ USHORT nEntries = GetEntryList()->GetEntryCount();
+ USHORT nVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
mpVScrollBar->SetRangeMax( nEntries );
mpVScrollBar->SetVisibleSize( nVisEntries );
mpVScrollBar->SetPageSize( nVisEntries - 1 );
@@ -2512,7 +2465,7 @@ void ImplListBox::ImplInitScrollBars()
if ( mbHScroll )
{
mpHScrollBar->SetRangeMax( GetMaxEntryWidth() + HORZ_SCROLL );
- mpHScrollBar->SetVisibleSize( (sal_uInt16)aOutSz.Width() );
+ mpHScrollBar->SetVisibleSize( (USHORT)aOutSz.Width() );
mpHScrollBar->SetLineSize( HORZ_SCROLL );
mpHScrollBar->SetPageSize( aOutSz.Width() - HORZ_SCROLL );
}
@@ -2537,7 +2490,7 @@ void ImplListBox::ImplResizeControls()
// pb: #106948# explicit mirroring for calc
// Scrollbar on left or right side?
- sal_Bool bMirroring = maLBWindow.IsMirroring();
+ BOOL bMirroring = maLBWindow.IsMirroring();
Point aWinPos( bMirroring && mbVScroll ? nSBWidth : 0, 0 );
maLBWindow.SetPosSizePixel( aWinPos, aInnerSz );
@@ -2592,10 +2545,10 @@ void ImplListBox::StateChanged( StateChangedType nType )
}
else if ( ( nType == STATE_CHANGE_UPDATEMODE ) || ( nType == STATE_CHANGE_DATA ) )
{
- sal_Bool bUpdate = IsUpdateMode();
+ BOOL bUpdate = IsUpdateMode();
maLBWindow.SetUpdateMode( bUpdate );
-// mpHScrollBar->SetUpdateMode( bUpdate );
-// mpVScrollBar->SetUpdateMode( bUpdate );
+// mpHScrollBar->SetUpdateMode( bUpdate );
+// mpVScrollBar->SetUpdateMode( bUpdate );
if ( bUpdate && IsReallyVisible() )
ImplCheckScrollBars();
}
@@ -2638,13 +2591,13 @@ void ImplListBox::StateChanged( StateChangedType nType )
void ImplListBox::DataChanged( const DataChangedEvent& rDCEvt )
{
-// if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
-// (rDCEvt.GetFlags() & SETTINGS_STYLE) )
-// {
-// maLBWindow.SetSettings( GetSettings() );
-// Resize();
-// }
-// else
+// if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+// (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+// {
+// maLBWindow.SetSettings( GetSettings() );
+// Resize();
+// }
+// else
Control::DataChanged( rDCEvt );
}
@@ -2678,15 +2631,15 @@ const Wallpaper& ImplListBox::GetDisplayBackground() const
// -----------------------------------------------------------------------
-sal_Bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
+BOOL ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
{
- sal_Bool bDone = sal_False;
+ BOOL bDone = FALSE;
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
{
- sal_uInt16 nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
+ USHORT nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
KeyEvent aKeyEvent( 0, KeyCode( nKey ) );
bDone = ProcessKeyInput( aKeyEvent );
}
@@ -2698,23 +2651,23 @@ sal_Bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
{
- sal_Bool bChanges = GetEntryList()->GetMRUCount() ? sal_True : sal_False;
+ BOOL bChanges = GetEntryList()->GetMRUCount() ? TRUE : FALSE;
// Remove old MRU entries
- for ( sal_uInt16 n = GetEntryList()->GetMRUCount();n; )
+ for ( USHORT n = GetEntryList()->GetMRUCount();n; )
maLBWindow.RemoveEntry( --n );
- sal_uInt16 nMRUCount = 0;
- sal_uInt16 nEntries = rEntries.GetTokenCount( cSep );
- for ( sal_uInt16 nEntry = 0; nEntry < nEntries; nEntry++ )
+ USHORT nMRUCount = 0;
+ USHORT nEntries = rEntries.GetTokenCount( cSep );
+ for ( USHORT 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, sal_False );
- bChanges = sal_True;
+ maLBWindow.GetEntryList()->InsertEntry( nMRUCount++, pNewEntry, FALSE );
+ bChanges = TRUE;
}
}
@@ -2731,7 +2684,7 @@ void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
XubString ImplListBox::GetMRUEntries( xub_Unicode cSep ) const
{
String aEntries;
- for ( sal_uInt16 n = 0; n < GetEntryList()->GetMRUCount(); n++ )
+ for ( USHORT n = 0; n < GetEntryList()->GetMRUCount(); n++ )
{
aEntries += GetEntryList()->GetEntryText( n );
if( n < ( GetEntryList()->GetMRUCount() - 1 ) )
@@ -2751,24 +2704,32 @@ ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) :
else
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- mbInUserDraw = sal_False;
- mbUserDrawEnabled = sal_False;
+ mbInUserDraw = FALSE;
+ mbUserDrawEnabled = FALSE;
mnItemPos = LISTBOX_ENTRY_NOTFOUND;
}
// -----------------------------------------------------------------------
-sal_Bool ImplWin::SetModeImage( const Image& rImage )
+BOOL ImplWin::SetModeImage( const Image& rImage, BmpColorMode eMode )
{
- SetImage( rImage );
- return sal_True;
+ if( eMode == BMP_COLOR_NORMAL )
+ SetImage( rImage );
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ maImageHC = rImage;
+ else
+ return FALSE;
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Image& ImplWin::GetModeImage( ) const
+const Image& ImplWin::GetModeImage( BmpColorMode eMode ) const
{
- return maImage;
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maImageHC;
+ else
+ return maImage;
}
// -----------------------------------------------------------------------
@@ -2785,6 +2746,7 @@ void ImplWin::MouseButtonDown( const MouseEvent& )
{
if( IsEnabled() )
{
+// Control::MouseButtonDown( rMEvt );
MBDown();
}
}
@@ -2827,7 +2789,7 @@ void ImplWin::ImplDraw( bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
if( ! bLayout )
{
@@ -2845,7 +2807,7 @@ void ImplWin::ImplDraw( bool bLayout )
nState &= ~CTRL_STATE_ENABLED;
if ( pWin->HasFocus() )
nState |= CTRL_STATE_FOCUSED;
-
+
// The listbox is painted over the entire control including the
// border, but ImplWin does not contain the border => correction
// needed.
@@ -2854,17 +2816,17 @@ void ImplWin::ImplDraw( bool bLayout )
Point aPoint( -nLeft, -nTop );
Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
- sal_Bool bMouseOver = sal_False;
+ BOOL bMouseOver = FALSE;
if( GetParent() )
{
Window *pChild = GetParent()->GetWindow( WINDOW_FIRSTCHILD );
- while( pChild && (bMouseOver = pChild->IsMouseOver()) == sal_False )
+ while( pChild && (bMouseOver = pChild->IsMouseOver()) == FALSE )
pChild = pChild->GetWindow( WINDOW_NEXT );
}
-
+
if( bMouseOver )
nState |= CTRL_STATE_ROLLOVER;
-
+
// if parent has no border, then nobody has drawn the background
// since no border window exists. so draw it here.
WinBits nParentStyle = pWin->GetStyle();
@@ -2874,7 +2836,7 @@ void ImplWin::ImplDraw( bool bLayout )
pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentRect,
nState, aControlValue, rtl::OUString() );
}
-
+
bNativeOK = DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
}
@@ -2911,14 +2873,14 @@ void ImplWin::ImplDraw( bool bLayout )
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = sal_True;
+ mbInUserDraw = TRUE;
UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = sal_False;
+ mbInUserDraw = FALSE;
}
else
{
- DrawEntry( sal_True, sal_True, sal_False, bLayout );
+ DrawEntry( TRUE, TRUE, FALSE, bLayout );
}
}
@@ -2931,21 +2893,27 @@ void ImplWin::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
+void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
{
long nBorder = 1;
Size aOutSz = GetOutputSizePixel();
- sal_Bool bImage = !!maImage;
+ BOOL bImage = !!maImage;
if( bDrawImage && bImage && !bLayout )
{
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
Size aImgSz = maImage.GetSizePixel();
Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) );
// check for HC mode
Image *pImage = &maImage;
+ if( !!maImageHC )
+ {
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImage = &maImageHC;
+ }
+
if ( !IsZoom() )
{
DrawImage( aPtImg, *pImage, nStyle );
@@ -2960,7 +2928,7 @@ void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDraw
if( bDrawText && maString.Len() )
{
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ USHORT nTextStyle = TEXT_DRAW_VCENTER;
if ( bDrawImage && bImage && !bLayout )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -3039,7 +3007,7 @@ void ImplWin::LoseFocus()
ImplBtn::ImplBtn( Window* pParent, WinBits nWinStyle ) :
PushButton( pParent, nWinStyle ),
- mbDown ( sal_False )
+ mbDown ( FALSE )
{
}
@@ -3059,7 +3027,7 @@ void ImplBtn::MouseButtonDown( const MouseEvent& )
if( IsEnabled() )
{
MBDown();
- mbDown = sal_True;
+ mbDown = TRUE;
}
}
@@ -3070,12 +3038,12 @@ ImplListBoxFloatingWindow::ImplListBoxFloatingWindow( Window* pParent ) :
{
mpImplLB = NULL;
mnDDLineCount = 0;
- mbAutoWidth = sal_False;
+ mbAutoWidth = FALSE;
mnPopupModeStartSaveSelection = LISTBOX_ENTRY_NOTFOUND;
EnableSaveBackground();
-
+
Window * pBorderWindow = ImplGetBorderWindow();
if( pBorderWindow )
{
@@ -3095,7 +3063,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- if( !GetParent()->HasChildPathFocus( sal_True ) )
+ if( !GetParent()->HasChildPathFocus( TRUE ) )
EndPopupMode();
}
@@ -3104,7 +3072,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
@@ -3121,11 +3089,11 @@ void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth,
if ( nFlags & WINDOW_POSSIZE_Y )
aPos.Y() = nY;
- sal_uInt16 nIndex;
+ USHORT nIndex;
SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FLOATWIN_POPUPMODE_DOWN, nIndex ) );
}
-// if( !IsReallyVisible() )
+// if( !IsReallyVisible() )
{
// Die ImplListBox erhaelt kein Resize, weil nicht sichtbar.
// Die Fenster muessen aber ein Resize() erhalten, damit die
@@ -3156,7 +3124,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- sal_uInt16 nLines = mpImplLB->GetEntryList()->GetEntryCount();
+ USHORT nLines = mpImplLB->GetEntryList()->GetEntryCount();
if ( mnDDLineCount && ( nLines > mnDDLineCount ) )
nLines = mnDDLineCount;
@@ -3222,7 +3190,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
+void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
{
if( !IsInPopupMode() )
{
@@ -3231,7 +3199,7 @@ void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
SetSizePixel( aFloatSz );
mpImplLB->SetSizePixel( GetOutputSizePixel() );
- sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
+ USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
mnPopupModeStartSaveSelection = nPos;
Size aSz = GetParent()->GetSizePixel();
@@ -3262,7 +3230,7 @@ void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
- mpImplLB->GetMainWindow()->EnableMouseMoveSelect( sal_True );
+ mpImplLB->GetMainWindow()->EnableMouseMoveSelect( TRUE );
if ( mpImplLB->GetMainWindow()->IsGrabFocusAllowed() )
mpImplLB->GetMainWindow()->GrabFocus();
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 7f304e335f54..436ab5e45a16 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,6 @@
#include <vcl/event.hxx>
#include <vcl/imgctrl.hxx>
-#include <tools/rcid.h>
#include <com/sun/star/awt/ImageScaleMode.hdl>
@@ -39,18 +38,10 @@ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
// -----------------------------------------------------------------------
-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 )
+ImageControl::ImageControl( Window* pParent, WinBits nStyle ) :
+ FixedImage( pParent, nStyle )
{
+ mnScaleMode = ImageScaleMode::Anisotropic;
}
// -----------------------------------------------------------------------
@@ -96,81 +87,154 @@ namespace
// -----------------------------------------------------------------------
-void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const
+void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
{
- sal_uInt16 nStyle = 0;
- if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ USHORT nStyle = 0;
+ BitmapEx* pBitmap = &maBmp;
+ if( !!maBmpHC )
{
- if ( !IsEnabled() )
- nStyle |= IMAGE_DRAW_DISABLE;
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pBitmap = &maBmpHC;
}
- const Image& rImage( GetModeImage() );
- const Image* pImage = &rImage;
- const Rectangle aDrawRect( rPos, rSize );
- if ( !*pImage )
+ if ( !*pBitmap )
{
String sText( GetText() );
if ( !sText.Len() )
return;
WinBits nWinStyle = GetStyle();
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
- if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
- if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ if ( !IsEnabled() )
+ nTextStyle |= TEXT_DRAW_DISABLE;
- rDev.DrawText( aDrawRect, sText, nTextStyle );
+ DrawText( rUDEvt.GetRect(), sText, nTextStyle );
return;
}
- const Size& rBitmapSize = pImage->GetSizePixel();
+ const Rectangle& rPaintRect = rUDEvt.GetRect();
+ const Size& rBitmapSize = maBmp.GetSizePixel();
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
+ if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
{
- rDev.DrawImage( lcl_centerWithin( aDrawRect, rBitmapSize ), *pImage, nStyle );
+ // 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_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
+ break;
+
+ } // switch ( mnScaleMode )
+ }
}
- break;
-
- case ImageScaleMode::Isotropic:
+ else
{
- const Size aPaintSize = lcl_calcPaintSize( aDrawRect, rBitmapSize );
- rDev.DrawImage(
- lcl_centerWithin( aDrawRect, aPaintSize ),
- aPaintSize,
- *pImage, nStyle );
+ 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_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
+ break;
+
+ } // switch ( mnScaleMode )
}
- break;
+}
- case ImageScaleMode::Anisotropic:
+// -----------------------------------------------------------------------
+
+void ImageControl::SetBitmap( const BitmapEx& rBmp )
+{
+ maBmp = rBmp;
+ StateChanged( STATE_CHANGE_DATA );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ImageControl::SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode )
+{
+ if( eMode == BMP_COLOR_NORMAL )
+ SetBitmap( rBitmap );
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
{
- rDev.DrawImage(
- aDrawRect.TopLeft(),
- aDrawRect.GetSize(),
- *pImage, nStyle );
+ maBmpHC = rBitmap;
+ StateChanged( STATE_CHANGE_DATA );
}
- break;
+ else
+ return FALSE;
+ return TRUE;
+}
- default:
- OSL_ENSURE( false, "ImageControl::ImplDraw: unhandled scale mode!" );
- break;
+// -----------------------------------------------------------------------
- } // switch ( mnScaleMode )
+const BitmapEx& ImageControl::GetModeBitmap( BmpColorMode eMode ) const
+{
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maBmpHC;
+ else
+ return maBmp;
}
// -----------------------------------------------------------------------
-void ImageControl::Paint( const Rectangle& /*rRect*/ )
+void ImageControl::Paint( const Rectangle& rRect )
{
- ImplDraw( *this, 0, Point(), GetOutputSizePixel() );
-
+ FixedImage::Paint( rRect );
if( HasFocus() )
{
Window *pWin = GetWindow( WINDOW_BORDER );
-
- sal_Bool bFlat = (GetBorderStyle() == 2);
+
+ BOOL bFlat = (GetBorderStyle() == 2);
Rectangle aRect( Point(0,0), pWin->GetOutputSizePixel() );
Color oldLineCol = pWin->GetLineColor();
Color oldFillCol = pWin->GetFillColor();
@@ -189,27 +253,6 @@ 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 e2d502026203..610dbd92d469 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,14 +48,14 @@
// =======================================================================
-#define FORMAT_LONGCURRENCY 4
+#define FORMAT_LONGCURRENCY 4
// =======================================================================
-static BigInt ImplPower10( sal_uInt16 n )
+static BigInt ImplPower10( USHORT n )
{
- sal_uInt16 i;
- BigInt nValue = 1;
+ USHORT i;
+ BigInt nValue = 1;
for ( i=0; i < n; i++ )
nValue *= 10;
@@ -65,7 +65,7 @@ static BigInt ImplPower10( sal_uInt16 n )
// -----------------------------------------------------------------------
-static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, sal_uInt16 nDigits, const String& rCurrSymbol, sal_Bool bShowThousandSep )
+static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, USHORT nDigits, const String& rCurrSymbol, BOOL bShowThousandSep )
{
DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
@@ -82,7 +82,7 @@ static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const
if ( !aInteger.IsZero() )
{
aFraction += aTmp;
- aTmp = 1000000000L;
+ aTmp = 1000000000L;
}
if ( rNumber.IsNeg() )
aFraction *= -1;
@@ -113,16 +113,16 @@ static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const
// -----------------------------------------------------------------------
-static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- sal_Bool bStrictFormat, sal_Bool bThousandSep,
+static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ BOOL bStrictFormat, BOOL bThousandSep,
const LocaleDataWrapper& rLocaleDataWrapper )
{
if ( !bStrictFormat )
- return sal_False;
+ return FALSE;
else
{
sal_Unicode cChar = rKEvt.GetCharCode();
- sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
+ USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -130,28 +130,28 @@ static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(bThousandSep && (cChar == rLocaleDataWrapper.getNumThousandSep())) ||
(cChar == rLocaleDataWrapper.getNumDecimalSep() ) ||
(cChar == '-') )
- return sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
}
// -----------------------------------------------------------------------
-static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
- sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
- sal_Bool bCurrency = sal_False )
+static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
+ USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
+ BOOL bCurrency = FALSE )
{
- XubString aStr = rStr;
- XubString aStr1;
- XubString aStr2;
- sal_uInt16 nDecPos;
- sal_Bool bNegative = sal_False;
- xub_StrLen i;
+ XubString aStr = rStr;
+ XubString aStr1;
+ XubString aStr2;
+ USHORT nDecPos;
+ BOOL bNegative = FALSE;
+ xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return sal_False;
+ return FALSE;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -171,7 +171,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = sal_True;
+ bNegative = TRUE;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -180,24 +180,24 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = sal_True;
+ bNegative = TRUE;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- sal_uInt16 nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
+ USHORT nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
- for ( i = (sal_uInt16)(aStr.Len()-1); i > 0; i++ )
+ for ( i = (USHORT)(aStr.Len()-1); i > 0; i++ )
{
if ( (aStr.GetChar( i ) >= '0') && (aStr.GetChar( i ) <= '9') )
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = sal_True;
+ bNegative = TRUE;
break;
}
}
@@ -207,7 +207,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = sal_True;
+ bNegative = TRUE;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -227,7 +227,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return sal_False;
+ return FALSE;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -235,11 +235,11 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- sal_Bool bRound = sal_False;
+ BOOL bRound = FALSE;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = sal_True;
+ bRound = TRUE;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -260,38 +260,38 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
rValue = nValue;
- return sal_True;
+ return TRUE;
}
// =======================================================================
-static sal_Bool ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
+static BOOL ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rLocaleDataWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rLocaleDataWrapper );
}
// -----------------------------------------------------------------------
-inline sal_Bool ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
- sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
+inline BOOL ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
+ USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, sal_True );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, TRUE );
}
// -----------------------------------------------------------------------
-sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
- sal_uInt16 nDecDigits,
+BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
+ USHORT nDecDigits,
const LocaleDataWrapper& rLocaleDataWrapper, String& rOutStr,
LongCurrencyFormatter& rFormatter )
{
BigInt nValue;
- if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, sal_True ) )
- return sal_True;
+ if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, TRUE ) )
+ return TRUE;
else
{
BigInt nTempVal = nValue;
@@ -306,7 +306,7 @@ sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nM
if ( !rFormatter.GetErrorHdl().Call( &rFormatter ) )
{
rFormatter.mnCorrectedValue = 0;
- return sal_False;
+ return FALSE;
}
else
{
@@ -314,8 +314,8 @@ sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nM
}
}
- rOutStr = ImplGetCurr( rLocaleDataWrapper, nTempVal, nDecDigits, rFormatter.GetCurrencySymbol(), rFormatter.IsUseThousandSep() );
- return sal_True;
+ rOutStr = ImplGetCurr( rLocaleDataWrapper, nTempVal, nDecDigits, rFormatter.GetCurrencySymbol(), rFormatter.IsUseThousandSep() );
+ return TRUE;
}
}
@@ -324,15 +324,15 @@ sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nM
void LongCurrencyFormatter::ImpInit()
{
- mnFieldValue = 0;
- mnLastValue = 0;
- mnMin = 0;
- mnMax = 0x7FFFFFFF;
- mnMax *= 0x7FFFFFFF;
- mnCorrectedValue = 0;
+ mnFieldValue = 0;
+ mnLastValue = 0;
+ mnMin = 0;
+ mnMax = 0x7FFFFFFF;
+ mnMax *= 0x7FFFFFFF;
+ mnCorrectedValue = 0;
mnDecimalDigits = 0;
- mnType = FORMAT_LONGCURRENCY;
- mbThousandSep = sal_True;
+ mnType = FORMAT_LONGCURRENCY;
+ mbThousandSep = TRUE;
SetDecimalDigits( 0 );
}
@@ -349,23 +349,23 @@ void LongCurrencyFormatter::ImplLoadRes( const ResId& rResId )
{
ImpInit();
- ResMgr* pMgr = rResId.GetResMgr();
+ ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- sal_uLong nMask = pMgr->ReadLong();
-
+ ULONG nMask = pMgr->ReadLong();
+
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
-
+
if ( NUMERICFORMATTER_MAX & nMask )
mnMax = pMgr->ReadLong();
-
+
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
-
+ SetStrictFormat( (BOOL)pMgr->ReadShort() );
+
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
-
+
if ( NUMERICFORMATTER_VALUE & nMask )
{
mnFieldValue = pMgr->ReadLong();
@@ -405,7 +405,7 @@ void LongCurrencyFormatter::SetValue( BigInt nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( sal_False );
+ SetEmptyFieldValueData( FALSE );
}
// -----------------------------------------------------------------------
@@ -430,7 +430,7 @@ void LongCurrencyFormatter::SetUserValue( BigInt nNewValue )
}
else
GetField()->SetText( aStr );
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
}
// -----------------------------------------------------------------------
@@ -464,7 +464,7 @@ void LongCurrencyFormatter::Reformat()
return;
XubString aStr;
- sal_Bool bOK = ImplLongCurrencyReformat( GetField()->GetText(), mnMin, mnMax,
+ 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( sal_False );
+ MarkToBeReformatted( FALSE );
ImplLongCurrencyGetValue( aStr, mnLastValue, GetDecimalDigits(), GetLocaleDataWrapper() );
}
else
@@ -504,7 +504,7 @@ void LongCurrencyFormatter::SetMax( BigInt nNewMax )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b )
+void LongCurrencyFormatter::SetUseThousandSep( BOOL b )
{
mbThousandSep = b;
ReformatAll();
@@ -513,34 +513,34 @@ void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits )
+void LongCurrencyFormatter::SetDecimalDigits( USHORT nDigits )
{
-// DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
+// DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
if ( nDigits > 9 )
nDigits = 9;
-
+
mnDecimalDigits = nDigits;
ReformatAll();
}
// -----------------------------------------------------------------------
-sal_uInt16 LongCurrencyFormatter::GetDecimalDigits() const
+USHORT LongCurrencyFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
// -----------------------------------------------------------------------
-sal_Bool LongCurrencyFormatter::IsValueModified() const
+BOOL LongCurrencyFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyValue();
else if ( GetValue() != mnFieldValue )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -548,7 +548,7 @@ sal_Bool LongCurrencyFormatter::IsValueModified() const
void LongCurrencyFormatter::SetEmptyValue()
{
GetField()->SetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( sal_True );
+ SetEmptyFieldValueData( TRUE );
}
// -----------------------------------------------------------------------
@@ -577,7 +577,7 @@ void ImplNewLongCurrencyFieldValue( LongCurrencyField* pField, BigInt nNewValue
Selection aSelect = pField->GetSelection();
aSelect.Justify();
XubString aText = pField->GetText();
- sal_Bool bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? sal_True : sal_False;
+ BOOL bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? TRUE : FALSE;
BigInt nOldLastValue = pField->mnLastValue;
pField->SetUserValue( nNewValue );
@@ -600,9 +600,9 @@ LongCurrencyField::LongCurrencyField( Window* pParent, WinBits nWinStyle ) :
SpinField( pParent, nWinStyle )
{
SetField( this );
- mnSpinSize = 1;
- mnFirst = mnMin;
- mnLast = mnMax;
+ mnSpinSize = 1;
+ mnFirst = mnMin;
+ mnLast = mnMax;
Reformat();
}
@@ -617,9 +617,9 @@ LongCurrencyField::LongCurrencyField( Window* pParent, const ResId& rResId ) :
SpinField::ImplInit( pParent, nStyle );
SetField( this );
- mnSpinSize = 1;
- mnFirst = mnMin;
- mnLast = mnMax;
+ mnSpinSize = 1;
+ mnFirst = mnMin;
+ mnLast = mnMax;
Reformat();
@@ -634,7 +634,7 @@ void LongCurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
LongCurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- sal_uLong nMask = ReadLongRes();
+ ULONG nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -669,7 +669,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -686,7 +686,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
void LongCurrencyField::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
SpinField::Modify();
}
@@ -781,7 +781,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( sal_False );
+ MarkToBeReformatted( FALSE );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -798,7 +798,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
void LongCurrencyBox::Modify()
{
- MarkToBeReformatted( sal_True );
+ MarkToBeReformatted( TRUE );
ComboBox::Modify();
}
@@ -807,9 +807,9 @@ void LongCurrencyBox::Modify()
void LongCurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( sal_False );
- sal_uInt16 nEntryCount = GetEntryCount();
- for ( sal_uInt16 i=0; i < nEntryCount; i++ )
+ SetUpdateMode( FALSE );
+ USHORT nEntryCount = GetEntryCount();
+ for ( USHORT 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( sal_True );
+ SetUpdateMode( TRUE );
}
// -----------------------------------------------------------------------
-void LongCurrencyBox::InsertValue( BigInt nValue, sal_uInt16 nPos )
+void LongCurrencyBox::InsertValue( BigInt nValue, USHORT 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( sal_uInt16 nPos ) const
+BigInt LongCurrencyBox::GetValue( USHORT nPos ) const
{
BigInt nValue = 0;
ImplLongCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue,
@@ -849,7 +849,7 @@ BigInt LongCurrencyBox::GetValue( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 LongCurrencyBox::GetValuePos( BigInt nValue ) const
+USHORT 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 88b583a3240d..2a5158230283 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -100,13 +100,13 @@ ListBox::~ListBox()
void ListBox::ImplInitListBoxData()
{
- mpFloatWin = NULL;
- mpImplWin = NULL;
- mpBtn = NULL;
+ mpFloatWin = NULL;
+ mpImplWin = NULL;
+ mpBtn = NULL;
- mnDDHeight = 0;
- mbDDAutoSize = sal_True;
- mnSaveValue = LISTBOX_ENTRY_NOTFOUND;
+ mnDDHeight = 0;
+ mbDDAutoSize = 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 = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (USHORT)(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<sal_uInt16>(nHeight);
+ mnDDHeight = static_cast<USHORT>(nHeight);
}
}
mpFloatWin = new ImplListBoxFloatingWindow( this );
- mpFloatWin->SetAutoWidth( sal_True );
+ mpFloatWin->SetAutoWidth( TRUE );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
@@ -176,7 +176,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
mpImplLB->SetPosPixel( Point() );
mpImplLB->Show();
-
+
mpImplLB->GetDropTarget()->addDropTargetListener(xDrop);
mpImplLB->SetDropTraget(xDrop);
@@ -186,9 +186,9 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
}
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
- SetCompoundControl( sal_True );
+ SetCompoundControl( TRUE );
}
// -----------------------------------------------------------------------
@@ -208,16 +208,16 @@ void ListBox::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_uInt16 nSelPos = ReadShortRes();
- sal_uInt16 nNumber = sal::static_int_cast<sal_uInt16>(ReadLongRes());
+ USHORT nSelPos = ReadShortRes();
+ USHORT nNumber = sal::static_int_cast<USHORT>(ReadLongRes());
- for( sal_uInt16 i = 0; i < nNumber; i++ )
+ for( USHORT i = 0; i < nNumber; i++ )
{
- sal_uInt16 nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
+ USHORT nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
long nId = ReadLongRes();
if( nId )
- SetEntryData( nPos, (void *)nId ); // ID als UserData
+ SetEntryData( nPos, (void *)nId ); // ID als UserData
}
if( nSelPos < nNumber )
@@ -228,7 +228,7 @@ void ListBox::ImplLoadRes( const ResId& rResId )
IMPL_LINK( ListBox, ImplSelectHdl, void*, EMPTYARG )
{
- sal_Bool bPopup = IsInDropDown();
+ BOOL bPopup = IsInDropDown();
if( IsDropDownBox() )
{
if( !mpImplLB->IsTravelSelect() )
@@ -277,7 +277,7 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
{
if ( !mpImplLB->IsTrackingSelect() )
{
- sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
+ USHORT nChanged = (USHORT)(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( sal_True );
- mpFloatWin->StartFloat( sal_True );
+ mpBtn->SetPressed( TRUE );
+ mpFloatWin->StartFloat( 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(), sal_True );
- sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( sal_True );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
+ BOOL bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( TRUE );
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -357,7 +357,7 @@ IMPL_LINK( ListBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
- mpBtn->SetPressed( sal_False );
+ mpBtn->SetPressed( FALSE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -374,8 +374,8 @@ void ListBox::ToggleDropDown()
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
- mpBtn->SetPressed( sal_True );
- mpFloatWin->StartFloat( sal_True );
+ mpBtn->SetPressed( TRUE );
+ mpFloatWin->StartFloat( TRUE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -383,9 +383,9 @@ void ListBox::ToggleDropDown()
// -----------------------------------------------------------------------
-void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
+ mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, 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, sa
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ 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, sa
}
long nOnePixel = GetDrawPixel( pDev, 1 );
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ USHORT nTextStyle = TEXT_DRAW_VCENTER;
Rectangle aTextRect( aPos, aSize );
if ( GetStyle() & WB_CENTER )
@@ -450,11 +450,11 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
if ( IsDropDownBox() )
{
- XubString aText = GetSelectEntry();
- long nTextHeight = pDev->GetTextHeight();
- long nTextWidth = pDev->GetTextWidth( aText );
- long nOffX = 3*nOnePixel;
- long nOffY = (aSize.Height()-nTextHeight) / 2;
+ XubString aText = GetSelectEntry();
+ long nTextHeight = pDev->GetTextHeight();
+ long nTextWidth = pDev->GetTextWidth( aText );
+ long nOffX = 3*nOnePixel;
+ long nOffY = (aSize.Height()-nTextHeight) / 2;
// Clipping?
if ( (nOffY < 0) ||
@@ -471,23 +471,23 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
}
else
{
- long nTextHeight = pDev->GetTextHeight();
- sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
- Rectangle aClip( aPos, aSize );
+ long nTextHeight = pDev->GetTextHeight();
+ USHORT nLines = (USHORT)(aSize.Height() / nTextHeight);
+ Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
if ( !nLines )
nLines = 1;
- for ( sal_uInt16 n = 0; n < nLines; n++ )
+ for ( USHORT n = 0; n < nLines; n++ )
{
- sal_uInt16 nEntry = n+mpImplLB->GetTopEntry();
- sal_Bool bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
+ USHORT nEntry = n+mpImplLB->GetTopEntry();
+ BOOL bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
if ( bSelected )
{
pDev->SetFillColor( COL_BLACK );
- pDev->DrawRect( Rectangle( Point( aPos.X(), aPos.Y() + n*nTextHeight ),
+ pDev->DrawRect( Rectangle( Point( aPos.X(), aPos.Y() + n*nTextHeight ),
Point( aPos.X() + aSize.Width(), aPos.Y() + (n+1)*nTextHeight + 2*nOnePixel ) ) );
pDev->SetFillColor();
pDev->SetTextColor( COL_WHITE );
@@ -566,8 +566,8 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
if ( mpImplWin )
{
- mpImplWin->SetSettings( GetSettings() ); // Falls noch nicht eingestellt...
- ImplInitFieldSettings( mpImplWin, sal_True, sal_True, sal_True );
+ mpImplWin->SetSettings( GetSettings() ); // Falls noch nicht eingestellt...
+ ImplInitFieldSettings( mpImplWin, TRUE, TRUE, TRUE );
mpBtn->SetSettings( GetSettings() );
ImplInitDropDownButton( mpBtn );
@@ -581,7 +581,7 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void ListBox::EnableAutoSize( sal_Bool bAuto )
+void ListBox::EnableAutoSize( BOOL bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -595,7 +595,7 @@ void ListBox::EnableAutoSize( sal_Bool bAuto )
// -----------------------------------------------------------------------
-void ListBox::EnableDDAutoWidth( sal_Bool b )
+void ListBox::EnableDDAutoWidth( BOOL b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -603,14 +603,14 @@ void ListBox::EnableDDAutoWidth( sal_Bool b )
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsDDAutoWidthEnabled() const
+BOOL ListBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
}
// -----------------------------------------------------------------------
-void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
+void ListBox::SetDropDownLineCount( USHORT nLines )
{
mnLineCount = nLines;
if ( mpFloatWin )
@@ -619,7 +619,7 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetDropDownLineCount() const
+USHORT ListBox::GetDropDownLineCount() const
{
if ( mpFloatWin )
return mpFloatWin->GetDropDownLineCount();
@@ -628,7 +628,7 @@ sal_uInt16 ListBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
-void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -655,8 +655,8 @@ void ListBox::Resize()
{
// initialize the dropdown button size with the standard scrollbar width
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
- long nTop = 0;
- long nBottom = aOutSz.Height();
+ long nTop = 0;
+ long nBottom = aOutSz.Height();
// note: in case of no border, pBorder will actually be this
Window *pBorder = GetWindow( WINDOW_BORDER );
@@ -748,7 +748,7 @@ void ListBox::FillLayoutData() const
// -----------------------------------------------------------------------
-long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
+long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -760,7 +760,7 @@ long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
// point must be either in main list window
// or in impl window (dropdown case)
ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
-
+
// convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
@@ -768,7 +768,7 @@ long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ USHORT 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 ) ? sal_True : sal_False );
- sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
+ BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : 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( sal_True );
- mpFloatWin->StartFloat( sal_False );
+ mpBtn->SetPressed( TRUE );
+ mpFloatWin->StartFloat( 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( sal_True ) )
+ if ( IsInDropDown() && !HasChildPathFocus( TRUE ) )
mpFloatWin->EndPopupMode();
}
else if ( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpImplWin) )
{
- sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -1047,30 +1047,30 @@ void ListBox::SetNoSelection()
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
+USHORT ListBox::InsertEntry( const XubString& rStr, USHORT nPos )
{
- sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
+USHORT ListBox::InsertEntry( const Image& rImage, USHORT nPos )
{
- sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
- nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
+ nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
+USHORT ListBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
{
- sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<USHORT>(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( sal_uInt16 nPos )
+void ListBox::RemoveEntry( USHORT nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
@@ -1092,7 +1092,7 @@ void ListBox::RemoveEntry( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
+Image ListBox::GetEntryImage( USHORT nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1101,90 +1101,90 @@ Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
+USHORT ListBox::GetEntryPos( const XubString& rStr ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
+USHORT ListBox::GetEntryPos( const void* pData ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ListBox::GetEntry( sal_uInt16 nPos ) const
+XubString ListBox::GetEntry( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetEntryCount() const
+USHORT ListBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-XubString ListBox::GetSelectEntry( sal_uInt16 nIndex ) const
+XubString ListBox::GetSelectEntry( USHORT nIndex ) const
{
return GetEntry( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetSelectEntryCount() const
+USHORT ListBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
+USHORT ListBox::GetSelectEntryPos( USHORT nIndex ) const
{
- sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ USHORT 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<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsEntrySelected( const XubString& rStr ) const
+BOOL ListBox::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( GetEntryPos( rStr ) );
}
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsEntryPosSelected( sal_uInt16 nPos ) const
+BOOL ListBox::IsEntryPosSelected( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
+void ListBox::SelectEntry( const XubString& rStr, BOOL bSelect )
{
SelectEntryPos( GetEntryPos( rStr ), bSelect );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
+void ListBox::SelectEntryPos( USHORT nPos, BOOL bSelect )
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
@@ -1192,51 +1192,51 @@ void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
// -----------------------------------------------------------------------
-void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
+void ListBox::SetEntryData( USHORT nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ListBox::GetEntryData( sal_uInt16 nPos ) const
+void* ListBox::GetEntryData( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
+void ListBox::SetEntryFlags( USHORT nPos, long nFlags )
{
mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags );
}
// -----------------------------------------------------------------------
-long ListBox::GetEntryFlags( sal_uInt16 nPos ) const
+long ListBox::GetEntryFlags( USHORT nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetTopEntry( sal_uInt16 nPos )
+void ListBox::SetTopEntry( USHORT nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::ShowProminentEntry( sal_uInt16 nPos )
+void ListBox::ShowProminentEntry( USHORT nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetTopEntry() const
+USHORT ListBox::GetTopEntry() const
{
- sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = 0;
return nPos;
@@ -1258,26 +1258,26 @@ ProminentEntry ListBox::GetProminentEntryType() const
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsTravelSelect() const
+BOOL ListBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsInDropDown() const
+BOOL ListBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-long ListBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
+long ListBox::CalcWindowSizePixel( USHORT nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
-Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
+Rectangle ListBox::GetBoundingRectangle( USHORT nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1287,12 +1287,12 @@ Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
// -----------------------------------------------------------------------
-void ListBox::EnableMultiSelection( sal_Bool bMulti )
+void ListBox::EnableMultiSelection( BOOL bMulti )
{
- EnableMultiSelection( bMulti, sal_False );
+ EnableMultiSelection( bMulti, FALSE );
}
-void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
+void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
{
mpImplLB->EnableMultiSelection( bMulti, bStackSelection );
@@ -1300,7 +1300,7 @@ void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
// Die MultiListBox verh�lt sich wie eine normale ListBox.
// Die Mehrfachselektion kann nur �ber entsprechende Zusatztasten erfolgen.
- sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
+ BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : FALSE;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
// ohne Focus ist das Traveln in einer MultiSelection nicht zu sehen:
@@ -1310,7 +1310,7 @@ void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsMultiSelectionEnabled() const
+BOOL ListBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
@@ -1350,7 +1350,7 @@ Size ListBox::CalcMinimumSize() const
}
aSz = CalcWindowSize( aSz );
-
+
if ( IsDropDownBox() ) // check minimum height of dropdown box
{
ImplControlValue aControlValue;
@@ -1363,7 +1363,7 @@ Size ListBox::CalcMinimumSize() const
aSz.Height() = aBound.GetHeight();
}
}
-
+
return aSz;
}
@@ -1407,11 +1407,11 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
+Size ListBox::CalcSize( USHORT nColumns, USHORT nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
-// aMinSz = ImplCalcOutSz( aMinSz );
+// aMinSz = ImplCalcOutSz( aMinSz );
Size aSz;
@@ -1449,19 +1449,19 @@ Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
// -----------------------------------------------------------------------
-void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
+void ListBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
- rnLines = (sal_uInt16) (aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
+ rnLines = (USHORT) (aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpImplWin->GetOutputSizePixel();
- rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
+ rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
@@ -1482,7 +1482,7 @@ void ListBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ListBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
+void ListBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, 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( sal_Bool bUserDraw )
+void ListBox::EnableUserDraw( BOOL bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
if ( mpImplWin )
@@ -1517,14 +1517,14 @@ void ListBox::EnableUserDraw( sal_Bool bUserDraw )
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsUserDrawEnabled() const
+BOOL ListBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ListBox::SetReadOnly( sal_Bool bReadOnly )
+void ListBox::SetReadOnly( BOOL bReadOnly )
{
if ( mpImplLB->IsReadOnly() != bReadOnly )
{
@@ -1535,14 +1535,14 @@ void ListBox::SetReadOnly( sal_Bool bReadOnly )
// -----------------------------------------------------------------------
-sal_Bool ListBox::IsReadOnly() const
+BOOL ListBox::IsReadOnly() const
{
return mpImplLB->IsReadOnly();
}
// -----------------------------------------------------------------------
-void ListBox::SetSeparatorPos( sal_uInt16 n )
+void ListBox::SetSeparatorPos( USHORT n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1556,7 +1556,7 @@ void ListBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetSeparatorPos() const
+USHORT ListBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1577,21 +1577,21 @@ XubString ListBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ListBox::SetMaxMRUCount( sal_uInt16 n )
+void ListBox::SetMaxMRUCount( USHORT n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetMaxMRUCount() const
+USHORT ListBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-sal_uInt16 ListBox::GetDisplayLineCount() const
+USHORT ListBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
@@ -1626,7 +1626,7 @@ MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
ListBox( WINDOW_MULTILISTBOX )
{
ImplInit( pParent, nStyle );
- EnableMultiSelection( sal_True );
+ EnableMultiSelection( TRUE );
}
// -----------------------------------------------------------------------
@@ -1641,7 +1641,7 @@ MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
if ( !(nStyle & WB_HIDE ) )
Show();
- EnableMultiSelection( sal_True );
+ EnableMultiSelection( TRUE );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index de2613b1084f..f9e994e0a66c 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -43,36 +43,51 @@ CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
# --- Files --------------------------------------------------------
-EXCEPTIONSFILES= \
- $(SLO)$/button.obj \
+SLOFILES= $(SLO)$/button.obj \
+ $(SLO)$/combobox.obj \
$(SLO)$/ctrl.obj \
$(SLO)$/edit.obj \
+ $(SLO)$/field.obj \
$(SLO)$/field2.obj \
- $(SLO)$/ilstbox.obj \
- $(SLO)$/tabctrl.obj \
- $(SLO)$/throbber.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
-SLOFILES= $(EXCEPTIONSFILES) \
+EXCEPTIONSFILES= \
+ $(SLO)$/button.obj \
$(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)$/morebtn.obj \
$(SLO)$/menubtn.obj \
+ $(SLO)$/morebtn.obj \
$(SLO)$/scrbar.obj \
$(SLO)$/slider.obj \
- $(SLO)$/spinfld.obj \
$(SLO)$/spinbtn.obj \
- $(SLO)$/quickselectionengine.obj
-
+ $(SLO)$/spinfld.obj \
+ $(SLO)$/tabctrl.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 13513f62b719..9e0de107161f 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,20 +40,20 @@
// =======================================================================
-#define IMAGEBUTTON_BORDER_OFF1 11
-#define IMAGEBUTTON_BORDER_OFF2 16
+#define IMAGEBUTTON_BORDER_OFF1 11
+#define IMAGEBUTTON_BORDER_OFF2 16
// =======================================================================
void MenuButton::ImplInitMenuButtonData()
{
- mnDDStyle = PUSHBUTTON_DROPDOWN_MENUBUTTON;
+ mnDDStyle = PUSHBUTTON_DROPDOWN_MENUBUTTON;
- mpMenuTimer = NULL;
- mpMenu = NULL;
- mpOwnMenu = NULL;
- mnCurItemId = 0;
- mnMenuMode = 0;
+ mpMenuTimer = NULL;
+ mpMenu = NULL;
+ mpOwnMenu = NULL;
+ mnCurItemId = 0;
+ mnMenuMode = 0;
}
// -----------------------------------------------------------------------
@@ -77,10 +77,19 @@ void MenuButton::ImplExecuteMenu()
Point aPos( 0, 1 );
Size aSize = GetSizePixel();
Rectangle aRect( aPos, aSize );
- SetPressed( sal_True );
+ 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 );
EndSelection();
mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN );
- SetPressed( sal_False );
+ SetPressed( FALSE );
if ( mnCurItemId )
{
Select();
@@ -119,7 +128,7 @@ void MenuButton::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( RSCMENUBUTTON_MENU & nObjMask )
{
@@ -171,10 +180,10 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
mpMenuTimer = new Timer;
mpMenuTimer->SetTimeoutHdl( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
}
-
+
mpMenuTimer->SetTimeout( GetSettings().GetMouseSettings().GetActionDelay() );
mpMenuTimer->Start();
-
+
PushButton::MouseButtonDown( rMEvt );
bExecute = false;
}
@@ -195,7 +204,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
void MenuButton::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nCode = aKeyCode.GetCode();
+ USHORT nCode = aKeyCode.GetCode();
if ( (nCode == KEY_DOWN) && aKeyCode.IsMod2() )
ImplExecuteMenu();
else if ( !(mnMenuMode & MENUBUTTON_MENUMODE_TIMED) &&
@@ -222,7 +231,7 @@ void MenuButton::Select()
// -----------------------------------------------------------------------
-void MenuButton::SetMenuMode( sal_uInt16 nMode )
+void MenuButton::SetMenuMode( USHORT 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 f40bc376d5e0..837118786959 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,11 +31,12 @@
#include <vcl/morebtn.hxx>
#include <tools/rc.h>
-#include <vector>
+
+
// =======================================================================
-typedef ::std::vector< Window* > ImplMoreWindowList;
+DECLARE_LIST( ImplMoreWindowList, Window* )
struct ImplMoreButtonData
{
@@ -49,9 +50,9 @@ struct ImplMoreButtonData
void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
{
mpMBData = new ImplMoreButtonData;
- mnDelta = 0;
- meUnit = MAP_PIXEL;
- mbState = sal_False;
+ mnDelta = 0;
+ meUnit = MAP_PIXEL;
+ mbState = FALSE;
mpMBData->mpItemList = NULL;
@@ -65,7 +66,7 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
ShowState();
SetSymbolAlign( SYMBOLALIGN_RIGHT );
- ImplSetSmallSymbol( sal_True );
+ ImplSetSmallSymbol( TRUE );
if ( ! ( nStyle & ( WB_RIGHT | WB_LEFT ) ) )
{
@@ -117,12 +118,12 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
{
PushButton::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( nObjMask & RSC_MOREBUTTON_STATE )
{
// Nicht Methode rufen, da Dialog nicht umgeschaltet werden soll
- mbState = (sal_Bool)ReadShortRes();
+ mbState = (BOOL)ReadShortRes();
// SetText( GetText() );
ShowState();
}
@@ -146,9 +147,10 @@ MoreButton::~MoreButton()
void MoreButton::Click()
{
- Window* pParent = GetParent();
- Size aSize( pParent->GetSizePixel() );
- long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height();
+ Window* pParent = GetParent();
+ Size aSize( pParent->GetSizePixel() );
+ Window* pWindow = (mpMBData->mpItemList) ? mpMBData->mpItemList->First() : NULL;
+ long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height();
// Status aendern
mbState = !mbState;
@@ -162,10 +164,10 @@ void MoreButton::Click()
if ( mbState )
{
// Fenster anzeigen
- if ( mpMBData->mpItemList ) {
- for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
- (*mpMBData->mpItemList)[ i ]->Show();
- }
+ while ( pWindow )
+ {
+ pWindow->Show();
+ pWindow = mpMBData->mpItemList->Next();
}
// Dialogbox anpassen
@@ -192,10 +194,10 @@ void MoreButton::Click()
pParent->SetSizePixel( aSize );
// Fenster nicht mehr anzeigen
- if ( mpMBData->mpItemList ) {
- for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
- (*mpMBData->mpItemList)[ i ]->Hide();
- }
+ while ( pWindow )
+ {
+ pWindow->Hide();
+ pWindow = mpMBData->mpItemList->Next();
}
}
}
@@ -205,9 +207,9 @@ void MoreButton::Click()
void MoreButton::AddWindow( Window* pWindow )
{
if ( !mpMBData->mpItemList )
- mpMBData->mpItemList = new ImplMoreWindowList();
+ mpMBData->mpItemList = new ImplMoreWindowList( 1024, 16, 16 );
- mpMBData->mpItemList->push_back( pWindow );
+ mpMBData->mpItemList->Insert( pWindow, LIST_APPEND );
if ( mbState )
pWindow->Show();
@@ -219,17 +221,8 @@ void MoreButton::AddWindow( Window* pWindow )
void MoreButton::RemoveWindow( Window* pWindow )
{
- if ( mpMBData->mpItemList ) {
- for ( ImplMoreWindowList::iterator it = mpMBData->mpItemList->begin();
- it < mpMBData->mpItemList->end();
- ++it
- ) {
- if ( *it == pWindow ) {
- mpMBData->mpItemList->erase( it );
- break;
- }
- }
- }
+ if ( mpMBData->mpItemList )
+ mpMBData->mpItemList->Remove( pWindow );
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
deleted file mode 100644
index 2d32393bf79a..000000000000
--- a/vcl/source/control/quickselectionengine.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/*************************************************************************
-* 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 938b7831985c..eacb6ed57edf 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,9 +39,10 @@
#include "rtl/string.hxx"
#include "tools/rc.h"
-using ::rtl::OUString;
+using namespace rtl;
+
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
abuse the HitTestNativeControl interface. All theming engines but aqua
@@ -49,10 +50,10 @@ using ::rtl::OUString;
However aqua draws a little outside. The canonical way would be to enhance the
HitTestNativeControl passing a ScrollbarValue additionally so all necessary
information is available in the call.
- .
+ .
However since there is only this one small exception we will deviate a little and
instead pass the respective rect as control region to allow for a small correction.
-
+
So all places using HitTestNativeControl on PART_THUMB_HORZ, PART_THUMB_VERT,
PART_TRACK_HORZ_LEFT, PART_TRACK_HORZ_RIGHT, PART_TRACK_VERT_UPPER, PART_TRACK_VERT_LOWER
do not use the control rectangle as region but the actuall part rectangle, making
@@ -70,31 +71,31 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#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_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_ALL (SCRBAR_DRAW_BTN1 | SCRBAR_DRAW_BTN2 | \
SCRBAR_DRAW_PAGE1 | SCRBAR_DRAW_PAGE2 |\
SCRBAR_DRAW_THUMB | SCRBAR_DRAW_BACKGROUND )
-#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_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_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
struct ImplScrollBarData
{
- AutoTimer maTimer; // Timer
- sal_Bool mbHide;
- Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic
+ AutoTimer maTimer; // Timer
+ BOOL mbHide;
+ Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic
};
// =======================================================================
@@ -116,14 +117,14 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
mnStateFlags = 0;
meScrollType = SCROLL_DONTKNOW;
meDDScrollType = SCROLL_DONTKNOW;
- mbCalcSize = sal_True;
+ mbCalcSize = 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 = sal_False;
+ mpData->mbHide = FALSE;
}
ImplInitStyle( nStyle );
@@ -139,7 +140,7 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
void ScrollBar::ImplInitStyle( WinBits nStyle )
{
if ( nStyle & WB_DRAG )
- mbFullDrag = sal_True;
+ mbFullDrag = TRUE;
else
mbFullDrag = (GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_SCROLL) != 0;
}
@@ -180,12 +181,12 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_Int16 nMin = ReadShortRes();
- sal_Int16 nMax = ReadShortRes();
- sal_Int16 nThumbPos = ReadShortRes();
- sal_Int16 nPage = ReadShortRes();
- sal_Int16 nStep = ReadShortRes();
- sal_Int16 nVisibleSize = ReadShortRes();
+ INT16 nMin = ReadShortRes();
+ INT16 nMax = ReadShortRes();
+ INT16 nThumbPos = ReadShortRes();
+ INT16 nPage = ReadShortRes();
+ INT16 nStep = ReadShortRes();
+ INT16 nVisibleSize = ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -196,9 +197,9 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
+void ScrollBar::ImplUpdateRects( BOOL bUpdate )
{
- sal_uInt16 nOldStateFlags = mnStateFlags;
+ USHORT nOldStateFlags = mnStateFlags;
Rectangle aOldPage1Rect = maPage1Rect;
Rectangle aOldPage2Rect = maPage2Rect;
Rectangle aOldThumbRect = maThumbRect;
@@ -244,6 +245,7 @@ void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
}
else
{
+ Size aScrBarSize = GetOutputSizePixel();
if ( GetStyle() & WB_HORZ )
{
const long nSpace = maTrackRect.Right() - maTrackRect.Left();
@@ -280,7 +282,7 @@ void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
if ( bUpdate )
{
- sal_uInt16 nDraw = 0;
+ USHORT nDraw = 0;
if ( (nOldStateFlags & SCRBAR_STATE_BTN1_DISABLE) !=
(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) )
nDraw |= SCRBAR_DRAW_BTN1;
@@ -333,7 +335,7 @@ long ScrollBar::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void ScrollBar::ImplCalc( sal_Bool bUpdate )
+void ScrollBar::ImplCalc( BOOL bUpdate )
{
const Size aSize = GetOutputSizePixel();
const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize();;
@@ -374,8 +376,8 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
if( mnThumbPixRange > 0 )
{
maPage1Rect.Left() = maTrackRect.Left();
- maPage1Rect.Bottom() =
- maPage2Rect.Bottom() =
+ maPage1Rect.Bottom() =
+ maPage2Rect.Bottom() =
maThumbRect.Bottom() = maTrackRect.Bottom();
}
else
@@ -415,8 +417,8 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
if( mnThumbPixRange > 0 )
{
maPage1Rect.Top() = maTrackRect.Top();
- maPage1Rect.Right() =
- maPage2Rect.Right() =
+ maPage1Rect.Right() =
+ maPage2Rect.Right() =
maThumbRect.Right() = maTrackRect.Right();
}
else
@@ -430,7 +432,7 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
if ( !mnThumbPixRange )
maThumbRect.SetEmpty();
- mbCalcSize = sal_False;
+ mbCalcSize = FALSE;
}
if ( mnThumbPixRange )
@@ -468,14 +470,14 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
if ( bUpdate && HasPaintEvent() )
{
Invalidate();
- bUpdate = sal_False;
+ bUpdate = FALSE;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -497,14 +499,14 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetSettings( aSettings );
}
- // for printing:
+ // for printing:
// -calculate the size of the rects
// -because this is zero-based add the correct offset
// -print
// -force recalculate
if ( mbCalcSize )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
maBtn1Rect+=aPos;
maBtn2Rect+=aPos;
@@ -516,24 +518,24 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
ImplDraw( SCRBAR_DRAW_ALL, pDev );
pDev->Pop();
- mbCalcSize = sal_True;
+ mbCalcSize = TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
+BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
{
ScrollbarValue scrValue;
- sal_Bool bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
+ BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
if( bNativeOK )
{
- sal_Bool bHorz = (GetStyle() & WB_HORZ ? true : false);
+ 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) )
{
- ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
+ ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
scrValue.mnMin = mnMinRange;
scrValue.mnMax = mnMaxRange;
@@ -581,8 +583,8 @@ sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
{
if ( (nDrawFlags & SCRBAR_DRAW_PAGE1) || (nDrawFlags & SCRBAR_DRAW_PAGE2) )
{
- sal_uInt32 part1 = bHorz ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER;
- sal_uInt32 part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER;
+ sal_uInt32 part1 = bHorz ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER;
+ sal_uInt32 part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER;
Rectangle aCtrlRegion1( maPage1Rect );
Rectangle aCtrlRegion2( maPage2Rect );
ControlState nState1 = (IsEnabled() ? CTRL_STATE_ENABLED : 0) | (HasFocus() ? CTRL_STATE_FOCUSED : 0);
@@ -604,19 +606,19 @@ sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
}
if ( nDrawFlags & SCRBAR_DRAW_PAGE1 )
- bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
+ bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
scrValue, rtl::OUString() );
if ( nDrawFlags & SCRBAR_DRAW_PAGE2 )
- bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
+ bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
scrValue, rtl::OUString() );
}
if ( (nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2) )
{
- sal_uInt32 part1 = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
- sal_uInt32 part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
- Rectangle aCtrlRegion1( maBtn1Rect );
- Rectangle aCtrlRegion2( maBtn2Rect );
+ sal_uInt32 part1 = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
+ sal_uInt32 part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
+ Rectangle aCtrlRegion1( maBtn1Rect );
+ Rectangle aCtrlRegion2( maBtn2Rect );
ControlState nState1 = HasFocus() ? CTRL_STATE_FOCUSED : 0;
ControlState nState2 = nState1;
@@ -646,17 +648,17 @@ sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
}
if ( nDrawFlags & SCRBAR_DRAW_BTN1 )
- bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
+ bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
scrValue, rtl::OUString() );
if ( nDrawFlags & SCRBAR_DRAW_BTN2 )
- bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
+ bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
scrValue, rtl::OUString() );
}
if ( (nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty() )
{
- ControlState nState = IsEnabled() ? CTRL_STATE_ENABLED : 0;
- Rectangle aCtrlRegion( maThumbRect );
+ ControlState nState = IsEnabled() ? CTRL_STATE_ENABLED : 0;
+ Rectangle aCtrlRegion( maThumbRect );
if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
nState |= CTRL_STATE_PRESSED;
@@ -682,23 +684,23 @@ sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
return bNativeOK;
}
-void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
+void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
{
DecorationView aDecoView( pOutDev );
Rectangle aTempRect;
- sal_uInt16 nStyle;
+ USHORT nStyle;
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
SymbolType eSymbolType;
- sal_Bool bEnabled = IsEnabled();
+ BOOL bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
Window *pWin = NULL;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
pWin = (Window*) pOutDev;
-
+
// Draw the entire control if the native theme engine needs it
if ( nDrawFlags && pWin && pWin->IsNativeControlSupported(CTRL_SCROLLBAR, PART_DRAW_BACKGROUND_HORZ) )
{
@@ -769,7 +771,64 @@ void ScrollBar::ImplDraw( sal_uInt16 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
{
@@ -799,7 +858,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
// -----------------------------------------------------------------------
-long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
+long ScrollBar::ImplScroll( long nNewPos, BOOL bCallEndScroll )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -817,7 +876,7 @@ long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
// -----------------------------------------------------------------------
-long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
+long ScrollBar::ImplDoAction( BOOL bCallEndScroll )
{
long nDelta = 0;
@@ -847,12 +906,12 @@ long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
// -----------------------------------------------------------------------
-void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
+void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
{
- sal_uInt16 nOldStateFlags = mnStateFlags;
- sal_Bool bAction = sal_False;
- sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
- sal_Bool bIsInside = sal_False;
+ USHORT nOldStateFlags = mnStateFlags;
+ BOOL bAction = FALSE;
+ BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
+ BOOL bIsInside = FALSE;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -919,7 +978,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction
if ( nOldStateFlags != mnStateFlags )
ImplDraw( mnDragDraw, this );
if ( bAction )
- ImplDoAction( sal_False );
+ ImplDoAction( FALSE );
}
// -----------------------------------------------------------------------
@@ -959,10 +1018,10 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() || rMEvt.IsMiddle() )
{
const Point& rMousePos = rMEvt.GetPosPixel();
- sal_uInt16 nTrackFlags = 0;
- sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
- sal_Bool bIsInside = sal_False;
- sal_Bool bDragToMouse = sal_False;
+ USHORT nTrackFlags = 0;
+ BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
+ BOOL bIsInside = FALSE;
+ BOOL bDragToMouse = FALSE;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1005,21 +1064,21 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if( mpData )
{
- mpData->mbHide = sal_True; // disable focus blinking
+ mpData->mbHide = TRUE; // disable focus blinking
if( HasFocus() )
ImplDraw( SCRBAR_DRAW_THUMB, this ); // paint without focus
}
-
+
if ( mnVisibleSize < mnMaxRange-mnMinRange )
{
nTrackFlags = 0;
meScrollType = SCROLL_DRAG;
mnDragDraw = SCRBAR_DRAW_THUMB;
-
+
// calculate mouse offset
if( rMEvt.IsMiddle() || (ImplGetSVData()->maNWFData.mbScrollbarJumpPage && !bThumbHit) )
{
- bDragToMouse = sal_True;
+ bDragToMouse = TRUE;
if ( GetStyle() & WB_HORZ )
mnMouseOff = maThumbRect.GetWidth()/2;
else
@@ -1032,7 +1091,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
else
mnMouseOff = rMousePos.Y()-maThumbRect.Top();
}
-
+
mnStateFlags |= SCRBAR_STATE_THUMB_DOWN;
ImplDraw( mnDragDraw, this );
}
@@ -1041,14 +1100,14 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
aControlRegion, rMousePos, bIsInside )?
- bIsInside : sal_True )
+ bIsInside : TRUE )
{
nTrackFlags = STARTTRACK_BUTTONREPEAT;
-
+
// HitTestNativeControl, see remark at top of file
if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
maPage1Rect, rMousePos, bIsInside )?
- bIsInside:
+ bIsInside:
maPage1Rect.IsInside( rMousePos ) )
{
meScrollType = SCROLL_PAGEUP;
@@ -1067,12 +1126,12 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
// remember original position in case of abort or EndScroll-Delta
mnStartPos = mnThumbPos;
- // #92906# Call StartTracking() before ImplDoMouseAction(), otherwise
- // MouseButtonUp() / EndTracking() may be called if somebody is spending
+ // #92906# Call StartTracking() before ImplDoMouseAction(), otherwise
+ // MouseButtonUp() / EndTracking() may be called if somebody is spending
// a lot of time in the scroll handler
StartTracking( nTrackFlags );
ImplDoMouseAction( rMousePos );
-
+
if( bDragToMouse )
ImplDragThumb( rMousePos );
}
@@ -1086,7 +1145,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- sal_uInt16 nOldStateFlags = mnStateFlags;
+ USHORT nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SCRBAR_STATE_BTN1_DOWN | SCRBAR_STATE_BTN2_DOWN |
SCRBAR_STATE_PAGE1_DOWN | SCRBAR_STATE_PAGE2_DOWN |
SCRBAR_STATE_THUMB_DOWN);
@@ -1123,7 +1182,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
meScrollType = SCROLL_DONTKNOW;
if( mpData )
- mpData->mbHide = sal_False; // re-enable focus blinking
+ mpData->mbHide = FALSE; // re-enable focus blinking
}
else
{
@@ -1197,9 +1256,9 @@ void ScrollBar::Paint( const Rectangle& )
void ScrollBar::Resize()
{
Control::Resize();
- mbCalcSize = sal_True;
+ mbCalcSize = TRUE;
if ( IsReallyVisible() )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
Invalidate();
}
@@ -1221,7 +1280,7 @@ void ScrollBar::ImplInvert()
aRect.Left() += 2;
aRect.Right() -= 2;
}
- if( aRect.getHeight() > 4 )
+ if( aRect.getHeight() > 4 )
{
aRect.Top() += 2;
aRect.Bottom() -= 2;
@@ -1238,7 +1297,7 @@ void ScrollBar::GetFocus()
{
mpData = new ImplScrollBarData;
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
- mpData->mbHide = sal_False;
+ mpData->mbHide = FALSE;
}
ImplInvert(); // react immediately
mpData->maTimer.SetTimeout( GetSettings().GetStyleSettings().GetCursorBlinkTime() );
@@ -1264,17 +1323,17 @@ void ScrollBar::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( sal_True );
+ ImplCalc( TRUE );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
Invalidate();
}
}
@@ -1291,8 +1350,8 @@ void ScrollBar::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SCRBAR_VIEW_STYLE) !=
(GetStyle() & SCRBAR_VIEW_STYLE) )
{
- mbCalcSize = sal_True;
- ImplCalc( sal_False );
+ mbCalcSize = TRUE;
+ ImplCalc( FALSE );
Invalidate();
}
}
@@ -1308,8 +1367,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- mbCalcSize = sal_True;
- ImplCalc( sal_False );
+ mbCalcSize = TRUE;
+ ImplCalc( FALSE );
Invalidate();
}
}
@@ -1318,8 +1377,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
{
- sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
- sal_Bool bIsInside = sal_False;
+ BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
+ BOOL bIsInside = FALSE;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1379,9 +1438,9 @@ long ScrollBar::PreNotify( NotifyEvent& rNEvt )
aClipRegion.Union( *pRect );
if ( pLastRect )
aClipRegion.Union( *pLastRect );
-
+
// Support for 3-button scroll bars
- sal_Bool bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
+ BOOL bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
if ( bHas3Buttons && ( pRect == &maBtn1Rect || pLastRect == &maBtn1Rect ) )
{
aClipRegion.Union( maBtn2Rect );
@@ -1421,7 +1480,7 @@ long ScrollBar::DoScroll( long nNewPos )
return 0;
meScrollType = SCROLL_DRAG;
- long nDelta = ImplScroll( nNewPos, sal_True );
+ long nDelta = ImplScroll( nNewPos, TRUE );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -1436,7 +1495,7 @@ long ScrollBar::DoScrollAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( sal_True );
+ long nDelta = ImplDoAction( TRUE );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 71eeeae665d4..ce0ffc4a75b1 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,49 +46,49 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#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_DRAW_THUMB ((USHORT)0x0001)
+#define SLIDER_DRAW_CHANNEL1 ((USHORT)0x0002)
+#define SLIDER_DRAW_CHANNEL2 ((USHORT)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 ((sal_uInt16)0x0001)
-#define SLIDER_STATE_CHANNEL2_DOWN ((sal_uInt16)0x0002)
-#define SLIDER_STATE_THUMB_DOWN ((sal_uInt16)0x0004)
+#define SLIDER_STATE_CHANNEL1_DOWN ((USHORT)0x0001)
+#define SLIDER_STATE_CHANNEL2_DOWN ((USHORT)0x0002)
+#define SLIDER_STATE_THUMB_DOWN ((USHORT)0x0004)
-#define SLIDER_THUMB_SIZE 9
-#define SLIDER_THUMB_HALFSIZE 4
-#define SLIDER_CHANNEL_OFFSET 0
-#define SLIDER_CHANNEL_SIZE 4
-#define SLIDER_CHANNEL_HALFSIZE 2
+#define SLIDER_THUMB_SIZE 9
+#define SLIDER_THUMB_HALFSIZE 4
+#define SLIDER_CHANNEL_OFFSET 0
+#define SLIDER_CHANNEL_SIZE 4
+#define SLIDER_CHANNEL_HALFSIZE 2
-#define SLIDER_HEIGHT 16
+#define SLIDER_HEIGHT 16
-#define SLIDER_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
+#define SLIDER_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
// =======================================================================
void Slider::ImplInit( Window* pParent, WinBits nStyle )
{
- mnThumbPixOffset = 0;
- mnThumbPixRange = 0;
- mnThumbPixPos = 0; // between mnThumbPixOffset and mnThumbPixOffset+mnThumbPixRange
- mnChannelPixOffset = 0;
- mnChannelPixRange = 0;
- mnChannelPixTop = 0;
- mnChannelPixBottom = 0;
-
- mnMinRange = 0;
- mnMaxRange = 100;
- mnThumbPos = 0;
- mnLineSize = 1;
- mnPageSize = 1;
- mnDelta = 0;
- mnDragDraw = 0;
- mnStateFlags = 0;
- meScrollType = SCROLL_DONTKNOW;
- mbCalcSize = sal_True;
- mbFullDrag = sal_True;
+ mnThumbPixOffset = 0;
+ mnThumbPixRange = 0;
+ mnThumbPixPos = 0; // between mnThumbPixOffset and mnThumbPixOffset+mnThumbPixRange
+ mnChannelPixOffset = 0;
+ mnChannelPixRange = 0;
+ mnChannelPixTop = 0;
+ mnChannelPixBottom = 0;
+
+ mnMinRange = 0;
+ mnMaxRange = 100;
+ mnThumbPos = 0;
+ mnLineSize = 1;
+ mnPageSize = 1;
+ mnDelta = 0;
+ mnDragDraw = 0;
+ mnStateFlags = 0;
+ meScrollType = SCROLL_DONTKNOW;
+ mbCalcSize = TRUE;
+ mbFullDrag = TRUE;
Control::ImplInit( pParent, nStyle, NULL );
@@ -124,12 +124,12 @@ void Slider::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_Int16 nMin = ReadShortRes();
- sal_Int16 nMax = ReadShortRes();
- sal_Int16 nThumbPos = ReadShortRes();
- sal_Int16 nPage = ReadShortRes();
- sal_Int16 nStep = ReadShortRes();
- /* sal_Int16 nVisibleSize = */ ReadShortRes();
+ INT16 nMin = ReadShortRes();
+ INT16 nMax = ReadShortRes();
+ INT16 nThumbPos = ReadShortRes();
+ INT16 nPage = ReadShortRes();
+ INT16 nStep = ReadShortRes();
+ /* INT16 nVisibleSize = */ ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -144,16 +144,16 @@ void Slider::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -164,7 +164,7 @@ void Slider::ImplInitSettings()
// -----------------------------------------------------------------------
-void Slider::ImplUpdateRects( sal_Bool bUpdate )
+void Slider::ImplUpdateRects( BOOL bUpdate )
{
Rectangle aOldThumbRect = maThumbRect;
bool bInvalidateAll = false;
@@ -173,27 +173,27 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
{
if ( GetStyle() & WB_HORZ )
{
- maThumbRect.Left() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE;
- maThumbRect.Right() = maThumbRect.Left()+SLIDER_THUMB_SIZE-1;
+ maThumbRect.Left() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE;
+ maThumbRect.Right() = maThumbRect.Left()+SLIDER_THUMB_SIZE-1;
if ( mnChannelPixOffset < maThumbRect.Left() )
{
- maChannel1Rect.Left() = mnChannelPixOffset;
- maChannel1Rect.Right() = maThumbRect.Left()-1;
- maChannel1Rect.Top() = mnChannelPixTop;
+ maChannel1Rect.Left() = mnChannelPixOffset;
+ maChannel1Rect.Right() = maThumbRect.Left()-1;
+ maChannel1Rect.Top() = mnChannelPixTop;
maChannel1Rect.Bottom() = mnChannelPixBottom;
}
else
maChannel1Rect.SetEmpty();
if ( mnChannelPixOffset+mnChannelPixRange-1 > maThumbRect.Right() )
{
- maChannel2Rect.Left() = maThumbRect.Right()+1;
- maChannel2Rect.Right() = mnChannelPixOffset+mnChannelPixRange-1;
- maChannel2Rect.Top() = mnChannelPixTop;
+ maChannel2Rect.Left() = maThumbRect.Right()+1;
+ maChannel2Rect.Right() = mnChannelPixOffset+mnChannelPixRange-1;
+ maChannel2Rect.Top() = mnChannelPixTop;
maChannel2Rect.Bottom() = mnChannelPixBottom;
}
else
maChannel2Rect.SetEmpty();
-
+
const Rectangle aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) );
Rectangle aThumbBounds, aThumbContent;
if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_HORZ,
@@ -207,23 +207,23 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
}
else
{
- maThumbRect.Top() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE;
- maThumbRect.Bottom() = maThumbRect.Top()+SLIDER_THUMB_SIZE-1;
+ maThumbRect.Top() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE;
+ maThumbRect.Bottom() = maThumbRect.Top()+SLIDER_THUMB_SIZE-1;
if ( mnChannelPixOffset < maThumbRect.Top() )
{
- maChannel1Rect.Top() = mnChannelPixOffset;
+ maChannel1Rect.Top() = mnChannelPixOffset;
maChannel1Rect.Bottom() = maThumbRect.Top()-1;
- maChannel1Rect.Left() = mnChannelPixTop;
- maChannel1Rect.Right() = mnChannelPixBottom;
+ maChannel1Rect.Left() = mnChannelPixTop;
+ maChannel1Rect.Right() = mnChannelPixBottom;
}
else
maChannel1Rect.SetEmpty();
if ( mnChannelPixOffset+mnChannelPixRange-1 > maThumbRect.Bottom() )
{
- maChannel2Rect.Top() = maThumbRect.Bottom()+1;
+ maChannel2Rect.Top() = maThumbRect.Bottom()+1;
maChannel2Rect.Bottom() = mnChannelPixOffset+mnChannelPixRange-1;
- maChannel2Rect.Left() = mnChannelPixTop;
- maChannel2Rect.Right() = mnChannelPixBottom;
+ maChannel2Rect.Left() = mnChannelPixTop;
+ maChannel2Rect.Right() = mnChannelPixBottom;
}
else
maChannel2Rect.SetEmpty();
@@ -257,7 +257,7 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate )
{
Region aInvalidRegion( aOldThumbRect );
aInvalidRegion.Union( maThumbRect );
-
+
if( !IsBackground() && GetParent() )
{
const Point aPos( GetPosPixel() );
@@ -302,16 +302,16 @@ long Slider::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void Slider::ImplCalc( sal_Bool bUpdate )
+void Slider::ImplCalc( BOOL bUpdate )
{
- sal_Bool bInvalidateAll = sal_False;
+ BOOL bInvalidateAll = FALSE;
if ( mbCalcSize )
{
- long nOldChannelPixOffset = mnChannelPixOffset;
- long nOldChannelPixRange = mnChannelPixRange;
- long nOldChannelPixTop = mnChannelPixTop;
- long nOldChannelPixBottom = mnChannelPixBottom;
+ long nOldChannelPixOffset = mnChannelPixOffset;
+ long nOldChannelPixRange = mnChannelPixRange;
+ long nOldChannelPixTop = mnChannelPixTop;
+ long nOldChannelPixBottom = mnChannelPixBottom;
long nCalcWidth;
long nCalcHeight;
@@ -322,28 +322,28 @@ void Slider::ImplCalc( sal_Bool bUpdate )
Size aSize = GetOutputSizePixel();
if ( GetStyle() & WB_HORZ )
{
- nCalcWidth = aSize.Width();
- nCalcHeight = aSize.Height();
- maThumbRect.Top() = 0;
+ nCalcWidth = aSize.Width();
+ nCalcHeight = aSize.Height();
+ maThumbRect.Top() = 0;
maThumbRect.Bottom()= aSize.Height()-1;
}
else
{
- nCalcWidth = aSize.Height();
- nCalcHeight = aSize.Width();
- maThumbRect.Left() = 0;
+ nCalcWidth = aSize.Height();
+ nCalcHeight = aSize.Width();
+ maThumbRect.Left() = 0;
maThumbRect.Right() = aSize.Width()-1;
}
if ( nCalcWidth >= SLIDER_THUMB_SIZE )
{
- mnThumbPixOffset = SLIDER_THUMB_HALFSIZE;
- mnThumbPixRange = nCalcWidth-(SLIDER_THUMB_HALFSIZE*2);
- mnThumbPixPos = 0;
- mnChannelPixOffset = SLIDER_CHANNEL_OFFSET;
- mnChannelPixRange = nCalcWidth-(SLIDER_CHANNEL_OFFSET*2);
- mnChannelPixTop = (nCalcHeight/2)-SLIDER_CHANNEL_HALFSIZE;
- mnChannelPixBottom = mnChannelPixTop+SLIDER_CHANNEL_SIZE-1;
+ mnThumbPixOffset = SLIDER_THUMB_HALFSIZE;
+ mnThumbPixRange = nCalcWidth-(SLIDER_THUMB_HALFSIZE*2);
+ mnThumbPixPos = 0;
+ mnChannelPixOffset = SLIDER_CHANNEL_OFFSET;
+ mnChannelPixRange = nCalcWidth-(SLIDER_CHANNEL_OFFSET*2);
+ mnChannelPixTop = (nCalcHeight/2)-SLIDER_CHANNEL_HALFSIZE;
+ mnChannelPixBottom = mnChannelPixTop+SLIDER_CHANNEL_SIZE-1;
}
else
{
@@ -355,9 +355,9 @@ void Slider::ImplCalc( sal_Bool bUpdate )
(nOldChannelPixRange != mnChannelPixRange) ||
(nOldChannelPixTop != mnChannelPixTop) ||
(nOldChannelPixBottom != mnChannelPixBottom) )
- bInvalidateAll = sal_True;
+ bInvalidateAll = TRUE;
- mbCalcSize = sal_False;
+ mbCalcSize = FALSE;
}
if ( mnThumbPixRange )
@@ -366,33 +366,33 @@ void Slider::ImplCalc( sal_Bool bUpdate )
if ( bUpdate && bInvalidateAll )
{
Invalidate();
- bUpdate = sal_False;
+ bUpdate = FALSE;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void Slider::ImplDraw( sal_uInt16 nDrawFlags )
+void Slider::ImplDraw( USHORT nDrawFlags )
{
- DecorationView aDecoView( this );
- sal_uInt16 nStyle;
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_Bool bEnabled = IsEnabled();
+ DecorationView aDecoView( this );
+ USHORT nStyle;
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ BOOL bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( sal_False );
+ ImplCalc( 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 );
SliderValue sldValue;
-
+
sldValue.mnMin = mnMinRange;
sldValue.mnMax = mnMaxRange;
sldValue.mnCur = mnThumbPos;
sldValue.maThumbRect = maThumbRect;
-
+
if( IsMouseOver() )
{
if( maThumbRect.IsInside( GetPointerPosPixel() ) )
@@ -407,8 +407,8 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags )
if ( (nDrawFlags & SLIDER_DRAW_CHANNEL1) && !maChannel1Rect.IsEmpty() )
{
- long nRectSize;
- Rectangle aRect = maChannel1Rect;
+ long nRectSize;
+ Rectangle aRect = maChannel1Rect;
SetLineColor( rStyleSettings.GetShadowColor() );
if ( GetStyle() & WB_HORZ )
{
@@ -451,8 +451,8 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags )
if ( (nDrawFlags & SLIDER_DRAW_CHANNEL2) && !maChannel2Rect.IsEmpty() )
{
- long nRectSize;
- Rectangle aRect = maChannel2Rect;
+ long nRectSize;
+ Rectangle aRect = maChannel2Rect;
SetLineColor( rStyleSettings.GetLightColor() );
if ( GetStyle() & WB_HORZ )
{
@@ -513,45 +513,45 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags )
// -----------------------------------------------------------------------
-sal_Bool Slider::ImplIsPageUp( const Point& rPos )
+BOOL Slider::ImplIsPageUp( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel1Rect;
if ( GetStyle() & WB_HORZ )
{
- aRect.Top() = 0;
- aRect.Bottom() = aSize.Height()-1;
+ aRect.Top() = 0;
+ aRect.Bottom() = aSize.Height()-1;
}
else
{
- aRect.Left() = 0;
- aRect.Right() = aSize.Width()-1;
+ aRect.Left() = 0;
+ aRect.Right() = aSize.Width()-1;
}
return aRect.IsInside( rPos );
}
// -----------------------------------------------------------------------
-sal_Bool Slider::ImplIsPageDown( const Point& rPos )
+BOOL Slider::ImplIsPageDown( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel2Rect;
if ( GetStyle() & WB_HORZ )
{
- aRect.Top() = 0;
- aRect.Bottom() = aSize.Height()-1;
+ aRect.Top() = 0;
+ aRect.Bottom() = aSize.Height()-1;
}
else
{
- aRect.Left() = 0;
- aRect.Right() = aSize.Width()-1;
+ aRect.Left() = 0;
+ aRect.Right() = aSize.Width()-1;
}
return aRect.IsInside( rPos );
}
// -----------------------------------------------------------------------
-long Slider::ImplSlide( long nNewPos, sal_Bool bCallEndSlide )
+long Slider::ImplSlide( long nNewPos, BOOL bCallEndSlide )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -569,7 +569,7 @@ long Slider::ImplSlide( long nNewPos, sal_Bool bCallEndSlide )
// -----------------------------------------------------------------------
-long Slider::ImplDoAction( sal_Bool bCallEndSlide )
+long Slider::ImplDoAction( BOOL bCallEndSlide )
{
long nDelta = 0;
@@ -603,17 +603,17 @@ long Slider::ImplDoAction( sal_Bool bCallEndSlide )
// -----------------------------------------------------------------------
-void Slider::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
+void Slider::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
{
- sal_uInt16 nOldStateFlags = mnStateFlags;
- sal_Bool bAction = sal_False;
+ USHORT nOldStateFlags = mnStateFlags;
+ BOOL bAction = FALSE;
switch ( meScrollType )
- {
+ {
case( SCROLL_SET ):
{
const bool bUp = ImplIsPageUp( rMousePos ), bDown = ImplIsPageDown( rMousePos );
-
+
if ( bUp || bDown )
{
bAction = bCallAction;
@@ -623,7 +623,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN );
break;
}
-
+
case SCROLL_PAGEUP:
if ( ImplIsPageUp( rMousePos ) )
{
@@ -649,7 +649,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
if ( bAction )
{
- if ( ImplDoAction( sal_False ) )
+ if ( ImplDoAction( 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, sal_True );
+ long nDelta = ImplSlide( nNewPos, TRUE );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -686,7 +686,7 @@ long Slider::ImplDoSlideAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( sal_True );
+ long nDelta = ImplDoAction( TRUE );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -697,14 +697,14 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() )
{
- const Point& rMousePos = rMEvt.GetPosPixel();
- sal_uInt16 nTrackFlags = 0;
+ const Point& rMousePos = rMEvt.GetPosPixel();
+ USHORT nTrackFlags = 0;
if ( maThumbRect.IsInside( rMousePos ) )
{
- nTrackFlags = 0;
- meScrollType = SCROLL_DRAG;
- mnDragDraw = SLIDER_DRAW_THUMB;
+ nTrackFlags = 0;
+ meScrollType = SCROLL_DRAG;
+ mnDragDraw = SLIDER_DRAW_THUMB;
// Zusaetzliche Daten berechnen
Point aCenterPos = maThumbRect.Center();
@@ -712,6 +712,13 @@ 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 ) )
{
@@ -722,7 +729,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
nTrackFlags = STARTTRACK_BUTTONREPEAT;
meScrollType = SCROLL_PAGEUP;
}
-
+
mnDragDraw = SLIDER_DRAW_CHANNEL;
}
else if ( ImplIsPageDown( rMousePos ) )
@@ -734,7 +741,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
nTrackFlags = STARTTRACK_BUTTONREPEAT;
meScrollType = SCROLL_PAGEDOWN;
}
-
+
mnDragDraw = SLIDER_DRAW_CHANNEL;
}
@@ -745,7 +752,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
mnStartPos = mnThumbPos;
ImplDoMouseAction( rMousePos, meScrollType != SCROLL_SET );
Update();
-
+
if( meScrollType != SCROLL_SET )
StartTracking( nTrackFlags );
}
@@ -759,15 +766,15 @@ void Slider::MouseButtonUp( const MouseEvent& )
if( SCROLL_SET == meScrollType )
{
// Button und PageRect-Status wieder herstellen
- const sal_uInt16 nOldStateFlags = mnStateFlags;
-
+ const USHORT nOldStateFlags = mnStateFlags;
+
mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN | SLIDER_STATE_THUMB_DOWN );
-
+
if ( nOldStateFlags != mnStateFlags )
ImplDraw( mnDragDraw );
-
+
mnDragDraw = 0;
- ImplDoAction( sal_True );
+ ImplDoAction( TRUE );
meScrollType = SCROLL_DONTKNOW;
}
}
@@ -779,7 +786,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- sal_uInt16 nOldStateFlags = mnStateFlags;
+ USHORT nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN |
SLIDER_STATE_THUMB_DOWN);
if ( nOldStateFlags != mnStateFlags )
@@ -916,9 +923,9 @@ void Slider::Paint( const Rectangle& )
void Slider::Resize()
{
Control::Resize();
- mbCalcSize = sal_True;
+ mbCalcSize = TRUE;
if ( IsReallyVisible() )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
Invalidate();
}
@@ -936,17 +943,17 @@ void Slider::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( sal_True );
+ ImplCalc( TRUE );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( sal_False );
+ ImplCalc( FALSE );
Invalidate();
}
}
@@ -962,8 +969,8 @@ void Slider::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SLIDER_VIEW_STYLE) !=
(GetStyle() & SLIDER_VIEW_STYLE) )
{
- mbCalcSize = sal_True;
- ImplCalc( sal_False );
+ mbCalcSize = TRUE;
+ ImplCalc( FALSE );
Invalidate();
}
}
@@ -1069,13 +1076,13 @@ Size Slider::CalcWindowSizePixel()
Size aSize;
if ( GetStyle() & WB_HORZ )
{
- aSize.Width() = nWidth;
- aSize.Height() = nHeight;
+ aSize.Width() = nWidth;
+ aSize.Height() = nHeight;
}
else
{
- aSize.Height() = nWidth;
- aSize.Width() = nHeight;
+ aSize.Height() = nWidth;
+ aSize.Width() = nHeight;
}
return aSize;
}
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 50265e911f80..703733cdf2c5 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,10 +37,10 @@
void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
{
- mbUpperIn = sal_False;
- mbLowerIn = sal_False;
- mbInitialUp = sal_False;
- mbInitialDown = sal_False;
+ mbUpperIn = FALSE;
+ mbLowerIn = FALSE;
+ mbInitialUp = FALSE;
+ mbInitialDown = 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 = sal_True;
+ mbHorz = TRUE;
else
- mbHorz = sal_False;
+ mbHorz = 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( sal_False )
+ ,mbUpperIsFocused( 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( sal_False )
+ ,mbUpperIsFocused( FALSE )
{
rResId.SetRT( RSC_SPINBUTTON );
ImplInit( pParent, ImplInitRes( rResId ) );
@@ -116,7 +116,7 @@ void SpinButton::Up()
mnValue += mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( sal_True );
+ ImplMoveFocus( TRUE );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_UP, maUpHdlLink, this );
@@ -131,7 +131,7 @@ void SpinButton::Down()
mnValue -= mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( sal_False );
+ ImplMoveFocus( FALSE );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_DOWN, maDownHdlLink, this );
@@ -164,11 +164,11 @@ void SpinButton::Resize()
// -----------------------------------------------------------------------
-void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
-
+
pDev->Push();
pDev->SetMapMode();
if ( !(nFlags & WINDOW_DRAW_MONO) )
@@ -201,9 +201,9 @@ void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aUpperRect += aPos;
aLowerRect += aPos;
- ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, sal_False, sal_False,
+ ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, FALSE, FALSE,
IsEnabled() && ImplIsUpperEnabled(),
- IsEnabled() && ImplIsLowerEnabled(), mbHorz, sal_True );
+ IsEnabled() && ImplIsLowerEnabled(), mbHorz, TRUE );
pDev->Pop();
}
@@ -212,10 +212,10 @@ void SpinButton::Paint( const Rectangle& )
{
HideFocus();
- sal_Bool bEnable = IsEnabled();
+ BOOL bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect, mbUpperIn, mbLowerIn,
bEnable && ImplIsUpperEnabled(),
- bEnable && ImplIsLowerEnabled(), mbHorz, sal_True );
+ bEnable && ImplIsLowerEnabled(), mbHorz, TRUE );
if ( HasFocus() )
ShowFocus( maFocusRect );
@@ -227,14 +227,14 @@ void SpinButton::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsUpperEnabled() ) )
{
- mbUpperIn = sal_True;
- mbInitialUp = sal_True;
+ mbUpperIn = TRUE;
+ mbInitialUp = TRUE;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsLowerEnabled() ) )
{
- mbLowerIn = sal_True;
- mbInitialDown = sal_True;
+ mbLowerIn = TRUE;
+ mbInitialDown = TRUE;
Invalidate( maLowerRect );
}
@@ -260,20 +260,20 @@ void SpinButton::MouseButtonUp( const MouseEvent& )
if ( mbUpperIn )
{
- mbUpperIn = sal_False;
+ mbUpperIn = FALSE;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = sal_False;
+ mbLowerIn = FALSE;
Invalidate( maLowerRect );
Update();
Down();
}
- mbInitialUp = mbInitialDown = sal_False;
+ mbInitialUp = mbInitialDown = FALSE;
}
// -----------------------------------------------------------------------
@@ -286,7 +286,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
if ( !maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
mbUpperIn && mbInitialUp )
{
- mbUpperIn = sal_False;
+ mbUpperIn = 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 = sal_False;
+ mbLowerIn = 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 = sal_True;
+ mbUpperIn = 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 = sal_True;
+ mbLowerIn = TRUE;
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maLowerRect );
@@ -323,6 +323,8 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
void SpinButton::KeyInput( const KeyEvent& rKEvt )
{
+ KeyCode aCode = rKEvt.GetKeyCode();
+
if ( !rKEvt.GetKeyCode().GetModifier() )
{
switch ( rKEvt.GetKeyCode().GetCode() )
@@ -330,7 +332,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_LEFT:
case KEY_RIGHT:
{
- sal_Bool bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
+ BOOL bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
if ( mbHorz && !ImplMoveFocus( bUp ) )
bUp ? Up() : Down();
}
@@ -339,7 +341,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_UP:
case KEY_DOWN:
{
- sal_Bool bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
+ BOOL bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
if ( !mbHorz && !ImplMoveFocus( KEY_UP == rKEvt.GetKeyCode().GetCode() ) )
bUp ? Up() : Down();
}
@@ -371,7 +373,7 @@ void SpinButton::StateChanged( StateChangedType nType )
case STATE_CHANGE_STYLE:
{
- sal_Bool bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
+ BOOL bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
if ( bNewRepeat != mbRepeat )
{
if ( maRepeatTimer.IsActive() )
@@ -382,7 +384,7 @@ void SpinButton::StateChanged( StateChangedType nType )
mbRepeat = bNewRepeat;
}
- sal_Bool bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
+ BOOL bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
if ( bNewHorz != mbHorz )
{
mbHorz = bNewHorz;
@@ -471,21 +473,21 @@ void SpinButton::LoseFocus()
// -----------------------------------------------------------------------
-sal_Bool SpinButton::ImplMoveFocus( sal_Bool _bUpper )
+BOOL SpinButton::ImplMoveFocus( BOOL _bUpper )
{
if ( _bUpper == mbUpperIsFocused )
- return sal_False;
+ return FALSE;
HideFocus();
ImplCalcFocusRect( _bUpper );
if ( HasFocus() )
ShowFocus( maFocusRect );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-void SpinButton::ImplCalcFocusRect( sal_Bool _bUpper )
+void SpinButton::ImplCalcFocusRect( 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 904c684b1fdd..628b2e8c2710 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,8 +41,8 @@
void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- sal_Bool bUpperIn, sal_Bool bLowerIn,
- sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz,
+ BOOL bUpperIn, BOOL bLowerIn,
+ BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz,
SpinbuttonValue& rValue )
{
// convert spinbutton data to a SpinbuttonValue structure for native painting
@@ -81,15 +81,15 @@ void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
}
-sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
if( pWin->IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) &&
// there is just no useful native support for spinfields with dropdown
!(pWin->GetStyle() & WB_DROPDOWN) )
{
- if( pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnUpperPart) &&
+ if( pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnUpperPart) &&
pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnLowerPart) )
{
// only paint the embedded spin buttons, all buttons are painted at once
@@ -121,7 +121,7 @@ sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbutt
{
aSize = aContent.GetSize();
}
-
+
Rectangle aRgn( aPt, aSize );
bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED,
rSpinbuttonValue, rtl::OUString() );
@@ -132,9 +132,9 @@ sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbutt
return bNativeOK;
}
-sal_Bool ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) )
{
@@ -148,13 +148,13 @@ sal_Bool ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbu
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- sal_Bool bUpperIn, sal_Bool bLowerIn,
- sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz, sal_Bool bMirrorHorz )
+ BOOL bUpperIn, BOOL bLowerIn,
+ BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz, BOOL bMirrorHorz )
{
DecorationView aDecoView( pOutDev );
- sal_uInt16 nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
- sal_uInt16 nSymStyle = 0;
+ USHORT nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
+ USHORT nSymStyle = 0;
SymbolType eType1, eType2;
@@ -188,11 +188,11 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
}
// Oberen/linken Button malen
- sal_uInt16 nTempStyle = nStyle;
+ USHORT nTempStyle = nStyle;
if ( bUpperIn )
nTempStyle |= BUTTON_DRAW_PRESSED;
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
Rectangle aUpRect;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
@@ -297,15 +297,15 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
void SpinField::ImplInitSpinFieldData()
{
- mpEdit = NULL;
- mbSpin = sal_False;
- mbRepeat = sal_False;
- mbUpperIn = sal_False;
- mbLowerIn = sal_False;
- mbInitialUp = sal_False;
- mbInitialDown = sal_False;
- mbNoSelect = sal_False;
- mbInDropDown = sal_False;
+ mpEdit = NULL;
+ mbSpin = FALSE;
+ mbRepeat = FALSE;
+ mbUpperIn = FALSE;
+ mbLowerIn = FALSE;
+ mbInitialUp = FALSE;
+ mbInitialDown = FALSE;
+ mbNoSelect = FALSE;
+ mbInDropDown = FALSE;
}
// --------------------------------------------------------------------
@@ -316,12 +316,12 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
if ( nWinStyle & (WB_SPIN|WB_DROPDOWN) )
{
- mbSpin = sal_True;
-
+ mbSpin = TRUE;
+
// Some themes want external spin buttons, therefore the main
// spinfield should not overdraw the border between its encapsulated
// edit field and the spin buttons
- if ( (nWinStyle & WB_SPIN) && ImplUseNativeBorder( nWinStyle ) )
+ if ( (nWinStyle & WB_SPIN) && ImplUseNativeBorder( nWinStyle ) )
{
SetBackground();
mpEdit = new Edit( this, WB_NOBORDER );
@@ -330,7 +330,7 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
else
mpEdit = new Edit( this, WB_NOBORDER );
- mpEdit->EnableRTL( sal_False );
+ mpEdit->EnableRTL( 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 = sal_True;
+ mbRepeat = TRUE;
- SetCompoundControl( sal_True );
+ SetCompoundControl( TRUE );
}
}
@@ -417,7 +417,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( !HasFocus() && ( !mpEdit || !mpEdit->HasFocus() ) )
{
- mbNoSelect = sal_True;
+ mbNoSelect = TRUE;
GrabFocus();
}
@@ -425,20 +425,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbUpperIn = sal_True;
- mbInitialUp = sal_True;
+ mbUpperIn = TRUE;
+ mbInitialUp = TRUE;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbLowerIn = sal_True;
- mbInitialDown = sal_True;
+ mbLowerIn = TRUE;
+ mbInitialDown = TRUE;
Invalidate( maLowerRect );
}
else if ( maDropDownRect.IsInside( rMEvt.GetPosPixel() ) )
{
// Rechts daneben liegt der DropDownButton:
- mbInDropDown = ShowDropDown( mbInDropDown ? sal_False : sal_True );
+ mbInDropDown = ShowDropDown( mbInDropDown ? FALSE : TRUE );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
@@ -460,20 +460,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
void SpinField::MouseButtonUp( const MouseEvent& rMEvt )
{
ReleaseMouse();
- mbInitialUp = mbInitialDown = sal_False;
+ mbInitialUp = mbInitialDown = FALSE;
maRepeatTimer.Stop();
maRepeatTimer.SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
if ( mbUpperIn )
{
- mbUpperIn = sal_False;
+ mbUpperIn = FALSE;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = sal_False;
+ mbLowerIn = FALSE;
Invalidate( maLowerRect );
Update();
Down();
@@ -490,7 +490,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
{
if ( mbInitialUp )
{
- sal_Bool bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
+ BOOL bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
if ( bNewUpperIn != mbUpperIn )
{
if ( bNewUpperIn )
@@ -508,7 +508,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
}
else if ( mbInitialDown )
{
- sal_Bool bNewLowerIn = maLowerRect.IsInside( rMEvt.GetPosPixel() );
+ 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() )
{
- sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier();
+ USHORT 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( sal_True );
+ mbInDropDown = ShowDropDown( TRUE );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
nDone = 1;
}
@@ -592,7 +592,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
{
if ( ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) && !IsReadOnly() )
{
- sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ USHORT 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 )
{
- sal_Bool bEnable = IsEnabled();
+ BOOL bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
mbUpperIn, mbLowerIn, bEnable, bEnable );
}
@@ -653,7 +653,7 @@ void SpinField::Paint( const Rectangle& rRect )
{
DecorationView aView( this );
- sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ USHORT nStyle = BUTTON_DRAW_NOLIGHTBORDER;
if ( mbInDropDown )
nStyle |= BUTTON_DRAW_PRESSED;
Rectangle aInnerRect = aView.DrawButton( maDropDownRect, nStyle );
@@ -696,10 +696,11 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
long nBottom1 = aSize.Height()/2;
long nBottom2 = aSize.Height()-1;
long nTop2 = nBottom1;
+ long nTop1 = 0;
if ( !(aSize.Height() & 0x01) )
nBottom1--;
- sal_Bool bNativeRegionOK = sal_False;
+ BOOL bNativeRegionOK = FALSE;
Rectangle aContentUp, aContentDown;
if ( (pDev->GetOutDevType() == OUTDEV_WINDOW) &&
@@ -718,12 +719,12 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
// use the full extent of the control
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
- bNativeRegionOK =
+ bNativeRegionOK =
pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_UP,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContentUp) &&
pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_DOWN,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContentDown);
-
+
if( bNativeRegionOK )
{
// convert back from border space to local coordinates
@@ -740,7 +741,6 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
}
else
{
- long nTop1 = 0;
aSize.Width() -= CalcZoom( GetDrawPixel( pDev, rStyleSettings.GetSpinSize() ) );
rSpinUpArea = Rectangle( aSize.Width(), nTop1, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 );
@@ -771,7 +771,7 @@ void SpinField::Resize()
ImplControlValue aControlValue;
Point aPoint;
Rectangle aContent, aBound;
-
+
// use the full extent of the control
Window *pBorder = GetWindow( WINDOW_BORDER );
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
@@ -839,9 +839,9 @@ void SpinField::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
if ( GetStyle() & WB_REPEAT )
- mbRepeat = sal_True;
+ mbRepeat = TRUE;
else
- mbRepeat = sal_False;
+ mbRepeat = FALSE;
}
else if ( nType == STATE_CHANGE_ZOOM )
{
@@ -854,21 +854,21 @@ void SpinField::StateChanged( StateChangedType nType )
{
if ( mpEdit )
mpEdit->SetControlFont( GetControlFont() );
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
if ( mpEdit )
mpEdit->SetControlForeground( GetControlForeground() );
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
if ( mpEdit )
mpEdit->SetControlBackground( GetControlBackground() );
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
else if( nType == STATE_CHANGE_MIRRORING )
@@ -959,15 +959,15 @@ long SpinField::PreNotify( NotifyEvent& rNEvt )
void SpinField::EndDropDown()
{
- mbInDropDown = sal_False;
+ mbInDropDown = FALSE;
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
// -----------------------------------------------------------------------
-sal_Bool SpinField::ShowDropDown( sal_Bool )
+BOOL SpinField::ShowDropDown( BOOL )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -998,7 +998,7 @@ Size SpinField::GetOptimalSize(WindowSizeType eType) const
// -----------------------------------------------------------------------
-Size SpinField::CalcSize( sal_uInt16 nChars ) const
+Size SpinField::CalcSize( USHORT 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, sal_uLong nFlags )
+void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 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 );
- sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ USHORT 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, sal_False, sal_False, sal_True, sal_True );
+ ImplDrawSpinButton( pDev, aUp, aDown, FALSE, FALSE, TRUE, TRUE );
}
pDev->Pop();
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index bb60e7e5eea9..a8ad1ea3de2e 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,32 +43,33 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
+#include "vcl/smartid.hxx"
#include "vcl/window.h"
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <vector>
// =======================================================================
struct ImplTabItem
{
- sal_uInt16 mnId;
- sal_uInt16 mnTabPageResId;
+ USHORT mnId;
+ USHORT mnTabPageResId;
TabPage* mpTabPage;
String maText;
String maFormatText;
String maHelpText;
- rtl::OString maHelpId;
+ ULONG mnHelpId;
Rectangle maRect;
- sal_uInt16 mnLine;
+ USHORT mnLine;
bool mbFullVisible;
bool mbEnabled;
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
- mnLine( 0 ), mbFullVisible( sal_False ), mbEnabled( true )
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
+ mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
{}
};
@@ -76,9 +77,11 @@ struct ImplTabItem
struct ImplTabCtrlData
{
- boost::unordered_map< int, int > maLayoutPageIdToLine;
- boost::unordered_map< int, int > maLayoutLineToPageId;
- std::vector< Rectangle > maTabRectangles;
+ PushButton* mpLeftBtn;
+ PushButton* mpRightBtn;
+ std::hash_map< int, int > maLayoutPageIdToLine;
+ std::hash_map< int, int > maLayoutLineToPageId;
+ std::vector< Rectangle > maTabRectangles;
Point maItemsOffset; // offset of the tabitems
std::vector< ImplTabItem > maItemList;
ListBox* mpListBox;
@@ -110,24 +113,34 @@ 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;
- mnLastHeight = 0;
- mnBtnSize = 0;
- mnMaxPageWidth = 0;
- mnActPageId = 0;
- mnCurPageId = 0;
- mbFormat = sal_True;
- mbRestoreHelpId = sal_False;
- mbRestoreUnqId = sal_False;
- mbSmallInvalidate = sal_False;
- mbExtraSpace = sal_False;
+ mnLastWidth = 0;
+ mnLastHeight = 0;
+ mnBtnSize = 0;
+ 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;
mpTabCtrlData = new ImplTabCtrlData;
+ mpTabCtrlData->mpLeftBtn = NULL;
+ mpTabCtrlData->mpRightBtn = NULL;
mpTabCtrlData->mpListBox = NULL;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
if( (nStyle & WB_DROPDOWN) )
{
@@ -140,8 +153,8 @@ 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( sal_True );
-
+ EnableChildTransparentMode( TRUE );
+
if ( pParent->IsDialog() )
pParent->AddChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) );
}
@@ -161,20 +174,8 @@ const Color& TabControl::GetCanonicalTextColor( const StyleSettings& _rStyle ) c
// -----------------------------------------------------------------------
-WinBits TabControl::ImplInitStyle( WinBits nStyle )
-{
- if ( !(nStyle & WB_NOTABSTOP) )
- nStyle |= WB_TABSTOP;
- if ( !(nStyle & WB_NOGROUP) )
- nStyle |= WB_GROUP;
-
- return nStyle;
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void TabControl::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -189,17 +190,17 @@ void TabControl::ImplInitSettings( sal_Bool bFont,
{
// set transparent mode for NWF tabcontrols to have
// the background always cleared properly
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -207,6 +208,8 @@ void TabControl::ImplInitSettings( sal_Bool bFont,
SetBackground( pParent->GetBackground() );
}
}
+
+ ImplScrollBtnsColor();
}
// -----------------------------------------------------------------------
@@ -227,7 +230,6 @@ TabControl::TabControl( Window* pParent, WinBits nStyle ) :
Control( WINDOW_TABCONTROL )
{
ImplInit( pParent, nStyle );
- OSL_TRACE("*** TABCONTROL no notabs? %s", ( GetStyle() & WB_NOBORDER ) ? "true" : "false" );
}
// -----------------------------------------------------------------------
@@ -250,14 +252,14 @@ void TabControl::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if ( nObjMask & RSC_TABCONTROL_ITEMLIST )
{
- sal_uLong nEle = ReadLongRes();
+ ULONG nEle = ReadLongRes();
// Item hinzufuegen
- for( sal_uLong i = 0; i < nEle; i++ )
+ for( ULONG i = 0; i < nEle; i++ )
{
InsertPage( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -279,13 +281,17 @@ 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( sal_uInt16 nId ) const
+ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
{
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
@@ -299,6 +305,74 @@ ImplTabItem* TabControl::ImplGetItem( sal_uInt16 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;
@@ -366,7 +440,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
// -----------------------------------------------------------------------
-Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight )
+Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight )
{
Size aWinSize = Control::GetOutputSizePixel();
if ( nWidth < 0 )
@@ -385,7 +459,7 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
if ( nItemPos == TAB_PAGERECT )
{
- sal_uInt16 nLastPos;
+ USHORT nLastPos;
if ( mnCurPageId )
nLastPos = GetPagePos( mnCurPageId );
else
@@ -409,9 +483,9 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
{
Font aFont( GetFont() );
Font aLightFont = aFont;
- aFont.SetTransparent( sal_True );
+ aFont.SetTransparent( TRUE );
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
- aLightFont.SetTransparent( sal_True );
+ aLightFont.SetTransparent( TRUE );
aLightFont.SetWeight( WEIGHT_LIGHT );
// If Bold and none Bold strings have the same width, we
@@ -431,16 +505,18 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
long nX = nOffsetX;
long nY = nOffsetY;
long nMaxWidth = nWidth;
- sal_uInt16 nPos = 0;
+ USHORT nPos = 0;
if ( (mnMaxPageWidth > 0) && (mnMaxPageWidth < nMaxWidth) )
nMaxWidth = mnMaxPageWidth;
nMaxWidth -= GetItemsOffset().X();
- sal_uInt16 nLines = 0;
- sal_uInt16 nCurLine = 0;
+ mbScroll = FALSE;
+
+ USHORT nLines = 0;
+ USHORT nCurLine = 0;
long nLineWidthAry[100];
- sal_uInt16 nLinePosAry[101];
+ USHORT nLinePosAry[101];
nLineWidthAry[0] = 0;
nLinePosAry[0] = 0;
@@ -463,10 +539,10 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
Rectangle aNewRect( Point( nX, nY ), aSize );
if ( mbSmallInvalidate && (it->maRect != aNewRect) )
- mbSmallInvalidate = sal_False;
+ mbSmallInvalidate = FALSE;
it->maRect = aNewRect;
it->mnLine = nLines;
- it->mbFullVisible = sal_True;
+ it->mbFullVisible = TRUE;
nLineWidthAry[nLines] += aSize.Width();
nX += aSize.Width();
@@ -482,8 +558,8 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
long nDX = 0;
long nModDX = 0;
long nIDX = 0;
- sal_uInt16 i;
- sal_uInt16 n;
+ USHORT i;
+ USHORT n;
long nLineHeightAry[100];
long nIH = mpTabCtrlData->maItemList[0].maRect.Bottom()-2;
@@ -499,7 +575,7 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
i = 0;
n = 0;
- nLinePosAry[nLines+1] = (sal_uInt16)mpTabCtrlData->maItemList.size();
+ nLinePosAry[nLines+1] = (USHORT)mpTabCtrlData->maItemList.size();
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
@@ -560,7 +636,9 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
mnLastWidth = nWidth;
mnLastHeight = nHeight;
- mbFormat = sal_False;
+ mbFormat = FALSE;
+
+ ImplPosScrollBtns();
}
return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle();
@@ -568,7 +646,7 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
// -----------------------------------------------------------------------
-void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
+void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
{
ImplFreeLayoutData();
@@ -580,7 +658,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
if ( IsReallyVisible() && IsUpdateMode() )
{
- sal_uInt16 nPos = GetPagePos( nId );
+ USHORT nPos = GetPagePos( nId );
Rectangle aRect = ImplGetTabRect( nPos );
if ( !pOldItem || (pOldItem->mnLine != pItem->mnLine) )
@@ -612,40 +690,41 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( rtl::OString() );
+ pCtrlParent->SetHelpId( 0 );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( rtl::OString() );
+ pCtrlParent->SetUniqueId( 0 );
+ if( mbRestoreSmartId )
+ pCtrlParent->SetSmartHelpId( SmartId() );
pOldPage->DeactivatePage();
}
if ( pPage )
{
- if ( ( GetStyle() & WB_NOBORDER ) )
- {
- Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
- pPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
- }
- else
- pPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
+ pPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
// 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().getLength() )
+ if ( !GetHelpId() )
{
- mbRestoreHelpId = sal_True;
+ mbRestoreHelpId = TRUE;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId().getLength() )
+ if ( !pCtrlParent->GetUniqueId() )
{
- mbRestoreUnqId = sal_True;
+ mbRestoreUnqId = TRUE;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
+ if( ! GetSmartHelpId().HasAny() )
+ {
+ mbRestoreSmartId = TRUE;
+ pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
+ }
pPage->ActivatePage();
if ( pOldPage && pOldPage->HasChildPathFocus() )
{
- sal_uInt16 n = 0;
+ USHORT n = 0;
Window* pFirstChild = pPage->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus( GETFOCUS_INIT );
@@ -675,31 +754,25 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
// -----------------------------------------------------------------------
-sal_Bool TabControl::ImplPosCurTabPage()
+BOOL TabControl::ImplPosCurTabPage()
{
// Aktuelle TabPage resizen/positionieren
ImplTabItem* pItem = ImplGetItem( GetCurPageId() );
if ( pItem && pItem->mpTabPage )
{
- if ( ( GetStyle() & WB_NOBORDER ) )
- {
- Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
- pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
- return sal_True;
- }
Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
pItem->mpTabPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void TabControl::ImplActivateTabPage( sal_Bool bNext )
+void TabControl::ImplActivateTabPage( BOOL bNext )
{
- sal_uInt16 nCurPos = GetPagePos( GetCurPageId() );
+ USHORT nCurPos = GetPagePos( GetCurPageId() );
if ( bNext )
nCurPos = (nCurPos + 1) % GetPageCount();
@@ -716,6 +789,13 @@ void TabControl::ImplActivateTabPage( sal_Bool bNext )
// -----------------------------------------------------------------------
+void TabControl::ImplSetFirstPagePos( USHORT )
+{
+ return; // was only required for single line
+}
+
+// -----------------------------------------------------------------------
+
void TabControl::ImplShowFocus()
{
if ( !GetPageCount() || mpTabCtrlData->mpListBox )
@@ -729,14 +809,14 @@ void TabControl::ImplShowFocus()
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
- sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
+ USHORT 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 );
- sal_uInt16 nOff;
+ USHORT nOff;
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -798,13 +878,13 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
Rectangle aRect = pItem->maRect;
long nLeftBottom = aRect.Bottom();
long nRightBottom = aRect.Bottom();
- sal_Bool bLeftBorder = sal_True;
- sal_Bool bRightBorder = sal_True;
- sal_uInt16 nOff;
- sal_Bool bNativeOK = sal_False;
+ BOOL bLeftBorder = TRUE;
+ BOOL bRightBorder = TRUE;
+ USHORT nOff;
+ BOOL bNativeOK = FALSE;
- sal_uInt16 nOff2 = 0;
- sal_uInt16 nOff3 = 0;
+ USHORT nOff2 = 0;
+ USHORT nOff3 = 0;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -826,10 +906,10 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
{
aLeftTestPos.X() -= 2;
if ( rCurRect.IsInside( aLeftTestPos ) )
- bLeftBorder = sal_False;
+ bLeftBorder = FALSE;
aRightTestPos.X() += 2;
if ( rCurRect.IsInside( aRightTestPos ) )
- bRightBorder = sal_False;
+ bRightBorder = FALSE;
}
else
{
@@ -840,10 +920,10 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
}
}
- if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == sal_True )
+ if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == TRUE )
{
Rectangle aCtrlRegion( pItem->maRect );
- ControlState nState = 0;
+ ControlState nState = 0;
if( pItem->mnId == mnCurPageId )
{
@@ -939,7 +1019,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( sal_True );
+ aFont.SetTransparent( TRUE );
aFont.SetWeight( ((bIsCurrentItem) && (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus)) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
@@ -957,7 +1037,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
long nYPos = aRect.Top()+((aTabSize.Height()-nTextHeight)/2)-nOff3;
if( pItem->maFormatText.Len() )
{
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC;
+ USHORT nStyle = TEXT_DRAW_MNEMONIC;
if( ! pItem->mbEnabled )
nStyle |= TEXT_DRAW_DISABLE;
DrawCtrlText( Point( nXPos + aImageSize.Width(), nYPos ),
@@ -982,11 +1062,11 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
long nRet = 0;
-
+
if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKeyEvent.GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
if ( aKeyCode.IsMod1() )
{
@@ -994,7 +1074,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEUP) )
{
- ImplActivateTabPage( sal_False );
+ ImplActivateTabPage( FALSE );
nRet = 1;
}
}
@@ -1002,19 +1082,27 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEDOWN) )
{
- ImplActivateTabPage( sal_True );
+ ImplActivateTabPage( TRUE );
nRet = 1;
}
}
}
- }
-
+ }
+
return nRet;
}
// -----------------------------------------------------------------------
+IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG )
+{
+ ImplSetScrollBtnsState();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
{
SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) );
@@ -1047,7 +1135,7 @@ void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
{
if( rMEvt.IsLeft() )
{
- sal_uInt16 nPageId = GetPageId( rMEvt.GetPosPixel() );
+ USHORT nPageId = GetPageId( rMEvt.GetPosPixel() );
ImplTabItem* pItem = ImplGetItem( nPageId );
if( pItem && pItem->mbEnabled )
SelectTabPage( nPageId );
@@ -1064,11 +1152,11 @@ void TabControl::KeyInput( const KeyEvent& rKEvt )
else if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_LEFT) || (nKeyCode == KEY_RIGHT) )
{
- sal_Bool bNext = (nKeyCode == KEY_RIGHT);
+ BOOL bNext = (nKeyCode == KEY_RIGHT);
ImplActivateTabPage( bNext );
}
}
@@ -1080,8 +1168,7 @@ void TabControl::KeyInput( const KeyEvent& rKEvt )
void TabControl::Paint( const Rectangle& rRect )
{
- if ( !( GetStyle() & WB_NOBORDER ) )
- ImplPaint( rRect, false );
+ ImplPaint( rRect, false );
}
// -----------------------------------------------------------------------
@@ -1109,6 +1196,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
// Draw the TabPage border
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aCurRect;
+ long nTopOff = 1;
aRect.Left() -= TAB_OFFSET;
aRect.Top() -= TAB_OFFSET;
aRect.Right() += TAB_OFFSET;
@@ -1118,17 +1206,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)
- sal_Bool bNoTabPage = sal_False;
+ BOOL bNoTabPage = FALSE;
TabPage* pCurPage = (pCurItem) ? pCurItem->mpTabPage : NULL;
if( !pCurPage || !pCurPage->IsVisible() )
{
- bNoTabPage = sal_True;
+ bNoTabPage = TRUE;
aRect.Left()-=10;
aRect.Right()+=10;
}
- sal_Bool bNativeOK = sal_False;
- if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == sal_True )
+ BOOL bNativeOK = FALSE;
+ if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == TRUE )
{
const ImplControlValue aControlValue;
@@ -1150,7 +1238,6 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
}
else
{
- long nTopOff = 1;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
SetLineColor( rStyleSettings.GetLightColor() );
else
@@ -1209,9 +1296,9 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
{
// Some native toolkits (GTK+) draw tabs right-to-left, with an
// overlap between adjacent tabs
- bool bDrawTabsRTL = IsNativeControlSupported( CTRL_TAB_ITEM, PART_TABS_DRAW_RTL );
- ImplTabItem * pFirstTab = NULL;
- ImplTabItem * pLastTab = NULL;
+ bool bDrawTabsRTL = IsNativeControlSupported( CTRL_TAB_ITEM, PART_TABS_DRAW_RTL );
+ ImplTabItem * pFirstTab = NULL;
+ ImplTabItem * pLastTab = NULL;
size_t idx;
// Event though there is a tab overlap with GTK+, the first tab is not
@@ -1239,7 +1326,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), sal_False );
+ ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), FALSE );
}
if ( bDrawTabsRTL )
@@ -1255,7 +1342,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), sal_True );
+ ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), TRUE );
}
}
@@ -1263,7 +1350,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
ImplShowFocus();
if( ! bLayout )
- mbSmallInvalidate = sal_True;
+ mbSmallInvalidate = TRUE;
}
// -----------------------------------------------------------------------
@@ -1274,7 +1361,7 @@ void TabControl::Resize()
if ( !IsReallyShown() )
return;
-
+
if( mpTabCtrlData->mpListBox )
{
// get the listbox' preferred size
@@ -1287,21 +1374,26 @@ void TabControl::Resize()
mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
}
- mbFormat = sal_True;
+ mbFormat = TRUE;
// Aktuelle TabPage resizen/positionieren
- sal_Bool bTabPage = ImplPosCurTabPage();
+ BOOL bTabPage = ImplPosCurTabPage();
// Feststellen, was invalidiert werden muss
Size aNewSize = Control::GetOutputSizePixel();
long nNewWidth = aNewSize.Width();
- for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
- it != mpTabCtrlData->maItemList.end(); ++it )
+ if ( mbScroll )
+ mbSmallInvalidate = FALSE;
+ else
{
- if ( !it->mbFullVisible ||
- (it->maRect.Right()-2 >= nNewWidth) )
+ for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
+ it != mpTabCtrlData->maItemList.end(); ++it )
{
- mbSmallInvalidate = sal_False;
- break;
+ if ( !it->mbFullVisible ||
+ (it->maRect.Right()-2 >= nNewWidth) )
+ {
+ mbSmallInvalidate = FALSE;
+ break;
+ }
}
}
@@ -1357,7 +1449,7 @@ void TabControl::LoseFocus()
void TabControl::RequestHelp( const HelpEvent& rHEvt )
{
- sal_uInt16 nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ USHORT nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -1379,13 +1471,13 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
- if ( aHelpId.getLength() )
+ ULONG nHelpId = GetHelpId( nItemId );
+ if ( nHelpId )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( aHelpId, this );
+ pHelp->Start( nHelpId, this );
return;
}
}
@@ -1446,7 +1538,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
if( (mpTabCtrlData->mpListBox == NULL) && (rCEvt.GetCommand() == COMMAND_CONTEXTMENU) && (GetPageCount() > 1) )
{
Point aMenuPos;
- sal_Bool bMenu;
+ BOOL bMenu;
if ( rCEvt.IsMouseEvent() )
{
aMenuPos = rCEvt.GetMousePosPixel();
@@ -1455,7 +1547,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
else
{
aMenuPos = ImplGetTabRect( GetPagePos( mnCurPageId ) ).Center();
- bMenu = sal_True;
+ bMenu = TRUE;
}
if ( bMenu )
@@ -1467,10 +1559,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->maHelpId );
+ aMenu.SetHelpId( it->mnId, it->mnHelpId );
}
- sal_uInt16 nId = aMenu.Execute( this, aMenuPos );
+ USHORT nId = aMenu.Execute( this, aMenuPos );
if ( nId && (nId != mnCurPageId) )
SelectTabPage( nId );
return;
@@ -1500,23 +1592,19 @@ void TabControl::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
- else if ( nType == STATE_CHANGE_STYLE )
- {
- SetStyle( ImplInitStyle( GetStyle() ) );
- }
}
// -----------------------------------------------------------------------
@@ -1530,7 +1618,7 @@ void TabControl::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
@@ -1630,7 +1718,7 @@ long TabControl::DeactivatePage()
if ( maDeactivateHdl.IsSet() )
return maDeactivateHdl.Call( this );
else
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1657,16 +1745,16 @@ Size TabControl::GetTabPageSizePixel() const
// -----------------------------------------------------------------------
-void TabControl::InsertPage( const ResId& rResId, sal_uInt16 nPos )
+void TabControl::InsertPage( const ResId& rResId, USHORT nPos )
{
GetRes( rResId.SetRT( RSC_TABCONTROLITEM ) );
- sal_uLong nObjMask = ReadLongRes();
- sal_uInt16 nItemId = 1;
+ ULONG nObjMask = ReadLongRes();
+ USHORT nItemId = 1;
// ID
if ( nObjMask & RSC_TABCONTROLITEM_ID )
- nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
+ nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
// Text
XubString aTmpStr;
@@ -1678,14 +1766,14 @@ void TabControl::InsertPage( const ResId& rResId, sal_uInt16 nPos )
if ( nObjMask & RSC_TABCONTROLITEM_PAGERESID )
{
ImplTabItem& rItem = mpTabCtrlData->maItemList[ GetPagePos( nItemId ) ];
- rItem.mnTabPageResId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
+ rItem.mnTabPageResId = sal::static_int_cast<USHORT>(ReadLongRes());
}
}
// -----------------------------------------------------------------------
-void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
- sal_uInt16 nPos )
+void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
+ USHORT nPos )
{
DBG_ASSERT( nPageId, "TabControl::InsertPage(): PageId == 0" );
DBG_ASSERT( GetPagePos( nPageId ) == TAB_PAGE_NOTFOUND,
@@ -1714,7 +1802,7 @@ void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
mpTabCtrlData->mpListBox->SelectEntryPos( 0 );
mpTabCtrlData->mpListBox->SetDropDownLineCount( mpTabCtrlData->mpListBox->GetEntryCount() );
}
-
+
// set current page id
if ( !mnCurPageId )
mnCurPageId = nPageId;
@@ -1723,10 +1811,11 @@ void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
+ pItem->mnHelpId = 0;
pItem->maText = rText;
- pItem->mbFullVisible = sal_False;
+ pItem->mbFullVisible = FALSE;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( IsUpdateMode() )
Invalidate();
@@ -1734,14 +1823,14 @@ void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
if( mpTabCtrlData->mpListBox ) // reposition/resize listbox
Resize();
- ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (sal_uLong)nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (ULONG)nPageId );
}
// -----------------------------------------------------------------------
-void TabControl::RemovePage( sal_uInt16 nPageId )
+void TabControl::RemovePage( USHORT nPageId )
{
- sal_uInt16 nPos = GetPagePos( nPageId );
+ USHORT nPos = GetPagePos( nPageId );
// does the item exist ?
if ( nPos != TAB_PAGE_NOTFOUND )
@@ -1775,13 +1864,13 @@ void TabControl::RemovePage( sal_uInt16 nPageId )
}
}
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (sal_uLong) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (ULONG) nPageId );
}
}
@@ -1797,7 +1886,7 @@ void TabControl::Clear()
ImplFreeLayoutData();
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( IsUpdateMode() )
Invalidate();
@@ -1806,14 +1895,14 @@ void TabControl::Clear()
// -----------------------------------------------------------------------
-void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable )
+void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem && pItem->mbEnabled != i_bEnable )
{
pItem->mbEnabled = i_bEnable;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SetEntryFlags( GetPagePos( i_nPageId ),
i_bEnable ? 0 : (LISTBOX_ENTRY_FLAG_DISABLE_SELECTION | LISTBOX_ENTRY_FLAG_DRAW_DISABLED) );
@@ -1829,14 +1918,14 @@ void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable )
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetPageCount() const
+USHORT TabControl::GetPageCount() const
{
- return (sal_uInt16)mpTabCtrlData->maItemList.size();
+ return (USHORT)mpTabCtrlData->maItemList.size();
}
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetPageId( sal_uInt16 nPos ) const
+USHORT TabControl::GetPageId( USHORT nPos ) const
{
if( size_t(nPos) < mpTabCtrlData->maItemList.size() )
return mpTabCtrlData->maItemList[ nPos ].mnId;
@@ -1845,13 +1934,13 @@ sal_uInt16 TabControl::GetPageId( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetPagePos( sal_uInt16 nPageId ) const
+USHORT TabControl::GetPagePos( USHORT nPageId ) const
{
for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
if ( it->mnId == nPageId )
- return (sal_uInt16)(it - mpTabCtrlData->maItemList.begin());
+ return (USHORT)(it - mpTabCtrlData->maItemList.begin());
}
return TAB_PAGE_NOTFOUND;
@@ -1859,11 +1948,11 @@ sal_uInt16 TabControl::GetPagePos( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
+USHORT TabControl::GetPageId( const Point& rPos ) const
{
for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i )
{
- if ( ((TabControl*)this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) )
+ if ( ((TabControl*)this)->ImplGetTabRect( static_cast<USHORT>(i) ).IsInside( rPos ) )
return mpTabCtrlData->maItemList[ i ].mnId;
}
@@ -1872,9 +1961,9 @@ sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
// -----------------------------------------------------------------------
-void TabControl::SetCurPageId( sal_uInt16 nPageId )
+void TabControl::SetCurPageId( USHORT nPageId )
{
- sal_uInt16 nPos = GetPagePos( nPageId );
+ USHORT nPos = GetPagePos( nPageId );
while( nPos != TAB_PAGE_NOTFOUND &&
! mpTabCtrlData->maItemList[nPos].mbEnabled )
{
@@ -1899,8 +1988,8 @@ void TabControl::SetCurPageId( sal_uInt16 nPageId )
mnActPageId = nPageId;
else
{
- mbFormat = sal_True;
- sal_uInt16 nOldId = mnCurPageId;
+ mbFormat = TRUE;
+ USHORT nOldId = mnCurPageId;
mnCurPageId = nPageId;
ImplChangeTabPage( nPageId, nOldId );
}
@@ -1909,7 +1998,7 @@ void TabControl::SetCurPageId( sal_uInt16 nPageId )
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetCurPageId() const
+USHORT TabControl::GetCurPageId() const
{
if ( mnActPageId )
return mnActPageId;
@@ -1919,13 +2008,20 @@ sal_uInt16 TabControl::GetCurPageId() const
// -----------------------------------------------------------------------
-void TabControl::SelectTabPage( sal_uInt16 nPageId )
+void TabControl::SetFirstPageId( USHORT )
+{
+ return; // was only required for single line
+}
+
+// -----------------------------------------------------------------------
+
+void TabControl::SelectTabPage( USHORT nPageId )
{
if ( nPageId && (nPageId != mnCurPageId) )
{
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (sal_uLong) mnCurPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (ULONG) mnCurPageId );
if ( DeactivatePage() )
{
mnActPageId = nPageId;
@@ -1936,14 +2032,14 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId )
SetCurPageId( nPageId );
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) );
- ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (sal_uLong) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (ULONG) nPageId );
}
}
}
// -----------------------------------------------------------------------
-void TabControl::SetTabPage( sal_uInt16 nPageId, TabPage* pTabPage )
+void TabControl::SetTabPage( USHORT nPageId, TabPage* pTabPage )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -1968,7 +2064,7 @@ void TabControl::SetTabPage( sal_uInt16 nPageId, TabPage* pTabPage )
// -----------------------------------------------------------------------
-TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const
+TabPage* TabControl::GetTabPage( USHORT nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -1980,7 +2076,7 @@ TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const
+USHORT TabControl::GetTabPageResId( USHORT nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -1992,30 +2088,30 @@ sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText )
+void TabControl::SetPageText( USHORT nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem && pItem->maText != rText )
{
pItem->maText = rText;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if( mpTabCtrlData->mpListBox )
{
- sal_uInt16 nPos = GetPagePos( nPageId );
+ USHORT nPos = GetPagePos( nPageId );
mpTabCtrlData->mpListBox->RemoveEntry( nPos );
mpTabCtrlData->mpListBox->InsertEntry( rText, nPos );
}
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (sal_uLong) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (ULONG) nPageId );
}
}
// -----------------------------------------------------------------------
-XubString TabControl::GetPageText( sal_uInt16 nPageId ) const
+XubString TabControl::GetPageText( USHORT nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2027,7 +2123,7 @@ XubString TabControl::GetPageText( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
+void TabControl::SetHelpText( USHORT nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2037,17 +2133,17 @@ void TabControl::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
+const XubString& TabControl::GetHelpText( USHORT nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
+ pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
}
return pItem->maHelpText;
@@ -2058,37 +2154,36 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
+void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->maHelpId = rHelpId;
+ pItem->mnHelpId = nHelpId;
}
// -----------------------------------------------------------------------
-rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const
+ULONG TabControl::GetHelpId( USHORT nPageId ) const
{
- rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- aRet = pItem->maHelpId;
-
- return aRet;
+ return pItem->mnHelpId;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
-void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage )
+void TabControl::SetPageImage( USHORT i_nPageId, const Image& i_rImage )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem )
{
pItem->maTabImage = i_rImage;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( IsUpdateMode() )
Invalidate();
}
@@ -2096,7 +2191,7 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage )
// -----------------------------------------------------------------------
-const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const
+const Image* TabControl::GetPageImage( USHORT i_nPageId ) const
{
const ImplTabItem* pItem = ImplGetItem( i_nPageId );
return pItem ? &pItem->maTabImage : NULL;
@@ -2104,7 +2199,7 @@ const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const
+Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
{
Rectangle aRet;
@@ -2113,7 +2208,7 @@ Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) cons
if( HasLayoutData() )
{
- boost::unordered_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPageId );
+ std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPageId );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
{
Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( it->second );
@@ -2127,7 +2222,7 @@ Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) cons
// -----------------------------------------------------------------------
-long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const
+long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
{
long nRet = -1;
@@ -2148,7 +2243,7 @@ long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) co
if( aPair.A() <= nIndex && aPair.B() >= nIndex )
{
nRet = nIndex - aPair.A();
- rPageId = (sal_uInt16)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
+ rPageId = (USHORT)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
break;
}
}
@@ -2169,7 +2264,7 @@ void TabControl::FillLayoutData() const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
+Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
{
Rectangle aRet;
@@ -2178,7 +2273,7 @@ Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
if( HasLayoutData() )
{
- boost::unordered_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPage );
+ std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPage );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
{
if( it->second >= 0 && it->second < static_cast<int>(mpTabCtrlData->maTabRectangles.size()) )
@@ -2194,7 +2289,7 @@ Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabBounds( sal_uInt16 nPageId ) const
+Rectangle TabControl::GetTabBounds( USHORT nPageId ) const
{
Rectangle aRet;
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
deleted file mode 100644
index a55fdb3eb379..000000000000
--- a/vcl/source/control/throbber.cxx
+++ /dev/null
@@ -1,325 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "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/cff.cxx b/vcl/source/fontsubset/cff.cxx
index b0c17df110b7..854c03a7ce22 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,104 +52,104 @@ typedef std::vector<ValType> ValVector;
// ====================================================================
static const char* pStringIds[] = {
-/*0*/ ".notdef", "space", "exclam", "quotedbl",
- "numbersign", "dollar", "percent", "ampersand",
- "quoteright", "parenleft", "parenright", "asterisk",
- "plus", "comma", "hyphen", "period",
-/*16*/ "slash", "zero", "one", "two",
- "three", "four", "five", "six",
- "seven", "eight", "nine", "colon",
- "semicolon", "less", "equal", "greater",
-/*32*/ "question", "at", "A", "B",
- "C", "D", "E", "F",
- "G", "H", "I", "J",
- "K", "L", "M", "N",
-/*48*/ "O", "P", "Q", "R",
- "S", "T", "U", "V",
- "W", "X", "Y", "Z",
- "bracketleft", "backslash", "bracketright", "asciicircum",
-/*64*/ "underscore", "quoteleft", "a", "b",
- "c", "d", "e", "f",
- "g", "h", "i", "j",
- "k", "l", "m", "n",
-/*80*/ "o", "p", "q", "r",
- "s", "t", "u", "v",
- "w", "x", "y", "z",
- "braceleft", "bar", "braceright", "asciitilde",
-/*96*/ "exclamdown", "cent", "sterlin", "fraction",
- "yen", "florin", "section", "currency",
- "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft",
- "guilsinglright", "fi", "fl", "endash",
-/*112*/ "dagger", "daggerdbl", "periodcentered", "paragraph",
- "bullet", "quotesinglbase", "quotedblbase", "quotedblright",
- "guillemotright", "ellipsis", "perthousand", "questiondown",
- "grave", "acute", "circumflex", "tilde",
-/*128*/ "macron", "breve", "dotaccent", "dieresis",
- "ring", "cedilla", "hungarumlaut", "ogonek",
- "caron", "endash", "AE", "ordfeminine",
- "Lslash", "Oslash", "OE", "ordmasculine",
-/*144*/ "ae", "dotlessi", "lslash", "oslash",
- "oe", "germandbls", "onesuperior", "logicalnot",
- "mu", "trademark", "Eth", "onehalf",
- "plusminus", "Thorn", "onequarter", "divide",
-/*160*/ "brokenbar", "degree", "thorn", "threequarters",
- "twosuperior", "registered", "minus", "eth",
- "multiply", "threesuperior", "copyright", "Aacute",
- "Acircumflex", "Adieresis", "Agrave", "Aring",
-/*176*/ "Atilde", "Ccedilla", "Eacute", "Ecircumflex",
- "Edieresis", "Egrave", "Iacute", "Icircumflex",
- "Idieresis", "Igrave", "Ntilde", "Oacute",
- "Ocircumflex", "Odieresis", "Ograve", "Otilde",
-/*192*/ "Scaron", "Uacute", "Ucircumflex", "Udieresis",
- "Ugrave", "Yacute", "Ydieresis", "Zcaron",
- "aacute", "acircumflex", "adieresis", "agrave",
- "aring", "atilde", "ccedilla", "eacute",
-/*208*/ "ecircumflex", "edieresis", "egrave", "iacute",
- "icircumflex", "idieresis", "igrave", "ntilde",
- "oacute", "ocircumflex", "odieresis", "ograve",
- "otilde", "scaron", "uacute", "ucircumflex",
-/*224*/ "udieresis", "ugrave", "yacute", "ydieresis",
- "zcaron", "exclamsmall", "Hungarumlautsmall","dollaroldstyle",
- "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior",
- "parenrightsuperior","twodotenleader", "onedotenleader", "zerooldstyle",
-/*240*/ "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle",
- "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle",
- "nineoldstile", "commasuperior", "threequartersemdash","periodsuperior",
- "questionsmall", "asuperior", "bsuperior", "centsuperior",
-/*256*/ "dsuperior", "esuperior", "isuperior", "lsuperior",
- "msuperior", "nsuperior", "osuperior", "rsuperior",
- "ssuperior", "tsuperior", "ff", "ffi",
- "ffl", "parenleftinferior","parenrightinferior","Circumflexsmall",
-/*272*/ "hyphensuperior","Gravesmall", "Asmall", "Bsmall",
- "Csmall", "Dsmall", "Esmall", "Fsmall",
- "Gsmall", "Hsmall", "Ismall", "Jsmall",
- "Ksmall", "Lsmall", "Msmall", "Nsmall",
-/*288*/ "Osmall", "Psmall", "Qsmall", "Rsmall",
- "Ssmall", "Tsmall", "Usmall", "Vsmall",
- "Wsmall", "Xsmall", "Ysmall", "Zsmall",
- "colonmonetary", "onefitted", "rupia", "Tildesmall",
-/*304*/ "exclamdownsmall","centoldstyle", "Lslashsmall", "Scaronsmall",
- "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall",
- "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior",
- "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall",
-/*320*/ "oneeight", "threeeights", "fiveeights", "seveneights",
- "onethird", "twothirds", "zerosuperior", "foursuperior",
- "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior",
- "ninesuperior", "zeroinferior", "oneinferior", "twoinferior",
-/*336*/ "threeinferior","fourinferior", "fiveinferior", "sixinferior",
- "seveninferior", "eightinferior", "nineinferior", "centinferior",
- "dollarinferior", "periodinferior", "commainferior", "Agravesmall",
- "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall",
-/*352*/ "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall",
- "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall",
- "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall",
- "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall",
-/*368*/ "Otildesmall", "Odieressissmall", "OEsmall", "Oslashsmall",
- "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall",
- "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000",
- "001.001", "001.002", "001.003", "Black",
-/*384*/ "Bold", "Book", "Light", "Medium",
- "Regular", "Roman", "Semibold"
+/*0*/ ".notdef", "space", "exclam", "quotedbl",
+ "numbersign", "dollar", "percent", "ampersand",
+ "quoteright", "parenleft", "parenright", "asterisk",
+ "plus", "comma", "hyphen", "period",
+/*16*/ "slash", "zero", "one", "two",
+ "three", "four", "five", "six",
+ "seven", "eight", "nine", "colon",
+ "semicolon", "less", "equal", "greater",
+/*32*/ "question", "at", "A", "B",
+ "C", "D", "E", "F",
+ "G", "H", "I", "J",
+ "K", "L", "M", "N",
+/*48*/ "O", "P", "Q", "R",
+ "S", "T", "U", "V",
+ "W", "X", "Y", "Z",
+ "bracketleft", "backslash", "bracketright", "asciicircum",
+/*64*/ "underscore", "quoteleft", "a", "b",
+ "c", "d", "e", "f",
+ "g", "h", "i", "j",
+ "k", "l", "m", "n",
+/*80*/ "o", "p", "q", "r",
+ "s", "t", "u", "v",
+ "w", "x", "y", "z",
+ "braceleft", "bar", "braceright", "asciitilde",
+/*96*/ "exclamdown", "cent", "sterlin", "fraction",
+ "yen", "florin", "section", "currency",
+ "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft",
+ "guilsinglright", "fi", "fl", "endash",
+/*112*/ "dagger", "daggerdbl", "periodcentered", "paragraph",
+ "bullet", "quotesinglbase", "quotedblbase", "quotedblright",
+ "guillemotright", "ellipsis", "perthousand", "questiondown",
+ "grave", "acute", "circumflex", "tilde",
+/*128*/ "macron", "breve", "dotaccent", "dieresis",
+ "ring", "cedilla", "hungarumlaut", "ogonek",
+ "caron", "endash", "AE", "ordfeminine",
+ "Lslash", "Oslash", "OE", "ordmasculine",
+/*144*/ "ae", "dotlessi", "lslash", "oslash",
+ "oe", "germandbls", "onesuperior", "logicalnot",
+ "mu", "trademark", "Eth", "onehalf",
+ "plusminus", "Thorn", "onequarter", "divide",
+/*160*/ "brokenbar", "degree", "thorn", "threequarters",
+ "twosuperior", "registered", "minus", "eth",
+ "multiply", "threesuperior", "copyright", "Aacute",
+ "Acircumflex", "Adieresis", "Agrave", "Aring",
+/*176*/ "Atilde", "Ccedilla", "Eacute", "Ecircumflex",
+ "Edieresis", "Egrave", "Iacute", "Icircumflex",
+ "Idieresis", "Igrave", "Ntilde", "Oacute",
+ "Ocircumflex", "Odieresis", "Ograve", "Otilde",
+/*192*/ "Scaron", "Uacute", "Ucircumflex", "Udieresis",
+ "Ugrave", "Yacute", "Ydieresis", "Zcaron",
+ "aacute", "acircumflex", "adieresis", "agrave",
+ "aring", "atilde", "ccedilla", "eacute",
+/*208*/ "ecircumflex", "edieresis", "egrave", "iacute",
+ "icircumflex", "idieresis", "igrave", "ntilde",
+ "oacute", "ocircumflex", "odieresis", "ograve",
+ "otilde", "scaron", "uacute", "ucircumflex",
+/*224*/ "udieresis", "ugrave", "yacute", "ydieresis",
+ "zcaron", "exclamsmall", "Hungarumlautsmall","dollaroldstyle",
+ "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior",
+ "parenrightsuperior","twodotenleader", "onedotenleader", "zerooldstyle",
+/*240*/ "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle",
+ "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle",
+ "nineoldstile", "commasuperior", "threequartersemdash","periodsuperior",
+ "questionsmall", "asuperior", "bsuperior", "centsuperior",
+/*256*/ "dsuperior", "esuperior", "isuperior", "lsuperior",
+ "msuperior", "nsuperior", "osuperior", "rsuperior",
+ "ssuperior", "tsuperior", "ff", "ffi",
+ "ffl", "parenleftinferior","parenrightinferior","Circumflexsmall",
+/*272*/ "hyphensuperior","Gravesmall", "Asmall", "Bsmall",
+ "Csmall", "Dsmall", "Esmall", "Fsmall",
+ "Gsmall", "Hsmall", "Ismall", "Jsmall",
+ "Ksmall", "Lsmall", "Msmall", "Nsmall",
+/*288*/ "Osmall", "Psmall", "Qsmall", "Rsmall",
+ "Ssmall", "Tsmall", "Usmall", "Vsmall",
+ "Wsmall", "Xsmall", "Ysmall", "Zsmall",
+ "colonmonetary", "onefitted", "rupia", "Tildesmall",
+/*304*/ "exclamdownsmall","centoldstyle", "Lslashsmall", "Scaronsmall",
+ "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall",
+ "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior",
+ "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall",
+/*320*/ "oneeight", "threeeights", "fiveeights", "seveneights",
+ "onethird", "twothirds", "zerosuperior", "foursuperior",
+ "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior",
+ "ninesuperior", "zeroinferior", "oneinferior", "twoinferior",
+/*336*/ "threeinferior","fourinferior", "fiveinferior", "sixinferior",
+ "seveninferior", "eightinferior", "nineinferior", "centinferior",
+ "dollarinferior", "periodinferior", "commainferior", "Agravesmall",
+ "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall",
+/*352*/ "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall",
+ "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall",
+ "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall",
+ "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall",
+/*368*/ "Otildesmall", "Odieressissmall", "OEsmall", "Oslashsmall",
+ "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall",
+ "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000",
+ "001.001", "001.002", "001.003", "Black",
+/*384*/ "Bold", "Book", "Light", "Medium",
+ "Regular", "Roman", "Semibold"
};
// --------------------------------------------------------------------
@@ -158,57 +158,57 @@ static const char* pStringIds[] = {
// TOP DICT keywords (also covers PRIV DICT keywords)
static const char* pDictOps[] = {
- "sVersion", "sNotice", "sFullName", "sFamilyName",
- "sWeight", "aFontBBox", "dBlueValues", "dOtherBlues",
- "dFamilyBlues", "dFamilyOtherBlues", "nStdHW", "nStdVW",
- "xESC", "nUniqueID", "aXUID", "nCharset",
- "nEncoding", "nCharStrings", "PPrivate", "nSubrs",
- "nDefaultWidthX", "nNominalWidthX", NULL, NULL,
- NULL, NULL, NULL, NULL,
- "shortint", "longint", "BCD", NULL
+ "sVersion", "sNotice", "sFullName", "sFamilyName",
+ "sWeight", "aFontBBox", "dBlueValues", "dOtherBlues",
+ "dFamilyBlues", "dFamilyOtherBlues", "nStdHW", "nStdVW",
+ "xESC", "nUniqueID", "aXUID", "nCharset",
+ "nEncoding", "nCharStrings", "PPrivate", "nSubrs",
+ "nDefaultWidthX", "nNominalWidthX", NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ "shortint", "longint", "BCD", NULL
};
// --------------------------------------------------------------------
// TOP DICT escapes (also covers PRIV DICT escapes)
static const char* pDictEscs[] = {
- "sCopyright", "bIsFixedPitch", "nItalicAngle", "nUnderlinePosition",
- "nUnderlineThickness", "nPaintType", "tCharstringType", "aFontMatrix",
- "nStrokeWidth", "nBlueScale", "nBlueShift", "nBlueFuzz",
- "dStemSnapH", "dStemSnapV", "bForceBold", NULL,
- NULL, "nLanguageGroup", "nExpansionFactor", "nInitialRandomSeed",
- "nSyntheticBase", "sPostScript", "sBaseFontName", "dBaseFontBlend",
- NULL, NULL, NULL, NULL,
- NULL, NULL, "rROS", "nCIDFontVersion",
- "nCIDFontRevision", "nCIDFontType", "nCIDCount", "nUIDBase",
- "nFDArray", "nFDSelect", "sFontName"
+ "sCopyright", "bIsFixedPitch", "nItalicAngle", "nUnderlinePosition",
+ "nUnderlineThickness", "nPaintType", "tCharstringType", "aFontMatrix",
+ "nStrokeWidth", "nBlueScale", "nBlueShift", "nBlueFuzz",
+ "dStemSnapH", "dStemSnapV", "bForceBold", NULL,
+ NULL, "nLanguageGroup", "nExpansionFactor", "nInitialRandomSeed",
+ "nSyntheticBase", "sPostScript", "sBaseFontName", "dBaseFontBlend",
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, "rROS", "nCIDFontVersion",
+ "nCIDFontRevision", "nCIDFontType", "nCIDCount", "nUIDBase",
+ "nFDArray", "nFDSelect", "sFontName"
};
// --------------------------------------------------------------------
static const char* pType1Ops[] = {
- NULL, "2hstem", NULL, "2vstem",
- "1vmoveto", "Arlineto", "1hlineto", "1vlineto",
- "Crrcurveto", "0closepath", "Lcallsubr", "0return",
- "xT1ESC", "2hsbw", "0endchar", NULL,
- NULL, NULL, NULL, NULL,
- NULL, "2rmoveto", "1hmoveto", NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, "4vhcurveto", "4hvcurveto"
+ NULL, "2hstem", NULL, "2vstem",
+ "1vmoveto", "Arlineto", "1hlineto", "1vlineto",
+ "Crrcurveto", "0closepath", "Lcallsubr", "0return",
+ "xT1ESC", "2hsbw", "0endchar", NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, "2rmoveto", "1hmoveto", NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, "4vhcurveto", "4hvcurveto"
};
// --------------------------------------------------------------------
static const char* pT1EscOps[] = {
- "0dotsection", "6vstem3", "6hstem3", NULL,
- NULL, NULL, "5seac", "4sbw",
- NULL, "1abs", "2add", "2sub",
- "2div", NULL, NULL, NULL,
- "Gcallothersubr", "1pop", NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, "2setcurrentpoint"
+ "0dotsection", "6vstem3", "6hstem3", NULL,
+ NULL, NULL, "5seac", "4sbw",
+ NULL, "1abs", "2add", "2sub",
+ "2div", NULL, NULL, NULL,
+ "Gcallothersubr", "1pop", NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, "2setcurrentpoint"
};
// --------------------------------------------------------------------
@@ -217,47 +217,47 @@ struct TYPE1OP
{
enum OPS
{
- HSTEM=1, VSTEM=3, VMOVETO=4, RLINETO=5,
- HLINETO=6, VLINETO=7, RCURVETO=8, CLOSEPATH=9,
- CALLSUBR=10, RETURN=11, T1ESC=12, HSBW=13,
- ENDCHAR=14, RMOVETO=21, HMOVETO=22, VHCURVETO=30,
+ HSTEM=1, VSTEM=3, VMOVETO=4, RLINETO=5,
+ HLINETO=6, VLINETO=7, RCURVETO=8, CLOSEPATH=9,
+ CALLSUBR=10, RETURN=11, T1ESC=12, HSBW=13,
+ ENDCHAR=14, RMOVETO=21, HMOVETO=22, VHCURVETO=30,
HVCURVETO=31
};
enum ESCS
{
- DOTSECTION=0, VSTEM3=1, HSTEM3=2, SEAC=6,
- SBW=7, ABS=9, ADD=10, SUB=11,
- DIV=12, CALLOTHERSUBR=16, POP=17, SETCURRENTPOINT=33
+ DOTSECTION=0, VSTEM3=1, HSTEM3=2, SEAC=6,
+ SBW=7, ABS=9, ADD=10, SUB=11,
+ DIV=12, CALLOTHERSUBR=16, POP=17, SETCURRENTPOINT=33
};
};
// --------------------------------------------------------------------
static const char* pType2Ops[] = {
- NULL, "hhstem", NULL, "vvstem",
- "mvmoveto", "Arlineto", "Ehlineto", "Evlineto",
- "Crrcurveto", NULL, "Lcallsubr", "Xreturn",
- "xT2ESC", NULL, "eendchar", NULL,
- NULL, NULL, "Hhstemhm", "Khintmask",
- "Kcntrmask", "Mrmoveto", "mhmoveto", "Vvstemhm",
- ".rcurveline", ".rlinecurve", ".vvcurveto", ".hhcurveto",
- ".shortint", "Gcallgsubr", ".vhcurveto", ".hvcurveto"
+ NULL, "hhstem", NULL, "vvstem",
+ "mvmoveto", "Arlineto", "Ehlineto", "Evlineto",
+ "Crrcurveto", NULL, "Lcallsubr", "Xreturn",
+ "xT2ESC", NULL, "eendchar", NULL,
+ NULL, NULL, "Hhstemhm", "Khintmask",
+ "Kcntrmask", "Mrmoveto", "mhmoveto", "Vvstemhm",
+ ".rcurveline", ".rlinecurve", ".vvcurveto", ".hhcurveto",
+ ".shortint", "Gcallgsubr", ".vhcurveto", ".hvcurveto"
};
// --------------------------------------------------------------------
static const char* pT2EscOps[] = {
- NULL, NULL, NULL, "2and",
- "2or", "1not", NULL, NULL,
- NULL, "1abs", "2add", "2sub",
- "2div", NULL, "1neg", "2eq",
- NULL, NULL, "1drop", NULL,
- "1put", "1get", "4ifelse", "0random",
- "2mul", NULL, "1sqrt", "1dup",
- "2exch", "Iindex", "Rroll", NULL,
- NULL, NULL, "7hflex", "Fflex",
- "9hflex1", "fflex1"
+ NULL, NULL, NULL, "2and",
+ "2or", "1not", NULL, NULL,
+ NULL, "1abs", "2add", "2sub",
+ "2div", NULL, "1neg", "2eq",
+ NULL, NULL, "1drop", NULL,
+ "1put", "1get", "4ifelse", "0random",
+ "2mul", NULL, "1sqrt", "1dup",
+ "2exch", "Iindex", "Rroll", NULL,
+ NULL, NULL, "7hflex", "Fflex",
+ "9hflex1", "fflex1"
};
// --------------------------------------------------------------------
@@ -266,23 +266,23 @@ struct TYPE2OP
{
enum OPS
{
- HSTEM=1, VSTEM=3, VMOVETO=4, RLINETO=5,
- HLINETO=6, VLINETO=7, RCURVETO=8, CALLSUBR=10,
- RETURN=11, T2ESC=12, ENDCHAR=14, HSTEMHM=18,
- HINTMASK=19, CNTRMASK=20, RMOVETO=21, HMOVETO=22,
- VSTEMHM=23, RCURVELINE=24, RLINECURVE=25, VVCURVETO=26,
- HHCURVETO=27, SHORTINT=28, CALLGSUBR=29, VHCURVETO=30,
+ HSTEM=1, VSTEM=3, VMOVETO=4, RLINETO=5,
+ HLINETO=6, VLINETO=7, RCURVETO=8, CALLSUBR=10,
+ RETURN=11, T2ESC=12, ENDCHAR=14, HSTEMHM=18,
+ HINTMASK=19, CNTRMASK=20, RMOVETO=21, HMOVETO=22,
+ VSTEMHM=23, RCURVELINE=24, RLINECURVE=25, VVCURVETO=26,
+ HHCURVETO=27, SHORTINT=28, CALLGSUBR=29, VHCURVETO=30,
HVCURVETO=31
};
enum ESCS
{
- AND=3, OR=4, NOT=5, ABS=9,
- ADD=10, SUB=11, DIV=12, NEG=14,
- EQ=15, DROP=18, PUT=20, GET=21,
- IFELSE=22, RANDOM=23, MUL=24, SQRT=26,
- DUP=27, EXCH=28, INDEX=29, ROLL=30,
- HFLEX=34, FLEX=35, HFLEX1=36, FLEX1=37
+ AND=3, OR=4, NOT=5, ABS=9,
+ ADD=10, SUB=11, DIV=12, NEG=14,
+ EQ=15, DROP=18, PUT=20, GET=21,
+ IFELSE=22, RANDOM=23, MUL=24, SQRT=26,
+ DUP=27, EXCH=28, INDEX=29, ROLL=30,
+ HFLEX=34, FLEX=35, HFLEX1=36, FLEX1=37
};
};
@@ -292,28 +292,28 @@ struct CffGlobal
{
explicit CffGlobal();
- int mnNameIdxBase;
- int mnNameIdxCount;
- int mnStringIdxBase;
- int mnStringIdxCount;
- bool mbCIDFont;
- int mnCharStrBase;
- int mnCharStrCount;
- int mnEncodingBase;
- int mnCharsetBase;
- int mnGlobalSubrBase;
- int mnGlobalSubrCount;
- int mnGlobalSubrBias;
- int mnFDSelectBase;
- int mnFontDictBase;
- int mnFDAryCount;
-
- ValVector maFontBBox;
- ValVector maFontMatrix;
-
- int mnFontNameSID;
- int mnFullNameSID;
- int mnFamilyNameSID;
+ int mnNameIdxBase;
+ int mnNameIdxCount;
+ int mnStringIdxBase;
+ int mnStringIdxCount;
+ bool mbCIDFont;
+ int mnCharStrBase;
+ int mnCharStrCount;
+ int mnEncodingBase;
+ int mnCharsetBase;
+ int mnGlobalSubrBase;
+ int mnGlobalSubrCount;
+ int mnGlobalSubrBias;
+ int mnFDSelectBase;
+ int mnFontDictBase;
+ int mnFDAryCount;
+
+ ValVector maFontBBox;
+ ValVector maFontMatrix;
+
+ int mnFontNameSID;
+ int mnFullNameSID;
+ int mnFamilyNameSID;
};
// ====================================================================
@@ -322,31 +322,31 @@ struct CffLocal
{
explicit CffLocal();
- int mnPrivDictBase;
- int mnPrivDictSize;
- int mnLocalSubrOffs;
- int mnLocalSubrBase;
- int mnLocalSubrCount;
- int mnLocalSubrBias;
+ int mnPrivDictBase;
+ int mnPrivDictSize;
+ int mnLocalSubrOffs;
+ int mnLocalSubrBase;
+ int mnLocalSubrCount;
+ int mnLocalSubrBias;
- ValType maNominalWidth;
+ ValType maNominalWidth;
ValType maDefaultWidth;
// ATM hinting related values
- ValType maStemStdHW;
- ValType maStemStdVW;
- ValVector maStemSnapH;
- ValVector maStemSnapV;
- ValVector maBlueValues;
- ValVector maOtherBlues;
- ValVector maFamilyBlues;
- ValVector maFamilyOtherBlues;
- RealType mfBlueScale;
- RealType mfBlueShift;
- RealType mfBlueFuzz;
- RealType mfExpFactor;
- int mnLangGroup;
- bool mbForceBold;
+ ValType maStemStdHW;
+ ValType maStemStdVW;
+ ValVector maStemSnapH;
+ ValVector maStemSnapV;
+ ValVector maBlueValues;
+ ValVector maOtherBlues;
+ ValVector maFamilyBlues;
+ ValVector maFamilyOtherBlues;
+ RealType mfBlueScale;
+ RealType mfBlueShift;
+ RealType mfBlueFuzz;
+ RealType mfExpFactor;
+ int mnLangGroup;
+ bool mbForceBold;
};
// ====================================================================
@@ -368,32 +368,32 @@ SubsetterContext::~SubsetterContext( void)
// ====================================================================
class CffSubsetterContext
-: public SubsetterContext
-, private CffGlobal
+: public SubsetterContext
+, private CffGlobal
{
public:
- static const int NMAXSTACK = 48; // see CFF.appendixB
- static const int NMAXHINTS = 2*96; // see CFF.appendixB
- static const int NMAXTRANS = 32; // see CFF.appendixB
+ static const int NMAXSTACK = 48; // see CFF.appendixB
+ static const int NMAXHINTS = 2*96; // see CFF.appendixB
+ static const int NMAXTRANS = 32; // see CFF.appendixB
public:
explicit CffSubsetterContext( const U8* pBasePtr, int nBaseLen);
- virtual ~CffSubsetterContext( void);
+ virtual ~CffSubsetterContext( void);
- void initialCffRead( void);
- bool emitAsType1( class Type1Emitter&,
+ void initialCffRead( void);
+ bool emitAsType1( class Type1Emitter&,
const long* pGlyphIDs, const U8* pEncoding,
GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& );
// used by charstring converter
- void setCharStringType( int);
- void fakeLocalSubrCount( int nLocalSubrs ) { maCffLocal[0].mnLocalSubrCount=nLocalSubrs;}
+ void setCharStringType( int);
+ void fakeLocalSubrCount( int nLocalSubrs ) { maCffLocal[0].mnLocalSubrCount=nLocalSubrs;}
protected:
- int convert2Type1Ops( CffLocal*, const U8* pType2Ops, int nType2Len, U8* pType1Ops);
+ int convert2Type1Ops( CffLocal*, const U8* pType2Ops, int nType2Len, U8* pType1Ops);
private:
- void convertOneTypeOp( void);
- void convertOneTypeEsc( void);
- void callType2Subr( bool bGlobal, int nSubrNumber);
- long getReadOfs( void) const { return (long)(mpReadPtr - mpBasePtr);}
+ void convertOneTypeOp( void);
+ void convertOneTypeEsc( void);
+ void callType2Subr( bool bGlobal, int nSubrNumber);
+ long getReadOfs( void) const { return (long)(mpReadPtr - mpBasePtr);}
const U8* mpBasePtr;
const U8* mpBaseEnd;
@@ -401,90 +401,90 @@ private:
const U8* mpReadPtr;
const U8* mpReadEnd;
- U8* mpWritePtr;
- bool mbSawError;
- bool mbNeedClose;
- bool mbIgnoreHints;
- long mnCntrMask;
+ U8* mpWritePtr;
+ bool mbSawError;
+ bool mbNeedClose;
+ bool mbIgnoreHints;
+ long mnCntrMask;
private:
- int seekIndexData( int nIndexBase, int nDataIndex);
- void seekIndexEnd( int nIndexBase);
+ int seekIndexData( int nIndexBase, int nDataIndex);
+ void seekIndexEnd( int nIndexBase);
private:
- const char** mpCharStringOps;
- const char** mpCharStringEscs;
+ const char** mpCharStringOps;
+ const char** mpCharStringEscs;
- CffLocal maCffLocal[16];
- CffLocal* mpCffLocal;
+ CffLocal maCffLocal[16];
+ CffLocal* mpCffLocal;
- void readDictOp( void);
- RealType readRealVal( void);
- const char* getString( int nStringID);
- int getFDSelect( int nGlyphIndex) const;
- int getGlyphSID( int nGlyphIndex) const;
+ void readDictOp( void);
+ RealType readRealVal( void);
+ const char* getString( int nStringID);
+ int getFDSelect( int nGlyphIndex) const;
+ int getGlyphSID( int nGlyphIndex) const;
const char* getGlyphName( int nGlyphIndex);
- void read2push( void);
- void pop2write( void);
- void writeType1Val( ValType);
- void writeTypeOp( int nTypeOp);
- void writeTypeEsc( int nTypeOp);
- void writeCurveTo( int nStackPos, int nIX1, int nIY1, int nIX2, int nIY2, int nIX3, int nIY3);
- void pop2MultiWrite( int nArgsPerTypo, int nTypeOp, int nTypeXor=0);
- void popAll2Write( int nTypeOp);
+ void read2push( void);
+ void pop2write( void);
+ void writeType1Val( ValType);
+ void writeTypeOp( int nTypeOp);
+ void writeTypeEsc( int nTypeOp);
+ void writeCurveTo( int nStackPos, int nIX1, int nIY1, int nIX2, int nIY2, int nIX3, int nIY3);
+ void pop2MultiWrite( int nArgsPerTypo, int nTypeOp, int nTypeXor=0);
+ void popAll2Write( int nTypeOp);
public: // TODO: is public really needed?
// accessing the value stack
// TODO: add more checks
- void push( ValType nVal) { mnValStack[ mnStackIdx++] = nVal;}
- ValType popVal( void) { return ((mnStackIdx>0) ? mnValStack[ --mnStackIdx] : 0);}
+ void push( ValType nVal) { mnValStack[ mnStackIdx++] = nVal;}
+ ValType popVal( void) { return ((mnStackIdx>0) ? mnValStack[ --mnStackIdx] : 0);}
ValType peekVal( void) const { return ((mnStackIdx>0) ? mnValStack[ mnStackIdx-1] : 0);}
ValType getVal( int nIndex) const { return mnValStack[ nIndex];}
- int popInt( void);
- int peekInt( void) const;
- int getInt( int nIndex) const;
- int size( void) const { return mnStackIdx;}
- bool empty( void) const { return !mnStackIdx;}
- void clear( void) { mnStackIdx = 0;}
+ int popInt( void);
+ int peekInt( void) const;
+ int getInt( int nIndex) const;
+ int size( void) const { return mnStackIdx;}
+ bool empty( void) const { return !mnStackIdx;}
+ void clear( void) { mnStackIdx = 0;}
// accessing the charstring hints
- void addHints( bool bVerticalHints);
- int getHorzHintCount( void) const { return (mnHorzHintSize/2);}
- int getVertHintCount( void) const { return (mnHintSize-mnHorzHintSize)/2;}
- void getHintPair( int nIndex, ValType* nMin, ValType* nEnd) const;
+ void addHints( bool bVerticalHints);
+ int getHorzHintCount( void) const { return (mnHorzHintSize/2);}
+ int getVertHintCount( void) const { return (mnHintSize-mnHorzHintSize)/2;}
+ void getHintPair( int nIndex, ValType* nMin, ValType* nEnd) const;
// accessing other charstring specifics
- bool hasCharWidth( void) const { return (maCharWidth > 0);}
- ValType getCharWidth( void) const { return maCharWidth;}
- void setNominalWidth( ValType aWidth) { mpCffLocal->maNominalWidth = aWidth;}
- void setDefaultWidth( ValType aWidth) { mpCffLocal->maDefaultWidth = aWidth;}
- void updateWidth( bool bUseFirstVal);
+ bool hasCharWidth( void) const { return (maCharWidth > 0);}
+ ValType getCharWidth( void) const { return maCharWidth;}
+ void setNominalWidth( ValType aWidth) { mpCffLocal->maNominalWidth = aWidth;}
+ void setDefaultWidth( ValType aWidth) { mpCffLocal->maDefaultWidth = aWidth;}
+ void updateWidth( bool bUseFirstVal);
private:
// typeop exceution context
- int mnStackIdx;
- ValType mnValStack[ NMAXSTACK+4];
- ValType mnTransVals[ NMAXTRANS];
+ int mnStackIdx;
+ ValType mnValStack[ NMAXSTACK+4];
+ ValType mnTransVals[ NMAXTRANS];
- int mnHintSize;
- int mnHorzHintSize;
- ValType mnHintStack[ NMAXHINTS];
+ int mnHintSize;
+ int mnHorzHintSize;
+ ValType mnHintStack[ NMAXHINTS];
- ValType maCharWidth;
+ ValType maCharWidth;
};
// --------------------------------------------------------------------
CffSubsetterContext::CffSubsetterContext( const U8* pBasePtr, int nBaseLen)
-: mpBasePtr( pBasePtr)
-, mpBaseEnd( pBasePtr+nBaseLen)
-, mnStackIdx(0)
-, mnHintSize(0)
-, mnHorzHintSize(0)
-, maCharWidth(-1)
+: mpBasePtr( pBasePtr)
+, mpBaseEnd( pBasePtr+nBaseLen)
+, mnStackIdx(0)
+, mnHintSize(0)
+, mnHorzHintSize(0)
+, maCharWidth(-1)
{
-// setCharStringType( 1);
+// setCharStringType( 1);
// TODO: new CffLocal[ mnFDAryCount];
mpCffLocal = &maCffLocal[0];
}
@@ -627,36 +627,36 @@ void CffSubsetterContext::readDictOp( void)
//TODO: if( nStackIdx > 0)
switch( *pCmdName) {
default: fprintf( stderr, "unsupported DictOp.type=\'%c\'\n", *pCmdName); break;
- case 'b': // bool
+ case 'b': // bool
nInt = popInt();
switch( nOpId) {
case 915: mpCffLocal->mbForceBold = nInt; break; // "ForceBold"
default: break; // TODO: handle more boolean dictops?
}
break;
- case 'n': // dict-op number
+ case 'n': // dict-op number
nVal = popVal();
nInt = static_cast<int>(nVal);
switch( nOpId) {
- case 10: mpCffLocal->maStemStdHW = nVal; break; // "StdHW"
- case 11: mpCffLocal->maStemStdVW = nVal; break; // "StdVW"
- case 15: mnCharsetBase = nInt; break; // "charset"
- case 16: mnEncodingBase = nInt; break; // "nEncoding"
- case 17: mnCharStrBase = nInt; break; // "nCharStrings"
+ case 10: mpCffLocal->maStemStdHW = nVal; break; // "StdHW"
+ case 11: mpCffLocal->maStemStdVW = nVal; break; // "StdVW"
+ case 15: mnCharsetBase = nInt; break; // "charset"
+ case 16: mnEncodingBase = nInt; break; // "nEncoding"
+ case 17: mnCharStrBase = nInt; break; // "nCharStrings"
case 19: mpCffLocal->mnLocalSubrOffs = nInt; break;// "nSubrs"
- case 20: setDefaultWidth( nVal ); break; // "defaultWidthX"
- case 21: setNominalWidth( nVal ); break; // "nominalWidthX"
- case 909: mpCffLocal->mfBlueScale = nVal; break; // "BlueScale"
- case 910: mpCffLocal->mfBlueShift = nVal; break; // "BlueShift"
- case 911: mpCffLocal->mfBlueFuzz = nVal; break; // "BlueFuzz"
- case 912: mpCffLocal->mfExpFactor = nVal; break; // "ExpansionFactor"
- case 917: mpCffLocal->mnLangGroup = nInt; break; // "LanguageGroup"
- case 936: mnFontDictBase = nInt; break; // "nFDArray"
- case 937: mnFDSelectBase = nInt; break; // "nFDSelect"
+ case 20: setDefaultWidth( nVal ); break; // "defaultWidthX"
+ case 21: setNominalWidth( nVal ); break; // "nominalWidthX"
+ case 909: mpCffLocal->mfBlueScale = nVal; break; // "BlueScale"
+ case 910: mpCffLocal->mfBlueShift = nVal; break; // "BlueShift"
+ case 911: mpCffLocal->mfBlueFuzz = nVal; break; // "BlueFuzz"
+ case 912: mpCffLocal->mfExpFactor = nVal; break; // "ExpansionFactor"
+ case 917: mpCffLocal->mnLangGroup = nInt; break; // "LanguageGroup"
+ case 936: mnFontDictBase = nInt; break; // "nFDArray"
+ case 937: mnFDSelectBase = nInt; break; // "nFDSelect"
default: break; // TODO: handle more numeric dictops?
}
break;
- case 'a': { // array
+ case 'a': { // array
switch( nOpId) {
case 5: maFontBBox.clear(); break; // "FontBBox"
case 907: maFontMatrix.clear(); break; // "FontMatrix"
@@ -672,36 +672,36 @@ void CffSubsetterContext::readDictOp( void)
}
clear();
} break;
- case 'd': { // delta array
+ case 'd': { // delta array
nVal = 0;
for( int i = 0; i < size(); ++i ) {
nVal += getVal(i);
switch( nOpId) {
- case 6: mpCffLocal->maBlueValues.push_back( nVal); break; // "BlueValues"
- case 7: mpCffLocal->maOtherBlues.push_back( nVal); break; // "OtherBlues"
- case 8: mpCffLocal->maFamilyBlues.push_back( nVal); break; // "FamilyBlues"
+ case 6: mpCffLocal->maBlueValues.push_back( nVal); break; // "BlueValues"
+ case 7: mpCffLocal->maOtherBlues.push_back( nVal); break; // "OtherBlues"
+ case 8: mpCffLocal->maFamilyBlues.push_back( nVal); break; // "FamilyBlues"
case 9: mpCffLocal->maFamilyOtherBlues.push_back( nVal); break;// "FamilyOtherBlues"
- case 912: mpCffLocal->maStemSnapH.push_back( nVal); break; // "StemSnapH"
- case 913: mpCffLocal->maStemSnapV.push_back( nVal); break; // "StemSnapV"
+ case 912: mpCffLocal->maStemSnapH.push_back( nVal); break; // "StemSnapH"
+ case 913: mpCffLocal->maStemSnapV.push_back( nVal); break; // "StemSnapV"
default: break; // TODO: handle more delta-array dictops?
}
}
clear();
} break;
- case 's': // stringid (SID)
+ case 's': // stringid (SID)
nInt = popInt();
switch( nOpId ) {
- case 2: mnFullNameSID = nInt; break; // "FullName"
- case 3: mnFamilyNameSID = nInt; break; // "FamilyName"
- case 938: mnFontNameSID = nInt; break; // "FontName"
+ case 2: mnFullNameSID = nInt; break; // "FullName"
+ case 3: mnFamilyNameSID = nInt; break; // "FamilyName"
+ case 938: mnFontNameSID = nInt; break; // "FontName"
default: break; // TODO: handle more string dictops?
}
break;
- case 'P': // private dict
+ case 'P': // private dict
mpCffLocal->mnPrivDictBase = popInt();
mpCffLocal->mnPrivDictSize = popInt();
break;
- case 'r': { // ROS operands
+ case 'r': { // ROS operands
int nSid1 = popInt();
int nSid2 = popInt();
(void)nSid1; // TODO: use
@@ -709,30 +709,30 @@ void CffSubsetterContext::readDictOp( void)
nVal = popVal();
mbCIDFont = true;
} break;
- case 't': // CharstringType
+ case 't': // CharstringType
nInt = popInt();
setCharStringType( nInt );
break;
}
- return;
+ return;
}
if( (c >= 32) || (c == 28) ) {
-// --mpReadPtr;
+// --mpReadPtr;
read2push();
- } else if( c == 29 ) { // longint
- ++mpReadPtr; // skip 29
+ } else if( c == 29 ) { // longint
+ ++mpReadPtr; // skip 29
int nS32 = mpReadPtr[0] << 24;
nS32 += mpReadPtr[1] << 16;
nS32 += mpReadPtr[2] << 8;
nS32 += mpReadPtr[3] << 0;
if( (sizeof(nS32) != 4) && (nS32 & (1<<31)))
- nS32 |= (~0U) << 31; // assuming 2s complement
+ nS32 |= (~0U) << 31; // assuming 2s complement
mpReadPtr += 4;
nVal = static_cast<ValType>(nS32);
push( nVal );
- } else if( c == 30) { // real number
+ } else if( c == 30) { // real number
++mpReadPtr; // skip 30
const RealType fReal = readRealVal();
// push value onto stack
@@ -752,22 +752,22 @@ void CffSubsetterContext::read2push()
if( c == 28 ) {
short nS16 = (p[1] << 8) + p[2];
if( (sizeof(nS16) != 2) && (nS16 & (1<<15)))
- nS16 |= (~0U) << 15; // assuming 2s complement
+ nS16 |= (~0U) << 15; // assuming 2s complement
aVal = nS16;
p += 3;
- } else if( c <= 246 ) { // -107..+107
+ } else if( c <= 246 ) { // -107..+107
aVal = static_cast<ValType>(p[0] - 139);
p += 1;
- } else if( c <= 250 ) { // +108..+1131
+ } else if( c <= 250 ) { // +108..+1131
aVal = static_cast<ValType>(((p[0] << 8) + p[1]) - 63124);
p += 2;
- } else if( c <= 254 ) { // -108..-1131
+ } else if( c <= 254 ) { // -108..-1131
aVal = static_cast<ValType>(64148 - ((p[0] << 8) + p[1]));
p += 2;
- } else /*if( c == 255)*/ { // Fixed16.16
+ } else /*if( c == 255)*/ { // Fixed16.16
int nS32 = (p[1] << 24) + (p[2] << 16) + (p[3] << 8) + p[4];
if( (sizeof(nS32) != 2) && (nS32 & (1<<31)))
- nS32 |= (~0U) << 31; // assuming 2s complement
+ nS32 |= (~0U) << 31; // assuming 2s complement
aVal = static_cast<ValType>(nS32 * (1.0 / 0x10000));
p += 5;
}
@@ -785,19 +785,19 @@ void CffSubsetterContext::writeType1Val( ValType aVal)
static const int nOutCharstrType = 1;
if( (nInt != aVal) && (nOutCharstrType == 2)) {
// numtype==255 means int32 for Type1, but 16.16 for Type2 charstrings!!!
- *(pOut++) = 255; // Fixed 16.16
+ *(pOut++) = 255; // Fixed 16.16
*(pOut++) = static_cast<U8>(nInt >> 8);
*(pOut++) = static_cast<U8>(nInt);
nInt = static_cast<int>(aVal * 0x10000) & 0xFFFF;
*(pOut++) = static_cast<U8>(nInt >> 8);
*(pOut++) = static_cast<U8>(nInt);
} else if( (nInt >= -107) && (nInt <= +107)) {
- *(pOut++) = static_cast<U8>(nInt + 139); // -107..+107
+ *(pOut++) = static_cast<U8>(nInt + 139); // -107..+107
} else if( (nInt >= -1131) && (nInt <= +1131)) {
if( nInt >= 0)
- nInt += 63124; // +108..+1131
+ nInt += 63124; // +108..+1131
else
- nInt = 64148 - nInt; // -108..-1131
+ nInt = 64148 - nInt; // -108..-1131
*(pOut++) = static_cast<U8>(nInt >> 8);
*(pOut++) = static_cast<U8>(nInt);
} else if( nOutCharstrType == 1) {
@@ -846,7 +846,7 @@ void CffSubsetterContext::pop2MultiWrite( int nArgsPerTypo, int nTypeOp, int nTy
}
i += nArgsPerTypo;
writeTypeOp( nTypeOp);
- nTypeOp ^= nTypeXor; // for toggling vlineto/hlineto
+ nTypeOp ^= nTypeXor; // for toggling vlineto/hlineto
}
clear();
}
@@ -1306,12 +1306,13 @@ void CffSubsetterContext::callType2Subr( bool bGlobal, int nSubrNumber)
const U8* const pOldReadPtr = mpReadPtr;
const U8* const pOldReadEnd = mpReadEnd;
+ int nLen = 0;
if( bGlobal ) {
nSubrNumber += mnGlobalSubrBias;
- seekIndexData( mnGlobalSubrBase, nSubrNumber);
+ nLen = seekIndexData( mnGlobalSubrBase, nSubrNumber);
} else {
nSubrNumber += mpCffLocal->mnLocalSubrBias;
- seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber);
+ nLen = seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber);
}
while( mpReadPtr < mpReadEnd)
@@ -1331,7 +1332,7 @@ int CffSubsetterContext::convert2Type1Ops( CffLocal* pCffLocal, const U8* const
// prepare the charstring conversion
mpWritePtr = pT1Ops;
-#if 1 // TODO: update caller
+#if 1 // TODO: update caller
U8 aType1Ops[ MAX_T1OPS_SIZE];
if( !pT1Ops)
mpWritePtr = aType1Ops;
@@ -1361,10 +1362,10 @@ mnHintSize=mnHorzHintSize=mnStackIdx=0; maCharWidth=-1;//#######
mnCntrMask = 0;
while( mpReadPtr < mpReadEnd)
convertOneTypeOp();
-// if( bActivePath)
-// writeTypeOp( TYPE1OP::CLOSEPATH);
-// if( bSubRoutine)
-// writeTypeOp( TYPE1OP::RETURN);
+// if( bActivePath)
+// writeTypeOp( TYPE1OP::CLOSEPATH);
+// if( bSubRoutine)
+// writeTypeOp( TYPE1OP::RETURN);
if( mbSawError) {
mpWritePtr = pT1Ops+4;
// create an "idiotproof" charstring
@@ -1391,7 +1392,7 @@ if( mbSawError) {
// encrypt the Type1 charstring
int nRDCryptR = 4330; // TODO: mnRDCryptSeed;
for( U8* p = pT1Ops; p < mpWritePtr; ++p) {
- *p ^= (nRDCryptR >> 8);
+ *p ^= (nRDCryptR >> 8);
nRDCryptR = (*(U8*)p + nRDCryptR) * 52845 + 22719;
}
@@ -1415,44 +1416,44 @@ RealType CffSubsetterContext::readRealVal()
if( nH <= 9) {
nNumber = nNumber * 10 + nH;
--nExpVal;
- } else if( nH == 10) { // comma
+ } else if( nH == 10) { // comma
nExpVal = 0;
bComma = true;
- } else if( nH == 11) { // +exp
+ } else if( nH == 11) { // +exp
fReal *= nNumber;
nExpSign = +1;
nNumber = 0;
- } else if( nH == 12) { // -exp
+ } else if( nH == 12) { // -exp
fReal *= nNumber;
nExpSign = -1;
nNumber = 0;
- } else if( nH == 13) { // reserved
+ } else if( nH == 13) { // reserved
// TODO: ignore or error?
- } else if( nH == 14) // minus
+ } else if( nH == 14) // minus
fReal = -fReal;
- else if( nH == 15) // end
+ else if( nH == 15) // end
break;
// parse low nibble
const U8 nL = c & 0x0F;
if( nL <= 9) {
nNumber = nNumber * 10 + nL;
--nExpVal;
- } else if( nL == 10) { // comma
+ } else if( nL == 10) { // comma
nExpVal = 0;
bComma = true;
- } else if( nL == 11) { // +exp
+ } else if( nL == 11) { // +exp
fReal *= nNumber;
nNumber = 0;
nExpSign = +1;
- } else if( nL == 12) { // -exp
+ } else if( nL == 12) { // -exp
fReal *= nNumber;
nNumber = 0;
nExpSign = -1;
- } else if( nL == 13) { // reserved
+ } else if( nL == 13) { // reserved
// TODO: ignore or error?
- } else if( nL == 14) // minus
+ } else if( nL == 14) // minus
fReal = -fReal;
- else if( nL == 15) // end
+ else if( nL == 15) // end
break;
}
@@ -1487,19 +1488,19 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex)
int nOfs1 = 0;
switch( nDataOfsSz) {
default: fprintf( stderr, "\tINVALID nDataOfsSz=%d\n\n", nDataOfsSz); return -1;
- case 1: nOfs1 = mpReadPtr[0]; break;
- case 2: nOfs1 = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
- case 3: nOfs1 = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2]; break;
- case 4: nOfs1 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
+ case 1: nOfs1 = mpReadPtr[0]; break;
+ case 2: nOfs1 = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
+ case 3: nOfs1 = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2]; break;
+ case 4: nOfs1 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
}
mpReadPtr += nDataOfsSz;
int nOfs2 = 0;
switch( nDataOfsSz) {
- case 1: nOfs2 = mpReadPtr[0]; break;
- case 2: nOfs2 = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
- case 3: nOfs2 = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2]; break;
- case 4: nOfs2 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
+ case 1: nOfs2 = mpReadPtr[0]; break;
+ case 2: nOfs2 = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
+ case 3: nOfs2 = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2]; break;
+ case 4: nOfs2 = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
}
mpReadPtr = mpBasePtr + (nIndexBase + 2) + nDataOfsSz * (nDataCount + 1) + nOfs1;
@@ -1525,10 +1526,10 @@ void CffSubsetterContext::seekIndexEnd( int nIndexBase)
int nEndOfs = 0;
switch( nDataOfsSz) {
default: fprintf( stderr, "\tINVALID nDataOfsSz=%d\n\n", nDataOfsSz); return;
- case 1: nEndOfs = mpReadPtr[0]; break;
- case 2: nEndOfs = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
- case 3: nEndOfs = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2];break;
- case 4: nEndOfs = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
+ case 1: nEndOfs = mpReadPtr[0]; break;
+ case 2: nEndOfs = (mpReadPtr[0]<<8) + mpReadPtr[1]; break;
+ case 3: nEndOfs = (mpReadPtr[0]<<16) + (mpReadPtr[1]<<8) + mpReadPtr[2];break;
+ case 4: nEndOfs = (mpReadPtr[0]<<24) + (mpReadPtr[1]<<16) + (mpReadPtr[2]<<8) + mpReadPtr[3]; break;
}
mpReadPtr += nDataOfsSz;
mpReadPtr += nEndOfs - 1;
@@ -1541,22 +1542,22 @@ void CffSubsetterContext::seekIndexEnd( int nIndexBase)
// initialize FONTDICT specific values
CffLocal::CffLocal( void)
-: mnPrivDictBase( 0)
-, mnPrivDictSize( 0)
-, mnLocalSubrOffs( 0)
-, mnLocalSubrBase( 0)
-, mnLocalSubrCount( 0)
-, mnLocalSubrBias( 0)
-, maNominalWidth( 0)
-, maDefaultWidth( 0)
-, maStemStdHW( 0)
-, maStemStdVW( 0)
-, mfBlueScale( 0.0)
-, mfBlueShift( 0.0)
-, mfBlueFuzz( 0.0)
-, mfExpFactor( 0.0)
-, mnLangGroup( 0)
-, mbForceBold( false)
+: mnPrivDictBase( 0)
+, mnPrivDictSize( 0)
+, mnLocalSubrOffs( 0)
+, mnLocalSubrBase( 0)
+, mnLocalSubrCount( 0)
+, mnLocalSubrBias( 0)
+, maNominalWidth( 0)
+, maDefaultWidth( 0)
+, maStemStdHW( 0)
+, maStemStdVW( 0)
+, mfBlueScale( 0.0)
+, mfBlueShift( 0.0)
+, mfBlueFuzz( 0.0)
+, mfExpFactor( 0.0)
+, mnLangGroup( 0)
+, mbForceBold( false)
{
maStemSnapH.clear();
maStemSnapV.clear();
@@ -1569,24 +1570,24 @@ CffLocal::CffLocal( void)
// --------------------------------------------------------------------
CffGlobal::CffGlobal( void)
-: mnNameIdxBase( 0)
-, mnNameIdxCount( 0)
-, mnStringIdxBase( 0)
-, mnStringIdxCount( 0)
-, mbCIDFont( false)
-, mnCharStrBase( 0)
-, mnCharStrCount( 0)
-, mnEncodingBase( 0)
-, mnCharsetBase( 0)
-, mnGlobalSubrBase( 0)
-, mnGlobalSubrCount( 0)
-, mnGlobalSubrBias( 0)
-, mnFDSelectBase( 0)
-, mnFontDictBase( 0)
-, mnFDAryCount( 1)
-, mnFontNameSID( 0)
-, mnFullNameSID( 0)
-, mnFamilyNameSID( 0)
+: mnNameIdxBase( 0)
+, mnNameIdxCount( 0)
+, mnStringIdxBase( 0)
+, mnStringIdxCount( 0)
+, mbCIDFont( false)
+, mnCharStrBase( 0)
+, mnCharStrCount( 0)
+, mnEncodingBase( 0)
+, mnCharsetBase( 0)
+, mnGlobalSubrBase( 0)
+, mnGlobalSubrCount( 0)
+, mnGlobalSubrBias( 0)
+, mnFDSelectBase( 0)
+, mnFontDictBase( 0)
+, mnFDAryCount( 1)
+, mnFontNameSID( 0)
+, mnFullNameSID( 0)
+, mnFamilyNameSID( 0)
{
maFontBBox.clear();
// TODO; maFontMatrix.clear();
@@ -1634,22 +1635,22 @@ void CffSubsetterContext::initialCffRead( void)
mnGlobalSubrCount = (mpReadPtr[0]<<8) + mpReadPtr[1];
mnGlobalSubrBias = (mnGlobalSubrCount<1240)?107:(mnGlobalSubrCount<33900)?1131:32768;
// skip past the last GlobalSubr entry
-// seekIndexEnd( mnGlobalSubrBase);
+// seekIndexEnd( mnGlobalSubrBase);
// get/skip the Encodings (we got mnEncodingBase from TOPDICT)
-// seekEncodingsEnd( mnEncodingBase);
+// seekEncodingsEnd( mnEncodingBase);
// get/skip the Charsets (we got mnCharsetBase from TOPDICT)
-// seekCharsetsEnd( mnCharStrBase);
+// seekCharsetsEnd( mnCharStrBase);
// get/skip FDSelect (CID only) data
// prepare access to the CharStrings index (we got the base from TOPDICT)
mpReadPtr = mpBasePtr + mnCharStrBase;
mnCharStrCount = (mpReadPtr[0]<<8) + mpReadPtr[1];
-// seekIndexEnd( mnCharStrBase);
+// seekIndexEnd( mnCharStrBase);
// read the FDArray index (CID only)
if( mbCIDFont) {
-// assert( mnFontDictBase == tellRel());
+// assert( mnFontDictBase == tellRel());
mpReadPtr = mpBasePtr + mnFontDictBase;
mnFDAryCount = (mpReadPtr[0]<<8) + mpReadPtr[1];
assert( mnFDAryCount < (int)(sizeof(maCffLocal)/sizeof(*maCffLocal)));
@@ -1688,7 +1689,7 @@ void CffSubsetterContext::initialCffRead( void)
const int nSubrCount = (mpReadPtr[0] << 8) + mpReadPtr[1];
mpCffLocal->mnLocalSubrCount = nSubrCount;
mpCffLocal->mnLocalSubrBias = (nSubrCount<1240)?107:(nSubrCount<33900)?1131:32768;
-// seekIndexEnd( mpCffLocal->mnLocalSubrBase);
+// seekIndexEnd( mpCffLocal->mnLocalSubrBase);
}
}
@@ -1753,7 +1754,6 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const
assert( nRangeCount <= mnCharStrCount);
U16 nPrev = (pReadPtr[2]<<8) + pReadPtr[3];
assert( nPrev == 0);
- (void)nPrev;
pReadPtr += 4;
// TODO? binary search
for( int i = 0; i < nRangeCount; ++i) {
@@ -1766,7 +1766,7 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const
nPrev = nNext;
}
} break;
- default: // invalid FDselect format
+ default: // invalid FDselect format
fprintf( stderr, "invalid CFF.FdselType=%d\n", nFDSelFormat);
break;
}
@@ -1867,40 +1867,40 @@ const char* CffSubsetterContext::getGlyphName( int nGlyphIndex)
class Type1Emitter
{
public:
- explicit Type1Emitter( const char* pOutFileName, bool bPfbSubset = true);
- explicit Type1Emitter( FILE* pOutFile, bool bPfbSubset = true);
- /*virtual*/ ~Type1Emitter( void);
- void setSubsetName( const char* );
-
- void emitRawData( const char* pData, int nLength) const;
- void emitAllRaw( void);
- void emitAllHex( void);
- void emitAllCrypted( void);
- int tellPos( void) const;
- void updateLen( int nTellPos, int nLength);
- void emitValVector( const char* pLineHead, const char* pLineTail, const ValVector&);
+ explicit Type1Emitter( const char* pOutFileName, bool bPfbSubset = true);
+ explicit Type1Emitter( FILE* pOutFile, bool bPfbSubset = true);
+ /*virtual*/ ~Type1Emitter( void);
+ void setSubsetName( const char* );
+
+ void emitRawData( const char* pData, int nLength) const;
+ void emitAllRaw( void);
+ void emitAllHex( void);
+ void emitAllCrypted( void);
+ int tellPos( void) const;
+ void updateLen( int nTellPos, int nLength);
+ void emitValVector( const char* pLineHead, const char* pLineTail, const ValVector&);
private:
- FILE* mpFileOut;
- bool mbCloseOutfile;
- char maBuffer[MAX_T1OPS_SIZE]; // TODO: dynamic allocation
- int mnEECryptR;
+ FILE* mpFileOut;
+ bool mbCloseOutfile;
+ char maBuffer[MAX_T1OPS_SIZE]; // TODO: dynamic allocation
+ int mnEECryptR;
public:
- char* mpPtr;
+ char* mpPtr;
- char maSubsetName[256];
- bool mbPfbSubset;
- int mnHexLineCol;
+ char maSubsetName[256];
+ bool mbPfbSubset;
+ int mnHexLineCol;
};
// --------------------------------------------------------------------
Type1Emitter::Type1Emitter( const char* pPfbFileName, bool bPfbSubset)
-: mpFileOut( NULL)
-, mbCloseOutfile( true)
-, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed
-, mpPtr( maBuffer)
-, mbPfbSubset( bPfbSubset)
-, mnHexLineCol( 0)
+: mpFileOut( NULL)
+, mbCloseOutfile( true)
+, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed
+, mpPtr( maBuffer)
+, mbPfbSubset( bPfbSubset)
+, mnHexLineCol( 0)
{
mpFileOut = fopen( pPfbFileName, "wb");
maSubsetName[0] = '\0';
@@ -1909,12 +1909,12 @@ Type1Emitter::Type1Emitter( const char* pPfbFileName, bool bPfbSubset)
// --------------------------------------------------------------------
Type1Emitter::Type1Emitter( FILE* pOutFile, bool bPfbSubset)
-: mpFileOut( pOutFile)
-, mbCloseOutfile( false)
-, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed
-, mpPtr( maBuffer)
-, mbPfbSubset( bPfbSubset)
-, mnHexLineCol( 0)
+: mpFileOut( pOutFile)
+, mbCloseOutfile( false)
+, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed
+, mpPtr( maBuffer)
+, mbPfbSubset( bPfbSubset)
+, mnHexLineCol( 0)
{
maSubsetName[0] = '\0';
}
@@ -2048,7 +2048,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail,
return;
// emit the line head
- mpPtr += sprintf( mpPtr, "%s", pLineHead);
+ mpPtr += sprintf( mpPtr, pLineHead);
// emit the vector values
ValVector::value_type aVal = 0;
for( ValVector::const_iterator it = rVector.begin();;) {
@@ -2061,7 +2061,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail,
// emit the last value
mpPtr += dbl2str( mpPtr, aVal);
// emit the line tail
- mpPtr += sprintf( mpPtr, "%s", pLineTail);
+ mpPtr += sprintf( mpPtr, pLineTail);
}
// --------------------------------------------------------------------
@@ -2112,7 +2112,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "%%!FontType1-1.0: %s 001.003\n", rEmitter.maSubsetName);
// emit TOPDICT
pOut += sprintf( pOut,
- "11 dict begin\n" // TODO: dynamic entry count for TOPDICT
+ "11 dict begin\n" // TODO: dynamic entry count for TOPDICT
"/FontType 1 def\n"
"/PaintType 0 def\n");
pOut += sprintf( pOut, "/FontName /%s def\n", rEmitter.maSubsetName);
@@ -2129,7 +2129,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "/FontBBox {0 0 999 999}readonly def\n");
// emit FONTINFO into TOPDICT
pOut += sprintf( pOut,
- "/FontInfo 2 dict dup begin\n" // TODO: check fontinfo entry count
+ "/FontInfo 2 dict dup begin\n" // TODO: check fontinfo entry count
" /FullName (%s) readonly def\n"
" /FamilyName (%s) readonly def\n"
"end readonly def\n",
@@ -2154,9 +2154,9 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
// update PFB header segment
const int nPfbHeaderLen = rEmitter.tellPos() - 6;
rEmitter.updateLen( 2, nPfbHeaderLen);
-
+
// prepare start of eexec segment
- rEmitter.emitRawData( "\x80\x02\x00\x00\x00\x00", 6); // segment start
+ rEmitter.emitRawData( "\x80\x02\x00\x00\x00\x00", 6); // segment start
}
const int nEExecSegTell = rEmitter.tellPos();
@@ -2190,11 +2190,11 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
"/ND{noaccess def}executeonly def\n"
"/NP{noaccess put}executeonly def\n"
"/MinFeature{16 16}ND\n"
- "/password 5839 def\n", // TODO: mnRDCryptSeed?
+ "/password 5839 def\n", // TODO: mnRDCryptSeed?
nPrivEntryCount);
#if defined(IGNORE_HINTS)
- pOut += sprintf( pOut, "/BlueValues []ND\n"); // BlueValues are mandatory
+ pOut += sprintf( pOut, "/BlueValues []ND\n"); // BlueValues are mandatory
#else
// emit blue hint related privdict entries
if( !mpCffLocal->maBlueValues.empty())
@@ -2210,12 +2210,12 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += dbl2str( pOut, mpCffLocal->mfBlueScale, 6);
pOut += sprintf( pOut, " def\n");
}
- if( mpCffLocal->mfBlueShift) { // default BlueShift==7
+ if( mpCffLocal->mfBlueShift) { // default BlueShift==7
pOut += sprintf( pOut, "/BlueShift ");
pOut += dbl2str( pOut, mpCffLocal->mfBlueShift);
pOut += sprintf( pOut, " def\n");
}
- if( mpCffLocal->mfBlueFuzz) { // default BlueFuzz==1
+ if( mpCffLocal->mfBlueFuzz) { // default BlueFuzz==1
pOut += sprintf( pOut, "/BlueFuzz ");
pOut += dbl2str( pOut, mpCffLocal->mfBlueFuzz);
pOut += sprintf( pOut, " def\n");
@@ -2325,7 +2325,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
const int nEExecLen = rEmitter.tellPos() - nEExecSegTell;
rEmitter.updateLen( nEExecSegTell-4, nEExecLen);
}
-
+
// create PFB footer
static const char aPfxFooter[] = "\x80\x01\x14\x02\x00\x00\n" // TODO: check segment len
"0000000000000000000000000000000000000000000000000000000000000000\n"
@@ -2358,12 +2358,12 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
static_cast<long>(maFontBBox[3] * fYFactor) ) );
// PDF-Spec says the values below mean the ink bounds!
// TODO: use better approximations for these ink bounds
- rFSInfo.m_nAscent = +rFSInfo.m_aFontBBox.Bottom(); // for capital letters
- rFSInfo.m_nDescent = -rFSInfo.m_aFontBBox.Top(); // for all letters
- rFSInfo.m_nCapHeight = rFSInfo.m_nAscent; // for top-flat capital letters
+ rFSInfo.m_nAscent = +rFSInfo.m_aFontBBox.Bottom(); // for capital letters
+ rFSInfo.m_nDescent = -rFSInfo.m_aFontBBox.Top(); // for all letters
+ rFSInfo.m_nCapHeight = rFSInfo.m_nAscent; // for top-flat capital letters
rFSInfo.m_nFontType = rEmitter.mbPfbSubset ? FontSubsetInfo::TYPE1_PFB : FontSubsetInfo::TYPE1_PFA;
- rFSInfo.m_aPSName = String( rEmitter.maSubsetName, RTL_TEXTENCODING_UTF8 );
+ rFSInfo.m_aPSName = String( rEmitter.maSubsetName, RTL_TEXTENCODING_UTF8 );
return true;
}
diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index 889d46efe373..cbcf30612cb5 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,14 +36,14 @@
// ====================================================================
FontSubsetInfo::FontSubsetInfo()
-: m_nAscent( 0)
-, m_nDescent( 0)
-, m_nCapHeight( 0)
-, m_nFontType( FontSubsetInfo::NO_FONT)
-, mpInFontBytes( NULL)
-, mnInByteLength( 0)
-, meInFontType( FontSubsetInfo::NO_FONT)
-, mpSftTTFont( NULL)
+: m_nAscent( 0)
+, m_nDescent( 0)
+, m_nCapHeight( 0)
+, m_nFontType( FontSubsetInfo::NO_FONT)
+, mpInFontBytes( NULL)
+, mnInByteLength( 0)
+, meInFontType( FontSubsetInfo::NO_FONT)
+, mpSftTTFont( NULL)
{}
// --------------------------------------------------------------------
@@ -86,15 +86,15 @@ bool FontSubsetInfo::CreateFontSubset(
{
// prepare request details needed by all underlying subsetters
mnReqFontTypeMask = nReqFontTypeMask;
- mpOutFile = pOutFile;
- mpReqFontName = pReqFontName;
- mpReqGlyphIds = pReqGlyphIds;
- mpReqEncodedIds = pReqEncodedIds;
- mnReqGlyphCount = nReqGlyphCount;
+ mpOutFile = pOutFile;
+ mpReqFontName = pReqFontName;
+ mpReqGlyphIds = pReqGlyphIds;
+ mpReqEncodedIds = pReqEncodedIds;
+ mnReqGlyphCount = nReqGlyphCount;
// TODO: move the glyphid/encid/notdef reshuffling from the callers to here
- // dispatch to underlying subsetters
+ // dispatch to underlying subsetters
bool bOK = false;
// TODO: better match available input-type to possible subset-types
@@ -116,7 +116,7 @@ bool FontSubsetInfo::CreateFontSubset(
case NO_FONT:
// fall trough
default:
- OSL_FAIL( "unhandled type in CreateFontSubset()");
+ DBG_ERROR( "unhandled type in CreateFontSubset()");
break;
}
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index da0d84cec089..450a70b6e544 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,22 +42,24 @@
namespace vcl
{
-typedef sal_uIntPtr sal_uLong;
+typedef sal_uInt32 ULONG;
+typedef sal_uInt32 UINT32;
+typedef sal_uInt16 USHORT;
typedef sal_uInt8 FT_Byte;
-typedef std::map<sal_uInt16,sal_uInt16> GlyphSubstitution;
+typedef std::map<USHORT,USHORT> GlyphSubstitution;
-inline sal_uInt32 NEXT_Long( const unsigned char* &p )
+inline long NEXT_Long( const unsigned char* &p )
{
- sal_uInt32 nVal = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
+ long nVal = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
p += 4;
return nVal;
}
-inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
+inline USHORT NEXT_UShort( const unsigned char* &p )
{
- sal_uInt16 nVal = (p[0]<<8) + p[1];
+ USHORT nVal = (p[0]<<8) + p[1];
p += 2;
return nVal;
}
@@ -76,50 +78,50 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
// parse GSUB header
const FT_Byte* pGsubHeader = pGsubBase;
- 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 );
+ const ULONG nVersion = NEXT_Long( pGsubHeader );
+ const USHORT nOfsScriptList = NEXT_UShort( pGsubHeader );
+ const USHORT nOfsFeatureTable = NEXT_UShort( pGsubHeader );
+ const USHORT 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<sal_uLong> ReqFeatureTagList;
+ typedef std::vector<ULONG> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
aReqFeatureTagList.push_back( MKTAG("vert") );
- typedef std::vector<sal_uInt16> UshortList;
+ typedef std::vector<USHORT> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const sal_uInt16 nCntScript = NEXT_UShort( pScriptHeader );
+ const USHORT nCntScript = NEXT_UShort( pScriptHeader );
if( pGsubLimit < pScriptHeader + 6 * nCntScript )
return false;
- for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- 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) )
+ const ULONG nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
+ const USHORT nOfsScriptTable= NEXT_UShort( pScriptHeader );
+ if( (nTag != (USHORT)nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
if( pGsubLimit < pScriptTable + 4 )
return false;
- const sal_uInt16 nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
- const sal_uInt16 nCntLangSystem = NEXT_UShort( pScriptTable );
- sal_uInt16 nLangsysOffset = 0;
+ const USHORT nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
+ const USHORT nCntLangSystem = NEXT_UShort( pScriptTable );
+ USHORT nLangsysOffset = 0;
if( pGsubLimit < pScriptTable + 6 * nCntLangSystem )
return false;
- for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- 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) )
+ const ULONG nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
+ const USHORT nOffset= NEXT_UShort( pScriptTable );
+ if( (nInnerTag != (USHORT)nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
nLangsysOffset = nOffset;
break;
@@ -130,15 +132,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
- const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
- const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
+ /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const USHORT nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
+ for( USHORT i = 0; i < nCntFeature; ++i )
{
- const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
+ const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -148,15 +150,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
- const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
- const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
+ /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const USHORT nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
+ for( USHORT i = 0; i < nCntFeature; ++i )
{
- const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
+ const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -172,34 +174,34 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
if( pGsubLimit < pFeatureHeader + 2 )
return false;
- const sal_uInt16 nCntFeature = NEXT_UShort( pFeatureHeader );
+ const USHORT nCntFeature = NEXT_UShort( pFeatureHeader );
if( pGsubLimit < pFeatureHeader + 6 * nCntFeature )
return false;
- for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const sal_uLong nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const sal_uInt16 nOffset= NEXT_UShort( pFeatureHeader );
+ const ULONG nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const USHORT nOffset= NEXT_UShort( pFeatureHeader );
// ignore unneeded feature lookups
if( aFeatureIndexList[0] != nFeatureIndex ) // do not ignore the required feature
{
const int nRequested = std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex);
- if( !nRequested ) // ignore features that are not requested
+ if( !nRequested ) // ignore features that are not requested
continue;
const int nAvailable = std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag);
- if( !nAvailable ) // some fonts don't provide features they request!
+ if( !nAvailable ) // some fonts don't provide features they request!
continue;
}
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
if( pGsubLimit < pFeatureTable + 2 )
return false;
- const sal_uInt16 nCntLookups = NEXT_UShort( pFeatureTable );
+ const USHORT nCntLookups = NEXT_UShort( pFeatureTable );
if( pGsubLimit < pFeatureTable + 2 * nCntLookups )
return false;
- for( sal_uInt16 i = 0; i < nCntLookups; ++i )
+ for( USHORT i = 0; i < nCntLookups; ++i )
{
- const sal_uInt16 nLookupIndex = NEXT_UShort( pFeatureTable );
+ const USHORT nLookupIndex = NEXT_UShort( pFeatureTable );
aLookupIndexList.push_back( nLookupIndex );
}
if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
@@ -210,12 +212,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
if( pGsubLimit < pLookupHeader + 2 )
return false;
- const sal_uInt16 nCntLookupTable = NEXT_UShort( pLookupHeader );
+ const USHORT nCntLookupTable = NEXT_UShort( pLookupHeader );
if( pGsubLimit < pLookupHeader + 2 * nCntLookupTable )
return false;
- for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const sal_uInt16 nOffset = NEXT_UShort( pLookupHeader );
+ const USHORT nOffset = NEXT_UShort( pLookupHeader );
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
}
@@ -223,13 +225,13 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
UshortList::const_iterator it = aLookupOffsetList.begin();
for(; it != aLookupOffsetList.end(); ++it )
{
- const sal_uInt16 nOfsLookupTable = *it;
+ const USHORT nOfsLookupTable = *it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
if( pGsubLimit < pLookupTable + 6 )
return false;
- const sal_uInt16 eLookupType = NEXT_UShort( pLookupTable );
- /*const sal_uInt16 eLookupFlag =*/ NEXT_UShort( pLookupTable );
- const sal_uInt16 nCntLookupSubtable = NEXT_UShort( pLookupTable );
+ const USHORT eLookupType = NEXT_UShort( pLookupTable );
+ /*const USHORT eLookupFlag =*/ NEXT_UShort( pLookupTable );
+ const USHORT nCntLookupSubtable = NEXT_UShort( pLookupTable );
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
@@ -237,16 +239,16 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
if( pGsubLimit < pLookupTable + 2 * nCntLookupSubtable )
return false;
- for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const sal_uInt16 nOfsSubLookupTable = NEXT_UShort( pLookupTable );
+ const USHORT nOfsSubLookupTable = NEXT_UShort( pLookupTable );
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
if( pGsubLimit < pSubLookup + 6 )
return false;
- const sal_uInt16 nFmtSubstitution = NEXT_UShort( pSubLookup );
- const sal_uInt16 nOfsCoverage = NEXT_UShort( pSubLookup );
+ const USHORT nFmtSubstitution = NEXT_UShort( pSubLookup );
+ const USHORT nOfsCoverage = NEXT_UShort( pSubLookup );
- typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
+ typedef std::pair<USHORT,USHORT> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
@@ -254,19 +256,19 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
+ nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
if( pGsubLimit < pCoverage + 4 )
return false;
- const sal_uInt16 nFmtCoverage = NEXT_UShort( pCoverage );
+ const USHORT nFmtCoverage = NEXT_UShort( pCoverage );
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const sal_uInt16 nCntGlyph = NEXT_UShort( pCoverage );
+ const USHORT nCntGlyph = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 2 * nCntGlyph )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 2;
return false;
aSubstVector.reserve( nCntGlyph );
- for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
+ for( USHORT i = 0; i < nCntGlyph; ++i )
{
- const sal_uInt16 nGlyphId = NEXT_UShort( pCoverage );
+ const USHORT nGlyphId = NEXT_UShort( pCoverage );
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
}
@@ -274,17 +276,17 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Coverage Format 2
{
- const sal_uInt16 nCntRange = NEXT_UShort( pCoverage );
+ const USHORT nCntRange = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 6 * nCntRange )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 6;
return false;
for( int i = nCntRange; --i >= 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 ) );
+ 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 ) );
}
}
break;
@@ -296,7 +298,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
{
case 1: // Single Substitution Format 1
{
- const sal_uInt16 nDeltaGlyphId = NEXT_UShort( pSubLookup );
+ const USHORT nDeltaGlyphId = NEXT_UShort( pSubLookup );
for(; subst_it != aSubstVector.end(); ++subst_it )
(*subst_it).second = (*subst_it).first + nDeltaGlyphId;
@@ -305,12 +307,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Single Substitution Format 2
{
- const sal_uInt16 nCntGlyph = NEXT_UShort( pSubLookup );
+ const USHORT nCntGlyph = NEXT_UShort( pSubLookup );
for( int i = nCntGlyph; (subst_it != aSubstVector.end()) && (--i>=0); ++subst_it )
{
if( pGsubLimit < pSubLookup + 2 )
return false;
- const sal_uInt16 nGlyphId = NEXT_UShort( pSubLookup );
+ const USHORT nGlyphId = NEXT_UShort( pSubLookup );
(*subst_it).second = nGlyphId;
}
}
@@ -342,7 +344,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<sal_uInt16>(nGlyph) ) );
+ GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<USHORT>(nGlyph) ) );
if( it != pGlyphSubstitution->end() )
nGlyph = (*it).second;
}
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
index bb4543f372da..e8cce6981d17 100644
--- a/vcl/source/fontsubset/gsub.h
+++ b/vcl/source/fontsubset/gsub.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,7 @@
namespace vcl
{
-
+
int HasVerticalGSUB( struct vcl::_TrueTypeFont* pTTFile );
int UseGSUB( struct vcl::_TrueTypeFont* pTTFile, int nGlyph, int wmode );
diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c
index def5faa7b553..001b15cdd6ac 100644
--- a/vcl/source/fontsubset/list.c
+++ b/vcl/source/fontsubset/list.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,12 +35,20 @@
/*[]---------------------------------------------------[]*/
#include <stdlib.h>
+
+#if OSL_DEBUG_LEVEL == 0
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+#endif
+
#include <assert.h>
#ifdef MALLOC_TRACE
#include <stdio.h>
#include </usr/local/include/malloc.h>
#endif
+/* #define TEST */
#include "list.h"
/*- private data types */
@@ -93,6 +101,31 @@ static lnode *appendPrim(list this, void *el)
this->aCount++;
return ptr;
}
+#ifdef TEST
+static lnode *prependPrim(list this, void *el)
+{
+ lnode *ptr = newNode(el);
+ lnode *flink, **blink;
+
+ if (this->head != 0) {
+ blink = &(this->head->prev);
+ flink = this->head;
+ } else {
+ blink = &this->tail;
+ flink = 0;
+ this->cptr = ptr; /*- list was empty - set current to this element */
+ }
+
+ *blink = ptr;
+ this->head = ptr;
+
+ ptr->next = flink;
+ ptr->prev = 0;
+
+ this->aCount++;
+ return ptr;
+}
+#endif
/*- public methods */
list listNewEmpty(void) /*- default ctor */
@@ -107,6 +140,32 @@ list listNewEmpty(void) /*- default ctor */
return this;
}
+#ifdef TEST
+list listNewCopy(list l) /*- copy ctor */
+{
+ lnode *ptr, *c;
+ list this;
+ assert(l != 0);
+
+ this = malloc(sizeof(struct _list));
+ assert(this != 0);
+
+ ptr = l->head;
+
+ this->aCount = 0;
+ this->eDtor = 0;
+ this->head = this->tail = this->cptr = 0;
+
+ while (ptr) {
+ c = appendPrim(this, ptr->value);
+ if (ptr == l->cptr) this->cptr = c;
+ ptr = ptr->next;
+ }
+
+ return this;
+}
+#endif
+
void listDispose(list this) /*- dtor */
{
assert(this != 0);
@@ -140,6 +199,36 @@ int listIsEmpty(list this)
return this->aCount == 0;
}
+
+#ifdef TEST
+int listAtFirst(list this)
+{
+ assert(this != 0);
+ return this->cptr == this->head;
+}
+
+int listAtLast(list this)
+{
+ assert(this != 0);
+ return this->cptr == this->tail;
+}
+
+int listPosition(list this)
+{
+ int res = 0;
+ lnode *ptr;
+ assert(this != 0);
+
+ ptr = this->head;
+
+ while (ptr != this->cptr) {
+ ptr = ptr->next;
+ res++;
+ }
+
+ return res;
+}
+#endif
int listFind(list this, void *el)
{
lnode *ptr;
@@ -223,7 +312,59 @@ list listAppend(list this, void *el)
appendPrim(this, el);
return this;
}
+#ifdef TEST
+list listPrepend(list this, void *el)
+{
+ assert(this != 0);
+ prependPrim(this, el);
+ return this;
+}
+
+list listInsertAfter(list this, void *el)
+{
+ lnode *ptr;
+ assert(this != 0);
+
+ if (this->cptr == 0) return listAppend(this, el);
+
+ ptr = newNode(el);
+
+ ptr->prev = this->cptr;
+ ptr->next = this->cptr->next;
+ this->cptr->next = ptr;
+
+ if (ptr->next != 0) {
+ ptr->next->prev = ptr;
+ } else {
+ this->tail = ptr;
+ }
+ this->aCount++;
+ return this;
+}
+
+list listInsertBefore(list this, void *el)
+{
+ lnode *ptr;
+ assert(this != 0);
+
+ if (this->cptr == 0) return listAppend(this, el);
+
+ ptr = newNode(el);
+
+ ptr->prev = this->cptr->prev;
+ ptr->next = this->cptr;
+ this->cptr->prev = ptr;
+
+ if (ptr->prev != 0) {
+ ptr->prev->next = ptr;
+ } else {
+ this->head = ptr;
+ }
+ this->aCount++;
+ return this;
+}
+#endif
list listRemove(list this)
{
lnode *ptr = 0;
@@ -268,4 +409,135 @@ list listClear(list this)
return this;
}
+#ifdef TEST
+
+void listForAll(list this, void (*f)(void *))
+{
+ lnode *ptr = this->head;
+ while (ptr) {
+ f(ptr->value);
+ ptr = ptr->next;
+ }
+}
+
+
+#include <stdio.h>
+
+void printlist(list l)
+{
+ int saved;
+ assert(l != 0);
+ saved = listPosition(l);
+
+ printf("[ ");
+
+ if (!listIsEmpty(l)) {
+ listToFirst(l);
+ do {
+ printf("%d ", (int) listCurrent(l));
+ } while (listNext(l));
+ }
+
+ printf("]\n");
+
+ listPositionAt(l, saved);
+}
+
+void printstringlist(list l)
+{
+ int saved;
+ assert(l != 0);
+ saved = listPosition(l);
+
+ printf("[ ");
+
+ if (!listIsEmpty(l)) {
+ listToFirst(l);
+ do {
+ printf("'%s' ", (char *) listCurrent(l));
+ } while (listNext(l));
+ }
+
+ printf("]\n");
+
+ listPositionAt(l, saved);
+}
+
+void printstat(list l)
+{
+ printf("count: %d, position: %d, isEmpty: %d, atFirst: %d, atLast: %d.\n",
+ listCount(l), listPosition(l), listIsEmpty(l), listAtFirst(l), listAtLast(l));
+}
+
+void allfunc(void *e)
+{
+ printf("%d ", e);
+}
+
+void edtor(void *ptr)
+{
+ printf("element dtor: 0x%08x\n", ptr);
+ free(ptr);
+}
+
+int main()
+{
+ list l1, l2;
+ char *ptr;
+ int i;
+
+#ifdef MALLOC_TRACE
+ mal_leaktrace(1);
+ mal_debug(2);
+#endif
+
+ l1 = listNewEmpty();
+ printstat(l1);
+
+ listAppend(l1, 1);
+ printstat(l1);
+
+ listAppend(l1, 2);
+ printstat(l1);
+
+ listAppend(l1, 3);
+ printstat(l1);
+
+ printlist(l1);
+
+ listToFirst(l1);
+ listInsertBefore(l1, -5);
+ printlist(l1);
+
+ l2 = listNewCopy(l1);
+ printlist(l2);
+
+ listForAll(l2, allfunc);
+ printf("\n");
+
+ listClear(l1);
+ listSetElementDtor(l1, edtor);
+
+ for(i=0; i<10; i++) {
+ ptr = malloc(20);
+ snprintf(ptr, 20, "element # %d", i);
+ listAppend(l1, ptr);
+ }
+
+ printstringlist(l1);
+
+
+ listDispose(l1);
+ listDispose(l2);
+
+#ifdef MALLOC_TRACE
+ mal_dumpleaktrace(stdout);
+#endif
+
+
+ return 0;
+}
+#endif
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4e3f8ceb0cf2..aa6fd99301f6 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,6 +36,11 @@
*
*/
+#if OSL_DEBUG_LEVEL == 0
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+#endif
#include <assert.h>
#include <stdlib.h>
@@ -60,6 +65,10 @@
#include <osl/endian.h>
#include <algorithm>
+#ifdef TEST7
+#include <ctype.h>
+#endif
+
namespace vcl
{
@@ -85,7 +94,7 @@ struct PSPathElement
int x1, y1;
int x2, y2;
int x3, y3;
-
+
PSPathElement( PathSegmentType i_eType ) : type( i_eType ),
x1( 0 ), y1( 0 ),
x2( 0 ), y2( 0 ),
@@ -533,11 +542,11 @@ static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoin
/* printf("GetSimpleTTOutline(%d)\n", glyphID); */
- if( glyphID >= ttf->nglyphs ) /*- glyph is not present in the font */
+ if( glyphID >= ttf->nglyphs ) /*- glyph is not present in the font */
return 0;
const sal_uInt8* ptr = table + ttf->goffsets[glyphID];
const sal_Int16 numberOfContours = GetInt16(ptr, 0, 1);
- if( numberOfContours <= 0 ) /*- glyph is not simple */
+ if( numberOfContours <= 0 ) /*- glyph is not simple */
return 0;
if (metrics) { /*- GetCompoundTTOutline() calls this function with NULL metrics -*/
@@ -667,6 +676,10 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
glyphlist.push_back( index );
+#ifdef DEBUG2
+ fprintf(stderr,"glyphlist: += %d\n", index);
+#endif
+
if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, 0, &glyphlist)) == 0)
{
/* XXX that probably indicates a corrupted font */
@@ -676,6 +689,18 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
#endif
}
+#ifdef DEBUG2
+ fprintf(stderr,"%d [", (int)glyphlist.size() );
+ for( std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
+ it != glyphlist.end(); ++it )
+ {
+ fprintf( stderr,"%d ", (int) *it );
+ }
+ fprintf(stderr, "]\n");
+ if( ! glyphlist.empty() )
+ fprintf(stderr, "glyphlist: -= %d\n", (int) glyphlist.back());
+
+#endif
if( ! glyphlist.empty() )
glyphlist.pop_back();
@@ -705,14 +730,23 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
b = c = 0;
if (flags & WE_HAVE_A_SCALE) {
+#ifdef DEBUG2
+ fprintf(stderr, "WE_HAVE_A_SCALE\n");
+#endif
a = GetInt16(ptr, 0, 1) << 2;
d = a;
ptr += 2;
} else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
+#ifdef DEBUG2
+ fprintf(stderr, "WE_HAVE_AN_X_AND_Y_SCALE\n");
+#endif
a = GetInt16(ptr, 0, 1) << 2;
d = GetInt16(ptr, 2, 1) << 2;
ptr += 4;
} else if (flags & WE_HAVE_A_TWO_BY_TWO) {
+#ifdef DEBUG2
+ fprintf(stderr, "WE_HAVE_A_TWO_BY_TWO\n");
+#endif
a = GetInt16(ptr, 0, 1) << 2;
b = GetInt16(ptr, 2, 1) << 2;
c = GetInt16(ptr, 4, 1) << 2;
@@ -738,6 +772,18 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
assert(!"ARGS_ARE_XY_VALUES is not implemented!!!\n");
}
+#ifdef DEBUG2
+ fprintf(stderr, "a: %f, b: %f, c: %f, d: %f, e: %f, f: %f, m: %f, n: %f\n",
+ ((double) a) / 65536,
+ ((double) b) / 65536,
+ ((double) c) / 65536,
+ ((double) d) / 65536,
+ ((double) e) / 65536,
+ ((double) f) / 65536,
+ ((double) m) / 65536,
+ ((double) n) / 65536);
+#endif
+
for (i=0; i<np; i++) {
F16Dot16 t;
ControlPoint cp;
@@ -747,6 +793,10 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
t = fixedMulDiv(b, nextComponent[i].x << 16, n) + fixedMulDiv(d, nextComponent[i].y << 16, n) + (f << 16);
cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
+#ifdef DEBUG2
+ fprintf(stderr, "( %d %d ) -> ( %d %d )\n", nextComponent[i].x, nextComponent[i].y, cp.x, cp.y);
+#endif
+
myPoints.push_back( cp );
}
@@ -760,7 +810,7 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
pa = (ControlPoint*)calloc(np, sizeof(ControlPoint));
assert(pa != 0);
-
+
memcpy( pa, &myPoints[0], np*sizeof(ControlPoint) );
*pointArray = pa;
@@ -808,6 +858,21 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist ? *glyphlist : aPrivList );
}
+#ifdef DEBUG3
+ {
+ int i;
+ FILE *out = fopen("points.dat", "a");
+ assert(out != 0);
+ fprintf(out, "Glyph: %d\nPoints: %d\n", glyphID, res);
+ for (i=0; i<res; i++) {
+ fprintf(out, "%c ", ((*pointArray)[i].flags & 0x8000) ? 'X' : '.');
+ fprintf(out, "%c ", ((*pointArray)[i].flags & 1) ? '+' : '-');
+ fprintf(out, "%d %d\n", (*pointArray)[i].x, (*pointArray)[i].y);
+ }
+ fclose(out);
+ }
+#endif
+
return res;
}
@@ -1113,7 +1178,7 @@ static void GetNames(TrueTypeFont *t)
{
t->subfamily = strdup("");
}
-
+
/* #i60349# sanity check psname
* psname parctically has to be 7bit ascii and should not contains spaces
* there is a class of broken fonts which do not fullfill that at all, so let's try
@@ -1268,7 +1333,7 @@ static sal_uInt32 getGlyph4(const sal_uInt8 *cmap, sal_uInt32 c) {
sal_uInt16 * idDelta;
/* sal_uInt16 * glyphIdArray; */
sal_uInt16 * idRangeOffset;
- /*sal_uInt16 * glyphIndexArray;*/
+ sal_uInt16 * glyphIndexArray;
sal_uInt16 *CMAP4 = (sal_uInt16 *) cmap;
/* sal_uInt16 GEbinsearch(sal_uInt16 *ar, sal_uInt16 length, sal_uInt16 toSearch); */
@@ -1286,7 +1351,7 @@ static sal_uInt32 getGlyph4(const sal_uInt8 *cmap, sal_uInt32 c) {
}
idDelta = startCode + segCount;
idRangeOffset = idDelta + segCount;
- /*glyphIndexArray = idRangeOffset + segCount;*/
+ glyphIndexArray = idRangeOffset + segCount;
if(Int16FromMOTA(idRangeOffset[i]) != 0) {
c = Int16FromMOTA(*(&(idRangeOffset[i]) + (Int16FromMOTA(idRangeOffset[i])/2 + (c - Int16FromMOTA(startCode[i])))));
@@ -1345,7 +1410,7 @@ static void FindCmap(TrueTypeFont *ttf)
for (i = 0; i < ncmaps; i++) {
sal_uInt32 offset;
sal_uInt16 pID, eID;
-
+
/* sanity check, cmap entry must lie within table */
if( i*8+4 > table_size )
break;
@@ -1353,14 +1418,14 @@ static void FindCmap(TrueTypeFont *ttf)
pID = GetUInt16(table, 4 + i * 8, 1);
eID = GetUInt16(table, 6 + i * 8, 1);
offset = GetUInt32(table, 8 + i * 8, 1);
-
+
/* sanity check, cmap must lie within file */
if( (table - ttf->ptr) + offset > (sal_uInt32)ttf->fsize )
continue;
/* Unicode tables in Apple fonts */
if (pID == 0) {
- AppleUni = offset;
+ AppleUni = offset;
}
if (pID == 3) {
@@ -1434,7 +1499,7 @@ static void GetKern(TrueTypeFont *ttf)
if( !table )
goto badtable;
- if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with sal_uInt16 version and nTables fields */
+ if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with USHORT 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);
@@ -1481,6 +1546,79 @@ static void GetKern(TrueTypeFont *ttf)
return;
}
+#ifdef TEST5
+/* KernGlyphsPrim?() functions expect the caller to ensure the validity of their arguments and
+ * that x and y elements of the kern array are initialized to zeroes
+ */
+static void KernGlyphsPrim1(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
+{
+ (void)ttf; /* avoid warning */
+ (void)glyphs; /* avoid warning */
+ (void)nglyphs; /* avoid warning */
+ (void)wmode; /* avoid warning */
+ (void)nglyphs; /* avoid warning */
+ (void)kern; /* avoid warning */
+ fprintf(stderr, "MacOS kerning tables have not been implemented yet!\n");
+}
+
+static void KernGlyphsPrim2(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
+{
+ sal_uInt32 i, j;
+ sal_uInt32 gpair;
+
+ if( ! nglyphs )
+ return;
+
+ for (i = 0; i < (sal_uInt32)nglyphs - 1; i++) {
+ gpair = (glyphs[i] << 16) | glyphs[i+1];
+#ifdef DEBUG2
+ /* All fonts with MS kern table that I've seen so far contain just one kern subtable.
+ * MS kern documentation is very poor and I doubt that font developers will be using
+ * several subtables. I expect them to be using OpenType tables instead.
+ * According to MS documention, format 2 subtables are not supported by Windows and OS/2.
+ */
+ if (ttf->nkern > 1) {
+ fprintf(stderr, "KernGlyphsPrim2: %d kern tables found.\n", ttf->nkern);
+ }
+#endif
+ for (j = 0; j < ttf->nkern; j++) {
+ sal_uInt16 coverage = GetUInt16(ttf->kerntables[j], 4, 1);
+ sal_uInt8 *ptr;
+ int npairs;
+ sal_uInt32 t;
+ int l, r, k;
+
+ if (! ((coverage & 1) ^ wmode)) continue;
+ if ((coverage & 0xFFFE) != 0) {
+#ifdef DEBUG2
+ fprintf(stderr, "KernGlyphsPrim2: coverage flags are not supported: %04X.\n", coverage);
+#endif
+ continue;
+ }
+ ptr = ttf->kerntables[j];
+ npairs = GetUInt16(ptr, 6, 1);
+ ptr += 14;
+ l = 0;
+ r = npairs;
+ do {
+ k = (l + r) >> 1;
+ t = GetUInt32(ptr, k * 6, 1);
+ if (gpair >= t) l = k + 1;
+ if (gpair <= t) r = k - 1;
+ } while (l <= r);
+ if (l - r == 2) {
+ if (!wmode) {
+ kern[i].x = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
+ } else {
+ kern[i].y = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
+ }
+ /* !wmode ? kern[i].x : kern[i].y = GetInt16(ptr, 4 + (l-1) * 6, 1); */
+ }
+ }
+ }
+}
+#endif
+
/*- Public functions */ /*FOLD00*/
int CountTTCFonts(const char* fname)
@@ -1522,7 +1660,7 @@ int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf )
struct stat st;
if (!fname || !*fname) return SF_BADFILE;
-
+
allocTrueTypeFont( ttf );
if( ! *ttf )
return SF_MEMORY;
@@ -1562,7 +1700,7 @@ int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf )
goto cleanup;
}
close(fd);
-
+
return doOpenTTFont( facenum, *ttf );
cleanup:
@@ -1580,12 +1718,12 @@ int OpenTTFontBuffer(void* pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTyp
allocTrueTypeFont( ttf );
if( *ttf == NULL )
return SF_MEMORY;
-
+
(*ttf)->fname = NULL;
(*ttf)->fsize = nLen;
(*ttf)->ptr = (sal_uInt8*)pBuffer;
-
- return doOpenTTFont( facenum, *ttf );
+
+ return doOpenTTFont( facenum, *ttf );
}
static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
@@ -1616,6 +1754,10 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
return SF_TTFORMAT;
}
+#ifdef DEBUG2
+ fprintf(stderr, "tdoffset: %d\n", tdoffset);
+#endif
+
/* magic number */
t->tag = TTFontClassTag;
@@ -1670,8 +1812,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
if( !pHead )
return SF_TTFORMAT;
/* limit Head candidate to TTC extract's limits */
- if( pHead > t->ptr + (t->fsize - 54) )
- pHead = t->ptr + (t->fsize - 54);
+ if( pHead > t->ptr + (t->fsize - 54) )
+ pHead = t->ptr + (t->fsize - 54);
/* TODO: find better method than searching head table's magic */
sal_uInt8* p = NULL;
for( p = pHead + 12; p > t->ptr; --p ) {
@@ -1695,12 +1837,12 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
* tables, but this would be quite time intensive.
* Try to fix tables, so we can cope with minor problems.
*/
-
+
if( (sal_uInt8*)t->tables[i] < t->ptr )
{
#if OSL_DEBUG_LEVEL > 1
if( t->tables[i] )
- fprintf( stderr, "font file %s has bad table offset %" SAL_PRI_PTRDIFFT "d (tagnum=%d)\n", t->fname, (sal_uInt8*)t->tables[i]-t->ptr, i );
+ fprintf( stderr, "font file %s has bad table offset %d (tagnum=%d)\n", t->fname, (sal_uInt8*)t->tables[i]-t->ptr, i );
#endif
t->tlens[i] = 0;
t->tables[i] = NULL;
@@ -1752,7 +1894,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
for( i = 0; i <= (int)t->nglyphs; ++i )
t->goffsets[i] = indexfmt ? GetUInt32(table, i << 2, 1) : (sal_uInt32)GetUInt16(table, i << 1, 1) << 1;
- } else if( getTable(t, O_CFF) ) { /* PS-OpenType */
+ } else if( getTable(t, O_CFF) ) { /* PS-OpenType */
t->goffsets = (sal_uInt32 *) calloc(1+t->nglyphs, sizeof(sal_uInt32));
/* TODO: implement to get subsetting */
assert(t->goffsets != 0);
@@ -1777,6 +1919,8 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
void CloseTTFont(TrueTypeFont *ttf) /*FOLD01*/
{
+ if (ttf->tag != TTFontClassTag) return;
+
#if !defined(WIN32) && !defined(OS2)
if( ttf->fname )
munmap((char *) ttf->ptr, ttf->fsize);
@@ -1914,7 +2058,7 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
fprintf(outf, h02, modname, modver, modextra);
fprintf(outf, h09, ttf->psname);
- fprintf(outf, "%s", h10);
+ fprintf(outf, h10);
fprintf(outf, h11, fname);
/* fprintf(outf, h12, 4000000); */
@@ -1929,17 +2073,17 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
*/
fprintf(outf, h17, rtl_crc32(0, ttf->ptr, ttf->fsize), nGlyphs, rtl_crc32(0, glyphArray, nGlyphs * 2), rtl_crc32(0, encoding, nGlyphs));
- fprintf(outf, "%s", h13);
+ fprintf(outf, h13);
fprintf(outf, h14, XUnits(UPEm, GetInt16(table, 36, 1)), XUnits(UPEm, GetInt16(table, 38, 1)), XUnits(UPEm, GetInt16(table, 40, 1)), XUnits(UPEm, GetInt16(table, 42, 1)));
- fprintf(outf, "%s", h15);
+ fprintf(outf, h15);
for (i = 0; i < nGlyphs; i++) {
fprintf(outf, h16, encoding[i], i);
}
fprintf(outf, h30, nGlyphs+1);
- fprintf(outf, "%s", h31);
- fprintf(outf, "%s", h32);
+ fprintf(outf, h31);
+ fprintf(outf, h32);
for (i = 0; i < nGlyphs; i++) {
fprintf(outf, h33, i);
@@ -1987,14 +2131,14 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
}
if (n > 0) fprintf(outf, "\tfill\n"); /* if glyph is not a whitespace character */
- fprintf(outf, "%s", h34);
+ fprintf(outf, h34);
free(pa);
free(path);
}
- fprintf(outf, "%s", h35);
+ fprintf(outf, h35);
- fprintf(outf, "%s", h40);
+ fprintf(outf, h40);
fprintf(outf, h41, fname);
return SF_OK;
@@ -2090,7 +2234,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
for (i = 0; i < nGlyphs; i++) {
gID[i] = glyfAdd(glyf, GetTTRawGlyphData(ttf, glyphArray[i]), ttf);
}
-
+
/** cmap **/
cmap = TrueTypeTableNew_cmap();
@@ -2597,6 +2741,23 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
}
}
+#ifdef TEST5
+void KernGlyphs(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
+{
+ int i;
+
+ if (!nglyphs || !glyphs || !kern) return;
+
+ for (i = 0; i < nglyphs-1; i++) kern[i].x = kern[i].y = 0;
+
+ switch (ttf->kerntype) {
+ case KT_APPLE_NEW: KernGlyphsPrim1(ttf, glyphs, nglyphs, wmode, kern); return;
+ case KT_MICROSOFT: KernGlyphsPrim2(ttf, glyphs, nglyphs, wmode, kern); return;
+ default: return;
+ }
+}
+#endif
+
GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
{
const sal_uInt8* glyf = getTable(ttf, O_glyf);
@@ -2701,6 +2862,10 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
}
else
{
+#ifdef DEBUG
+ fprintf( stderr, "found invalid name record %d with name id %d for file %s\n",
+ i, rec[i].nameID, ttf->fname );
+#endif
rec[i].sptr = 0;
rec[i].slen = 0;
}
@@ -2725,54 +2890,424 @@ void DisposeNameRecords(NameRecord* nr, int n)
free(nr);
}
-bool getTTCoverage(
- boost::dynamic_bitset<sal_uInt32> &rUnicodeRange,
- boost::dynamic_bitset<sal_uInt32> &rCodePageRange,
- const unsigned char* pTable, size_t nLength)
+} // namespace vcl
+
+
+#ifdef TEST1
+/* This example creates a subset of a TrueType font with two encoded characters */
+int main(int ac, char **av)
{
- bool bRet = false;
- sal_uInt16 nVersion = GetUInt16(pTable, 0, 1);
- // parse OS/2 header
- if ( nVersion >= 0x0001 && nLength >= 58 )
- {
- rUnicodeRange.append(GetUInt32(pTable, 42, 1));
- rUnicodeRange.append(GetUInt32(pTable, 46, 1));
- rUnicodeRange.append(GetUInt32(pTable, 50, 1));
- rUnicodeRange.append(GetUInt32(pTable, 54, 1));
- bRet = true;
- if (nLength >= 86)
- {
- rCodePageRange.append(GetUInt32(pTable, 78, 1));
- rCodePageRange.append(GetUInt32(pTable, 82, 1));
+ TrueTypeFont *fnt;
+ int r;
+
+ /* Array of Unicode source characters */
+ sal_uInt16 chars[2];
+
+ /* Encoding vector maps character encoding to the ordinal number
+ * of the glyph in the output file */
+ sal_uInt8 encoding[2];
+
+ /* This array is for glyph IDs that source characters map to */
+ sal_uInt16 g[2];
+
+
+ if (ac < 2) return 0;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+
+ /* We want to create the output file that only contains two Unicode characters:
+ * L'a' and L'A' */
+
+ chars[0] = L'a';
+ chars[1] = L'A';
+
+ /* Figure out what glyphs do these characters map in our font */
+ MapString(fnt, chars, 2, g);
+
+ /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
+ * newly generated font */
+ encoding[0] = chars[0];
+ encoding[1] = chars[1];
+
+
+ /* Generate a subset */
+ CreateT3FromTTGlyphs(fnt, stdout, 0, g, encoding, 2, 0);
+
+ /* Now call the dtor for the font */
+ CloseTTFont(fnt);
+ return 0;
+}
+#endif
+
+#ifdef TEST2
+/* This example extracts first 224 glyphs from a TT fonts and encodes them starting at 32 */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ int i, r;
+
+ /* Array of Unicode source characters */
+ sal_uInt16 glyphs[224];
+
+ /* Encoding vector maps character encoding to the ordinal number
+ * of the glyph in the output file */
+ sal_uInt8 encoding[224];
+
+
+
+ for (i=0; i<224; i++) {
+ glyphs[i] = i;
+ encoding[i] = 32 + i;
+ }
+
+ if (ac < 2) return 0;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+
+ /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
+ * newly generated font */
+
+ /* Generate a subset */
+ CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 224, 0);
+
+ /* Now call the dtor for the font */
+ CloseTTFont(fnt);
+ return 0;
+}
+#endif
+
+#ifdef TEST3
+/* Glyph metrics example */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ int i, r;
+ sal_uInt16 glyphs[224];
+ TTSimpleGlyphMetrics *m;
+
+ for (i=0; i<224; i++) {
+ glyphs[i] = i;
+ }
+
+ if (ac < 2) return 0;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ if ((m = GetTTSimpleGlyphMetrics(fnt, glyphs, 224, 0)) == 0) {
+ printf("Requested metrics is not available\n");
+ } else {
+ for (i=0; i<224; i++) {
+ printf("%d. advWid: %5d, LSBear: %5d\n", i, m[i].adv, m[i].sb);
}
}
- return bRet;
+
+ /* Now call the dtor for the font */
+ free(m);
+ CloseTTFont(fnt);
+ return 0;
}
+#endif
-void getTTScripts(std::vector< sal_uInt32 > &rScriptTags, const unsigned char* pTable, size_t nLength)
+#ifdef TEST4
+int main(int ac, char **av)
{
- if (nLength < 6)
- return;
+ TrueTypeFont *fnt;
+ TTGlobalFontInfo info;
+ int i, r;
- // parse GSUB/GPOS header
- const sal_uInt16 nOfsScriptList = GetUInt16(pTable, 4, 1);
- // parse Script Table
- const sal_uInt16 nCntScript = GetUInt16(pTable, nOfsScriptList, 1);
- sal_uInt32 nCurrentPos = nOfsScriptList+2;
- for( sal_uInt16 nScriptIndex = 0;
- nScriptIndex < nCntScript && nLength >= 6; ++nScriptIndex,
- nLength-=6 )
- {
- sal_uInt32 nTag = GetUInt32(pTable, nCurrentPos, 1);
- nCurrentPos+=6;
- rScriptTags.push_back(nTag); // e.g. hani/arab/kana/hang
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ printf("Font file: %s\n", av[1]);
+
+#ifdef PRINT_KERN
+ switch (fnt->kerntype) {
+ case KT_MICROSOFT:
+ printf("\tkern: MICROSOFT, ntables: %d.", fnt->nkern);
+ if (fnt->nkern) {
+ printf(" [");
+ for (i=0; i<fnt->nkern; i++) {
+ printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
+ }
+ printf("]");
+ }
+ printf("\n");
+ break;
+
+ case KT_APPLE_NEW:
+ printf("\tkern: APPLE_NEW, ntables: %d.", fnt->nkern);
+ if (fnt->nkern) {
+ printf(" [");
+ for (i=0; i<fnt->nkern; i++) {
+ printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
+ }
+ printf("]");
+ }
+ printf("\n");
+ break;
+
+ case KT_NONE:
+ printf("\tkern: none.\n");
+ break;
+
+ default:
+ printf("\tkern: unrecoginzed.\n");
+ break;
}
+ printf("\n");
+#endif
- std::sort(rScriptTags.begin(), rScriptTags.end());
- rScriptTags.erase(std::unique(rScriptTags.begin(), rScriptTags.end()), rScriptTags.end());
+ GetTTGlobalFontInfo(fnt, &info);
+ printf("\tfamily name: `%s`\n", info.family);
+ printf("\tsubfamily name: `%s`\n", info.subfamily);
+ printf("\tpostscript name: `%s`\n", info.psname);
+ printf("\tweight: %d\n", info.weight);
+ printf("\twidth: %d\n", info.width);
+ printf("\tpitch: %d\n", info.pitch);
+ printf("\titalic angle: %d\n", info.italicAngle);
+ printf("\tbouding box: [%d %d %d %d]\n", info.xMin, info.yMin, info.xMax, info.yMax);
+ printf("\tascender: %d\n", info.ascender);
+ printf("\tdescender: %d\n", info.descender);
+ printf("\tlinegap: %d\n", info.linegap);
+ printf("\tvascent: %d\n", info.vascent);
+ printf("\tvdescent: %d\n", info.vdescent);
+ printf("\ttypoAscender: %d\n", info.typoAscender);
+ printf("\ttypoDescender: %d\n", info.typoDescender);
+ printf("\ttypoLineGap: %d\n", info.typoLineGap);
+ printf("\twinAscent: %d\n", info.winAscent);
+ printf("\twinDescent: %d\n", info.winDescent);
+ printf("\tUnicode ranges:\n");
+ for (i = 0; i < 32; i++) {
+ if ((info.ur1 >> i) & 1) {
+ printf("\t\t\t%s\n", UnicodeRangeName(i));
+ }
+ }
+ for (i = 0; i < 32; i++) {
+ if ((info.ur2 >> i) & 1) {
+ printf("\t\t\t%s\n", UnicodeRangeName(i+32));
+ }
+ }
+ for (i = 0; i < 32; i++) {
+ if ((info.ur3 >> i) & 1) {
+ printf("\t\t\t%s\n", UnicodeRangeName(i+64));
+ }
+ }
+ for (i = 0; i < 32; i++) {
+ if ((info.ur4 >> i) & 1) {
+ printf("\t\t\t%s\n", UnicodeRangeName(i+96));
+ }
+ }
+
+ CloseTTFont(fnt);
+ return 0;
}
+#endif
+
+#ifdef TEST5
+/* Kerning example */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ sal_uInt16 g[224];
+ KernData d[223];
+ int r, i, k = 0;
+
+ g[k++] = 11;
+ g[k++] = 36;
+ g[k++] = 11;
+ g[k++] = 98;
+ g[k++] = 11;
+ g[k++] = 144;
+ g[k++] = 41;
+ g[k++] = 171;
+ g[k++] = 51;
+ g[k++] = 15;
+
+ if (ac < 2) return 0;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ KernGlyphs(fnt, g, k, 0, d);
+
+ for (i = 0; i < k-1; i++) {
+ printf("%3d %3d: [%3d %3d]\n", g[i], g[i+1], d[i].x, d[i].y);
+ }
+
+ CloseTTFont(fnt);
+ return 0;
+}
+#endif
+
+
+
+#ifdef TEST6
+/* This example extracts a single glyph from a font */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ int r, i;
+
+ sal_uInt16 glyphs[256];
+ sal_uInt8 encoding[256];
+
+ for (i=0; i<256; i++) {
+ glyphs[i] = 512 + i;
+ encoding[i] = i;
+ }
+
+ if (ac < 2) return 0;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ /* Generate a subset */
+ CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 256, 0);
+
+ fprintf(stderr, "UnitsPerEm: %d.\n", fnt->unitsPerEm);
+
+ /* Now call the dtor for the font */
+ CloseTTFont(fnt);
+ return 0;
+}
+#endif
+
+#ifdef TEST7
+/* NameRecord extraction example */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ int r, i, j, n;
+ NameRecord *nr;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ if ((n = GetTTNameRecords(fnt, &nr)) == 0) {
+ fprintf(stderr, "No name records in the font.\n");
+ return 0;
+ }
+
+ printf("Number of name records: %d.\n", n);
+ for (i = 0; i < n; i++) {
+ printf("%d %d %04X %d [", nr[i].platformID, nr[i].encodingID, nr[i].languageID, nr[i].nameID);
+ for (j=0; j<nr[i].slen; j++) {
+ printf("%c", isprint(nr[i].sptr[j]) ? nr[i].sptr[j] : '.');
+ }
+ printf("]\n");
+ }
+
+
+ DisposeNameRecords(nr, n);
+ CloseTTFont(fnt);
+ return 0;
+}
+#endif
+
+#ifdef TEST8
+/* TrueType -> TrueType subsetting */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ sal_uInt16 glyphArray[] = { 0, 98, 99, 22, 24, 25, 26, 27, 28, 29, 30, 31, 1270, 1289, 34};
+ sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
+ int r;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ CreateTTFromTTGlyphs(fnt, "subfont.ttf", glyphArray, encoding, 15, 0, 0, TTCF_AutoName | TTCF_IncludeOS2);
+
+
+ CloseTTFont(fnt);
+
+ return 0;
+}
+#endif
+
+#ifdef TEST9
+/* TrueType -> Type42 subsetting */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ /*
+ sal_uInt16 glyphArray[] = { 0, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34};
+ sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
+ */
+ sal_uInt16 glyphArray[] = { 0, 6711, 6724, 11133, 11144, 14360, 26, 27, 28, 29, 30, 31, 1270, 1289, 34};
+ sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
+ int r;
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ CreateT42FromTTGlyphs(fnt, stdout, "testfont", glyphArray, encoding, 15);
+
+ CloseTTFont(fnt);
+
+ return 0;
+}
+#endif
+
+#ifdef TEST10
+/* Component glyph test */
+int main(int ac, char **av)
+{
+ TrueTypeFont *fnt;
+ int r, i;
+ list glyphlist = listNewEmpty();
+
+
+ if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
+ fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
+ return 0;
+ }
+
+ for (i = 0; i < fnt->nglyphs; i++) {
+ r = GetTTGlyphComponents(fnt, i, glyphlist);
+ if (r > 1) {
+ printf("%d -> ", i);
+ listToFirst(glyphlist);
+ do {
+ printf("%d ", (int) listCurrent(glyphlist));
+ } while (listNext(glyphlist));
+ printf("\n");
+ } else {
+ printf("%d: single glyph.\n", i);
+ }
+ listClear(glyphlist);
+ }
+
+ CloseTTFont(fnt);
+ listDispose(glyphlist);
+
+ return 0;
+}
+#endif
-} // namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 7a785b9bf99f..8235c3a27e82 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,7 +57,7 @@ namespace vcl
sal_uInt32 tag; /**< TrueType file tag */
list tables; /**< List of table tags and pointers */
};
-
+
/* These must be #defined so that they can be used in initializers */
#define T_maxp 0x6D617870
#define T_glyf 0x676C7966
@@ -168,7 +168,7 @@ _inline void PutInt16(sal_Int16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bige
ptr[offset] = (sal_uInt8)(val & 0xFF);
}
}
-
+
_inline void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian)
{
assert(ptr != 0);
@@ -240,7 +240,7 @@ static int NameRecordCompareF(const void *l, const void *r)
}
return 0;
}
-
+
static sal_uInt32 CheckSum(sal_uInt32 *ptr, sal_uInt32 length)
{
@@ -293,7 +293,7 @@ int AddTable(TrueTypeCreator *_this, TrueTypeTable *table)
void RemoveTable(TrueTypeCreator *_this, sal_uInt32 tag)
{
int done = 0;
-
+
if (listCount(_this->tables)) {
listToFirst(_this->tables);
do {
@@ -317,16 +317,16 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
sal_uInt32 *p;
int i=0, n;
sal_uInt8 *head = NULL; /* saved pointer to the head table data for checkSumAdjustment calculation */
-
+
if ((n = listCount(_this->tables)) == 0) return SF_TTFORMAT;
ProcessTables(_this);
/* ProcessTables() adds 'loca' and 'hmtx' */
-
+
n = listCount(_this->tables);
numTables = (sal_uInt16) n;
-
+
TableEntry* te = (TableEntry*)scalloc(n, sizeof(TableEntry));
@@ -337,7 +337,7 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
}
qsort(te, n, sizeof(TableEntry), TableEntryCompareF);
-
+
do {
searchRange *= 2;
entrySelector++;
@@ -387,7 +387,7 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
*ptr = ttf;
*length = s;
-
+
return SF_OK;
}
@@ -477,12 +477,12 @@ typedef struct {
sal_uInt32 isFixedPitch;
void *ptr; /* format-specific pointer */
} tdata_post;
-
+
/* allocate memory for a TT table */
static sal_uInt8 *ttmalloc(sal_uInt32 nbytes)
{
- sal_uInt32 n;
+ sal_uInt32 n;
n = (nbytes + 3) & (sal_uInt32) ~3;
sal_uInt8* res = (sal_uInt8*)malloc(n);
@@ -491,7 +491,7 @@ static sal_uInt8 *ttmalloc(sal_uInt32 nbytes)
return res;
}
-
+
static void FreeGlyphData(void *ptr)
{
GlyphData *p = (GlyphData *) ptr;
@@ -560,7 +560,7 @@ static void TrueTypeTableDispose_cmap(TrueTypeTable *_this)
table_cmap *t;
CmapSubTable *s;
sal_uInt32 i;
-
+
if (_this) {
t = (table_cmap *) _this->data;
if (t) {
@@ -618,7 +618,7 @@ static struct {
{T_cmap, TrueTypeTableDispose_cmap},
{T_name, TrueTypeTableDispose_name},
{T_post, TrueTypeTableDispose_post}
-
+
};
static int GetRawData_generic(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt32 *tag)
@@ -639,7 +639,7 @@ static int GetRawData_head(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
*len = TABLESIZE_head;
*ptr = (sal_uInt8 *) _this->data;
*tag = T_head;
-
+
return TTCR_OK;
}
@@ -648,7 +648,7 @@ static int GetRawData_hhea(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
*len = TABLESIZE_hhea;
*ptr = (sal_uInt8 *) _this->data;
*tag = T_hhea;
-
+
return TTCR_OK;
}
@@ -674,7 +674,7 @@ static int GetRawData_maxp(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
*len = TABLESIZE_maxp;
*ptr = (sal_uInt8 *) _this->data;
*tag = T_maxp;
-
+
return TTCR_OK;
}
@@ -766,7 +766,7 @@ static sal_uInt8 *PackCmapType6(CmapSubTable *s, sal_uInt32 *length)
return ptr;
}
-
+
/* XXX it only handles Format 0 encoding tables */
static sal_uInt8 *PackCmap(CmapSubTable *s, sal_uInt32 *length)
@@ -863,7 +863,7 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
qsort(nr, n, sizeof(NameRecord), NameRecordCompareF);
int nameLen = stringLen + 12 * n + 6;
- sal_uInt8* name = (sal_uInt8*)ttmalloc(nameLen);
+ sal_uInt8* name = (sal_uInt8*)ttmalloc(nameLen);
PutUInt16(0, name, 0, 1);
PutUInt16(n, name, 2, 1);
@@ -927,9 +927,9 @@ static int GetRawData_post(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
return ret;
}
+
-
-
+
static struct {
sal_uInt32 tag;
@@ -945,10 +945,10 @@ static struct {
{T_cmap, GetRawData_cmap},
{T_name, GetRawData_name},
{T_post, GetRawData_post}
-
-
+
+
};
-
+
/*
* TrueTypeTable public methods
*/
@@ -969,11 +969,11 @@ TrueTypeTable *TrueTypeTableNew(sal_uInt32 tag,
const sal_uInt8* ptr)
{
TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
- tdata_generic* pdata = (tdata_generic*)smalloc(sizeof(tdata_generic));
+ tdata_generic* pdata = (tdata_generic*)smalloc(sizeof(tdata_generic));
pdata->nbytes = nbytes;
pdata->tag = tag;
if (nbytes) {
- pdata->ptr = ttmalloc(nbytes);
+ pdata->ptr = ttmalloc(nbytes);
memcpy(pdata->ptr, ptr, nbytes);
} else {
pdata->ptr = 0;
@@ -985,7 +985,7 @@ TrueTypeTable *TrueTypeTableNew(sal_uInt32 tag,
return table;
}
-
+
TrueTypeTable *TrueTypeTableNew_head(sal_uInt32 fontRevision,
sal_uInt16 flags,
sal_uInt16 unitsPerEm,
@@ -996,7 +996,7 @@ TrueTypeTable *TrueTypeTableNew_head(sal_uInt32 fontRevision,
{
assert(created != 0);
- TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
sal_uInt8* ptr = (sal_uInt8*)ttmalloc(TABLESIZE_head);
@@ -1040,7 +1040,7 @@ TrueTypeTable *TrueTypeTableNew_hhea(sal_Int16 ascender,
PutUInt16(0, ptr, 28, 1); /* reserved 4 */
PutUInt16(0, ptr, 30, 1); /* reserved 5 */
PutUInt16(0, ptr, 32, 1); /* metricDataFormat */
-
+
table->data = (void *) ptr;
table->tag = T_hhea;
table->rawdata = 0;
@@ -1070,7 +1070,7 @@ TrueTypeTable *TrueTypeTableNew_maxp( const sal_uInt8* maxp, int size)
if (maxp && size == TABLESIZE_maxp) {
memcpy(table->data, maxp, TABLESIZE_maxp);
}
-
+
table->tag = T_maxp;
table->rawdata = 0;
@@ -1081,7 +1081,7 @@ TrueTypeTable *TrueTypeTableNew_glyf(void)
{
TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
list l = listNewEmpty();
-
+
assert(l != 0);
listSetElementDtor(l, (list_destructor)FreeGlyphData);
@@ -1097,12 +1097,12 @@ TrueTypeTable *TrueTypeTableNew_cmap(void)
{
TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
table_cmap* cmap = (table_cmap*)smalloc(sizeof(table_cmap));
-
+
cmap->n = 0;
cmap->m = CMAP_SUBTABLE_INIT;
cmap->s = (CmapSubTable *) scalloc(CMAP_SUBTABLE_INIT, sizeof(CmapSubTable));
memset(cmap->s, 0, sizeof(CmapSubTable) * CMAP_SUBTABLE_INIT);
-
+
table->data = (table_cmap *) cmap;
table->rawdata = 0;
@@ -1138,7 +1138,7 @@ TrueTypeTable *TrueTypeTableNew_name(int n, NameRecord *nr)
{
TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
list l = listNewEmpty();
-
+
assert(l != 0);
listSetElementDtor(l, (list_destructor)DisposeNameRecord);
@@ -1207,7 +1207,7 @@ int GetRawData(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt3
assert(!"Unknwon TrueType table.\n");
return TTCR_UNKNOWN;
}
-
+
void cmapAdd(TrueTypeTable *table, sal_uInt32 id, sal_uInt32 c, sal_uInt32 g)
{
sal_uInt32 i, found;
@@ -1230,7 +1230,7 @@ void cmapAdd(TrueTypeTable *table, sal_uInt32 id, sal_uInt32 c, sal_uInt32 g)
if (!found) {
if (t->n == t->m) {
- CmapSubTable* tmp = (CmapSubTable*)scalloc(t->m + CMAP_SUBTABLE_INCR, sizeof(CmapSubTable));
+ CmapSubTable* tmp = (CmapSubTable*)scalloc(t->m + CMAP_SUBTABLE_INCR, sizeof(CmapSubTable));
memset(tmp, 0, t->m + CMAP_SUBTABLE_INCR * sizeof(CmapSubTable));
memcpy(tmp, s, sizeof(CmapSubTable) * t->m);
t->m += CMAP_SUBTABLE_INCR;
@@ -1336,7 +1336,7 @@ sal_uInt32 glyfCount(const TrueTypeTable *table)
assert(table->tag == T_glyf);
return listCount((list) table->data);
}
-
+
void nameAdd(TrueTypeTable *table, NameRecord *nr)
{
@@ -1426,10 +1426,10 @@ static void ProcessTables(TrueTypeCreator *tt)
z = GetInt16(gd->ptr, 4, 1);
if (z < yMin) yMin = z;
-
+
z = GetInt16(gd->ptr, 6, 1);
if (z > xMax) xMax = z;
-
+
z = GetInt16(gd->ptr, 8, 1);
if (z > yMax) yMax = z;
}
@@ -1441,14 +1441,14 @@ static void ProcessTables(TrueTypeCreator *tt)
if (gd->npoints > maxCompositePoints) maxCompositePoints = gd->npoints;
if (gd->ncontours > maxCompositeContours) maxCompositeContours = gd->ncontours;
}
-
+
} while (listNext(glyphlist));
indexToLocFormat = (glyfLen / 2 > 0xFFFF) ? 1 : 0;
locaLen = indexToLocFormat ? (nGlyphs + 1) << 2 : (nGlyphs + 1) << 1;
sal_uInt8* glyfPtr = ttmalloc(glyfLen);
- sal_uInt8* locaPtr = ttmalloc(locaLen);
+ sal_uInt8* locaPtr = ttmalloc(locaLen);
TTSimpleGlyphMetrics* met = (TTSimpleGlyphMetrics*)scalloc(nGlyphs, sizeof(TTSimpleGlyphMetrics));
i = 0;
@@ -1457,7 +1457,7 @@ static void ProcessTables(TrueTypeCreator *tt)
p2 = locaPtr;
do {
GlyphData *gd = (GlyphData *) listCurrent(glyphlist);
-
+
if (gd->compflag) { /* re-number all components */
sal_uInt16 flags, index;
sal_uInt8 *ptr = gd->ptr + 10;
@@ -1526,7 +1526,7 @@ static void ProcessTables(TrueTypeCreator *tt)
((tdata_loca *) loca->data)->nbytes = locaLen;
AddTable(tt, loca);
-
+
head = FindTable(tt, T_head);
sal_uInt8* const pHeadData = (sal_uInt8*)head->data;
PutInt16(xMin, pHeadData, 36, 1);
@@ -1577,7 +1577,7 @@ static void ProcessTables(TrueTypeCreator *tt)
}
} // namespace vcl
-
+
extern "C"
{
/**
@@ -1597,11 +1597,11 @@ extern "C"
{
/* XXX do a binary search */
unsigned int i;
-
+
assert(_this != 0);
-
+
if (_this->rawdata) free(_this->rawdata);
-
+
for(i=0; i < sizeof(vcl::vtable1)/sizeof(*vcl::vtable1); i++) {
if (_this->tag == vcl::vtable1[i].tag) {
vcl::vtable1[i].f(_this);
@@ -1611,7 +1611,7 @@ extern "C"
assert(!"Unknown TrueType table.\n");
}
}
-
+
#ifdef TEST_TTCR
int main(void)
diff --git a/vcl/source/fontsubset/ttcr.hxx b/vcl/source/fontsubset/ttcr.hxx
index b2beb0549174..41ab42fa74b9 100644
--- a/vcl/source/fontsubset/ttcr.hxx
+++ b/vcl/source/fontsubset/ttcr.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,7 +56,7 @@ namespace vcl
};
/** Error codes for most functions */
- enum TTCRErrCodes {
+ enum TTCRErrCodes {
TTCR_OK = 0, /**< no error */
TTCR_ZEROGLYPHS = 1, /**< At least one glyph should be defined */
TTCR_UNKNOWN = 2, /**< Unknown TrueType table */
@@ -213,7 +213,7 @@ namespace vcl
* Table manipulation functions
*
*------------------------------------------------------------------------------*/
-
+
/**
* Add a character/glyph pair to a cmap table
@@ -243,7 +243,7 @@ namespace vcl
*/
void nameAdd(TrueTypeTable *, NameRecord *nr);
-} // namespace
+} // namespace
extern "C"
diff --git a/vcl/source/fontsubset/xlat.cxx b/vcl/source/fontsubset/xlat.cxx
index 1df7a5a2fdde..9c442d5b0748 100644
--- a/vcl/source/fontsubset/xlat.cxx
+++ b/vcl/source/fontsubset/xlat.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,12 +38,12 @@ namespace { // anonymous namespace
class ConverterCache
{
public:
- explicit ConverterCache( void );
+ explicit ConverterCache( void );
~ConverterCache( void );
- sal_uInt16 convertOne( int nSelect, sal_Unicode );
- void convertStr( int nSelect, const sal_Unicode* pSrc, sal_uInt16* pDst, int nCount );
+ sal_uInt16 convertOne( int nSelect, sal_Unicode );
+ void convertStr( int nSelect, const sal_Unicode* pSrc, sal_uInt16* pDst, int nCount );
protected:
- void ensureConverter( int nSelect );
+ void ensureConverter( int nSelect );
private:
rtl_UnicodeToTextConverter maConverterCache[ MAX_CVT_SELECT+1 ];
rtl_UnicodeToTextContext maContexts[ MAX_CVT_SELECT+1 ];
@@ -192,22 +192,22 @@ sal_uInt16 TranslateChar16(sal_uInt16 src)
{
return aCC.convertOne( 6, src);
}
-
+
void TranslateString12(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
{
aCC.convertStr( 2, src, dst, n);
}
-
+
void TranslateString13(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
{
aCC.convertStr( 3, src, dst, n);
}
-
+
void TranslateString14(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
{
aCC.convertStr( 4, src, dst, n);
}
-
+
void TranslateString15(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
{
aCC.convertStr( 5, src, dst, n);
@@ -217,7 +217,7 @@ void TranslateString16(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
{
aCC.convertStr( 6, src, dst, n);
}
-
+
} // namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/xlat.hxx b/vcl/source/fontsubset/xlat.hxx
index 3d8622bf9ae7..700c15ff0efd 100644
--- a/vcl/source/fontsubset/xlat.hxx
+++ b/vcl/source/fontsubset/xlat.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index 6107affaf4e9..27a4862acd61 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,7 +59,7 @@ AlphaMask::AlphaMask( const AlphaMask& rAlphaMask ) :
// -----------------------------------------------------------------------------
-AlphaMask::AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency ) :
+AlphaMask::AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency ) :
Bitmap( rSizePixel, 8, &Bitmap::GetGreyPalette( 256 ) )
{
if( pEraseTransparency )
@@ -108,14 +108,14 @@ Bitmap AlphaMask::GetBitmap() const
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Crop( const Rectangle& rRectPixel )
+BOOL AlphaMask::Crop( const Rectangle& rRectPixel )
{
return Bitmap::Crop( rRectPixel );
}
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency )
+BOOL AlphaMask::Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency )
{
Color aColor;
@@ -127,15 +127,15 @@ sal_Bool AlphaMask::Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransp
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+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
// this optimization is possible because the palettes of AlphaMasks are always identical (8bit GreyPalette, see ctor)
- const Size aSizePix( GetSizePixel() );
- Rectangle aRectDst( rRectDst );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ Rectangle aRectDst( rRectDst );
+ BOOL bRet = FALSE;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -143,9 +143,9 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect
{
if( pAlphaSrc && ( *pAlphaSrc != *this ) )
{
- Bitmap* pSrc = (Bitmap*) pAlphaSrc;
- const Size aCopySizePix( pSrc->GetSizePixel() );
- Rectangle aRectSrc( rRectSrc );
+ Bitmap* pSrc = (Bitmap*) pAlphaSrc;
+ const Size aCopySizePix( pSrc->GetSizePixel() );
+ Rectangle aRectSrc( rRectSrc );
aRectSrc.Intersection( Rectangle( Point(), aCopySizePix ) );
@@ -159,11 +159,11 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect
if( pWriteAcc )
{
- const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcEndX = aRectSrc.Left() + nWidth;
- const long nSrcEndY = aRectSrc.Top() + nHeight;
- long nDstY = aRectDst.Top();
+ const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const long nSrcEndX = aRectSrc.Left() + nWidth;
+ const long nSrcEndY = aRectSrc.Top() + nHeight;
+ long nDstY = aRectDst.Top();
for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
@@ -185,20 +185,20 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect
if( !aRectSrc.IsEmpty() && ( aRectSrc != aRectDst ) )
{
- BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
+ BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcX = aRectSrc.Left();
- const long nSrcY = aRectSrc.Top();
- const long nSrcEndX1 = nSrcX + nWidth - 1L;
- const long nSrcEndY1 = nSrcY + nHeight - 1L;
- const long nDstX = aRectDst.Left();
- const long nDstY = aRectDst.Top();
- const long nDstEndX1 = nDstX + nWidth - 1L;
- const long nDstEndY1 = nDstY + nHeight - 1L;
+ const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const long nSrcX = aRectSrc.Left();
+ const long nSrcY = aRectSrc.Top();
+ const long nSrcEndX1 = nSrcX + nWidth - 1L;
+ const long nSrcEndY1 = nSrcY + nHeight - 1L;
+ const long nDstX = aRectDst.Left();
+ const long nDstY = aRectDst.Top();
+ const long nDstEndX1 = nDstX + nWidth - 1L;
+ const long nDstEndY1 = nDstY + nHeight - 1L;
if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
{
@@ -226,7 +226,7 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect
}
ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
}
@@ -238,26 +238,26 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Erase( sal_uInt8 cTransparency )
+BOOL AlphaMask::Erase( BYTE cTransparency )
{
return Bitmap::Erase( Color( cTransparency, cTransparency, cTransparency ) );
}
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Invert()
+BOOL AlphaMask::Invert()
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAcc && pAcc->GetBitCount() == 8 )
{
- BitmapColor aCol( 0 );
- const long nWidth = pAcc->Width(), nHeight = pAcc->Height();
- sal_uInt8* pMap = new sal_uInt8[ 256 ];
+ BitmapColor aCol( 0 );
+ const long nWidth = pAcc->Width(), nHeight = pAcc->Height();
+ BYTE* pMap = new BYTE[ 256 ];
for( long i = 0; i < 256; i++ )
- pMap[ i ] = ~(sal_uInt8) i;
+ pMap[ i ] = ~(BYTE) i;
for( long nY = 0L; nY < nHeight; nY++ )
{
@@ -269,7 +269,7 @@ sal_Bool AlphaMask::Invert()
}
delete[] pMap;
- bRet = sal_True;
+ bRet = TRUE;
}
if( pAcc )
@@ -280,16 +280,16 @@ sal_Bool AlphaMask::Invert()
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Mirror( sal_uLong nMirrorFlags )
+BOOL AlphaMask::Mirror( ULONG nMirrorFlags )
{
return Bitmap::Mirror( nMirrorFlags );
}
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+BOOL AlphaMask::Scale( const Size& rNewSize, ULONG nScaleFlag )
{
- sal_Bool bRet = Bitmap::Scale( rNewSize, nScaleFlag );
+ BOOL bRet = Bitmap::Scale( rNewSize, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -299,9 +299,9 @@ sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+BOOL AlphaMask::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
{
- sal_Bool bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
+ BOOL bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -311,25 +311,25 @@ sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uLo
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Rotate( long nAngle10, sal_uInt8 cFillTransparency )
+BOOL AlphaMask::Rotate( long nAngle10, BYTE cFillTransparency )
{
return Bitmap::Rotate( nAngle10, Color( cFillTransparency, cFillTransparency, cFillTransparency ) );
}
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency )
+BOOL AlphaMask::Replace( const Bitmap& rMask, BYTE cReplaceTransparency )
{
- BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pMaskAcc && pAcc )
{
- const BitmapColor aReplace( cReplaceTransparency );
- const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
- const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
- const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aReplace( cReplaceTransparency );
+ const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
+ const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
+ const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
@@ -345,14 +345,14 @@ sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong
+BOOL AlphaMask::Replace( BYTE cSearchTransparency, BYTE cReplaceTransparency, ULONG
#ifdef DBG_UTIL
nTol
#endif
)
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
DBG_ASSERT( !nTol, "AlphaMask::Replace: nTol not used yet" );
@@ -375,7 +375,7 @@ nTol
}
else
{
- BitmapColor aReplace( cReplaceTransparency );
+ BitmapColor aReplace( cReplaceTransparency );
for( long nY = 0L; nY < nHeight; nY++ )
{
@@ -387,7 +387,7 @@ nTol
}
}
- bRet = sal_True;
+ bRet = TRUE;
}
if( pAcc )
@@ -398,17 +398,17 @@ nTol
// -----------------------------------------------------------------------------
-sal_Bool AlphaMask::Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
- sal_uLong nColorCount, sal_uLong* pTols )
+BOOL AlphaMask::Replace( BYTE* pSearchTransparencies, BYTE* pReplaceTransparencies,
+ ULONG nColorCount, ULONG* pTols )
{
- Color* pSearchColors = new Color[ nColorCount ];
- Color* pReplaceColors = new Color[ nColorCount ];
- sal_Bool bRet;
+ Color* pSearchColors = new Color[ nColorCount ];
+ Color* pReplaceColors = new Color[ nColorCount ];
+ BOOL bRet;
- for( sal_uLong i = 0; i < nColorCount; i++ )
+ for( ULONG i = 0; i < nColorCount; i++ )
{
- const sal_uInt8 cSearchTransparency = pSearchTransparencies[ i ];
- const sal_uInt8 cReplaceTransparency = pReplaceTransparencies[ i ];
+ const BYTE cSearchTransparency = pSearchTransparencies[ i ];
+ const BYTE 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 63d0010bd5d2..7bd825fe04c2 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,16 +50,16 @@ DBG_NAME( Animation )
// - statics -
// -----------
-sal_uLong Animation::mnAnimCount = 0UL;
+ULONG Animation::mnAnimCount = 0UL;
// -------------------
// - AnimationBitmap -
// -------------------
-sal_uLong AnimationBitmap::GetChecksum() const
+ULONG AnimationBitmap::GetChecksum() const
{
- sal_uInt32 nCrc = aBmpEx.GetChecksum();
- SVBT32 aBT32;
+ sal_uInt32 nCrc = aBmpEx.GetChecksum();
+ SVBT32 aBT32;
UInt32ToSVBT32( aPosPix.X(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
@@ -90,13 +90,13 @@ sal_uLong AnimationBitmap::GetChecksum() const
// -------------
Animation::Animation() :
- mnLoopCount ( 0 ),
- mnLoops ( 0 ),
- mnPos ( 0 ),
- meCycleMode ( CYCLE_NORMAL ),
- mbIsInAnimation ( sal_False ),
- mbLoopTerminated ( sal_False ),
- mbIsWaiting ( sal_False )
+ mnLoopCount ( 0 ),
+ mnLoops ( 0 ),
+ mnPos ( 0 ),
+ meCycleMode ( CYCLE_NORMAL ),
+ mbIsInAnimation ( FALSE ),
+ mbLoopTerminated ( FALSE ),
+ mbIsWaiting ( FALSE )
{
DBG_CTOR( Animation, NULL );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
@@ -106,14 +106,14 @@ Animation::Animation() :
// -----------------------------------------------------------------------
Animation::Animation( const Animation& rAnimation ) :
- maBitmapEx ( rAnimation.maBitmapEx ),
- maGlobalSize ( rAnimation.maGlobalSize ),
- mnLoopCount ( rAnimation.mnLoopCount ),
- mnPos ( rAnimation.mnPos ),
- meCycleMode ( rAnimation.meCycleMode ),
- mbIsInAnimation ( sal_False ),
- mbLoopTerminated ( rAnimation.mbLoopTerminated ),
- mbIsWaiting ( rAnimation.mbIsWaiting )
+ maBitmapEx ( rAnimation.maBitmapEx ),
+ maGlobalSize ( rAnimation.maGlobalSize ),
+ mnLoopCount ( rAnimation.mnLoopCount ),
+ mnPos ( rAnimation.mnPos ),
+ meCycleMode ( rAnimation.meCycleMode ),
+ mbIsInAnimation ( FALSE ),
+ mbLoopTerminated ( rAnimation.mbLoopTerminated ),
+ mbIsWaiting ( rAnimation.mbIsWaiting )
{
DBG_CTOR( Animation, NULL );
@@ -166,24 +166,24 @@ Animation& Animation::operator=( const Animation& rAnimation )
// -----------------------------------------------------------------------
-sal_Bool Animation::operator==( const Animation& rAnimation ) const
+BOOL Animation::operator==( const Animation& rAnimation ) const
{
- const sal_uLong nCount = maList.Count();
- sal_Bool bRet = sal_False;
+ const ULONG nCount = maList.Count();
+ BOOL bRet = FALSE;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx == maBitmapEx &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- bRet = sal_True;
+ bRet = TRUE;
- for( sal_uLong n = 0; n < nCount; n++ )
+ for( ULONG n = 0; n < nCount; n++ )
{
if( ( *(AnimationBitmap*) maList.GetObject( n ) ) !=
( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
{
- bRet = sal_False;
+ bRet = FALSE;
break;
}
}
@@ -194,19 +194,19 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-sal_Bool Animation::IsEqual( const Animation& rAnimation ) const
+BOOL Animation::IsEqual( const Animation& rAnimation ) const
{
- const sal_uLong nCount = maList.Count();
- sal_Bool bRet = sal_False;
+ const ULONG nCount = maList.Count();
+ BOOL bRet = FALSE;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx.IsEqual( maBitmapEx ) &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ )
+ for( ULONG n = 0; ( n < nCount ) && !bRet; n++ )
if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -214,7 +214,7 @@ sal_Bool Animation::IsEqual( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-sal_Bool Animation::IsEmpty() const
+BOOL Animation::IsEmpty() const
{
return( maBitmapEx.IsEmpty() && !maList.Count() );
}
@@ -224,7 +224,7 @@ sal_Bool Animation::IsEmpty() const
void Animation::SetEmpty()
{
maTimer.Stop();
- mbIsInAnimation = sal_False;
+ mbIsInAnimation = FALSE;
maGlobalSize = Size();
maBitmapEx.SetEmpty();
@@ -246,11 +246,11 @@ void Animation::Clear()
// -----------------------------------------------------------------------
-sal_Bool Animation::IsTransparent() const
+BOOL Animation::IsTransparent() const
{
- Point aPoint;
- Rectangle aRect( aPoint, maGlobalSize );
- sal_Bool bRet = sal_False;
+ Point aPoint;
+ Rectangle aRect( aPoint, maGlobalSize );
+ BOOL bRet = FALSE;
// Falls irgendein 'kleines' Bildchen durch den Hintergrund
// ersetzt werden soll, muessen wir 'transparent' sein, um
@@ -262,7 +262,7 @@ sal_Bool Animation::IsTransparent() const
if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect )
{
- bRet = sal_True;
+ bRet = TRUE;
break;
}
}
@@ -275,9 +275,9 @@ sal_Bool Animation::IsTransparent() const
// -----------------------------------------------------------------------
-sal_uLong Animation::GetSizeBytes() const
+ULONG Animation::GetSizeBytes() const
{
- sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
+ ULONG nSizeBytes = GetBitmapEx().GetSizeBytes();
for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
{
@@ -290,10 +290,10 @@ sal_uLong Animation::GetSizeBytes() const
// -----------------------------------------------------------------------
-sal_uLong Animation::GetChecksum() const
+ULONG Animation::GetChecksum() const
{
- SVBT32 aBT32;
- sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
+ SVBT32 aBT32;
+ sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
UInt32ToSVBT32( maList.Count(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
@@ -318,7 +318,7 @@ sal_uLong Animation::GetChecksum() const
// -----------------------------------------------------------------------
-sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
+BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
return Start( pOut, rDestPt, pOut->PixelToLogic( maGlobalSize ), nExtraData, pFirstFrameOutDev );
@@ -326,18 +326,18 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtra
// -----------------------------------------------------------------------
-sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
+BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( maList.Count() )
{
if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) && !mbLoopTerminated &&
( ANIMATION_TIMEOUT_ON_CLICK != ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ) )
{
- ImplAnimView* pView;
- ImplAnimView* pMatch = NULL;
+ ImplAnimView* pView;
+ ImplAnimView* pMatch = NULL;
for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() )
{
@@ -362,7 +362,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = sal_False;
+ mbIsInAnimation = FALSE;
mnPos = 0UL;
}
@@ -372,13 +372,13 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size&
if( !mbIsInAnimation )
{
ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait );
- mbIsInAnimation = sal_True;
+ mbIsInAnimation = TRUE;
}
}
else
Draw( pOut, rDestPt, rDestSz );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -404,7 +404,7 @@ void Animation::Stop( OutputDevice* pOut, long nExtraData )
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = sal_False;
+ mbIsInAnimation = 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 sal_uLong nCount = maList.Count();
+ const 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 sal_uLong nOldPos = mnPos;
+ const 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( sal_uLong nTimeout )
+void Animation::ImplRestartTimer( ULONG nTimeout )
{
- maTimer.SetTimeout( Max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
+ maTimer.SetTimeout( Max( nTimeout, (ULONG)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
maTimer.Start();
}
@@ -451,12 +451,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout )
IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
{
- const sal_uLong nAnimCount = maList.Count();
+ const ULONG nAnimCount = maList.Count();
if( nAnimCount )
{
- ImplAnimView* pView;
- sal_Bool bGlobalPause = sal_True;
+ ImplAnimView* pView;
+ BOOL bGlobalPause = TRUE;
if( maNotifyLink.IsSet() )
{
@@ -482,7 +482,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
pView = (ImplAnimView*) pAInfo->pViewData;
pView->ImplPause( pAInfo->bPause );
- pView->ImplSetMarked( sal_True );
+ pView->ImplSetMarked( TRUE );
}
// delete AInfo structures
@@ -502,15 +502,15 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
else
{
if( !pView->ImplIsPause() )
- bGlobalPause = sal_False;
+ bGlobalPause = FALSE;
- pView->ImplSetMarked( sal_False );
+ pView->ImplSetMarked( FALSE );
pView = (ImplAnimView*) mpViewList->Next();
}
}
}
else
- bGlobalPause = sal_False;
+ bGlobalPause = FALSE;
if( !mpViewList->Count() )
Stop();
@@ -525,7 +525,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
if( mnLoops == 1 )
{
Stop();
- mbLoopTerminated = sal_True;
+ mbLoopTerminated = TRUE;
mnPos = nAnimCount - 1UL;
maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx;
return 0L;
@@ -573,14 +573,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
+BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !IsInAnimation() )
{
- Point aPoint;
- Rectangle aGlobalRect( aPoint, maGlobalSize );
+ Point aPoint;
+ Rectangle aGlobalRect( aPoint, maGlobalSize );
maGlobalSize = aGlobalRect.Union( Rectangle( rStepBmp.aPosPix, rStepBmp.aSizePix ) ).GetSize();
maList.Insert( new AnimationBitmap( rStepBmp ), LIST_APPEND );
@@ -589,7 +589,7 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
if( maList.Count() == 1 )
maBitmapEx = rStepBmp.aBmpEx;
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -597,7 +597,7 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
// -----------------------------------------------------------------------
-const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const
+const AnimationBitmap& Animation::Get( USHORT 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( sal_uInt16 nAnimation ) const
// -----------------------------------------------------------------------
-void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation )
+void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, USHORT nAnimation )
{
DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
@@ -624,7 +624,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16
// -----------------------------------------------------------------------
-void Animation::SetLoopCount( const sal_uLong nLoopCount )
+void Animation::SetLoopCount( const ULONG nLoopCount )
{
mnLoopCount = nLoopCount;
ResetLoopCount();
@@ -635,20 +635,20 @@ void Animation::SetLoopCount( const sal_uLong nLoopCount )
void Animation::ResetLoopCount()
{
mnLoops = mnLoopCount;
- mbLoopTerminated = sal_False;
+ mbLoopTerminated = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Convert( BmpConversion eConversion )
+BOOL Animation::Convert( BmpConversion eConversion )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion );
@@ -656,22 +656,22 @@ sal_Bool Animation::Convert( BmpConversion eConversion )
maBitmapEx.Convert( eConversion );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
+BOOL Animation::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce );
@@ -679,22 +679,22 @@ sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
maBitmapEx.ReduceColors( nNewColorCount, eReduce );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Invert()
+BOOL Animation::Invert()
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert();
@@ -702,22 +702,22 @@ sal_Bool Animation::Invert()
maBitmapEx.Invert();
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
+BOOL Animation::Mirror( ULONG nMirrorFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
if( nMirrorFlags )
{
@@ -725,7 +725,7 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
pStepBmp && bRet;
pStepBmp = (AnimationBitmap*) maList.Next() )
{
- if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True )
+ if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == TRUE )
{
if( nMirrorFlags & BMP_MIRROR_HORZ )
pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width();
@@ -739,22 +739,22 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
}
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Dither( sal_uLong nDitherFlags )
+BOOL Animation::Dither( ULONG nDitherFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags );
@@ -762,24 +762,24 @@ sal_Bool Animation::Dither( sal_uLong nDitherFlags )
maBitmapEx.Dither( nDitherFlags );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
+BOOL Animation::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, sal_Bool bInvert )
+ double fGamma, BOOL bInvert )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
{
@@ -793,22 +793,22 @@ sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
fGamma, bInvert );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- sal_Bool bRet;
+ BOOL bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = sal_True;
+ bRet = TRUE;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
@@ -816,7 +816,7 @@ sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterPara
maBitmapEx.Filter( eFilter, pFilterParam, pProgress );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
@@ -825,12 +825,12 @@ sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterPara
SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
{
- const sal_uInt16 nCount = rAnimation.Count();
+ const USHORT nCount = rAnimation.Count();
if( nCount )
{
- const ByteString aDummyStr;
- const sal_uInt32 nDummy32 = 0UL;
+ const ByteString aDummyStr;
+ const UINT32 nDummy32 = 0UL;
// Falls keine BitmapEx gesetzt wurde, schreiben wir
// einfach die erste Bitmap der Animation
@@ -840,27 +840,27 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
rOStm << rAnimation.GetBitmapEx();
// Kennung schreiben ( SDANIMA1 )
- rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931;
+ rOStm << (UINT32) 0x5344414e << (UINT32) 0x494d4931;
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ for( USHORT i = 0; i < nCount; i++ )
{
- const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
- const sal_uInt16 nRest = nCount - i - 1;
+ const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
+ const UINT16 nRest = nCount - i - 1;
// AnimationBitmap schreiben
rOStm << rAnimBmp.aBmpEx;
rOStm << rAnimBmp.aPosPix;
rOStm << rAnimBmp.aSizePix;
rOStm << rAnimation.maGlobalSize;
- 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
+ rOStm << (UINT16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
+ rOStm << (UINT16) rAnimBmp.eDisposal;
+ rOStm << (BYTE) rAnimBmp.bUserInput;
+ rOStm << (UINT32) rAnimation.mnLoopCount;
+ rOStm << nDummy32; // unbenutzt
+ rOStm << nDummy32; // unbenutzt
+ rOStm << nDummy32; // unbenutzt
rOStm << aDummyStr; // unbenutzt
- rOStm << nRest; // Anzahl der Strukturen, die noch _folgen_
+ rOStm << nRest; // Anzahl der Strukturen, die noch _folgen_
}
}
@@ -871,11 +871,11 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
{
- Bitmap aBmp;
- sal_uLong nStmPos = rIStm.Tell();
- sal_uInt32 nAnimMagic1, nAnimMagic2;
- sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
- sal_Bool bReadAnimations = sal_False;
+ Bitmap aBmp;
+ ULONG nStmPos = rIStm.Tell();
+ UINT32 nAnimMagic1, nAnimMagic2;
+ USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ BOOL bReadAnimations = 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 = sal_True;
+ bReadAnimations = 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 = sal_True;
+ bReadAnimations = TRUE;
else
rIStm.Seek( nStmPos );
}
@@ -905,11 +905,11 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
if( bReadAnimations )
{
AnimationBitmap aAnimBmp;
- BitmapEx aBmpEx;
- ByteString aDummyStr;
- sal_uInt32 nTmp32;
- sal_uInt16 nTmp16;
- sal_uInt8 cTmp;
+ BitmapEx aBmpEx;
+ ByteString aDummyStr;
+ UINT32 nTmp32;
+ UINT16 nTmp16;
+ BYTE cTmp;
do
{
@@ -919,13 +919,13 @@ 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 = (sal_Bool) cTmp;
- rIStm >> nTmp32; rAnimation.mnLoopCount = (sal_uInt16) nTmp32;
- rIStm >> nTmp32; // unbenutzt
- rIStm >> nTmp32; // unbenutzt
- rIStm >> nTmp32; // unbenutzt
+ rIStm >> cTmp; aAnimBmp.bUserInput = (BOOL) cTmp;
+ rIStm >> nTmp32; rAnimation.mnLoopCount = (USHORT) nTmp32;
+ rIStm >> nTmp32; // unbenutzt
+ rIStm >> nTmp32; // unbenutzt
+ rIStm >> nTmp32; // unbenutzt
rIStm >> aDummyStr; // unbenutzt
- rIStm >> nTmp16; // Rest zu lesen
+ rIStm >> nTmp16; // Rest zu lesen
rAnimation.Insert( aAnimBmp );
}
diff --git a/vcl/source/gdi/base14.cxx b/vcl/source/gdi/base14.cxx
index 9912b3e91509..da30404052d6 100644
--- a/vcl/source/gdi/base14.cxx
+++ b/vcl/source/gdi/base14.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,16 +33,14 @@
#include <rtl/strbuf.hxx>
using namespace vcl;
-
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
+using namespace rtl;
OString PDFWriterImpl::BuiltinFont::getNameObject() const
{
OStringBuffer aBuf( 16 );
aBuf.append( '/' );
const char* pRun = m_pPSName;
-
+
unsigned int nCopied = 0;
while( *pRun )
{
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index a0b48f4ee124..8fa4ab638e85 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,16 +57,16 @@ Bitmap::Bitmap( const ResId& rResId ) :
mpImpBmp( NULL )
{
const BitmapEx aBmpEx( rResId );
-
+
if( !aBmpEx.IsEmpty() )
- *this = aBmpEx.GetBitmap();
+ *this = aBmpEx.GetBitmap();
}
// ------------------------------------------------------------------
Bitmap::Bitmap( const Bitmap& rBitmap ) :
- maPrefMapMode ( rBitmap.maPrefMapMode ),
- maPrefSize ( rBitmap.maPrefSize )
+ maPrefMapMode ( rBitmap.maPrefMapMode ),
+ maPrefSize ( rBitmap.maPrefSize )
{
mpImpBmp = rBitmap.mpImpBmp;
@@ -86,12 +86,12 @@ Bitmap::Bitmap( SalBitmap* pSalBitmap )
// ------------------------------------------------------------------
-Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal )
+Bitmap::Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal )
{
if( rSizePixel.Width() && rSizePixel.Height() )
{
- BitmapPalette aPal;
- BitmapPalette* pRealPal = NULL;
+ BitmapPalette aPal;
+ BitmapPalette* pRealPal = NULL;
if( nBitCount <= 8 )
{
@@ -126,12 +126,12 @@ Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalett
// Dither-Palette erzeugen
if( 8 == nBitCount )
{
- sal_uInt16 nActCol = 16;
+ USHORT nActCol = 16;
- 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 );
+ 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 );
// Standard-Office-Farbe setzen
aPal[ nActCol++ ] = BitmapColor( 0, 184, 255 );
@@ -196,11 +196,11 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
if( !aGreyPalette16.GetEntryCount() )
{
- sal_uInt8 cGrey = 0, cGreyInc = 17;
+ BYTE cGrey = 0, cGreyInc = 17;
aGreyPalette16.SetEntryCount( 16 );
- for( sal_uInt16 i = 0; i < 16; i++, cGrey = sal::static_int_cast<sal_uInt8>(cGrey + cGreyInc) )
+ for( USHORT i = 0; i < 16; i++, cGrey = sal::static_int_cast<BYTE>(cGrey + cGreyInc) )
aGreyPalette16[ i ] = BitmapColor( cGrey, cGrey, cGrey );
}
@@ -212,8 +212,8 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
aGreyPalette256.SetEntryCount( 256 );
- for( sal_uInt16 i = 0; i < 256; i++ )
- aGreyPalette256[ i ] = BitmapColor( (sal_uInt8) i, (sal_uInt8) i, (sal_uInt8) i );
+ for( USHORT i = 0; i < 256; i++ )
+ aGreyPalette256[ i ] = BitmapColor( (BYTE) i, (BYTE) i, (BYTE) i );
}
return aGreyPalette256;
@@ -221,7 +221,7 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
}
else
{
- OSL_FAIL( "Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)" );
+ DBG_ERROR( "Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)" );
return aGreyPalette2;
}
}
@@ -235,13 +235,9 @@ bool BitmapPalette::IsGreyPalette() const
const int nEntryCount = GetEntryCount();
if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping
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;
- }
+ const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
+ if( rGreyPalette == *this )
+ return true;
// TODO: is it worth to compare the entries?
return false;
}
@@ -264,7 +260,7 @@ Bitmap& Bitmap::operator=( const Bitmap& rBitmap )
// ------------------------------------------------------------------
-sal_Bool Bitmap::IsEqual( const Bitmap& rBmp ) const
+BOOL Bitmap::IsEqual( const Bitmap& rBmp ) const
{
return( IsSameInstance( rBmp ) ||
( rBmp.GetSizePixel() == GetSizePixel() &&
@@ -313,17 +309,17 @@ void Bitmap::SetSourceSizePixel( const Size& rSize)
// ------------------------------------------------------------------
-sal_uInt16 Bitmap::GetBitCount() const
+USHORT Bitmap::GetBitCount() const
{
return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 );
}
// ------------------------------------------------------------------
-sal_Bool Bitmap::HasGreyPalette() const
+BOOL Bitmap::HasGreyPalette() const
{
- const sal_uInt16 nBitCount = GetBitCount();
- sal_Bool bRet = sal_False;
+ const USHORT nBitCount = GetBitCount();
+ BOOL bRet = FALSE;
if( 1 == nBitCount )
{
@@ -336,12 +332,12 @@ sal_Bool Bitmap::HasGreyPalette() const
if( rCol0.GetRed() == rCol0.GetGreen() && rCol0.GetRed() == rCol0.GetBlue() &&
rCol1.GetRed() == rCol1.GetGreen() && rCol1.GetRed() == rCol1.GetBlue() )
{
- bRet = sal_True;
+ bRet = TRUE;
}
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
else
- bRet = sal_True;
+ bRet = TRUE;
}
else if( 4 == nBitCount || 8 == nBitCount )
{
@@ -350,8 +346,8 @@ sal_Bool Bitmap::HasGreyPalette() const
if( pRAcc )
{
if( pRAcc->HasPalette() && ( (BitmapPalette&) pRAcc->GetPalette() == GetGreyPalette( 1 << nBitCount ) ) )
- bRet = sal_True;
-
+ bRet = TRUE;
+
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
}
@@ -361,9 +357,9 @@ sal_Bool Bitmap::HasGreyPalette() const
// ------------------------------------------------------------------
-sal_uLong Bitmap::GetChecksum() const
+ULONG Bitmap::GetChecksum() const
{
- sal_uLong nRet = 0UL;
+ ULONG nRet = 0UL;
if( mpImpBmp )
{
@@ -375,8 +371,8 @@ sal_uLong Bitmap::GetChecksum() const
if( pRAcc && pRAcc->Width() && pRAcc->Height() )
{
- sal_uInt32 nCrc = 0;
- SVBT32 aBT32;
+ sal_uInt32 nCrc = 0;
+ SVBT32 aBT32;
pRAcc->ImplZeroInitUnusedBits();
@@ -397,7 +393,7 @@ sal_uLong Bitmap::GetChecksum() const
UInt32ToSVBT32( pRAcc->GetColorMask().GetBlueMask(), aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
-
+
if( pRAcc->HasPalette() )
{
nCrc = rtl_crc32( nCrc, pRAcc->GetPalette().ImplGetColorBuffer(),
@@ -405,7 +401,7 @@ sal_uLong Bitmap::GetChecksum() const
}
nCrc = rtl_crc32( nCrc, pRAcc->GetBuffer(), pRAcc->GetScanlineSize() * pRAcc->Height() );
-
+
mpImpBmp->ImplSetChecksum( nRet = nCrc );
}
@@ -451,10 +447,10 @@ void Bitmap::ImplMakeUnique()
void Bitmap::ImplAssignWithSize( const Bitmap& rBitmap )
{
- const Size aOldSizePix( GetSizePixel() );
- const Size aNewSizePix( rBitmap.GetSizePixel() );
- const MapMode aOldMapMode( maPrefMapMode );
- Size aNewPrefSize;
+ const Size aOldSizePix( GetSizePixel() );
+ const Size aNewSizePix( rBitmap.GetSizePixel() );
+ const MapMode aOldMapMode( maPrefMapMode );
+ Size aNewPrefSize;
if( ( aOldSizePix != aNewSizePix ) && aOldSizePix.Width() && aOldSizePix.Height() )
{
@@ -527,44 +523,44 @@ void Bitmap::ReleaseAccess( BitmapReadAccess* pBitmapAccess )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Erase( const Color& rFillColor )
+BOOL Bitmap::Erase( const Color& rFillColor )
{
if( !(*this) )
- return sal_True;
-
- BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ return TRUE;
+
+ BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pWriteAcc )
{
- const sal_uLong nFormat = pWriteAcc->GetScanlineFormat();
- sal_uInt8 cIndex = 0;
- sal_Bool bFast = sal_False;
+ const ULONG nFormat = pWriteAcc->GetScanlineFormat();
+ BYTE cIndex = 0;
+ BOOL bFast = FALSE;
switch( nFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
case( BMP_FORMAT_1BIT_LSB_PAL ):
{
- cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = ( cIndex ? 255 : 0 );
- bFast = sal_True;
+ bFast = TRUE;
}
break;
case( BMP_FORMAT_4BIT_MSN_PAL ):
case( BMP_FORMAT_4BIT_LSN_PAL ):
{
- cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = cIndex | ( cIndex << 4 );
- bFast = sal_True;
+ bFast = TRUE;
}
break;
case( BMP_FORMAT_8BIT_PAL ):
{
- cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
- bFast = sal_True;
+ cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ bFast = TRUE;
}
break;
@@ -575,21 +571,21 @@ sal_Bool Bitmap::Erase( const Color& rFillColor )
( rFillColor.GetRed() == rFillColor.GetBlue() ) )
{
cIndex = rFillColor.GetRed();
- bFast = sal_True;
+ bFast = TRUE;
}
else
- bFast = sal_False;
+ bFast = FALSE;
}
break;
default:
- bFast = sal_False;
+ bFast = FALSE;
break;
}
if( bFast )
{
- const sal_uLong nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
+ const ULONG nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
memset( pWriteAcc->GetBuffer(), cIndex, nBufSize );
}
else
@@ -601,7 +597,7 @@ sal_Bool Bitmap::Erase( const Color& rFillColor )
}
ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -609,27 +605,27 @@ sal_Bool Bitmap::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Invert()
+BOOL Bitmap::Invert()
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAcc )
{
if( pAcc->HasPalette() )
{
- BitmapPalette aBmpPal( pAcc->GetPalette() );
- const sal_uInt16 nCount = aBmpPal.GetEntryCount();
+ BitmapPalette aBmpPal( pAcc->GetPalette() );
+ const USHORT nCount = aBmpPal.GetEntryCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ for( USHORT i = 0; i < nCount; i++ )
aBmpPal[ i ].Invert();
pAcc->SetPalette( aBmpPal );
}
else
{
- const long nWidth = pAcc->Width();
- const long nHeight = pAcc->Height();
+ const long nWidth = pAcc->Width();
+ const long nHeight = pAcc->Height();
for( long nX = 0L; nX < nWidth; nX++ )
for( long nY = 0L; nY < nHeight; nY++ )
@@ -637,7 +633,7 @@ sal_Bool Bitmap::Invert()
}
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -645,22 +641,22 @@ sal_Bool Bitmap::Invert()
// ------------------------------------------------------------------
-sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
+BOOL Bitmap::Mirror( ULONG nMirrorFlags )
{
- 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;
+ BOOL bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
+ BOOL bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
+ BOOL bRet = FALSE;
if( bHorz && !bVert )
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
if( pAcc )
{
- const long nWidth = pAcc->Width();
- const long nHeight = pAcc->Height();
- const long nWidth1 = nWidth - 1L;
- const long nWidth_2 = nWidth >> 1L;
+ const long nWidth = pAcc->Width();
+ const long nHeight = pAcc->Height();
+ const long nWidth1 = nWidth - 1L;
+ const long nWidth_2 = nWidth >> 1L;
for( long nY = 0L; nY < nHeight; nY++ )
{
@@ -674,20 +670,20 @@ sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
else if( bVert && !bHorz )
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
if( pAcc )
{
- const long nScanSize = pAcc->GetScanlineSize();
- sal_uInt8* pBuffer = new sal_uInt8[ nScanSize ];
- const long nHeight = pAcc->Height();
- const long nHeight1 = nHeight - 1L;
- const long nHeight_2 = nHeight >> 1L;
+ const long nScanSize = pAcc->GetScanlineSize();
+ BYTE* pBuffer = new BYTE[ nScanSize ];
+ const long nHeight = pAcc->Height();
+ const long nHeight1 = nHeight - 1L;
+ const long nHeight_2 = nHeight >> 1L;
for( long nY = 0L, nOther = nHeight1; nY < nHeight_2; nY++, nOther-- )
{
@@ -698,19 +694,19 @@ sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
delete[] pBuffer;
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
else if( bHorz && bVert )
{
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
if( pAcc )
{
- const long nWidth = pAcc->Width();
- const long nWidth1 = nWidth - 1L;
- const long nHeight = pAcc->Height();
- long nHeight_2 = nHeight >> 1;
+ const long nWidth = pAcc->Width();
+ const long nWidth1 = nWidth - 1L;
+ const long nHeight = pAcc->Height();
+ long nHeight_2 = nHeight >> 1;
for( long nY = 0L, nOtherY = nHeight - 1L; nY < nHeight_2; nY++, nOtherY-- )
{
@@ -735,51 +731,51 @@ sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
else
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
// ------------------------------------------------------------------
-sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
+BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
nAngle10 %= 3600L;
nAngle10 = ( nAngle10 < 0L ) ? ( 3599L + nAngle10 ) : nAngle10;
- if( !nAngle10 )
- bRet = sal_True;
+ if( !nAngle10 )
+ bRet = TRUE;
else if( 1800L == nAngle10 )
bRet = Mirror( BMP_MIRROR_HORZ | BMP_MIRROR_VERT );
else
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- Bitmap aRotatedBmp;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ Bitmap aRotatedBmp;
if( pReadAcc )
{
- const Size aSizePix( GetSizePixel() );
+ const Size aSizePix( GetSizePixel() );
if( ( 900L == nAngle10 ) || ( 2700L == nAngle10 ) )
{
- const Size aNewSizePix( aSizePix.Height(), aSizePix.Width() );
- Bitmap aNewBmp( aNewSizePix, GetBitCount(), &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ const Size aNewSizePix( aSizePix.Height(), aSizePix.Width() );
+ Bitmap aNewBmp( aNewSizePix, GetBitCount(), &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = aSizePix.Width();
- const long nWidth1 = nWidth - 1L;
- const long nHeight = aSizePix.Height();
- const long nHeight1 = nHeight - 1L;
- const long nNewWidth = aNewSizePix.Width();
- const long nNewHeight = aNewSizePix.Height();
+ const long nWidth = aSizePix.Width();
+ const long nWidth1 = nWidth - 1L;
+ const long nHeight = aSizePix.Height();
+ const long nHeight1 = nHeight - 1L;
+ const long nNewWidth = aNewSizePix.Width();
+ const long nNewHeight = aNewSizePix.Height();
if( 900L == nAngle10 )
{
@@ -801,37 +797,37 @@ sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
}
else
{
- Point aTmpPoint;
- Rectangle aTmpRectangle( aTmpPoint, aSizePix );
- Polygon aPoly( aTmpRectangle );
- aPoly.Rotate( aTmpPoint, (sal_uInt16) nAngle10 );
+ Point aTmpPoint;
+ Rectangle aTmpRectangle( aTmpPoint, aSizePix );
+ Polygon aPoly( aTmpRectangle );
+ aPoly.Rotate( aTmpPoint, (USHORT) nAngle10 );
- Rectangle aNewBound( aPoly.GetBoundRect() );
- const Size aNewSizePix( aNewBound.GetSize() );
- Bitmap aNewBmp( aNewSizePix, GetBitCount(), &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Rectangle aNewBound( aPoly.GetBoundRect() );
+ const Size aNewSizePix( aNewBound.GetSize() );
+ Bitmap aNewBmp( aNewSizePix, GetBitCount(), &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const BitmapColor aFillColor( pWriteAcc->GetBestMatchingColor( rFillColor ) );
- const double fCosAngle = cos( nAngle10 * F_PI1800 );
- const double fSinAngle = sin( nAngle10 * F_PI1800 );
- const double fXMin = aNewBound.Left();
- const double fYMin = aNewBound.Top();
- const long nWidth = aSizePix.Width();
- const long nHeight = aSizePix.Height();
- const long nNewWidth = aNewSizePix.Width();
- const long nNewHeight = aNewSizePix.Height();
- long nX;
- long nY;
- long nRotX;
- long nRotY;
- long nSinY;
- long nCosY;
- long* pCosX = new long[ nNewWidth ];
- long* pSinX = new long[ nNewWidth ];
- long* pCosY = new long[ nNewHeight ];
- long* pSinY = new long[ nNewHeight ];
+ const BitmapColor aFillColor( pWriteAcc->GetBestMatchingColor( rFillColor ) );
+ const double fCosAngle = cos( nAngle10 * F_PI1800 );
+ const double fSinAngle = sin( nAngle10 * F_PI1800 );
+ const double fXMin = aNewBound.Left();
+ const double fYMin = aNewBound.Top();
+ const long nWidth = aSizePix.Width();
+ const long nHeight = aSizePix.Height();
+ const long nNewWidth = aNewSizePix.Width();
+ const long nNewHeight = aNewSizePix.Height();
+ long nX;
+ long nY;
+ long nRotX;
+ long nRotY;
+ long nSinY;
+ long nCosY;
+ long* pCosX = new long[ nNewWidth ];
+ long* pSinX = new long[ nNewWidth ];
+ long* pCosY = new long[ nNewHeight ];
+ long* pSinY = new long[ nNewHeight ];
for ( nX = 0; nX < nNewWidth; nX++ )
{
@@ -880,7 +876,7 @@ sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
ReleaseAccess( pReadAcc );
}
- if( ( bRet = !!aRotatedBmp ) == sal_True )
+ if( ( bRet = !!aRotatedBmp ) == TRUE )
ImplAssignWithSize( aRotatedBmp );
}
@@ -889,11 +885,11 @@ sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
+BOOL Bitmap::Crop( const Rectangle& rRectPixel )
{
- const Size aSizePix( GetSizePixel() );
- Rectangle aRect( rRectPixel );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ Rectangle aRect( rRectPixel );
+ BOOL bRet = FALSE;
aRect.Intersection( Rectangle( Point(), aSizePix ) );
@@ -903,10 +899,10 @@ sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
if( pReadAcc )
{
- Point aTmpPoint;
- const Rectangle aNewRect( aTmpPoint, aRect.GetSize() );
- Bitmap aNewBmp( aNewRect.GetSize(), GetBitCount(), &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Point aTmpPoint;
+ const Rectangle aNewRect( aTmpPoint, aRect.GetSize() );
+ Bitmap aNewBmp( aNewRect.GetSize(), GetBitCount(), &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
@@ -920,7 +916,7 @@ sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPixel( nY2, nX2 ) );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -935,12 +931,12 @@ sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
+BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc, const Bitmap* pBmpSrc )
{
- const Size aSizePix( GetSizePixel() );
- Rectangle aRectDst( rRectDst );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ Rectangle aRectDst( rRectDst );
+ BOOL bRet = FALSE;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -948,11 +944,11 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
{
if( pBmpSrc && ( *pBmpSrc != *this ) )
{
- Bitmap* pSrc = (Bitmap*) pBmpSrc;
- const Size aCopySizePix( pSrc->GetSizePixel() );
- Rectangle aRectSrc( rRectSrc );
- const sal_uInt16 nSrcBitCount = pBmpSrc->GetBitCount();
- const sal_uInt16 nDstBitCount = GetBitCount();
+ Bitmap* pSrc = (Bitmap*) pBmpSrc;
+ const Size aCopySizePix( pSrc->GetSizePixel() );
+ Rectangle aRectSrc( rRectSrc );
+ const USHORT nSrcBitCount = pBmpSrc->GetBitCount();
+ const USHORT nDstBitCount = GetBitCount();
if( nSrcBitCount > nDstBitCount )
{
@@ -973,32 +969,32 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
if( nNextIndex )
{
- BitmapReadAccess* pSrcAcc = pSrc->AcquireReadAccess();
- BitmapWriteAccess* pDstAcc = AcquireWriteAccess();
+ BitmapReadAccess* pSrcAcc = pSrc->AcquireReadAccess();
+ BitmapWriteAccess* pDstAcc = AcquireWriteAccess();
if( pSrcAcc && pDstAcc )
{
- const long nSrcCount = pDstAcc->GetPaletteEntryCount();
- const long nDstCount = 1 << nDstBitCount;
- sal_Bool bFound;
+ const long nSrcCount = pDstAcc->GetPaletteEntryCount();
+ const long nDstCount = 1 << nDstBitCount;
+ BOOL bFound;
for( long i = 0L; ( i < nSrcCount ) && ( nNextIndex < nSrcCount ); i++ )
{
- const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (sal_uInt16) i );
+ const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (USHORT) i );
- bFound = sal_False;
+ bFound = FALSE;
for( long j = 0L; j < nDstCount; j++ )
{
- if( rSrcCol == pDstAcc->GetPaletteColor( (sal_uInt16) j ) )
+ if( rSrcCol == pDstAcc->GetPaletteColor( (USHORT) j ) )
{
- bFound = sal_True;
+ bFound = TRUE;
break;
}
}
if( !bFound )
- pDstAcc->SetPaletteColor( (sal_uInt16) nNextIndex++, rSrcCol );
+ pDstAcc->SetPaletteColor( (USHORT) nNextIndex++, rSrcCol );
}
}
@@ -1022,22 +1018,22 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
if( pWriteAcc )
{
- const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcEndX = aRectSrc.Left() + nWidth;
- const long nSrcEndY = aRectSrc.Top() + nHeight;
- long nDstY = aRectDst.Top();
+ const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const long nSrcEndX = aRectSrc.Left() + nWidth;
+ const long nSrcEndY = aRectSrc.Top() + nHeight;
+ long nDstY = aRectDst.Top();
if( pReadAcc->HasPalette() && pWriteAcc->HasPalette() )
{
- const sal_uInt16 nCount = pReadAcc->GetPaletteEntryCount();
- sal_uInt8* pMap = new sal_uInt8[ nCount ];
+ const USHORT nCount = pReadAcc->GetPaletteEntryCount();
+ BYTE* pMap = new BYTE[ nCount ];
// Index-Map fuer Farbtabelle
// aufbauen, da das Bild ja (relativ) farbgenau
// kopiert werden soll
- for( sal_uInt16 i = 0; i < nCount; i++ )
- pMap[ i ] = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) );
+ for( USHORT i = 0; i < nCount; i++ )
+ pMap[ i ] = (BYTE) 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++ )
@@ -1072,20 +1068,20 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
if( !aRectSrc.IsEmpty() && ( aRectSrc != aRectDst ) )
{
- BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
+ BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcX = aRectSrc.Left();
- const long nSrcY = aRectSrc.Top();
- const long nSrcEndX1 = nSrcX + nWidth - 1L;
- const long nSrcEndY1 = nSrcY + nHeight - 1L;
- const long nDstX = aRectDst.Left();
- const long nDstY = aRectDst.Top();
- const long nDstEndX1 = nDstX + nWidth - 1L;
- const long nDstEndY1 = nDstY + nHeight - 1L;
+ const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const long nSrcX = aRectSrc.Left();
+ const long nSrcY = aRectSrc.Top();
+ const long nSrcEndX1 = nSrcX + nWidth - 1L;
+ const long nSrcEndY1 = nSrcY + nHeight - 1L;
+ const long nDstX = aRectDst.Left();
+ const long nDstY = aRectDst.Top();
+ const long nDstEndX1 = nDstX + nWidth - 1L;
+ const long nDstEndY1 = nDstY + nHeight - 1L;
if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
{
@@ -1113,7 +1109,7 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
}
ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
}
@@ -1124,33 +1120,33 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
// ------------------------------------------------------------------
-sal_Bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
+BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( nDX || nDY )
{
- const Size aSizePixel( GetSizePixel() );
- const long nWidth = aSizePixel.Width();
- const long nHeight = aSizePixel.Height();
- const Size aNewSize( nWidth + nDX, nHeight + nDY );
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ const Size aSizePixel( GetSizePixel() );
+ const long nWidth = aSizePixel.Width();
+ const long nHeight = aSizePixel.Height();
+ const Size aNewSize( nWidth + nDX, nHeight + nDY );
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
if( pReadAcc )
{
- BitmapPalette aBmpPal( pReadAcc->GetPalette() );
- Bitmap aNewBmp( aNewSize, GetBitCount(), &aBmpPal );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BitmapPalette aBmpPal( pReadAcc->GetPalette() );
+ Bitmap aNewBmp( aNewSize, GetBitCount(), &aBmpPal );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
BitmapColor aColor;
- const long nNewX = nWidth;
- const long nNewY = nHeight;
- const long nNewWidth = pWriteAcc->Width();
- const long nNewHeight = pWriteAcc->Height();
- long nX;
- long nY;
+ const long nNewX = nWidth;
+ const long nNewY = nHeight;
+ const long nNewWidth = pWriteAcc->Width();
+ const long nNewHeight = pWriteAcc->Height();
+ long nX;
+ long nY;
if( pInitColor )
aColor = pWriteAcc->GetBestMatchingColor( *pInitColor );
@@ -1170,7 +1166,7 @@ sal_Bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
pWriteAcc->SetPixel( nY, nX, aColor );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1185,11 +1181,11 @@ sal_Bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
// ------------------------------------------------------------------
-Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
+Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
{
- Bitmap aNewBmp( GetSizePixel(), 1 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ Bitmap aNewBmp( GetSizePixel(), 1 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pWriteAcc )
{
@@ -1197,24 +1193,24 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
if( pReadAcc )
{
- const long nWidth = pReadAcc->Width();
- const long nHeight = pReadAcc->Height();
- const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
- const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const long nWidth = pReadAcc->Width();
+ const long nHeight = pReadAcc->Height();
+ const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
+ const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
if( !nTol )
{
- const BitmapColor aTest( pReadAcc->GetBestMatchingColor( rTransColor ) );
- long nX, nY, nShift;
+ const BitmapColor aTest( pReadAcc->GetBestMatchingColor( rTransColor ) );
+ long nX, nY, nShift;
if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL ||
pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_LSN_PAL )
{
// optimized for 4Bit-MSN/LSN source palette
- const sal_uInt8 cTest = aTest.GetIndex();
+ const BYTE cTest = aTest.GetIndex();
const long nShiftInit = ( ( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL ) ? 4 : 0 );
- if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
+ if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
aWhite.GetIndex() == 1 )
{
// optimized for 1Bit-MSB destination palette
@@ -1249,9 +1245,9 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
// optimized for 8Bit source palette
- const sal_uInt8 cTest = aTest.GetIndex();
+ const BYTE cTest = aTest.GetIndex();
- if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
+ if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
aWhite.GetIndex() == 1 )
{
// optimized for 1Bit-MSB destination palette
@@ -1301,13 +1297,13 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
else
{
BitmapColor aCol;
- long nR, nG, nB;
- const long nMinR = MinMax( (long) rTransColor.GetRed() - nTol, 0, 255 );
- const long nMaxR = MinMax( (long) rTransColor.GetRed() + nTol, 0, 255 );
- const long nMinG = MinMax( (long) rTransColor.GetGreen() - nTol, 0, 255 );
- const long nMaxG = MinMax( (long) rTransColor.GetGreen() + nTol, 0, 255 );
- const long nMinB = MinMax( (long) rTransColor.GetBlue() - nTol, 0, 255 );
- const long nMaxB = MinMax( (long) rTransColor.GetBlue() + nTol, 0, 255 );
+ long nR, nG, nB;
+ const long nMinR = MinMax( (long) rTransColor.GetRed() - nTol, 0, 255 );
+ const long nMaxR = MinMax( (long) rTransColor.GetRed() + nTol, 0, 255 );
+ const long nMinG = MinMax( (long) rTransColor.GetGreen() - nTol, 0, 255 );
+ const long nMaxG = MinMax( (long) rTransColor.GetGreen() + nTol, 0, 255 );
+ const long nMinB = MinMax( (long) rTransColor.GetBlue() - nTol, 0, 255 );
+ const long nMaxB = MinMax( (long) rTransColor.GetBlue() + nTol, 0, 255 );
if( pReadAcc->HasPalette() )
{
@@ -1356,7 +1352,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
}
( (Bitmap*) this )->ReleaseAccess( pReadAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
aNewBmp.ReleaseAccess( pWriteAcc );
@@ -1377,21 +1373,21 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
{
- Region aRegion;
- Rectangle aRect( rRect );
- BitmapReadAccess* pReadAcc = ( (Bitmap*) this )->AcquireReadAccess();
+ Region aRegion;
+ Rectangle aRect( rRect );
+ BitmapReadAccess* pReadAcc = ( (Bitmap*) this )->AcquireReadAccess();
aRect.Intersection( Rectangle( Point(), GetSizePixel() ) );
aRect.Justify();
if( pReadAcc )
{
- Rectangle aSubRect;
- const long nLeft = aRect.Left();
- const long nTop = aRect.Top();
- const long nRight = aRect.Right();
- const long nBottom = aRect.Bottom();
- const BitmapColor aMatch( pReadAcc->GetBestMatchingColor( rColor ) );
+ Rectangle aSubRect;
+ const long nLeft = aRect.Left();
+ const long nTop = aRect.Top();
+ const long nRight = aRect.Right();
+ const long nBottom = aRect.Bottom();
+ const BitmapColor aMatch( pReadAcc->GetBestMatchingColor( rColor ) );
aRegion.ImplBeginAddRect();
@@ -1428,30 +1424,30 @@ Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
// ------------------------------------------------------------------
-sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
+BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
- BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pMaskAcc && pAcc )
{
- const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
- const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
- const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
- BitmapColor aReplace;
+ const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
+ const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
+ const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ BitmapColor aReplace;
if( pAcc->HasPalette() )
{
- const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount();
- const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount();
+ const USHORT nActColors = pAcc->GetPaletteEntryCount();
+ const USHORT 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( (sal_uInt8) aReplace ) != BitmapColor( rReplaceColor ) )
+ if( pAcc->GetPaletteColor( (BYTE) aReplace ) != BitmapColor( rReplaceColor ) )
{
// erst einmal nachsehen, ob wir unsere ReplaceColor
// nicht auf einen freien Platz am Ende der Palette
@@ -1460,26 +1456,26 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
pAcc->SetPaletteEntryCount( nActColors + 1 );
pAcc->SetPaletteColor( nActColors, rReplaceColor );
- aReplace = BitmapColor( (sal_uInt8) nActColors );
+ aReplace = BitmapColor( (BYTE) nActColors );
}
else
{
- sal_Bool* pFlags = new sal_Bool[ nMaxColors ];
+ BOOL* pFlags = new 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[ (sal_uInt8) pAcc->GetPixel( nY, nX ) ] = sal_True;
+ pFlags[ (BYTE) pAcc->GetPixel( nY, nX ) ] = TRUE;
- for( sal_uInt16 i = 0UL; i < nMaxColors; i++ )
+ for( USHORT i = 0UL; i < nMaxColors; i++ )
{
// Hurra, wir haben einen unbenutzten Eintrag
if( !pFlags[ i ] )
{
- pAcc->SetPaletteColor( (sal_uInt16) i, rReplaceColor );
- aReplace = BitmapColor( (sal_uInt8) i );
+ pAcc->SetPaletteColor( (USHORT) i, rReplaceColor );
+ aReplace = BitmapColor( (BYTE) i );
}
}
@@ -1495,7 +1491,7 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
if( pMaskAcc->GetPixel( nY, nX ) == aMaskWhite )
pAcc->SetPixel( nY, nX, aReplace );
- bRet = sal_True;
+ bRet = TRUE;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1506,30 +1502,30 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
+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();
- sal_Bool bRet = sal_False;
+ Bitmap aNewBmp( GetSizePixel(), 24 );
+ BitmapReadAccess* pAcc = AcquireReadAccess();
+ BitmapReadAccess* pAlphaAcc = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
+ BitmapWriteAccess* pNewAcc = aNewBmp.AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAcc && pAlphaAcc && pNewAcc )
{
- BitmapColor aCol;
- const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() );
- const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() );
+ BitmapColor aCol;
+ const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() );
+ const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() );
for( long nY = 0L; nY < nHeight; nY++ )
{
for( long nX = 0L; nX < nWidth; nX++ )
{
aCol = pAcc->GetColor( nY, nX );
- pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (sal_uInt8) pAlphaAcc->GetPixel( nY, nX ) ) );
+ pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (BYTE) pAlphaAcc->GetPixel( nY, nX ) ) );
}
}
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pAcc );
@@ -1538,8 +1534,8 @@ sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -1552,28 +1548,28 @@ sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
if( 1 == GetBitCount() )
Convert( BMP_CONVERSION_4BIT_COLORS );
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAcc )
{
- const long nMinR = MinMax( (long) rSearchColor.GetRed() - nTol, 0, 255 );
- const long nMaxR = MinMax( (long) rSearchColor.GetRed() + nTol, 0, 255 );
- const long nMinG = MinMax( (long) rSearchColor.GetGreen() - nTol, 0, 255 );
- const long nMaxG = MinMax( (long) rSearchColor.GetGreen() + nTol, 0, 255 );
- const long nMinB = MinMax( (long) rSearchColor.GetBlue() - nTol, 0, 255 );
- const long nMaxB = MinMax( (long) rSearchColor.GetBlue() + nTol, 0, 255 );
+ const long nMinR = MinMax( (long) rSearchColor.GetRed() - nTol, 0, 255 );
+ const long nMaxR = MinMax( (long) rSearchColor.GetRed() + nTol, 0, 255 );
+ const long nMinG = MinMax( (long) rSearchColor.GetGreen() - nTol, 0, 255 );
+ const long nMaxG = MinMax( (long) rSearchColor.GetGreen() + nTol, 0, 255 );
+ const long nMinB = MinMax( (long) rSearchColor.GetBlue() - nTol, 0, 255 );
+ const long nMaxB = MinMax( (long) rSearchColor.GetBlue() + nTol, 0, 255 );
if( pAcc->HasPalette() )
{
- for( sal_uInt16 i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
+ for( USHORT i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
@@ -1587,8 +1583,8 @@ sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor,
}
else
{
- BitmapColor aCol;
- const BitmapColor aReplace( pAcc->GetBestMatchingColor( rReplaceColor ) );
+ BitmapColor aCol;
+ const BitmapColor aReplace( pAcc->GetBestMatchingColor( rReplaceColor ) );
for( long nY = 0L, nHeight = pAcc->Height(); nY < nHeight; nY++ )
{
@@ -1607,7 +1603,7 @@ sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor,
}
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -1615,27 +1611,27 @@ sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor,
// ------------------------------------------------------------------
-sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
- sal_uLong nColorCount, sal_uLong* _pTols )
+BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ ULONG nColorCount, ULONG* _pTols )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
if( 1 == GetBitCount() )
Convert( BMP_CONVERSION_4BIT_COLORS );
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAcc )
{
- long* pMinR = new long[ nColorCount ];
- long* pMaxR = new long[ nColorCount ];
- long* pMinG = new long[ nColorCount ];
- long* pMaxG = new long[ nColorCount ];
- long* pMinB = new long[ nColorCount ];
- long* pMaxB = new long[ nColorCount ];
- long* pTols;
- sal_uLong i;
+ long* pMinR = new long[ nColorCount ];
+ long* pMaxR = new long[ nColorCount ];
+ long* pMinG = new long[ nColorCount ];
+ long* pMaxG = new long[ nColorCount ];
+ long* pMinB = new long[ nColorCount ];
+ long* pMaxB = new long[ nColorCount ];
+ long* pTols;
+ ULONG i;
if( !_pTols )
{
@@ -1647,8 +1643,8 @@ sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColor
for( i = 0UL; i < nColorCount; i++ )
{
- const Color& rCol = pSearchColors[ i ];
- const long nTol = pTols[ i ];
+ const Color& rCol = pSearchColors[ i ];
+ const long nTol = pTols[ i ];
pMinR[ i ] = MinMax( (long) rCol.GetRed() - nTol, 0, 255 );
pMaxR[ i ] = MinMax( (long) rCol.GetRed() + nTol, 0, 255 );
@@ -1660,7 +1656,7 @@ sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColor
if( pAcc->HasPalette() )
{
- for( sal_uInt16 nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
+ for( USHORT nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( nEntry );
@@ -1670,7 +1666,7 @@ sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColor
pMinG[ i ] <= rCol.GetGreen() && pMaxG[ i ] >= rCol.GetGreen() &&
pMinB[ i ] <= rCol.GetBlue() && pMaxB[ i ] >= rCol.GetBlue() )
{
- pAcc->SetPaletteColor( (sal_uInt16)nEntry, pReplaceColors[ i ] );
+ pAcc->SetPaletteColor( (USHORT)nEntry, pReplaceColors[ i ] );
break;
}
}
@@ -1678,8 +1674,8 @@ sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColor
}
else
{
- BitmapColor aCol;
- BitmapColor* pReplaces = new BitmapColor[ nColorCount ];
+ BitmapColor aCol;
+ BitmapColor* pReplaces = new BitmapColor[ nColorCount ];
for( i = 0UL; i < nColorCount; i++ )
pReplaces[ i ] = pAcc->GetBestMatchingColor( pReplaceColors[ i ] );
@@ -1716,7 +1712,7 @@ sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColor
delete[] pMinB;
delete[] pMaxB;
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -1743,22 +1739,54 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
// ------------------------------------------------------------------
-sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
+Bitmap Bitmap::GetColorTransformedBitmap( BmpColorMode eColorMode ) const
+{
+ Bitmap aRet;
+
+ if( BMP_COLOR_HIGHCONTRAST == eColorMode )
+ {
+ Color* pSrcColors = NULL;
+ Color* pDstColors = NULL;
+ ULONG nColorCount = 0;
+
+ aRet = *this;
+
+ Image::GetColorTransformArrays( (ImageColorTransform) eColorMode, pSrcColors, pDstColors, nColorCount );
+
+ if( nColorCount && pSrcColors && pDstColors )
+ aRet.Replace( pSrcColors, pDstColors, nColorCount );
+
+ delete[] pSrcColors;
+ delete[] pDstColors;
+ }
+ else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
+ BMP_COLOR_MONOCHROME_WHITE == eColorMode )
+ {
+ aRet = *this;
+ aRet.MakeMono( BMP_COLOR_MONOCHROME_THRESHOLD );
+ }
+
+ return aRet;
+}
+
+// ------------------------------------------------------------------
+
+BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
{
- BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pMaskAcc && pAcc )
{
- const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
- const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
- const Color aColBlack( COL_BLACK );
- BitmapColor aPixel;
- BitmapColor aMaskPixel;
- const BitmapColor aWhite( pAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
- const BitmapColor aBlack( pAcc->GetBestMatchingColor( aColBlack ) );
- const BitmapColor aMaskBlack( pMaskAcc->GetBestMatchingColor( aColBlack ) );
+ const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() );
+ const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() );
+ const Color aColBlack( COL_BLACK );
+ BitmapColor aPixel;
+ BitmapColor aMaskPixel;
+ const BitmapColor aWhite( pAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aBlack( pAcc->GetBestMatchingColor( aColBlack ) );
+ const BitmapColor aMaskBlack( pMaskAcc->GetBestMatchingColor( aColBlack ) );
switch( eCombine )
{
@@ -1871,7 +1899,7 @@ sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
break;
}
- bRet = sal_True;
+ bRet = TRUE;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1882,7 +1910,7 @@ sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
+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.
@@ -1892,22 +1920,22 @@ sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
if( GetBitCount() <= 8 )
Convert( BMP_CONVERSION_24BIT );
- BitmapReadAccess* pAlphaAcc = const_cast<AlphaMask&>(rAlpha).AcquireReadAccess();
- BitmapWriteAccess* pAcc = AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pAlphaAcc = const_cast<AlphaMask&>(rAlpha).AcquireReadAccess();
+ BitmapWriteAccess* pAcc = AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pAlphaAcc && pAcc )
{
- const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() );
- const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() );
+ const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() );
+ const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() );
for( long nY = 0L; nY < nHeight; ++nY )
for( long nX = 0L; nX < nWidth; ++nX )
- pAcc->SetPixel( nY, nX,
- pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor,
+ pAcc->SetPixel( nY, nX,
+ pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor,
255 - pAlphaAcc->GetPixel( nY, nX ) ) );
- bRet = sal_True;
+ bRet = TRUE;
}
const_cast<AlphaMask&>(rAlpha).ReleaseAccess( pAlphaAcc );
@@ -1918,7 +1946,7 @@ sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
// ------------------------------------------------------------------
-sal_Bool Bitmap::MakeMono( sal_uInt8 cThreshold )
+BOOL Bitmap::MakeMono( BYTE cThreshold )
{
return ImplMakeMono( cThreshold );
}
@@ -1934,7 +1962,7 @@ bool Bitmap::GetSystemData( BitmapSystemData& rData ) const
if( pSalBitmap )
bRet = pSalBitmap->GetSystemData( rData );
}
-
+
return bRet;
}
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 9db334395e23..3fc6f86ea7f4 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,8 +43,8 @@
// - Defines -
// -----------
-#define DIBCOREHEADERSIZE ( 12UL )
-#define DIBINFOHEADERSIZE ( sizeof( DIBInfoHeader ) )
+#define DIBCOREHEADERSIZE ( 12UL )
+#define DIBINFOHEADERSIZE ( sizeof( DIBInfoHeader ) )
#define BITMAPINFOHEADER 0x28
#define SETPIXEL4( pBuf, nX, cChar )( (pBuf)[ (nX) >> 1 ] |= ( (nX) & 1 ) ? ( cChar ): (cChar) << 4 );
@@ -53,12 +53,12 @@
// - Compression defines
// ----------------------
-#define COMPRESS_OWN ('S'|('D'<<8UL))
-#define COMPRESS_NONE ( 0UL )
-#define RLE_8 ( 1UL )
-#define RLE_4 ( 2UL )
-#define BITFIELDS ( 3UL )
-#define ZCOMPRESS ( COMPRESS_OWN | 0x01000000UL ) /* == 'SD01' (binary) */
+#define COMPRESS_OWN ('S'|('D'<<8UL))
+#define COMPRESS_NONE ( 0UL )
+#define RLE_8 ( 1UL )
+#define RLE_4 ( 2UL )
+#define BITFIELDS ( 3UL )
+#define ZCOMPRESS ( COMPRESS_OWN | 0x01000000UL ) /* == 'SD01' (binary) */
// -----------------
// - DIBInfoHeader -
@@ -66,17 +66,17 @@
struct DIBInfoHeader
{
- sal_uInt32 nSize;
- sal_Int32 nWidth;
- sal_Int32 nHeight;
- sal_uInt16 nPlanes;
- sal_uInt16 nBitCount;
- sal_uInt32 nCompression;
- sal_uInt32 nSizeImage;
- sal_Int32 nXPelsPerMeter;
- sal_Int32 nYPelsPerMeter;
- sal_uInt32 nColsUsed;
- sal_uInt32 nColsImportant;
+ sal_uInt32 nSize;
+ sal_Int32 nWidth;
+ sal_Int32 nHeight;
+ sal_uInt16 nPlanes;
+ sal_uInt16 nBitCount;
+ sal_uInt32 nCompression;
+ sal_uInt32 nSizeImage;
+ sal_Int32 nXPelsPerMeter;
+ sal_Int32 nYPelsPerMeter;
+ sal_uInt32 nColsUsed;
+ sal_uInt32 nColsImportant;
DIBInfoHeader() :
nSize( 0UL ),
@@ -96,14 +96,14 @@ struct DIBInfoHeader
namespace
{
- inline sal_uInt16 discretizeBitcount( sal_uInt16 nInputCount )
+ inline USHORT discretizeBitcount( UINT16 nInputCount )
{
return ( nInputCount <= 1 ) ? 1 :
( nInputCount <= 4 ) ? 4 :
( nInputCount <= 8 ) ? 8 : 24;
}
- inline bool isBitfieldCompression( sal_uLong nScanlineFormat )
+ inline bool isBitfieldCompression( 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, sal_True );
+ rBitmap.Read( rIStm, TRUE );
return rIStm;
}
@@ -124,18 +124,18 @@ SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap )
SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap )
{
- rBitmap.Write( rOStm, sal_False, sal_True );
+ rBitmap.Write( rOStm, FALSE, TRUE );
return rOStm;
}
// ------------------------------------------------------------------
-sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader, sal_Bool bIsMSOFormat )
+BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
{
- const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
- const sal_uLong nOldPos = rIStm.Tell();
- sal_uLong nOffset = 0UL;
- sal_Bool bRet = sal_False;
+ const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ const ULONG nOldPos = rIStm.Tell();
+ ULONG nOffset = 0UL;
+ BOOL bRet = FALSE;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -162,33 +162,33 @@ sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader, sal_Bool bIsMSOFor
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bIsMSOFormat )
+BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIsMSOFormat )
{
- DIBInfoHeader aHeader;
- const sal_uLong nStmPos = rIStm.Tell();
- sal_Bool bRet = sal_False;
- sal_Bool bTopDown = sal_False;
+ DIBInfoHeader aHeader;
+ const ULONG nStmPos = rIStm.Tell();
+ BOOL bRet = FALSE;
+ sal_Bool bTopDown = sal_False;
if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
- const sal_uInt16 nBitCount( discretizeBitcount(aHeader.nBitCount) );
+ const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
- const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
- BitmapPalette aDummyPal;
- Bitmap aNewBmp( aSizePixel, nBitCount, &aDummyPal );
- BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess();
+ const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
+ BitmapPalette aDummyPal;
+ Bitmap aNewBmp( aSizePixel, nBitCount, &aDummyPal );
+ BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess();
if( pAcc )
{
- sal_uInt16 nColors;
- SvStream* pIStm;
- SvMemoryStream* pMemStm = NULL;
- sal_uInt8* pData = NULL;
+ USHORT nColors;
+ SvStream* pIStm;
+ SvMemoryStream* pMemStm = NULL;
+ BYTE* pData = NULL;
if( nBitCount <= 8 )
{
if( aHeader.nColsUsed )
- nColors = (sal_uInt16) aHeader.nColsUsed;
+ nColors = (USHORT) aHeader.nColsUsed;
else
nColors = ( 1 << aHeader.nBitCount );
}
@@ -197,28 +197,27 @@ sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset,
if( ZCOMPRESS == aHeader.nCompression )
{
- ZCodec aCodec;
+ ZCodec aCodec;
sal_uInt32 nCodedSize, nUncodedSize;
- sal_uLong nCodedPos;
+ ULONG nCodedPos;
// read coding information
rIStm >> nCodedSize >> nUncodedSize >> aHeader.nCompression;
- pData = (sal_uInt8*) rtl_allocateMemory( nUncodedSize );
-
+ pData = (BYTE*) rtl_allocateMemory( nUncodedSize );
+
// decode buffer
nCodedPos = rIStm.Tell();
aCodec.BeginCompression();
aCodec.Read( rIStm, pData, nUncodedSize );
aCodec.EndCompression();
-
+
// skip unread bytes from coded buffer
rIStm.SeekRel( nCodedSize - ( rIStm.Tell() - nCodedPos ) );
-
- // set decoded bytes to memory stream,
+
+ // set decoded bytes to memory stream,
// from which we will read the bitmap data
- pMemStm = new SvMemoryStream;
- pIStm = pMemStm;
- pMemStm->SetBuffer( (char*) pData, nUncodedSize, sal_False, nUncodedSize );
+ pIStm = pMemStm = new SvMemoryStream;
+ pMemStm->SetBuffer( (char*) pData, nUncodedSize, FALSE, nUncodedSize );
nOffset = 0;
}
else
@@ -252,7 +251,7 @@ sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset,
if( pData )
rtl_freeMemory( pData );
-
+
delete pMemStm;
aNewBmp.ReleaseAccess( pAcc );
@@ -266,11 +265,11 @@ sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset,
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
+BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
{
- sal_uInt32 nTmp32;
- sal_uInt16 nTmp16 = 0;
- sal_Bool bRet = sal_False;
+ UINT32 nTmp32;
+ UINT16 nTmp16 = 0;
+ BOOL bRet = FALSE;
rIStm >> nTmp16;
@@ -301,13 +300,14 @@ sal_Bool Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
+BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
{
// BITMAPINFOHEADER or BITMAPCOREHEADER
rIStm >> rHeader.nSize;
// BITMAPCOREHEADER
sal_Int16 nTmp16 = 0;
+ sal_uInt8 nTmp8 = 0;
if ( rHeader.nSize == DIBCOREHEADERSIZE )
{
@@ -318,7 +318,6 @@ sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader,
}
else if ( bIsMSOFormat && ( rHeader.nSize == BITMAPINFOHEADER ) )
{
- sal_uInt8 nTmp8 = 0;
rIStm >> nTmp16; rHeader.nWidth = nTmp16;
rIStm >> nTmp16; rHeader.nHeight = nTmp16;
rIStm >> nTmp8; rHeader.nPlanes = nTmp8;
@@ -337,7 +336,7 @@ sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader,
// unknown Header
if( rHeader.nSize < DIBINFOHEADERSIZE )
{
- sal_uLong nUnknownSize = sizeof( rHeader.nSize );
+ ULONG nUnknownSize = sizeof( rHeader.nSize );
rIStm >> rHeader.nWidth; nUnknownSize += sizeof( rHeader.nWidth );
rIStm >> rHeader.nHeight; nUnknownSize += sizeof( rHeader.nHeight );
@@ -408,7 +407,7 @@ sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader,
if ( rHeader.nWidth < 0 )
rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
-
+
// #144105# protect a little against damaged files
if( rHeader.nSizeImage > ( 16 * static_cast< sal_uInt32 >( rHeader.nWidth * rHeader.nHeight ) ) )
rHeader.nSizeImage = 0;
@@ -418,17 +417,17 @@ sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader,
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad )
+BOOL Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad )
{
- const sal_uInt16 nColors = rAcc.GetPaletteEntryCount();
- const sal_uLong nPalSize = nColors * ( bQuad ? 4UL : 3UL );
- BitmapColor aPalColor;
+ const USHORT nColors = rAcc.GetPaletteEntryCount();
+ const ULONG nPalSize = nColors * ( bQuad ? 4UL : 3UL );
+ BitmapColor aPalColor;
- sal_uInt8* pEntries = new sal_uInt8[ nPalSize ];
+ BYTE* pEntries = new BYTE[ nPalSize ];
rIStm.Read( pEntries, nPalSize );
- sal_uInt8* pTmpEntry = pEntries;
- for( sal_uInt16 i = 0; i < nColors; i++ )
+ BYTE* pTmpEntry = pEntries;
+ for( USHORT i = 0; i < nColors; i++ )
{
aPalColor.SetBlue( *pTmpEntry++ );
aPalColor.SetGreen( *pTmpEntry++ );
@@ -447,15 +446,15 @@ sal_Bool Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, s
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
+BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
{
- 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 ) ||
+ 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 ) ||
( RLE_4 == rHeader.nCompression && rHeader.nBitCount == 4 );
// Is native format?
@@ -469,7 +468,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
break;
default:
- bNative = sal_False;
+ bNative = FALSE;
break;
}
// Read data
@@ -511,14 +510,14 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
{
if ( !rHeader.nSizeImage )
{
- const sal_uLong nOldPos = rIStm.Tell();
+ const ULONG nOldPos = rIStm.Tell();
rIStm.Seek( STREAM_SEEK_TO_END );
rHeader.nSizeImage = rIStm.Tell() - nOldPos;
rIStm.Seek( nOldPos );
}
- sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( rHeader.nSizeImage );
+ BYTE* pBuffer = (BYTE*) rtl_allocateMemory( rHeader.nSizeImage );
rIStm.Read( (char*) pBuffer, rHeader.nSizeImage );
ImplDecodeRLE( pBuffer, rHeader, rAcc, RLE_4 == rHeader.nCompression );
@@ -527,9 +526,9 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
}
else
{
- const long nWidth = rHeader.nWidth;
- const long nHeight = abs(rHeader.nHeight);
- sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
+ const long nWidth = rHeader.nWidth;
+ const long nHeight = abs(rHeader.nHeight);
+ BYTE* pBuf = new BYTE[ nAlignedWidth ];
// true color DIB's can have a (optimization) palette
if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
@@ -538,13 +537,13 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
const long nI = bTopDown ? 1 : -1;
long nY = bTopDown ? 0 : nHeight - 1;
long nCount = nHeight;
-
+
switch( rHeader.nBitCount )
{
case( 1 ):
{
- sal_uInt8* pTmp;
- sal_uInt8 cTmp;
+ BYTE* pTmp;
+ BYTE cTmp;
for( ; nCount--; nY += nI )
{
@@ -559,7 +558,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> --nShift ) & 1) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> --nShift ) & 1) );
}
}
}
@@ -567,8 +566,8 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
case( 4 ):
{
- sal_uInt8* pTmp;
- sal_uInt8 cTmp;
+ BYTE* pTmp;
+ BYTE cTmp;
for( ; nCount--; nY += nI )
{
@@ -583,7 +582,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
}
}
}
@@ -591,7 +590,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
case( 8 ):
{
- sal_uInt8* pTmp;
+ BYTE* pTmp;
for( ; nCount--; nY += nI )
{
@@ -605,17 +604,17 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
case( 16 ):
{
- ColorMask aMask( nRMask, nGMask, nBMask );
+ ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- sal_uInt16* pTmp16;
+ UINT16* pTmp16;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp16 = (sal_uInt16*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp16 = (UINT16*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor16BitLSB( aColor, (sal_uInt8*) pTmp16++ );
+ aMask.GetColorFor16BitLSB( aColor, (BYTE*) pTmp16++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -625,7 +624,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
case( 24 ):
{
BitmapColor aPixelColor;
- sal_uInt8* pTmp;
+ BYTE* pTmp;
for( ; nCount--; nY += nI )
{
@@ -644,17 +643,17 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
case( 32 ):
{
- ColorMask aMask( nRMask, nGMask, nBMask );
+ ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- sal_uInt32* pTmp32;
+ UINT32* pTmp32;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp32 = (sal_uInt32*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp32 = (UINT32*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor32Bit( aColor, (sal_uInt8*) pTmp32++ );
+ aMask.GetColorFor32Bit( aColor, (BYTE*) pTmp32++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -670,18 +669,18 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
// ------------------------------------------------------------------
-sal_Bool Bitmap::Write( SvStream& rOStm, sal_Bool bCompressed, sal_Bool bFileHeader ) const
+BOOL Bitmap::Write( SvStream& rOStm, BOOL bCompressed, BOOL bFileHeader ) const
{
DBG_ASSERT( mpImpBmp, "Empty Bitmaps can't be saved" );
- const Size aSizePix( GetSizePixel() );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ BOOL bRet = FALSE;
if( mpImpBmp && aSizePix.Width() && aSizePix.Height() )
{
- BitmapReadAccess* pAcc = ( (Bitmap*) this)->AcquireReadAccess();
- const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
- const sal_uLong nOldPos = rOStm.Tell();
+ BitmapReadAccess* pAcc = ( (Bitmap*) this)->AcquireReadAccess();
+ const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const ULONG nOldPos = rOStm.Tell();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -712,14 +711,14 @@ sal_Bool Bitmap::Write( SvStream& rOStm, sal_Bool bCompressed, sal_Bool bFileHea
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const
+BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const
{
- const MapMode aMapPixel( MAP_PIXEL );
- DIBInfoHeader aHeader;
- sal_uLong nImageSizePos;
- sal_uLong nEndPos;
- sal_uInt32 nCompression = 0;
- sal_Bool bRet = sal_False;
+ const MapMode aMapPixel( MAP_PIXEL );
+ DIBInfoHeader aHeader;
+ ULONG nImageSizePos;
+ ULONG nEndPos;
+ sal_uInt32 nCompression = 0;
+ BOOL bRet = FALSE;
aHeader.nSize = DIBINFOHEADERSIZE;
aHeader.nWidth = rAcc.Width();
@@ -730,7 +729,7 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
{
aHeader.nBitCount = ( rAcc.GetScanlineFormat() == BMP_FORMAT_16BIT_TC_LSB_MASK ) ? 16 : 32;
aHeader.nSizeImage = rAcc.Height() * rAcc.GetScanlineSize();
-
+
nCompression = BITFIELDS;
}
else
@@ -744,10 +743,10 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
// recent.
// #i59239# discretize bitcount to 1,4,8,24 (other cases
// are not written below)
- const sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
+ const UINT16 nBitCount( sal::static_int_cast<UINT16>(rAcc.GetBitCount()) );
aHeader.nBitCount = discretizeBitcount( nBitCount );
- aHeader.nSizeImage = rAcc.Height() *
+ aHeader.nSizeImage = rAcc.Height() *
AlignedWidth4Bytes( rAcc.Width()*aHeader.nBitCount );
if( bCompressed )
@@ -761,7 +760,7 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
nCompression = COMPRESS_NONE;
}
- if( ( rOStm.GetCompressMode() & COMPRESSMODE_ZBITMAP ) &&
+ if( ( rOStm.GetCompressMode() & COMPRESSMODE_ZBITMAP ) &&
( rOStm.GetVersion() >= SOFFICE_FILEFORMAT_40 ) )
{
aHeader.nCompression = ZCOMPRESS;
@@ -777,18 +776,18 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
// MapMode is integer-based, and suffers from roundoffs,
// especially if maPrefSize is small. Trying to circumvent
// that by performing part of the math in floating point.
- const Size aScale100000(
+ const Size aScale100000(
OutputDevice::LogicToLogic( Size(100000L,
- 100000L),
- MAP_100TH_MM,
+ 100000L),
+ MAP_100TH_MM,
maPrefMapMode ) );
const double fBmpWidthM((double)maPrefSize.Width() / aScale100000.Width() );
const double fBmpHeightM((double)maPrefSize.Height() / aScale100000.Height() );
if( fabs(fBmpWidthM) > 0.000000001 &&
fabs(fBmpHeightM) > 0.000000001 )
{
- aHeader.nXPelsPerMeter = (sal_uInt32)(rAcc.Width() / fBmpWidthM + .5);
- aHeader.nYPelsPerMeter = (sal_uInt32)(rAcc.Height() / fBmpHeightM + .5);
+ aHeader.nXPelsPerMeter = (UINT32)(rAcc.Width() / fBmpWidthM + .5);
+ aHeader.nYPelsPerMeter = (UINT32)(rAcc.Height() / fBmpHeightM + .5);
}
}
@@ -812,15 +811,15 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
if( aHeader.nCompression == ZCOMPRESS )
{
- ZCodec aCodec;
- SvMemoryStream aMemStm( aHeader.nSizeImage + 4096, 65535 );
- sal_uLong nCodedPos = rOStm.Tell(), nLastPos;
- sal_uInt32 nCodedSize, nUncodedSize;
+ ZCodec aCodec;
+ SvMemoryStream aMemStm( aHeader.nSizeImage + 4096, 65535 );
+ ULONG nCodedPos = rOStm.Tell(), nLastPos;
+ sal_uInt32 nCodedSize, nUncodedSize;
// write uncoded data palette
if( aHeader.nColsUsed )
ImplWriteDIBPalette( aMemStm, rAcc );
-
+
// write uncoded bits
bRet = ImplWriteDIBBits( aMemStm, rAcc, nCompression, aHeader.nSizeImage );
@@ -829,12 +828,12 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
// seek over compress info
rOStm.SeekRel( 12 );
-
+
// write compressed data
aCodec.BeginCompression( 3 );
- aCodec.Write( rOStm, (sal_uInt8*) aMemStm.GetData(), nUncodedSize );
+ aCodec.Write( rOStm, (BYTE*) aMemStm.GetData(), nUncodedSize );
aCodec.EndCompression();
-
+
// update compress info ( coded size, uncoded size, uncoded compression )
nCodedSize = ( nLastPos = rOStm.Tell() ) - nCodedPos - 12;
rOStm.Seek( nCodedPos );
@@ -862,16 +861,16 @@ sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
+BOOL Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- sal_uInt32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
+ UINT32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
isBitfieldCompression( rAcc.GetScanlineFormat() ) ? 3UL : 0UL );
- sal_uInt32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
+ UINT32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
- rOStm << (sal_uInt16) 0x4D42;
- rOStm << (sal_uInt32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
- rOStm << (sal_uInt16) 0;
- rOStm << (sal_uInt16) 0;
+ rOStm << (UINT16) 0x4D42;
+ rOStm << (UINT32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
+ rOStm << (UINT16) 0;
+ rOStm << (UINT16) 0;
rOStm << nOffset;
return( rOStm.GetError() == 0UL );
@@ -879,15 +878,15 @@ sal_Bool Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
+BOOL Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- 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;
+ const USHORT nColors = rAcc.GetPaletteEntryCount();
+ const ULONG nPalSize = nColors * 4UL;
+ BYTE* pEntries = new BYTE[ nPalSize ];
+ BYTE* pTmpEntry = pEntries;
+ BitmapColor aPalColor;
- for( sal_uInt16 i = 0; i < nColors; i++ )
+ for( USHORT i = 0; i < nColors; i++ )
{
const BitmapColor& rPalColor = rAcc.GetPaletteColor( i );
@@ -905,22 +904,22 @@ sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- sal_uLong nCompression, sal_uInt32& rImageSize )
+BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ ULONG nCompression, sal_uInt32& rImageSize )
{
if( BITFIELDS == nCompression )
{
- const ColorMask& rMask = rAcc.GetColorMask();
- SVBT32 aVal32;
+ const ColorMask& rMask = rAcc.GetColorMask();
+ SVBT32 aVal32;
UInt32ToSVBT32( rMask.GetRedMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( (BYTE*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetGreenMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( (BYTE*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetBlueMask(), aVal32 );
- rOStm.Write( (sal_uInt8*) aVal32, 4UL );
+ rOStm.Write( (BYTE*) aVal32, 4UL );
rImageSize = rOStm.Tell();
@@ -947,10 +946,10 @@ sal_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 sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
- const sal_uLong nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
+ const USHORT nBitCount( sal::static_int_cast<USHORT>(rAcc.GetBitCount()) );
+ const ULONG nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
discretizeBitcount(nBitCount));
- sal_Bool bNative = sal_False;
+ BOOL bNative = FALSE;
switch( rAcc.GetScanlineFormat() )
{
@@ -960,7 +959,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
case( BMP_FORMAT_24BIT_TC_BGR ):
{
if( rAcc.IsBottomUp() && ( rAcc.GetScanlineSize() == nAlignedWidth ) )
- bNative = sal_True;
+ bNative = TRUE;
}
break;
@@ -974,11 +973,11 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
rOStm.Write( rAcc.GetBuffer(), nAlignedWidth * rAcc.Height() );
else
{
- const long nWidth = rAcc.Width();
- const long nHeight = rAcc.Height();
- sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
- sal_uInt8* pTmp;
- sal_uInt8 cTmp;
+ const long nWidth = rAcc.Width();
+ const long nHeight = rAcc.Height();
+ BYTE* pBuf = new BYTE[ nAlignedWidth ];
+ BYTE* pTmp;
+ BYTE cTmp;
switch( nBitCount )
{
@@ -998,7 +997,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << --nShift );
+ cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << --nShift );
}
*pTmp = cTmp;
@@ -1023,7 +1022,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
+ cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
}
*pTmp = cTmp;
rOStm.Write( pBuf, nAlignedWidth );
@@ -1081,17 +1080,17 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
// ------------------------------------------------------------------
-void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, sal_Bool bRLE4 )
+void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, BOOL bRLE4 )
{
- Scanline pRLE = pBuffer;
- long nY = abs(rHeader.nHeight) - 1L;
- const sal_uLong nWidth = rAcc.Width();
- sal_uLong nCountByte;
- sal_uLong nRunByte;
- sal_uLong nX = 0UL;
- sal_uInt8 cTmp;
- sal_Bool bEndDecoding = sal_False;
+ 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;
do
{
@@ -1105,10 +1104,10 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
{
nCountByte = nRunByte >> 1;
- for( sal_uLong i = 0UL; i < nCountByte; i++ )
+ for( ULONG i = 0UL; i < nCountByte; i++ )
{
cTmp = *pRLE++;
-
+
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, cTmp >> 4 );
@@ -1129,7 +1128,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( sal_uLong i = 0UL; i < nRunByte; i++ )
+ for( ULONG i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, *pRLE );
@@ -1147,7 +1146,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
nX = 0UL;
}
else if( nRunByte == 1 )
- bEndDecoding = sal_True;
+ bEndDecoding = TRUE;
else
{
nX += *pRLE++;
@@ -1162,7 +1161,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
{
nRunByte = nCountByte >> 1;
- for( sal_uLong i = 0UL; i < nRunByte; i++ )
+ for( ULONG i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, cTmp >> 4 );
@@ -1176,7 +1175,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( sal_uLong i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
+ for( ULONG i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
rAcc.SetPixel( nY, nX++, cTmp );
}
}
@@ -1186,19 +1185,19 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 )
+BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
{
- 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;
+ 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;
for ( long nY = nHeight - 1L; nY >= 0L; nY-- )
{
@@ -1218,7 +1217,7 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
if ( nCount > 1 )
{
- *pTmp++ = (sal_uInt8) nCount;
+ *pTmp++ = (BYTE) nCount;
*pTmp++ = ( bRLE4 ? ( ( cPix << 4 ) | cPix ) : cPix );
nBufCount += 2;
}
@@ -1226,13 +1225,13 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
{
cLast = cPix;
nSaveIndex = nX - 1UL;
- bFound = sal_False;
+ bFound = FALSE;
while( ( nX < nWidth ) && ( nCount < 256L ) && ( cPix = rAcc.GetPixel( nY, nX ) ) != cLast )
{
nX++; nCount++;
cLast = cPix;
- bFound = sal_True;
+ bFound = TRUE;
}
if ( bFound )
@@ -1241,13 +1240,13 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
if ( nCount > 3 )
{
*pTmp++ = 0;
- *pTmp++ = (sal_uInt8) --nCount;
+ *pTmp++ = (BYTE) --nCount;
if( bRLE4 )
{
- for ( sal_uLong i = 0; i < nCount; i++, pTmp++ )
+ for ( ULONG i = 0; i < nCount; i++, pTmp++ )
{
- *pTmp = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
+ *pTmp = (BYTE) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
if ( ++i < nCount )
*pTmp |= rAcc.GetPixel( nY, nSaveIndex++ );
@@ -1257,7 +1256,7 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
}
else
{
- for( sal_uLong i = 0UL; i < nCount; i++ )
+ for( ULONG i = 0UL; i < nCount; i++ )
*pTmp++ = rAcc.GetPixel( nY, nSaveIndex++ );
}
@@ -1272,12 +1271,12 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
else
{
*pTmp++ = 1;
- *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (BYTE) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
if ( nCount == 3 )
{
*pTmp++ = 1;
- *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (BYTE) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
nBufCount += 4;
}
else
@@ -1292,8 +1291,8 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
rOStm.Write( pBuf, nBufCount );
}
- rOStm << (sal_uInt8) 0;
- rOStm << (sal_uInt8) 1;
+ rOStm << (BYTE) 0;
+ rOStm << (BYTE) 1;
delete[] pBuf;
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index c2d929ea4fa0..fcd60f2dcda5 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,49 +41,49 @@
// - Defines -
// -----------
-#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; \
- nBErr = MinMax( nTemp, 0, 255 ); \
- nBErr = nBErr - FloydIndexMap[ nBC = FloydMap[nBErr] ]; \
- nTemp = p1T[nX++] >> 12; \
- nGErr = MinMax( nTemp, 0, 255 ); \
- nGErr = nGErr - FloydIndexMap[ nGC = FloydMap[nGErr] ]; \
- nTemp = p1T[nX] >> 12; \
- nRErr = MinMax( nTemp, 0, 255 ); \
+#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 CALC_ERRORS \
+ nTemp = p1T[nX++] >> 12; \
+ nBErr = MinMax( nTemp, 0, 255 ); \
+ nBErr = nBErr - FloydIndexMap[ nBC = FloydMap[nBErr] ]; \
+ nTemp = p1T[nX++] >> 12; \
+ nGErr = MinMax( nTemp, 0, 255 ); \
+ nGErr = nGErr - FloydIndexMap[ nGC = FloydMap[nGErr] ]; \
+ nTemp = p1T[nX] >> 12; \
+ nRErr = MinMax( nTemp, 0, 255 ); \
nRErr = nRErr - FloydIndexMap[ nRC = FloydMap[nRErr] ];
-#define CALC_TABLES3 \
- p2T[nX++] += FloydError3[nBErr]; \
- p2T[nX++] += FloydError3[nGErr]; \
+#define CALC_TABLES3 \
+ p2T[nX++] += FloydError3[nBErr]; \
+ p2T[nX++] += FloydError3[nGErr]; \
p2T[nX++] += FloydError3[nRErr];
-#define CALC_TABLES5 \
- p2T[nX++] += FloydError5[nBErr]; \
- p2T[nX++] += FloydError5[nGErr]; \
+#define CALC_TABLES5 \
+ p2T[nX++] += FloydError5[nBErr]; \
+ p2T[nX++] += FloydError5[nGErr]; \
p2T[nX++] += FloydError5[nRErr];
-#define CALC_TABLES7 \
- p1T[++nX] += FloydError7[nBErr]; \
- p2T[nX++] += FloydError1[nBErr]; \
- p1T[nX] += FloydError7[nGErr]; \
- p2T[nX++] += FloydError1[nGErr]; \
- p1T[nX] += FloydError7[nRErr]; \
+#define CALC_TABLES7 \
+ p1T[++nX] += FloydError7[nBErr]; \
+ p2T[nX++] += FloydError1[nBErr]; \
+ p1T[nX] += FloydError7[nGErr]; \
+ p2T[nX++] += FloydError1[nGErr]; \
+ p1T[nX] += FloydError7[nRErr]; \
p2T[nX] += FloydError1[nRErr];
// -----------
// - Statics -
// -----------
-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 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 nVCLDitherLut[ 256 ] =
+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 @@ sal_uLong nVCLDitherLut[ 256 ] =
// ------------------------------------------------------------------------
-sal_uLong nVCLLut[ 256 ] =
+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( sal_uInt8 (*pDitherMatrix)[16][16] )
+void ImplCreateDitherMatrix( BYTE (*pDitherMatrix)[16][16] )
{
- double fVal = 3.125;
- const double fVal16 = fVal / 16.;
- long i, j, k, l;
- sal_uInt16 pMtx[ 16 ][ 16 ];
- sal_uInt16 nMax = 0;
- static sal_uInt8 pMagic[4][4] = { { 0, 14, 3, 13, },
+ 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, },
{11, 5, 8, 6, },
{12, 2, 15, 1, },
{7, 9, 4, 10 } };
@@ -261,22 +261,22 @@ void ImplCreateDitherMatrix( sal_uInt8 (*pDitherMatrix)[16][16] )
for ( k = 0; k < 4; k++ )
for ( l = 0; l < 4; l++ )
nMax = Max ( pMtx[ (k<<2) + i][(l<<2 ) + j] =
- (sal_uInt16) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax );
+ (USHORT) ( 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] = (sal_uInt8) ( fVal * pMtx[i][j] );
+ (*pDitherMatrix)[i][j] = (BYTE) ( fVal * pMtx[i][j] );
}
// ----------
// - Bitmap -
// ----------
-sal_Bool Bitmap::Convert( BmpConversion eConversion )
+BOOL Bitmap::Convert( BmpConversion eConversion )
{
- const sal_uInt16 nBitCount = GetBitCount();
- sal_Bool bRet = sal_False;
+ const USHORT nBitCount = GetBitCount();
+ BOOL bRet = FALSE;
switch( eConversion )
{
@@ -299,7 +299,7 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 4 )
bRet = ImplConvertDown( 4, NULL );
else
- bRet = sal_True;
+ bRet = TRUE;
}
break;
@@ -325,7 +325,7 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 8 )
bRet = ImplConvertDown( 8 );
else
- bRet = sal_True;
+ bRet = TRUE;
}
break;
@@ -343,9 +343,9 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
case( BMP_CONVERSION_24BIT ):
{
if( nBitCount < 24 )
- bRet = ImplConvertUp( 24, sal_False );
+ bRet = ImplConvertUp( 24, FALSE );
else
- bRet = sal_True;
+ bRet = TRUE;
}
break;
@@ -354,7 +354,7 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
break;
default:
- OSL_FAIL( "Bitmap::Convert(): Unsupported conversion" );
+ DBG_ERROR( "Bitmap::Convert(): Unsupported conversion" );
break;
}
@@ -363,22 +363,22 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold )
+BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 1 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 1 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
- const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
+ const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
if( pReadAcc->HasPalette() )
{
@@ -414,15 +414,15 @@ sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -436,23 +436,23 @@ sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplMakeMonoDither()
+BOOL Bitmap::ImplMakeMonoDither()
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 1 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 1 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
- const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- sal_uInt8 pDitherMatrix[ 16 ][ 16 ];
+ const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
+ const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
+ BYTE pDitherMatrix[ 16 ][ 16 ];
ImplCreateDitherMatrix( &pDitherMatrix );
@@ -490,15 +490,15 @@ sal_Bool Bitmap::ImplMakeMonoDither()
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -512,31 +512,31 @@ sal_Bool Bitmap::ImplMakeMonoDither()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
+BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
{
DBG_ASSERT( nGreys == 16 || nGreys == 256, "Only 16 or 256 greyscales are supported!" );
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- const BitmapPalette& rPal = GetGreyPalette( nGreys );
- sal_uLong nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
- sal_Bool bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
+ const BitmapPalette& rPal = GetGreyPalette( nGreys );
+ ULONG nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
+ BOOL bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
if( !bPalDiffers )
bPalDiffers = ( (BitmapPalette&) rPal != pReadAcc->GetPalette() );
if( bPalDiffers )
{
- Bitmap aNewBmp( GetSizePixel(), ( nGreys == 16 ) ? 4 : 8, &rPal );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), ( nGreys == 16 ) ? 4 : 8, &rPal );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
if( pReadAcc->HasPalette() )
{
@@ -545,7 +545,7 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
pWriteAcc->SetPixel( nY, nX,
- (sal_uInt8) ( pReadAcc->GetPaletteColor(
+ (BYTE) ( pReadAcc->GetPaletteColor(
pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ) );
}
}
@@ -562,11 +562,11 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const sal_uLong nB = *pReadScan++;
- const sal_uLong nG = *pReadScan++;
- const sal_uLong nR = *pReadScan++;
-
- *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ const ULONG nB = *pReadScan++;
+ const ULONG nG = *pReadScan++;
+ const ULONG nR = *pReadScan++;
+
+ *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -582,11 +582,11 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const sal_uLong nR = *pReadScan++;
- const sal_uLong nG = *pReadScan++;
- const sal_uLong nB = *pReadScan++;
-
- *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ const ULONG nR = *pReadScan++;
+ const ULONG nG = *pReadScan++;
+ const ULONG nB = *pReadScan++;
+
+ *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -594,19 +594,19 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
+ pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<BYTE>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -617,7 +617,7 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
else
{
ReleaseAccess( pReadAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
@@ -626,32 +626,32 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor )
+BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount > GetBitCount(), "New BitCount must be greater!" );
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- BitmapPalette aPal;
- Bitmap aNewBmp( GetSizePixel(), nBitCount, pReadAcc->HasPalette() ? &pReadAcc->GetPalette() : &aPal );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BitmapPalette aPal;
+ Bitmap aNewBmp( GetSizePixel(), nBitCount, pReadAcc->HasPalette() ? &pReadAcc->GetPalette() : &aPal );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
if( pWriteAcc->HasPalette() )
{
- const sal_uInt16 nOldCount = 1 << GetBitCount();
- const BitmapPalette& rOldPal = pReadAcc->GetPalette();
+ const USHORT nOldCount = 1 << GetBitCount();
+ const BitmapPalette& rOldPal = pReadAcc->GetPalette();
aPal.SetEntryCount( 1 << nBitCount );
- for( sal_uInt16 i = 0; i < nOldCount; i++ )
+ for( USHORT i = 0; i < nOldCount; i++ )
aPal[ i ] = rOldPal[ i ];
if( pExtColor )
@@ -680,15 +680,15 @@ sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -702,37 +702,37 @@ sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
+BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount <= GetBitCount(), "New BitCount must be lower ( or equal when pExtColor is set )!" );
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- BitmapPalette aPal;
- Bitmap aNewBmp( GetSizePixel(), nBitCount, &aPal );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BitmapPalette aPal;
+ Bitmap aNewBmp( GetSizePixel(), nBitCount, &aPal );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const sal_uInt16 nCount = 1 << nBitCount;
- const long nWidth = pWriteAcc->Width();
- const long nWidth1 = nWidth - 1L;
- const long nHeight = pWriteAcc->Height();
- Octree aOctree( *pReadAcc, pExtColor ? ( nCount - 1 ) : nCount );
+ const USHORT nCount = 1 << nBitCount;
+ const long nWidth = pWriteAcc->Width();
+ const long nWidth1 = nWidth - 1L;
+ const long nHeight = pWriteAcc->Height();
+ Octree aOctree( *pReadAcc, pExtColor ? ( nCount - 1 ) : nCount );
InverseColorMap aColorMap( aPal = aOctree.GetPalette() );
- BitmapColor aColor;
- ImpErrorQuad aErrQuad;
- ImpErrorQuad* pErrQuad1 = new ImpErrorQuad[ nWidth ];
- ImpErrorQuad* pErrQuad2 = new ImpErrorQuad[ nWidth ];
- ImpErrorQuad* pQLine1 = pErrQuad1;
- ImpErrorQuad* pQLine2 = 0;
- long nX, nY;
- long nYTmp = 0L;
- sal_uInt8 cIndex;
- sal_Bool bQ1 = sal_True;
+ BitmapColor aColor;
+ ImpErrorQuad aErrQuad;
+ ImpErrorQuad* pErrQuad1 = new ImpErrorQuad[ nWidth ];
+ ImpErrorQuad* pErrQuad2 = new ImpErrorQuad[ nWidth ];
+ ImpErrorQuad* pQLine1 = pErrQuad1;
+ ImpErrorQuad* pQLine2 = 0;
+ long nX, nY;
+ long nYTmp = 0L;
+ BYTE cIndex;
+ BOOL bQ1 = TRUE;
if( pExtColor )
{
@@ -764,12 +764,12 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
for( nY = 0L; nY < nHeight; nY++, nYTmp++ )
{
// erstes ZeilenPixel
- cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
+ cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, 0, cIndex );
for( nX = 1L; nX < nWidth1; nX++ )
{
- cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
+ cIndex = (BYTE) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
aErrQuad = ( ImpErrorQuad( aColor ) -= pWriteAcc->GetPaletteColor( cIndex ) );
pQLine1[ ++nX ].ImplAddColorError7( aErrQuad );
pQLine2[ nX-- ].ImplAddColorError1( aErrQuad );
@@ -781,13 +781,13 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
// letztes ZeilenPixel
if( nX < nWidth )
{
- cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
+ cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, nX, cIndex );
}
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
{
@@ -806,15 +806,15 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
delete[] pErrQuad2;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -828,11 +828,11 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplConvertGhosted()
+BOOL Bitmap::ImplConvertGhosted()
{
- Bitmap aNewBmp;
- BitmapReadAccess* pR = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ Bitmap aNewBmp;
+ BitmapReadAccess* pR = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pR )
{
@@ -842,8 +842,8 @@ sal_Bool Bitmap::ImplConvertGhosted()
for( long i = 0, nCount = aNewPal.GetEntryCount(); i < nCount; i++ )
{
- const BitmapColor& rOld = pR->GetPaletteColor( (sal_uInt16) i );
- aNewPal[ (sal_uInt16) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
+ const BitmapColor& rOld = pR->GetPaletteColor( (USHORT) i );
+ aNewPal[ (USHORT) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
( rOld.GetGreen() >> 1 ) | 0x80,
( rOld.GetBlue() >> 1 ) | 0x80 );
}
@@ -855,7 +855,7 @@ sal_Bool Bitmap::ImplConvertGhosted()
{
pW->CopyBuffer( *pR );
aNewBmp.ReleaseAccess( pW );
- bRet = sal_True;
+ bRet = TRUE;
}
}
else
@@ -873,7 +873,7 @@ sal_Bool Bitmap::ImplConvertGhosted()
for( long nX = 0; nX < nWidth; nX++ )
{
const BitmapColor aOld( pR->GetPixel( nY, nX ) );
- pW->SetPixel( nY, nX, BitmapColor( ( aOld.GetRed() >> 1 ) | 0x80,
+ pW->SetPixel( nY, nX, BitmapColor( ( aOld.GetRed() >> 1 ) | 0x80,
( aOld.GetGreen() >> 1 ) | 0x80,
( aOld.GetBlue() >> 1 ) | 0x80 ) );
@@ -881,7 +881,7 @@ sal_Bool Bitmap::ImplConvertGhosted()
}
aNewBmp.ReleaseAccess( pW );
- bRet = sal_True;
+ bRet = TRUE;
}
}
@@ -890,8 +890,8 @@ sal_Bool Bitmap::ImplConvertGhosted()
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -904,9 +904,9 @@ sal_Bool Bitmap::ImplConvertGhosted()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+BOOL Bitmap::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
{
- sal_Bool bRet;
+ BOOL bRet;
if( ( rScaleX != 1.0 ) || ( rScaleY != 1.0 ) )
{
@@ -915,20 +915,20 @@ sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong
else if( BMP_SCALE_INTERPOLATE == nScaleFlag )
bRet = ImplScaleInterpolate( rScaleX, rScaleY );
else
- bRet = sal_False;
+ bRet = FALSE;
}
else
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+BOOL Bitmap::Scale( const Size& rNewSize, ULONG nScaleFlag )
{
- const Size aSize( GetSizePixel() );
- sal_Bool bRet;
+ const Size aSize( GetSizePixel() );
+ BOOL bRet;
if( aSize.Width() && aSize.Height() )
{
@@ -937,45 +937,44 @@ sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
nScaleFlag );
}
else
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
+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 );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
+ const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
+ BOOL bRet = FALSE;
if( nNewWidth && nNewHeight )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- Bitmap aNewBmp( Size( nNewWidth, nNewHeight ), GetBitCount(), &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ Bitmap aNewBmp( Size( nNewWidth, nNewHeight ), GetBitCount(), &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pReadAcc && pWriteAcc )
{
- const long nScanlineSize = pWriteAcc->GetScanlineSize();
- const long nNewWidth1 = nNewWidth - 1L;
- const long nNewHeight1 = nNewHeight - 1L;
- const long nWidth = pReadAcc->Width();
- const long nHeight = pReadAcc->Height();
- long* pLutX = new long[ nNewWidth ];
- long* pLutY = new long[ nNewHeight ];
+ 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;
+ long* pLutX = new long[ nNewWidth ];
+ long* pLutY = new long[ nNewHeight ];
+ long nX, nY, nMapY, nActY = 0L;
if( nNewWidth1 && nNewHeight1 )
{
- long nX, nY, nMapY, nActY = 0L;
-
for( nX = 0L; nX < nNewWidth; nX++ )
- pLutX[ nX ] = nX * nWidth / nNewWidth;
+ pLutX[ nX ] = nX * nWidth1 / nNewWidth1;
for( nY = 0L; nY < nNewHeight; nY++ )
- pLutY[ nY ] = nY * nHeight / nNewHeight;
+ pLutY[ nY ] = nY * nHeight1 / nNewHeight1;
while( nActY < nNewHeight )
{
@@ -994,7 +993,7 @@ sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
nActY++;
}
- bRet = sal_True;
+ bRet = TRUE;
}
delete[] pLutX;
@@ -1013,34 +1012,34 @@ sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY )
+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 );
- sal_Bool bRet = sal_False;
+ const Size aSizePix( GetSizePixel() );
+ const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
+ const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
+ BOOL bRet = FALSE;
if( ( nNewWidth > 1L ) && ( nNewHeight > 1L ) )
{
- BitmapColor aCol0;
- BitmapColor aCol1;
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- long nWidth = pReadAcc->Width();
- long nHeight = pReadAcc->Height();
- Bitmap aNewBmp( Size( nNewWidth, nHeight ), 24 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- long* pLutInt;
- long* pLutFrac;
- long nX, nY;
- long lXB0, lXB1, lXG0, lXG1, lXR0, lXR1;
- double fTemp;
- long nTemp;
+ BitmapColor aCol0;
+ BitmapColor aCol1;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ long nWidth = pReadAcc->Width();
+ long nHeight = pReadAcc->Height();
+ Bitmap aNewBmp( Size( nNewWidth, nHeight ), 24 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ long* pLutInt;
+ long* pLutFrac;
+ long nX, nY;
+ long lXB0, lXB1, lXG0, lXG1, lXR0, lXR1;
+ double fTemp;
+ long nTemp;
if( pReadAcc && pWriteAcc )
{
- const long nNewWidth1 = nNewWidth - 1L;
- const long nWidth1 = pReadAcc->Width() - 1L;
- const double fRevScaleX = (double) nWidth1 / nNewWidth1;
+ const long nNewWidth1 = nNewWidth - 1L;
+ const long nWidth1 = pReadAcc->Width() - 1L;
+ const double fRevScaleX = (double) nWidth1 / nNewWidth1;
pLutInt = new long[ nNewWidth ];
pLutFrac = new long[ nNewWidth ];
@@ -1079,9 +1078,9 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- 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 ) );
+ aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1114,9 +1113,9 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- 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 ) );
+ aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1126,7 +1125,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
delete[] pLutInt;
delete[] pLutFrac;
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1134,7 +1133,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
if( bRet )
{
- bRet = sal_False;
+ bRet = FALSE;
ImplAssignWithSize( aNewBmp );
pReadAcc = AcquireReadAccess();
aNewBmp = Bitmap( Size( nNewWidth, nNewHeight ), 24 );
@@ -1142,9 +1141,9 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
if( pReadAcc && pWriteAcc )
{
- const long nNewHeight1 = nNewHeight - 1L;
- const long nHeight1 = pReadAcc->Height() - 1L;
- const double fRevScaleY = (double) nHeight1 / nNewHeight1;
+ const long nNewHeight1 = nNewHeight - 1L;
+ const long nHeight1 = pReadAcc->Height() - 1L;
+ const double fRevScaleY = (double) nHeight1 / nNewHeight1;
pLutInt = new long[ nNewHeight ];
pLutFrac = new long[ nNewHeight ];
@@ -1183,9 +1182,9 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- 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 ) );
+ aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1218,9 +1217,9 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- 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 ) );
+ aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1230,7 +1229,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
delete[] pLutInt;
delete[] pLutFrac;
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1249,14 +1248,14 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Dither( sal_uLong nDitherFlags )
+BOOL Bitmap::Dither( ULONG nDitherFlags )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
const Size aSizePix( GetSizePixel() );
if( aSizePix.Width() == 1 || aSizePix.Height() == 1 )
- bRet = sal_True;
+ bRet = TRUE;
else if( nDitherFlags & BMP_DITHER_MATRIX )
bRet = ImplDitherMatrix();
else if( nDitherFlags & BMP_DITHER_FLOYD )
@@ -1269,55 +1268,55 @@ sal_Bool Bitmap::Dither( sal_uLong nDitherFlags )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplDitherMatrix()
+BOOL Bitmap::ImplDitherMatrix()
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- Bitmap aNewBmp( GetSizePixel(), 8 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ Bitmap aNewBmp( GetSizePixel(), 8 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pReadAcc && pWriteAcc )
{
- const sal_uLong nWidth = pReadAcc->Width();
- const sal_uLong nHeight = pReadAcc->Height();
- BitmapColor aIndex( (sal_uInt8) 0 );
+ const ULONG nWidth = pReadAcc->Width();
+ const ULONG nHeight = pReadAcc->Height();
+ BitmapColor aIndex( (BYTE) 0 );
if( pReadAcc->HasPalette() )
{
- for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
+ for( ULONG nY = 0UL; nY < nHeight; nY++ )
{
- for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
- const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) );
- 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;
+ 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;
- aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
else
{
- for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
+ for( ULONG nY = 0UL; nY < nHeight; nY++ )
{
- for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
- const BitmapColor aCol( pReadAcc->GetPixel( nY, nX ) );
- 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;
+ 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;
- aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1325,8 +1324,8 @@ sal_Bool Bitmap::ImplDitherMatrix()
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -1339,36 +1338,36 @@ sal_Bool Bitmap::ImplDitherMatrix()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplDitherFloyd()
+BOOL Bitmap::ImplDitherFloyd()
{
- const Size aSize( GetSizePixel() );
- sal_Bool bRet = sal_False;
+ const Size aSize( GetSizePixel() );
+ BOOL bRet = FALSE;
if( ( aSize.Width() > 3 ) && ( aSize.Height() > 2 ) )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- Bitmap aNewBmp( GetSizePixel(), 8 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ Bitmap aNewBmp( GetSizePixel(), 8 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pReadAcc && pWriteAcc )
{
- BitmapColor aColor;
- long nWidth = pReadAcc->Width();
- long nWidth1 = nWidth - 1L;
- long nHeight = pReadAcc->Height();
- long nX;
- long nW = nWidth * 3L;
- long nW2 = nW - 3L;
- long nRErr, nGErr, nBErr;
- long nRC, nGC, nBC;
- long nTemp;
- long nZ;
- long* p1 = new long[ nW ];
- long* p2 = new long[ nW ];
- long* p1T = p1;
- long* p2T = p2;
- long* pTmp;
- sal_Bool bPal = pReadAcc->HasPalette();
+ BitmapColor aColor;
+ long nWidth = pReadAcc->Width();
+ long nWidth1 = nWidth - 1L;
+ long nHeight = pReadAcc->Height();
+ long nX;
+ long nW = nWidth * 3L;
+ long nW2 = nW - 3L;
+ long nRErr, nGErr, nBErr;
+ long nRC, nGC, nBC;
+ long nTemp;
+ long nZ;
+ long* p1 = new long[ nW ];
+ long* p2 = new long[ nW ];
+ long* p1T = p1;
+ long* p2T = p2;
+ long* pTmp;
+ BOOL bPal = pReadAcc->HasPalette();
pTmp = p2T;
@@ -1433,7 +1432,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
CALC_TABLES7;
nX -= 5;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
// mittlere Pixel ueber Schleife
long nXAcc;
@@ -1444,7 +1443,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
nX -= 8;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
// letztes Pixel gesondert betrachten
@@ -1452,12 +1451,12 @@ sal_Bool Bitmap::ImplDitherFloyd()
nX -= 5;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
delete[] p1;
delete[] p2;
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1465,8 +1464,8 @@ sal_Bool Bitmap::ImplDitherFloyd()
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aPrefSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aPrefSize( maPrefSize );
*this = aNewBmp;
@@ -1480,28 +1479,28 @@ sal_Bool Bitmap::ImplDitherFloyd()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplDitherFloyd16()
+BOOL Bitmap::ImplDitherFloyd16()
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- Bitmap aNewBmp( GetSizePixel(), 24 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ Bitmap aNewBmp( GetSizePixel(), 24 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ BOOL bRet = FALSE;
if( pReadAcc && pWriteAcc )
{
- const long nWidth = pWriteAcc->Width();
- const long nWidth1 = nWidth - 1L;
- const long nHeight = pWriteAcc->Height();
- BitmapColor aColor;
- BitmapColor aBestCol;
- ImpErrorQuad aErrQuad;
- ImpErrorQuad* pErrQuad1 = new ImpErrorQuad[ nWidth ];
- ImpErrorQuad* pErrQuad2 = new ImpErrorQuad[ nWidth ];
- ImpErrorQuad* pQLine1 = pErrQuad1;
- ImpErrorQuad* pQLine2 = 0;
- long nX, nY;
- long nYTmp = 0L;
- sal_Bool bQ1 = sal_True;
+ const long nWidth = pWriteAcc->Width();
+ const long nWidth1 = nWidth - 1L;
+ const long nHeight = pWriteAcc->Height();
+ BitmapColor aColor;
+ BitmapColor aBestCol;
+ ImpErrorQuad aErrQuad;
+ ImpErrorQuad* pErrQuad1 = new ImpErrorQuad[ nWidth ];
+ ImpErrorQuad* pErrQuad2 = new ImpErrorQuad[ nWidth ];
+ ImpErrorQuad* pQLine1 = pErrQuad1;
+ ImpErrorQuad* pQLine2 = 0;
+ long nX, nY;
+ long nYTmp = 0L;
+ BOOL bQ1 = TRUE;
for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ )
for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ )
@@ -1539,7 +1538,7 @@ sal_Bool Bitmap::ImplDitherFloyd16()
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
for( nX = 0L; nX < nWidth; nX++ )
@@ -1549,7 +1548,7 @@ sal_Bool Bitmap::ImplDitherFloyd16()
// Zeilenpuffer zerstoeren
delete[] pErrQuad1;
delete[] pErrQuad2;
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -1557,8 +1556,8 @@ sal_Bool Bitmap::ImplDitherFloyd16()
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -1571,12 +1570,12 @@ sal_Bool Bitmap::ImplDitherFloyd16()
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ReduceColors( sal_uInt16 nColorCount, BmpReduce eReduce )
+BOOL Bitmap::ReduceColors( USHORT nColorCount, BmpReduce eReduce )
{
- sal_Bool bRet;
+ BOOL bRet;
- if( GetColorCount() <= (sal_uLong) nColorCount )
- bRet = sal_True;
+ if( GetColorCount() <= (ULONG) nColorCount )
+ bRet = TRUE;
else if( nColorCount )
{
if( BMP_REDUCE_SIMPLE == eReduce )
@@ -1587,20 +1586,20 @@ sal_Bool Bitmap::ReduceColors( sal_uInt16 nColorCount, BmpReduce eReduce )
bRet = ImplReduceMedian( nColorCount );
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
+BOOL Bitmap::ImplReduceSimple( USHORT nColorCount )
{
- Bitmap aNewBmp;
- BitmapReadAccess* pRAcc = AcquireReadAccess();
- const sal_uInt16 nColCount = Min( nColorCount, (sal_uInt16) 256 );
- sal_uInt16 nBitCount;
- sal_Bool bRet = sal_False;
+ Bitmap aNewBmp;
+ BitmapReadAccess* pRAcc = AcquireReadAccess();
+ const USHORT nColCount = Min( nColorCount, (USHORT) 256 );
+ USHORT nBitCount;
+ BOOL bRet = FALSE;
if( nColCount <= 2 )
nBitCount = 1;
@@ -1611,9 +1610,9 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
if( pRAcc )
{
- Octree aOct( *pRAcc, nColCount );
- const BitmapPalette& rPal = aOct.GetPalette();
- BitmapWriteAccess* pWAcc;
+ Octree aOct( *pRAcc, nColCount );
+ const BitmapPalette& rPal = aOct.GetPalette();
+ BitmapWriteAccess* pWAcc;
aNewBmp = Bitmap( GetSizePixel(), nBitCount, &rPal );
pWAcc = aNewBmp.AcquireWriteAccess();
@@ -1627,17 +1626,17 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX =0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
+ pWAcc->SetPixel( nY, nX, (BYTE) 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, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (BYTE) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
}
aNewBmp.ReleaseAccess( pWAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pRAcc );
@@ -1645,8 +1644,8 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
maPrefMapMode = aMap;
@@ -1660,8 +1659,8 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
struct PopularColorCount
{
- sal_uInt32 mnIndex;
- sal_uInt32 mnCount;
+ sal_uInt32 mnIndex;
+ sal_uInt32 mnCount;
};
// ------------------------------------------------------------------------
@@ -1672,21 +1671,21 @@ extern "C" int __LOADONCALLAPI ImplPopularCmpFnc( const void* p1, const void* p2
if( ( (PopularColorCount*) p1 )->mnCount < ( (PopularColorCount*) p2 )->mnCount )
nRet = 1;
- else if( ( (PopularColorCount*) p1 )->mnCount == ( (PopularColorCount*) p2 )->mnCount )
+ else if( ( (PopularColorCount*) p1 )->mnCount == ( (PopularColorCount*) p2 )->mnCount )
nRet = 0;
else
nRet = -1;
-
+
return nRet;
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
+BOOL Bitmap::ImplReducePopular( USHORT nColCount )
{
- BitmapReadAccess* pRAcc = AcquireReadAccess();
- sal_uInt16 nBitCount;
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pRAcc = AcquireReadAccess();
+ USHORT nBitCount;
+ BOOL bRet = FALSE;
if( nColCount > 256 )
nColCount = 256;
@@ -1698,17 +1697,17 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
if( pRAcc )
{
- const sal_uInt32 nValidBits = 4;
- const sal_uInt32 nRightShiftBits = 8 - nValidBits;
- const sal_uInt32 nLeftShiftBits1 = nValidBits;
- const sal_uInt32 nLeftShiftBits2 = nValidBits << 1;
- const sal_uInt32 nColorsPerComponent = 1 << nValidBits;
- const sal_uInt32 nColorOffset = 256 / nColorsPerComponent;
- const sal_uInt32 nTotalColors = nColorsPerComponent * nColorsPerComponent * nColorsPerComponent;
- const long nWidth = pRAcc->Width();
- const long nHeight = pRAcc->Height();
- PopularColorCount* pCountTable = new PopularColorCount[ nTotalColors ];
- long nX, nY, nR, nG, nB, nIndex;
+ const sal_uInt32 nValidBits = 4;
+ const sal_uInt32 nRightShiftBits = 8 - nValidBits;
+ const sal_uInt32 nLeftShiftBits1 = nValidBits;
+ const sal_uInt32 nLeftShiftBits2 = nValidBits << 1;
+ const sal_uInt32 nColorsPerComponent = 1 << nValidBits;
+ const sal_uInt32 nColorOffset = 256 / nColorsPerComponent;
+ const sal_uInt32 nTotalColors = nColorsPerComponent * nColorsPerComponent * nColorsPerComponent;
+ const long nWidth = pRAcc->Width();
+ const long nHeight = pRAcc->Height();
+ PopularColorCount* pCountTable = new PopularColorCount[ nTotalColors ];
+ long nX, nY, nR, nG, nB, nIndex;
rtl_zeroMemory( pCountTable, nTotalColors * sizeof( PopularColorCount ) );
@@ -1732,7 +1731,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) );
pCountTable[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
- ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
+ ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ].mnCount++;
}
}
@@ -1745,8 +1744,8 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
const BitmapColor aCol( pRAcc->GetPixel( nY, nX ) );
pCountTable[ ( ( ( (sal_uInt32) aCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
- ( ( ( (sal_uInt32) aCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
- ( ( (sal_uInt32) aCol.GetBlue() ) >> nRightShiftBits ) ].mnCount++;
+ ( ( ( (sal_uInt32) aCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
+ ( ( (sal_uInt32) aCol.GetBlue() ) >> nRightShiftBits ) ].mnCount++;
}
}
}
@@ -1754,27 +1753,27 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
BitmapPalette aNewPal( nColCount );
qsort( pCountTable, nTotalColors, sizeof( PopularColorCount ), ImplPopularCmpFnc );
-
- for( sal_uInt16 n = 0; n < nColCount; n++ )
+
+ for( USHORT n = 0; n < nColCount; n++ )
{
const PopularColorCount& rPop = pCountTable[ n ];
- aNewPal[ n ] = BitmapColor( (sal_uInt8) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
- (sal_uInt8) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
- (sal_uInt8) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
+ aNewPal[ n ] = BitmapColor( (BYTE) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
+ (BYTE) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
+ (BYTE) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
}
- Bitmap aNewBmp( GetSizePixel(), nBitCount, &aNewPal );
- BitmapWriteAccess* pWAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), nBitCount, &aNewPal );
+ BitmapWriteAccess* pWAcc = aNewBmp.AcquireWriteAccess();
if( pWAcc )
{
- BitmapColor aDstCol( (sal_uInt8) 0 );
- sal_uInt8* pIndexMap = new sal_uInt8[ nTotalColors ];
+ BitmapColor aDstCol( (BYTE) 0 );
+ BYTE* pIndexMap = new BYTE[ 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++ ] = (sal_uInt8) aNewPal.GetBestIndex( BitmapColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB ) );
+ pIndexMap[ nIndex++ ] = (BYTE) aNewPal.GetBestIndex( BitmapColor( (BYTE) nR, (BYTE) nG, (BYTE) nB ) );
if( pRAcc->HasPalette() )
{
@@ -1784,7 +1783,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) );
aDstCol.SetIndex( pIndexMap[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
- ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
+ ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ] );
pWAcc->SetPixel( nY, nX, aDstCol );
}
@@ -1798,7 +1797,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
const BitmapColor aCol( pRAcc->GetPixel( nY, nX ) );
aDstCol.SetIndex( pIndexMap[ ( ( ( (sal_uInt32) aCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
- ( ( ( (sal_uInt32) aCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
+ ( ( ( (sal_uInt32) aCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) |
( ( (sal_uInt32) aCol.GetBlue() ) >> nRightShiftBits ) ] );
pWAcc->SetPixel( nY, nX, aDstCol );
}
@@ -1807,7 +1806,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
delete[] pIndexMap;
aNewBmp.ReleaseAccess( pWAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
delete[] pCountTable;
@@ -1815,8 +1814,8 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
maPrefMapMode = aMap;
@@ -1829,11 +1828,11 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
+BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
{
- BitmapReadAccess* pRAcc = AcquireReadAccess();
- sal_uInt16 nBitCount;
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pRAcc = AcquireReadAccess();
+ USHORT nBitCount;
+ BOOL bRet = FALSE;
if( nColCount < 17 )
nBitCount = 4;
@@ -1841,23 +1840,23 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
nBitCount = 8;
else
{
- OSL_FAIL( "Bitmap::ImplReduceMedian(): invalid color count!" );
+ DBG_ERROR( "Bitmap::ImplReduceMedian(): invalid color count!" );
nBitCount = 8;
nColCount = 256;
}
if( pRAcc )
{
- Bitmap aNewBmp( GetSizePixel(), nBitCount );
- BitmapWriteAccess* pWAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), nBitCount );
+ BitmapWriteAccess* pWAcc = aNewBmp.AcquireWriteAccess();
if( pWAcc )
{
- 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;
+ const ULONG nSize = 32768UL * sizeof( ULONG );
+ ULONG* pColBuf = (ULONG*) rtl_allocateMemory( nSize );
+ const long nWidth = pWAcc->Width();
+ const long nHeight = pWAcc->Height();
+ long nIndex = 0L;
memset( (HPBYTE) pColBuf, 0, nSize );
@@ -1887,7 +1886,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
// create palette via median cut
BitmapPalette aPal( pWAcc->GetPaletteEntryCount() );
- ImplMedianCut( pColBuf, aPal, 0, 31, 0, 31, 0, 31,
+ ImplMedianCut( pColBuf, aPal, 0, 31, 0, 31, 0, 31,
nColCount, nWidth * nHeight, nIndex );
// do mapping of colors to palette
@@ -1895,19 +1894,19 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
pWAcc->SetPalette( aPal );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (sal_uInt8) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (BYTE) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
rtl_freeMemory( pColBuf );
aNewBmp.ReleaseAccess( pWAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pRAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
maPrefMapMode = aMap;
@@ -1920,28 +1919,28 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
// ------------------------------------------------------------------------
-void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
+void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex )
{
if( !nPixels )
return;
- BitmapColor aCol;
- const long nRLen = nR2 - nR1;
- const long nGLen = nG2 - nG1;
- const long nBLen = nB2 - nB1;
- long nR, nG, nB;
- sal_uLong* pBuf = pColBuf;
+ BitmapColor aCol;
+ const long nRLen = nR2 - nR1;
+ const long nGLen = nG2 - nG1;
+ const long nBLen = nB2 - nB1;
+ long nR, nG, nB;
+ ULONG* pBuf = pColBuf;
if( !nRLen && !nGLen && !nBLen )
{
if( pBuf[ RGB15( nR1, nG1, nB1 ) ] )
{
- aCol.SetRed( (sal_uInt8) ( nR1 << 3 ) );
- aCol.SetGreen( (sal_uInt8) ( nG1 << 3 ) );
- aCol.SetBlue( (sal_uInt8) ( nB1 << 3 ) );
- rPal[ (sal_uInt16) rIndex++ ] = aCol;
+ aCol.SetRed( (BYTE) ( nR1 << 3 ) );
+ aCol.SetGreen( (BYTE) ( nG1 << 3 ) );
+ aCol.SetBlue( (BYTE) ( nB1 << 3 ) );
+ rPal[ (USHORT) rIndex++ ] = aCol;
}
}
else
@@ -1968,16 +1967,16 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
}
}
- 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;
+ aCol.SetRed( (BYTE) ( ( nRSum / nPixels ) << 3 ) );
+ aCol.SetGreen( (BYTE) ( ( nGSum / nPixels ) << 3 ) );
+ aCol.SetBlue( (BYTE) ( ( nBSum / nPixels ) << 3 ) );
+ rPal[ (USHORT) rIndex++ ] = aCol;
}
else
{
- const long nTest = ( nPixels >> 1 );
- long nPixOld = 0;
- long nPixNew = 0;
+ const long nTest = ( nPixels >> 1 );
+ long nPixOld = 0;
+ long nPixNew = 0;
if( nBLen > nGLen && nBLen > nRLen )
{
@@ -2054,32 +2053,32 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Vectorize( PolyPolygon& rPolyPoly, sal_uLong nFlags, const Link* pProgress )
+BOOL Bitmap::Vectorize( PolyPolygon& rPolyPoly, ULONG nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rPolyPoly, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
+BOOL Bitmap::Vectorize( GDIMetaFile& rMtf, BYTE cReduce, ULONG nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
+BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, sal_Bool bInvert )
+ double fGamma, BOOL bInvert )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
// nothing to do => return quickly
- if( !nLuminancePercent && !nContrastPercent &&
+ if( !nLuminancePercent && !nContrastPercent &&
!nChannelRPercent && !nChannelGPercent && !nChannelBPercent &&
( fGamma == 1.0 ) && !bInvert )
{
- bRet = sal_True;
+ bRet = TRUE;
}
else
{
@@ -2087,15 +2086,15 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
if( pAcc )
{
- BitmapColor aCol;
- const long nW = pAcc->Width();
- const long nH = pAcc->Height();
- 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;
-
+ 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 ];
+ long nX, nY;
+ double fM, fROff, fGOff, fBOff, fOff;
+
// calculate slope
if( nContrastPercent >= 0 )
fM = 128.0 / ( 128.0 - 1.27 * MinMax( nContrastPercent, 0L, 100L ) );
@@ -2112,14 +2111,14 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const sal_Bool bGamma = ( fGamma != 1.0 );
+ const BOOL bGamma = ( fGamma != 1.0 );
// create mapping table
for( nX = 0L; nX < 256L; nX++ )
{
- 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 );
+ 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 );
if( bGamma )
{
@@ -2141,9 +2140,9 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
{
BitmapColor aNewCol;
- for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
- const BitmapColor& rCol = pAcc->GetPaletteColor( i );
+ const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aNewCol.SetRed( cMapR[ rCol.GetRed() ] );
aNewCol.SetGreen( cMapG[ rCol.GetGreen() ] );
aNewCol.SetBlue( cMapB[ rCol.GetBlue() ] );
@@ -2197,7 +2196,7 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
delete[] cMapG;
delete[] cMapB;
ReleaseAccess( pAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 1166f6cc0931..ab8bf914bf46 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,21 +37,21 @@
// - Defines -
// -----------
-#define S2(a,b) { register long t; if( ( t = b - a ) < 0 ) { a += t; b -= t; } }
-#define MN3(a,b,c) S2(a,b); S2(a,c);
-#define MX3(a,b,c) S2(b,c); S2(a,c);
-#define MNMX3(a,b,c) MX3(a,b,c); S2(a,b);
-#define MNMX4(a,b,c,d) S2(a,b); S2(c,d); S2(a,c); S2(b,d);
-#define MNMX5(a,b,c,d,e) S2(a,b); S2(c,d); MN3(a,c,e); MX3(b,d,e);
-#define MNMX6(a,b,c,d,e,f) S2(a,d); S2(b,e); S2(c,f); MN3(a,b,c); MX3(d,e,f);
+#define S2(a,b) { register long t; if( ( t = b - a ) < 0 ) { a += t; b -= t; } }
+#define MN3(a,b,c) S2(a,b); S2(a,c);
+#define MX3(a,b,c) S2(b,c); S2(a,c);
+#define MNMX3(a,b,c) MX3(a,b,c); S2(a,b);
+#define MNMX4(a,b,c,d) S2(a,b); S2(c,d); S2(a,c); S2(b,d);
+#define MNMX5(a,b,c,d,e) S2(a,b); S2(c,d); MN3(a,c,e); MX3(b,d,e);
+#define MNMX6(a,b,c,d,e,f) S2(a,d); S2(b,e); S2(c,f); MN3(a,b,c); MX3(d,e,f);
// ----------
// - Bitmap -
// ----------
-sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+BOOL Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
switch( eFilter )
{
@@ -98,7 +98,7 @@ sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam,
break;
default:
- OSL_FAIL( "Bitmap::Convert(): Unsupported filter" );
+ DBG_ERROR( "Bitmap::Convert(): Unsupported filter" );
break;
}
@@ -107,33 +107,33 @@ sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam,
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
+BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 24 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 24 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
- const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
- long* pColm = new long[ nWidth2 ];
- long* pRows = new long[ nHeight2 ];
- 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;
- BitmapColor* pColor;
- long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp;
- long (*pKoeff)[ 256 ] = new long[ 9 ][ 256 ];
- long* pTmp;
+ const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
+ 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* pRowTmp1 = pColRow1;
+ BitmapColor* pRowTmp2 = pColRow2;
+ BitmapColor* pRowTmp3 = pColRow3;
+ BitmapColor* pColor;
+ long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp;
+ long (*pKoeff)[ 256 ] = new long[ 9 ][ 256 ];
+ long* pTmp;
// create LUT of products of matrix value and possible color component values
for( nY = 0; nY < 9; nY++ )
@@ -143,13 +143,13 @@ sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
// create column LUT
for( i = 0; i < nWidth2; i++ )
pColm[ i ] = ( i > 0 ) ? ( i - 1 ) : 0;
-
+
pColm[ nWidth + 1 ] = pColm[ nWidth ];
// create row LUT
for( i = 0; i < nHeight2; i++ )
pRows[ i ] = ( i > 0 ) ? ( i - 1 ) : 0;
-
+
pRows[ nHeight + 1 ] = pRows[ nHeight ];
// read first three rows of bitmap color
@@ -205,9 +205,9 @@ sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
nSumB += pTmp[ pColor->GetBlue() ];
// calculate destination color
- 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 ) ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) MinMax( nSumR / nDivisor, 0, 255 ),
+ (BYTE) MinMax( nSumG / nDivisor, 0, 255 ),
+ (BYTE) MinMax( nSumB / nDivisor, 0, 255 ) ) );
}
if( ++nY < nHeight )
@@ -225,23 +225,23 @@ sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
}
delete[] pKoeff;
- delete[] (sal_uInt8*) pColRow1;
- delete[] (sal_uInt8*) pColRow2;
- delete[] (sal_uInt8*) pColRow3;
+ delete[] (BYTE*) pColRow1;
+ delete[] (BYTE*) pColRow2;
+ delete[] (BYTE*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -255,44 +255,44 @@ sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 24 );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 24 );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
- const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
- long* pColm = new long[ nWidth2 ];
- long* pRows = new long[ nHeight2 ];
- 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;
- BitmapColor* pColor;
- long nY, nX, i;
- long nR1, nR2, nR3, nR4, nR5, nR6, nR7, nR8, nR9;
- long nG1, nG2, nG3, nG4, nG5, nG6, nG7, nG8, nG9;
- long nB1, nB2, nB3, nB4, nB5, nB6, nB7, nB8, nB9;
+ const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
+ 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* pRowTmp1 = pColRow1;
+ BitmapColor* pRowTmp2 = pColRow2;
+ BitmapColor* pRowTmp3 = pColRow3;
+ BitmapColor* pColor;
+ long nY, nX, i;
+ long nR1, nR2, nR3, nR4, nR5, nR6, nR7, nR8, nR9;
+ long nG1, nG2, nG3, nG4, nG5, nG6, nG7, nG8, nG9;
+ long nB1, nB2, nB3, nB4, nB5, nB6, nB7, nB8, nB9;
// create column LUT
for( i = 0; i < nWidth2; i++ )
pColm[ i ] = ( i > 0 ) ? ( i - 1 ) : 0;
-
+
pColm[ nWidth + 1 ] = pColm[ nWidth ];
// create row LUT
for( i = 0; i < nHeight2; i++ )
pRows[ i ] = ( i > 0 ) ? ( i - 1 ) : 0;
-
+
pRows[ nHeight + 1 ] = pRows[ nHeight ];
// read first three rows of bitmap color
@@ -314,7 +314,7 @@ sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const
nR1 = ( pColor = pRowTmp1 + nX )->GetRed(), nG1 = pColor->GetGreen(), nB1 = pColor->GetBlue();
nR2 = ( ++pColor )->GetRed(), nG2 = pColor->GetGreen(), nB2 = pColor->GetBlue();
nR3 = ( ++pColor )->GetRed(), nG3 = pColor->GetGreen(), nB3 = pColor->GetBlue();
-
+
nR4 = ( pColor = pRowTmp2 + nX )->GetRed(), nG4 = pColor->GetGreen(), nB4 = pColor->GetBlue();
nR5 = ( ++pColor )->GetRed(), nG5 = pColor->GetGreen(), nB5 = pColor->GetBlue();
nR6 = ( ++pColor )->GetRed(), nG6 = pColor->GetGreen(), nB6 = pColor->GetBlue();
@@ -322,7 +322,7 @@ sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const
nR7 = ( pColor = pRowTmp3 + nX )->GetRed(), nG7 = pColor->GetGreen(), nB7 = pColor->GetBlue();
nR8 = ( ++pColor )->GetRed(), nG8 = pColor->GetGreen(), nB8 = pColor->GetBlue();
nR9 = ( ++pColor )->GetRed(), nG9 = pColor->GetGreen(), nB9 = pColor->GetBlue();
-
+
MNMX6( nR1, nR2, nR3, nR4, nR5, nR6 );
MNMX5( nR7, nR2, nR3, nR4, nR5 );
MNMX4( nR8, nR2, nR3, nR4 );
@@ -337,9 +337,9 @@ sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const
MNMX5( nB7, nB2, nB3, nB4, nB5 );
MNMX4( nB8, nB2, nB3, nB4 );
MNMX3( nB9, nB2, nB3 );
-
+
// set destination color
- pWriteAcc->SetPixel( nY, nX, BitmapColor( (sal_uInt8) nR2, (sal_uInt8) nG2, (sal_uInt8) nB2 ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) nR2, (BYTE) nG2, (BYTE) nB2 ) );
}
if( ++nY < nHeight )
@@ -356,23 +356,23 @@ sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const
}
}
- delete[] (sal_uInt8*) pColRow1;
- delete[] (sal_uInt8*) pColRow2;
- delete[] (sal_uInt8*) pColRow3;
+ delete[] (BYTE*) pColRow1;
+ delete[] (BYTE*) pColRow2;
+ delete[] (BYTE*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -386,38 +386,38 @@ sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- sal_Bool bRet = ImplMakeGreyscales( 256 );
+ BOOL bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = sal_False;
+ bRet = FALSE;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
-
+
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 8, &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 8, &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- BitmapColor aGrey( (sal_uInt8) 0 );
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- const long nMask111 = -1, nMask121 = 0, nMask131 = 1;
- const long nMask211 = -2, nMask221 = 0, nMask231 = 2;
- const long nMask311 = -1, nMask321 = 0, nMask331 = 1;
- const long nMask112 = 1, nMask122 = 2, nMask132 = 1;
- const long nMask212 = 0, nMask222 = 0, nMask232 = 0;
- const long nMask312 = -1, nMask322 = -2, nMask332 = -1;
- long nGrey11, nGrey12, nGrey13;
- long nGrey21, nGrey22, nGrey23;
- long nGrey31, nGrey32, nGrey33;
- long* pHMap = new long[ nWidth + 2 ];
- long* pVMap = new long[ nHeight + 2 ];
- long nX, nY, nSum1, nSum2;
+ BitmapColor aGrey( (BYTE) 0 );
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
+ const long nMask111 = -1, nMask121 = 0, nMask131 = 1;
+ const long nMask211 = -2, nMask221 = 0, nMask231 = 2;
+ const long nMask311 = -1, nMask321 = 0, nMask331 = 1;
+ const long nMask112 = 1, nMask122 = 2, nMask132 = 1;
+ const long nMask212 = 0, nMask222 = 0, nMask232 = 0;
+ const long nMask312 = -1, nMask322 = -2, nMask332 = -1;
+ long nGrey11, nGrey12, nGrey13;
+ long nGrey21, nGrey22, nGrey23;
+ long nGrey31, nGrey32, nGrey33;
+ long* pHMap = new long[ nWidth + 2 ];
+ long* pVMap = new long[ nHeight + 2 ];
+ long nX, nY, nSum1, nSum2;
// fill mapping tables
pHMap[ 0 ] = 0;
@@ -474,7 +474,7 @@ sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Li
nSum2 += nMask332 * nGrey33;
nSum1 = (long) sqrt( (double)( nSum1 * nSum1 + nSum2 * nSum2 ) );
- aGrey.SetIndex( ~(sal_uInt8) SAL_BOUND( nSum1, 0, 255 ) );
+ aGrey.SetIndex( ~(BYTE) SAL_BOUND( nSum1, 0, 255 ) );
pWriteAcc->SetPixel( nY, nX, aGrey );
if( nX < ( nWidth - 1 ) )
@@ -491,15 +491,15 @@ sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Li
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -514,42 +514,42 @@ sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Li
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- sal_Bool bRet = ImplMakeGreyscales( 256 );
+ BOOL bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = sal_False;
+ bRet = FALSE;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
-
+
if( pReadAcc )
{
- Bitmap aNewBmp( GetSizePixel(), 8, &pReadAcc->GetPalette() );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 8, &pReadAcc->GetPalette() );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- BitmapColor aGrey( (sal_uInt8) 0 );
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- long nGrey11, nGrey12, nGrey13;
- long nGrey21, nGrey22, nGrey23;
- long nGrey31, nGrey32, nGrey33;
- double fAzim = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
+ BitmapColor aGrey( (BYTE) 0 );
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
+ long nGrey11, nGrey12, nGrey13;
+ long nGrey21, nGrey22, nGrey23;
+ long nGrey31, nGrey32, nGrey33;
+ double fAzim = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
( pFilterParam->maEmbossAngles.mnAzimuthAngle100 * 0.01 ) : 0.0 ) * F_PI180;
- double fElev = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
+ double fElev = ( ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_EMBOSS_GREY ) ?
( pFilterParam->maEmbossAngles.mnElevationAngle100 * 0.01 ) : 90.0 ) * F_PI180;
- long* pHMap = new long[ nWidth + 2 ];
- long* pVMap = new long[ nHeight + 2 ];
- long nX, nY, nNx, nNy, nDotL;
- const long nLx = FRound( cos( fAzim ) * cos( fElev ) * 255.0 );
- const long nLy = FRound( sin( fAzim ) * cos( fElev ) * 255.0 );
- 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 sal_uInt8 cLz = (sal_uInt8) SAL_BOUND( nLz, 0, 255 );
+ long* pHMap = new long[ nWidth + 2 ];
+ long* pVMap = new long[ nHeight + 2 ];
+ long nX, nY, nNx, nNy, nDotL;
+ const long nLx = FRound( cos( fAzim ) * cos( fElev ) * 255.0 );
+ const long nLy = FRound( sin( fAzim ) * cos( fElev ) * 255.0 );
+ 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 );
// fill mapping tables
pHMap[ 0 ] = 0;
@@ -586,9 +586,9 @@ sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link*
else
{
const double fGrey = nDotL / sqrt( (double)(nNx * nNx + nNy * nNy + nZ2) );
- aGrey.SetIndex( (sal_uInt8) SAL_BOUND( fGrey, 0, 255 ) );
+ aGrey.SetIndex( (BYTE) SAL_BOUND( fGrey, 0, 255 ) );
}
-
+
pWriteAcc->SetPixel( nY, nX, aGrey );
if( nX < ( nWidth - 1 ) )
@@ -605,15 +605,15 @@ sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link*
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -628,21 +628,21 @@ sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link*
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- sal_Bool bRet = sal_False;
- BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
-
+ BOOL bRet = FALSE;
+ BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
+
if( pWriteAcc )
{
- const sal_uInt8 cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
+ const BYTE cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
pFilterParam->mcSolarGreyThreshold : 128;
if( pWriteAcc->HasPalette() )
{
const BitmapPalette& rPal = pWriteAcc->GetPalette();
- for( sal_uInt16 i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
{
if( rPal[ i ].GetLuminance() >= cThreshold )
{
@@ -653,16 +653,16 @@ sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /
}
else
{
- BitmapColor aCol;
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ BitmapColor aCol;
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
for( long nY = 0; nY < nHeight ; nY++ )
{
for( long nX = 0; nX < nWidth; nX++ )
{
aCol = pWriteAcc->GetPixel( nY, nX );
-
+
if( aCol.GetLuminance() >= cThreshold )
pWriteAcc->SetPixel( nY, nX, aCol.Invert() );
}
@@ -670,7 +670,7 @@ sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /
}
ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -678,47 +678,47 @@ sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- BitmapReadAccess* pReadAcc = AcquireReadAccess();
- sal_Bool bRet = sal_False;
-
+ BitmapReadAccess* pReadAcc = AcquireReadAccess();
+ BOOL bRet = FALSE;
+
if( pReadAcc )
{
- long nSepiaPercent = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SEPIA ) ?
+ long nSepiaPercent = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SEPIA ) ?
pFilterParam->mcSolarGreyThreshold : 10;
- const long nSepia = 10000 - 100 * SAL_BOUND( nSepiaPercent, 0, 100 );
- BitmapPalette aSepiaPal( 256 );
+ const long nSepia = 10000 - 100 * SAL_BOUND( nSepiaPercent, 0, 100 );
+ BitmapPalette aSepiaPal( 256 );
DBG_ASSERT( nSepiaPercent <= 100, "Bitmap::ImplSepia(): sepia value out of range; defaulting to 100%" );
- for( sal_uInt16 i = 0; i < 256; i++ )
+ for( USHORT i = 0; i < 256; i++ )
{
- BitmapColor& rCol = aSepiaPal[ i ];
- const sal_uInt8 cSepiaValue = (sal_uInt8) ( ( nSepia * i ) / 10000 );
+ BitmapColor& rCol = aSepiaPal[ i ];
+ const BYTE cSepiaValue = (BYTE) ( ( nSepia * i ) / 10000 );
- rCol.SetRed( (sal_uInt8) i );
+ rCol.SetRed( (BYTE) i );
rCol.SetGreen( cSepiaValue );
rCol.SetBlue( cSepiaValue );
}
- Bitmap aNewBmp( GetSizePixel(), 8, &aSepiaPal );
- BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
+ Bitmap aNewBmp( GetSizePixel(), 8, &aSepiaPal );
+ BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
if( pWriteAcc )
{
- BitmapColor aCol( (sal_uInt8) 0 );
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ BitmapColor aCol( (BYTE) 0 );
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
if( pReadAcc->HasPalette() )
{
for( long nY = 0; nY < nHeight ; nY++ )
{
- const sal_uInt16 nPalCount = pReadAcc->GetPaletteEntryCount();
- sal_uInt8* pIndexMap = new sal_uInt8[ nPalCount ];
+ const USHORT nPalCount = pReadAcc->GetPaletteEntryCount();
+ BYTE* pIndexMap = new BYTE[ nPalCount ];
- for( sal_uInt16 i = 0; i < nPalCount; i++ )
+ for( USHORT i = 0; i < nPalCount; i++ )
pIndexMap[ i ] = pReadAcc->GetPaletteColor( i ).GetLuminance();
for( long nX = 0; nX < nWidth; nX++ )
@@ -743,15 +743,15 @@ sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pP
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = aNewBmp;
@@ -765,13 +765,13 @@ sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pP
// -----------------------------------------------------------------------------
-sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- sal_uLong nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ ULONG nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileWidth : 4;
- sal_uLong nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ ULONG nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileHeight : 4;
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !nTileWidth )
nTileWidth = 1;
@@ -781,9 +781,9 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
if( nTileWidth > 1 || nTileHeight > 1 )
{
- Bitmap* pNewBmp;
- BitmapReadAccess* pReadAcc;
- BitmapWriteAccess* pWriteAcc;
+ Bitmap* pNewBmp;
+ BitmapReadAccess* pReadAcc;
+ BitmapWriteAccess* pWriteAcc;
if( GetBitCount() > 8 )
{
@@ -796,14 +796,14 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
pReadAcc = AcquireReadAccess();
pWriteAcc = pNewBmp->AcquireWriteAccess();
}
-
+
if( pReadAcc && pWriteAcc )
{
- BitmapColor aCol;
- long nWidth = pReadAcc->Width();
- long nHeight = pReadAcc->Height();
- long nX, nY, nX1, nX2, nY1, nY2, nSumR, nSumG, nSumB;
- double fArea_1;
+ BitmapColor aCol;
+ long nWidth = pReadAcc->Width();
+ long nHeight = pReadAcc->Height();
+ long nX, nY, nX1, nX2, nY1, nY2, nSumR, nSumG, nSumB;
+ double fArea_1;
nY1 = 0; nY2 = nTileHeight - 1;
@@ -816,7 +816,7 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
if( nX2 >= nWidth )
nX2 = nWidth - 1;
-
+
fArea_1 = 1.0 / ( ( nX2 - nX1 + 1 ) * ( nY2 - nY1 + 1 ) );
if( !pNewBmp )
@@ -834,9 +834,9 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
}
}
- aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -860,16 +860,16 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
{
for( nX = nX1; nX <= nX2; nX++ )
{
- const BitmapColor& rCol = pReadAcc->GetPaletteColor( (sal_uInt8) pReadAcc->GetPixel( nY, nX ) );
+ const BitmapColor& rCol = pReadAcc->GetPaletteColor( (BYTE) pReadAcc->GetPixel( nY, nX ) );
nSumR += rCol.GetRed();
nSumG += rCol.GetGreen();
nSumB += rCol.GetBlue();
}
}
- aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -893,7 +893,7 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
}
while( nY1 < nHeight );
- bRet = sal_True;
+ bRet = TRUE;
}
ReleaseAccess( pReadAcc );
@@ -904,8 +904,8 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
if( bRet )
{
- const MapMode aMap( maPrefMapMode );
- const Size aSize( maPrefSize );
+ const MapMode aMap( maPrefMapMode );
+ const Size aSize( maPrefSize );
*this = *pNewBmp;
@@ -917,8 +917,8 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
}
}
else
- bRet = sal_True;
-
+ bRet = TRUE;
+
return bRet;
}
@@ -926,8 +926,8 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p
struct PopArtEntry
{
- sal_uInt32 mnIndex;
- sal_uInt32 mnCount;
+ sal_uInt32 mnIndex;
+ sal_uInt32 mnCount;
};
// ------------------------------------------------------------------------
@@ -938,33 +938,33 @@ extern "C" int __LOADONCALLAPI ImplPopArtCmpFnc( const void* p1, const void* p2
if( ( (PopArtEntry*) p1 )->mnCount < ( (PopArtEntry*) p2 )->mnCount )
nRet = 1;
- else if( ( (PopArtEntry*) p1 )->mnCount == ( (PopArtEntry*) p2 )->mnCount )
+ else if( ( (PopArtEntry*) p1 )->mnCount == ( (PopArtEntry*) p2 )->mnCount )
nRet = 0;
else
nRet = -1;
-
+
return nRet;
}
// ------------------------------------------------------------------------
-sal_Bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- sal_Bool bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : sal_True;
+ BOOL bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : TRUE;
if( bRet )
{
- bRet = sal_False;
+ bRet = FALSE;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
if( pWriteAcc )
{
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- const sal_uLong nEntryCount = 1 << pWriteAcc->GetBitCount();
- sal_uLong n;
- PopArtEntry* pPopArtTable = new PopArtEntry[ nEntryCount ];
+ const long nWidth = pWriteAcc->Width();
+ const long nHeight = pWriteAcc->Height();
+ const ULONG nEntryCount = 1 << pWriteAcc->GetBitCount();
+ ULONG n;
+ PopArtEntry* pPopArtTable = new PopArtEntry[ nEntryCount ];
for( n = 0; n < nEntryCount; n++ )
{
@@ -980,28 +980,28 @@ sal_Bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link*
// sort table
qsort( pPopArtTable, nEntryCount, sizeof( PopArtEntry ), ImplPopArtCmpFnc );
-
+
// get last used entry
- sal_uLong nFirstEntry;
- sal_uLong nLastEntry = 0;
+ ULONG nFirstEntry;
+ 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<sal_uInt16>(pPopArtTable[ 0 ].mnIndex) ) );
+ const BitmapColor aFirstCol( pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ 0 ].mnIndex) ) );
for( nFirstEntry = 0; nFirstEntry < nLastEntry; nFirstEntry++ )
{
- 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[ nFirstEntry ].mnIndex),
+ pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nFirstEntry + 1 ].mnIndex) ) );
}
- pWriteAcc->SetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
+ pWriteAcc->SetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
// cleanup
delete[] pPopArtTable;
ReleaseAccess( pWriteAcc );
- bRet = sal_True;
+ bRet = TRUE;
}
}
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index d1f130d9d1cc..43589e3813f7 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,25 +50,25 @@
BitmapEx::BitmapEx() :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( sal_False )
+ bAlpha ( FALSE )
{
}
// ------------------------------------------------------------------
BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) :
- aBitmap ( rBitmapEx.aBitmap ),
- aMask ( rBitmapEx.aMask ),
- aBitmapSize ( rBitmapEx.aBitmapSize ),
- aTransparentColor ( rBitmapEx.aTransparentColor ),
- eTransparent ( rBitmapEx.eTransparent ),
- bAlpha ( rBitmapEx.bAlpha )
+ aBitmap ( rBitmapEx.aBitmap ),
+ aMask ( rBitmapEx.aMask ),
+ aBitmapSize ( rBitmapEx.aBitmapSize ),
+ aTransparentColor ( rBitmapEx.aTransparentColor ),
+ eTransparent ( rBitmapEx.eTransparent ),
+ bAlpha ( rBitmapEx.bAlpha )
{
}
BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( sal_False )
+ bAlpha ( FALSE )
{
if( rBitmapEx.IsEmpty() )
return;
@@ -77,12 +77,12 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
aBitmapSize = aSize;
if( rBitmapEx.IsAlpha() )
{
- bAlpha = sal_True;
+ bAlpha = TRUE;
aMask = AlphaMask( aSize ).ImplGetBitmap();
}
else if( rBitmapEx.IsTransparent() )
aMask = Bitmap( aSize, rBitmapEx.aMask.GetBitCount() );
-
+
Rectangle aDestRect( Point( 0, 0 ), aSize );
Rectangle aSrcRect( aSrc, aSize );
CopyPixel( aDestRect, aSrcRect, &rBitmapEx );
@@ -92,23 +92,23 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
BitmapEx::BitmapEx( const ResId& rResId ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( sal_False )
+ bAlpha ( FALSE )
{
- static ImplImageTreeSingletonRef aImageTree;
- ResMgr* pResMgr = NULL;
+ static ImplImageTreeSingletonRef aImageTree;
+ ResMgr* pResMgr = NULL;
ResMgr::GetResourceSkipHeader( rResId.SetRT( RSC_BITMAP ), &pResMgr );
pResMgr->ReadLong();
pResMgr->ReadLong();
-
+
const String aFileName( pResMgr->ReadString() );
::rtl::OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
-
- if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this, true ) )
+
+ if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this ) )
{
-#ifdef DBG_UTIL
+#ifdef DBG_UTIL
ByteString aErrorStr( "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <" );
- OSL_FAIL( ( ( aErrorStr += ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ) ) += '>' ).GetBuffer() );
+ DBG_ERROR( ( ( aErrorStr += ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ) ) += '>' ).GetBuffer() );
#endif
}
}
@@ -116,21 +116,21 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
// ------------------------------------------------------------------
BitmapEx::BitmapEx( const Bitmap& rBmp ) :
- aBitmap ( rBmp ),
- aBitmapSize ( aBitmap.GetSizePixel() ),
+ aBitmap ( rBmp ),
+ aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( sal_False )
+ bAlpha ( FALSE )
{
}
// ------------------------------------------------------------------
BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
- aBitmap ( rBmp ),
- aMask ( rMask ),
- aBitmapSize ( aBitmap.GetSizePixel() ),
- eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( sal_False )
+ aBitmap ( rBmp ),
+ aMask ( rMask ),
+ aBitmapSize ( aBitmap.GetSizePixel() ),
+ eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
+ bAlpha ( FALSE )
{
DBG_ASSERT( !rMask || rBmp.GetSizePixel() == rMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and mask." );
@@ -146,18 +146,18 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
// ------------------------------------------------------------------
BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
- aBitmap ( rBmp ),
- aMask ( rAlphaMask.ImplGetBitmap() ),
- aBitmapSize ( aBitmap.GetSizePixel() ),
- eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( !rAlphaMask ? sal_False : sal_True )
+ aBitmap ( rBmp ),
+ aMask ( rAlphaMask.ImplGetBitmap() ),
+ aBitmapSize ( aBitmap.GetSizePixel() ),
+ eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
+ bAlpha ( !rAlphaMask ? FALSE : TRUE )
{
DBG_ASSERT( !rAlphaMask || rBmp.GetSizePixel() == rAlphaMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." );
// #i75531# the workaround below can go when
// X11SalGraphics::drawAlphaBitmap()'s render acceleration
- // can handle the bitmap depth mismatch directly
+ // can handle the bitmap depth mismatch directly
if( aBitmap.GetBitCount() < aMask.GetBitCount() )
aBitmap.Convert( BMP_CONVERSION_24BIT );
}
@@ -165,11 +165,11 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
// ------------------------------------------------------------------
BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) :
- aBitmap ( rBmp ),
- aBitmapSize ( aBitmap.GetSizePixel() ),
- aTransparentColor ( rTransparentColor ),
- eTransparent ( TRANSPARENT_BITMAP ),
- bAlpha ( sal_False )
+ aBitmap ( rBmp ),
+ aBitmapSize ( aBitmap.GetSizePixel() ),
+ aTransparentColor ( rTransparentColor ),
+ eTransparent ( TRANSPARENT_BITMAP ),
+ bAlpha ( FALSE )
{
aMask = aBitmap.CreateMask( aTransparentColor );
@@ -204,19 +204,19 @@ BitmapEx& BitmapEx::operator=( const BitmapEx& rBitmapEx )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
+BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
{
if( eTransparent != rBitmapEx.eTransparent )
- return sal_False;
+ return FALSE;
if( aBitmap != rBitmapEx.aBitmap )
- return sal_False;
+ return FALSE;
if( aBitmapSize != rBitmapEx.aBitmapSize )
- return sal_False;
+ return FALSE;
if( eTransparent == TRANSPARENT_NONE )
- return sal_True;
+ return TRUE;
if( eTransparent == TRANSPARENT_COLOR )
return aTransparentColor == rBitmapEx.aTransparentColor;
@@ -226,7 +226,7 @@ sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
// ------------------------------------------------------------------
-sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
+BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
{
return( rBmpEx.eTransparent == eTransparent &&
rBmpEx.bAlpha == bAlpha &&
@@ -236,7 +236,7 @@ sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
// ------------------------------------------------------------------
-sal_Bool BitmapEx::IsEmpty() const
+BOOL BitmapEx::IsEmpty() const
{
return( aBitmap.IsEmpty() && aMask.IsEmpty() );
}
@@ -248,7 +248,7 @@ void BitmapEx::SetEmpty()
aBitmap.SetEmpty();
aMask.SetEmpty();
eTransparent = TRANSPARENT_NONE;
- bAlpha = sal_False;
+ bAlpha = FALSE;
}
// ------------------------------------------------------------------
@@ -260,14 +260,14 @@ void BitmapEx::Clear()
// ------------------------------------------------------------------
-sal_Bool BitmapEx::IsTransparent() const
+BOOL BitmapEx::IsTransparent() const
{
return( eTransparent != TRANSPARENT_NONE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::IsAlpha() const
+BOOL BitmapEx::IsAlpha() const
{
return( IsTransparent() && bAlpha );
}
@@ -298,6 +298,36 @@ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const
// ------------------------------------------------------------------
+BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const
+{
+ BitmapEx aRet;
+
+ if( BMP_COLOR_HIGHCONTRAST == eColorMode )
+ {
+ aRet = *this;
+ aRet.aBitmap = aBitmap.GetColorTransformedBitmap( eColorMode );
+ }
+ else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
+ BMP_COLOR_MONOCHROME_WHITE == eColorMode )
+ {
+ aRet = *this;
+ aRet.aBitmap = aRet.aBitmap.GetColorTransformedBitmap( eColorMode );
+
+ if( !aRet.aMask.IsEmpty() )
+ {
+ aRet.aMask.CombineSimple( aRet.aBitmap, BMP_COMBINE_OR );
+ aRet.aBitmap.Erase( ( BMP_COLOR_MONOCHROME_BLACK == eColorMode ) ? COL_BLACK : COL_WHITE );
+
+ DBG_ASSERT( aRet.aBitmap.GetSizePixel() == aRet.aMask.GetSizePixel(),
+ "BitmapEx::GetColorTransformedBitmapEx(): size mismatch for bitmap and alpha mask." );
+ }
+ }
+
+ return aRet;
+}
+
+// ------------------------------------------------------------------
+
Bitmap BitmapEx::GetMask() const
{
Bitmap aRet( aMask );
@@ -324,9 +354,9 @@ AlphaMask BitmapEx::GetAlpha() const
// ------------------------------------------------------------------
-sal_uLong BitmapEx::GetSizeBytes() const
+ULONG BitmapEx::GetSizeBytes() const
{
- sal_uLong nSizeBytes = aBitmap.GetSizeBytes();
+ ULONG nSizeBytes = aBitmap.GetSizeBytes();
if( eTransparent == TRANSPARENT_BITMAP )
nSizeBytes += aMask.GetSizeBytes();
@@ -336,10 +366,10 @@ sal_uLong BitmapEx::GetSizeBytes() const
// ------------------------------------------------------------------
-sal_uLong BitmapEx::GetChecksum() const
+ULONG BitmapEx::GetChecksum() const
{
- sal_uInt32 nCrc = aBitmap.GetChecksum();
- SVBT32 aBT32;
+ sal_uInt32 nCrc = aBitmap.GetChecksum();
+ SVBT32 aBT32;
UInt32ToSVBT32( (long) eTransparent, aBT32 );
nCrc = rtl_crc32( nCrc, aBT32, 4 );
@@ -365,9 +395,9 @@ void BitmapEx::SetSizePixel( const Size& rNewSize )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Invert()
+BOOL BitmapEx::Invert()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -382,9 +412,9 @@ sal_Bool BitmapEx::Invert()
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
+BOOL BitmapEx::Mirror( ULONG nMirrorFlags )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -399,9 +429,9 @@ sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -421,9 +451,9 @@ sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLon
// ------------------------------------------------------------------------
-sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag )
{
- sal_Bool bRet;
+ BOOL bRet;
if( aBitmapSize.Width() && aBitmapSize.Height() )
{
@@ -432,20 +462,20 @@ sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
nScaleFlag );
}
else
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
+BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
- const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
+ const BOOL bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
if( bTransRotate )
{
@@ -485,9 +515,9 @@ sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel )
+BOOL BitmapEx::Crop( const Rectangle& rRectPixel )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -507,23 +537,23 @@ sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Convert( BmpConversion eConversion )
+BOOL BitmapEx::Convert( BmpConversion eConversion )
{
- return( !!aBitmap ? aBitmap.Convert( eConversion ) : sal_False );
+ return( !!aBitmap ? aBitmap.Convert( eConversion ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
+BOOL BitmapEx::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
{
- return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : sal_False );
+ return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, sal_Bool bExpandTransparent )
+BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpandTransparent )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -546,10 +576,10 @@ sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor
// ------------------------------------------------------------------
-sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const BitmapEx* pBmpExSrc )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !pBmpExSrc || pBmpExSrc->IsEmpty() )
{
@@ -580,18 +610,18 @@ sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectS
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
- bAlpha = sal_True;
+ bAlpha = TRUE;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
else
{
- sal_uInt8 cBlack = 0;
- AlphaMask* pAlpha = new AlphaMask( GetSizePixel(), &cBlack );
+ sal_uInt8 cBlack = 0;
+ AlphaMask* pAlpha = new AlphaMask( GetSizePixel(), &cBlack );
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
eTransparent = TRANSPARENT_BITMAP;
- bAlpha = sal_True;
+ bAlpha = TRUE;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
}
@@ -614,7 +644,7 @@ sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectS
}
else if( IsAlpha() )
{
- sal_uInt8 cBlack = 0;
+ sal_uInt8 cBlack = 0;
const AlphaMask aAlphaSrc( pBmpExSrc->GetSizePixel(), &cBlack );
aMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() );
@@ -635,9 +665,9 @@ sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectS
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Erase( const Color& rFillColor )
+BOOL BitmapEx::Erase( const Color& rFillColor )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !!aBitmap )
{
@@ -664,41 +694,41 @@ sal_Bool BitmapEx::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Dither( sal_uLong nDitherFlags )
+BOOL BitmapEx::Dither( ULONG nDitherFlags )
{
- return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : sal_False );
+ return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+BOOL BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
{
- return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : sal_False );
+ return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
+BOOL BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, const ULONG* pTols )
{
- return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols ) : sal_False );
+ return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (ULONG*) pTols ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
+BOOL BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, sal_Bool bInvert )
+ double fGamma, BOOL bInvert )
{
return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent,
nChannelRPercent, nChannelGPercent, nChannelBPercent,
- fGamma, bInvert ) : sal_False );
+ fGamma, bInvert ) : FALSE );
}
// ------------------------------------------------------------------
-sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+BOOL BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : sal_False );
+ return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : FALSE );
}
// ------------------------------------------------------------------
@@ -763,6 +793,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize
imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
}
+ Size aBmpSize = aRet.GetSizePixel();
Size aStdSize( aStandardSize, aStandardSize );
Rectangle aRect(aEmptyPoint, aStdSize );
@@ -857,9 +888,9 @@ SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
{
rBitmapEx.aBitmap.Write( rOStm );
- rOStm << (sal_uInt32) 0x25091962;
- rOStm << (sal_uInt32) 0xACB20201;
- rOStm << (sal_uInt8) rBitmapEx.eTransparent;
+ rOStm << (UINT32) 0x25091962;
+ rOStm << (UINT32) 0xACB20201;
+ rOStm << (BYTE) rBitmapEx.eTransparent;
if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
rBitmapEx.aMask.Write( rOStm );
@@ -879,9 +910,9 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
if( !rIStm.GetError() )
{
- const sal_uLong nStmPos = rIStm.Tell();
- sal_uInt32 nMagic1 = 0;
- sal_uInt32 nMagic2 = 0;
+ const ULONG nStmPos = rIStm.Tell();
+ UINT32 nMagic1 = 0;
+ UINT32 nMagic2 = 0;
rIStm >> nMagic1 >> nMagic2;
@@ -893,11 +924,11 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
}
else
{
- sal_uInt8 bTransparent = false;
+ BYTE bTransparent = false;
rIStm >> bTransparent;
- if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
+ if( bTransparent == (BYTE) TRANSPARENT_BITMAP )
{
Bitmap aMask;
@@ -920,7 +951,7 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
else
rBitmapEx = aBmp;
}
- else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
+ else if( bTransparent == (BYTE) TRANSPARENT_COLOR )
{
Color aTransparentColor;
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 0762821c3267..1d742672853f 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,12 +38,12 @@
// - BitmapReadAccess -
// --------------------
-BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify ) :
- mpBuffer ( NULL ),
- mpScanBuf ( NULL ),
- mFncGetPixel ( NULL ),
- mFncSetPixel ( NULL ),
- mbModify ( bModify )
+BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, BOOL bModify ) :
+ mpBuffer ( NULL ),
+ mpScanBuf ( NULL ),
+ mFncGetPixel ( NULL ),
+ mFncSetPixel ( NULL ),
+ mbModify ( bModify )
{
ImplCreate( rBitmap );
}
@@ -51,11 +51,11 @@ BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify ) :
// ------------------------------------------------------------------
BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap ) :
- mpBuffer ( NULL ),
- mpScanBuf ( NULL ),
- mFncGetPixel ( NULL ),
- mFncSetPixel ( NULL ),
- mbModify ( sal_False )
+ mpBuffer ( NULL ),
+ mpScanBuf ( NULL ),
+ mFncGetPixel ( NULL ),
+ mFncSetPixel ( NULL ),
+ mbModify ( FALSE )
{
ImplCreate( rBitmap );
}
@@ -106,8 +106,8 @@ void BitmapReadAccess::ImplCreate( Bitmap& rBitmap )
if( mpBuffer )
{
- const long nHeight = mpBuffer->mnHeight;
- Scanline pTmpLine = mpBuffer->mpBits;
+ const long nHeight = mpBuffer->mnHeight;
+ Scanline pTmpLine = mpBuffer->mpBits;
mpScanBuf = new Scanline[ nHeight ];
maColorMask = mpBuffer->maColorMask;
@@ -155,9 +155,9 @@ void BitmapReadAccess::ImplDestroy()
// ------------------------------------------------------------------
-sal_Bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat )
+BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat )
{
- sal_Bool bRet = sal_True;
+ BOOL bRet = TRUE;
switch( nFormat )
{
@@ -179,7 +179,7 @@ sal_Bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat )
CASE_FORMAT( _32BIT_TC_MASK )
default:
- bRet = sal_False;
+ bRet = FALSE;
break;
}
@@ -197,7 +197,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
sal_uInt32 nBits;
bool bMsb;
- const sal_uLong nScanlineFormat = GetScanlineFormat();
+ const ULONG nScanlineFormat = GetScanlineFormat();
switch( nScanlineFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
@@ -250,7 +250,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
default:
{
- OSL_FAIL( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format");
+ DBG_ERROR( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format");
nBits = 0;
bMsb = true;
}
@@ -266,14 +266,14 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
if( nLeftOverBits != 0 ) // else there is really nothing to do
{
const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U;
- sal_uInt8 nMask;
-
+ sal_uInt8 nMask;
+
if( bMsb )
nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL));
else
nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL));
-
- sal_uInt8* pLastBytes = (sal_uInt8*)GetBuffer() + ( nScanSize - nBytes );
+
+ BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes );
for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize )
{
*pLastBytes &= nMask;
@@ -284,8 +284,8 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
}
else if( nBits & 0x1f )
{
- sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits );
- sal_uInt8* pLast4Bytes = (sal_uInt8*) GetBuffer() + ( nScanSize - 4 );
+ sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits );
+ BYTE* pLast4Bytes = (BYTE*) GetBuffer() + ( nScanSize - 4 );
#ifdef OSL_LITENDIAN
nMask = SWAPLONG( nMask );
@@ -305,7 +305,7 @@ void BitmapReadAccess::Flush()
// ------------------------------------------------------------------
-void BitmapReadAccess::ReAccess( sal_Bool bModify )
+void BitmapReadAccess::ReAccess( BOOL bModify )
{
const ImpBitmap* pImpBmp = maBitmap.ImplGetImpBitmap();
@@ -321,7 +321,7 @@ void BitmapReadAccess::ReAccess( sal_Bool bModify )
// ------------------------------------------------------------------
-sal_uInt16 BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
+USHORT BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
{
return( HasPalette() ? mpBuffer->maPalette.GetBestIndex( rBitmapColor ) : 0 );
}
@@ -331,7 +331,7 @@ sal_uInt16 BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColo
// ---------------------
BitmapWriteAccess::BitmapWriteAccess( Bitmap& rBitmap ) :
- BitmapReadAccess( rBitmap, sal_True ),
+ BitmapReadAccess( rBitmap, TRUE ),
mpLineColor ( NULL ),
mpFillColor ( NULL )
{
@@ -367,16 +367,16 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc
// ------------------------------------------------------------------
void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline,
- sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize )
+ ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize )
{
- const sal_uLong nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat );
+ const 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 sal_uLong nCount = Min( GetScanlineSize(), nSrcScanlineSize );
+ const ULONG nCount = Min( GetScanlineSize(), nSrcScanlineSize );
if( nCount )
{
@@ -394,22 +394,22 @@ void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline,
switch( nFormat )
{
- case( BMP_FORMAT_1BIT_MSB_PAL ): pFncGetPixel = GetPixelFor_1BIT_MSB_PAL; break;
- case( BMP_FORMAT_1BIT_LSB_PAL ): pFncGetPixel = GetPixelFor_1BIT_LSB_PAL; break;
- case( BMP_FORMAT_4BIT_MSN_PAL ): pFncGetPixel = GetPixelFor_4BIT_MSN_PAL; break;
- case( BMP_FORMAT_4BIT_LSN_PAL ): pFncGetPixel = GetPixelFor_4BIT_LSN_PAL; break;
- case( BMP_FORMAT_8BIT_PAL ): pFncGetPixel = GetPixelFor_8BIT_PAL; break;
- case( BMP_FORMAT_8BIT_TC_MASK ): pFncGetPixel = GetPixelFor_8BIT_TC_MASK; break;
- case( BMP_FORMAT_16BIT_TC_MSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_MSB_MASK; break;
- case( BMP_FORMAT_16BIT_TC_LSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_LSB_MASK; break;
- case( BMP_FORMAT_24BIT_TC_BGR ): pFncGetPixel = GetPixelFor_24BIT_TC_BGR; break;
- case( BMP_FORMAT_24BIT_TC_RGB ): pFncGetPixel = GetPixelFor_24BIT_TC_RGB; break;
- case( BMP_FORMAT_24BIT_TC_MASK ): pFncGetPixel = GetPixelFor_24BIT_TC_MASK; break;
- case( BMP_FORMAT_32BIT_TC_ABGR ): pFncGetPixel = GetPixelFor_32BIT_TC_ABGR; break;
- case( BMP_FORMAT_32BIT_TC_ARGB ): pFncGetPixel = GetPixelFor_32BIT_TC_ARGB; break;
- case( BMP_FORMAT_32BIT_TC_BGRA ): pFncGetPixel = GetPixelFor_32BIT_TC_BGRA; break;
- case( BMP_FORMAT_32BIT_TC_RGBA ): pFncGetPixel = GetPixelFor_32BIT_TC_RGBA; break;
- case( BMP_FORMAT_32BIT_TC_MASK ): pFncGetPixel = GetPixelFor_32BIT_TC_MASK; break;
+ case( BMP_FORMAT_1BIT_MSB_PAL ): pFncGetPixel = GetPixelFor_1BIT_MSB_PAL; break;
+ case( BMP_FORMAT_1BIT_LSB_PAL ): pFncGetPixel = GetPixelFor_1BIT_LSB_PAL; break;
+ case( BMP_FORMAT_4BIT_MSN_PAL ): pFncGetPixel = GetPixelFor_4BIT_MSN_PAL; break;
+ case( BMP_FORMAT_4BIT_LSN_PAL ): pFncGetPixel = GetPixelFor_4BIT_LSN_PAL; break;
+ case( BMP_FORMAT_8BIT_PAL ): pFncGetPixel = GetPixelFor_8BIT_PAL; break;
+ case( BMP_FORMAT_8BIT_TC_MASK ): pFncGetPixel = GetPixelFor_8BIT_TC_MASK; break;
+ case( BMP_FORMAT_16BIT_TC_MSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_MSB_MASK; break;
+ case( BMP_FORMAT_16BIT_TC_LSB_MASK ): pFncGetPixel = GetPixelFor_16BIT_TC_LSB_MASK; break;
+ case( BMP_FORMAT_24BIT_TC_BGR ): pFncGetPixel = GetPixelFor_24BIT_TC_BGR; break;
+ case( BMP_FORMAT_24BIT_TC_RGB ): pFncGetPixel = GetPixelFor_24BIT_TC_RGB; break;
+ case( BMP_FORMAT_24BIT_TC_MASK ): pFncGetPixel = GetPixelFor_24BIT_TC_MASK; break;
+ case( BMP_FORMAT_32BIT_TC_ABGR ): pFncGetPixel = GetPixelFor_32BIT_TC_ABGR; break;
+ case( BMP_FORMAT_32BIT_TC_ARGB ): pFncGetPixel = GetPixelFor_32BIT_TC_ARGB; break;
+ case( BMP_FORMAT_32BIT_TC_BGRA ): pFncGetPixel = GetPixelFor_32BIT_TC_BGRA; break;
+ case( BMP_FORMAT_32BIT_TC_RGBA ): pFncGetPixel = GetPixelFor_32BIT_TC_RGBA; break;
+ case( BMP_FORMAT_32BIT_TC_MASK ): pFncGetPixel = GetPixelFor_32BIT_TC_MASK; break;
default:
pFncGetPixel = NULL;
@@ -437,8 +437,8 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc )
if( ( GetScanlineFormat() == rReadAcc.GetScanlineFormat() ) &&
( GetScanlineSize() == rReadAcc.GetScanlineSize() ) )
{
- const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() );
- const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize;
+ const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() );
+ const 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 718bd56cdb0c..34f56c34e6f5 100644
--- a/vcl/source/gdi/bmpacc2.cxx
+++ b/vcl/source/gdi/bmpacc2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL )
{
- sal_uInt8& rByte = pScanline[ nX >> 3 ];
+ BYTE& 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 )
{
- sal_uInt8& rByte = pScanline[ nX >> 3 ];
+ BYTE& rByte = pScanline[ nX >> 3 ];
( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( nX & 7 ) ) :
( rByte &= ~( 1 << ( nX & 7 ) ) );
@@ -78,9 +78,9 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL )
{
- sal_uInt8& rByte = pScanline[ nX >> 1 ];
+ BYTE& rByte = pScanline[ nX >> 1 ];
- ( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
+ ( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) );
}
@@ -95,9 +95,9 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL )
{
- sal_uInt8& rByte = pScanline[ nX >> 1 ];
+ BYTE& rByte = pScanline[ nX >> 1 ];
- ( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
+ ( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) );
}
@@ -111,7 +111,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _8BIT_PAL )
// ------------------------------------------------------------------
IMPL_FORMAT_SETPIXEL_NOMASK( _8BIT_PAL )
-{
+{
pScanline[ nX ] = rBitmapColor.GetIndex();
}
@@ -285,7 +285,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _32BIT_TC_BGRA )
// ------------------------------------------------------------------
IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_BGRA )
-{
+{
*( pScanline = pScanline + ( nX << 2 ) )++ = rBitmapColor.GetBlue();
*pScanline++ = rBitmapColor.GetGreen();
*pScanline++ = rBitmapColor.GetRed();
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index 5e87d680e9c0..50fdcfac9ece 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,11 +50,11 @@ void BitmapWriteAccess::SetLineColor()
void BitmapWriteAccess::SetLineColor( const Color& rColor )
{
delete mpLineColor;
-
+
if( rColor.GetTransparency() == 255 )
mpLineColor = NULL;
else
- mpLineColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpLineColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -62,12 +62,12 @@ void BitmapWriteAccess::SetLineColor( const Color& rColor )
Color BitmapWriteAccess::GetLineColor() const
{
Color aRet;
-
+
if( mpLineColor )
aRet = (const Color&) *mpLineColor;
else
aRet.SetTransparency( 255 );
-
+
return aRet;
}
@@ -84,11 +84,11 @@ void BitmapWriteAccess::SetFillColor()
void BitmapWriteAccess::SetFillColor( const Color& rColor )
{
delete mpFillColor;
-
+
if( rColor.GetTransparency() == 255 )
mpFillColor = NULL;
else
- mpFillColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpFillColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -96,7 +96,7 @@ void BitmapWriteAccess::SetFillColor( const Color& rColor )
Color BitmapWriteAccess::GetFillColor() const
{
Color aRet;
-
+
if( mpFillColor )
aRet = (const Color&) *mpFillColor;
else
@@ -113,15 +113,15 @@ void BitmapWriteAccess::Erase( const Color& rColor )
// TODO: provide and use Erase( BitmapColor& method)
BitmapColor aColor = rColor;
if( HasPalette() )
- aColor = BitmapColor( (sal_uInt8)GetBestPaletteIndex( rColor) );
+ aColor = BitmapColor( (BYTE)GetBestPaletteIndex( rColor) );
// try fast bitmap method first
if( ImplFastEraseBitmap( *mpBuffer, aColor ) )
return;
// use the canonical method to clear the bitmap
- BitmapColor* pOldFillColor = mpFillColor ? new BitmapColor( *mpFillColor ) : NULL;
- const Point aPoint;
- const Rectangle aRect( aPoint, maBitmap.GetSizePixel() );
+ BitmapColor* pOldFillColor = mpFillColor ? new BitmapColor( *mpFillColor ) : NULL;
+ const Point aPoint;
+ const Rectangle aRect( aPoint, maBitmap.GetSizePixel() );
SetFillColor( rColor );
FillRect( aRect );
@@ -135,17 +135,17 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
{
if( mpLineColor )
{
- const BitmapColor& rLineColor = *mpLineColor;
- long nX, nY;
-
+ const BitmapColor& rLineColor = *mpLineColor;
+ long nX, nY;
+
if ( rStart.X() == rEnd.X() )
{
// vertikale Line
const long nEndY = rEnd.Y();
-
+
nX = rStart.X();
nY = rStart.Y();
-
+
if ( nEndY > nY )
{
for (; nY <= nEndY; nY++ )
@@ -161,10 +161,10 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
{
// horizontale Line
const long nEndX = rEnd.X();
-
+
nX = rStart.X();
nY = rStart.Y();
-
+
if ( nEndX > nX )
{
for (; nX <= nEndX; nX++ )
@@ -178,13 +178,13 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
}
else
{
- const long nDX = labs( rEnd.X() - rStart.X() );
- const long nDY = labs( rEnd.Y() - rStart.Y() );
- long nX1;
- long nY1;
- long nX2;
- long nY2;
-
+ const long nDX = labs( rEnd.X() - rStart.X() );
+ const long nDY = labs( rEnd.Y() - rStart.Y() );
+ long nX1;
+ long nY1;
+ long nX2;
+ long nY2;
+
if ( nDX >= nDY )
{
if ( rStart.X() < rEnd.X() )
@@ -201,22 +201,22 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
nX2 = rStart.X();
nY2 = rStart.Y();
}
-
- const long nDYX = ( nDY - nDX ) << 1;
- const long nDY2 = nDY << 1;
- long nD = nDY2 - nDX;
- sal_Bool bPos = nY1 < nY2;
-
+
+ const long nDYX = ( nDY - nDX ) << 1;
+ const long nDY2 = nDY << 1;
+ long nD = nDY2 - nDX;
+ BOOL bPos = nY1 < nY2;
+
for ( nX = nX1, nY = nY1; nX <= nX2; nX++ )
{
SetPixel( nY, nX, rLineColor );
-
+
if ( nD < 0 )
nD += nDY2;
else
{
nD += nDYX;
-
+
if ( bPos )
nY++;
else
@@ -240,22 +240,22 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
nX2 = rStart.X();
nY2 = rStart.Y();
}
-
- const long nDYX = ( nDX - nDY ) << 1;
- const long nDY2 = nDX << 1;
- long nD = nDY2 - nDY;
- sal_Bool bPos = nX1 < nX2;
-
+
+ const long nDYX = ( nDX - nDY ) << 1;
+ const long nDY2 = nDX << 1;
+ long nD = nDY2 - nDY;
+ BOOL bPos = nX1 < nX2;
+
for ( nX = nX1, nY = nY1; nY <= nY2; nY++ )
{
SetPixel( nY, nX, rLineColor );
-
+
if ( nD < 0 )
nD += nDY2;
else
{
nD += nDYX;
-
+
if ( bPos )
nX++;
else
@@ -273,19 +273,19 @@ void BitmapWriteAccess::FillRect( const Rectangle& rRect )
{
if( mpFillColor )
{
- const BitmapColor& rFillColor = *mpFillColor;
- Point aPoint;
- Rectangle aRect( aPoint, maBitmap.GetSizePixel() );
+ const BitmapColor& rFillColor = *mpFillColor;
+ Point aPoint;
+ Rectangle aRect( aPoint, maBitmap.GetSizePixel() );
aRect.Intersection( rRect );
if( !aRect.IsEmpty() )
{
- const long nStartX = rRect.Left();
- const long nStartY = rRect.Top();
- const long nEndX = rRect.Right();
- const long nEndY = rRect.Bottom();
-
+ const long nStartX = rRect.Left();
+ const long nStartY = rRect.Top();
+ const long nEndX = rRect.Right();
+ const long nEndY = rRect.Bottom();
+
for( long nY = nStartY; nY <= nEndY; nY++ )
for( long nX = nStartX; nX <= nEndX; nX++ )
SetPixel( nY, nX, rFillColor );
@@ -299,7 +299,7 @@ void BitmapWriteAccess::DrawRect( const Rectangle& rRect )
{
if( mpFillColor )
FillRect( rRect );
-
+
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
DrawLine( rRect.TopLeft(), rRect.TopRight() );
@@ -313,13 +313,13 @@ void BitmapWriteAccess::DrawRect( const Rectangle& rRect )
void BitmapWriteAccess::FillPolygon( const Polygon& rPoly )
{
- const sal_uInt16 nSize = rPoly.GetSize();
+ const USHORT nSize = rPoly.GetSize();
if( nSize && mpFillColor )
{
- const BitmapColor& rFillColor = *mpFillColor;
- Region aRegion( rPoly );
- Rectangle aRect;
+ const BitmapColor& rFillColor = *mpFillColor;
+ Region aRegion( rPoly );
+ Rectangle aRect;
aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) );
@@ -346,9 +346,9 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- const sal_uInt16 nSize = rPoly.GetSize();
+ const USHORT nSize = rPoly.GetSize();
- for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( USHORT i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
DrawLine( rPoly[ i ], rPoly[ i + 1 ] );
if( rPoly[ nSize - 1 ] != rPoly[ 0 ] )
@@ -360,20 +360,20 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon& rPolyPoly )
{
- const sal_uInt16 nCount = rPolyPoly.Count();
+ const USHORT nCount = rPolyPoly.Count();
if( nCount && mpFillColor )
{
- const BitmapColor& rFillColor = *mpFillColor;
- Region aRegion( rPolyPoly );
- Rectangle aRect;
+ const BitmapColor& rFillColor = *mpFillColor;
+ Region aRegion( rPolyPoly );
+ Rectangle aRect;
aRegion.Intersect( Rectangle( Point(), Size( Width(), Height() ) ) );
if( !aRegion.IsEmpty() )
{
RegionHandle aRegHandle( aRegion.BeginEnumRects() );
-
+
while( aRegion.GetNextEnumRect( aRegHandle, aRect ) )
for( long nY = aRect.Top(), nEndY = aRect.Bottom(); nY <= nEndY; nY++ )
for( long nX = aRect.Left(), nEndX = aRect.Right(); nX <= nEndX; nX++ )
@@ -390,17 +390,17 @@ void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
{
if( mpFillColor )
FillPolyPolygon( rPolyPoly );
-
+
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- for( sal_uInt16 n = 0, nCount = rPolyPoly.Count(); n < nCount; )
+ for( USHORT n = 0, nCount = rPolyPoly.Count(); n < nCount; )
{
- const Polygon& rPoly = rPolyPoly[ n++ ];
- const sal_uInt16 nSize = rPoly.GetSize();
+ const Polygon& rPoly = rPolyPoly[ n++ ];
+ const USHORT nSize = rPoly.GetSize();
if( nSize )
{
- for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( USHORT 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 886055817312..94c913c68a90 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,14 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include "vcl/bitmap.hxx"
-#include "vcl/svapp.hxx"
-#include "vcl/salctype.hxx"
+#include <vcl/bitmap.hxx>
+#include <vcl/impbmpconv.hxx>
+#include <vcl/svapp.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;
@@ -44,20 +44,19 @@ using namespace com::sun::star::script;
using namespace com::sun::star::beans;
using namespace com::sun::star::reflection;
using namespace com::sun::star::awt;
-
-using ::rtl::OUString;
+using namespace rtl;
namespace vcl {
class BmpTransporter :
public cppu::WeakImplHelper1< com::sun::star::awt::XBitmap >
{
- Sequence<sal_Int8> m_aBM;
- com::sun::star::awt::Size m_aSize;
+ Sequence<sal_Int8> m_aBM;
+ com::sun::star::awt::Size m_aSize;
public:
BmpTransporter( const Bitmap& rBM );
virtual ~BmpTransporter();
-
+
virtual com::sun::star::awt::Size SAL_CALL getSize() throw();
virtual Sequence< sal_Int8 > SAL_CALL getDIB() throw();
virtual Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw();
@@ -69,7 +68,7 @@ class BmpConverter :
public:
BmpConverter();
virtual ~BmpConverter();
-
+
virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection() throw();
virtual void SAL_CALL setValue( const OUString& rProperty, const Any& rValue )
throw( UnknownPropertyException );
@@ -77,7 +76,7 @@ public:
throw( UnknownPropertyException );
virtual sal_Bool SAL_CALL hasMethod( const OUString& rName ) throw();
virtual sal_Bool SAL_CALL hasProperty( const OUString& rProp ) throw();
-
+
virtual Any SAL_CALL invoke( const OUString& rFunction,
const Sequence< Any >& rParams,
Sequence< sal_Int16 >& rOutParamIndex,
@@ -120,7 +119,7 @@ Any SAL_CALL BmpConverter::getValue( const OUString& ) throw( UnknownPropertyExc
sal_Bool SAL_CALL BmpConverter::hasMethod( const OUString& rName ) throw()
{
- return rName.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("convert-bitmap-depth")) );
+ return rName.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) );
}
sal_Bool SAL_CALL BmpConverter::hasProperty( const OUString& ) throw()
@@ -137,7 +136,7 @@ Any SAL_CALL BmpConverter::invoke(
{
Any aRet;
- if( rFunction.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("convert-bitmap-depth")) ) )
+ if( rFunction.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) ) )
{
Reference< XBitmap > xBM;
sal_uInt16 nTargetDepth = 0;
@@ -155,7 +154,7 @@ Any SAL_CALL BmpConverter::invoke(
SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
Bitmap aBM;
- aBM.Read( aStream, sal_True );
+ aBM.Read( aStream, TRUE );
if( nTargetDepth < 4 )
nTargetDepth = 1;
else if( nTargetDepth < 8 )
@@ -170,10 +169,10 @@ Any SAL_CALL BmpConverter::invoke(
{
switch( nTargetDepth )
{
- case 1: aBM.Convert( BMP_CONVERSION_1BIT_THRESHOLD );break;
- case 4: aBM.ReduceColors( BMP_CONVERSION_4BIT_COLORS );break;
- case 8: aBM.ReduceColors( BMP_CONVERSION_8BIT_COLORS );break;
- case 24: aBM.Convert( BMP_CONVERSION_24BIT );break;
+ case 1: aBM.Convert( BMP_CONVERSION_1BIT_THRESHOLD );break;
+ case 4: aBM.ReduceColors( BMP_CONVERSION_4BIT_COLORS );break;
+ case 8: aBM.ReduceColors( BMP_CONVERSION_8BIT_COLORS );break;
+ case 24: aBM.Convert( BMP_CONVERSION_24BIT );break;
}
}
xBM = new BmpTransporter( aBM );
@@ -190,7 +189,7 @@ BmpTransporter::BmpTransporter( const Bitmap& rBM )
m_aSize.Width = rBM.GetSizePixel().Width();
m_aSize.Height = rBM.GetSizePixel().Height();
SvMemoryStream aStream;
- rBM.Write( aStream, sal_False, sal_True );
+ rBM.Write( aStream, FALSE, 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 8fc5188c9204..afccabc3309f 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,7 +56,7 @@ protected:
PIXBYTE* mpPixel;
};
-template <sal_uLong PIXFMT>
+template <ULONG PIXFMT>
class TrueColorPixelPtr : public BasePixelPtr
{
public:
@@ -255,7 +255,7 @@ class TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL>
// =======================================================================
// converting truecolor formats
-template <sal_uLong SRCFMT, sal_uLong DSTFMT>
+template <ULONG SRCFMT, 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 <sal_uLong SRCFMT, sal_uLong DSTFMT>
+template <ULONG SRCFMT, 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, sal_uLong SRCFMT, sal_uLong DSTFMT>
+template <unsigned ALPHABITS, ULONG SRCFMT, 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, sal_uLong MASKFMT, sal_uLong SRCFMT, sal_uLong DSTFMT>
+template <unsigned ALPHABITS, ULONG MASKFMT, ULONG SRCFMT, 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, sal_uLong SRCFMT, sal_uLong DSTFMT>
+template <unsigned ALPHABITS, ULONG SRCFMT, 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 <sal_uLong DSTFMT,sal_uLong SRCFMT>
+template <ULONG DSTFMT,ULONG SRCFMT>
bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer )
{
@@ -438,7 +438,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
// -----------------------------------------------------------------------
-template <sal_uLong SRCFMT>
+template <ULONG SRCFMT>
inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc )
{
TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
@@ -482,7 +482,7 @@ inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc
case BMP_FORMAT_32BIT_TC_RGBA:
return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDst, rSrc );
}
-
+
#ifdef DEBUG
static int nNotAccelerated = 0;
if( rSrc.mnWidth * rSrc.mnHeight >= 4000 )
@@ -539,8 +539,8 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
if( rDst.mnHeight < rTR.mnDestY + rTR.mnDestHeight )
return false;
- const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const 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 <sal_uLong DSTFMT,sal_uLong SRCFMT> //,sal_uLong MSKFMT>
+template <ULONG DSTFMT,ULONG SRCFMT> //,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 <sal_uLong SRCFMT>
+template <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 sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const 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 sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// erasing a bitmap is often just a byte-wise memory fill
bool bByteFill = true;
- sal_uInt8 nFillByte;
+ BYTE nFillByte;
switch( nDstFormat )
{
case BMP_FORMAT_1BIT_MSB_PAL:
case BMP_FORMAT_1BIT_LSB_PAL:
nFillByte = rColor.GetIndex();
- nFillByte = static_cast<sal_uInt8>( -(nFillByte & 1) ); // 0x00 or 0xFF
+ nFillByte = static_cast<BYTE>( -(nFillByte & 1) ); // 0x00 or 0xFF
break;
case BMP_FORMAT_4BIT_MSN_PAL:
case BMP_FORMAT_4BIT_LSN_PAL:
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index ff701ab640fa..004dc4db1f6b 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,6 +35,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
+using namespace rtl;
using namespace utl;
using namespace vcl;
using namespace com::sun::star::uno;
@@ -42,12 +43,10 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
-using ::rtl::OUString;
-
#define SETTINGS_CONFIGNODE "VCL/Settings"
/*
- * SettingsConfigItem::get
+ * SettingsConfigItem::get
*/
SettingsConfigItem* SettingsConfigItem::get()
@@ -90,7 +89,7 @@ void SettingsConfigItem::Commit()
if( ! IsValidConfigMgr() )
return;
- boost::unordered_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
+ std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
{
@@ -105,10 +104,10 @@ void SettingsConfigItem::Commit()
String aName( aKeyName );
aName.Append( '/' );
aName.Append( String( it->first ) );
- pValues[nIndex].Name = aName;
- pValues[nIndex].Handle = 0;
+ pValues[nIndex].Name = aName;
+ pValues[nIndex].Handle = 0;
pValues[nIndex].Value <<= it->second;
- pValues[nIndex].State = PropertyState_DIRECT_VALUE;
+ pValues[nIndex].State = PropertyState_DIRECT_VALUE;
nIndex++;
}
ReplaceSetProperties( aKeyName, aValues );
@@ -135,11 +134,12 @@ void SettingsConfigItem::getValues()
m_aSettings.clear();
Sequence< OUString > aNames( GetNodeNames( OUString() ) );
+ m_aSettings.resize( aNames.getLength() );
for( int j = 0; j < aNames.getLength(); j++ )
{
#if OSL_DEBUG_LEVEL > 2
- OSL_TRACE( "found settings data for \"%s\"\n",
+ fprintf( stderr, "found settings data for \"%s\"\n",
OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
);
#endif
@@ -165,7 +165,7 @@ void SettingsConfigItem::getValues()
if( pLine->getLength() )
m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
#if OSL_DEBUG_LEVEL > 2
- OSL_TRACE( " \"%s\"=\"%.30s\"\n",
+ fprintf( stderr, " \"%s\"=\"%.30s\"\n",
OUStringToOString( aKeys.getConstArray()[i], RTL_TEXTENCODING_ASCII_US ).getStr(),
OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr()
);
@@ -181,7 +181,7 @@ void SettingsConfigItem::getValues()
const OUString& SettingsConfigItem::getValue( const OUString& rGroup, const OUString& rKey ) const
{
- ::boost::unordered_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
+ ::std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
if( group == m_aSettings.end() || group->second.find( rKey ) == group->second.end() )
{
static OUString aEmpty;
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 261781ebcf50..ae033d497778 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,7 +36,7 @@
#include <vcl/cvtgrf.hxx>
// --------------
-// - Callback -
+// - Callback -
// --------------
// --------------------
@@ -56,19 +56,19 @@ GraphicConverter::~GraphicConverter()
// ------------------------------------------------------------------------
-sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
- void** ppOutBuffer, sal_uLong nOutFormat )
+ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
+ void** ppOutBuffer, ULONG nOutFormat )
{
- sal_uLong nRetBufSize = 0UL;
+ ULONG nRetBufSize = 0UL;
if( ( nInFormat != nOutFormat ) && pInBuffer )
{
if( ( nInFormat == CVT_SVM ) || ( nInFormat == CVT_BMP ) )
{
- SvMemoryStream aIStm;
- Graphic aGraphic;
+ SvMemoryStream aIStm;
+ Graphic aGraphic;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
aIStm >> aGraphic;
if( !aIStm.GetError() )
@@ -76,12 +76,12 @@ sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, s
SvMemoryStream aOStm( 64535, 64535 );
mpConvertData = new ConvertData( aGraphic, aOStm, nOutFormat );
-
+
if( maFilterHdl.IsSet() && maFilterHdl.Call( mpConvertData ) )
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( sal_False );
+ aOStm.ObjectOwnsMemory( FALSE );
}
delete mpConvertData;
@@ -90,15 +90,15 @@ sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, s
}
else if( ( nOutFormat == CVT_SVM ) || ( nOutFormat == CVT_BMP ) )
{
- SvMemoryStream aIStm;
+ SvMemoryStream aIStm;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
mpConvertData = new ConvertData( Graphic(), aIStm, nInFormat );
-
+
if( maFilterHdl.IsSet() && maFilterHdl.Call( mpConvertData ) )
{
- SvMemoryStream aOStm( 645535, 64535 );
- Graphic& rGraphic = mpConvertData->maGraphic;
+ SvMemoryStream aOStm( 645535, 64535 );
+ Graphic& rGraphic = mpConvertData->maGraphic;
if( ( rGraphic.GetType() == GRAPHIC_BITMAP ) && ( CVT_SVM == nOutFormat ) )
{
@@ -118,7 +118,7 @@ sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, s
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( sal_False );
+ aOStm.ObjectOwnsMemory( FALSE );
}
}
@@ -132,15 +132,15 @@ sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, s
// ------------------------------------------------------------------------
-sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat )
+ULONG GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat )
{
- GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- sal_uLong nRet = ERRCODE_IO_GENERAL;
+ GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
+ ULONG nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
- ConvertData aData( rGraphic, rIStm, nFormat );
-
+ ConvertData aData( rGraphic, rIStm, nFormat );
+
if( pCvt->GetFilterHdl().Call( &aData ) )
{
rGraphic = aData.maGraphic;
@@ -149,27 +149,27 @@ sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLon
else if( rIStm.GetError() )
nRet = rIStm.GetError();
}
-
+
return nRet;
}
// ------------------------------------------------------------------------
-sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat )
+ULONG GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat )
{
- GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- sal_uLong nRet = ERRCODE_IO_GENERAL;
+ GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
+ ULONG nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
- ConvertData aData( rGraphic, rOStm, nFormat );
-
+ ConvertData aData( rGraphic, rOStm, nFormat );
+
if( pCvt->GetFilterHdl().Call( &aData ) )
nRet = ERRCODE_NONE;
else if( rOStm.GetError() )
nRet = rOStm.GetError();
}
-
+
return nRet;
}
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 2d9fbef36e44..a2bbd6ee0e6e 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -75,12 +75,12 @@ void ImplWriteRect( SvStream& rOStm, const Rectangle& rRect )
void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
{
- sal_Int32 nSize;
+ INT32 nSize;
rIStm >> nSize;
- rPoly = Polygon( (sal_uInt16) nSize );
+ rPoly = Polygon( (USHORT) nSize );
- for( sal_uInt16 i = 0; i < (sal_uInt16) nSize; i++ )
+ for( USHORT i = 0; i < (USHORT) nSize; i++ )
rIStm >> rPoly[ i ];
}
@@ -89,11 +89,11 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly )
{
Polygon aPoly;
- sal_Int32 nPolyCount;
+ INT32 nPolyCount;
rIStm >> nPolyCount;
- for( sal_uInt16 i = 0; i < (sal_uInt16) nPolyCount; i++ )
+ for( USHORT i = 0; i < (USHORT) 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 sal_uInt16 nPoly = rPolyPoly.Count();
- sal_uInt16 nPoints = 0;
- sal_uInt16 n;
+ const USHORT nPoly = rPolyPoly.Count();
+ USHORT nPoints = 0;
+ USHORT n;
for( n = 0; n < nPoly; n++ )
- nPoints = sal::static_int_cast<sal_uInt16>(nPoints + rPolyPoly[ n ].GetSize());
+ nPoints = sal::static_int_cast<USHORT>(nPoints + rPolyPoly[ n ].GetSize());
- rOStm << (sal_Int16) GDI_POLYPOLYGON_ACTION;
- rOStm << (sal_Int32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
- rOStm << (sal_Int32) nPoly;
+ rOStm << (INT16) GDI_POLYPOLYGON_ACTION;
+ rOStm << (INT32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
+ rOStm << (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 sal_uInt16 nSize(aSimplePoly.GetSize());
+ const USHORT nSize(aSimplePoly.GetSize());
- rOStm << (sal_Int32) nSize;
+ rOStm << (INT32) nSize;
- for( sal_uInt16 j = 0; j < nSize; j++ )
+ for( USHORT 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 )
{
- sal_Int16 nVal;
+ INT16 nVal;
- 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) );
+ 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) );
}
// ------------------------------------------------------------------------
void ImplWriteColor( SvStream& rOStm, const Color& rColor )
{
- sal_Int16 nVal;
+ INT16 nVal;
- nVal = ( (sal_Int16) rColor.GetRed() << 8 ) | rColor.GetRed();
+ nVal = ( (INT16) rColor.GetRed() << 8 ) | rColor.GetRed();
rOStm << nVal;
- nVal = ( (sal_Int16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
+ nVal = ( (INT16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
rOStm << nVal;
- nVal = ( (sal_Int16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
+ nVal = ( (INT16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
rOStm << nVal;
}
@@ -162,12 +162,12 @@ void ImplWriteColor( SvStream& rOStm, const Color& rColor )
void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
{
- Point aOrg;
- sal_Int32 nXNum;
- sal_Int32 nXDenom;
- sal_Int32 nYNum;
- sal_Int32 nYDenom;
- sal_Int16 nUnit;
+ Point aOrg;
+ INT32 nXNum;
+ INT32 nXDenom;
+ INT32 nYNum;
+ INT32 nYDenom;
+ 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 << (sal_Int16) rMapMode.GetMapUnit();
+ rOStm << (INT16) rMapMode.GetMapUnit();
rOStm << rMapMode.GetOrigin();
- rOStm << (sal_Int32) rMapMode.GetScaleX().GetNumerator();
- rOStm << (sal_Int32) rMapMode.GetScaleX().GetDenominator();
- rOStm << (sal_Int32) rMapMode.GetScaleY().GetNumerator();
- rOStm << (sal_Int32) rMapMode.GetScaleY().GetDenominator();
+ rOStm << (INT32) rMapMode.GetScaleX().GetNumerator();
+ rOStm << (INT32) rMapMode.GetScaleX().GetDenominator();
+ rOStm << (INT32) rMapMode.GetScaleY().GetNumerator();
+ rOStm << (INT32) rMapMode.GetScaleY().GetDenominator();
}
// ------------------------------------------------------------------------
void ImplWritePushAction( SvStream& rOStm )
{
- rOStm << (sal_Int16) GDI_PUSH_ACTION;
- rOStm << (sal_Int32) 4;
+ rOStm << (INT16) GDI_PUSH_ACTION;
+ rOStm << (INT32) 4;
}
// ------------------------------------------------------------------------
void ImplWritePopAction( SvStream& rOStm )
{
- rOStm << (sal_Int16) GDI_POP_ACTION;
- rOStm << (sal_Int32) 4;
+ rOStm << (INT16) GDI_POP_ACTION;
+ rOStm << (INT32) 4;
}
// ------------------------------------------------------------------------
-void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle, sal_Int32 nWidth = 0L )
+void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, INT16 nStyle, INT32 nWidth = 0L )
{
if( rColor.GetTransparency() > 127 )
nStyle = 0;
- rOStm << (sal_Int16) GDI_PEN_ACTION;
- rOStm << (sal_Int32) 16;
+ rOStm << (INT16) GDI_PEN_ACTION;
+ rOStm << (INT32) 16;
ImplWriteColor( rOStm, rColor );
rOStm << nWidth;
rOStm << nStyle;
@@ -217,10 +217,10 @@ void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle,
// ------------------------------------------------------------------------
-void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle )
+void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle )
{
- rOStm << (sal_Int16) GDI_FILLBRUSH_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_FILLBRUSH_ACTION;
+ rOStm << (INT32) 20;
ImplWriteColor( rOStm, rColor );
if( rColor.GetTransparency() > 127 )
@@ -230,13 +230,13 @@ void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle
{
ImplWriteColor( rOStm, COL_WHITE );
rOStm << nStyle;
- rOStm << (sal_Int16) 1;
+ rOStm << (INT16) 1;
}
else
{
ImplWriteColor( rOStm, COL_BLACK );
rOStm << nStyle;
- rOStm << (sal_Int16) 0;
+ rOStm << (INT16) 0;
}
}
@@ -245,8 +245,8 @@ void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle
void ImplWriteFont( SvStream& rOStm, const Font& rFont,
rtl_TextEncoding& rActualCharSet )
{
- char aName[32];
- short nWeight;
+ char aName[32];
+ short nWeight;
ByteString aByteName( rFont.GetName(), rOStm.GetStreamCharSet() );
strncpy( aName, aByteName.GetBuffer(), 32 );
@@ -275,24 +275,24 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
break;
}
- rOStm << (sal_Int16) GDI_FONT_ACTION;
- rOStm << (sal_Int32) 78;
+ rOStm << (INT16) GDI_FONT_ACTION;
+ rOStm << (INT32) 78;
rActualCharSet = GetStoreCharSet( rFont.GetCharSet() );
ImplWriteColor( rOStm, rFont.GetColor() );
ImplWriteColor( rOStm, rFont.GetFillColor() );
rOStm.Write( aName, 32 );
rOStm << rFont.GetSize();
- 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 << (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 << rFont.IsOutline();
rOStm << rFont.IsShadow();
rOStm << rFont.IsTransparent();
@@ -302,9 +302,9 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
// ------------------------------------------------------------------------
-void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
+void ImplWriteRasterOpAction( SvStream& rOStm, INT16 nRasterOp )
{
- rOStm << (sal_Int16) GDI_RASTEROP_ACTION << (sal_Int32) 6 << nRasterOp;
+ rOStm << (INT16) GDI_RASTEROP_ACTION << (INT32) 6 << nRasterOp;
}
// ------------------------------------------------------------------------
@@ -314,8 +314,8 @@ sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const String& rString )
xub_StrLen i, nStringLen = rString.Len();
if ( nStringLen )
{
- sal_uInt32 nSize = ( nStringLen << 1 ) + 4;
- sal_uInt16 nType = GDI_UNICODE_COMMENT;
+ sal_uInt32 nSize = ( nStringLen << 1 ) + 4;
+ sal_uInt16 nType = GDI_UNICODE_COMMENT;
rOStm << nType << nSize;
for ( i = 0; i < nStringLen; i++ )
@@ -334,12 +334,12 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, String& rStri
sal_uInt32 nOld = rIStm.Tell();
if ( nStrmPos )
{
- sal_uInt16 nType;
- sal_uInt32 nActionSize;
+ sal_uInt16 nType;
+ sal_uInt32 nActionSize;
xub_StrLen nStringLen;
-
+
rIStm.Seek( nStrmPos );
- rIStm >> nType
+ rIStm >> nType
>> nActionSize;
nStringLen = sal::static_int_cast<xub_StrLen>(( nActionSize - 4 ) >> 1);
@@ -356,12 +356,12 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, String& rStri
// ------------------------------------------------------------------------
-void ImplSkipActions( SvStream& rIStm, sal_uLong nSkipCount )
+void ImplSkipActions( SvStream& rIStm, ULONG nSkipCount )
{
- sal_Int32 nActionSize;
- sal_Int16 nType;
+ INT32 nActionSize;
+ INT16 nType;
- for( sal_uLong i = 0UL; i < nSkipCount; i++ )
+ for( ULONG i = 0UL; i < nSkipCount; i++ )
{
rIStm >> nType >> nActionSize;
rIStm.SeekRel( nActionSize - 4L );
@@ -400,15 +400,15 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if((bOnlyWhenCurve && nAllFlagCount) || (!bOnlyWhenCurve && nAllPointCount))
{
- rOStm << (sal_Int16) GDI_EXTENDEDPOLYGON_ACTION;
-
+ rOStm << (INT16) GDI_EXTENDEDPOLYGON_ACTION;
+
const sal_Int32 nActionSize(
- 4 + // Action size
- 2 + // PolygonCount
- (nAllPolygonCount * 2) + // Points per polygon
- (nAllPointCount << 3) + // Points themselves
- nAllPolygonCount + // Bool if (when poly has points) it has flags, too
- nAllFlagCount); // Flags themselves
+ 4 + // Action size
+ 2 + // PolygonCount
+ (nAllPolygonCount * 2) + // Points per polygon
+ (nAllPointCount << 3) + // Points themselves
+ nAllPolygonCount + // Bool if (when poly has points) it has flags, too
+ nAllFlagCount); // Flags themselves
rOStm << nActionSize;
rOStm << (sal_uInt16)nAllPolygonCount;
@@ -429,16 +429,16 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if(rCandidate.HasFlags())
{
- rOStm << (sal_uInt8)true;
+ rOStm << (BYTE)true;
for(sal_uInt16 c(0); c < nPointCount; c++)
{
- rOStm << (sal_uInt8)rCandidate.GetFlags(c);
+ rOStm << (BYTE)rCandidate.GetFlags(c);
}
}
else
{
- rOStm << (sal_uInt8)false;
+ rOStm << (BYTE)false;
}
}
}
@@ -471,12 +471,12 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly)
rIStm >> aCandidate[b];
}
- sal_uInt8 bHasFlags(false);
+ BYTE bHasFlags(false);
rIStm >> bHasFlags;
if(bHasFlags)
{
- sal_uInt8 aPolyFlags(0);
+ BYTE 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, sal_uLong nConvertMode )
+SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMode )
{
if( !rStm.GetError() )
{
@@ -509,26 +509,26 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, sal_uLong nConver
void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
- const sal_uLong nPos = rIStm.Tell();
- const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ const ULONG nPos = rIStm.Tell();
+ const USHORT nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- char aCode[ 5 ];
- Size aPrefSz;
- sal_Int16 nSize;
- sal_Int16 nVersion;
+ char aCode[ 5 ];
+ Size aPrefSz;
+ INT16 nSize;
+ INT16 nVersion;
// read header
- rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung
- rIStm >> nSize; // Size
- rIStm >> nVersion; // Version
- rIStm >> aPrefSz.Width(); // PrefSize.Width()
- rIStm >> aPrefSz.Height(); // PrefSize.Height()
+ rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung
+ rIStm >> nSize; // Size
+ rIStm >> nVersion; // Version
+ rIStm >> aPrefSz.Width(); // PrefSize.Width()
+ rIStm >> aPrefSz.Height(); // PrefSize.Height()
// check header-magic and version
if( rIStm.GetError()
- || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 )
+ || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 )
|| ( nVersion != 200 ) )
{
rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
@@ -537,37 +537,37 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
return;
}
- LineInfo aLineInfo( LINE_NONE, 0 );
- Stack aLIStack;
- VirtualDevice aFontVDev;
- rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
- sal_Bool bFatLine = sal_False;
+ LineInfo aLineInfo( LINE_NONE, 0 );
+ Stack aLIStack;
+ VirtualDevice aFontVDev;
+ rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
+ BOOL bFatLine = FALSE;
// TODO: fix reindentation below if you can accept being blamed by the SCM
MapMode aMapMode;
- Polygon aActionPoly;
- Rectangle aRect;
- Point aPt, aPt1;
- Size aSz;
- Color aActionColor;
- sal_Int32 nTmp, nTmp1, nActionSize;
- sal_Int32 nActions;
- sal_Int16 nType;
+ Polygon aActionPoly;
+ Rectangle aRect;
+ Point aPt, aPt1;
+ Size aSz;
+ Color aActionColor;
+ INT32 nTmp, nTmp1, nActionSize;
+ INT32 nActions;
+ INT16 nType;
- sal_uInt32 nUnicodeCommentStreamPos = 0;
- sal_Int32 nUnicodeCommentActionNumber = 0;
+ sal_uInt32 nUnicodeCommentStreamPos = 0;
+ INT32 nUnicodeCommentActionNumber = 0;
- ImplReadMapMode( rIStm, aMapMode ); // MapMode
- rIStm >> nActions; // Action count
+ ImplReadMapMode( rIStm, aMapMode ); // MapMode
+ rIStm >> nActions; // Action count
rMtf.SetPrefSize( aPrefSz );
rMtf.SetPrefMapMode( aMapMode );
sal_uInt32 nLastPolygonAction(0);
- for( sal_Int32 i = 0L; i < nActions; i++ )
+ for( INT32 i = 0L; i < nActions; i++ )
{
rIStm >> nType;
- sal_Int32 nActBegin = rIStm.Tell();
+ sal_Int32 nActBegin = rIStm.Tell();
rIStm >> nActionSize;
DBG_ASSERT( ( nType <= 33 ) || ( nType >= 1024 ), "Unknown GDIMetaAction while converting!" );
@@ -598,7 +598,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case (GDI_LINEJOIN_ACTION) :
{
- sal_Int16 nLineJoin(0);
+ 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) :
{
- sal_Int16 a(0);
- sal_Int32 b(0);
+ INT16 a(0);
+ INT32 b(0);
rIStm >> a; aLineInfo.SetDashCount(a);
rIStm >> b; aLineInfo.SetDashLen(b);
@@ -644,7 +644,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
rMtf.ReplaceAction(
new MetaPolyLineAction(
- aInputPolyPolygon.GetObject(0),
+ aInputPolyPolygon.GetObject(0),
pPolyLineAction->GetLineInfo()),
nLastPolygonAction);
pPolyLineAction->Delete();
@@ -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, sal_False ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 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, sal_False ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 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, sal_False ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 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, sal_False ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 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, sal_False ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
rMtf.AddAction( new MetaPopAction() );
- for( sal_uInt16 nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
+ for( USHORT nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
rMtf.AddAction( new MetaPolyLineAction( aPolyPoly[ nPoly ], aLineInfo ) );
}
else
@@ -834,12 +834,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_FONT_ACTION ):
{
- Font aFont;
- char aName[ 32 ];
- sal_Int32 nWidth, nHeight;
- sal_Int16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
- sal_Int16 nCharOrient, nLineOrient;
- sal_Bool bItalic, bOutline, bShadow, bTransparent;
+ Font aFont;
+ char aName[ 32 ];
+ INT32 nWidth, nHeight;
+ INT16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
+ INT16 nCharOrient, nLineOrient;
+ BOOL bItalic, bOutline, bShadow, bTransparent;
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
@@ -868,7 +868,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
eActualCharSet = aFont.GetCharSet();
if ( eActualCharSet == RTL_TEXTENCODING_DONTKNOW )
eActualCharSet = gsl_getSystemTextEncoding();
-
+
rMtf.AddAction( new MetaFontAction( aFont ) );
rMtf.AddAction( new MetaTextAlignAction( aFont.GetAlign() ) );
rMtf.AddAction( new MetaTextColorAction( aFont.GetColor() ) );
@@ -881,17 +881,17 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXT_ACTION ):
{
- ByteString aByteStr;
- sal_Int32 nIndex, nLen;
-
+ ByteString aByteStr;
+ INT32 nIndex, nLen;
+
rIStm >> aPt >> nIndex >> nLen >> nTmp;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextAction( aPt, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
+ rMtf.AddAction( new MetaTextAction( aPt, aStr, (USHORT) nIndex, (USHORT) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -899,19 +899,19 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXTARRAY_ACTION ):
{
- ByteString aByteStr;
- sal_Int32* pDXAry = NULL;
- sal_Int32 nIndex, nLen, nAryLen;
+ ByteString aByteStr;
+ sal_Int32* pDXAry = NULL;
+ 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( (sal_uInt16)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if( nAryLen > 0L )
{
- sal_Int32 nStrLen( aStr.Len() );
+ INT32 nStrLen( aStr.Len() );
pDXAry = new sal_Int32[ Max( nAryLen, nStrLen ) ];
@@ -925,8 +925,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
sal_Int32* pTmpAry = new sal_Int32[nStrLen];
- aFontVDev.GetTextArray( aStr, pTmpAry, (sal_uInt16) nIndex, (sal_uInt16) nLen );
-
+ aFontVDev.GetTextArray( aStr, pTmpAry, (USHORT) nIndex, (USHORT) nLen );
+
// now, the difference between the
// last and the second last DX array
// is the advancement for the last
@@ -943,13 +943,13 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
}
#ifdef DBG_UTIL
else
- OSL_FAIL("More than one DX array element missing on SVM import");
+ DBG_ERROR("More than one DX array element missing on SVM import");
#endif
}
}
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
+ rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (USHORT) nIndex, (USHORT) nLen ) );
if( pDXAry )
delete[] pDXAry;
@@ -960,17 +960,17 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_STRETCHTEXT_ACTION ):
{
- ByteString aByteStr;
- sal_Int32 nIndex, nLen, nWidth;
+ ByteString aByteStr;
+ 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( (sal_uInt16)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
+ rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (USHORT) nIndex, (USHORT) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -996,8 +996,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_BITMAPSCALEPART_ACTION ):
{
- Bitmap aBmp;
- Size aSz2;
+ Bitmap aBmp;
+ Size aSz2;
rIStm >> aPt >> aSz >> aPt1 >> aSz2 >> aBmp;
rMtf.AddAction( new MetaBmpScalePartAction( aPt, aSz, aPt1, aSz2, aBmp ) );
@@ -1006,8 +1006,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_PEN_ACTION ):
{
- sal_Int32 nPenWidth;
- sal_Int16 nPenStyle;
+ INT32 nPenWidth;
+ INT16 nPenStyle;
ImplReadColor( rIStm, aActionColor );
rIStm >> nPenWidth >> nPenStyle;
@@ -1022,7 +1022,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_FILLBRUSH_ACTION ):
{
- sal_Int16 nBrushStyle;
+ INT16 nBrushStyle;
ImplReadColor( rIStm, aActionColor );
rIStm.SeekRel( 6L );
@@ -1044,10 +1044,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_CLIPREGION_ACTION ):
{
- Region aRegion;
- sal_Int16 nRegType;
- sal_Int16 bIntersect;
- sal_Bool bClip = sal_False;
+ Region aRegion;
+ INT16 nRegType;
+ INT16 bIntersect;
+ BOOL bClip = 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 = sal_True;
+ bClip = TRUE;
}
break;
@@ -1071,25 +1071,25 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ImplReadPoly( rIStm, aActionPoly );
aRegion = Region( aActionPoly );
- bClip = sal_True;
+ bClip = TRUE;
}
break;
case( 3 ):
{
PolyPolygon aPolyPoly;
- sal_Int32 nPolyCount;
+ INT32 nPolyCount;
rIStm >> nPolyCount;
- for( sal_uInt16 j = 0; j < (sal_uInt16) nPolyCount; j++ )
+ for( USHORT j = 0; j < (USHORT) nPolyCount; j++ )
{
ImplReadPoly( rIStm, aActionPoly );
aPolyPoly.Insert( aActionPoly );
}
aRegion = Region( aPolyPoly );
- bClip = sal_True;
+ bClip = TRUE;
}
break;
}
@@ -1117,8 +1117,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_RASTEROP_ACTION ):
{
- RasterOp eRasterOp;
- sal_Int16 nRasterOp;
+ RasterOp eRasterOp;
+ INT16 nRasterOp;
rIStm >> nRasterOp;
@@ -1174,15 +1174,15 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_GRADIENT_ACTION ):
{
- Color aStartCol;
- Color aEndCol;
- sal_Int16 nStyle;
- sal_Int16 nAngle;
- sal_Int16 nBorder;
- sal_Int16 nOfsX;
- sal_Int16 nOfsY;
- sal_Int16 nIntensityStart;
- sal_Int16 nIntensityEnd;
+ Color aStartCol;
+ Color aEndCol;
+ INT16 nStyle;
+ INT16 nAngle;
+ INT16 nBorder;
+ INT16 nOfsX;
+ INT16 nOfsY;
+ INT16 nIntensityStart;
+ INT16 nIntensityEnd;
ImplReadRect( rIStm, aRect );
rIStm >> nStyle;
@@ -1205,8 +1205,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TRANSPARENT_COMMENT ):
{
PolyPolygon aPolyPoly;
- sal_Int32 nFollowingActionCount;
- sal_Int16 nTrans;
+ INT32 nFollowingActionCount;
+ INT16 nTrans;
rIStm >> aPolyPoly >> nTrans >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1221,10 +1221,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_FLOATTRANSPARENT_COMMENT ):
{
GDIMetaFile aMtf;
- Point aPos;
- Size aSize;
- Gradient aGradient;
- sal_Int32 nFollowingActionCount;
+ Point aPos;
+ Size aSize;
+ Gradient aGradient;
+ INT32 nFollowingActionCount;
rIStm >> aMtf >> aPos >> aSize >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1239,8 +1239,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_HATCH_COMMENT ):
{
PolyPolygon aPolyPoly;
- Hatch aHatch;
- sal_Int32 nFollowingActionCount;
+ Hatch aHatch;
+ INT32 nFollowingActionCount;
rIStm >> aPolyPoly >> aHatch >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1254,9 +1254,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_REFPOINT_COMMENT ):
{
- Point aRefPoint;
- sal_Bool bSet;
- sal_Int32 nFollowingActionCount;
+ Point aRefPoint;
+ BOOL bSet;
+ INT32 nFollowingActionCount;
rIStm >> aRefPoint >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1276,9 +1276,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXTLINECOLOR_COMMENT ):
{
- Color aColor;
- sal_Bool bSet;
- sal_Int32 nFollowingActionCount;
+ Color aColor;
+ BOOL bSet;
+ INT32 nFollowingActionCount;
rIStm >> aColor >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1292,11 +1292,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXTLINE_COMMENT ):
{
- Point aStartPt;
- long nWidth;
+ Point aStartPt;
+ long nWidth;
sal_uInt32 nStrikeout;
sal_uInt32 nUnderline;
- sal_Int32 nFollowingActionCount;
+ INT32 nFollowingActionCount;
rIStm >> aStartPt >> nWidth >> nStrikeout >> nUnderline >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1314,8 +1314,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_GRADIENTEX_COMMENT ):
{
PolyPolygon aPolyPoly;
- Gradient aGradient;
- sal_Int32 nFollowingActionCount;
+ Gradient aGradient;
+ INT32 nFollowingActionCount;
rIStm >> aPolyPoly >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1329,17 +1329,17 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_COMMENT_COMMENT ):
{
- ByteString aComment;
- sal_Int32 nValue;
- sal_uInt32 nDataSize;
- sal_uInt8* pData;
- sal_Int32 nFollowingActionCount;
+ ByteString aComment;
+ sal_Int32 nValue;
+ sal_uInt32 nDataSize;
+ BYTE* pData;
+ INT32 nFollowingActionCount;
rIStm >> aComment >> nValue >> nDataSize;
if( nDataSize )
{
- pData = new sal_uInt8[ nDataSize ];
+ pData = new BYTE[ nDataSize ];
rIStm.Read( pData, nDataSize );
}
else
@@ -1380,32 +1380,34 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
{
- sal_uLong nCountPos;
- Font aSaveFont;
- const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
- rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
- const Size aPrefSize( rMtf.GetPrefSize() );
- sal_Bool bRop_0_1 = sal_False;
- VirtualDevice aSaveVDev;
- Color aLineCol( COL_BLACK );
- Stack aLineColStack;
+ ULONG nPos;
+ ULONG nCountPos;
+ Font aSaveFont;
+ const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
+ const Size aPrefSize( rMtf.GetPrefSize() );
+ BOOL bRop_0_1 = FALSE;
+ VirtualDevice aSaveVDev;
+ Color aLineCol( COL_BLACK );
+ Stack aLineColStack;
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
//MagicCode schreiben
rOStm << "SVGDI"; // Kennung
- rOStm << (sal_Int16) 42; // HeaderSize
- rOStm << (sal_Int16) 200; // VERSION
- rOStm << (sal_Int32) aPrefSize.Width();
- rOStm << (sal_Int32) aPrefSize.Height();
+ nPos = rOStm.Tell();
+ rOStm << (INT16) 42; // HeaderSize
+ rOStm << (INT16) 200; // VERSION
+ rOStm << (INT32) aPrefSize.Width();
+ rOStm << (INT32) aPrefSize.Height();
ImplWriteMapMode( rOStm, rMtf.GetPrefMapMode() );
// ActionCount wird spaeter geschrieben
nCountPos = rOStm.Tell();
rOStm.SeekRel( 4L );
- const sal_Int32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
- const sal_uLong nActPos = rOStm.Tell();
+ const INT32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
+ const ULONG nActPos = rOStm.Tell();
rOStm.Seek( nCountPos );
rOStm << nActCount;
@@ -1419,13 +1421,13 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
+ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, BOOL& rRop_0_1,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet )
{
- sal_uLong nCount = 0;
- for( sal_uLong i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
+ ULONG nCount = 0;
+ for( ULONG i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
@@ -1435,8 +1437,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
- rOStm << (sal_Int16) GDI_PIXEL_ACTION;
- rOStm << (sal_Int32) 18;
+ rOStm << (INT16) GDI_PIXEL_ACTION;
+ rOStm << (INT32) 18;
rOStm << pAct->GetPoint();
ImplWriteColor( rOStm, pAct->GetColor() );
nCount++;
@@ -1447,8 +1449,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPointAction* pAct = (MetaPointAction*) pAction;
- rOStm << (sal_Int16) GDI_POINT_ACTION;
- rOStm << (sal_Int32) 12;
+ rOStm << (INT16) GDI_POINT_ACTION;
+ rOStm << (INT32) 12;
rOStm << pAct->GetPoint();
nCount++;
}
@@ -1469,25 +1471,25 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
- rOStm << (sal_Int32) 6;
- rOStm << (sal_Int16) rInfo.GetLineJoin();
+ rOStm << (INT16) GDI_LINEJOIN_ACTION;
+ rOStm << (INT32) 6;
+ rOStm << (INT16) rInfo.GetLineJoin();
}
if(bLineDashDot)
{
- 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_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_LINE_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_LINE_ACTION;
+ rOStm << (INT32) 20;
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
nCount++;
@@ -1496,12 +1498,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
ImplWritePopAction( rOStm );
nCount += 3;
-
+
if(bLineJoin)
{
nCount += 1;
}
-
+
if(bLineDashDot)
{
nCount += 1;
@@ -1514,11 +1516,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRectAction* pAct = (MetaRectAction*) pAction;
- rOStm << (sal_Int16) GDI_RECT_ACTION;
- rOStm << (sal_Int32) 28;
+ rOStm << (INT16) GDI_RECT_ACTION;
+ rOStm << (INT32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (sal_Int32) 0;
- rOStm << (sal_Int32) 0;
+ rOStm << (INT32) 0;
+ rOStm << (INT32) 0;
nCount++;
}
break;
@@ -1527,11 +1529,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
- rOStm << (sal_Int16) GDI_RECT_ACTION;
- rOStm << (sal_Int32) 28;
+ rOStm << (INT16) GDI_RECT_ACTION;
+ rOStm << (INT32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (sal_Int32) pAct->GetHorzRound();
- rOStm << (sal_Int32) pAct->GetVertRound();
+ rOStm << (INT32) pAct->GetHorzRound();
+ rOStm << (INT32) pAct->GetVertRound();
nCount++;
}
break;
@@ -1540,8 +1542,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
- rOStm << (sal_Int16) GDI_ELLIPSE_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_ELLIPSE_ACTION;
+ rOStm << (INT32) 20;
ImplWriteRect( rOStm, pAct->GetRect() );
nCount++;
}
@@ -1551,8 +1553,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaArcAction* pAct = (MetaArcAction*) pAction;
- rOStm << (sal_Int16) GDI_ARC_ACTION;
- rOStm << (sal_Int32) 36;
+ rOStm << (INT16) GDI_ARC_ACTION;
+ rOStm << (INT32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1564,8 +1566,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPieAction* pAct = (MetaPieAction*) pAction;
- rOStm << (sal_Int16) GDI_PIE_ACTION;
- rOStm << (sal_Int32) 36;
+ rOStm << (INT16) GDI_PIE_ACTION;
+ rOStm << (INT32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1575,16 +1577,16 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_CHORD_ACTION ):
{
- MetaChordAction* pAct = (MetaChordAction*) pAction;
- Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(),
+ MetaChordAction* pAct = (MetaChordAction*) pAction;
+ Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(),
pAct->GetEndPoint(), POLY_CHORD );
- const sal_uInt16 nPoints = aChordPoly.GetSize();
+ const USHORT nPoints = aChordPoly.GetSize();
- rOStm << (sal_Int16) GDI_POLYGON_ACTION;
- rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
- rOStm << (sal_Int32) nPoints;
+ rOStm << (INT16) GDI_POLYGON_ACTION;
+ rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (INT32) nPoints;
- for( sal_uInt16 n = 0; n < nPoints; n++ )
+ for( USHORT n = 0; n < nPoints; n++ )
rOStm << aChordPoly[ n ];
nCount++;
}
@@ -1600,7 +1602,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
const LineInfo& rInfo = pAct->GetLineInfo();
- const sal_uInt16 nPoints(aSimplePoly.GetSize());
+ const USHORT 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 +1614,28 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
- rOStm << (sal_Int32) 6;
- rOStm << (sal_Int16) rInfo.GetLineJoin();
+ rOStm << (INT16) GDI_LINEJOIN_ACTION;
+ rOStm << (INT32) 6;
+ rOStm << (INT16) rInfo.GetLineJoin();
}
}
if(bLineDashDot)
{
- 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_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_POLYLINE_ACTION;
- rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
- rOStm << (sal_Int32) nPoints;
+ rOStm << (INT16) GDI_POLYLINE_ACTION;
+ rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (INT32) nPoints;
- for( sal_uInt16 n = 0; n < nPoints; n++ )
+ for( USHORT n = 0; n < nPoints; n++ )
{
rOStm << aSimplePoly[ n ];
}
@@ -1650,13 +1652,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
ImplWritePopAction( rOStm );
nCount += 3;
-
+
if(bLineJoin)
{
nCount += 1;
}
}
-
+
if(bLineDashDot)
{
nCount += 1;
@@ -1672,17 +1674,17 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// a polygon representing the curve as good as possible
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
- const sal_uInt16 nPoints(aSimplePoly.GetSize());
+ const USHORT nPoints(aSimplePoly.GetSize());
- rOStm << (sal_Int16) GDI_POLYGON_ACTION;
- rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
- rOStm << (sal_Int32) nPoints;
+ rOStm << (INT16) GDI_POLYGON_ACTION;
+ rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (INT32) nPoints;
- for( sal_uInt16 n = 0; n < nPoints; n++ )
+ for( USHORT n = 0; n < nPoints; n++ )
rOStm << aSimplePoly[ n ];
nCount++;
-
+
const PolyPolygon aPolyPolygon(pAct->GetPolygon());
if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon, true))
{
@@ -1696,7 +1698,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction;
ImplWritePolyPolyAction( rOStm, pAct->GetPolyPolygon() );
nCount++;
-
+
if(ImplWriteExtendedPolyPolygonAction(rOStm, pAct->GetPolyPolygon(), true))
{
nCount++;
@@ -1707,19 +1709,19 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXT_ACTION ):
{
MetaTextAction* pAct = (MetaTextAction*) pAction;
- String aUniText( pAct->GetText() );
- ByteString aText( aUniText, rActualCharSet );
- const sal_uLong nStrLen = aText.Len();
+ String aUniText( pAct->GetText() );
+ ByteString aText( aUniText, rActualCharSet );
+ const ULONG nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (sal_Int16) GDI_TEXT_ACTION;
- rOStm << (sal_Int32) ( 24 + ( nStrLen + 1 ) );
+ rOStm << (INT16) GDI_TEXT_ACTION;
+ rOStm << (INT32) ( 24 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (sal_Int32) pAct->GetIndex();
- rOStm << (sal_Int32) pAct->GetLen();
- rOStm << (sal_Int32) nStrLen;
+ rOStm << (INT32) pAct->GetIndex();
+ rOStm << (INT32) pAct->GetLen();
+ rOStm << (INT32) nStrLen;
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1727,13 +1729,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXTARRAY_ACTION ):
{
- MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction;
- ByteString aText( pAct->GetText(), rActualCharSet );
- String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() );
- sal_uLong nAryLen;
- sal_uLong nLen = pAct->GetLen();
- const sal_uLong nTextLen = aText.Len();
- sal_Int32* pDXArray = pAct->GetDXArray();
+ 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_Int32* pDXArray = pAct->GetDXArray();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
@@ -1749,19 +1751,19 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( !pDXArray || !nLen )
nAryLen = 0;
else
- nAryLen = nLen; // #105987# Write out all of DX array
+ nAryLen = nLen; // #105987# Write out all of DX array
- rOStm << (sal_Int16) GDI_TEXTARRAY_ACTION;
- rOStm << (sal_Int32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
+ rOStm << (INT16) GDI_TEXTARRAY_ACTION;
+ rOStm << (INT32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
rOStm << pAct->GetPoint();
- rOStm << (sal_Int32) 0;
- rOStm << (sal_Int32) nLen;
- rOStm << (sal_Int32) nLen;
- rOStm << (sal_Int32) nAryLen;
+ rOStm << (INT32) 0;
+ rOStm << (INT32) nLen;
+ rOStm << (INT32) nLen;
+ rOStm << (INT32) nAryLen;
rOStm.Write( aText.GetBuffer()+pAct->GetIndex(), nLen + 1 );
- for( sal_uLong n = 0UL ; n < nAryLen; n++ )
- rOStm << (sal_Int32) pDXArray[ n ];
+ for( ULONG n = 0UL ; n < nAryLen; n++ )
+ rOStm << (INT32) pDXArray[ n ];
nCount++;
}
@@ -1769,21 +1771,21 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_STRETCHTEXT_ACTION ):
{
- MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
- String aUniText( pAct->GetText() );
- ByteString aText( aUniText, rActualCharSet );
- const sal_uLong nStrLen = aText.Len();
+ MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
+ String aUniText( pAct->GetText() );
+ ByteString aText( aUniText, rActualCharSet );
+ const ULONG nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (sal_Int16) GDI_STRETCHTEXT_ACTION;
- rOStm << (sal_Int32) ( 28 + ( nStrLen + 1 ) );
+ rOStm << (INT16) GDI_STRETCHTEXT_ACTION;
+ rOStm << (INT32) ( 28 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (sal_Int32) pAct->GetIndex();
- rOStm << (sal_Int32) pAct->GetLen();
- rOStm << (sal_Int32) nStrLen;
- rOStm << (sal_Int32) pAct->GetWidth();
+ rOStm << (INT32) pAct->GetIndex();
+ rOStm << (INT32) pAct->GetLen();
+ rOStm << (INT32) nStrLen;
+ rOStm << (INT32) pAct->GetWidth();
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1793,8 +1795,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
- rOStm << (sal_Int16) GDI_BITMAP_ACTION;
- rOStm << (sal_Int32) 12;
+ rOStm << (INT16) GDI_BITMAP_ACTION;
+ rOStm << (INT32) 12;
rOStm << pAct->GetPoint();
rOStm << pAct->GetBitmap();
nCount++;
@@ -1805,8 +1807,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
- rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (INT32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << pAct->GetBitmap();
@@ -1818,8 +1820,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
- rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (sal_Int32) 36;
+ rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (INT32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1831,11 +1833,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_BMPEX_ACTION ):
{
- MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
- const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
+ MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
+ const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (sal_Int16) GDI_BITMAP_ACTION;
- rOStm << (sal_Int32) 12;
+ rOStm << (INT16) GDI_BITMAP_ACTION;
+ rOStm << (INT32) 12;
rOStm << pAct->GetPoint();
rOStm << aBmp;
nCount++;
@@ -1844,11 +1846,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_BMPEXSCALE_ACTION ):
{
- MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
- const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
+ MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
+ const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (INT32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << aBmp;
@@ -1859,10 +1861,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_BMPEXSCALEPART_ACTION ):
{
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
- const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
+ const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (sal_Int32) 36;
+ rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (INT32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1875,20 +1877,20 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_GRADIENT_ACTION ):
{
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
- const Gradient& rGrad = pAct->GetGradient();
+ const Gradient& rGrad = pAct->GetGradient();
- rOStm << (sal_Int16) GDI_GRADIENT_ACTION;
- rOStm << (sal_Int32) 46;
+ rOStm << (INT16) GDI_GRADIENT_ACTION;
+ rOStm << (INT32) 46;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (sal_Int16) rGrad.GetStyle();
+ rOStm << (INT16) rGrad.GetStyle();
ImplWriteColor( rOStm, rGrad.GetStartColor() );
ImplWriteColor( rOStm, rGrad.GetEndColor() );
- 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();
+ rOStm << (INT16) rGrad.GetAngle();
+ rOStm << (INT16) rGrad.GetBorder();
+ rOStm << (INT16) rGrad.GetOfsX();
+ rOStm << (INT16) rGrad.GetOfsY();
+ rOStm << (INT16) rGrad.GetStartIntensity();
+ rOStm << (INT16) rGrad.GetEndIntensity();
nCount++;
}
break;
@@ -1896,10 +1898,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_GRADIENTEX_ACTION ):
{
const MetaGradientExAction* pA = (MetaGradientExAction*) pAction;
- sal_uLong nOldPos, nNewPos;
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_GRADIENTEX_COMMENT;
+ rOStm << (INT16) GDI_GRADIENTEX_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -1907,12 +1909,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << pA->GetPolyPolygon() << pA->GetGradient();
- rOStm << (sal_Int32) 0; // number of actions that follow this comment
+ rOStm << (INT32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -1921,18 +1923,18 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_WALLPAPER_ACTION ):
{
- MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
- const Color& rColor = pAct->GetWallpaper().GetColor();
+ MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
+ const Color& rColor = pAct->GetWallpaper().GetColor();
ImplWritePushAction( rOStm );
ImplWriteLineColor( rOStm, rColor, 1 );
ImplWriteFillColor( rOStm, rColor, 1 );
- rOStm << (sal_Int16) GDI_RECT_ACTION;
- rOStm << (sal_Int32) 28;
+ rOStm << (INT16) GDI_RECT_ACTION;
+ rOStm << (INT32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (sal_Int32) 0;
- rOStm << (sal_Int32) 0;
+ rOStm << (INT32) 0;
+ rOStm << (INT32) 0;
ImplWritePopAction( rOStm );
nCount += 5;
@@ -1941,22 +1943,22 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_CLIPREGION_ACTION ):
{
- MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
- const Region& rRegion = pAct->GetRegion();
- Rectangle aClipRect;
+ MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
+ const Region& rRegion = pAct->GetRegion();
+ Rectangle aClipRect;
- rOStm << (sal_Int16) GDI_CLIPREGION_ACTION;
- rOStm << (sal_Int32) 24;
+ rOStm << (INT16) GDI_CLIPREGION_ACTION;
+ rOStm << (INT32) 24;
if( pAct->IsClipping() )
{
aClipRect = rRegion.GetBoundRect();
- rOStm << (sal_Int16) 1;
+ rOStm << (INT16) 1;
}
else
- rOStm << (sal_Int16) 0;
+ rOStm << (INT16) 0;
- rOStm << (sal_Int16) 0;
+ rOStm << (INT16) 0;
ImplWriteRect( rOStm, aClipRect );
if( pAct->IsClipping() )
@@ -1970,8 +1972,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
- rOStm << (sal_Int16) GDI_ISECTCLIPREGION_ACTION;
- rOStm << (sal_Int32) 20;
+ rOStm << (INT16) GDI_ISECTCLIPREGION_ACTION;
+ rOStm << (INT32) 20;
rOStm << pAct->GetRect();
nCount++;
}
@@ -1981,10 +1983,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
- rOStm << (sal_Int16) GDI_MOVECLIPREGION_ACTION;
- rOStm << (sal_Int32) 12;
- rOStm << (sal_Int32) pAct->GetHorzMove();
- rOStm << (sal_Int32) pAct->GetVertMove();
+ rOStm << (INT16) GDI_MOVECLIPREGION_ACTION;
+ rOStm << (INT32) 12;
+ rOStm << (INT32) pAct->GetHorzMove();
+ rOStm << (INT32) pAct->GetVertMove();
nCount++;
}
break;
@@ -2026,8 +2028,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXTFILLCOLOR_ACTION ):
{
- MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction;
- Font aSaveFont( rSaveVDev.GetFont() );
+ MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction;
+ Font aSaveFont( rSaveVDev.GetFont() );
if( pAct->IsSetting() )
aSaveFont.SetFillColor( pAct->GetColor() );
@@ -2055,8 +2057,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMapModeAction* pAct = (MetaMapModeAction*) pAction;
- rOStm << (sal_Int16) GDI_MAPMODE_ACTION;
- rOStm << (sal_Int32) 30;
+ rOStm << (INT16) GDI_MAPMODE_ACTION;
+ rOStm << (INT32) 30;
ImplWriteMapMode( rOStm, pAct->GetMapMode() );
nCount++;
}
@@ -2093,7 +2095,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( ( pAct->GetRasterOp() != ROP_0 ) && ( pAct->GetRasterOp() != ROP_1 ) )
{
- sal_Int16 nRasterOp;
+ INT16 nRasterOp;
// Falls vorher ROP_0/1 gesetzt war, alten
// Zustand durch Pop erst wieder herstellen
@@ -2101,16 +2103,16 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
ImplWritePopAction( rOStm );
rSaveVDev.Pop();
- rRop_0_1 = sal_False;
+ rRop_0_1 = FALSE;
nCount++;
}
switch( pAct->GetRasterOp() )
{
case( ROP_OVERPAINT ) : nRasterOp = 0; break;
- case( ROP_XOR ) : nRasterOp = 4; break;
- case( ROP_INVERT ): nRasterOp = 1; break;
- default: nRasterOp = 0; break;
+ case( ROP_XOR ) : nRasterOp = 4; break;
+ case( ROP_INVERT ): nRasterOp = 1; break;
+ default: nRasterOp = 0; break;
}
ImplWriteRasterOpAction( rOStm, nRasterOp );
@@ -2133,7 +2135,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
}
ImplWriteRasterOpAction( rOStm, 0 );
- rRop_0_1 = sal_True;
+ rRop_0_1 = TRUE;
nCount += 4;
}
}
@@ -2141,13 +2143,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TRANSPARENT_ACTION ):
{
- const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon();
- const sal_Int16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence();
- const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
- sal_uLong nOldPos, nNewPos;
+ 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;
// write transparence comment
- rOStm << (sal_Int16) GDI_TRANSPARENT_COMMENT;
+ rOStm << (INT16) GDI_TRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2156,12 +2158,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write comment data
rOStm << rPolyPoly;
rOStm << nTrans;
- rOStm << (sal_Int32) 15; // number of actions that follow this comment
+ rOStm << (INT32) 15; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
{
@@ -2202,15 +2204,15 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_FLOATTRANSPARENT_ACTION ):
{
- const MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) pAction;
- const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile();
- const Point& rPos = pA->GetPoint();
- const Size& rSize = pA->GetSize();
- const Gradient& rGradient = pA->GetGradient();
- sal_uLong nOldPos, nNewPos;
+ const MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) pAction;
+ const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile();
+ const Point& rPos = pA->GetPoint();
+ const Size& rSize = pA->GetSize();
+ const Gradient& rGradient = pA->GetGradient();
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_FLOATTRANSPARENT_COMMENT;
+ rOStm << (INT16) GDI_FLOATTRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2222,18 +2224,18 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
+ rOStm << (INT32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
// write actions for float transparence
- sal_uLong nAddCount;
- GDIMetaFile aMtf( rTransMtf );
- const Size aSrcSize( rTransMtf.GetPrefSize() );
- Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() );
- const double fScaleX = aSrcSize.Width() ? (double) rSize.Width() / aSrcSize.Width() : 1.0;
- const double fScaleY = aSrcSize.Height() ? (double) rSize.Height() / aSrcSize.Height() : 1.0;
- long nMoveX, nMoveY;
+ ULONG nAddCount;
+ GDIMetaFile aMtf( rTransMtf );
+ const Size aSrcSize( rTransMtf.GetPrefSize() );
+ Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() );
+ const double fScaleX = aSrcSize.Width() ? (double) rSize.Width() / aSrcSize.Width() : 1.0;
+ const double fScaleY = aSrcSize.Height() ? (double) rSize.Height() / aSrcSize.Height() : 1.0;
+ long nMoveX, nMoveY;
if( fScaleX != 1.0 || fScaleY != 1.0 )
{
@@ -2249,7 +2251,7 @@ sal_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 << (sal_Int32) nAddCount;
+ rOStm << (INT32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2263,13 +2265,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_HATCH_ACTION ):
{
- const MetaHatchAction* pA = (MetaHatchAction*) pAction;
- const PolyPolygon& rPolyPoly = pA->GetPolyPolygon();
- const Hatch& rHatch = pA->GetHatch();
- sal_uLong nOldPos, nNewPos, nAddCount;
+ const MetaHatchAction* pA = (MetaHatchAction*) pAction;
+ const PolyPolygon& rPolyPoly = pA->GetPolyPolygon();
+ const Hatch& rHatch = pA->GetHatch();
+ ULONG nOldPos, nNewPos, nAddCount;
// write hatch comment
- rOStm << (sal_Int16) GDI_HATCH_COMMENT;
+ rOStm << (INT16) GDI_HATCH_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2282,19 +2284,19 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
+ rOStm << (INT32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
// write actions for hatch
- VirtualDevice aVDev;
- GDIMetaFile aTmpMtf;
+ VirtualDevice aVDev;
+ GDIMetaFile aTmpMtf;
aVDev.AddHatchActions( rPolyPoly, rHatch, aTmpMtf );
nAddCount = ImplWriteActions( rOStm, aTmpMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) nAddCount;
+ rOStm << (INT32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2308,13 +2310,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_REFPOINT_ACTION ):
{
- const MetaRefPointAction* pA = (MetaRefPointAction*) pAction;
- const Point& rRefPoint = pA->GetRefPoint();
- const sal_Bool bSet = pA->IsSetting();
- sal_uLong nOldPos, nNewPos;
+ const MetaRefPointAction* pA = (MetaRefPointAction*) pAction;
+ const Point& rRefPoint = pA->GetRefPoint();
+ const BOOL bSet = pA->IsSetting();
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_REFPOINT_COMMENT;
+ rOStm << (INT16) GDI_REFPOINT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2322,12 +2324,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rRefPoint << bSet;
- rOStm << (sal_Int32) 0; // number of actions that follow this comment
+ rOStm << (INT32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2336,13 +2338,13 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXTLINECOLOR_ACTION ):
{
- const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction;
- const Color& rColor = pA->GetColor();
- const sal_Bool bSet = pA->IsSetting();
- sal_uLong nOldPos, nNewPos;
+ const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction;
+ const Color& rColor = pA->GetColor();
+ const BOOL bSet = pA->IsSetting();
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_TEXTLINECOLOR_COMMENT;
+ rOStm << (INT16) GDI_TEXTLINECOLOR_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2350,12 +2352,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rColor << bSet;
- rOStm << (sal_Int32) 0; // number of actions that follow this comment
+ rOStm << (INT32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2364,30 +2366,30 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TEXTLINE_ACTION ):
{
- const MetaTextLineAction* pA = (MetaTextLineAction*) pAction;
- const Point& rStartPt = pA->GetStartPoint();
- const long nWidth = pA->GetWidth();
- const FontStrikeout eStrikeout = pA->GetStrikeout();
- const FontUnderline eUnderline = pA->GetUnderline();
- sal_uLong nOldPos, nNewPos;
+ const MetaTextLineAction* pA = (MetaTextLineAction*) pAction;
+ const Point& rStartPt = pA->GetStartPoint();
+ const long nWidth = pA->GetWidth();
+ const FontStrikeout eStrikeout = pA->GetStrikeout();
+ const FontUnderline eUnderline = pA->GetUnderline();
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_TEXTLINE_COMMENT;
+ rOStm << (INT16) GDI_TEXTLINE_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
rOStm.SeekRel( 4 );
// write data
- rOStm << rStartPt << nWidth <<
- static_cast<sal_uInt32>(eStrikeout) <<
+ rOStm << rStartPt << nWidth <<
+ static_cast<sal_uInt32>(eStrikeout) <<
static_cast<sal_uInt32>(eUnderline);
- rOStm << (sal_Int32) 0; // number of actions that follow this comment
+ rOStm << (INT32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2399,12 +2401,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_COMMENT_ACTION ):
{
- const MetaCommentAction* pA = (MetaCommentAction*) pAction;
- const sal_uInt32 nDataSize = pA->GetDataSize();
- sal_uLong nOldPos, nNewPos;
+ const MetaCommentAction* pA = (MetaCommentAction*) pAction;
+ const sal_uInt32 nDataSize = pA->GetDataSize();
+ ULONG nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (sal_Int16) GDI_COMMENT_COMMENT;
+ rOStm << (INT16) GDI_COMMENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2416,12 +2418,12 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( nDataSize )
rOStm.Write( pA->GetData(), nDataSize );
- rOStm << (sal_Int32) 0; // number of actions that follow this comment
+ rOStm << (INT32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (sal_Int32) ( nNewPos - nOldPos );
+ rOStm << (INT32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2434,7 +2436,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
ByteString aStr( "Missing implementation for Action#: " );
aStr += ByteString::CreateFromInt32( pAction->GetType() );
aStr += '!';
- OSL_FAIL( aStr.GetBuffer() );
+ DBG_ERROR( aStr.GetBuffer() );
}
break;
#endif
diff --git a/vcl/source/gdi/extoutdevdata.cxx b/vcl/source/gdi/extoutdevdata.cxx
index 2b8ad0fb9ae6..20e057ba1442 100644
--- a/vcl/source/gdi/extoutdevdata.cxx
+++ b/vcl/source/gdi/extoutdevdata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 2a10563441fa..6e89a36376e7 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,29 +54,29 @@ Impl_Font::Impl_Font() :
maColor( COL_TRANSPARENT ),
maFillColor( COL_TRANSPARENT )
{
- mnRefCount = 1;
- meCharSet = RTL_TEXTENCODING_DONTKNOW;
- meLanguage = LANGUAGE_DONTKNOW;
- meCJKLanguage = LANGUAGE_DONTKNOW;
- meFamily = FAMILY_DONTKNOW;
- mePitch = PITCH_DONTKNOW;
- meAlign = ALIGN_TOP;
- meWeight = WEIGHT_DONTKNOW;
- meWidthType = WIDTH_DONTKNOW;
- meItalic = ITALIC_NONE;
- meUnderline = UNDERLINE_NONE;
- meOverline = UNDERLINE_NONE;
- meStrikeout = STRIKEOUT_NONE;
- meRelief = RELIEF_NONE;
- meEmphasisMark = EMPHASISMARK_NONE;
- mnOrientation = 0;
- mnKerning = 0;
- mbWordLine = false;
- mbOutline = false;
- mbShadow = false;
- mbVertical = false;
- mbTransparent = true;
- mbConfigLookup = false;
+ mnRefCount = 1;
+ meCharSet = RTL_TEXTENCODING_DONTKNOW;
+ meLanguage = LANGUAGE_DONTKNOW;
+ meCJKLanguage = LANGUAGE_DONTKNOW;
+ meFamily = FAMILY_DONTKNOW;
+ mePitch = PITCH_DONTKNOW;
+ meAlign = ALIGN_TOP;
+ meWeight = WEIGHT_DONTKNOW;
+ meWidthType = WIDTH_DONTKNOW;
+ meItalic = ITALIC_NONE;
+ meUnderline = UNDERLINE_NONE;
+ meOverline = UNDERLINE_NONE;
+ meStrikeout = STRIKEOUT_NONE;
+ meRelief = RELIEF_NONE;
+ meEmphasisMark = EMPHASISMARK_NONE;
+ mnOrientation = 0;
+ mnKerning = 0;
+ mbWordLine = false;
+ mbOutline = false;
+ mbShadow = false;
+ mbVertical = false;
+ mbTransparent = true;
+ mbConfigLookup = false;
}
// -----------------------------------------------------------------------
@@ -88,29 +88,29 @@ Impl_Font::Impl_Font( const Impl_Font& rImplFont )
maColor( rImplFont.maColor ),
maFillColor( rImplFont.maFillColor )
{
- mnRefCount = 1;
- meCharSet = rImplFont.meCharSet;
- meLanguage = rImplFont.meLanguage;
- meCJKLanguage = rImplFont.meCJKLanguage;
- meFamily = rImplFont.meFamily;
- mePitch = rImplFont.mePitch;
- meAlign = rImplFont.meAlign;
- meWeight = rImplFont.meWeight;
- meWidthType = rImplFont.meWidthType;
- meItalic = rImplFont.meItalic;
- meUnderline = rImplFont.meUnderline;
- meOverline = rImplFont.meOverline;
- meStrikeout = rImplFont.meStrikeout;
- meRelief = rImplFont.meRelief;
- meEmphasisMark = rImplFont.meEmphasisMark;
- mnOrientation = rImplFont.mnOrientation;
- mnKerning = rImplFont.mnKerning;
- mbWordLine = rImplFont.mbWordLine;
- mbOutline = rImplFont.mbOutline;
- mbShadow = rImplFont.mbShadow;
- mbVertical = rImplFont.mbVertical;
- mbTransparent = rImplFont.mbTransparent;
- mbConfigLookup = rImplFont.mbConfigLookup;
+ mnRefCount = 1;
+ meCharSet = rImplFont.meCharSet;
+ meLanguage = rImplFont.meLanguage;
+ meCJKLanguage = rImplFont.meCJKLanguage;
+ meFamily = rImplFont.meFamily;
+ mePitch = rImplFont.mePitch;
+ meAlign = rImplFont.meAlign;
+ meWeight = rImplFont.meWeight;
+ meWidthType = rImplFont.meWidthType;
+ meItalic = rImplFont.meItalic;
+ meUnderline = rImplFont.meUnderline;
+ meOverline = rImplFont.meOverline;
+ meStrikeout = rImplFont.meStrikeout;
+ meRelief = rImplFont.meRelief;
+ meEmphasisMark = rImplFont.meEmphasisMark;
+ mnOrientation = rImplFont.mnOrientation;
+ mnKerning = rImplFont.mnKerning;
+ mbWordLine = rImplFont.mbWordLine;
+ mbOutline = rImplFont.mbOutline;
+ mbShadow = rImplFont.mbShadow;
+ mbVertical = rImplFont.mbVertical;
+ mbTransparent = rImplFont.mbTransparent;
+ mbConfigLookup = rImplFont.mbConfigLookup;
}
// -----------------------------------------------------------------------
@@ -172,7 +172,7 @@ void Impl_Font::AskConfig()
String aShortName;
String aFamilyName;
- sal_uLong nType = 0;
+ ULONG nType = 0;
FontWeight eWeight = WEIGHT_DONTKNOW;
FontWidth eWidthType = WIDTH_DONTKNOW;
String aMapName = maFamilyName;
@@ -277,9 +277,9 @@ Font::Font( const String& rFamilyName, const Size& rSize )
{
DBG_CTOR( Font, NULL );
- mpImplFont = new Impl_Font;
+ mpImplFont = new Impl_Font;
mpImplFont->maFamilyName= rFamilyName;
- mpImplFont->maSize = rSize;
+ mpImplFont->maSize = rSize;
}
// -----------------------------------------------------------------------
@@ -288,10 +288,10 @@ Font::Font( const String& rFamilyName, const String& rStyleName, const Size& rSi
{
DBG_CTOR( Font, NULL );
- mpImplFont = new Impl_Font;
+ mpImplFont = new Impl_Font;
mpImplFont->maFamilyName= rFamilyName;
mpImplFont->maStyleName = rStyleName;
- mpImplFont->maSize = rSize;
+ mpImplFont->maSize = rSize;
}
// -----------------------------------------------------------------------
@@ -300,9 +300,9 @@ Font::Font( FontFamily eFamily, const Size& rSize )
{
DBG_CTOR( Font, NULL );
- mpImplFont = new Impl_Font;
- mpImplFont->meFamily = eFamily;
- mpImplFont->maSize = rSize;
+ mpImplFont = new Impl_Font;
+ mpImplFont->meFamily = eFamily;
+ mpImplFont->maSize = rSize;
}
// -----------------------------------------------------------------------
@@ -349,7 +349,7 @@ void Font::SetFillColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Font::SetTransparent( sal_Bool bTransparent )
+void Font::SetTransparent( BOOL bTransparent )
{
DBG_CHKTHIS( Font, NULL );
@@ -486,7 +486,7 @@ void Font::SetOrientation( short nOrientation )
// -----------------------------------------------------------------------
-void Font::SetVertical( sal_Bool bVertical )
+void Font::SetVertical( BOOL bVertical )
{
DBG_CHKTHIS( Font, NULL );
@@ -512,7 +512,7 @@ void Font::SetKerning( FontKerning nKerning )
// -----------------------------------------------------------------------
-sal_Bool Font::IsKerning() const
+BOOL Font::IsKerning() const
{
return (mpImplFont->mnKerning & KERNING_FONTSPECIFIC) != 0;
}
@@ -558,7 +558,7 @@ void Font::SetItalic( FontItalic eItalic )
// -----------------------------------------------------------------------
-void Font::SetOutline( sal_Bool bOutline )
+void Font::SetOutline( BOOL bOutline )
{
DBG_CHKTHIS( Font, NULL );
@@ -571,7 +571,7 @@ void Font::SetOutline( sal_Bool bOutline )
// -----------------------------------------------------------------------
-void Font::SetShadow( sal_Bool bShadow )
+void Font::SetShadow( BOOL bShadow )
{
DBG_CHKTHIS( Font, NULL );
@@ -649,7 +649,7 @@ void Font::SetEmphasisMark( FontEmphasisMark eEmphasisMark )
// -----------------------------------------------------------------------
-void Font::SetWordLineMode( sal_Bool bWordLine )
+void Font::SetWordLineMode( BOOL bWordLine )
{
DBG_CHKTHIS( Font, NULL );
@@ -690,17 +690,17 @@ Font& Font::operator=( const Font& rFont )
// -----------------------------------------------------------------------
-sal_Bool Font::operator==( const Font& rFont ) const
+BOOL Font::operator==( const Font& rFont ) const
{
DBG_CHKTHIS( Font, NULL );
DBG_CHKOBJ( &rFont, Font, NULL );
if( mpImplFont == rFont.mpImplFont )
- return sal_True;
+ return TRUE;
if( *mpImplFont == *rFont.mpImplFont )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -758,7 +758,7 @@ void Font::Merge( const Font& rFont )
void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const
{
- // #i56788# Use members directly, don't risc config access.
+ // #i56788# Use members directly, don't risc config access.
rAttrs.maName = mpImplFont->maFamilyName;
rAttrs.maStyleName = mpImplFont->maStyleName;
rAttrs.meFamily = mpImplFont->meFamily;
@@ -774,10 +774,10 @@ void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const
SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
- sal_Bool bTmp;
- sal_uInt8 nTmp8;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ UINT16 nTmp16;
+ BOOL bTmp;
+ BYTE nTmp8;
rIStm.ReadByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
rIStm.ReadByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
@@ -802,10 +802,10 @@ SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
if( aCompat.GetVersion() >= 2 )
{
- rIStm >> nTmp8; rImpl_Font.meRelief = (FontRelief)nTmp8;
- rIStm >> nTmp16; rImpl_Font.meCJKLanguage = (LanguageType)nTmp16;
- rIStm >> bTmp; rImpl_Font.mbVertical = bTmp;
- rIStm >> nTmp16; rImpl_Font.meEmphasisMark = (FontEmphasisMark)nTmp16;
+ rIStm >> nTmp8; rImpl_Font.meRelief = (FontRelief)nTmp8;
+ rIStm >> nTmp16; rImpl_Font.meCJKLanguage = (LanguageType)nTmp16;
+ rIStm >> bTmp; rImpl_Font.mbVertical = bTmp;
+ rIStm >> nTmp16; rImpl_Font.meEmphasisMark = (FontEmphasisMark)nTmp16;
}
if( aCompat.GetVersion() >= 3 )
{
@@ -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 << (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 << (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 << rImpl_Font.mnOrientation;
- rOStm << (sal_Bool) rImpl_Font.mbWordLine;
- rOStm << (sal_Bool) rImpl_Font.mbOutline;
- rOStm << (sal_Bool) rImpl_Font.mbShadow;
- rOStm << (sal_uInt8) rImpl_Font.mnKerning;
+ rOStm << (BOOL) rImpl_Font.mbWordLine;
+ rOStm << (BOOL) rImpl_Font.mbOutline;
+ rOStm << (BOOL) rImpl_Font.mbShadow;
+ rOStm << (BYTE) rImpl_Font.mnKerning;
// new in version 2
- rOStm << (sal_uInt8) rImpl_Font.meRelief;
- rOStm << (sal_uInt16) rImpl_Font.meCJKLanguage;
- rOStm << (sal_Bool) rImpl_Font.mbVertical;
- rOStm << (sal_uInt16) rImpl_Font.meEmphasisMark;
+ rOStm << (BYTE) rImpl_Font.meRelief;
+ rOStm << (UINT16) rImpl_Font.meCJKLanguage;
+ rOStm << (BOOL) rImpl_Font.mbVertical;
+ rOStm << (UINT16) rImpl_Font.meEmphasisMark;
// new in version 3
- rOStm << (sal_uInt16) rImpl_Font.meOverline;
+ rOStm << (UINT16) rImpl_Font.meOverline;
return rOStm;
}
@@ -937,16 +937,16 @@ namespace
}
// set italic
o_rResult.SetItalic( (aInfo.italicAngle != 0) ? ITALIC_NORMAL : ITALIC_NONE );
-
+
// set pitch
o_rResult.SetPitch( (aInfo.pitch == 0) ? PITCH_VARIABLE : PITCH_FIXED );
-
+
// set style name
if( aInfo.usubfamily )
o_rResult.SetStyleName( rtl::OUString( aInfo.usubfamily ) );
else if( aInfo.subfamily )
o_rResult.SetStyleName( rtl::OUString::createFromAscii( aInfo.subfamily ) );
-
+
// cleanup
CloseTTFont( pTTF );
// success
@@ -955,13 +955,13 @@ namespace
#endif
return bResult;
}
-
+
struct WeightSearchEntry
{
const char* string;
int string_len;
FontWeight weight;
-
+
bool operator<( const WeightSearchEntry& rRight ) const
{
return rtl_str_compareIgnoreAsciiCase_WithLength( string, string_len, rRight.string, rRight.string_len ) < 0;
@@ -980,7 +980,7 @@ namespace
{ "super", 5, WEIGHT_ULTRABOLD },
{ "thin", 4, WEIGHT_THIN }
};
-
+
bool identifyType1Font( const char* i_pBuffer, sal_uInt32 i_nSize, Font& o_rResult )
{
bool bResult = false;
@@ -1007,7 +1007,7 @@ namespace
o_rResult.SetName( rtl::OStringToOUString( rtl::OString( pOpen+1, pClose-pOpen-1 ), RTL_TEXTENCODING_ASCII_US ) );
}
}
-
+
// parse /ItalicAngle
static const char* pItalic = "/ItalicAngle";
const char* pItalicPos = std::search( pStream, pExecPos, pItalic, pItalic+12 );
@@ -1016,7 +1016,7 @@ namespace
sal_Int32 nItalic = rtl_str_toInt32( pItalicPos+12, 10 );
o_rResult.SetItalic( (nItalic != 0) ? ITALIC_NORMAL : ITALIC_NONE );
}
-
+
// parse /Weight
static const char* pWeight = "/Weight";
const char* pWeightPos = std::search( pStream, pExecPos, pWeight, pWeight+7 );
@@ -1079,7 +1079,7 @@ Font Font::identifyFont( const void* i_pBuffer, sal_uInt32 i_nSize )
identifyType1Font( pStream, i_nSize, aResult );
}
}
-
+
return aResult;
}
@@ -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; }
-sal_Bool Font::IsTransparent() const { return mpImplFont->mbTransparent; }
+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; }
-sal_Bool Font::IsVertical() const { return mpImplFont->mbVertical; }
+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(); }
-sal_Bool Font::IsOutline() const { return mpImplFont->mbOutline; }
-sal_Bool Font::IsShadow() const { return mpImplFont->mbShadow; }
+BOOL Font::IsOutline() const { return mpImplFont->mbOutline; }
+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; }
-sal_Bool Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
-sal_Bool Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
+BOOL Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
+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 849750ea20a9..8202bf1f3f4e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -62,7 +62,7 @@ using namespace com::sun::star;
// - Defines -
// -----------
-#define GAMMA( _def_cVal, _def_InvGamma ) ((sal_uInt8)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
+#define GAMMA( _def_cVal, _def_InvGamma ) ((BYTE)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
// --------------------------
// - Color exchange structs -
@@ -70,32 +70,32 @@ using namespace com::sun::star;
struct ImplColAdjustParam
{
- sal_uInt8* pMapR;
- sal_uInt8* pMapG;
- sal_uInt8* pMapB;
+ BYTE* pMapR;
+ BYTE* pMapG;
+ BYTE* pMapB;
};
struct ImplBmpAdjustParam
{
- short nLuminancePercent;
- short nContrastPercent;
- short nChannelRPercent;
- short nChannelGPercent;
- short nChannelBPercent;
- double fGamma;
- sal_Bool bInvert;
+ short nLuminancePercent;
+ short nContrastPercent;
+ short nChannelRPercent;
+ short nChannelGPercent;
+ short nChannelBPercent;
+ double fGamma;
+ BOOL bInvert;
};
// -----------------------------------------------------------------------------
struct ImplColConvertParam
{
- MtfConversion eConversion;
+ MtfConversion eConversion;
};
struct ImplBmpConvertParam
{
- BmpConversion eConversion;
+ BmpConversion eConversion;
};
// -----------------------------------------------------------------------------
@@ -114,22 +114,22 @@ struct ImplBmpMonoParam
struct ImplColReplaceParam
{
- sal_uLong* pMinR;
- sal_uLong* pMaxR;
- sal_uLong* pMinG;
- sal_uLong* pMaxG;
- sal_uLong* pMinB;
- sal_uLong* pMaxB;
- const Color* pDstCols;
- sal_uLong nCount;
+ ULONG* pMinR;
+ ULONG* pMaxR;
+ ULONG* pMinG;
+ ULONG* pMaxG;
+ ULONG* pMinB;
+ ULONG* pMaxB;
+ const Color* pDstCols;
+ ULONG nCount;
};
struct ImplBmpReplaceParam
{
- const Color* pSrcCols;
- const Color* pDstCols;
- sal_uLong nCount;
- const sal_uLong* pTols;
+ const Color* pSrcCols;
+ const Color* pDstCols;
+ ULONG nCount;
+ const ULONG* pTols;
};
@@ -139,10 +139,10 @@ struct ImplBmpReplaceParam
struct ImpLabel
{
- String aLabelName;
- sal_uLong nActionPos;
+ String aLabelName;
+ ULONG nActionPos;
- ImpLabel( const String& rLabelName, sal_uLong _nActionPos ) :
+ ImpLabel( const String& rLabelName, ULONG _nActionPos ) :
aLabelName( rLabelName ),
nActionPos( _nActionPos ) {}
};
@@ -159,14 +159,14 @@ public:
ImpLabelList( const ImpLabelList& rList );
~ImpLabelList();
- void ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); }
- 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( sal_uLong nPos ) const { return (ImpLabel*) GetObject( nPos ); }
- sal_uLong ImplGetLabelPos( const String& rLabelName );
- sal_uLong ImplCount() const { return Count(); }
+ void ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); }
+ ImpLabel* ImplRemove( 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(); }
};
// ------------------------------------------------------------------------
@@ -188,9 +188,9 @@ ImpLabelList::~ImpLabelList()
// ------------------------------------------------------------------------
-sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName )
+ULONG ImpLabelList::ImplGetLabelPos( const String& rLabelName )
{
- sal_uLong nLabelPos = METAFILE_LABEL_NOTFOUND;
+ ULONG nLabelPos = METAFILE_LABEL_NOTFOUND;
for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
{
@@ -209,31 +209,31 @@ sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName )
// ---------------
GDIMetaFile::GDIMetaFile() :
- List ( 0x3EFF, 64, 64 ),
- aPrefSize ( 1, 1 ),
- pPrev ( NULL ),
- pNext ( NULL ),
- pOutDev ( NULL ),
- pLabelList ( NULL ),
- bPause ( sal_False ),
- bRecord ( sal_False ),
- bUseCanvas ( sal_False )
+ List ( 0x3EFF, 64, 64 ),
+ aPrefSize ( 1, 1 ),
+ pPrev ( NULL ),
+ pNext ( NULL ),
+ pOutDev ( NULL ),
+ pLabelList ( NULL ),
+ bPause ( FALSE ),
+ bRecord ( FALSE ),
+ bUseCanvas ( FALSE )
{
}
// ------------------------------------------------------------------------
GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
- List ( rMtf ),
- aPrefMapMode ( rMtf.aPrefMapMode ),
- aPrefSize ( rMtf.aPrefSize ),
- aHookHdlLink ( rMtf.aHookHdlLink ),
- pPrev ( rMtf.pPrev ),
- pNext ( rMtf.pNext ),
- pOutDev ( NULL ),
- bPause ( sal_False ),
- bRecord ( sal_False ),
- bUseCanvas ( rMtf.bUseCanvas )
+ List ( rMtf ),
+ aPrefMapMode ( rMtf.aPrefMapMode ),
+ aPrefSize ( rMtf.aPrefSize ),
+ aHookHdlLink ( rMtf.aHookHdlLink ),
+ pPrev ( rMtf.pPrev ),
+ pNext ( rMtf.pNext ),
+ pOutDev ( NULL ),
+ bPause ( FALSE ),
+ bRecord ( FALSE ),
+ bUseCanvas ( rMtf.bUseCanvas )
{
// RefCount der MetaActions erhoehen
for( void* pAct = First(); pAct; pAct = Next() )
@@ -249,7 +249,7 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
Record( rMtf.pOutDev );
if ( rMtf.bPause )
- Pause( sal_True );
+ Pause( TRUE );
}
}
@@ -285,8 +285,8 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
pPrev = rMtf.pPrev;
pNext = rMtf.pNext;
pOutDev = NULL;
- bPause = sal_False;
- bRecord = sal_False;
+ bPause = FALSE;
+ bRecord = FALSE;
bUseCanvas = rMtf.bUseCanvas;
if( rMtf.bRecord )
@@ -294,7 +294,7 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
Record( rMtf.pOutDev );
if( rMtf.bPause )
- Pause( sal_True );
+ Pause( TRUE );
}
}
@@ -303,24 +303,24 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
+BOOL GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
{
- const sal_uLong nObjCount = Count();
- sal_Bool bRet = sal_False;
+ const ULONG nObjCount = Count();
+ BOOL bRet = FALSE;
if( this == &rMtf )
- bRet = sal_True;
+ bRet = TRUE;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = sal_True;
+ bRet = TRUE;
- for( sal_uLong n = 0UL; n < nObjCount; n++ )
+ for( ULONG n = 0UL; n < nObjCount; n++ )
{
if( GetObject( n ) != rMtf.GetObject( n ) )
{
- bRet = sal_False;
+ bRet = FALSE;
break;
}
}
@@ -333,22 +333,22 @@ sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
sal_Bool GDIMetaFile::IsEqual( const GDIMetaFile& rMtf ) const
{
- const sal_uLong nObjCount = Count();
- sal_Bool bRet = sal_False;
+ const ULONG nObjCount = Count();
+ BOOL bRet = FALSE;
if( this == &rMtf )
- bRet = sal_True;
+ bRet = TRUE;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = sal_True;
+ bRet = TRUE;
- for( sal_uLong n = 0UL; n < nObjCount; n++ )
+ for( ULONG n = 0UL; n < nObjCount; n++ )
{
if(!((MetaAction*)GetObject( n ))->IsEqual(*((MetaAction*)rMtf.GetObject( n ))))
{
- bRet = sal_False;
+ bRet = FALSE;
break;
}
}
@@ -375,7 +375,7 @@ void GDIMetaFile::Clear()
// ------------------------------------------------------------------------
-void GDIMetaFile::Linker( OutputDevice* pOut, sal_Bool bLink )
+void GDIMetaFile::Linker( OutputDevice* pOut, BOOL bLink )
{
if( bLink )
{
@@ -424,27 +424,25 @@ void GDIMetaFile::Record( OutputDevice* pOut )
Last();
pOutDev = pOut;
- bRecord = sal_True;
- Linker( pOut, sal_True );
+ bRecord = TRUE;
+ Linker( pOut, TRUE );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos )
+void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
{
if ( !bRecord && !rMtf.bRecord )
{
MetaAction* pAction = GetCurAction();
- const sal_uLong nObjCount = Count();
-
- rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
+ const ULONG nObjCount = Count();
rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
if( nPos > nObjCount )
nPos = nObjCount;
- for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -459,13 +457,13 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos )
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
+void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos )
{
if( !bRecord )
{
MetaAction* pAction = GetCurAction();
- const sal_uLong nObjCount = Count();
- sal_uLong i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
+ const ULONG nObjCount = Count();
+ ULONG i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
if( nPos > nObjCount )
nPos = nObjCount;
@@ -478,7 +476,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
pOut->SetLayoutMode( 0 );
pOut->SetDigitLanguage( 0 );
- for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -530,7 +528,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
if( xBitmapCanvas.is() ) {
args[0] = uno::Any( xBitmapCanvas );
- xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.rendering.MtfRenderer")),
+ xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ),
args ), uno::UNO_QUERY );
if( xMtfRenderer.is() ) {
@@ -589,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 sal_uInt8* pData = pAct->GetData();
- const sal_uInt8* const pEndData = pData + pAct->GetDataSize();
+ const BYTE* pData = pAct->GetData();
+ const BYTE* const pEndData = pData + pAct->GetDataSize();
if( !pData )
return;
@@ -656,15 +654,15 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
// ------------------------------------------------------------------------
void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
- const Size& rSize, sal_uLong nPos )
+ const Size& rSize, ULONG nPos )
{
- Region aDrawClipRegion;
+ Region aDrawClipRegion;
MapMode aDrawMap( GetPrefMapMode() );
- Size aDestSize( pOut->LogicToPixel( rSize ) );
+ Size aDestSize( pOut->LogicToPixel( rSize ) );
if( aDestSize.Width() && aDestSize.Height() )
{
- GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
+ GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
if( bUseCanvas && !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
return;
@@ -682,7 +680,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
aScaleX *= aDrawMap.GetScaleX(); aDrawMap.SetScaleX( aScaleX );
aScaleY *= aDrawMap.GetScaleY(); aDrawMap.SetScaleY( aScaleY );
-
+
// #i47260# Convert logical output position to offset within
// the metafile's mapmode. Therefore, disable pixel offset on
// outdev, it's inverse mnOutOffLogicX/Y is calculated for a
@@ -721,19 +719,19 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
// ------------------------------------------------------------------------
-void GDIMetaFile::Pause( sal_Bool _bPause )
+void GDIMetaFile::Pause( BOOL _bPause )
{
if( bRecord )
{
if( _bPause )
{
if( !bPause )
- Linker( pOutDev, sal_False );
+ Linker( pOutDev, FALSE );
}
else
{
if( bPause )
- Linker( pOutDev, sal_True );
+ Linker( pOutDev, TRUE );
}
bPause = _bPause;
@@ -746,12 +744,12 @@ void GDIMetaFile::Stop()
{
if( bRecord )
{
- bRecord = sal_False;
+ bRecord = FALSE;
if( !bPause )
- Linker( pOutDev, sal_False );
+ Linker( pOutDev, FALSE );
else
- bPause = sal_False;
+ bPause = FALSE;
}
}
@@ -773,7 +771,7 @@ void GDIMetaFile::WindEnd()
// ------------------------------------------------------------------------
-void GDIMetaFile::Wind( sal_uLong nActionPos )
+void GDIMetaFile::Wind( ULONG nActionPos )
{
if( !bRecord )
Seek( nActionPos );
@@ -810,7 +808,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction )
// ------------------------------------------------------------------------
-void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos )
+void GDIMetaFile::AddAction( MetaAction* pAction, ULONG nPos )
{
Insert( pAction, nPos );
@@ -824,7 +822,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos )
// ------------------------------------------------------------------------
// @since #110496#
-void GDIMetaFile::RemoveAction( sal_uLong nPos )
+void GDIMetaFile::RemoveAction( ULONG nPos )
{
Remove( nPos );
@@ -834,14 +832,14 @@ void GDIMetaFile::RemoveAction( sal_uLong nPos )
// ------------------------------------------------------------------------
-MetaAction* GDIMetaFile::CopyAction( sal_uLong nPos ) const
+MetaAction* GDIMetaFile::CopyAction( ULONG nPos ) const
{
return ( (MetaAction*) GetObject( nPos ) )->Clone();
}
// ------------------------------------------------------------------------
-sal_uLong GDIMetaFile::GetActionPos( const String& rLabel )
+ULONG GDIMetaFile::GetActionPos( const String& rLabel )
{
ImpLabel* pLabel = NULL;
@@ -855,9 +853,9 @@ sal_uLong GDIMetaFile::GetActionPos( const String& rLabel )
// ------------------------------------------------------------------------
-sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos )
+BOOL GDIMetaFile::InsertLabel( const String& rLabel, ULONG nActionPos )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !pLabelList )
pLabelList = new ImpLabelList;
@@ -865,7 +863,7 @@ sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos )
if( pLabelList->ImplGetLabelPos( rLabel ) == METAFILE_LABEL_NOTFOUND )
{
pLabelList->ImplInsert( new ImpLabel( rLabel, nActionPos ) );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -877,7 +875,7 @@ void GDIMetaFile::RemoveLabel( const String& rLabel )
{
if( pLabelList )
{
- const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if( nLabelPos != METAFILE_LABEL_NOTFOUND )
delete pLabelList->ImplRemove( nLabelPos );
@@ -890,7 +888,7 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
{
if( pLabelList )
{
- const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if ( nLabelPos != METAFILE_LABEL_NOTFOUND )
pLabelList->ImplGetLabel( nLabelPos )->aLabelName = rNewLabel;
@@ -899,14 +897,14 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
// ------------------------------------------------------------------------
-sal_uLong GDIMetaFile::GetLabelCount() const
+ULONG GDIMetaFile::GetLabelCount() const
{
return( pLabelList ? pLabelList->ImplCount() : 0UL );
}
// ------------------------------------------------------------------------
-String GDIMetaFile::GetLabel( sal_uLong nLabel )
+String GDIMetaFile::GetLabel( ULONG nLabel )
{
String aString;
@@ -923,12 +921,12 @@ String GDIMetaFile::GetLabel( sal_uLong nLabel )
// ------------------------------------------------------------------------
-sal_Bool GDIMetaFile::SaveStatus()
+BOOL GDIMetaFile::SaveStatus()
{
if ( bRecord )
{
if ( bPause )
- Linker( pOutDev, sal_True );
+ Linker( pOutDev, TRUE );
AddAction( new MetaLineColorAction( pOutDev->GetLineColor(),
pOutDev->IsLineColor() ) );
@@ -949,22 +947,22 @@ sal_Bool GDIMetaFile::SaveStatus()
pOutDev->IsClipRegion() ) );
if ( bPause )
- Linker( pOutDev, sal_False );
+ Linker( pOutDev, FALSE );
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
// ------------------------------------------------------------------------
-sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
+BOOL GDIMetaFile::Mirror( ULONG nMirrorFlags )
{
- const Size aOldPrefSize( GetPrefSize() );
- long nMoveX, nMoveY;
- double fScaleX, fScaleY;
- sal_Bool bRet;
+ const Size aOldPrefSize( GetPrefSize() );
+ long nMoveX, nMoveY;
+ double fScaleX, fScaleY;
+ BOOL bRet;
if( nMirrorFlags & MTF_MIRROR_HORZ )
nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
@@ -981,10 +979,10 @@ sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
Scale( fScaleX, fScaleY );
Move( nMoveX, nMoveY );
SetPrefSize( aOldPrefSize );
- bRet = sal_True;
+ bRet = TRUE;
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
@@ -997,9 +995,9 @@ void GDIMetaFile::Move( long nX, long nY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( sal_False );
+ aMapVDev.EnableOutput( FALSE );
aMapVDev.SetMapMode( GetPrefMapMode() );
-
+
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
{
const long nType = pAct->GetType();
@@ -1013,7 +1011,7 @@ void GDIMetaFile::Move( long nX, long nY )
else
pModAct = pAct;
- if( ( META_MAPMODE_ACTION == nType ) ||
+ if( ( META_MAPMODE_ACTION == nType ) ||
( META_PUSH_ACTION == nType ) ||
( META_POP_ACTION == nType ) )
{
@@ -1031,10 +1029,10 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( sal_False );
+ aMapVDev.EnableOutput( FALSE );
aMapVDev.SetReferenceDevice( nDPIX, nDPIY );
aMapVDev.SetMapMode( GetPrefMapMode() );
-
+
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
{
const long nType = pAct->GetType();
@@ -1048,7 +1046,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY )
else
pModAct = pAct;
- if( ( META_MAPMODE_ACTION == nType ) ||
+ if( ( META_MAPMODE_ACTION == nType ) ||
( META_PUSH_ACTION == nType ) ||
( META_POP_ACTION == nType ) )
{
@@ -1105,14 +1103,14 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
Rectangle aCurRect( i_rClipRect );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( sal_False );
+ aMapVDev.EnableOutput( FALSE );
aMapVDev.SetMapMode( GetPrefMapMode() );
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
{
const long nType = pAct->GetType();
- if( ( META_MAPMODE_ACTION == nType ) ||
+ if( ( META_MAPMODE_ACTION == nType ) ||
( META_PUSH_ACTION == nType ) ||
( META_POP_ACTION == nType ) )
{
@@ -1125,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, sal_True );
+ MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, TRUE );
Replace( pNewAct, GetCurPos() );
pOldAct->Delete();
}
@@ -1146,7 +1144,7 @@ Point GDIMetaFile::ImplGetRotatedPoint( const Point& rPt, const Point& rRotatePt
// ------------------------------------------------------------------------
-Polygon GDIMetaFile::ImplGetRotatedPolygon( const Polygon& rPoly, const Point& rRotatePt,
+Polygon GDIMetaFile::ImplGetRotatedPolygon( const Polygon& rPoly, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos )
{
Polygon aRet( rPoly );
@@ -1159,7 +1157,7 @@ Polygon GDIMetaFile::ImplGetRotatedPolygon( const Polygon& rPoly, const Point& r
// ------------------------------------------------------------------------
-PolyPolygon GDIMetaFile::ImplGetRotatedPolyPolygon( const PolyPolygon& rPolyPoly, const Point& rRotatePt,
+PolyPolygon GDIMetaFile::ImplGetRotatedPolyPolygon( const PolyPolygon& rPolyPoly, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos )
{
PolyPolygon aRet( rPolyPoly );
@@ -1172,16 +1170,16 @@ PolyPolygon GDIMetaFile::ImplGetRotatedPolyPolygon( const PolyPolygon& rPolyPoly
// ------------------------------------------------------------------------
-void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf,
+void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf,
const OutputDevice& rMapDev,
const PolyPolygon& rPolyPoly,
- const Gradient& rGrad )
+ const Gradient& rGrad )
{
// #105055# Generate comment, GradientEx and Gradient actions
// (within DrawGradient)
VirtualDevice aVDev( rMapDev, 0 );
- aVDev.EnableOutput( sal_False );
- GDIMetaFile aGradMtf;
+ aVDev.EnableOutput( FALSE );
+ GDIMetaFile aGradMtf;
aGradMtf.Record( &aVDev );
aVDev.DrawGradient( rPolyPoly, rGrad );
@@ -1210,33 +1208,33 @@ void GDIMetaFile::Rotate( long nAngle10 )
const double fAngle = F_PI1800 * nAngle10;
const double fSin = sin( fAngle );
const double fCos = cos( fAngle );
- Rectangle aRect=Rectangle( Point(), GetPrefSize() );
+ Rectangle aRect=Rectangle( Point(), GetPrefSize() );
Polygon aPoly( aRect );
aPoly.Rotate( Point(), fSin, fCos );
- aMapVDev.EnableOutput( sal_False );
+ aMapVDev.EnableOutput( FALSE );
aMapVDev.SetMapMode( GetPrefMapMode() );
const Rectangle aNewBound( aPoly.GetBoundRect() );
-
+
const Point aOrigin( GetPrefMapMode().GetOrigin().X(), GetPrefMapMode().GetOrigin().Y() );
const Size aOffset( -aNewBound.Left(), -aNewBound.Top() );
-
+
Point aRotAnchor( aOrigin );
Size aRotOffset( aOffset );
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const sal_uInt16 nActionType = pAction->GetType();
+ const USHORT nActionType = pAction->GetType();
switch( nActionType )
{
case( META_PIXEL_ACTION ):
{
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
- aMtf.AddAction( new MetaPixelAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
- pAct->GetColor() ) );
+ aMtf.AddAction( new MetaPixelAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
+ pAct->GetColor() ) );
}
break;
@@ -1250,60 +1248,60 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_LINE_ACTION ):
{
MetaLineAction* pAct = (MetaLineAction*) pAction;
- aMtf.AddAction( new MetaLineAction( ImplGetRotatedPoint( pAct->GetStartPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
+ aMtf.AddAction( new MetaLineAction( ImplGetRotatedPoint( pAct->GetStartPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
ImplGetRotatedPoint( pAct->GetEndPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
pAct->GetLineInfo() ) );
}
break;
-
+
case( META_RECT_ACTION ):
{
MetaRectAction* pAct = (MetaRectAction*) pAction;
- aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) );
+ aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
-
+
case( META_ROUNDRECT_ACTION ):
{
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
const Polygon aRoundRectPoly( pAct->GetRect(), pAct->GetHorzRound(), pAct->GetVertRound() );
-
- aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aRoundRectPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
+
+ aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aRoundRectPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
-
+
case( META_ELLIPSE_ACTION ):
{
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
const Polygon aEllipsePoly( pAct->GetRect().Center(), pAct->GetRect().GetWidth() >> 1, pAct->GetRect().GetHeight() >> 1 );
-
- aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aEllipsePoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
+
+ aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aEllipsePoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
-
+
case( META_ARC_ACTION ):
{
MetaArcAction* pAct = (MetaArcAction*) pAction;
const Polygon aArcPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_ARC );
-
+
aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aArcPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
-
+
case( META_PIE_ACTION ):
{
MetaPieAction* pAct = (MetaPieAction*) pAction;
const Polygon aPiePoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_PIE );
-
+
aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aPiePoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
-
- case( META_CHORD_ACTION ):
+
+ case( META_CHORD_ACTION ):
{
MetaChordAction* pAct = (MetaChordAction*) pAction;
const Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_CHORD );
-
+
aMtf.AddAction( new MetaPolygonAction( ImplGetRotatedPolygon( aChordPoly, aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
@@ -1337,14 +1335,14 @@ void GDIMetaFile::Rotate( long nAngle10 )
}
break;
- case( META_TEXTARRAY_ACTION ):
+ case( META_TEXTARRAY_ACTION ):
{
MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction;
aMtf.AddAction( new MetaTextArrayAction( ImplGetRotatedPoint( pAct->GetPoint(), aRotAnchor, aRotOffset, fSin, fCos ),
pAct->GetText(), pAct->GetDXArray(), pAct->GetIndex(), pAct->GetLen() ) );
}
break;
-
+
case( META_STRETCHTEXT_ACTION ):
{
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
@@ -1352,7 +1350,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
pAct->GetWidth(), pAct->GetText(), pAct->GetIndex(), pAct->GetLen() ) );
}
break;
-
+
case( META_TEXTLINE_ACTION ):
{
MetaTextLineAction* pAct = (MetaTextLineAction*) pAction;
@@ -1368,8 +1366,8 @@ void GDIMetaFile::Rotate( long nAngle10 )
Rectangle aBmpRect( aBmpPoly.GetBoundRect() );
BitmapEx aBmpEx( pAct->GetBitmap() );
- aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
- aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(),
+ aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
+ aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(),
aBmpEx ) );
}
break;
@@ -1383,7 +1381,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aBmpEx.Crop( Rectangle( pAct->GetSrcPoint(), pAct->GetSrcSize() ) );
aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
-
+
aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(), aBmpEx ) );
}
break;
@@ -1395,8 +1393,8 @@ void GDIMetaFile::Rotate( long nAngle10 )
Rectangle aBmpRect( aBmpPoly.GetBoundRect() );
BitmapEx aBmpEx( pAct->GetBitmapEx() );
- aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
-
+ aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
+
aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(), aBmpEx ) );
}
break;
@@ -1410,7 +1408,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aBmpEx.Crop( Rectangle( pAct->GetSrcPoint(), pAct->GetSrcSize() ) );
aBmpEx.Rotate( nAngle10, Color( COL_TRANSPARENT ) );
-
+
aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(), aBmpEx ) );
}
break;
@@ -1419,7 +1417,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
{
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
- ImplAddGradientEx( aMtf, aMapVDev,
+ ImplAddGradientEx( aMtf, aMapVDev,
ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ),
pAct->GetGradient() );
}
@@ -1441,17 +1439,17 @@ void GDIMetaFile::Rotate( long nAngle10 )
{
int nBeginComments( 1 );
pAction = (MetaAction*) Next();
-
+
// skip everything, except gradientex action
while( pAction )
{
- const sal_uInt16 nType = pAction->GetType();
-
+ const USHORT nType = pAction->GetType();
+
if( META_GRADIENTEX_ACTION == nType )
{
// Add rotated gradientex
MetaGradientExAction* pAct = (MetaGradientExAction*) pAction;
- ImplAddGradientEx( aMtf, aMapVDev,
+ ImplAddGradientEx( aMtf, aMapVDev,
ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ),
pAct->GetGradient() );
}
@@ -1496,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 sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
}
else
{
@@ -1507,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 sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
}
}
}
@@ -1524,11 +1522,11 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_HATCH_ACTION ):
{
- MetaHatchAction* pAct = (MetaHatchAction*) pAction;
- Hatch aHatch( pAct->GetHatch() );
+ MetaHatchAction* pAct = (MetaHatchAction*) pAction;
+ Hatch aHatch( pAct->GetHatch() );
- aHatch.SetAngle( aHatch.GetAngle() + (sal_uInt16) nAngle10 );
- aMtf.AddAction( new MetaHatchAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ),
+ aHatch.SetAngle( aHatch.GetAngle() + (USHORT) nAngle10 );
+ aMtf.AddAction( new MetaHatchAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ),
aHatch ) );
}
break;
@@ -1544,20 +1542,20 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_FLOATTRANSPARENT_ACTION ):
{
MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction;
- GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
+ GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
Polygon aMtfPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) );
Rectangle aMtfRect( aMtfPoly.GetBoundRect() );
aTransMtf.Rotate( nAngle10 );
- aMtf.AddAction( new MetaFloatTransparentAction( aTransMtf, aMtfRect.TopLeft(), aMtfRect.GetSize(),
+ aMtf.AddAction( new MetaFloatTransparentAction( aTransMtf, aMtfRect.TopLeft(), aMtfRect.GetSize(),
pAct->GetGradient() ) );
}
break;
case( META_EPS_ACTION ):
{
- MetaEPSAction* pAct = (MetaEPSAction*) pAction;
- GDIMetaFile aEPSMtf( pAct->GetSubstitute() );
+ MetaEPSAction* pAct = (MetaEPSAction*) pAction;
+ GDIMetaFile aEPSMtf( pAct->GetSubstitute() );
Polygon aEPSPoly( ImplGetRotatedPolygon( Rectangle( pAct->GetPoint(), pAct->GetSize() ), aRotAnchor, aRotOffset, fSin, fCos ) );
Rectangle aEPSRect( aEPSPoly.GetBoundRect() );
@@ -1572,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 ) ), sal_True ) );
+ aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), TRUE ) );
else
{
pAction->Duplicate();
@@ -1583,12 +1581,12 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_ISECTRECTCLIPREGION_ACTION ):
{
- MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
- aMtf.AddAction( new MetaISectRegionClipRegionAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) );
+ MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
+ aMtf.AddAction( new MetaISectRegionClipRegionAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) );
}
break;
- case( META_ISECTREGIONCLIPREGION_ACTION ):
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
{
MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction;
const Region& rRegion = pAct->GetRegion();
@@ -1613,9 +1611,9 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_FONT_ACTION ):
{
MetaFontAction* pAct = (MetaFontAction*) pAction;
- Font aFont( pAct->GetFont() );
+ Font aFont( pAct->GetFont() );
- aFont.SetOrientation( aFont.GetOrientation() + (sal_uInt16) nAngle10 );
+ aFont.SetOrientation( aFont.GetOrientation() + (USHORT) nAngle10 );
aMtf.AddAction( new MetaFontAction( aFont ) );
}
break;
@@ -1629,7 +1627,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_TEXTRECT_ACTION ):
case( META_MOVECLIPREGION_ACTION ):
{
- OSL_FAIL( "GDIMetaFile::Rotate(): unsupported action" );
+ DBG_ERROR( "GDIMetaFile::Rotate(): unsupported action" );
}
break;
@@ -1640,7 +1638,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aMtf.AddAction( pAction );
// update rotation point and offset, if necessary
- if( ( META_MAPMODE_ACTION == nActionType ) ||
+ if( ( META_MAPMODE_ACTION == nActionType ) ||
( META_PUSH_ACTION == nActionType ) ||
( META_POP_ACTION == nActionType ) )
{
@@ -1681,19 +1679,19 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
{
GDIMetaFile aMtf;
VirtualDevice aMapVDev( i_rReference );
-
- aMapVDev.EnableOutput( sal_False );
+
+ aMapVDev.EnableOutput( FALSE );
aMapVDev.SetMapMode( GetPrefMapMode() );
-
+
std::vector<Rectangle> aClipStack( 1, Rectangle() );
- std::vector<sal_uInt16> aPushFlagStack;
-
+ std::vector<USHORT> aPushFlagStack;
+
Rectangle aBound;
-
+
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const sal_uInt16 nActionType = pAction->GetType();
-
+ const USHORT nActionType = pAction->GetType();
+
switch( nActionType )
{
case( META_PIXEL_ACTION ):
@@ -1705,7 +1703,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aClipStack );
}
break;
-
+
case( META_POINT_ACTION ):
{
MetaPointAction* pAct = (MetaPointAction*) pAction;
@@ -1715,7 +1713,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aClipStack );
}
break;
-
+
case( META_LINE_ACTION ):
{
MetaLineAction* pAct = (MetaLineAction*) pAction;
@@ -1725,28 +1723,28 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_RECT_ACTION ):
{
MetaRectAction* pAct = (MetaRectAction*) pAction;
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_ROUNDRECT_ACTION ):
{
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_ELLIPSE_ACTION ):
{
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_ARC_ACTION ):
{
MetaArcAction* pAct = (MetaArcAction*) pAction;
@@ -1755,7 +1753,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_PIE_ACTION ):
{
MetaPieAction* pAct = (MetaPieAction*) pAction;
@@ -1764,8 +1762,8 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
- case( META_CHORD_ACTION ):
+
+ case( META_CHORD_ACTION ):
{
MetaChordAction* pAct = (MetaChordAction*) pAction;
// FIXME: this is imprecise
@@ -1773,7 +1771,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_POLYLINE_ACTION ):
{
MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction;
@@ -1781,7 +1779,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_POLYGON_ACTION ):
{
MetaPolygonAction* pAct = (MetaPolygonAction*) pAction;
@@ -1789,7 +1787,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_POLYPOLYGON_ACTION ):
{
MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction;
@@ -1797,7 +1795,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_TEXT_ACTION ):
{
MetaTextAction* pAct = (MetaTextAction*) pAction;
@@ -1809,8 +1807,8 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
- case( META_TEXTARRAY_ACTION ):
+
+ case( META_TEXTARRAY_ACTION ):
{
MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction;
Rectangle aRect;
@@ -1822,10 +1820,10 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_STRETCHTEXT_ACTION ):
{
- MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
+ MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
Rectangle aRect;
// hdu said base = index
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
@@ -1835,14 +1833,14 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_TEXTLINE_ACTION ):
{
MetaTextLineAction* pAct = (MetaTextLineAction*) pAction;
// measure a test string to get ascend and descent right
static const sal_Unicode pStr[] = { 0xc4, 0x67, 0 };
String aStr( pStr );
-
+
Rectangle aRect;
aMapVDev.GetTextBoundRect( aRect, aStr, 0, 0, aStr.Len(), 0, NULL );
Point aPt( pAct->GetStartPoint() );
@@ -1851,7 +1849,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_BMPSCALE_ACTION ):
{
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
@@ -1859,7 +1857,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_BMPSCALEPART_ACTION ):
{
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
@@ -1867,7 +1865,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_BMPEXSCALE_ACTION ):
{
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
@@ -1875,7 +1873,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_BMPEXSCALEPART_ACTION ):
{
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
@@ -1883,7 +1881,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_GRADIENT_ACTION ):
{
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
@@ -1891,7 +1889,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_GRADIENTEX_ACTION ):
{
MetaGradientExAction* pAct = (MetaGradientExAction*) pAction;
@@ -1899,21 +1897,21 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_COMMENT_ACTION ):
{
// nothing to do
};
break;
-
+
case( META_HATCH_ACTION ):
{
- MetaHatchAction* pAct = (MetaHatchAction*) pAction;
+ MetaHatchAction* pAct = (MetaHatchAction*) pAction;
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_TRANSPARENT_ACTION ):
{
MetaTransparentAction* pAct = (MetaTransparentAction*) pAction;
@@ -1921,11 +1919,11 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_FLOATTRANSPARENT_ACTION ):
{
MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction;
- GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
+ GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
// get the bound rect of the contained metafile
Rectangle aRect( aTransMtf.GetBoundRect( i_rReference ) );
// scale the rect now on the assumption that the correct top left of the metafile
@@ -1939,22 +1937,22 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aRect.Right() = long(double(aRect.Right())*fX);
aRect.Top() = long(double(aRect.Top())*fY);
aRect.Bottom() = long(double(aRect.Bottom())*fY);
-
+
// transform the rect to current VDev state
aRect = aMapVDev.LogicToLogic( aRect, aTransMtf.GetPrefMapMode(), aMapVDev.GetMapMode() );
-
+
ImplActionBounds( aBound, aRect, aClipStack );
}
break;
-
+
case( META_EPS_ACTION ):
{
- MetaEPSAction* pAct = (MetaEPSAction*) pAction;
+ MetaEPSAction* pAct = (MetaEPSAction*) pAction;
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_CLIPREGION_ACTION ):
{
MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
@@ -1964,7 +1962,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aClipStack.back() = Rectangle();
}
break;
-
+
case( META_ISECTRECTCLIPREGION_ACTION ):
{
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
@@ -1975,8 +1973,8 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aClipStack.back().Intersection( aRect );
}
break;
-
- case( META_ISECTREGIONCLIPREGION_ACTION ):
+
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
{
MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction;
Rectangle aRect( aMapVDev.LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) );
@@ -1986,7 +1984,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
aClipStack.back().Intersection( aRect );
}
break;
-
+
case( META_BMP_ACTION ):
{
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
@@ -1994,7 +1992,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_BMPEX_ACTION ):
{
MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
@@ -2002,7 +2000,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_MASK_ACTION ):
{
MetaMaskAction* pAct = (MetaMaskAction*) pAction;
@@ -2010,7 +2008,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_MASKSCALE_ACTION ):
{
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
@@ -2018,7 +2016,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_MASKSCALEPART_ACTION ):
{
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
@@ -2026,7 +2024,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_WALLPAPER_ACTION ):
{
MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
@@ -2034,7 +2032,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_TEXTRECT_ACTION ):
{
MetaTextRectAction* pAct = (MetaTextRectAction*) pAction;
@@ -2042,7 +2040,7 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
}
break;
-
+
case( META_MOVECLIPREGION_ACTION ):
{
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
@@ -2054,11 +2052,11 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
}
}
break;
-
+
default:
{
pAction->Execute( &aMapVDev );
-
+
if( nActionType == META_PUSH_ACTION )
{
MetaPushAction* pAct = (MetaPushAction*) pAction;
@@ -2093,9 +2091,9 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
Color GDIMetaFile::ImplColAdjustFnc( const Color& rColor, const void* pColParam )
{
- return Color( rColor.GetTransparency(),
- ( (const ImplColAdjustParam*) pColParam )->pMapR[ rColor.GetRed() ],
- ( (const ImplColAdjustParam*) pColParam )->pMapG[ rColor.GetGreen() ],
+ return Color( rColor.GetTransparency(),
+ ( (const ImplColAdjustParam*) pColParam )->pMapR[ rColor.GetRed() ],
+ ( (const ImplColAdjustParam*) pColParam )->pMapG[ rColor.GetGreen() ],
( (const ImplColAdjustParam*) pColParam )->pMapB[ rColor.GetBlue() ] );
}
@@ -2104,11 +2102,11 @@ Color GDIMetaFile::ImplColAdjustFnc( const Color& rColor, const void* pColParam
BitmapEx GDIMetaFile::ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmpParam )
{
- const ImplBmpAdjustParam* p = (const ImplBmpAdjustParam*) pBmpParam;
- BitmapEx aRet( rBmpEx );
+ const ImplBmpAdjustParam* p = (const ImplBmpAdjustParam*) pBmpParam;
+ BitmapEx aRet( rBmpEx );
aRet.Adjust( p->nLuminancePercent, p->nContrastPercent,
- p->nChannelRPercent, p->nChannelGPercent, p->nChannelBPercent,
+ p->nChannelRPercent, p->nChannelGPercent, p->nChannelBPercent,
p->fGamma, p->bInvert );
return aRet;
@@ -2118,7 +2116,7 @@ BitmapEx GDIMetaFile::ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmp
Color GDIMetaFile::ImplColConvertFnc( const Color& rColor, const void* pColParam )
{
- sal_uInt8 cLum = rColor.GetLuminance();
+ BYTE cLum = rColor.GetLuminance();
if( MTF_CONVERSION_1BIT_THRESHOLD == ( (const ImplColConvertParam*) pColParam )->eConversion )
cLum = ( cLum < 128 ) ? 0 : 255;
@@ -2169,20 +2167,20 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa
Color GDIMetaFile::ImplColReplaceFnc( const Color& rColor, const void* pColParam )
{
- const sal_uLong nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
+ const ULONG nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
- for( sal_uLong i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
- {
- if( ( ( (const ImplColReplaceParam*) pColParam )->pMinR[ i ] <= nR ) &&
+ for( ULONG i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
+ {
+ if( ( ( (const ImplColReplaceParam*) pColParam )->pMinR[ i ] <= nR ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMaxR[ i ] >= nR ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMinG[ i ] <= nG ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMaxG[ i ] >= nG ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMinB[ i ] <= nB ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMaxB[ i ] >= nB ) )
- {
+ {
return( ( (const ImplColReplaceParam*) pColParam )->pDstCols[ i ] );
- }
- }
+ }
+ }
return rColor;
}
@@ -2191,8 +2189,8 @@ Color GDIMetaFile::ImplColReplaceFnc( const Color& rColor, const void* pColParam
BitmapEx GDIMetaFile::ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBmpParam )
{
- const ImplBmpReplaceParam* p = (const ImplBmpReplaceParam*) pBmpParam;
- BitmapEx aRet( rBmpEx );
+ const ImplBmpReplaceParam* p = (const ImplBmpReplaceParam*) pBmpParam;
+ BitmapEx aRet( rBmpEx );
aRet.Replace( p->pSrcCols, p->pDstCols, p->nCount, p->pTols );
@@ -2201,7 +2199,7 @@ BitmapEx GDIMetaFile::ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBm
// ------------------------------------------------------------------------
-void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pColParam,
+void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pColParam,
BmpExchangeFnc pFncBmp, const void* pBmpParam )
{
GDIMetaFile aMtf;
@@ -2211,7 +2209,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const sal_uInt16 nType = pAction->GetType();
+ const USHORT nType = pAction->GetType();
switch( nType )
{
@@ -2229,7 +2227,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
+ pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2242,7 +2240,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
+ pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2262,7 +2260,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
+ pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2275,7 +2273,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
+ pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2288,7 +2286,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
+ pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2297,7 +2295,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_FONT_ACTION ):
{
MetaFontAction* pAct = (MetaFontAction*) pAction;
- Font aFont( pAct->GetFont() );
+ Font aFont( pAct->GetFont() );
aFont.SetColor( pFncCol( aFont.GetColor(), pColParam ) );
aFont.SetFillColor( pFncCol( aFont.GetFillColor(), pColParam ) );
@@ -2307,9 +2305,9 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_WALLPAPER_ACTION ):
{
- MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
- Wallpaper aWall( pAct->GetWallpaper() );
- const Rectangle& rRect = pAct->GetRect();
+ MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
+ Wallpaper aWall( pAct->GetWallpaper() );
+ const Rectangle& rRect = pAct->GetRect();
aWall.SetColor( pFncCol( aWall.GetColor(), pColParam ) );
@@ -2333,15 +2331,15 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_BMPEX_ACTION ):
case( META_MASK_ACTION ):
{
- OSL_FAIL( "Don't use bitmap actions of this type in metafiles!" );
+ DBG_ERROR( "Don't use bitmap actions of this type in metafiles!" );
}
break;
case( META_BMPSCALE_ACTION ):
{
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
- aMtf.Insert( new MetaBmpScaleAction( pAct->GetPoint(), pAct->GetSize(),
- pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ),
+ aMtf.Insert( new MetaBmpScaleAction( pAct->GetPoint(), pAct->GetSize(),
+ pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ),
LIST_APPEND );
}
break;
@@ -2351,7 +2349,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
aMtf.Insert( new MetaBmpScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(),
pAct->GetSrcPoint(), pAct->GetSrcSize(),
- pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ),
+ pFncBmp( pAct->GetBitmap(), pBmpParam ).GetBitmap() ),
LIST_APPEND );
}
break;
@@ -2359,7 +2357,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_BMPEXSCALE_ACTION ):
{
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
- aMtf.Insert( new MetaBmpExScaleAction( pAct->GetPoint(), pAct->GetSize(),
+ aMtf.Insert( new MetaBmpExScaleAction( pAct->GetPoint(), pAct->GetSize(),
pFncBmp( pAct->GetBitmapEx(), pBmpParam ) ),
LIST_APPEND );
}
@@ -2399,7 +2397,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_GRADIENT_ACTION ):
{
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
- Gradient aGradient( pAct->GetGradient() );
+ Gradient aGradient( pAct->GetGradient() );
aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) );
aGradient.SetEndColor( pFncCol( aGradient.GetEndColor(), pColParam ) );
@@ -2410,7 +2408,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_GRADIENTEX_ACTION ):
{
MetaGradientExAction* pAct = (MetaGradientExAction*) pAction;
- Gradient aGradient( pAct->GetGradient() );
+ Gradient aGradient( pAct->GetGradient() );
aGradient.SetStartColor( pFncCol( aGradient.GetStartColor(), pColParam ) );
aGradient.SetEndColor( pFncCol( aGradient.GetEndColor(), pColParam ) );
@@ -2420,8 +2418,8 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_HATCH_ACTION ):
{
- MetaHatchAction* pAct = (MetaHatchAction*) pAction;
- Hatch aHatch( pAct->GetHatch() );
+ MetaHatchAction* pAct = (MetaHatchAction*) pAction;
+ Hatch aHatch( pAct->GetHatch() );
aHatch.SetColor( pFncCol( aHatch.GetColor(), pColParam ) );
aMtf.Insert( new MetaHatchAction( pAct->GetPolyPolygon(), aHatch ), LIST_APPEND );
@@ -2431,24 +2429,24 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_FLOATTRANSPARENT_ACTION ):
{
MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction;
- GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
+ GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
aTransMtf.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam );
- aMtf.Insert( new MetaFloatTransparentAction( aTransMtf,
+ aMtf.Insert( new MetaFloatTransparentAction( aTransMtf,
pAct->GetPoint(), pAct->GetSize(),
- pAct->GetGradient() ),
+ pAct->GetGradient() ),
LIST_APPEND );
}
break;
case( META_EPS_ACTION ):
{
- MetaEPSAction* pAct = (MetaEPSAction*) pAction;
- GDIMetaFile aSubst( pAct->GetSubstitute() );
+ MetaEPSAction* pAct = (MetaEPSAction*) pAction;
+ GDIMetaFile aSubst( pAct->GetSubstitute() );
aSubst.ImplExchangeColors( pFncCol, pColParam, pFncBmp, pBmpParam );
- aMtf.Insert( new MetaEPSAction( pAct->GetPoint(), pAct->GetSize(),
- pAct->GetLink(), aSubst ),
+ aMtf.Insert( new MetaEPSAction( pAct->GetPoint(), pAct->GetSize(),
+ pAct->GetLink(), aSubst ),
LIST_APPEND );
}
break;
@@ -2469,20 +2467,20 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent,
- short nChannelBPercent, double fGamma, sal_Bool bInvert )
+ short nChannelBPercent, double fGamma, BOOL bInvert )
{
// nothing to do? => return quickly
if( nLuminancePercent || nContrastPercent ||
nChannelRPercent || nChannelGPercent || nChannelBPercent ||
( fGamma != 1.0 ) || bInvert )
{
- double fM, fROff, fGOff, fBOff, fOff;
- ImplColAdjustParam aColParam;
- ImplBmpAdjustParam aBmpParam;
+ double fM, fROff, fGOff, fBOff, fOff;
+ ImplColAdjustParam aColParam;
+ ImplBmpAdjustParam aBmpParam;
- aColParam.pMapR = new sal_uInt8[ 256 ];
- aColParam.pMapG = new sal_uInt8[ 256 ];
- aColParam.pMapB = new sal_uInt8[ 256 ];
+ aColParam.pMapR = new BYTE[ 256 ];
+ aColParam.pMapG = new BYTE[ 256 ];
+ aColParam.pMapB = new BYTE[ 256 ];
// calculate slope
if( nContrastPercent >= 0 )
@@ -2493,21 +2491,21 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
// total offset = luminance offset + contrast offset
fOff = MinMax( nLuminancePercent, -100L, 100L ) * 2.55 + 128.0 - fM * 128.0;
- // channel offset = channel offset + total offset
+ // channel offset = channel offset + total offset
fROff = nChannelRPercent * 2.55 + fOff;
fGOff = nChannelGPercent * 2.55 + fOff;
fBOff = nChannelBPercent * 2.55 + fOff;
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const sal_Bool bGamma = ( fGamma != 1.0 );
+ const BOOL bGamma = ( fGamma != 1.0 );
// create mapping table
for( long nX = 0L; nX < 256L; nX++ )
{
- 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 );
+ 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 );
if( bGamma )
{
@@ -2548,8 +2546,8 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
// nothing to do? => return quickly
if( eConversion != MTF_CONVERSION_NONE )
{
- ImplColConvertParam aColParam;
- ImplBmpConvertParam aBmpParam;
+ ImplColConvertParam aColParam;
+ ImplBmpConvertParam aBmpParam;
aColParam.eConversion = eConversion;
aBmpParam.eConversion = ( MTF_CONVERSION_1BIT_THRESHOLD == eConversion ) ? BMP_CONVERSION_1BIT_THRESHOLD : BMP_CONVERSION_8BIT_GREYS;
@@ -2560,41 +2558,41 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
{
ReplaceColors( &rSearchColor, &rReplaceColor, 1, &nTol );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, sal_uLong* pTols )
+void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, ULONG* pTols )
{
ImplColReplaceParam aColParam;
ImplBmpReplaceParam aBmpParam;
- 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 ];
+ 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 ];
- for( sal_uLong i = 0; i < nColorCount; i++ )
+ for( ULONG i = 0; i < nColorCount; i++ )
{
- const long nTol = pTols ? ( pTols[ i ] * 255 ) / 100 : 0;
- long nVal;
+ const long nTol = pTols ? ( pTols[ i ] * 255 ) / 100 : 0;
+ long nVal;
nVal = pSearchColors[ i ].GetRed();
- aColParam.pMinR[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
- aColParam.pMaxR[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
+ aColParam.pMinR[ i ] = (ULONG) Max( nVal - nTol, 0L );
+ aColParam.pMaxR[ i ] = (ULONG) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetGreen();
- aColParam.pMinG[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
- aColParam.pMaxG[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
+ aColParam.pMinG[ i ] = (ULONG) Max( nVal - nTol, 0L );
+ aColParam.pMaxG[ i ] = (ULONG) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetBlue();
- aColParam.pMinB[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
- aColParam.pMaxB[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
+ aColParam.pMinB[ i ] = (ULONG) Max( nVal - nTol, 0L );
+ aColParam.pMaxB[ i ] = (ULONG) Min( nVal + nTol, 255L );
}
aColParam.pDstCols = pReplaceColors;
@@ -2621,8 +2619,8 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
{
GDIMetaFile aRet( *this );
- ImplColMonoParam aColParam;
- ImplBmpMonoParam aBmpParam;
+ ImplColMonoParam aColParam;
+ ImplBmpMonoParam aBmpParam;
aColParam.aColor = rColor;
aBmpParam.aColor = rColor;
@@ -2634,16 +2632,16 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
// ------------------------------------------------------------------------
-sal_uLong GDIMetaFile::GetChecksum() const
+ULONG GDIMetaFile::GetChecksum() const
{
- GDIMetaFile aMtf;
- SvMemoryStream aMemStm( 65535, 65535 );
- ImplMetaWriteData aWriteData; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
- SVBT16 aBT16;
- SVBT32 aBT32;
- sal_uLong nCrc = 0;
+ GDIMetaFile aMtf;
+ SvMemoryStream aMemStm( 65535, 65535 );
+ ImplMetaWriteData aWriteData; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
+ SVBT16 aBT16;
+ SVBT32 aBT32;
+ ULONG nCrc = 0;
- for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
+ for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
{
MetaAction* pAction = GetAction( i );
@@ -2825,7 +2823,7 @@ sal_uLong GDIMetaFile::GetChecksum() const
nCrc = rtl_crc32( nCrc, aBT32, 4 );
}
break;
-
+
case( META_MASKSCALE_ACTION ):
{
MetaMaskScaleAction* pAct = (MetaMaskScaleAction*) pAction;
@@ -2914,11 +2912,11 @@ sal_uLong GDIMetaFile::GetChecksum() const
// ------------------------------------------------------------------------
-sal_uLong GDIMetaFile::GetSizeBytes() const
+ULONG GDIMetaFile::GetSizeBytes() const
{
- sal_uLong nSizeBytes = 0;
+ ULONG nSizeBytes = 0;
- for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
+ for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
{
MetaAction* pAction = GetAction( i );
@@ -2931,22 +2929,22 @@ sal_uLong GDIMetaFile::GetSizeBytes() const
case( META_BMP_ACTION ): nSizeBytes += ( (MetaBmpAction*) pAction )->GetBitmap().GetSizeBytes(); break;
case( META_BMPSCALE_ACTION ): nSizeBytes += ( (MetaBmpScaleAction*) pAction )->GetBitmap().GetSizeBytes(); break;
case( META_BMPSCALEPART_ACTION ): nSizeBytes += ( (MetaBmpScalePartAction*) pAction )->GetBitmap().GetSizeBytes(); break;
-
+
case( META_BMPEX_ACTION ): nSizeBytes += ( (MetaBmpExAction*) pAction )->GetBitmapEx().GetSizeBytes(); break;
case( META_BMPEXSCALE_ACTION ): nSizeBytes += ( (MetaBmpExScaleAction*) pAction )->GetBitmapEx().GetSizeBytes(); break;
case( META_BMPEXSCALEPART_ACTION ): nSizeBytes += ( (MetaBmpExScalePartAction*) pAction )->GetBitmapEx().GetSizeBytes(); break;
-
+
case( META_MASK_ACTION ): nSizeBytes += ( (MetaMaskAction*) pAction )->GetBitmap().GetSizeBytes(); break;
case( META_MASKSCALE_ACTION ): nSizeBytes += ( (MetaMaskScaleAction*) pAction )->GetBitmap().GetSizeBytes(); break;
case( META_MASKSCALEPART_ACTION ): nSizeBytes += ( (MetaMaskScalePartAction*) pAction )->GetBitmap().GetSizeBytes(); break;
-
+
case( META_POLYLINE_ACTION ): nSizeBytes += ( ( (MetaPolyLineAction*) pAction )->GetPolygon().GetSize() * sizeof( Point ) ); break;
case( META_POLYGON_ACTION ): nSizeBytes += ( ( (MetaPolygonAction*) pAction )->GetPolygon().GetSize() * sizeof( Point ) ); break;
case( META_POLYPOLYGON_ACTION ):
{
const PolyPolygon& rPolyPoly = ( (MetaPolyPolygonAction*) pAction )->GetPolyPolygon();
-
- for( sal_uInt16 n = 0; n < rPolyPoly.Count(); ++n )
+
+ for( USHORT n = 0; n < rPolyPoly.Count(); ++n )
nSizeBytes += ( rPolyPoly[ n ].GetSize() * sizeof( Point ) );
}
break;
@@ -2954,22 +2952,22 @@ sal_uLong GDIMetaFile::GetSizeBytes() const
case( META_TEXT_ACTION ): nSizeBytes += ( ( (MetaTextAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
case( META_STRETCHTEXT_ACTION ): nSizeBytes += ( ( (MetaStretchTextAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
case( META_TEXTRECT_ACTION ): nSizeBytes += ( ( (MetaTextRectAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
- case( META_TEXTARRAY_ACTION ):
+ case( META_TEXTARRAY_ACTION ):
{
MetaTextArrayAction* pTextArrayAction = (MetaTextArrayAction*) pAction;
-
+
nSizeBytes += ( pTextArrayAction->GetText().Len() * sizeof( sal_Unicode ) );
-
+
if( pTextArrayAction->GetDXArray() )
nSizeBytes += ( pTextArrayAction->GetLen() << 2 );
}
break;
-
+
default:
break;
}
}
-
+
return( nSizeBytes );
}
@@ -2979,9 +2977,9 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
{
if( !rIStm.GetError() )
{
- char aId[ 7 ];
- sal_uLong nStmPos = rIStm.Tell();
- sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ char aId[ 7 ];
+ ULONG nStmPos = rIStm.Tell();
+ USHORT nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -2992,10 +2990,10 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
if ( !strcmp( aId, "VCLMTF" ) )
{
// new format
- VersionCompat* pCompat;
- MetaAction* pAction;
- sal_uInt32 nStmCompressMode = 0;
- sal_uInt32 nCount = 0;
+ VersionCompat* pCompat;
+ MetaAction* pAction;
+ UINT32 nStmCompressMode = 0;
+ UINT32 nCount = 0;
pCompat = new VersionCompat( rIStm, STREAM_READ );
@@ -3009,7 +3007,7 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
ImplMetaReadData aReadData;
aReadData.meActualCharSet = rIStm.GetStreamCharSet();
- for( sal_uInt32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
+ for( UINT32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
{
pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
@@ -3066,9 +3064,9 @@ SvStream& GDIMetaFile::Read( SvStream& rIStm )
SvStream& GDIMetaFile::Write( SvStream& rOStm )
{
- VersionCompat* pCompat;
- const sal_uInt32 nStmCompressMode = rOStm.GetCompressMode();
- sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ VersionCompat* pCompat;
+ const UINT32 nStmCompressMode = rOStm.GetCompressMode();
+ USHORT nOldFormat = rOStm.GetNumberFormatInt();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rOStm.Write( "VCLMTF", 6 );
@@ -3078,7 +3076,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
rOStm << nStmCompressMode;
rOStm << aPrefMapMode;
rOStm << aPrefSize;
- rOStm << (sal_uInt32) GetActionCount();
+ rOStm << (UINT32) GetActionCount();
delete pCompat;
@@ -3099,22 +3097,22 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
// ------------------------------------------------------------------------
-sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
- BitmapEx& rBmpEx,
+BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
+ BitmapEx& rBmpEx,
const BitmapEx* pOverlay,
const Rectangle* pOverlayRect ) const
{
// the implementation is provided by KA
// initialization seems to be complicated but is used to avoid rounding errors
- VirtualDevice aVDev;
+ VirtualDevice aVDev;
const Point aNullPt;
const Point aTLPix( aVDev.LogicToPixel( aNullPt, GetPrefMapMode() ) );
const Point aBRPix( aVDev.LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) );
Size aDrawSize( aVDev.LogicToPixel( GetPrefSize(), GetPrefMapMode() ) );
- Size aSizePix( labs( aBRPix.X() - aTLPix.X() ) + 1, labs( aBRPix.Y() - aTLPix.Y() ) + 1 );
- Point aPosPix;
-
+ Size aSizePix( labs( aBRPix.X() - aTLPix.X() ) + 1, labs( aBRPix.Y() - aTLPix.Y() ) + 1 );
+ Point aPosPix;
+
if ( !rBmpEx.IsEmpty() )
rBmpEx.SetEmpty();
@@ -3139,23 +3137,23 @@ sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
aSizePix.Width() = nMaximumExtent;
aSizePix.Height() = FRound( nMaximumExtent / fWH );
}
-
+
aDrawSize.Width() = FRound( ( static_cast< double >( aDrawSize.Width() ) * aSizePix.Width() ) / aOldSizePix.Width() );
aDrawSize.Height() = FRound( ( static_cast< double >( aDrawSize.Height() ) * aSizePix.Height() ) / aOldSizePix.Height() );
}
-
- Size aFullSize;
- Point aBackPosPix;
- Rectangle aOverlayRect;
+
+ Size aFullSize;
+ Point aBackPosPix;
+ Rectangle aOverlayRect;
// calculate addigtional positions and sizes if an overlay image is used
if ( pOverlay )
{
aFullSize = Size( nMaximumExtent, nMaximumExtent );
aOverlayRect = Rectangle( aNullPt, aFullSize );
-
+
aOverlayRect.Intersection( pOverlayRect ? *pOverlayRect : Rectangle( aNullPt, pOverlay->GetSizePixel() ) );
-
+
if ( !aOverlayRect.IsEmpty() )
aBackPosPix = Point( ( nMaximumExtent - aSizePix.Width() ) >> 1, ( nMaximumExtent - aSizePix.Height() ) >> 1 );
else
@@ -3166,36 +3164,36 @@ sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
aFullSize = aSizePix;
pOverlay = NULL;
}
-
+
// draw image(s) into VDev and get resulting image
if ( aVDev.SetOutputSizePixel( aFullSize ) )
{
// draw metafile into VDev
const_cast<GDIMetaFile *>(this)->WindStart();
const_cast<GDIMetaFile *>(this)->Play( &aVDev, aBackPosPix, aDrawSize );
-
+
// draw overlay if neccessary
if ( pOverlay )
aVDev.DrawBitmapEx( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), *pOverlay );
-
+
// get paint bitmap
Bitmap aBmp( aVDev.GetBitmap( aNullPt, aVDev.GetOutputSizePixel() ) );
-
+
// assure that we have a true color image
if ( aBmp.GetBitCount() != 24 )
aBmp.Convert( BMP_CONVERSION_24BIT );
-
+
// create resulting mask bitmap with metafile output set to black
GDIMetaFile aMonchromeMtf( GetMonochromeMtf( COL_BLACK ) );
aVDev.DrawWallpaper( Rectangle( aNullPt, aSizePix ), Wallpaper( Color( COL_WHITE ) ) );
aMonchromeMtf.WindStart();
aMonchromeMtf.Play( &aVDev, aBackPosPix, aDrawSize );
-
+
// watch for overlay mask
if ( pOverlay )
{
Bitmap aOverlayMergeBmp( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ) );
-
+
// create ANDed resulting mask at overlay area
if ( pOverlay->IsTransparent() )
aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), pOverlay->GetMask() );
@@ -3204,19 +3202,19 @@ sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
aVDev.SetLineColor( COL_BLACK );
aVDev.SetFillColor( COL_BLACK );
aVDev.DrawRect( aOverlayRect);
- }
-
+ }
+
aOverlayMergeBmp.CombineSimple( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ), BMP_COMBINE_AND );
aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), aOverlayMergeBmp );
}
-
+
rBmpEx = BitmapEx( aBmp, aVDev.GetBitmap( aNullPt, aVDev.GetOutputSizePixel() ) );
}
-
+
return !rBmpEx.IsEmpty();
}
-void GDIMetaFile::UseCanvas( sal_Bool _bUseCanvas )
+void GDIMetaFile::UseCanvas( BOOL _bUseCanvas )
{
bUseCanvas = _bUseCanvas;
}
@@ -3228,7 +3226,7 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe
const void* _pData,
sal_uInt32 nDataSize )
{
- const sal_uInt8* pData=(sal_uInt8*)_pData;
+ const BYTE* pData=(BYTE*)_pData;
// data gets copied twice, unfortunately
rtl::OString aRendererServiceName(
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 29b6a62253a6..8f9dd042e605 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,11 +46,11 @@
// -----------
GfxLink::GfxLink() :
- meType ( GFX_LINK_TYPE_NONE ),
- mpBuf ( NULL ),
- mpSwap ( NULL ),
- mnBufSize ( 0 ),
- mnUserId ( 0UL ),
+ meType ( GFX_LINK_TYPE_NONE ),
+ mpBuf ( NULL ),
+ mpSwap ( NULL ),
+ mnBufSize ( 0 ),
+ mnUserId ( 0UL ),
mpImpData ( new ImpGfxLink )
{
}
@@ -65,7 +65,7 @@ GfxLink::GfxLink( const GfxLink& rGfxLink ) :
// ------------------------------------------------------------------------
-GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns ) :
+GfxLink::GfxLink( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns ) :
mpImpData( new ImpGfxLink )
{
DBG_ASSERT( (pBuf != NULL && nSize) || (!bOwns && nSize == 0),
@@ -83,7 +83,7 @@ GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool
mpBuf = new ImpBuffer( nSize );
memcpy( mpBuf->mpBuffer, pBuf, nSize );
}
- else
+ else
mpBuf = NULL;
}
@@ -132,7 +132,7 @@ sal_Bool GfxLink::IsEqual( const GfxLink& rGfxLink ) const
sal_uInt32 nDestSize = rGfxLink.GetDataSize();
if ( pSource && pDest && ( nSourceSize == nDestSize ) )
{
- bIsEqual = memcmp( pSource, pDest, nSourceSize ) == 0;
+ bIsEqual = memcmp( pSource, pDest, nSourceSize ) == 0;
}
else if ( ( pSource == 0 ) && ( pDest == 0 ) )
bIsEqual = sal_True;
@@ -167,7 +167,7 @@ GfxLinkType GfxLink::GetType() const
// ------------------------------------------------------------------------
-sal_Bool GfxLink::IsNative() const
+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 sal_uInt8* GfxLink::GetData() const
+const BYTE* GfxLink::GetData() const
{
if( IsSwappedOut() )
( (GfxLink*) this )->SwapIn();
@@ -191,7 +191,7 @@ const sal_uInt8* GfxLink::GetData() const
// ------------------------------------------------------------------------
-const Size& GfxLink::GetPrefSize() const
+const Size& GfxLink::GetPrefSize() const
{
return mpImpData->maPrefSize;
}
@@ -235,20 +235,20 @@ bool GfxLink::IsPrefMapModeValid()
// ------------------------------------------------------------------------
-sal_Bool GfxLink::LoadNative( Graphic& rGraphic )
+BOOL GfxLink::LoadNative( Graphic& rGraphic )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( IsNative() && mnBufSize )
{
- const sal_uInt8* pData = GetData();
+ const BYTE* pData = GetData();
if( pData )
{
- SvMemoryStream aMemStm;
- sal_uLong nCvtType;
+ SvMemoryStream aMemStm;
+ ULONG nCvtType;
- aMemStm.SetBuffer( (char*) pData, mnBufSize, sal_False, mnBufSize );
+ aMemStm.SetBuffer( (char*) pData, mnBufSize, FALSE, mnBufSize );
switch( meType )
{
@@ -259,12 +259,12 @@ sal_Bool GfxLink::LoadNative( Graphic& rGraphic )
case( GFX_LINK_TYPE_NATIVE_WMF ): nCvtType = CVT_WMF; break;
case( GFX_LINK_TYPE_NATIVE_MET ): nCvtType = CVT_MET; break;
case( GFX_LINK_TYPE_NATIVE_PCT ): nCvtType = CVT_PCT; break;
-
+
default: nCvtType = CVT_UNKNOWN; break;
}
if( nCvtType && ( GraphicConverter::Import( aMemStm, rGraphic, nCvtType ) == ERRCODE_NONE ) )
- bRet = sal_True;
+ bRet = TRUE;
}
}
@@ -301,7 +301,7 @@ void GfxLink::SwapIn()
if( IsSwappedOut() )
{
mpBuf = new ImpBuffer( mpSwap->GetData() );
-
+
if( !( --mpSwap->mnRefCount ) )
delete mpSwap;
@@ -311,7 +311,7 @@ void GfxLink::SwapIn()
// ------------------------------------------------------------------------
-sal_Bool GfxLink::ExportNative( SvStream& rOStream ) const
+BOOL GfxLink::ExportNative( SvStream& rOStream ) const
{
if( GetDataSize() )
{
@@ -329,15 +329,15 @@ sal_Bool GfxLink::ExportNative( SvStream& rOStream ) const
SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink )
{
VersionCompat* pCompat = new VersionCompat( rOStream, STREAM_WRITE, 2 );
-
+
// Version 1
- rOStream << (sal_uInt16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
-
+ rOStream << (UINT16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
+
// Version 2
- rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode();
-
+ rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode();
+
delete pCompat;
-
+
if( rGfxLink.GetDataSize() )
{
if( rGfxLink.IsSwappedOut() )
@@ -355,12 +355,12 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
{
Size aSize;
MapMode aMapMode;
- sal_uInt32 nSize;
- sal_uInt32 nUserId;
- sal_uInt16 nType;
- sal_uInt8* pBuf;
- bool bMapAndSizeValid( false );
- VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ );
+ sal_uInt32 nSize;
+ sal_uInt32 nUserId;
+ UINT16 nType;
+ BYTE* pBuf;
+ bool bMapAndSizeValid( false );
+ VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ );
// Version 1
rIStream >> nType >> nSize >> nUserId;
@@ -370,13 +370,13 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
rIStream >> aSize >> aMapMode;
bMapAndSizeValid = true;
}
-
+
delete pCompat;
- pBuf = new sal_uInt8[ nSize ];
+ pBuf = new BYTE[ nSize ];
rIStream.Read( pBuf, nSize );
-
- rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, sal_True );
+
+ rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, TRUE );
rGfxLink.SetUserId( nUserId );
if( bMapAndSizeValid )
@@ -392,7 +392,7 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
// - ImpSwap -
// -----------
-ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
+ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
mnDataSize( nDataSize ),
mnRefCount( 1UL )
{
@@ -430,16 +430,16 @@ ImpSwap::~ImpSwap()
// ------------------------------------------------------------------------
-sal_uInt8* ImpSwap::GetData() const
+BYTE* ImpSwap::GetData() const
{
- sal_uInt8* pData;
+ BYTE* pData;
if( IsSwapped() )
{
SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
- pData = new sal_uInt8[ mnDataSize ];
+ pData = new BYTE[ mnDataSize ];
pIStm->Read( pData, mnDataSize );
sal_Bool bError = ( ERRCODE_NONE != pIStm->GetError() );
delete pIStm;
@@ -460,7 +460,7 @@ sal_uInt8* ImpSwap::GetData() const
void ImpSwap::WriteTo( SvStream& rOStm ) const
{
- sal_uInt8* pData = GetData();
+ BYTE* pData = GetData();
if( pData )
{
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index 38d8ba4567a2..d11d62ed6233 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -175,7 +175,7 @@ void Gradient::SetEndColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Gradient::SetAngle( sal_uInt16 nAngle )
+void Gradient::SetAngle( USHORT nAngle )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -185,7 +185,7 @@ void Gradient::SetAngle( sal_uInt16 nAngle )
// -----------------------------------------------------------------------
-void Gradient::SetBorder( sal_uInt16 nBorder )
+void Gradient::SetBorder( USHORT nBorder )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -195,7 +195,7 @@ void Gradient::SetBorder( sal_uInt16 nBorder )
// -----------------------------------------------------------------------
-void Gradient::SetOfsX( sal_uInt16 nOfsX )
+void Gradient::SetOfsX( USHORT nOfsX )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -205,7 +205,7 @@ void Gradient::SetOfsX( sal_uInt16 nOfsX )
// -----------------------------------------------------------------------
-void Gradient::SetOfsY( sal_uInt16 nOfsY )
+void Gradient::SetOfsY( USHORT nOfsY )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -215,7 +215,7 @@ void Gradient::SetOfsY( sal_uInt16 nOfsY )
// -----------------------------------------------------------------------
-void Gradient::SetStartIntensity( sal_uInt16 nIntens )
+void Gradient::SetStartIntensity( USHORT nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -225,7 +225,7 @@ void Gradient::SetStartIntensity( sal_uInt16 nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetEndIntensity( sal_uInt16 nIntens )
+void Gradient::SetEndIntensity( USHORT nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -235,7 +235,7 @@ void Gradient::SetEndIntensity( sal_uInt16 nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetSteps( sal_uInt16 nSteps )
+void Gradient::SetSteps( USHORT nSteps )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -245,99 +245,6 @@ void Gradient::SetSteps( sal_uInt16 nSteps )
// -----------------------------------------------------------------------
-void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Point& rCenter ) const
-{
- Rectangle aRect( rRect );
- sal_uInt16 nAngle = GetAngle() % 3600;
-
- if( GetStyle() == GRADIENT_LINEAR || GetStyle() == GRADIENT_AXIAL )
- {
- aRect.Left()--;
- aRect.Top()--;
- aRect.Right()++;
- aRect.Bottom()++;
-
- const double fAngle = nAngle * F_PI1800;
- const double fWidth = aRect.GetWidth();
- const double fHeight = aRect.GetHeight();
- double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
- double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
-
- fDX = ( fDX - fWidth ) * 0.5 + 0.5;
- fDY = ( fDY - fHeight ) * 0.5 + 0.5;
-
- aRect.Left() -= (long) fDX;
- aRect.Right() += (long) fDX;
- aRect.Top() -= (long) fDY;
- aRect.Bottom() += (long) fDY;
-
- rBoundRect = aRect;
- rCenter = rRect.Center();
- }
- else
- {
-
- if( GetStyle() == GRADIENT_SQUARE || GetStyle() == GRADIENT_RECT )
- {
- const double fAngle = nAngle * F_PI1800;
- const double fWidth = aRect.GetWidth();
- const double fHeight = aRect.GetHeight();
- double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
- double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
-
- fDX = ( fDX - fWidth ) * 0.5 + 0.5;
- fDY = ( fDY - fHeight ) * 0.5 + 0.5;
-
- aRect.Left() -= (long) fDX;
- aRect.Right() += (long) fDX;
- aRect.Top() -= (long) fDY;
- aRect.Bottom() += (long) fDY;
- }
-
- Size aSize( aRect.GetSize() );
-
- if( GetStyle() == GRADIENT_RADIAL )
- {
- // Radien-Berechnung fuer Kreis
- aSize.Width() = (long)(0.5 + sqrt((double)aSize.Width()*(double)aSize.Width() + (double)aSize.Height()*(double)aSize.Height()));
- aSize.Height() = aSize.Width();
- }
- else if( GetStyle() == GRADIENT_ELLIPTICAL )
- {
- // Radien-Berechnung fuer Ellipse
- aSize.Width() = (long)( 0.5 + (double) aSize.Width() * 1.4142 );
- aSize.Height() = (long)( 0.5 + (double) aSize.Height() * 1.4142 );
- }
- else if( GetStyle() == GRADIENT_SQUARE )
- {
- if ( aSize.Width() > aSize.Height() )
- aSize.Height() = aSize.Width();
- else
- aSize.Width() = aSize.Height();
- }
-
- // neue Mittelpunkte berechnen
- long nZWidth = aRect.GetWidth() * (long) GetOfsX() / 100;
- long nZHeight = aRect.GetHeight() * (long) GetOfsY() / 100;
- long nBorderX = (long) GetBorder() * aSize.Width() / 100;
- long nBorderY = (long) GetBorder() * aSize.Height() / 100;
- rCenter = Point( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
-
- // Rand beruecksichtigen
- aSize.Width() -= nBorderX;
- aSize.Height() -= nBorderY;
-
- // Ausgaberechteck neu setzen
- aRect.Left() = rCenter.X() - ( aSize.Width() >> 1 );
- aRect.Top() = rCenter.Y() - ( aSize.Height() >> 1 );
-
- aRect.SetSize( aSize );
- rBoundRect = rRect;
- }
-}
-
-// -----------------------------------------------------------------------
-
Gradient& Gradient::operator=( const Gradient& rGradient )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -359,13 +266,13 @@ Gradient& Gradient::operator=( const Gradient& rGradient )
// -----------------------------------------------------------------------
-sal_Bool Gradient::operator==( const Gradient& rGradient ) const
+BOOL Gradient::operator==( const Gradient& rGradient ) const
{
DBG_CHKTHIS( Gradient, NULL );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
if ( mpImplGradient == rGradient.mpImplGradient )
- return sal_True;
+ return TRUE;
if ( (mpImplGradient->meStyle == rGradient.mpImplGradient->meStyle) ||
(mpImplGradient->mnAngle == rGradient.mpImplGradient->mnAngle) ||
@@ -377,15 +284,15 @@ sal_Bool Gradient::operator==( const Gradient& rGradient ) const
(mpImplGradient->mnIntensityEnd == rGradient.mpImplGradient->mnIntensityEnd) ||
(mpImplGradient->maStartColor == rGradient.mpImplGradient->maStartColor) ||
(mpImplGradient->maEndColor == rGradient.mpImplGradient->maEndColor) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImpl_Gradient )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ UINT16 nTmp16;
rIStm >> nTmp16; rImpl_Gradient.meStyle = (GradientStyle) nTmp16;
@@ -408,7 +315,7 @@ SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImpl_Gradient )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (sal_uInt16) rImpl_Gradient.meStyle <<
+ rOStm << (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 f61bbf8dc041..5f4d3148584b 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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 )
{
- sal_uInt16 nPixel = (sal_uInt16) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
- sal_uInt16 nPixelWidth = nPixel;
+ USHORT nPixel = (USHORT) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
+ USHORT nPixelWidth = nPixel;
Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
- sal_Bool bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
+ 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 )
{
- sal_uInt16 nStart = 0;
- sal_uInt16 nLen = 0;
+ USHORT nStart = 0;
+ USHORT 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-- )
{
- sal_uInt16 nNext = nLen;
+ USHORT 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() );
- sal_uInt16 n = nLen;
+ USHORT 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<sal_uInt16>(nStart + nLen);
+ nStart = sal::static_int_cast<USHORT>(nStart + nLen);
nLen = nNext-nLen;
while( nStart < pText->Len() && pText->GetChar( nStart ) == ' ' )
{
@@ -261,9 +261,9 @@ Graphic::Graphic( const GDIMetaFile& rMtf )
Graphic::Graphic( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic )
{
- uno::Reference< lang::XUnoTunnel > xTunnel( rxGraphic, uno::UNO_QUERY );
- uno::Reference< lang::XTypeProvider > xProv( rxGraphic, uno::UNO_QUERY );
- const ::Graphic* pGraphic = ( ( xTunnel.is() && xProv.is() ) ?
+ uno::Reference< lang::XUnoTunnel > xTunnel( rxGraphic, uno::UNO_QUERY );
+ uno::Reference< lang::XTypeProvider > xProv( rxGraphic, uno::UNO_QUERY );
+ const ::Graphic* pGraphic = ( ( xTunnel.is() && xProv.is() ) ?
reinterpret_cast< ::Graphic* >( xTunnel->getSomething( xProv->getImplementationId() ) ) :
NULL );
@@ -335,21 +335,21 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
// ------------------------------------------------------------------------
-sal_Bool Graphic::operator==( const Graphic& rGraphic ) const
+BOOL Graphic::operator==( const Graphic& rGraphic ) const
{
return( *mpImpGraphic == *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::operator!=( const Graphic& rGraphic ) const
+BOOL Graphic::operator!=( const Graphic& rGraphic ) const
{
return( *mpImpGraphic != *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::operator!() const
+BOOL Graphic::operator!() const
{
return( GRAPHIC_NONE == mpImpGraphic->ImplGetType() );
}
@@ -400,28 +400,28 @@ void Graphic::SetDefaultType()
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsSupportedGraphic() const
+BOOL Graphic::IsSupportedGraphic() const
{
return mpImpGraphic->ImplIsSupportedGraphic();
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsTransparent() const
+BOOL Graphic::IsTransparent() const
{
return mpImpGraphic->ImplIsTransparent();
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsAlpha() const
+BOOL Graphic::IsAlpha() const
{
return mpImpGraphic->ImplIsAlpha();
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsAnimated() const
+BOOL Graphic::IsAnimated() const
{
return mpImpGraphic->ImplIsAnimated();
}
@@ -472,8 +472,8 @@ uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
if( xProv.is() )
{
- uno::Sequence< beans::PropertyValue > aLoadProps( 1 );
- ::rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "private:memorygraphic/" ) );
+ uno::Sequence< beans::PropertyValue > aLoadProps( 1 );
+ ::rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "private:memorygraphic/" ) );
aLoadProps[ 0 ].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
aLoadProps[ 0 ].Value <<= ( aURL += ::rtl::OUString::valueOf( reinterpret_cast< sal_Int64 >( this ) ) );
@@ -532,7 +532,7 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
// ------------------------------------------------------------------
-sal_uLong Graphic::GetSizeBytes() const
+ULONG Graphic::GetSizeBytes() const
{
return mpImpGraphic->ImplGetSizeBytes();
}
@@ -616,7 +616,7 @@ Link Graphic::GetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-sal_uLong Graphic::GetAnimationLoopCount() const
+ULONG Graphic::GetAnimationLoopCount() const
{
return mpImpGraphic->ImplGetAnimationLoopCount();
}
@@ -651,20 +651,20 @@ void Graphic::SetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-sal_uInt16 Graphic::GetGraphicsCompressMode( SvStream& rIStm )
+USHORT Graphic::GetGraphicsCompressMode( SvStream& rIStm )
{
- const sal_uLong nPos = rIStm.Tell();
- const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
- sal_uInt32 nTmp32;
- sal_uInt16 nTmp16;
- sal_uInt16 nCompressMode = COMPRESSMODE_NONE;
+ const ULONG nPos = rIStm.Tell();
+ const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ UINT32 nTmp32;
+ UINT16 nTmp16;
+ USHORT nCompressMode = COMPRESSMODE_NONE;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rIStm >> nTmp32;
// is it a swapped graphic with a bitmap?
- rIStm.SeekRel( (nTmp32 == (sal_uInt32) GRAPHIC_BITMAP ) ? 40 : -4 );
+ rIStm.SeekRel( (nTmp32 == (UINT32) GRAPHIC_BITMAP ) ? 40 : -4 );
// try to read bitmap id
rIStm >> nTmp16;
@@ -689,7 +689,7 @@ sal_uInt16 Graphic::GetGraphicsCompressMode( SvStream& rIStm )
// ------------------------------------------------------------------------
-void Graphic::SetDocFileName( const String& rName, sal_uLong nFilePos )
+void Graphic::SetDocFileName( const String& rName, ULONG nFilePos )
{
mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
}
@@ -703,14 +703,14 @@ const String& Graphic::GetDocFileName() const
// ------------------------------------------------------------------------
-sal_uLong Graphic::GetDocFilePos() const
+ULONG Graphic::GetDocFilePos() const
{
return mpImpGraphic->ImplGetDocFilePos();
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::ReadEmbedded( SvStream& rIStream, sal_Bool bSwap )
+BOOL Graphic::ReadEmbedded( SvStream& rIStream, BOOL bSwap )
{
ImplTestRefCount();
return mpImpGraphic->ImplReadEmbedded( rIStream, bSwap );
@@ -718,7 +718,7 @@ sal_Bool Graphic::ReadEmbedded( SvStream& rIStream, sal_Bool bSwap )
// ------------------------------------------------------------------------
-sal_Bool Graphic::WriteEmbedded( SvStream& rOStream )
+BOOL Graphic::WriteEmbedded( SvStream& rOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplWriteEmbedded( rOStream );
@@ -726,7 +726,7 @@ sal_Bool Graphic::WriteEmbedded( SvStream& rOStream )
// ------------------------------------------------------------------------
-sal_Bool Graphic::SwapOut()
+BOOL Graphic::SwapOut()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut();
@@ -734,7 +734,7 @@ sal_Bool Graphic::SwapOut()
// ------------------------------------------------------------------------
-sal_Bool Graphic::SwapOut( SvStream* pOStream )
+BOOL Graphic::SwapOut( SvStream* pOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut( pOStream );
@@ -742,7 +742,7 @@ sal_Bool Graphic::SwapOut( SvStream* pOStream )
// ------------------------------------------------------------------------
-sal_Bool Graphic::SwapIn()
+BOOL Graphic::SwapIn()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn();
@@ -750,7 +750,7 @@ sal_Bool Graphic::SwapIn()
// ------------------------------------------------------------------------
-sal_Bool Graphic::SwapIn( SvStream* pStrm )
+BOOL Graphic::SwapIn( SvStream* pStrm )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn( pStrm );
@@ -758,7 +758,7 @@ sal_Bool Graphic::SwapIn( SvStream* pStrm )
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsSwapOut() const
+BOOL Graphic::IsSwapOut() const
{
return mpImpGraphic->ImplIsSwapOut();
}
@@ -780,21 +780,21 @@ GfxLink Graphic::GetLink() const
// ------------------------------------------------------------------------
-sal_Bool Graphic::IsLink() const
+BOOL Graphic::IsLink() const
{
return mpImpGraphic->ImplIsLink();
}
// ------------------------------------------------------------------------
-sal_uLong Graphic::GetChecksum() const
+ULONG Graphic::GetChecksum() const
{
return mpImpGraphic->ImplGetChecksum();
}
// ------------------------------------------------------------------------
-sal_Bool Graphic::ExportNative( SvStream& rOStream ) const
+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 2e20a3639790..49236ae44e7f 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
static ::rtl::OString polyToString( const Polygon& rPoly )
{
::rtl::OString aStr;
- sal_uInt16 nVertex;
+ USHORT nVertex;
for(nVertex=0; nVertex<rPoly.GetSize(); ++nVertex)
{
aStr += "(";
@@ -52,14 +52,14 @@ static ::rtl::OString polyToString( const Polygon& rPoly )
break;
default:
- OSL_FAIL( "SvtGraphicStroke::polyToString invalid flag");
+ DBG_ERROR( "SvtGraphicStroke::polyToString invalid flag");
break;
}
aStr += ::rtl::OString::valueOf( static_cast< double >( rPoly[nVertex].getX() ) );
aStr += ",";
aStr += ::rtl::OString::valueOf( static_cast< double >( rPoly[nVertex].getY() ) );
aStr += ") ";
- }
+ }
return aStr;
}
@@ -67,7 +67,7 @@ static ::rtl::OString polyToString( const Polygon& rPoly )
static ::rtl::OString polyPolyToString( const PolyPolygon& rPolyPoly )
{
::rtl::OString aStr;
- sal_uInt16 nPoly;
+ USHORT nPoly;
for(nPoly=0; nPoly<rPolyPoly.Count(); ++nPoly)
{
const Polygon& rPoly = rPolyPoly[nPoly];
@@ -119,7 +119,7 @@ SvtGraphicFill::Transform::Transform()
{
matrix[0] = 1.0; matrix[1] = 0.0; matrix[2] = 0.0;
matrix[3] = 0.0; matrix[4] = 1.0; matrix[5] = 0.0;
-}
+}
////////////////////////////////////////////////////////////////////////////
@@ -133,18 +133,18 @@ SvtGraphicStroke::SvtGraphicStroke() :
maJoinType(),
mfMiterLimit( 3.0 ),
maDashArray()
-{
-}
-
-SvtGraphicStroke::SvtGraphicStroke( const Polygon& rPath,
- const PolyPolygon& rStartArrow,
- const PolyPolygon& rEndArrow,
- double fTransparency,
- double fStrokeWidth,
- CapType aCap,
- JoinType aJoin,
- double fMiterLimit,
- const DashArray& rDashArray ) :
+{
+}
+
+SvtGraphicStroke::SvtGraphicStroke( const Polygon& rPath,
+ const PolyPolygon& rStartArrow,
+ const PolyPolygon& rEndArrow,
+ double fTransparency,
+ double fStrokeWidth,
+ CapType aCap,
+ JoinType aJoin,
+ double fMiterLimit,
+ const DashArray& rDashArray ) :
maPath( rPath ),
maStartArrow( rStartArrow ),
maEndArrow( rEndArrow ),
@@ -208,7 +208,7 @@ void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
aStr += polyToString( maPath );
aStr += "trans: ";
- aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
+ aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
aStr += " width: ";
aStr += ::rtl::OString::valueOf( static_cast< double >(getStrokeWidth()) );
aStr += " cap: ";
@@ -227,7 +227,7 @@ void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing cap type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing cap type");
break;
}
aStr += " join: ";
@@ -250,7 +250,7 @@ void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing join type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing join type");
break;
}
aStr += " ";
@@ -322,15 +322,15 @@ void SvtGraphicStroke::setDashArray( const DashArray& rDashArray )
SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
-
+
rClass.maPath.Write( rOStm );
rClass.maStartArrow.Write( rOStm );
rClass.maEndArrow.Write( rOStm );
rOStm << rClass.mfTransparency;
rOStm << rClass.mfStrokeWidth;
- sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maCapType );
+ UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maCapType );
rOStm << nTmp;
- nTmp = sal::static_int_cast<sal_uInt16>( rClass.maJoinType );
+ nTmp = sal::static_int_cast<UINT16>( rClass.maJoinType );
rOStm << nTmp;
rOStm << rClass.mfMiterLimit;
@@ -345,13 +345,13 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass )
SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass )
{
VersionCompat aCompat( rIStm, STREAM_READ );
-
+
rClass.maPath.Read( rIStm );
rClass.maStartArrow.Read( rIStm );
rClass.maEndArrow.Read( rIStm );
rIStm >> rClass.mfTransparency;
rIStm >> rClass.mfStrokeWidth;
- sal_uInt16 nTmp;
+ UINT16 nTmp;
rIStm >> nTmp;
rClass.maCapType = SvtGraphicStroke::CapType(nTmp);
rIStm >> nTmp;
@@ -364,7 +364,7 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass )
size_t i;
for(i=0; i<rClass.maDashArray.size(); ++i)
rIStm >> rClass.maDashArray[i];
-
+
return rIStm;
}
@@ -388,20 +388,20 @@ SvtGraphicFill::SvtGraphicFill() :
{
}
-SvtGraphicFill::SvtGraphicFill( const PolyPolygon& rPath,
- Color aFillColor,
- double fTransparency,
- FillRule aFillRule,
- FillType aFillType,
- const Transform& aFillTransform,
- bool bTiling,
- HatchType aHatchType,
- Color aHatchColor,
- GradientType aGradientType,
- Color aGradient1stColor,
- Color aGradient2ndColor,
- int aGradientStepCount,
- const Graphic& aFillGraphic ) :
+SvtGraphicFill::SvtGraphicFill( const PolyPolygon& rPath,
+ Color aFillColor,
+ double fTransparency,
+ FillRule aFillRule,
+ FillType aFillType,
+ const Transform& aFillTransform,
+ bool bTiling,
+ HatchType aHatchType,
+ Color aHatchColor,
+ GradientType aGradientType,
+ Color aGradient1stColor,
+ Color aGradient2ndColor,
+ int aGradientStepCount,
+ const Graphic& aFillGraphic ) :
maPath( rPath ),
maFillColor( aFillColor ),
mfTransparency( fTransparency ),
@@ -502,7 +502,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
aStr += "fill";
aStr += colorToString( getFillColor() );
aStr += " trans: ";
- aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
+ aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
aStr += " rule: ";
switch( getFillRule() )
{
@@ -515,7 +515,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- OSL_FAIL( "SvtGraphicFill::toString missing fill rule");
+ DBG_ERROR( "SvtGraphicFill::toString missing fill rule");
break;
}
aStr += " type: ";
@@ -538,14 +538,14 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing fill type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing fill type");
break;
}
aStr += " transform: [ ";
int i;
for(i=0; i<Transform::MatrixSize; ++i)
- aStr += ::rtl::OString::valueOf( maFillTransform.matrix[i] );
+ aStr += ::rtl::OString::valueOf( maFillTransform.matrix[i] );
aStr += " ] ";
aStr += " hatch: ";
@@ -564,7 +564,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing hatch type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing hatch type");
break;
}
@@ -587,7 +587,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing gradient type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing gradient type");
break;
}
@@ -606,24 +606,24 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
switch( maFillGraphic.GetType() )
{
case GRAPHIC_BITMAP:
- aStr += "bitmap";
+ aStr += "bitmap";
break;
case GRAPHIC_GDIMETAFILE:
- aStr += "metafile";
+ aStr += "metafile";
break;
case GRAPHIC_DEFAULT:
- aStr += "default";
+ aStr += "default";
break;
default:
- OSL_FAIL( "SvtGraphicStroke::toString missing graphic type");
+ DBG_ERROR( "SvtGraphicStroke::toString missing graphic type");
break;
}
aStr += " of ";
- aStr += ::rtl::OString::valueOf( static_cast< sal_Int32 >(maFillGraphic.GetSizeBytes()) );
+ aStr += ::rtl::OString::valueOf( static_cast< sal_Int32 >(maFillGraphic.GetSizeBytes()) );
aStr += " bytes";
}
@@ -703,23 +703,23 @@ void SvtGraphicFill::setGraphic( const Graphic& rGraphic )
SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
-
+
rClass.maPath.Write( rOStm );
rOStm << rClass.maFillColor;
rOStm << rClass.mfTransparency;
- sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillRule );
+ UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maFillRule );
rOStm << nTmp;
- nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillType );
+ nTmp = sal::static_int_cast<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<sal_uInt16>( rClass.maHatchType );
+ nTmp = sal::static_int_cast<UINT16>( rClass.maHatchType );
rOStm << nTmp;
rOStm << rClass.maHatchColor;
- nTmp = sal::static_int_cast<sal_uInt16>( rClass.maGradientType );
+ nTmp = sal::static_int_cast<UINT16>( rClass.maGradientType );
rOStm << nTmp;
rOStm << rClass.maGradient1stColor;
rOStm << rClass.maGradient2ndColor;
@@ -732,11 +732,11 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass )
SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass )
{
VersionCompat aCompat( rIStm, STREAM_READ );
-
+
rClass.maPath.Read( rIStm );
rIStm >> rClass.maFillColor;
rIStm >> rClass.mfTransparency;
- sal_uInt16 nTmp;
+ 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 9836b2e6e4b4..b8a2a55d4c4d 100644
--- a/vcl/source/gdi/hatch.cxx
+++ b/vcl/source/gdi/hatch.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,22 +40,22 @@ DBG_NAME( Hatch )
// --------------
ImplHatch::ImplHatch() :
- mnRefCount ( 1 ),
- maColor ( COL_BLACK ),
- meStyle ( HATCH_SINGLE ),
- mnDistance ( 1 ),
- mnAngle ( 0 )
+ mnRefCount ( 1 ),
+ maColor ( COL_BLACK ),
+ meStyle ( HATCH_SINGLE ),
+ mnDistance ( 1 ),
+ mnAngle ( 0 )
{
}
// -----------------------------------------------------------------------
ImplHatch::ImplHatch( const ImplHatch& rImplHatch ) :
- mnRefCount ( 1 ),
- maColor ( rImplHatch.maColor ),
- meStyle ( rImplHatch.meStyle ),
- mnDistance ( rImplHatch.mnDistance ),
- mnAngle ( rImplHatch.mnAngle )
+ mnRefCount ( 1 ),
+ maColor ( rImplHatch.maColor ),
+ meStyle ( rImplHatch.meStyle ),
+ mnDistance ( rImplHatch.mnDistance ),
+ mnAngle ( rImplHatch.mnAngle )
{
}
@@ -82,7 +82,7 @@ Hatch::Hatch( const Hatch& rHatch )
// -----------------------------------------------------------------------
Hatch::Hatch( HatchStyle eStyle, const Color& rColor,
- long nDistance, sal_uInt16 nAngle10 )
+ long nDistance, USHORT nAngle10 )
{
DBG_CTOR( Hatch, NULL );
mpImplHatch = new ImplHatch;
@@ -112,14 +112,14 @@ Hatch& Hatch::operator=( const Hatch& rHatch )
if( !( --mpImplHatch->mnRefCount ) )
delete mpImplHatch;
-
+
mpImplHatch = rHatch.mpImplHatch;
return *this;
}
// -----------------------------------------------------------------------
-sal_Bool Hatch::operator==( const Hatch& rHatch ) const
+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( sal_uInt16 nAngle10 )
+void Hatch::SetAngle( USHORT nAngle10 )
{
DBG_CHKTHIS( Hatch, NULL );
ImplMakeUnique();
@@ -184,8 +184,8 @@ void Hatch::SetAngle( sal_uInt16 nAngle10 )
SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ 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 << (sal_uInt16) rImplHatch.meStyle << rImplHatch.maColor;
+ rOStm << (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 24c86c326910..47c77da623a4 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <boost/scoped_ptr.hpp>
-#include <boost/scoped_array.hpp>
-
+#include <boost/scoped_ptr.hpp>
+#include <boost/scoped_array.hpp>
+
#include <rtl/logfile.hxx>
#include <tools/debug.hxx>
#include <tools/stream.hxx>
@@ -44,7 +44,6 @@
#include <vcl/impimagetree.hxx>
#include <vcl/image.h>
#include <vcl/image.hxx>
-#include <vcl/imagerepository.hxx>
#if OSL_DEBUG_LEVEL > 0
#include <rtl/strbuf.hxx>
@@ -81,8 +80,8 @@ Image::Image( const ResId& rResId ) :
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- BitmapEx aBmpEx;
- sal_uLong nObjMask = pResMgr->ReadLong();
+ BitmapEx aBmpEx;
+ ULONG nObjMask = pResMgr->ReadLong();
if( nObjMask & RSC_IMAGE_IMAGEBITMAP )
{
@@ -155,7 +154,7 @@ Image::Image( const Bitmap& rBitmap, const Bitmap& rMaskBitmap ) :
DBG_CTOR( Image, NULL );
const BitmapEx aBmpEx( rBitmap, rMaskBitmap );
-
+
ImplInit( aBmpEx );
}
@@ -167,7 +166,7 @@ Image::Image( const Bitmap& rBitmap, const Color& rColor ) :
DBG_CTOR( Image, NULL );
const BitmapEx aBmpEx( rBitmap, rColor );
-
+
ImplInit( aBmpEx );
}
@@ -177,7 +176,7 @@ Image::Image( const uno::Reference< graphic::XGraphic >& rxGraphic ) :
mpImplData( NULL )
{
DBG_CTOR( Image, NULL );
-
+
const Graphic aGraphic( rxGraphic );
ImplInit( aGraphic.GetBitmapEx() );
}
@@ -219,7 +218,7 @@ void Image::ImplInit( const BitmapEx& rBmpEx )
Size Image::GetSizePixel() const
{
DBG_CHKTHIS( Image, NULL );
-
+
Size aRet;
if( mpImplData )
@@ -244,7 +243,7 @@ Size Image::GetSizePixel() const
BitmapEx Image::GetBitmapEx() const
{
DBG_CHKTHIS( Image, NULL );
-
+
BitmapEx aRet;
if( mpImplData )
@@ -269,12 +268,57 @@ BitmapEx Image::GetBitmapEx() const
uno::Reference< graphic::XGraphic > Image::GetXGraphic() const
{
const Graphic aGraphic( GetBitmapEx() );
-
+
return aGraphic.GetXGraphic();
}
// -----------------------------------------------------------------------
+Image Image::GetColorTransformedImage( ImageColorTransform eColorTransform ) const
+{
+ DBG_CHKTHIS( Image, NULL );
+
+ Image aRet;
+
+ if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
+ {
+ BitmapEx aBmpEx( GetBitmapEx() );
+
+ if( !aBmpEx.IsEmpty() )
+ {
+ Color* pSrcColors = NULL;
+ Color* pDstColors = NULL;
+ ULONG nColorCount = 0;
+
+ Image::GetColorTransformArrays( eColorTransform, pSrcColors, pDstColors, nColorCount );
+
+ if( nColorCount && pSrcColors && pDstColors )
+ {
+ aBmpEx.Replace( pSrcColors, pDstColors, nColorCount );
+ aRet = Image( aBmpEx );
+ }
+
+ delete[] pSrcColors;
+ delete[] pDstColors;
+ }
+ }
+ else if( IMAGECOLORTRANSFORM_MONOCHROME_BLACK == eColorTransform ||
+ IMAGECOLORTRANSFORM_MONOCHROME_WHITE == eColorTransform )
+ {
+ BitmapEx aBmpEx( GetBitmapEx() );
+
+ if( !aBmpEx.IsEmpty() )
+ aRet = Image( aBmpEx.GetColorTransformedBitmapEx( ( BmpColorMode )( eColorTransform ) ) );
+ }
+
+ if( !aRet )
+ aRet = *this;
+
+ return aRet;
+}
+
+// -----------------------------------------------------------------------
+
void Image::Invert()
{
BitmapEx aInvertedBmp( GetBitmapEx() );
@@ -285,7 +329,7 @@ void Image::Invert()
// -----------------------------------------------------------------------
void Image::GetColorTransformArrays( ImageColorTransform eColorTransform,
- Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount )
+ Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount )
{
if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
{
@@ -324,7 +368,7 @@ Image& Image::operator=( const Image& rImage )
if( mpImplData && ( 0 == --mpImplData->mnRefCount ) )
delete mpImplData;
-
+
mpImplData = rImage.mpImplData;
return *this;
@@ -332,11 +376,11 @@ Image& Image::operator=( const Image& rImage )
// -----------------------------------------------------------------------
-sal_Bool Image::operator==( const Image& rImage ) const
+BOOL Image::operator==( const Image& rImage ) const
{
DBG_CHKTHIS( Image, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
-
+
bool bRet = false;
if( rImage.mpImplData == mpImplData )
@@ -356,7 +400,7 @@ sal_Bool Image::operator==( const Image& rImage ) const
case IMAGETYPE_IMAGE:
bRet = static_cast< ImplImageData* >( rImage.mpImplData->mpData )->IsEqual( *static_cast< ImplImageData* >( mpImplData->mpData ) );
break;
-
+
default:
bRet = false;
break;
@@ -370,7 +414,7 @@ sal_Bool Image::operator==( const Image& rImage ) const
// - ImageList -
// -------------
-ImageList::ImageList( sal_uInt16 nInit, sal_uInt16 nGrow ) :
+ImageList::ImageList( USHORT nInit, USHORT nGrow ) :
mpImplData( NULL ),
mnInitSize( nInit ),
mnGrowSize( nGrow )
@@ -388,38 +432,38 @@ ImageList::ImageList( const ResId& rResId ) :
RTL_LOGFILE_CONTEXT( aLog, "vcl: ImageList::ImageList( const ResId& rResId )" );
DBG_CTOR( ImageList, NULL );
-
+
rResId.SetRT( RSC_IMAGELIST );
-
+
ResMgr* pResMgr = rResId.GetResMgr();
if( pResMgr && pResMgr->GetResource( rResId ) )
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- sal_uLong nObjMask = pResMgr->ReadLong();
- const String aPrefix( pResMgr->ReadString() );
+ ULONG nObjMask = pResMgr->ReadLong();
+ const String aPrefix( pResMgr->ReadString() );
::boost::scoped_ptr< Color > spMaskColor;
if( nObjMask & RSC_IMAGE_MASKCOLOR )
spMaskColor.reset( new Color( ResId( (RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ) );
-
+
pResMgr->Increment( pResMgr->GetObjSize( (RSHEADER_TYPE*)pResMgr->GetClass() ) );
-
+
if( nObjMask & RSC_IMAGELIST_IDLIST )
{
for( sal_Int32 i = 0, nCount = pResMgr->ReadLong(); i < nCount; ++i )
pResMgr->ReadLong();
}
-
+
sal_Int32 nCount = pResMgr->ReadLong();
- ImplInit( static_cast< sal_uInt16 >( nCount ), Size() );
+ ImplInit( static_cast< USHORT >( nCount ), Size() );
BitmapEx aEmpty;
for( sal_Int32 i = 0; i < nCount; ++i )
{
rtl::OUString aName = pResMgr->ReadString();
- sal_uInt16 nId = static_cast< sal_uInt16 >( pResMgr->ReadLong() );
+ USHORT nId = static_cast< USHORT >( pResMgr->ReadLong() );
mpImplData->AddImage( aName, nId, aEmpty );
}
@@ -430,8 +474,8 @@ ImageList::ImageList( const ResId& rResId ) :
// -----------------------------------------------------------------------
-ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
- const ::rtl::OUString& rPrefix,
+ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
+ const ::rtl::OUString& rPrefix,
const Color* ) :
mpImplData( NULL ),
mnInitSize( 1 ),
@@ -441,12 +485,14 @@ ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
DBG_CTOR( ImageList, NULL );
- ImplInit( sal::static_int_cast< sal_uInt16 >( rNameVector.size() ), Size() );
+ ImplInit( sal::static_int_cast< USHORT >( rNameVector.size() ), Size() );
mpImplData->maPrefix = rPrefix;
for( sal_uInt32 i = 0; i < rNameVector.size(); ++i )
{
- mpImplData->AddImage( rNameVector[ i ], static_cast< sal_uInt16 >( i ) + 1, BitmapEx() );
+// fprintf (stderr, "List %p [%d]: '%s'\n",
+// this, i, rtl::OUStringToOString( rNameVector[i], RTL_TEXTENCODING_UTF8 ).getStr() );
+ mpImplData->AddImage( rNameVector[ i ], static_cast< USHORT >( i ) + 1, BitmapEx() );
}
}
@@ -473,7 +519,7 @@ ImageList::~ImageList()
delete mpImplData;
}
-void ImageList::ImplInit( sal_uInt16 nItems, const Size &rSize )
+void ImageList::ImplInit( USHORT nItems, const Size &rSize )
{
mpImplData = new ImplImageList;
mpImplData->mnRefCount = 1;
@@ -491,6 +537,9 @@ void ImageAryData::Load(const rtl::OUString &rPrefix)
BitmapEx aBmpEx;
+// fprintf (stderr, "Attempt load of '%s'\n",
+// rtl::OUStringToOString( maName, RTL_TEXTENCODING_UTF8 ).getStr() );
+
rtl::OUString aFileName = rPrefix;
aFileName += maName;
#if OSL_DEBUG_LEVEL > 0
@@ -504,7 +553,7 @@ void ImageAryData::Load(const rtl::OUString &rPrefix)
aMessage.append( "ImageAryData::Load: failed to load image '" );
aMessage.append( ::rtl::OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8 ).getStr() );
aMessage.append( "'" );
- OSL_FAIL( aMessage.makeStringAndClear().getStr() );
+ OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() );
}
#endif
}
@@ -525,13 +574,13 @@ void ImageList::ImplMakeUnique()
BitmapEx ImageList::GetAsHorizontalStrip() const
{
Size aSize( mpImplData->maImageSize );
- sal_uInt16 nCount = GetImageCount();
+ USHORT nCount = GetImageCount();
if( !nCount )
return BitmapEx();
aSize.Width() *= nCount;
// Load any stragglers
- for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
+ for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
{
ImageAryData *pData = mpImplData->maImages[ nIdx ];
if( pData->IsLoadable() )
@@ -549,7 +598,7 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
aResult = BitmapEx( aPixels );
Rectangle aSrcRect( Point( 0, 0 ), mpImplData->maImageSize );
- for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
+ for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
{
Rectangle aDestRect( Point( nIdx * mpImplData->maImageSize.Width(), 0 ),
mpImplData->maImageSize );
@@ -565,7 +614,9 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector )
{
- sal_uInt16 nItems = sal::static_int_cast< sal_uInt16 >( rNameVector.size() );
+ USHORT nItems = sal::static_int_cast< USHORT >( rNameVector.size() );
+
+// fprintf (stderr, "InsertFromHorizontalStrip (1) [%d items]\n", nItems);
if (!nItems)
return;
@@ -576,7 +627,7 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
aSize.Width() /= nItems;
ImplInit( nItems, aSize );
- for (sal_uInt16 nIdx = 0; nIdx < nItems; nIdx++)
+ for (USHORT nIdx = 0; nIdx < nItems; nIdx++)
{
BitmapEx aBitmap( rBitmapEx, Point( nIdx * aSize.Width(), 0 ), aSize );
mpImplData->AddImage( rNameVector[ nIdx ], nIdx + 1, aBitmap );
@@ -586,11 +637,11 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
// -----------------------------------------------------------------------
void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
- sal_uInt16 nCount,
+ USHORT nCount,
const Color *pMaskColor,
- const Color *pSearchColors,
+ const Color *pSearchColors,
const Color *pReplaceColors,
- sal_uLong nColorCount)
+ ULONG nColorCount)
{
BitmapEx aBmpEx( rResId );
if (!aBmpEx.IsTransparent())
@@ -602,14 +653,14 @@ void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
}
if ( nColorCount && pSearchColors && pReplaceColors )
aBmpEx.Replace( pSearchColors, pReplaceColors, nColorCount );
-
+
std::vector< rtl::OUString > aNames( nCount );
InsertFromHorizontalStrip( aBmpEx, aNames );
}
// -----------------------------------------------------------------------
-sal_uInt16 ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
+USHORT ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -622,7 +673,7 @@ sal_uInt16 ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-void ImageList::AddImage( sal_uInt16 nId, const Image& rImage )
+void ImageList::AddImage( USHORT nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -652,7 +703,7 @@ void ImageList::AddImage( const ::rtl::OUString& rImageName, const Image& rImage
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( sal_uInt16 nId, const Image& rImage )
+void ImageList::ReplaceImage( USHORT nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -666,12 +717,12 @@ void ImageList::ReplaceImage( sal_uInt16 nId, const Image& rImage )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage )
{
- const sal_uInt16 nId = ImplGetImageId( rImageName );
+ const USHORT nId = ImplGetImageId( rImageName );
if( nId )
{
RemoveImage( nId );
-
+
if( !mpImplData )
ImplInit( 0, rImage.GetSizePixel() );
mpImplData->AddImage( rImageName, nId, rImage.GetBitmapEx());
@@ -680,14 +731,14 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rI
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId )
+void ImageList::ReplaceImage( USHORT nId, USHORT 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" );
- sal_uLong nPosDest = GetImagePos( nId );
- sal_uLong nPosSrc = GetImagePos( nReplaceId );
+ ULONG nPosDest = GetImagePos( nId );
+ ULONG nPosSrc = GetImagePos( nReplaceId );
if( nPosDest != IMAGELIST_IMAGE_NOTFOUND &&
nPosSrc != IMAGELIST_IMAGE_NOTFOUND )
{
@@ -700,7 +751,7 @@ void ImageList::ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName )
{
- const sal_uInt16 nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
+ const USHORT nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
if( nId1 && nId2 )
ReplaceImage( nId1, nId2 );
@@ -708,7 +759,7 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OU
// -----------------------------------------------------------------------
-void ImageList::RemoveImage( sal_uInt16 nId )
+void ImageList::RemoveImage( USHORT nId )
{
DBG_CHKTHIS( ImageList, NULL );
@@ -716,7 +767,7 @@ void ImageList::RemoveImage( sal_uInt16 nId )
{
if( mpImplData->maImages[ i ]->mnId == nId )
{
- mpImplData->RemoveImage( static_cast< sal_uInt16 >( i ) );
+ mpImplData->RemoveImage( static_cast< USHORT >( i ) );
break;
}
}
@@ -726,7 +777,7 @@ void ImageList::RemoveImage( sal_uInt16 nId )
void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
{
- const sal_uInt16 nId = ImplGetImageId( rImageName );
+ const USHORT nId = ImplGetImageId( rImageName );
if( nId )
RemoveImage( nId );
@@ -734,17 +785,19 @@ void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
// -----------------------------------------------------------------------
-Image ImageList::GetImage( sal_uInt16 nId ) const
+Image ImageList::GetImage( USHORT nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
+// fprintf (stderr, "GetImage %d\n", nId);
+
Image aRet;
if( mpImplData )
{
std::vector<ImageAryData *>::iterator aIter;
for( aIter = mpImplData->maImages.begin();
- aIter != mpImplData->maImages.end(); ++aIter)
+ aIter != mpImplData->maImages.end(); aIter++)
{
if ((*aIter)->mnId == nId)
{
@@ -756,14 +809,6 @@ Image ImageList::GetImage( sal_uInt16 nId ) const
}
}
- if (!aRet)
- {
- BitmapEx rBitmap;
- bool res = ::vcl::ImageRepository::loadDefaultImage(rBitmap);
- if (res)
- aRet = Image(rBitmap);
- }
-
return aRet;
}
@@ -771,10 +816,13 @@ Image ImageList::GetImage( sal_uInt16 nId ) const
Image ImageList::GetImage( const ::rtl::OUString& rImageName ) const
{
+// fprintf (stderr, "GetImage '%s'\n",
+// rtl::OUStringToOString( rImageName, RTL_TEXTENCODING_UTF8 ).getStr() );
+
if( mpImplData )
{
ImageAryData *pImg = mpImplData->maNameHash[ rImageName ];
-
+
if( pImg )
{
if( pImg->IsLoadable() )
@@ -782,6 +830,7 @@ Image ImageList::GetImage( const ::rtl::OUString& rImageName ) const
return Image( pImg->maBitmapEx );
}
}
+// fprintf (stderr, "no such image\n");
return Image();
}
@@ -800,16 +849,16 @@ void ImageList::Clear()
// -----------------------------------------------------------------------
-sal_uInt16 ImageList::GetImageCount() const
+USHORT ImageList::GetImageCount() const
{
DBG_CHKTHIS( ImageList, NULL );
-
- return mpImplData ? static_cast< sal_uInt16 >( mpImplData->maImages.size() ) : 0;
+
+ return mpImplData ? static_cast< USHORT >( mpImplData->maImages.size() ) : 0;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImageList::GetImagePos( sal_uInt16 nId ) const
+USHORT ImageList::GetImagePos( USHORT nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -818,21 +867,21 @@ sal_uInt16 ImageList::GetImagePos( sal_uInt16 nId ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); ++i )
{
if (mpImplData->maImages[ i ]->mnId == nId)
- return static_cast< sal_uInt16 >( i );
+ return static_cast< USHORT >( i );
}
}
return IMAGELIST_IMAGE_NOTFOUND;
}
-bool ImageList::HasImageAtPos( sal_uInt16 nId ) const
+bool ImageList::HasImageAtPos( USHORT nId ) const
{
return GetImagePos( nId ) != IMAGELIST_IMAGE_NOTFOUND;
}
// -----------------------------------------------------------------------
-sal_uInt16 ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
+USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -841,7 +890,7 @@ sal_uInt16 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< sal_uInt16 >( i );
+ return static_cast< USHORT >( i );
}
}
@@ -850,7 +899,7 @@ sal_uInt16 ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-sal_uInt16 ImageList::GetImageId( sal_uInt16 nPos ) const
+USHORT ImageList::GetImageId( USHORT nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -862,14 +911,14 @@ sal_uInt16 ImageList::GetImageId( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-void ImageList::GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const
+void ImageList::GetImageIds( ::std::vector< USHORT >& rIds ) const
{
RTL_LOGFILE_CONTEXT( aLog, "vcl: ImageList::GetImageIds" );
DBG_CHKTHIS( ImageList, NULL );
- rIds = ::std::vector< sal_uInt16 >();
-
+ rIds = ::std::vector< USHORT >();
+
if( mpImplData )
{
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
@@ -879,7 +928,7 @@ void ImageList::GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const
// -----------------------------------------------------------------------
-::rtl::OUString ImageList::GetImageName( sal_uInt16 nPos ) const
+::rtl::OUString ImageList::GetImageName( USHORT nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -898,7 +947,7 @@ void ImageList::GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const
DBG_CHKTHIS( ImageList, NULL );
rNames = ::std::vector< ::rtl::OUString >();
-
+
if( mpImplData )
{
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
@@ -915,7 +964,7 @@ void ImageList::GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const
Size ImageList::GetImageSize() const
{
DBG_CHKTHIS( ImageList, NULL );
-
+
Size aRet;
if( mpImplData )
@@ -930,6 +979,9 @@ Size ImageList::GetImageSize() const
aRet = mpImplData->maImageSize = aTmp.GetSizePixel();
}
}
+// fprintf (stderr, "GetImageSize returns %d, %d\n",
+// aRet.Width(), aRet.Height());
+
return aRet;
}
@@ -953,11 +1005,11 @@ ImageList& ImageList::operator=( const ImageList& rImageList )
// -----------------------------------------------------------------------
-sal_Bool ImageList::operator==( const ImageList& rImageList ) const
+BOOL ImageList::operator==( const ImageList& rImageList ) const
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImageList, ImageList, NULL );
-
+
bool bRet = false;
if( rImageList.mpImplData == mpImplData )
diff --git a/vcl/source/gdi/imagerepository.cxx b/vcl/source/gdi/imagerepository.cxx
index ea5b5f5d87a4..fa358c9d77db 100644
--- a/vcl/source/gdi/imagerepository.cxx
+++ b/vcl/source/gdi/imagerepository.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,19 +42,12 @@ namespace vcl
//= ImageRepository
//====================================================================
//--------------------------------------------------------------------
- bool ImageRepository::loadImage( const ::rtl::OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent, bool loadMissing )
+ bool ImageRepository::loadImage( const ::rtl::OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent )
{
::rtl::OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
ImplImageTreeSingletonRef aImplImageTree;
- return aImplImageTree->loadImage( _rName, sCurrentSymbolsStyle, _out_rImage, _bSearchLanguageDependent, loadMissing );
- }
-
- bool ImageRepository::loadDefaultImage( BitmapEx& _out_rImage)
- {
- ::rtl::OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
- ImplImageTreeSingletonRef aImplImageTree;
- return aImplImageTree->loadDefaultImage( sCurrentSymbolsStyle,_out_rImage);
+ return aImplImageTree->loadImage( _rName, sCurrentSymbolsStyle, _out_rImage, _bSearchLanguageDependent );
}
//........................................................................
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 59ee15fa558a..d568d9a9d473 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,22 +40,22 @@
ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
const Point& rPt, const Size& rSz,
- sal_uLong nExtraData,
+ ULONG nExtraData,
OutputDevice* pFirstFrameOutDev ) :
- mpParent ( pParent ),
- mpOut ( pFirstFrameOutDev ? pFirstFrameOutDev : pOut ),
- mnExtraData ( nExtraData ),
- maPt ( rPt ),
- maSz ( rSz ),
- maSzPix ( mpOut->LogicToPixel( maSz ) ),
- maClip ( mpOut->GetClipRegion() ),
- mpBackground ( new VirtualDevice ),
- mpRestore ( new VirtualDevice ),
- meLastDisposal ( DISPOSE_BACK ),
- mbPause ( sal_False ),
- mbMarked ( sal_False ),
- mbHMirr ( maSz.Width() < 0L ),
- mbVMirr ( maSz.Height() < 0L )
+ mpParent ( pParent ),
+ mpOut ( pFirstFrameOutDev ? pFirstFrameOutDev : pOut ),
+ mnExtraData ( nExtraData ),
+ maPt ( rPt ),
+ maSz ( rSz ),
+ maSzPix ( mpOut->LogicToPixel( maSz ) ),
+ maClip ( mpOut->GetClipRegion() ),
+ mpBackground ( new VirtualDevice ),
+ mpRestore ( new VirtualDevice ),
+ meLastDisposal ( DISPOSE_BACK ),
+ mbPause ( FALSE ),
+ mbMarked ( FALSE ),
+ mbHMirr ( maSz.Width() < 0L ),
+ mbVMirr ( maSz.Height() < 0L )
{
mpParent->ImplIncAnimCount();
@@ -98,7 +98,7 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
}
else
mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
-
+
// initial drawing to actual position
ImplDrawToPos( mpParent->ImplGetCurPos() );
@@ -119,17 +119,17 @@ ImplAnimView::~ImplAnimView()
// ------------------------------------------------------------------------
-sal_Bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
+BOOL ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
{
- sal_Bool bRet = sal_False;
-
+ BOOL bRet = FALSE;
+
if( nExtraData )
{
if( ( mnExtraData == nExtraData ) && ( !pOut || ( pOut == mpOut ) ) )
- bRet = sal_True;
+ bRet = TRUE;
}
else if( !pOut || ( pOut == mpOut ) )
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
@@ -139,9 +139,9 @@ sal_Bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix )
{
const Size& rAnmSize = mpParent->GetDisplaySizePixel();
- Point aPt2( rAnm.aPosPix.X() + rAnm.aSizePix.Width() - 1L,
+ Point aPt2( rAnm.aPosPix.X() + rAnm.aSizePix.Width() - 1L,
rAnm.aPosPix.Y() + rAnm.aSizePix.Height() - 1L );
- double fFactX, fFactY;
+ double fFactX, fFactY;
// calculate x scaling
if( rAnmSize.Width() > 1L )
@@ -175,15 +175,15 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix,
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
+void ImplAnimView::ImplDrawToPos( ULONG nPos )
{
- VirtualDevice aVDev;
- Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL;
+ VirtualDevice aVDev;
+ Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL;
- aVDev.SetOutputSizePixel( maSzPix, sal_False );
- nPos = Min( nPos, (sal_uLong) mpParent->Count() - 1UL );
+ aVDev.SetOutputSizePixel( maSzPix, FALSE );
+ nPos = Min( nPos, (ULONG) mpParent->Count() - 1UL );
- for( sal_uLong i = 0UL; i <= nPos; i++ )
+ for( ULONG i = 0UL; i <= nPos; i++ )
ImplDraw( i, &aVDev );
if( pOldClip )
@@ -200,29 +200,29 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( sal_uLong nPos )
+void ImplAnimView::ImplDraw( ULONG nPos )
{
- ImplDraw( nPos, NULL );
+ ImplDraw( nPos, NULL );
}
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
+void ImplAnimView::ImplDraw( 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( sal_True );
+ ImplSetMarked( TRUE );
else if( !mbPause )
{
- VirtualDevice* pDev;
- Point aPosPix;
- Point aBmpPosPix;
- Size aSizePix;
- Size aBmpSizePix;
- const sal_uLong nLastPos = mpParent->Count() - 1;
- const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = Min( nPos, nLastPos ) ) );
+ VirtualDevice* pDev;
+ Point aPosPix;
+ Point aBmpPosPix;
+ Size aSizePix;
+ Size aBmpSizePix;
+ const ULONG nLastPos = mpParent->Count() - 1;
+ const AnimationBitmap& rAnm = mpParent->Get( (USHORT) ( mnActPos = Min( nPos, nLastPos ) ) );
ImplGetPosSize( rAnm, aPosPix, aSizePix );
@@ -254,7 +254,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
if( !pVDev )
{
pDev = new VirtualDevice;
- pDev->SetOutputSizePixel( maSzPix, sal_False );
+ pDev->SetOutputSizePixel( maSzPix, FALSE );
pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
}
else
@@ -285,10 +285,10 @@ void ImplAnimView::ImplDraw( sal_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 ), sal_False );
+ mpRestore->SetOutputSizePixel( Size( 1, 1 ), FALSE );
else
{
- mpRestore->SetOutputSizePixel( maRestSz, sal_False );
+ mpRestore->SetOutputSizePixel( maRestSz, FALSE );
mpRestore->DrawOutDev( Point(), maRestSz, aPosPix, aSizePix, *pDev );
}
@@ -308,7 +308,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
mpOut->SetClipRegion( *pOldClip );
delete pOldClip;
}
-
+
delete pDev;
if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
@@ -321,7 +321,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
void ImplAnimView::ImplRepaint()
{
- const sal_Bool bOldPause = mbPause;
+ const BOOL bOldPause = mbPause;
if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
{
@@ -334,8 +334,8 @@ void ImplAnimView::ImplRepaint()
else
mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
- mbPause = sal_False;
- ImplDrawToPos( mnActPos );
+ mbPause = FALSE;
+ ImplDrawToPos( mnActPos );
mbPause = bOldPause;
}
diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx
index 4e96ecbd9b64..bdd46dd76460 100644
--- a/vcl/source/gdi/impanmvw.hxx
+++ b/vcl/source/gdi/impanmvw.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,54 +44,54 @@ class ImplAnimView
{
private:
- Animation* mpParent;
- OutputDevice* mpOut;
- long mnExtraData;
- Point maPt;
- Point maDispPt;
- Point maRestPt;
- Size maSz;
- Size maSzPix;
- Size maDispSz;
- Size maRestSz;
- MapMode maMap;
- Region maClip;
- VirtualDevice* mpBackground;
- VirtualDevice* mpRestore;
- sal_uLong mnActPos;
- Disposal meLastDisposal;
- 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( sal_uLong nPos, VirtualDevice* pVDev );
+ Animation* mpParent;
+ OutputDevice* mpOut;
+ long mnExtraData;
+ Point maPt;
+ Point maDispPt;
+ Point maRestPt;
+ Size maSz;
+ Size maSzPix;
+ Size maDispSz;
+ Size maRestSz;
+ MapMode maMap;
+ Region maClip;
+ VirtualDevice* mpBackground;
+ VirtualDevice* mpRestore;
+ ULONG mnActPos;
+ Disposal meLastDisposal;
+ BOOL mbPause;
+ BOOL mbFirst;
+ BOOL mbMarked;
+ BOOL mbHMirr;
+ BOOL mbVMirr;
+
+ void ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix );
+ void ImplDraw( ULONG nPos, VirtualDevice* pVDev );
public:
ImplAnimView( Animation* pParent, OutputDevice* pOut,
- const Point& rPt, const Size& rSz, sal_uLong nExtraData,
+ const Point& rPt, const Size& rSz, ULONG nExtraData,
OutputDevice* pFirstFrameOutDev = NULL );
~ImplAnimView();
- sal_Bool ImplMatches( OutputDevice* pOut, long nExtraData ) const;
- void ImplDrawToPos( sal_uLong nPos );
- void ImplDraw( sal_uLong nPos );
- void ImplRepaint();
- AInfo* ImplCreateAInfo() const;
+ BOOL ImplMatches( OutputDevice* pOut, long nExtraData ) const;
+ void ImplDrawToPos( ULONG nPos );
+ void ImplDraw( ULONG nPos );
+ void ImplRepaint();
+ AInfo* ImplCreateAInfo() const;
- const Point& ImplGetOutPos() const { return maPt; }
+ const Point& ImplGetOutPos() const { return maPt; }
- const Size& ImplGetOutSize() const { return maSz; }
- const Size& ImplGetOutSizePix() const { return maSzPix; }
+ const Size& ImplGetOutSize() const { return maSz; }
+ const Size& ImplGetOutSizePix() const { return maSzPix; }
- void ImplPause( sal_Bool bPause ) { mbPause = bPause; }
- sal_Bool ImplIsPause() const { return mbPause; }
+ void ImplPause( BOOL bPause ) { mbPause = bPause; }
+ BOOL ImplIsPause() const { return mbPause; }
- void ImplSetMarked( sal_Bool bMarked ) { mbMarked = bMarked; }
- sal_Bool ImplIsMarked() const { return mbMarked; }
+ void ImplSetMarked( BOOL bMarked ) { mbMarked = bMarked; }
+ BOOL ImplIsMarked() const { return mbMarked; }
};
#endif
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 6957e32b3e25..25c57c446abc 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,12 +38,12 @@
#include <vcl/salinst.hxx>
// --------------
-// - ImpBitmap -
+// - ImpBitmap -
// --------------
ImpBitmap::ImpBitmap() :
- mnRefCount ( 1UL ),
- mnChecksum ( 0UL ),
+ mnRefCount ( 1UL ),
+ mnChecksum ( 0UL ),
mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() ),
maSourceSize( 0, 0 )
{
@@ -63,8 +63,8 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
}
// -----------------------------------------------------------------------
-
-sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
+
+BOOL ImpBitmap::ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
{
maSourceSize = rSize;
return mpSalBitmap->Create( rSize, nBitCount, rPal );
@@ -72,7 +72,7 @@ sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const B
// -----------------------------------------------------------------------
-sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
+BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
{
maSourceSize = rImpBitmap.maSourceSize;
mnChecksum = rImpBitmap.mnChecksum;
@@ -81,14 +81,14 @@ sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
// -----------------------------------------------------------------------
-sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
+BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, pGraphics );
}
// -----------------------------------------------------------------------
-sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount )
+BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, USHORT nNewBitCount )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, nNewBitCount );
}
@@ -109,22 +109,22 @@ Size ImpBitmap::ImplGetSize() const
// -----------------------------------------------------------------------
-sal_uInt16 ImpBitmap::ImplGetBitCount() const
+USHORT ImpBitmap::ImplGetBitCount() const
{
- sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
+ USHORT nBitCount = mpSalBitmap->GetBitCount();
return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 );
}
// -----------------------------------------------------------------------
-BitmapBuffer* ImpBitmap::ImplAcquireBuffer( sal_Bool bReadOnly )
+BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BOOL bReadOnly )
{
return mpSalBitmap->AcquireBuffer( bReadOnly );
}
// -----------------------------------------------------------------------
-void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly )
+void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly )
{
mpSalBitmap->ReleaseBuffer( pBuffer, bReadOnly );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index bf99364a0f64..a353e034ed33 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,17 +50,17 @@
// - Defines -
// -----------
-#define GRAPHIC_MAXPARTLEN 256000L
-#define GRAPHIC_MTFTOBMP_MAXEXT 2048
-#define GRAPHIC_STREAMBUFSIZE 8192UL
-
-#define SYS_WINMETAFILE 0x00000003L
-#define SYS_WNTMETAFILE 0x00000004L
-#define SYS_OS2METAFILE 0x00000005L
-#define SYS_MACMETAFILE 0x00000006L
+#define GRAPHIC_MAXPARTLEN 256000L
+#define GRAPHIC_MTFTOBMP_MAXEXT 2048
+#define GRAPHIC_STREAMBUFSIZE 8192UL
-#define GRAPHIC_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'G', 'R', 'F', '5' ))
-#define NATIVE_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'N', 'A', 'T', '5' ))
+#define SYS_WINMETAFILE 0x00000003L
+#define SYS_WNTMETAFILE 0x00000004L
+#define SYS_OS2METAFILE 0x00000005L
+#define SYS_MACMETAFILE 0x00000006L
+
+#define GRAPHIC_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'G', 'R', 'F', '5' ))
+#define NATIVE_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'N', 'A', 'T', '5' ))
// ---------------
// - ImpSwapFile -
@@ -68,8 +68,8 @@
struct ImpSwapFile
{
- INetURLObject aSwapURL;
- sal_uLong nRefCount;
+ INetURLObject aSwapURL;
+ ULONG nRefCount;
};
// -----------------
@@ -89,15 +89,15 @@ GraphicReader::~GraphicReader()
// ------------------------------------------------------------------------
-sal_Bool GraphicReader::IsPreviewModeEnabled() const
+BOOL GraphicReader::IsPreviewModeEnabled() const
{
if( !mpReaderData )
- return sal_False;
+ return FALSE;
if( mpReaderData->maPreviewSize.Width() )
- return sal_True;
+ return TRUE;
if( mpReaderData->maPreviewSize.Height() )
- return sal_True;
- return sal_False;
+ return TRUE;
+ return FALSE;
}
// ------------------------------------------------------------------------
@@ -132,33 +132,33 @@ Size GraphicReader::GetPreviewSize() const
// --------------
ImpGraphic::ImpGraphic() :
- mpAnimation ( NULL ),
- mpContext ( NULL ),
- mpSwapFile ( NULL ),
- mpGfxLink ( NULL ),
- meType ( GRAPHIC_NONE ),
+ mpAnimation ( NULL ),
+ mpContext ( NULL ),
+ mpSwapFile ( NULL ),
+ mpGfxLink ( NULL ),
+ meType ( GRAPHIC_NONE ),
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( sal_False ),
- mbSwapUnderway ( sal_False )
+ mbSwapOut ( FALSE ),
+ mbSwapUnderway ( FALSE )
{
}
// ------------------------------------------------------------------------
ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
- maMetaFile ( rImpGraphic.maMetaFile ),
- maEx ( rImpGraphic.maEx ),
- mpContext ( NULL ),
- mpSwapFile ( rImpGraphic.mpSwapFile ),
- meType ( rImpGraphic.meType ),
- maDocFileURLStr ( rImpGraphic.maDocFileURLStr ),
- mnDocFilePos ( rImpGraphic.mnDocFilePos ),
+ maMetaFile ( rImpGraphic.maMetaFile ),
+ maEx ( rImpGraphic.maEx ),
+ mpContext ( NULL ),
+ mpSwapFile ( rImpGraphic.mpSwapFile ),
+ meType ( rImpGraphic.meType ),
+ maDocFileURLStr ( rImpGraphic.maDocFileURLStr ),
+ mnDocFilePos ( rImpGraphic.mnDocFilePos ),
mnSizeBytes ( rImpGraphic.mnSizeBytes ),
- mnRefCount ( 1UL ),
- mbSwapOut ( rImpGraphic.mbSwapOut ),
- mbSwapUnderway ( sal_False )
+ mnRefCount ( 1UL ),
+ mbSwapOut ( rImpGraphic.mbSwapOut ),
+ mbSwapUnderway ( FALSE )
{
if( mpSwapFile )
mpSwapFile->nRefCount++;
@@ -180,68 +180,68 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
// ------------------------------------------------------------------------
ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
- maEx ( rBitmap ),
- mpAnimation ( NULL ),
- mpContext ( NULL ),
- mpSwapFile ( NULL ),
- mpGfxLink ( NULL ),
- meType ( !rBitmap ? GRAPHIC_NONE : GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
+ maEx ( rBitmap ),
+ mpAnimation ( NULL ),
+ mpContext ( NULL ),
+ mpSwapFile ( NULL ),
+ mpGfxLink ( NULL ),
+ meType ( !rBitmap ? GRAPHIC_NONE : GRAPHIC_BITMAP ),
+ mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
- mnRefCount ( 1UL ),
- mbSwapOut ( sal_False ),
- mbSwapUnderway ( sal_False )
+ mnRefCount ( 1UL ),
+ mbSwapOut ( FALSE ),
+ mbSwapUnderway ( FALSE )
{
}
// ------------------------------------------------------------------------
ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
- maEx ( rBitmapEx ),
- mpAnimation ( NULL ),
- mpContext ( NULL ),
- mpSwapFile ( NULL ),
- mpGfxLink ( NULL ),
- meType ( !rBitmapEx ? GRAPHIC_NONE : GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
+ maEx ( rBitmapEx ),
+ mpAnimation ( NULL ),
+ mpContext ( NULL ),
+ mpSwapFile ( NULL ),
+ mpGfxLink ( NULL ),
+ meType ( !rBitmapEx ? GRAPHIC_NONE : GRAPHIC_BITMAP ),
+ mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
- mnRefCount ( 1UL ),
- mbSwapOut ( sal_False ),
- mbSwapUnderway ( sal_False )
+ mnRefCount ( 1UL ),
+ mbSwapOut ( FALSE ),
+ mbSwapUnderway ( FALSE )
{
}
// ------------------------------------------------------------------------
ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
- maEx ( rAnimation.GetBitmapEx() ),
- mpAnimation ( new Animation( rAnimation ) ),
- mpContext ( NULL ),
- mpSwapFile ( NULL ),
- mpGfxLink ( NULL ),
- meType ( GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
+ maEx ( rAnimation.GetBitmapEx() ),
+ mpAnimation ( new Animation( rAnimation ) ),
+ mpContext ( NULL ),
+ mpSwapFile ( NULL ),
+ mpGfxLink ( NULL ),
+ meType ( GRAPHIC_BITMAP ),
+ mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
- mnRefCount ( 1UL ),
- mbSwapOut ( sal_False ),
- mbSwapUnderway ( sal_False )
+ mnRefCount ( 1UL ),
+ mbSwapOut ( FALSE ),
+ mbSwapUnderway ( FALSE )
{
}
// ------------------------------------------------------------------------
ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) :
- maMetaFile ( rMtf ),
- mpAnimation ( NULL ),
- mpContext ( NULL ),
- mpSwapFile ( NULL ),
- mpGfxLink ( NULL ),
- meType ( GRAPHIC_GDIMETAFILE ),
- mnDocFilePos ( 0UL ),
+ maMetaFile ( rMtf ),
+ mpAnimation ( NULL ),
+ mpContext ( NULL ),
+ mpSwapFile ( NULL ),
+ mpGfxLink ( NULL ),
+ meType ( GRAPHIC_GDIMETAFILE ),
+ mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
- mnRefCount ( 1UL ),
- mbSwapOut ( sal_False ),
- mbSwapUnderway ( sal_False )
+ mnRefCount ( 1UL ),
+ mbSwapOut ( FALSE ),
+ mbSwapUnderway ( FALSE )
{
}
@@ -251,7 +251,7 @@ ImpGraphic::~ImpGraphic()
{
ImplClear();
- if( (sal_uLong) mpContext > 1UL )
+ if( (ULONG) mpContext > 1UL )
delete mpContext;
}
@@ -305,24 +305,24 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
+BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( this == &rImpGraphic )
- bRet = sal_True;
+ bRet = TRUE;
else if( !ImplIsSwapOut() && ( rImpGraphic.meType == meType ) )
{
switch( meType )
{
case( GRAPHIC_NONE ):
- bRet = sal_True;
+ bRet = TRUE;
break;
case( GRAPHIC_GDIMETAFILE ):
{
if( rImpGraphic.maMetaFile == maMetaFile )
- bRet = sal_True;
+ bRet = TRUE;
}
break;
@@ -331,10 +331,10 @@ sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
if( mpAnimation )
{
if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) )
- bRet = sal_True;
+ bRet = TRUE;
}
else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) )
- bRet = sal_True;
+ bRet = TRUE;
}
break;
@@ -348,7 +348,7 @@ sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
// ------------------------------------------------------------------------
-void ImpGraphic::ImplClearGraphics( sal_Bool bCreateSwapInfo )
+void ImpGraphic::ImplClearGraphics( BOOL bCreateSwapInfo )
{
if( bCreateSwapInfo && !ImplIsSwapOut() )
{
@@ -388,7 +388,7 @@ void ImpGraphic::ImplClear()
::ucbhelper::Content aCnt( mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
+ aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -410,12 +410,12 @@ void ImpGraphic::ImplClear()
mpSwapFile = NULL;
}
- mbSwapOut = sal_False;
+ mbSwapOut = FALSE;
mnDocFilePos = 0UL;
maDocFileURLStr.Erase();
// cleanup
- ImplClearGraphics( sal_False );
+ ImplClearGraphics( FALSE );
meType = GRAPHIC_NONE;
mnSizeBytes = 0;
}
@@ -437,42 +437,42 @@ void ImpGraphic::ImplSetDefaultType()
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsSupportedGraphic() const
+BOOL ImpGraphic::ImplIsSupportedGraphic() const
{
return( meType != GRAPHIC_NONE );
}
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsTransparent() const
+BOOL ImpGraphic::ImplIsTransparent() const
{
- sal_Bool bRet;
+ BOOL bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent() );
else
- bRet = sal_True;
+ bRet = TRUE;
return bRet;
}
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsAlpha() const
+BOOL ImpGraphic::ImplIsAlpha() const
{
- sal_Bool bRet;
+ BOOL bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( NULL == mpAnimation ) && maEx.IsAlpha();
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsAnimated() const
+BOOL ImpGraphic::ImplIsAnimated() const
{
return( mpAnimation != NULL );
}
@@ -486,7 +486,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
if( meType == GRAPHIC_BITMAP )
{
const BitmapEx& rRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maEx );
- const Color aReplaceColor( COL_WHITE );
+ const Color aReplaceColor( COL_WHITE );
aRetBmp = rRetBmpEx.GetBitmap( &aReplaceColor );
@@ -495,26 +495,26 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
}
else if( ( meType != GRAPHIC_DEFAULT ) && ImplIsSupportedGraphic() )
{
- // use corner points of graphic to determine the pixel
+ // use corner points of graphic to determine the pixel
// extent of the graphic (rounding errors are possible else)
- VirtualDevice aVDev;
+ VirtualDevice aVDev;
const Point aNullPt;
const Point aTLPix( aVDev.LogicToPixel( aNullPt, maMetaFile.GetPrefMapMode() ) );
const Point aBRPix( aVDev.LogicToPixel( Point( maMetaFile.GetPrefSize().Width() - 1, maMetaFile.GetPrefSize().Height() - 1 ), maMetaFile.GetPrefMapMode() ) );
Size aDrawSize( aVDev.LogicToPixel( maMetaFile.GetPrefSize(), maMetaFile.GetPrefMapMode() ) );
- Size aSizePix( labs( aBRPix.X() - aTLPix.X() ) + 1, labs( aBRPix.Y() - aTLPix.Y() ) + 1 );
+ Size aSizePix( labs( aBRPix.X() - aTLPix.X() ) + 1, labs( aBRPix.Y() - aTLPix.Y() ) + 1 );
if(rParameters.getSizePixel().Width() && rParameters.getSizePixel().Height())
{
- aDrawSize.Width() = FRound((double)rParameters.getSizePixel().Width() *
+ aDrawSize.Width() = FRound((double)rParameters.getSizePixel().Width() *
(double)aDrawSize.Width() / (double)aSizePix.Width());
- aDrawSize.Height() = FRound((double)rParameters.getSizePixel().Height() *
+ aDrawSize.Height() = FRound((double)rParameters.getSizePixel().Height() *
(double)aDrawSize.Height() / (double)aSizePix.Height());
aSizePix = rParameters.getSizePixel();
}
- if( aSizePix.Width() && aSizePix.Height() && !rParameters.getUnlimitedSize()
+ if( aSizePix.Width() && aSizePix.Height() && !rParameters.getUnlimitedSize()
&& (aSizePix.Width() > GRAPHIC_MTFTOBMP_MAXEXT || aSizePix.Height() > GRAPHIC_MTFTOBMP_MAXEXT))
{
const Size aOldSizePix( aSizePix );
@@ -535,7 +535,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
{
aVDev.SetAntialiasing(aVDev.GetAntialiasing() | ANTIALIASING_ENABLE_B2DDRAW);
}
-
+
if(rParameters.getSnapHorVerLines())
{
aVDev.SetAntialiasing(aVDev.GetAntialiasing() | ANTIALIASING_PIXELSNAPHAIRLINE);
@@ -728,14 +728,14 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
// ------------------------------------------------------------------------
-sal_uLong ImpGraphic::ImplGetSizeBytes() const
+ULONG ImpGraphic::ImplGetSizeBytes() const
{
if( 0 == mnSizeBytes )
{
if( meType == GRAPHIC_BITMAP )
{
mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maEx.GetSizeBytes();
- }
+ }
else if( meType == GRAPHIC_GDIMETAFILE )
{
mnSizeBytes = maMetaFile.GetSizeBytes();
@@ -855,7 +855,7 @@ Link ImpGraphic::ImplGetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-sal_uLong ImpGraphic::ImplGetAnimationLoopCount() const
+ULONG ImpGraphic::ImplGetAnimationLoopCount() const
{
return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL );
}
@@ -891,7 +891,7 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-void ImpGraphic::ImplSetDocFileName( const String& rName, sal_uLong nFilePos )
+void ImpGraphic::ImplSetDocFileName( const String& rName, ULONG nFilePos )
{
const INetURLObject aURL( rName );
@@ -910,29 +910,29 @@ const String& ImpGraphic::ImplGetDocFileName() const
// ------------------------------------------------------------------------
-sal_uLong ImpGraphic::ImplGetDocFilePos() const
+ULONG ImpGraphic::ImplGetDocFilePos() const
{
return mnDocFilePos;
}
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
+BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
{
- MapMode aMapMode;
- Size aSize;
- const sal_uLong nStartPos = rIStm.Tell();
- sal_uInt32 nId;
- sal_uLong nHeaderLen;
- long nType;
- long nLen;
- const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
- sal_Bool bRet = sal_False;
+ MapMode aMapMode;
+ Size aSize;
+ const ULONG nStartPos = rIStm.Tell();
+ sal_uInt32 nId;
+ ULONG nHeaderLen;
+ long nType;
+ long nLen;
+ const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ BOOL bRet = FALSE;
if( !mbSwapUnderway )
{
- const String aTempURLStr( maDocFileURLStr );
- const sal_uLong nTempPos = mnDocFilePos;
+ const String aTempURLStr( maDocFileURLStr );
+ const ULONG nTempPos = mnDocFilePos;
ImplClear();
@@ -1017,12 +1017,12 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
if( maDocFileURLStr.Len() )
{
rIStm.Seek( nStartPos + nHeaderLen + nLen );
- bRet = mbSwapOut = sal_True;
+ bRet = mbSwapOut = TRUE;
}
else
{
- ::utl::TempFile aTempFile;
- const INetURLObject aTmpURL( aTempFile.GetURL() );
+ ::utl::TempFile aTempFile;
+ const INetURLObject aTmpURL( aTempFile.GetURL() );
if( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
{
@@ -1030,9 +1030,9 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
if( pOStm )
{
- sal_uLong nFullLen = nHeaderLen + nLen;
- sal_uLong nPartLen = Min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN );
- sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen );
+ ULONG nFullLen = nHeaderLen + nLen;
+ ULONG nPartLen = Min( nFullLen, (ULONG) GRAPHIC_MAXPARTLEN );
+ BYTE* pBuffer = (BYTE*) rtl_allocateMemory( nPartLen );
pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1052,12 +1052,12 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
}
rtl_freeMemory( pBuffer );
- sal_uLong nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
+ ULONG nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
delete pOStm, pOStm = NULL;
if( !nReadErr && !nWriteErr )
{
- bRet = mbSwapOut = sal_True;
+ bRet = mbSwapOut = TRUE;
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
mpSwapFile->aSwapURL = aTmpURL;
@@ -1069,7 +1069,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
+ aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1100,9 +1100,9 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
else if( meType >= SYS_WINMETAFILE && meType <= SYS_MACMETAFILE )
{
Graphic aSysGraphic;
- sal_uLong nCvtType;
+ ULONG nCvtType;
- switch( sal::static_int_cast<sal_uLong>(meType) )
+ switch( sal::static_int_cast<ULONG>(meType) )
{
case( SYS_WINMETAFILE ):
case( SYS_WNTMETAFILE ): nCvtType = CVT_WMF; break;
@@ -1130,7 +1130,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
}
}
else
- bRet = sal_True;
+ bRet = TRUE;
rIStm.SetNumberFormatInt( nOldFormat );
@@ -1139,16 +1139,16 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
+BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( ( meType != GRAPHIC_NONE ) && ( meType != GRAPHIC_DEFAULT ) && !ImplIsSwapOut() )
{
- const MapMode aMapMode( ImplGetPrefMapMode() );
- const Size aSize( ImplGetPrefSize() );
- const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
- sal_uLong nDataFieldPos;
+ const MapMode aMapMode( ImplGetPrefMapMode() );
+ const Size aSize( ImplGetPrefSize() );
+ const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ ULONG nDataFieldPos;
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1195,18 +1195,18 @@ sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// write data block
if( !rOStm.GetError() )
{
- const sal_uLong nDataStart = rOStm.Tell();
+ const ULONG nDataStart = rOStm.Tell();
if( ImplIsSupportedGraphic() )
rOStm << *this;
if( !rOStm.GetError() )
{
- const sal_uLong nStmPos2 = rOStm.Tell();
+ const ULONG nStmPos2 = rOStm.Tell();
rOStm.Seek( nDataFieldPos );
rOStm << (long) ( nStmPos2 - nDataStart );
rOStm.Seek( nStmPos2 );
- bRet = sal_True;
+ bRet = TRUE;
}
}
@@ -1218,16 +1218,16 @@ sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplSwapOut()
+BOOL ImpGraphic::ImplSwapOut()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( !ImplIsSwapOut() )
{
if( !maDocFileURLStr.Len() )
{
- ::utl::TempFile aTempFile;
- const INetURLObject aTmpURL( aTempFile.GetURL() );
+ ::utl::TempFile aTempFile;
+ const INetURLObject aTmpURL( aTempFile.GetURL() );
if( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
{
@@ -1238,7 +1238,7 @@ sal_Bool ImpGraphic::ImplSwapOut()
pOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
pOStm->SetCompressMode( COMPRESSMODE_NATIVE );
- if( ( bRet = ImplSwapOut( pOStm ) ) == sal_True )
+ if( ( bRet = ImplSwapOut( pOStm ) ) == TRUE )
{
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
@@ -1253,7 +1253,7 @@ sal_Bool ImpGraphic::ImplSwapOut()
::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
+ aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1276,8 +1276,8 @@ sal_Bool ImpGraphic::ImplSwapOut()
}
else
{
- ImplClearGraphics( sal_True );
- bRet = mbSwapOut = sal_True;
+ ImplClearGraphics( TRUE );
+ bRet = mbSwapOut = TRUE;
}
}
@@ -1286,9 +1286,9 @@ sal_Bool ImpGraphic::ImplSwapOut()
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm )
+BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( pOStm )
{
@@ -1300,15 +1300,15 @@ sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm )
if( !pOStm->GetError() )
{
- ImplClearGraphics( sal_True );
- bRet = mbSwapOut = sal_True;
+ ImplClearGraphics( TRUE );
+ bRet = mbSwapOut = TRUE;
}
}
}
else
{
- ImplClearGraphics( sal_True );
- bRet = mbSwapOut = sal_True;
+ ImplClearGraphics( TRUE );
+ bRet = mbSwapOut = TRUE;
}
return bRet;
@@ -1316,9 +1316,9 @@ sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm )
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplSwapIn()
+BOOL ImpGraphic::ImplSwapIn()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( ImplIsSwapOut() )
{
@@ -1355,7 +1355,7 @@ sal_Bool ImpGraphic::ImplSwapIn()
::ucbhelper::Content aCnt( aSwapURL,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
+ aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1385,9 +1385,9 @@ sal_Bool ImpGraphic::ImplSwapIn()
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm )
+BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( pIStm )
{
@@ -1395,14 +1395,14 @@ sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm )
if( !pIStm->GetError() )
{
- mbSwapUnderway = sal_True;
+ mbSwapUnderway = TRUE;
bRet = ImplReadEmbedded( *pIStm );
- mbSwapUnderway = sal_False;
+ mbSwapUnderway = FALSE;
if( !bRet )
ImplClear();
else
- mbSwapOut = sal_False;
+ mbSwapOut = FALSE;
}
}
@@ -1411,14 +1411,14 @@ sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm )
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsSwapOut() const
+BOOL ImpGraphic::ImplIsSwapOut() const
{
return mbSwapOut;
}
// ------------------------------------------------------------------------
-void ImpGraphic::ImplSetLink( const GfxLink& rGfxLink )
+void ImpGraphic::ImplSetLink( const GfxLink& rGfxLink )
{
delete mpGfxLink;
mpGfxLink = new GfxLink( rGfxLink );
@@ -1436,16 +1436,16 @@ GfxLink ImpGraphic::ImplGetLink()
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplIsLink() const
+BOOL ImpGraphic::ImplIsLink() const
{
- return ( mpGfxLink != NULL ) ? sal_True : sal_False;
+ return ( mpGfxLink != NULL ) ? TRUE : FALSE;
}
// ------------------------------------------------------------------------
-sal_uLong ImpGraphic::ImplGetChecksum() const
+ULONG ImpGraphic::ImplGetChecksum() const
{
- sal_uLong nRet = 0;
+ ULONG nRet = 0;
if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
{
@@ -1474,9 +1474,9 @@ sal_uLong ImpGraphic::ImplGetChecksum() const
// ------------------------------------------------------------------------
-sal_Bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const
+BOOL ImpGraphic::ImplExportNative( SvStream& rOStm ) const
{
- sal_Bool bResult = sal_False;
+ BOOL bResult = FALSE;
if( !rOStm.GetError() )
{
@@ -1503,7 +1503,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
{
if( !rIStm.GetError() )
{
- const sal_uLong nStmPos1 = rIStm.Tell();
+ const ULONG nStmPos1 = rIStm.Tell();
sal_uInt32 nTmp;
if ( !rImpGraphic.mbSwapUnderway )
@@ -1513,16 +1513,16 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
rIStm >> nTmp;
// if there is no more data, avoid further expensive
- // reading which will create VDevs and other stuff, just to
+ // reading which will create VDevs and other stuff, just to
// read nothing. CAUTION: Eof is only true AFTER reading another
// byte, a speciality of SvMemoryStream (!)
if(!rIStm.GetError() && !rIStm.IsEof())
{
if( NATIVE_FORMAT_50 == nTmp )
{
- Graphic aGraphic;
- GfxLink aLink;
- VersionCompat* pCompat;
+ Graphic aGraphic;
+ GfxLink aLink;
+ VersionCompat* pCompat;
// read compat info
pCompat = new VersionCompat( rIStm, STREAM_READ );
@@ -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 sal_Bool bSetLink = ( rImpGraphic.mpGfxLink == NULL );
+ const BOOL bSetLink = ( rImpGraphic.mpGfxLink == NULL );
// assign graphic
rImpGraphic = *aGraphic.ImplGetImpGraphic();
@@ -1559,8 +1559,8 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
}
else
{
- BitmapEx aBmpEx;
- const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ BitmapEx aBmpEx;
+ const USHORT nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SeekRel( -4 );
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1568,8 +1568,8 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
if( !rIStm.GetError() )
{
- sal_uInt32 nMagic1(0), nMagic2(0);
- sal_uLong nActPos = rIStm.Tell();
+ UINT32 nMagic1(0), nMagic2(0);
+ 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 sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ const USHORT 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 d2e479e1edb5..ad91356e801f 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,9 @@
// - Defines -
// -----------
-#define IMPSYSIMAGEITEM_MASK ( 0x01 )
-#define IMPSYSIMAGEITEM_ALPHA ( 0x02 )
-#define DISA_ALL ( 0xffff )
+#define IMPSYSIMAGEITEM_MASK ( 0x01 )
+#define IMPSYSIMAGEITEM_ALPHA ( 0x02 )
+#define DISA_ALL ( 0xffff )
// ----------------
// - ImageAryData -
@@ -66,7 +66,7 @@ ImageAryData::ImageAryData( const ImageAryData& rData ) :
}
ImageAryData::ImageAryData( const rtl::OUString &aName,
- sal_uInt16 nId, const BitmapEx &aBitmap )
+ USHORT nId, const BitmapEx &aBitmap )
: maName( aName ), mnId( nId ), maBitmapEx( aBitmap )
{
}
@@ -118,7 +118,7 @@ ImplImageList::~ImplImageList()
}
void ImplImageList::AddImage( const ::rtl::OUString &aName,
- sal_uInt16 nId, const BitmapEx &aBitmapEx )
+ USHORT 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( sal_uInt16 nPos )
+void ImplImageList::RemoveImage( USHORT nPos )
{
ImageAryData *pImg = maImages[ nPos ];
if( pImg->maName.getLength() )
@@ -134,9 +134,9 @@ void ImplImageList::RemoveImage( sal_uInt16 nPos )
maImages.erase( maImages.begin() + nPos );
}
-sal_uInt16 ImplImageList::GetImageCount() const
+USHORT ImplImageList::GetImageCount() const
{
- return sal::static_int_cast< sal_uInt16 >( maImages.size() );
+ return sal::static_int_cast< USHORT >( maImages.size() );
}
// -----------------
@@ -160,7 +160,7 @@ ImplImageData::~ImplImageData()
// - ImplImageData -
// -----------------
-sal_Bool ImplImageData::IsEqual( const ImplImageData& rData )
+BOOL ImplImageData::IsEqual( const ImplImageData& rData )
{
return( maBmpEx == rData.maBmpEx );
}
@@ -212,7 +212,7 @@ ImplImageBmp::~ImplImageBmp()
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
+void ImplImageBmp::Create( long nItemWidth, long nItemHeight, USHORT nInitSize )
{
const Size aTotalSize( nInitSize * nItemWidth, nItemHeight );
@@ -226,13 +226,13 @@ void ImplImageBmp::Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSi
mnSize = nInitSize;
delete[] mpInfoAry;
- mpInfoAry = new sal_uInt8[ mnSize ];
+ mpInfoAry = new BYTE[ mnSize ];
memset( mpInfoAry, 0, mnSize );
}
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
+void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, USHORT 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 sal_uInt8[ mnSize ];
+ mpInfoAry = new BYTE[ 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( sal_uInt16 nGrowSize )
+void ImplImageBmp::Expand( USHORT 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) ];
+ const ULONG nDX = nGrowSize * maSize.Width();
+ const USHORT nOldSize = mnSize;
+ BYTE* pNewAry = new BYTE[ mnSize = sal::static_int_cast<USHORT>(mnSize+nGrowSize) ];
maBmpEx.Expand( nDX, 0UL );
@@ -284,7 +284,7 @@ void ImplImageBmp::Invert()
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos )
+void ImplImageBmp::Replace( USHORT nPos, USHORT 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( sal_uInt16 nPos, sal_uInt16 nSrcPos )
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos )
+void ImplImageBmp::Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT 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( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx )
+void ImplImageBmp::Replace( USHORT nPos, const BitmapEx& rBmpEx )
{
const Point aNullPos, aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aNullPos, maSize );
@@ -338,7 +338,7 @@ void ImplImageBmp::Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx )
// -----------------------------------------------------------------------
-void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uLong nColorCount )
+void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount )
{
maBmpEx.Replace( pSrcColors, pDstColors, nColorCount );
delete mpDisplayBmp;
@@ -347,10 +347,19 @@ void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColo
// -----------------------------------------------------------------------
-BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const
+void ImplImageBmp::ColorTransform( BmpColorMode eColorMode )
+{
+ maBmpEx = maBmpEx.GetColorTransformedBitmapEx( eColorMode );
+ delete mpDisplayBmp;
+ mpDisplayBmp = NULL;
+}
+
+// -----------------------------------------------------------------------
+
+BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
{
- const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() );
- BitmapEx aRet;
+ const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() );
+ BitmapEx aRet;
if( maBmpEx.IsAlpha() )
{
// initialize target bitmap with an empty alpha mask
@@ -362,10 +371,10 @@ BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry )
else
aRet = BitmapEx( aNewBmp );
- for( sal_uInt16 i = 0; i < nPosCount; i++ )
+ for( USHORT i = 0; i < nPosCount; i++ )
{
const Point aSrcPos( pPosAry[ i ] * maSize.Width(), 0L );
- const Point aPos( i * maSize.Width(), 0L );
+ const Point aPos( i * maSize.Width(), 0L );
const Rectangle aSrcRect( aSrcPos, maSize );
const Rectangle aDstRect( aPos, maSize );
@@ -377,14 +386,14 @@ BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry )
// -----------------------------------------------------------------------
-void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
- const Point& rPos, sal_uInt16 nStyle,
+void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
+ const Point& rPos, USHORT nStyle,
const Size* pSize )
{
if( pOutDev->IsDeviceOutputNecessary() )
{
const Point aSrcPos( nPos * maSize.Width(), 0 );
- Size aOutSize;
+ Size aOutSize;
aOutSize = ( pSize ? *pSize : pOutDev->PixelToLogic( maSize ) );
@@ -396,6 +405,7 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
else
{
if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM |
+ IMAGE_DRAW_MONOCHROME_BLACK | IMAGE_DRAW_MONOCHROME_WHITE |
IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE | IMAGE_DRAW_SEMITRANSPARENT ) )
{
BitmapEx aTmpBmpEx;
@@ -408,6 +418,14 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
aTmpBmpEx.Crop( aCropRect );
+ if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM | IMAGE_DRAW_MONOCHROME_BLACK | IMAGE_DRAW_MONOCHROME_WHITE ) )
+ {
+ const BmpColorMode eMode = ( nStyle & IMAGE_DRAW_COLORTRANSFORM ) ? BMP_COLOR_HIGHCONTRAST :
+ ( ( nStyle & IMAGE_DRAW_MONOCHROME_BLACK ) ? BMP_COLOR_MONOCHROME_BLACK : BMP_COLOR_MONOCHROME_WHITE );
+
+ aTmpBmpEx = aTmpBmpEx.GetColorTransformedBitmapEx( eMode );
+ }
+
Bitmap aTmpBmp( aTmpBmpEx.GetBitmap() );
if( nStyle & ( IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE ) )
@@ -416,35 +434,35 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
if( pAcc )
{
- const StyleSettings& rSettings = pOutDev->GetSettings().GetStyleSettings();
- Color aColor;
- BitmapColor aCol;
- const long nW = pAcc->Width();
- const long nH = pAcc->Height();
- sal_uInt8* pMapR = new sal_uInt8[ 256 ];
- sal_uInt8* pMapG = new sal_uInt8[ 256 ];
- sal_uInt8* pMapB = new sal_uInt8[ 256 ];
- long nX, nY;
+ const StyleSettings& rSettings = pOutDev->GetSettings().GetStyleSettings();
+ Color aColor;
+ 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 ];
+ long nX, nY;
if( nStyle & IMAGE_DRAW_HIGHLIGHT )
aColor = rSettings.GetHighlightColor();
else
aColor = rSettings.GetDeactiveColor();
- const sal_uInt8 cR = aColor.GetRed();
- const sal_uInt8 cG = aColor.GetGreen();
- const sal_uInt8 cB = aColor.GetBlue();
+ const BYTE cR = aColor.GetRed();
+ const BYTE cG = aColor.GetGreen();
+ const BYTE cB = aColor.GetBlue();
for( nX = 0L; nX < 256L; nX++ )
{
- 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 );
+ 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 );
}
if( pAcc->HasPalette() )
{
- for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aCol.SetRed( pMapR[ rCol.GetRed() ] );
@@ -500,7 +518,7 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
}
else
{
- sal_uInt8 cErase = 128;
+ BYTE cErase = 128;
aTmpBmpEx = BitmapEx( aTmpBmp, AlphaMask( aTmpBmp.GetSizePixel(), &cErase ) );
}
}
@@ -536,14 +554,14 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
// -----------------------------------------------------------------------
void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
-#if defined WNT
+#if defined WIN || defined WNT
pOutDev
#endif
)
{
if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
{
-#if defined WNT
+#if defined WIN || defined WNT
if( maBmpEx.IsAlpha() )
mpDisplayBmp = new BitmapEx( maBmpEx );
else
@@ -587,7 +605,7 @@ void ImplImageBmp::ImplUpdateDisabledBmpEx( int nPos )
if( pBmp && pBmpAlphaMask && pGrey && pGreyAlphaMask )
{
- BitmapColor aGreyVal( 0 );
+ BitmapColor aGreyVal( 0 );
BitmapColor aGreyAlphaMaskVal( 0 );
const Point aPos( ( nPos < 0 ) ? 0 : ( nPos * maSize.Width() ), 0 );
const int nLeft = aPos.X(), nRight = nLeft + ( ( nPos < 0 ) ? aTotalSize.Width() : maSize.Width() );
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 88b465c89f7d..51435965c040 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,7 +34,7 @@
#include <utility>
#include <vector>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/io/XInputStream.hpp"
@@ -138,7 +138,7 @@ bool ImplImageTree::checkStyle(rtl::OUString const & style)
// skip brand-specific icon themes; they are incomplete and thus not useful for this check
if (nFromIndex < 0 || !aZipURL.match(sBrandURLSuffix, nFromIndex)) {
osl::File aZip(aZipURL);
- if (aZip.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None) {
+ if (aZip.open(OpenFlag_Read) == ::osl::FileBase::E_None) {
aZip.close();
exists = true;
}
@@ -151,41 +151,6 @@ bool ImplImageTree::checkStyle(rtl::OUString const & style)
bool ImplImageTree::loadImage(
rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap,
- bool localized, bool loadMissing )
-{
- bool found = false;
- try {
- found = doLoadImage(name, style, bitmap, localized);
- } catch (css::uno::RuntimeException &) {
- if (!loadMissing)
- throw;
- }
- if (found || !loadMissing)
- return found;
-
- try {
- OSL_TRACE(
- "ImplImageTree::loadImage exception couldn't load \"%s\", fetching missing_icon.png",
- rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
- found = loadDefaultImage(style, bitmap);
- } catch (css::uno::RuntimeException &) {
- throw;
- }
- return found;
-}
-
-bool ImplImageTree::loadDefaultImage(
- rtl::OUString const & style,
- BitmapEx& bitmap)
-{
- return doLoadImage(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("res/grafikde.png")),
- style, bitmap, false);
-}
-
-
-bool ImplImageTree::doLoadImage(
- rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap,
bool localized)
{
setStyle(style);
@@ -308,7 +273,7 @@ void ImplImageTree::resetZips() {
u.GetMainURL(INetURLObject::NO_DECODE),
css::uno::Reference< css::container::XNameAccess >()));
}
- if ( m_style.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default"))) )
+ if ( m_style.equals(::rtl::OUString::createFromAscii("default")) )
{
rtl::OUString url(
RTL_CONSTASCII_USTRINGPARAM(
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index 21c0cbb0abd4..5cd2c4c51c98 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,16 +53,16 @@
// -----------------------------------------------------------------------------
-#define VECT_POLY_INLINE_INNER 1UL
-#define VECT_POLY_INLINE_OUTER 2UL
-#define VECT_POLY_OUTLINE_INNER 4UL
-#define VECT_POLY_OUTLINE_OUTER 8UL
+#define VECT_POLY_INLINE_INNER 1UL
+#define VECT_POLY_INLINE_OUTER 2UL
+#define VECT_POLY_OUTLINE_INNER 4UL
+#define VECT_POLY_OUTLINE_OUTER 8UL
// -----------------------------------------------------------------------------
-#define VECT_MAP( _def_pIn, _def_pOut, _def_nVal ) _def_pOut[_def_nVal]=(_def_pIn[_def_nVal]=((_def_nVal)*4L)+1L)+5L;
-#define BACK_MAP( _def_nVal ) ((((_def_nVal)+2)>>2)-1)
-#define VECT_PROGRESS( _def_pProgress, _def_nVal ) if(_def_pProgress&&_def_pProgress->IsSet())(_def_pProgress->Call((void*)_def_nVal));
+#define VECT_MAP( _def_pIn, _def_pOut, _def_nVal ) _def_pOut[_def_nVal]=(_def_pIn[_def_nVal]=((_def_nVal)*4L)+1L)+5L;
+#define BACK_MAP( _def_nVal ) ((((_def_nVal)+2)>>2)-1)
+#define VECT_PROGRESS( _def_pProgress, _def_nVal ) if(_def_pProgress&&_def_pProgress->IsSet())(_def_pProgress->Call((void*)_def_nVal));
// -----------
// - statics -
@@ -70,7 +70,7 @@
struct ChainMove { long nDX; long nDY; };
-static ChainMove aImplMove[ 8 ] = {
+static ChainMove aImplMove[ 8 ] = {
{ 1L, 0L },
{ 0L, -1L },
{ -1L, 0L },
@@ -81,7 +81,7 @@ static ChainMove aImplMove[ 8 ] = {
{ 1L, 1L }
};
-static ChainMove aImplMoveInner[ 8 ] = {
+static ChainMove aImplMoveInner[ 8 ] = {
{ 0L, 1L },
{ 1L, 0L },
{ 0L, -1L },
@@ -92,7 +92,7 @@ static ChainMove aImplMoveInner[ 8 ] = {
{ -1L, 0L }
};
-static ChainMove aImplMoveOuter[ 8 ] = {
+static ChainMove aImplMoveOuter[ 8 ] = {
{ 0L, -1L },
{ -1L, 0L },
{ 0L, 1L },
@@ -110,23 +110,23 @@ static ChainMove aImplMoveOuter[ 8 ] = {
struct ImplColorSet
{
BitmapColor maColor;
- sal_uInt16 mnIndex;
- sal_Bool mbSet;
+ USHORT mnIndex;
+ BOOL mbSet;
- sal_Bool operator<( const ImplColorSet& rSet ) const;
- sal_Bool operator>( const ImplColorSet& rSet ) const;
+ BOOL operator<( const ImplColorSet& rSet ) const;
+ BOOL operator>( const ImplColorSet& rSet ) const;
};
// ----------------------------------------------------------------------------
-inline sal_Bool ImplColorSet::operator<( const ImplColorSet& rSet ) const
+inline BOOL ImplColorSet::operator<( const ImplColorSet& rSet ) const
{
return( mbSet && ( !rSet.mbSet || ( maColor.GetLuminance() > rSet.maColor.GetLuminance() ) ) );
}
// ----------------------------------------------------------------------------
-inline sal_Bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
+inline BOOL ImplColorSet::operator>( const ImplColorSet& rSet ) const
{
return( !mbSet || ( rSet.mbSet && maColor.GetLuminance() < rSet.maColor.GetLuminance() ) );
}
@@ -135,14 +135,14 @@ inline sal_Bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p2 )
{
- ImplColorSet* pSet1 = (ImplColorSet*) p1;
- ImplColorSet* pSet2 = (ImplColorSet*) p2;
- int nRet;
+ ImplColorSet* pSet1 = (ImplColorSet*) p1;
+ ImplColorSet* pSet2 = (ImplColorSet*) p2;
+ int nRet;
if( pSet1->mbSet && pSet2->mbSet )
{
- const sal_uInt8 cLum1 = pSet1->maColor.GetLuminance();
- const sal_uInt8 cLum2 = pSet2->maColor.GetLuminance();
+ const BYTE cLum1 = pSet1->maColor.GetLuminance();
+ const BYTE cLum2 = pSet2->maColor.GetLuminance();
nRet = ( ( cLum1 > cLum2 ) ? -1 : ( ( cLum1 == cLum2 ) ? 0 : 1 ) );
}
else if( pSet1->mbSet )
@@ -161,32 +161,32 @@ extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p
class ImplPointArray
{
- Point* mpArray;
- sal_uLong mnSize;
- sal_uLong mnRealSize;
+ Point* mpArray;
+ ULONG mnSize;
+ ULONG mnRealSize;
public:
ImplPointArray();
~ImplPointArray();
- void ImplSetSize( sal_uLong nSize );
+ void ImplSetSize( ULONG nSize );
- sal_uLong ImplGetRealSize() const { return mnRealSize; }
- void ImplSetRealSize( sal_uLong nRealSize ) { mnRealSize = nRealSize; }
+ ULONG ImplGetRealSize() const { return mnRealSize; }
+ void ImplSetRealSize( ULONG nRealSize ) { mnRealSize = nRealSize; }
- inline Point& operator[]( sal_uLong nPos );
- inline const Point& operator[]( sal_uLong nPos ) const;
+ inline Point& operator[]( ULONG nPos );
+ inline const Point& operator[]( ULONG nPos ) const;
- void ImplCreatePoly( Polygon& rPoly ) const;
+ void ImplCreatePoly( Polygon& rPoly ) const;
};
// -----------------------------------------------------------------------------
ImplPointArray::ImplPointArray() :
- mpArray ( NULL ),
- mnSize ( 0UL ),
- mnRealSize ( 0UL )
+ mpArray ( NULL ),
+ mnSize ( 0UL ),
+ mnRealSize ( 0UL )
{
}
@@ -201,9 +201,9 @@ ImplPointArray::~ImplPointArray()
// -----------------------------------------------------------------------------
-void ImplPointArray::ImplSetSize( sal_uLong nSize )
+void ImplPointArray::ImplSetSize( ULONG nSize )
{
- const sal_uLong nTotal = nSize * sizeof( Point );
+ const ULONG nTotal = nSize * sizeof( Point );
mnSize = nSize;
mnRealSize = 0UL;
@@ -217,7 +217,7 @@ void ImplPointArray::ImplSetSize( sal_uLong nSize )
// -----------------------------------------------------------------------------
-inline Point& ImplPointArray::operator[]( sal_uLong nPos )
+inline Point& ImplPointArray::operator[]( ULONG nPos )
{
DBG_ASSERT( nPos < mnSize, "ImplPointArray::operator[]: nPos out of range!" );
return mpArray[ nPos ];
@@ -225,7 +225,7 @@ inline Point& ImplPointArray::operator[]( sal_uLong nPos )
// -----------------------------------------------------------------------------
-inline const Point& ImplPointArray::operator[]( sal_uLong nPos ) const
+inline const Point& ImplPointArray::operator[]( 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[]( sal_uLong nPos ) const
void ImplPointArray::ImplCreatePoly( Polygon& rPoly ) const
{
- rPoly = Polygon( sal::static_int_cast<sal_uInt16>(mnRealSize), mpArray );
+ rPoly = Polygon( sal::static_int_cast<USHORT>(mnRealSize), mpArray );
}
// ---------------
@@ -246,10 +246,10 @@ class ImplVectMap
{
private:
- Scanline mpBuf;
- Scanline* mpScan;
- long mnWidth;
- long mnHeight;
+ Scanline mpBuf;
+ Scanline* mpScan;
+ long mnWidth;
+ long mnHeight;
ImplVectMap() {};
@@ -258,27 +258,27 @@ public:
ImplVectMap( long nWidth, long nHeight );
~ImplVectMap();
- inline long Width() const { return mnWidth; }
- inline long Height() const { return mnHeight; }
+ inline long Width() const { return mnWidth; }
+ inline long Height() const { return mnHeight; }
- inline void Set( long nY, long nX, sal_uInt8 cVal );
- inline sal_uInt8 Get( long nY, long nX ) const;
+ inline void Set( long nY, long nX, BYTE cVal );
+ inline BYTE Get( 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;
+ inline BOOL IsFree( long nY, long nX ) const;
+ inline BOOL IsCont( long nY, long nX ) const;
+ inline BOOL IsDone( long nY, long nX ) const;
};
// -----------------------------------------------------------------------------
ImplVectMap::ImplVectMap( long nWidth, long nHeight ) :
- mnWidth ( nWidth ),
+ mnWidth ( nWidth ),
mnHeight( nHeight )
{
- const long nWidthAl = ( nWidth >> 2L ) + 1L;
- const long nSize = nWidthAl * nHeight;
- Scanline pTmp = mpBuf = (Scanline) rtl_allocateMemory( nSize );
+ const long nWidthAl = ( nWidth >> 2L ) + 1L;
+ const long nSize = nWidthAl * nHeight;
+ Scanline pTmp = mpBuf = (Scanline) rtl_allocateMemory( nSize );
memset( mpBuf, 0, nSize );
mpScan = (Scanline*) rtl_allocateMemory( nHeight * sizeof( Scanline ) );
@@ -298,36 +298,36 @@ ImplVectMap::~ImplVectMap()
// -----------------------------------------------------------------------------
-inline void ImplVectMap::Set( long nY, long nX, sal_uInt8 cVal )
+inline void ImplVectMap::Set( long nY, long nX, BYTE cVal )
{
- const sal_uInt8 cShift = sal::static_int_cast<sal_uInt8>(6 - ( ( nX & 3 ) << 1 ));
+ const BYTE cShift = sal::static_int_cast<BYTE>(6 - ( ( nX & 3 ) << 1 ));
( ( mpScan[ nY ][ nX >> 2 ] ) &= ~( 3 << cShift ) ) |= ( cVal << cShift );
}
// -----------------------------------------------------------------------------
-inline sal_uInt8 ImplVectMap::Get( long nY, long nX ) const
+inline BYTE ImplVectMap::Get( long nY, long nX ) const
{
- return sal::static_int_cast<sal_uInt8>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
+ return sal::static_int_cast<BYTE>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
}
// -----------------------------------------------------------------------------
-inline sal_Bool ImplVectMap::IsFree( long nY, long nX ) const
+inline BOOL ImplVectMap::IsFree( long nY, long nX ) const
{
return( VECT_FREE_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline sal_Bool ImplVectMap::IsCont( long nY, long nX ) const
+inline BOOL ImplVectMap::IsCont( long nY, long nX ) const
{
return( VECT_CONT_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline sal_Bool ImplVectMap::IsDone( long nY, long nX ) const
+inline BOOL ImplVectMap::IsDone( long nY, long nX ) const
{
return( VECT_DONE_INDEX == Get( nY, nX ) );
}
@@ -340,41 +340,41 @@ class ImplChain
{
private:
- Polygon maPoly;
- Point maStartPt;
- sal_uLong mnArraySize;
- sal_uLong mnCount;
- long mnResize;
- sal_uInt8* mpCodes;
+ Polygon maPoly;
+ Point maStartPt;
+ ULONG mnArraySize;
+ ULONG mnCount;
+ long mnResize;
+ BYTE* mpCodes;
- void ImplGetSpace();
+ void ImplGetSpace();
- void ImplCreate();
- void ImplCreateInner();
- void ImplCreateOuter();
- void ImplPostProcess( const ImplPointArray& rArr );
+ void ImplCreate();
+ void ImplCreateInner();
+ void ImplCreateOuter();
+ void ImplPostProcess( const ImplPointArray& rArr );
public:
- ImplChain( sal_uLong nInitCount = 1024UL, long nResize = -1L );
+ ImplChain( ULONG nInitCount = 1024UL, long nResize = -1L );
~ImplChain();
- void ImplBeginAdd( const Point& rStartPt );
- inline void ImplAdd( sal_uInt8 nCode );
- void ImplEndAdd( sal_uLong nTypeFlag );
+ void ImplBeginAdd( const Point& rStartPt );
+ inline void ImplAdd( BYTE nCode );
+ void ImplEndAdd( ULONG nTypeFlag );
- const Polygon& ImplGetPoly() const { return maPoly; }
+ const Polygon& ImplGetPoly() { return maPoly; }
};
// -----------------------------------------------------------------------------
-ImplChain::ImplChain( sal_uLong nInitCount, long nResize ) :
- mnArraySize ( nInitCount ),
- mnCount ( 0UL ),
- mnResize ( nResize )
+ImplChain::ImplChain( ULONG nInitCount, long nResize ) :
+ mnArraySize ( nInitCount ),
+ mnCount ( 0UL ),
+ mnResize ( nResize )
{
DBG_ASSERT( nInitCount && nResize, "ImplChain::ImplChain(): invalid parameters!" );
- mpCodes = new sal_uInt8[ mnArraySize ];
+ mpCodes = new BYTE[ mnArraySize ];
}
// -----------------------------------------------------------------------------
@@ -388,11 +388,11 @@ ImplChain::~ImplChain()
void ImplChain::ImplGetSpace()
{
- const sal_uLong nOldArraySize = mnArraySize;
- sal_uInt8* pNewCodes;
+ const ULONG nOldArraySize = mnArraySize;
+ BYTE* pNewCodes;
- mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (sal_uLong) mnResize );
- pNewCodes = new sal_uInt8[ mnArraySize ];
+ mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (ULONG) mnResize );
+ pNewCodes = new BYTE[ mnArraySize ];
memcpy( pNewCodes, mpCodes, nOldArraySize );
delete[] mpCodes;
mpCodes = pNewCodes;
@@ -409,7 +409,7 @@ void ImplChain::ImplBeginAdd( const Point& rStartPt )
// -----------------------------------------------------------------------------
-inline void ImplChain::ImplAdd( sal_uInt8 nCode )
+inline void ImplChain::ImplAdd( BYTE nCode )
{
if( mnCount == mnArraySize )
ImplGetSpace();
@@ -419,7 +419,7 @@ inline void ImplChain::ImplAdd( sal_uInt8 nCode )
// -----------------------------------------------------------------------------
-void ImplChain::ImplEndAdd( sal_uLong nFlag )
+void ImplChain::ImplEndAdd( ULONG nFlag )
{
if( mnCount )
{
@@ -434,15 +434,15 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- sal_uInt16 i, nPolyPos;
+ USHORT i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- 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 ];
- sal_Bool bDone = sal_True;
+ const BYTE cMove = mpCodes[ i ];
+ const BYTE cNextMove = mpCodes[ i + 1 ];
+ const ChainMove& rMove = aImplMove[ cMove ];
+ const ChainMove& rMoveInner = aImplMoveInner[ cMove ];
+// Point& rPt = aArr[ nPolyPos ];
+ BOOL bDone = TRUE;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -500,7 +500,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = sal_False;
+ bDone = FALSE;
}
else if( cMove == 7 && cNextMove == 0 )
{
@@ -519,7 +519,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
aArr[ nPolyPos++ ].Y() = nLastY;
}
else
- bDone = sal_False;
+ bDone = FALSE;
if( !bDone )
{
@@ -541,15 +541,15 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- sal_uInt16 i, nPolyPos;
+ USHORT i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- 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 ];
- sal_Bool bDone = sal_True;
+ const BYTE cMove = mpCodes[ i ];
+ const BYTE cNextMove = mpCodes[ i + 1 ];
+ const ChainMove& rMove = aImplMove[ cMove ];
+ const ChainMove& rMoveOuter = aImplMoveOuter[ cMove ];
+// Point& rPt = aArr[ nPolyPos ];
+ BOOL bDone = TRUE;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -607,7 +607,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = sal_False;
+ bDone = FALSE;
}
else if( cMove == 7 && cNextMove == 3 )
{
@@ -626,7 +626,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
aArr[ nPolyPos++ ].Y() = nLastY + 1;
}
else
- bDone = sal_False;
+ bDone = FALSE;
if( !bDone )
{
@@ -646,7 +646,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
aArr.ImplSetSize( mnCount + 1 );
aArr[ 0 ] = Point( nLastX, nLastY );
- for( sal_uLong i = 0; i < mnCount; )
+ for( ULONG i = 0; i < mnCount; )
{
const ChainMove& rMove = aImplMove[ mpCodes[ i ] ];
aArr[ ++i ] = Point( nLastX += rMove.nDX, nLastY += rMove.nDY );
@@ -665,13 +665,13 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
{
- ImplPointArray aNewArr1;
- ImplPointArray aNewArr2;
- Point* pLast;
- Point* pLeast;
- sal_uLong nNewPos;
- sal_uLong nCount = rArr.ImplGetRealSize();
- sal_uLong n;
+ ImplPointArray aNewArr1;
+ ImplPointArray aNewArr2;
+ Point* pLast;
+ Point* pLeast;
+ ULONG nNewPos;
+ ULONG nCount = rArr.ImplGetRealSize();
+ ULONG n;
// pass 1
aNewArr1.ImplSetSize( nCount );
@@ -682,8 +682,8 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
for( n = nNewPos = 1; n < nCount; )
{
const Point& rPt = rArr[ n++ ];
- const long nX = BACK_MAP( rPt.X() );
- const long nY = BACK_MAP( rPt.Y() );
+ const long nX = BACK_MAP( rPt.X() );
+ const long nY = BACK_MAP( rPt.Y() );
if( nX != pLast->X() || nY != pLast->Y() )
{
@@ -738,26 +738,26 @@ ImplVectorizer::~ImplVectorizer()
// -----------------------------------------------------------------------------
-sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
+BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
+ BYTE cReduce, ULONG nFlags, const Link* pProgress )
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
VECT_PROGRESS( pProgress, 0 );
- Bitmap* pBmp = new Bitmap( rColorBmp );
- BitmapReadAccess* pRAcc = pBmp->AcquireReadAccess();
+ Bitmap* pBmp = new Bitmap( rColorBmp );
+ BitmapReadAccess* pRAcc = pBmp->AcquireReadAccess();
if( pRAcc )
{
- PolyPolygon aPolyPoly;
- double fPercent = 0.0;
- double fPercentStep_2 = 0.0;
- const long nWidth = pRAcc->Width();
- const long nHeight = pRAcc->Height();
- const sal_uInt16 nColorCount = pRAcc->GetPaletteEntryCount();
- sal_uInt16 n;
- ImplColorSet* pColorSet = (ImplColorSet*) new sal_uInt8[ 256 * sizeof( ImplColorSet ) ];
+ PolyPolygon aPolyPoly;
+ double fPercent = 0.0;
+ 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 ) ];
memset( pColorSet, 0, 256 * sizeof( ImplColorSet ) );
rMtf.Clear();
@@ -784,12 +784,12 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM
VECT_PROGRESS( pProgress, FRound( fPercent += 10.0 ) );
- for( sal_uInt16 i = 0; i < n; i++ )
+ for( USHORT i = 0; i < n; i++ )
{
- const BitmapColor aBmpCol( pRAcc->GetPaletteColor( pColorSet[ i ].mnIndex ) );
- const Color aFindColor( aBmpCol.GetRed(), aBmpCol.GetGreen(), aBmpCol.GetBlue() );
-// const sal_uInt8 cLum = aFindColor.GetLuminance();
- ImplVectMap* pMap = ImplExpand( pRAcc, aFindColor );
+ const BitmapColor aBmpCol( pRAcc->GetPaletteColor( pColorSet[ i ].mnIndex ) );
+ const Color aFindColor( aBmpCol.GetRed(), aBmpCol.GetGreen(), aBmpCol.GetBlue() );
+// const BYTE cLum = aFindColor.GetLuminance();
+ ImplVectMap* pMap = ImplExpand( pRAcc, aFindColor );
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
@@ -808,8 +808,8 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM
if( aPolyPoly.Count() )
{
- rMtf.AddAction( new MetaLineColorAction( aFindColor, sal_True ) );
- rMtf.AddAction( new MetaFillColorAction( aFindColor, sal_True ) );
+ rMtf.AddAction( new MetaLineColorAction( aFindColor, TRUE ) );
+ rMtf.AddAction( new MetaFillColorAction( aFindColor, TRUE ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
}
}
@@ -818,19 +818,19 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
}
- delete[] (sal_uInt8*) pColorSet;
+ delete[] (BYTE*) pColorSet;
if( rMtf.GetActionCount() )
{
- MapMode aMap( MAP_100TH_MM );
- VirtualDevice aVDev;
- const Size aLogSize1( aVDev.PixelToLogic( Size( 1, 1 ), aMap ) );
+ MapMode aMap( MAP_100TH_MM );
+ VirtualDevice aVDev;
+ const Size aLogSize1( aVDev.PixelToLogic( Size( 1, 1 ), aMap ) );
rMtf.SetPrefMapMode( aMap );
rMtf.SetPrefSize( Size( nWidth + 2, nHeight + 2 ) );
rMtf.Move( 1, 1 );
rMtf.Scale( aLogSize1.Width(), aLogSize1.Height() );
- bRet = sal_True;
+ bRet = TRUE;
}
}
@@ -843,14 +843,14 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rM
// -----------------------------------------------------------------------------
-sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
+BOOL ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
PolyPolygon& rPolyPoly,
- sal_uLong nFlags, const Link* pProgress )
+ ULONG nFlags, const Link* pProgress )
{
- Bitmap* pBmp = new Bitmap( rMonoBmp );
- BitmapReadAccess* pRAcc;
- ImplVectMap* pMap;
- sal_Bool bRet = sal_False;
+ Bitmap* pBmp = new Bitmap( rMonoBmp );
+ BitmapReadAccess* pRAcc;
+ ImplVectMap* pMap;
+ BOOL bRet = FALSE;
VECT_PROGRESS( pProgress, 10 );
@@ -886,10 +886,10 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
for( ; nCurPoly < nCount; ++nCurPoly )
{
- const Polygon& rPoly = rPolyPoly.GetObject( nCurPoly );
+ const Polygon& rPoly = rPolyPoly.GetObject( nCurPoly );
const sal_uInt16 nSize( rPoly.GetSize() );
- sal_uInt16 nDepth( 0 ), i( 0 );
- const bool bRight( rPoly.IsRightOrientated() );
+ sal_uInt16 nDepth( 0 ), i( 0 );
+ const bool bRight( rPoly.IsRightOrientated() );
for( ; i < nCount; ++i )
if( ( i != nCurPoly ) && rPolyPoly.GetObject( i ).IsInside( rPoly[ 0 ] ) )
@@ -899,7 +899,7 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
if( nSize && ( ( !bRight && !bHole ) || ( bRight && bHole ) ) )
{
- Polygon aNewPoly( nSize );
+ Polygon aNewPoly( nSize );
sal_uInt16 nPrim( 0 ), nSec( nSize - 1 );
if( rPoly.HasFlags() )
@@ -924,13 +924,13 @@ sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
// put outmost polygon to the front
if( nFirstPoly > 0 )
{
- const Polygon aFirst( rPolyPoly.GetObject( static_cast< sal_uInt16 >( nFirstPoly ) ) );
+ const Polygon aFirst( rPolyPoly.GetObject( static_cast< USHORT >( nFirstPoly ) ) );
- rPolyPoly.Remove( static_cast< sal_uInt16 >( nFirstPoly ) );
+ rPolyPoly.Remove( static_cast< USHORT >( nFirstPoly ) );
rPolyPoly.Insert( aFirst, 0 );
}
-
- bRet = sal_True;
+
+ bRet = TRUE;
}
VECT_PROGRESS( pProgress, 100 );
@@ -945,15 +945,15 @@ void ImplVectorizer::ImplLimitPolyPoly( PolyPolygon& rPolyPoly )
if( rPolyPoly.Count() > VECT_POLY_MAX )
{
PolyPolygon aNewPolyPoly;
- long nReduce = 0;
- sal_uInt16 nNewCount;
+ long nReduce = 0;
+ USHORT nNewCount;
do
{
aNewPolyPoly.Clear();
nReduce++;
- for( sal_uInt16 i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
{
const Rectangle aBound( rPolyPoly[ i ].GetBoundRect() );
@@ -980,14 +980,14 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r
if( pRAcc && pRAcc->Width() && pRAcc->Height() )
{
- const long nOldWidth = pRAcc->Width();
- const long nOldHeight = pRAcc->Height();
- const long nNewWidth = ( nOldWidth << 2L ) + 4L;
- const long nNewHeight = ( nOldHeight << 2L ) + 4L;
- const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) );
- long* pMapIn = new long[ Max( nOldWidth, nOldHeight ) ];
- long* pMapOut = new long[ Max( nOldWidth, nOldHeight ) ];
- long nX, nY, nTmpX, nTmpY;
+ const long nOldWidth = pRAcc->Width();
+ const long nOldHeight = pRAcc->Height();
+ const long nNewWidth = ( nOldWidth << 2L ) + 4L;
+ const long nNewHeight = ( nOldHeight << 2L ) + 4L;
+ const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) );
+ long* pMapIn = new long[ Max( nOldWidth, nOldHeight ) ];
+ long* pMapOut = new long[ Max( nOldWidth, nOldHeight ) ];
+ long nX, nY, nTmpX, nTmpY;
pMap = new ImplVectMap( nNewWidth, nNewHeight );
@@ -1067,14 +1067,14 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r
// -----------------------------------------------------------------------------
-void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags )
+void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, BYTE cReduce, ULONG nFlags )
{
const long nWidth = pMap->Width(), nHeight= pMap->Height();
for( long nY = 0L; nY < nHeight; nY++ )
{
- long nX = 0L;
- sal_Bool bInner = sal_True;
+ long nX = 0L;
+ BOOL bInner = TRUE;
while( nX < nWidth )
{
@@ -1088,8 +1088,8 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, s
if( pMap->IsCont( nY, nX ) )
{
// new contour
- ImplChain aChain;
- const Point aStartPt( nX++, nY );
+ ImplChain aChain;
+ const Point aStartPt( nX++, nY );
// get chain code
aChain.ImplBeginAdd( aStartPt );
@@ -1106,7 +1106,7 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, s
{
if( cReduce )
{
- const Rectangle aBound( rPoly.GetBoundRect() );
+ const Rectangle aBound( rPoly.GetBoundRect() );
if( aBound.GetWidth() > cReduce && aBound.GetHeight() > cReduce )
rPolyPoly.Insert( rPoly );
@@ -1136,15 +1136,15 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, s
// -----------------------------------------------------------------------------
-sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
+BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
{
- long nActX = rStartPt.X();
- long nActY = rStartPt.Y();
- long nTryX;
- long nTryY;
- sal_uLong nFound;
- sal_uLong nLastDir = 0UL;
- sal_uLong nDir;
+ long nActX = rStartPt.X();
+ long nActY = rStartPt.Y();
+ long nTryX;
+ long nTryY;
+ ULONG nFound;
+ ULONG nLastDir = 0UL;
+ ULONG nDir;
do
{
@@ -1156,7 +1156,7 @@ sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (sal_uInt8) nLastDir );
+ rChain.ImplAdd( (BYTE) nLastDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
}
@@ -1173,7 +1173,7 @@ sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (sal_uInt8) nDir );
+ rChain.ImplAdd( (BYTE) nDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
nLastDir = nDir;
@@ -1185,21 +1185,21 @@ sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt
}
while( nFound );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------------
-sal_Bool ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
+BOOL ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
{
if( pMap->IsDone( nY - 1L, nX ) )
- return sal_True;
+ return TRUE;
else if( pMap->IsDone( nY + 1L, nX ) )
- return sal_False;
+ return FALSE;
else if( pMap->IsDone( nY - 1L, nX - 1L ) || pMap->IsDone( nY - 1L, nX + 1L ) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index 56591e969b8b..db1213e14e9b 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,22 +43,22 @@ class ImplVectMap;
class ImplVectorizer
{
private:
-
- ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor );
- 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:
+
+ 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 ImplLimitPolyPoly( PolyPolygon& rPolyPoly );
+
+public:
ImplVectorizer();
~ImplVectorizer();
-
- 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 );
+
+ 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 );
};
#endif
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index bcf7986c70b2..5174caaffc96 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,44 +38,44 @@
DBG_NAME( JobSetup )
-#define JOBSET_FILEFORMAT2 3780
-#define JOBSET_FILE364_SYSTEM ((sal_uInt16)0xFFFF)
-#define JOBSET_FILE605_SYSTEM ((sal_uInt16)0xFFFE)
+#define JOBSET_FILEFORMAT2 3780
+#define JOBSET_FILE364_SYSTEM ((USHORT)0xFFFF)
+#define JOBSET_FILE605_SYSTEM ((USHORT)0xFFFE)
struct ImplOldJobSetupData
{
- char cPrinterName[64];
- char cDeviceName[32];
- char cPortName[32];
- char cDriverName[32];
+ char cPrinterName[64];
+ char cDeviceName[32];
+ char cPortName[32];
+ char cDriverName[32];
};
struct Impl364JobSetupData
{
- SVBT16 nSize;
- SVBT16 nSystem;
- SVBT32 nDriverDataLen;
- SVBT16 nOrientation;
- SVBT16 nPaperBin;
- SVBT16 nPaperFormat;
- SVBT32 nPaperWidth;
- SVBT32 nPaperHeight;
+ SVBT16 nSize;
+ SVBT16 nSystem;
+ SVBT32 nDriverDataLen;
+ SVBT16 nOrientation;
+ SVBT16 nPaperBin;
+ SVBT16 nPaperFormat;
+ SVBT32 nPaperWidth;
+ SVBT32 nPaperHeight;
};
// =======================================================================
ImplJobSetup::ImplJobSetup()
{
- mnRefCount = 1;
- mnSystem = 0;
- meOrientation = ORIENTATION_PORTRAIT;
+ mnRefCount = 1;
+ mnSystem = 0;
+ meOrientation = ORIENTATION_PORTRAIT;
meDuplexMode = DUPLEX_UNKNOWN;
- mnPaperBin = 0;
- mePaperFormat = PAPER_USER;
- mnPaperWidth = 0;
- mnPaperHeight = 0;
- mnDriverDataLen = 0;
- mpDriverData = NULL;
+ mnPaperBin = 0;
+ mePaperFormat = PAPER_USER;
+ mnPaperWidth = 0;
+ mnPaperHeight = 0;
+ mnDriverDataLen = 0;
+ mpDriverData = NULL;
}
// -----------------------------------------------------------------------
@@ -84,23 +84,23 @@ ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) :
maPrinterName( rJobSetup.maPrinterName ),
maDriver( rJobSetup.maDriver )
{
- mnRefCount = 1;
- mnSystem = rJobSetup.mnSystem;
- meOrientation = rJobSetup.meOrientation;
+ mnRefCount = 1;
+ mnSystem = rJobSetup.mnSystem;
+ meOrientation = rJobSetup.meOrientation;
meDuplexMode = rJobSetup.meDuplexMode;
- mnPaperBin = rJobSetup.mnPaperBin;
- mePaperFormat = rJobSetup.mePaperFormat;
- mnPaperWidth = rJobSetup.mnPaperWidth;
- mnPaperHeight = rJobSetup.mnPaperHeight;
- mnDriverDataLen = rJobSetup.mnDriverDataLen;
+ mnPaperBin = rJobSetup.mnPaperBin;
+ mePaperFormat = rJobSetup.mePaperFormat;
+ mnPaperWidth = rJobSetup.mnPaperWidth;
+ mnPaperHeight = rJobSetup.mnPaperHeight;
+ mnDriverDataLen = rJobSetup.mnDriverDataLen;
if ( rJobSetup.mpDriverData )
{
- mpDriverData = (sal_uInt8*)rtl_allocateMemory( mnDriverDataLen );
+ mpDriverData = (BYTE*)rtl_allocateMemory( mnDriverDataLen );
memcpy( mpDriverData, rJobSetup.mpDriverData, mnDriverDataLen );
}
else
mpDriverData = NULL;
- maValueMap = rJobSetup.maValueMap;
+ maValueMap = rJobSetup.maValueMap;
}
// -----------------------------------------------------------------------
@@ -212,7 +212,7 @@ String JobSetup::GetValue( const String& rKey ) const
{
if( mpData )
{
- ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
it = mpData->maValueMap.find( rKey );
return it != mpData->maValueMap.end() ? String( it->second ) : String();
}
@@ -258,35 +258,35 @@ JobSetup& JobSetup::operator=( const JobSetup& rJobSetup )
// -----------------------------------------------------------------------
-sal_Bool JobSetup::operator==( const JobSetup& rJobSetup ) const
+BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
{
DBG_CHKTHIS( JobSetup, NULL );
DBG_CHKOBJ( &rJobSetup, JobSetup, NULL );
if ( mpData == rJobSetup.mpData )
- return sal_True;
+ return TRUE;
if ( !mpData || !rJobSetup.mpData )
- return sal_False;
+ return FALSE;
ImplJobSetup* pData1 = mpData;
ImplJobSetup* pData2 = rJobSetup.mpData;
- if ( (pData1->mnSystem == pData2->mnSystem) &&
- (pData1->maPrinterName == pData2->maPrinterName) &&
- (pData1->maDriver == pData2->maDriver) &&
- (pData1->meOrientation == pData2->meOrientation) &&
- (pData1->meDuplexMode == pData2->meDuplexMode) &&
- (pData1->mnPaperBin == pData2->mnPaperBin) &&
- (pData1->mePaperFormat == pData2->mePaperFormat) &&
- (pData1->mnPaperWidth == pData2->mnPaperWidth) &&
- (pData1->mnPaperHeight == pData2->mnPaperHeight) &&
- (pData1->mnDriverDataLen == pData2->mnDriverDataLen) &&
- (memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0) &&
- (pData1->maValueMap == pData2->maValueMap)
+ if ( (pData1->mnSystem == pData2->mnSystem) &&
+ (pData1->maPrinterName == pData2->maPrinterName) &&
+ (pData1->maDriver == pData2->maDriver) &&
+ (pData1->meOrientation == pData2->meOrientation) &&
+ (pData1->meDuplexMode == pData2->meDuplexMode) &&
+ (pData1->mnPaperBin == pData2->mnPaperBin) &&
+ (pData1->mePaperFormat == pData2->mePaperFormat) &&
+ (pData1->mnPaperWidth == pData2->mnPaperWidth) &&
+ (pData1->mnPaperHeight == pData2->mnPaperHeight) &&
+ (pData1->mnDriverDataLen == pData2->mnDriverDataLen) &&
+ (memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0) &&
+ (pData1->maValueMap == pData2->maValueMap)
)
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -295,17 +295,16 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
{
DBG_ASSERTWARNING( rIStream.GetVersion(), "JobSetup::>> - Solar-Version not set on rOStream" );
+ // Zur Zeit haben wir noch kein neues FileFormat
+// if ( rIStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
+ USHORT nLen;
+ USHORT nSystem;
sal_Size nFirstPos = rIStream.Tell();
-
- sal_uInt16 nLen = 0;
rIStream >> nLen;
if ( !nLen )
return rIStream;
-
- sal_uInt16 nSystem = 0;
rIStream >> nSystem;
-
char* pTempBuf = new char[nLen];
rIStream.Read( pTempBuf, nLen - sizeof( nLen ) - sizeof( nSystem ) );
if ( nLen >= sizeof(ImplOldJobSetupData)+4 )
@@ -318,34 +317,34 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
else
rJobSetup.mpData->mnRefCount--;
}
-
+
rtl_TextEncoding aStreamEncoding = RTL_TEXTENCODING_UTF8;
if( nSystem == JOBSET_FILE364_SYSTEM )
aStreamEncoding = rIStream.GetStreamCharSet();
-
+
rJobSetup.mpData = new ImplJobSetup;
ImplJobSetup* pJobData = rJobSetup.mpData;
pJobData->maPrinterName = UniString( pData->cPrinterName, aStreamEncoding );
- pJobData->maDriver = UniString( pData->cDriverName, aStreamEncoding );
+ pJobData->maDriver = UniString( pData->cDriverName, aStreamEncoding );
// Sind es unsere neuen JobSetup-Daten?
if ( nSystem == JOBSET_FILE364_SYSTEM ||
nSystem == JOBSET_FILE605_SYSTEM )
{
- Impl364JobSetupData* pOldJobData = (Impl364JobSetupData*)(pTempBuf + sizeof( ImplOldJobSetupData ));
- sal_uInt16 nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
- pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem );
- pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen );
- pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation );
+ Impl364JobSetupData* pOldJobData = (Impl364JobSetupData*)(pTempBuf + sizeof( ImplOldJobSetupData ));
+ USHORT nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
+ pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem );
+ pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen );
+ pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation );
pJobData->meDuplexMode = DUPLEX_UNKNOWN;
- pJobData->mnPaperBin = SVBT16ToShort( pOldJobData->nPaperBin );
- pJobData->mePaperFormat = (Paper)SVBT16ToShort( pOldJobData->nPaperFormat );
- pJobData->mnPaperWidth = (long)SVBT32ToUInt32( pOldJobData->nPaperWidth );
- pJobData->mnPaperHeight = (long)SVBT32ToUInt32( pOldJobData->nPaperHeight );
+ pJobData->mnPaperBin = SVBT16ToShort( pOldJobData->nPaperBin );
+ pJobData->mePaperFormat = (Paper)SVBT16ToShort( pOldJobData->nPaperFormat );
+ pJobData->mnPaperWidth = (long)SVBT32ToUInt32( pOldJobData->nPaperWidth );
+ pJobData->mnPaperHeight = (long)SVBT32ToUInt32( pOldJobData->nPaperHeight );
if ( pJobData->mnDriverDataLen )
{
- sal_uInt8* pDriverData = ((sal_uInt8*)pOldJobData) + nOldJobDataSize;
- pJobData->mpDriverData = (sal_uInt8*)rtl_allocateMemory( pJobData->mnDriverDataLen );
+ BYTE* pDriverData = ((BYTE*)pOldJobData) + nOldJobDataSize;
+ pJobData->mpDriverData = (BYTE*)rtl_allocateMemory( pJobData->mnDriverDataLen );
memcpy( pJobData->mpDriverData, pDriverData, pJobData->mnDriverDataLen );
}
if( nSystem == JOBSET_FILE605_SYSTEM )
@@ -378,6 +377,11 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
}
delete[] pTempBuf;
}
+/*
+ else
+ {
+ }
+*/
return rIStream;
}
@@ -389,26 +393,26 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
DBG_ASSERTWARNING( rOStream.GetVersion(), "JobSetup::<< - Solar-Version not set on rOStream" );
// Zur Zeit haben wir noch kein neues FileFormat
-// if ( rOStream.GetVersion() < JOBSET_FILEFORMAT2 )
+// if ( rOStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
- sal_uInt16 nLen = 0;
+ USHORT nLen = 0;
if ( !rJobSetup.mpData )
rOStream << nLen;
else
{
- sal_uInt16 nSystem = JOBSET_FILE605_SYSTEM;
+ USHORT nSystem = JOBSET_FILE605_SYSTEM;
const ImplJobSetup* pJobData = rJobSetup.ImplGetConstData();
Impl364JobSetupData aOldJobData;
- sal_uInt16 nOldJobDataSize = sizeof( aOldJobData );
+ USHORT nOldJobDataSize = sizeof( aOldJobData );
ShortToSVBT16( nOldJobDataSize, aOldJobData.nSize );
ShortToSVBT16( pJobData->mnSystem, aOldJobData.nSystem );
UInt32ToSVBT32( pJobData->mnDriverDataLen, aOldJobData.nDriverDataLen );
- ShortToSVBT16( (sal_uInt16)(pJobData->meOrientation), aOldJobData.nOrientation );
+ ShortToSVBT16( (USHORT)(pJobData->meOrientation), aOldJobData.nOrientation );
ShortToSVBT16( pJobData->mnPaperBin, aOldJobData.nPaperBin );
- ShortToSVBT16( (sal_uInt16)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
- UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
- UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
+ ShortToSVBT16( (USHORT)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
+ UInt32ToSVBT32( (ULONG)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
+ UInt32ToSVBT32( (ULONG)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
ImplOldJobSetupData aOldData;
memset( &aOldData, 0, sizeof( aOldData ) );
@@ -416,14 +420,14 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
strncpy( aOldData.cPrinterName, aPrnByteName.GetBuffer(), 63 );
ByteString aDriverByteName( rJobSetup.GetDriverName(), RTL_TEXTENCODING_UTF8 );
strncpy( aOldData.cDriverName, aDriverByteName.GetBuffer(), 31 );
-// nLen = sizeof( aOldData ) + 4 + nOldJobDataSize + pJobData->mnDriverDataLen;
+// nLen = sizeof( aOldData ) + 4 + nOldJobDataSize + pJobData->mnDriverDataLen;
int nPos = rOStream.Tell();
rOStream << nLen;
rOStream << nSystem;
rOStream.Write( (char*)&aOldData, sizeof( aOldData ) );
rOStream.Write( (char*)&aOldJobData, nOldJobDataSize );
rOStream.Write( (char*)pJobData->mpDriverData, pJobData->mnDriverDataLen );
- ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
for( it = pJobData->maValueMap.begin(); it != pJobData->maValueMap.end(); ++it )
{
rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
@@ -432,12 +436,12 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
rOStream.WriteByteString( "COMPAT_DUPLEX_MODE" ) ;
switch( pJobData->meDuplexMode )
{
- case DUPLEX_UNKNOWN: rOStream.WriteByteString( "DUPLEX_UNKNOWN" );break;
- case DUPLEX_OFF: rOStream.WriteByteString( "DUPLEX_OFF" );break;
- case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
- case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
+ case DUPLEX_UNKNOWN: rOStream.WriteByteString( "DUPLEX_UNKNOWN" );break;
+ case DUPLEX_OFF: rOStream.WriteByteString( "DUPLEX_OFF" );break;
+ case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
+ case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
}
- nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);
+ nLen = sal::static_int_cast<USHORT>(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 542c3103eb27..b2357d82619b 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,14 +44,14 @@ DBG_NAME( LineInfo )
// ----------------
ImplLineInfo::ImplLineInfo() :
- mnRefCount ( 1 ),
- meStyle ( LINE_SOLID ),
- mnWidth ( 0 ),
- mnDashCount ( 0 ),
- mnDashLen ( 0 ),
- mnDotCount ( 0 ),
- mnDotLen ( 0 ),
- mnDistance ( 0 ),
+ mnRefCount ( 1 ),
+ meStyle ( LINE_SOLID ),
+ mnWidth ( 0 ),
+ mnDashCount ( 0 ),
+ mnDashLen ( 0 ),
+ mnDotCount ( 0 ),
+ mnDotLen ( 0 ),
+ mnDistance ( 0 ),
meLineJoin ( basegfx::B2DLINEJOIN_ROUND )
{
}
@@ -59,32 +59,18 @@ ImplLineInfo::ImplLineInfo() :
// -----------------------------------------------------------------------
ImplLineInfo::ImplLineInfo( const ImplLineInfo& rImplLineInfo ) :
- mnRefCount ( 1 ),
- meStyle ( rImplLineInfo.meStyle ),
- mnWidth ( rImplLineInfo.mnWidth ),
- mnDashCount ( rImplLineInfo.mnDashCount ),
- mnDashLen ( rImplLineInfo.mnDashLen ),
- mnDotCount ( rImplLineInfo.mnDotCount ),
- mnDotLen ( rImplLineInfo.mnDotLen ),
- mnDistance ( rImplLineInfo.mnDistance ),
+ mnRefCount ( 1 ),
+ meStyle ( rImplLineInfo.meStyle ),
+ mnWidth ( rImplLineInfo.mnWidth ),
+ mnDashCount ( rImplLineInfo.mnDashCount ),
+ mnDashLen ( rImplLineInfo.mnDashLen ),
+ mnDotCount ( rImplLineInfo.mnDotCount ),
+ mnDotLen ( rImplLineInfo.mnDotLen ),
+ mnDistance ( rImplLineInfo.mnDistance ),
meLineJoin ( rImplLineInfo.meLineJoin )
{
}
-// -----------------------------------------------------------------------
-
-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 -
// ------------
@@ -127,20 +113,26 @@ LineInfo& LineInfo::operator=( const LineInfo& rLineInfo )
if( !( --mpImplLineInfo->mnRefCount ) )
delete mpImplLineInfo;
-
+
mpImplLineInfo = rLineInfo.mpImplLineInfo;
return *this;
}
// -----------------------------------------------------------------------
-sal_Bool LineInfo::operator==( const LineInfo& rLineInfo ) const
+BOOL LineInfo::operator==( const LineInfo& rLineInfo ) const
{
DBG_CHKTHIS( LineInfo, NULL );
DBG_CHKOBJ( &rLineInfo, LineInfo, NULL );
return( mpImplLineInfo == rLineInfo.mpImplLineInfo ||
- *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 ) );
}
// -----------------------------------------------------------------------
@@ -176,7 +168,7 @@ void LineInfo::SetWidth( long nWidth )
// -----------------------------------------------------------------------
-void LineInfo::SetDashCount( sal_uInt16 nDashCount )
+void LineInfo::SetDashCount( USHORT nDashCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -194,7 +186,7 @@ void LineInfo::SetDashLen( long nDashLen )
// -----------------------------------------------------------------------
-void LineInfo::SetDotCount( sal_uInt16 nDotCount )
+void LineInfo::SetDotCount( USHORT nDotCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -236,8 +228,8 @@ void LineInfo::SetLineJoin(basegfx::B2DLineJoin eLineJoin)
SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ UINT16 nTmp16;
rIStm >> nTmp16; rImplLineInfo.meStyle = (LineStyle) nTmp16;
rIStm >> rImplLineInfo.mnWidth;
@@ -266,7 +258,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
// version 1
- rOStm << (sal_uInt16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
+ rOStm << (UINT16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
// since version2
rOStm << rImplLineInfo.mnDashCount << rImplLineInfo.mnDashLen;
@@ -274,7 +266,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
rOStm << rImplLineInfo.mnDistance;
// since version3
- rOStm << (sal_uInt16) rImplLineInfo.meLineJoin;
+ rOStm << (UINT16) rImplLineInfo.meLineJoin;
return rOStm;
}
@@ -353,15 +345,15 @@ void LineInfo::applyToB2DPolyPolygon(
if(GetWidth() > 1 && io_rLinePolyPolygon.count())
{
const double fHalfLineWidth((GetWidth() * 0.5) + 0.5);
-
+
for(sal_uInt32 a(0); a < io_rLinePolyPolygon.count(); a++)
{
o_rFillPolyPolygon.append(basegfx::tools::createAreaGeometry(
- io_rLinePolyPolygon.getB2DPolygon(a),
- fHalfLineWidth,
+ io_rLinePolyPolygon.getB2DPolygon(a),
+ fHalfLineWidth,
GetLineJoin()));
}
-
+
io_rLinePolyPolygon.clear();
}
}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index d01c46a77ca0..451d446a86b7 100755..100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -43,9 +43,6 @@ CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
.ENDIF
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
CDEFS+=-DENABLE_GRAPHITE
-.IF "$(SYSTEM_GRAPHITE)" != "YES"
-CDEFS+=-DGR2_STATIC
-.ENDIF
.ENDIF
# --- Files --------------------------------------------------------
@@ -88,7 +85,6 @@ 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 ae7b13ca25b7..596734ca7891 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,7 +46,7 @@ ImplMapMode::ImplMapMode() :
{
mnRefCount = 1;
meUnit = MAP_PIXEL;
- mbSimple = sal_False;
+ mbSimple = FALSE;
}
// -----------------------------------------------------------------------
@@ -58,15 +58,15 @@ ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) :
{
mnRefCount = 1;
meUnit = rImplMapMode.meUnit;
- mbSimple = sal_False;
+ mbSimple = FALSE;
}
// -----------------------------------------------------------------------
SvStream& operator>>( SvStream& rIStm, ImplMapMode& rImplMapMode )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ 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 << (sal_uInt16) rImplMapMode.meUnit <<
+ rOStm << (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 = sal_True;
+ pImplMapMode->mbSimple = TRUE;
}
return pImplMapMode;
@@ -260,40 +260,40 @@ MapMode& MapMode::operator=( const MapMode& rMapMode )
// -----------------------------------------------------------------------
-sal_Bool MapMode::operator==( const MapMode& rMapMode ) const
+BOOL MapMode::operator==( const MapMode& rMapMode ) const
{
DBG_CHKTHIS( MapMode, NULL );
DBG_CHKOBJ( &rMapMode, MapMode, NULL );
if ( mpImplMapMode == rMapMode.mpImplMapMode )
- return sal_True;
+ return TRUE;
if ( (mpImplMapMode->meUnit == rMapMode.mpImplMapMode->meUnit) &&
(mpImplMapMode->maOrigin == rMapMode.mpImplMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == rMapMode.mpImplMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == rMapMode.mpImplMapMode->maScaleY) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool MapMode::IsDefault() const
+BOOL MapMode::IsDefault() const
{
DBG_CHKTHIS( MapMode, NULL );
ImplMapMode* pDefMapMode = ImplMapMode::ImplGetStaticMapMode( MAP_PIXEL );
if ( mpImplMapMode == pDefMapMode )
- return sal_True;
+ return TRUE;
if ( (mpImplMapMode->meUnit == pDefMapMode->meUnit) &&
(mpImplMapMode->maOrigin == pDefMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == pDefMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == pDefMapMode->maScaleY) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index feba437c7c2f..a56756c293c0 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -66,7 +66,7 @@ inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY )
inline void ImplScalePoly( Polygon& rPoly, double fScaleX, double fScaleY )
{
- for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
}
@@ -89,8 +89,8 @@ inline void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScal
#define COMPAT( _def_rIStm ) VersionCompat aCompat( ( _def_rIStm ), STREAM_READ );
#define COMPAT_VERSION() aCompat.GetVersion()
-#define WRITE_BASE_COMPAT( _def_rOStm, _def_nVer, _pWriteData ) \
- MetaAction::Write( ( _def_rOStm ), _pWriteData ); \
+#define WRITE_BASE_COMPAT( _def_rOStm, _def_nVer, _pWriteData ) \
+ MetaAction::Write( ( _def_rOStm ), _pWriteData ); \
VersionCompat aCompat( ( _def_rOStm ), STREAM_WRITE, ( _def_nVer ) );
// ========================================================================
@@ -103,7 +103,7 @@ MetaAction::MetaAction() :
// ------------------------------------------------------------------------
-MetaAction::MetaAction( sal_uInt16 nType ) :
+MetaAction::MetaAction( USHORT nType ) :
mnRefCount( 1 ),
mnType( nType )
{
@@ -155,7 +155,7 @@ sal_Bool MetaAction::IsEqual( const MetaAction& rMetaAction ) const
return sal_False;
else
return Compare( rMetaAction );
-}
+}
// ------------------------------------------------------------------------
@@ -176,7 +176,7 @@ void MetaAction::Read( SvStream& rIStm, ImplMetaReadData* )
MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData )
{
MetaAction* pAction = NULL;
- sal_uInt16 nType;
+ UINT16 nType;
rIStm >> nType;
@@ -259,9 +259,9 @@ IMPL_META_ACTION( Pixel, META_PIXEL_ACTION )
// ------------------------------------------------------------------------
MetaPixelAction::MetaPixelAction( const Point& rPt, const Color& rColor ) :
- MetaAction ( META_PIXEL_ACTION ),
- maPt ( rPt ),
- maColor ( rColor )
+ MetaAction ( META_PIXEL_ACTION ),
+ maPt ( rPt ),
+ maColor ( rColor )
{
}
@@ -309,7 +309,7 @@ void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maPt;
- maColor.Write( rOStm, sal_True );
+ maColor.Write( rOStm, TRUE );
}
// ------------------------------------------------------------------------
@@ -318,7 +318,7 @@ void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maPt;
- maColor.Read( rIStm, sal_True );
+ maColor.Read( rIStm, TRUE );
}
// ========================================================================
@@ -328,8 +328,8 @@ IMPL_META_ACTION( Point, META_POINT_ACTION )
// ------------------------------------------------------------------------
MetaPointAction::MetaPointAction( const Point& rPt ) :
- MetaAction ( META_POINT_ACTION ),
- maPt ( rPt )
+ MetaAction ( META_POINT_ACTION ),
+ maPt ( rPt )
{
}
@@ -393,9 +393,9 @@ IMPL_META_ACTION( Line, META_LINE_ACTION )
// ------------------------------------------------------------------------
MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd ) :
- MetaAction ( META_LINE_ACTION ),
- maStartPt ( rStart ),
- maEndPt ( rEnd )
+ MetaAction ( META_LINE_ACTION ),
+ maStartPt ( rStart ),
+ maEndPt ( rEnd )
{
}
@@ -403,10 +403,10 @@ MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd ) :
MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd,
const LineInfo& rLineInfo ) :
- MetaAction ( META_LINE_ACTION ),
- maLineInfo ( rLineInfo ),
- maStartPt ( rStart ),
- maEndPt ( rEnd )
+ MetaAction ( META_LINE_ACTION ),
+ maLineInfo ( rLineInfo ),
+ maStartPt ( rStart ),
+ maEndPt ( rEnd )
{
}
@@ -461,8 +461,8 @@ void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
- rOStm << maStartPt << maEndPt; // Version 1
- rOStm << maLineInfo; // Version 2
+ rOStm << maStartPt << maEndPt; // Version 1
+ rOStm << maLineInfo; // Version 2
}
// ------------------------------------------------------------------------
@@ -488,8 +488,8 @@ IMPL_META_ACTION( Rect, META_RECT_ACTION )
// ------------------------------------------------------------------------
MetaRectAction::MetaRectAction( const Rectangle& rRect ) :
- MetaAction ( META_RECT_ACTION ),
- maRect ( rRect )
+ MetaAction ( META_RECT_ACTION ),
+ maRect ( rRect )
{
}
@@ -554,8 +554,8 @@ IMPL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION )
MetaRoundRectAction::MetaRoundRectAction( const Rectangle& rRect,
sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) :
- MetaAction ( META_ROUNDRECT_ACTION ),
- maRect ( rRect ),
+ MetaAction ( META_ROUNDRECT_ACTION ),
+ maRect ( rRect ),
mnHorzRound ( nHorzRound ),
mnVertRound ( nVertRound )
{
@@ -625,8 +625,8 @@ IMPL_META_ACTION( Ellipse, META_ELLIPSE_ACTION )
// ------------------------------------------------------------------------
MetaEllipseAction::MetaEllipseAction( const Rectangle& rRect ) :
- MetaAction ( META_ELLIPSE_ACTION ),
- maRect ( rRect )
+ MetaAction ( META_ELLIPSE_ACTION ),
+ maRect ( rRect )
{
}
@@ -691,10 +691,10 @@ IMPL_META_ACTION( Arc, META_ARC_ACTION )
MetaArcAction::MetaArcAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd ) :
- MetaAction ( META_ARC_ACTION ),
- maRect ( rRect ),
- maStartPt ( rStart ),
- maEndPt ( rEnd )
+ MetaAction ( META_ARC_ACTION ),
+ maRect ( rRect ),
+ maStartPt ( rStart ),
+ maEndPt ( rEnd )
{
}
@@ -765,10 +765,10 @@ IMPL_META_ACTION( Pie, META_PIE_ACTION )
MetaPieAction::MetaPieAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd ) :
- MetaAction ( META_PIE_ACTION ),
- maRect ( rRect ),
- maStartPt ( rStart ),
- maEndPt ( rEnd )
+ MetaAction ( META_PIE_ACTION ),
+ maRect ( rRect ),
+ maStartPt ( rStart ),
+ maEndPt ( rEnd )
{
}
@@ -839,10 +839,10 @@ IMPL_META_ACTION( Chord, META_CHORD_ACTION )
MetaChordAction::MetaChordAction( const Rectangle& rRect,
const Point& rStart, const Point& rEnd ) :
- MetaAction ( META_CHORD_ACTION ),
- maRect ( rRect ),
- maStartPt ( rStart ),
- maEndPt ( rEnd )
+ MetaAction ( META_CHORD_ACTION ),
+ maRect ( rRect ),
+ maStartPt ( rStart ),
+ maEndPt ( rEnd )
{
}
@@ -912,17 +912,17 @@ IMPL_META_ACTION( PolyLine, META_POLYLINE_ACTION )
// ------------------------------------------------------------------------
MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly ) :
- MetaAction ( META_POLYLINE_ACTION ),
- maPoly ( rPoly )
+ MetaAction ( META_POLYLINE_ACTION ),
+ maPoly ( rPoly )
{
}
// ------------------------------------------------------------------------
MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo ) :
- MetaAction ( META_POLYLINE_ACTION ),
- maLineInfo ( rLineInfo ),
- maPoly ( rPoly )
+ MetaAction ( META_POLYLINE_ACTION ),
+ maLineInfo ( rLineInfo ),
+ maPoly ( rPoly )
{
}
@@ -977,16 +977,16 @@ sal_Bool MetaPolyLineAction::Compare( const MetaAction& rMetaAction ) const
void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
- WRITE_BASE_COMPAT( rOStm, 3, pData );
+ WRITE_BASE_COMPAT( rOStm, 3, pData );
Polygon aSimplePoly;
maPoly.AdaptiveSubdivide( aSimplePoly );
- rOStm << aSimplePoly; // Version 1
- rOStm << maLineInfo; // Version 2
+ rOStm << aSimplePoly; // Version 1
+ rOStm << maLineInfo; // Version 2
- sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 3
- rOStm << bHasPolyFlags;
+ sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 3
+ rOStm << bHasPolyFlags;
if ( bHasPolyFlags )
maPoly.Write( rOStm );
}
@@ -1019,8 +1019,8 @@ IMPL_META_ACTION( Polygon, META_POLYGON_ACTION )
// ------------------------------------------------------------------------
MetaPolygonAction::MetaPolygonAction( const Polygon& rPoly ) :
- MetaAction ( META_POLYGON_ACTION ),
- maPoly ( rPoly )
+ MetaAction ( META_POLYGON_ACTION ),
+ maPoly ( rPoly )
{
}
@@ -1067,11 +1067,11 @@ void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
- Polygon aSimplePoly; // Version 1
+ Polygon aSimplePoly; // Version 1
maPoly.AdaptiveSubdivide( aSimplePoly );
- rOStm << aSimplePoly;
+ rOStm << aSimplePoly;
- sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 2
+ sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 2
rOStm << bHasPolyFlags;
if ( bHasPolyFlags )
maPoly.Write( rOStm );
@@ -1083,9 +1083,9 @@ void MetaPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maPoly; // Version 1
+ rIStm >> maPoly; // Version 1
- if( aCompat.GetVersion() >= 2 ) // Version 2
+ if( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt8 bHasPolyFlags;
rIStm >> bHasPolyFlags;
@@ -1101,8 +1101,8 @@ IMPL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION )
// ------------------------------------------------------------------------
MetaPolyPolygonAction::MetaPolyPolygonAction( const PolyPolygon& rPolyPoly ) :
- MetaAction ( META_POLYPOLYGON_ACTION ),
- maPolyPoly ( rPolyPoly )
+ MetaAction ( META_POLYPOLYGON_ACTION ),
+ maPolyPoly ( rPolyPoly )
{
}
@@ -1133,7 +1133,7 @@ void MetaPolyPolygonAction::Move( long nHorzMove, long nVertMove )
void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY )
{
- for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -1153,7 +1153,7 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
sal_uInt16 nNumberOfComplexPolygons = 0;
sal_uInt16 i, nPolyCount = maPolyPoly.Count();
- Polygon aSimplePoly; // Version 1
+ Polygon aSimplePoly; // Version 1
rOStm << nPolyCount;
for ( i = 0; i < nPolyCount; i++ )
{
@@ -1164,7 +1164,7 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm << aSimplePoly;
}
- rOStm << nNumberOfComplexPolygons; // Version 2
+ rOStm << nNumberOfComplexPolygons; // Version 2
for ( i = 0; nNumberOfComplexPolygons && ( i < nPolyCount ); i++ )
{
const Polygon& rPoly = maPolyPoly.GetObject( i );
@@ -1183,9 +1183,9 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maPolyPoly; // Version 1
-
- if ( aCompat.GetVersion() >= 2 ) // Version 2
+ rIStm >> maPolyPoly; // Version 1
+
+ if ( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt16 i, nIndex, nNumberOfComplexPolygons;
rIStm >> nNumberOfComplexPolygons;
@@ -1206,12 +1206,12 @@ IMPL_META_ACTION( Text, META_TEXT_ACTION )
// ------------------------------------------------------------------------
MetaTextAction::MetaTextAction( const Point& rPt, const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen ) :
- MetaAction ( META_TEXT_ACTION ),
- maPt ( rPt ),
- maStr ( rStr ),
- mnIndex ( nIndex ),
- mnLen ( nLen )
+ USHORT nIndex, USHORT nLen ) :
+ MetaAction ( META_TEXT_ACTION ),
+ maPt ( rPt ),
+ maStr ( rStr ),
+ mnIndex ( nIndex ),
+ mnLen ( nLen )
{
}
@@ -1260,12 +1260,12 @@ sal_Bool MetaTextAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
- rOStm << maPt;
+ rOStm << maPt;
rOStm.WriteByteString( maStr, pData->meActualCharSet );
- rOStm << mnIndex;
- rOStm << mnLen;
+ rOStm << mnIndex;
+ rOStm << mnLen;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 i, nLen = maStr.Len(); // version 2
rOStm << nLen;
for ( i = 0; i < nLen; i++ )
{
@@ -1279,12 +1279,12 @@ void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
- rIStm >> maPt;
+ rIStm >> maPt;
rIStm.ReadByteString( maStr, pData->meActualCharSet );
- rIStm >> mnIndex;
- rIStm >> mnLen;
+ rIStm >> mnIndex;
+ rIStm >> mnLen;
- if ( aCompat.GetVersion() >= 2 ) // Version 2
+ if ( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt16 nLen;
rIStm >> nLen;
@@ -1297,25 +1297,25 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
// ========================================================================
MetaTextArrayAction::MetaTextArrayAction() :
- MetaAction ( META_TEXTARRAY_ACTION ),
- mpDXAry ( NULL ),
- mnIndex ( 0 ),
- mnLen ( 0 )
+ MetaAction ( META_TEXTARRAY_ACTION ),
+ mpDXAry ( NULL ),
+ mnIndex ( 0 ),
+ mnLen ( 0 )
{
}
// ------------------------------------------------------------------------
MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
- MetaAction ( META_TEXTARRAY_ACTION ),
- maStartPt ( rAction.maStartPt ),
- maStr ( rAction.maStr ),
- mnIndex ( rAction.mnIndex ),
- mnLen ( rAction.mnLen )
+ MetaAction ( META_TEXTARRAY_ACTION ),
+ maStartPt ( rAction.maStartPt ),
+ maStr ( rAction.maStr ),
+ mnIndex ( rAction.mnIndex ),
+ mnLen ( rAction.mnLen )
{
if( rAction.mpDXAry )
{
- const sal_uLong nAryLen = mnLen;
+ const 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,
- sal_uInt16 nIndex,
- sal_uInt16 nLen ) :
- MetaAction ( META_TEXTARRAY_ACTION ),
- maStartPt ( rStartPt ),
- maStr ( rStr ),
- mnIndex ( nIndex ),
- mnLen ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
+ USHORT nIndex,
+ USHORT nLen ) :
+ MetaAction ( META_TEXTARRAY_ACTION ),
+ maStartPt ( rStartPt ),
+ maStr ( rStr ),
+ mnIndex ( nIndex ),
+ mnLen ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
{
- const sal_uLong nAryLen = pDXAry ? mnLen : 0;
+ const ULONG nAryLen = pDXAry ? mnLen : 0;
if( nAryLen )
{
@@ -1386,7 +1386,7 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
if ( mpDXAry && mnLen )
{
- for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
+ for ( USHORT i = 0, nCount = mnLen; i < nCount; i++ )
mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) );
}
}
@@ -1409,16 +1409,16 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
const sal_uInt32 nAryLen = mpDXAry ? mnLen : 0;
WRITE_BASE_COMPAT( rOStm, 2, pData );
- rOStm << maStartPt;
+ rOStm << maStartPt;
rOStm.WriteByteString( maStr, pData->meActualCharSet );
- rOStm << mnIndex;
- rOStm << mnLen;
- rOStm << nAryLen;
+ rOStm << mnIndex;
+ rOStm << mnLen;
+ rOStm << nAryLen;
- for( sal_uLong i = 0UL; i < nAryLen; i++ )
+ for( ULONG i = 0UL; i < nAryLen; i++ )
rOStm << mpDXAry[ i ];
- sal_uInt16 j, nLen = maStr.Len(); // version 2
+ sal_uInt16 j, nLen = maStr.Len(); // version 2
rOStm << nLen;
for ( j = 0; j < nLen; j++ )
{
@@ -1436,11 +1436,11 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
delete[] mpDXAry;
COMPAT( rIStm );
- rIStm >> maStartPt;
+ rIStm >> maStartPt;
rIStm.ReadByteString( maStr, pData->meActualCharSet );
- rIStm >> mnIndex;
- rIStm >> mnLen;
- rIStm >> nAryLen;
+ rIStm >> mnIndex;
+ rIStm >> mnLen;
+ rIStm >> nAryLen;
if ( mnIndex + mnLen > maStr.Len() )
{
@@ -1457,7 +1457,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
if ( mpDXAry )
{
- sal_uLong i;
+ ULONG i;
for( i = 0UL; i < nAryLen; i++ )
rIStm >> mpDXAry[ i ];
@@ -1475,7 +1475,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
else
mpDXAry = NULL;
- if ( aCompat.GetVersion() >= 2 ) // Version 2
+ if ( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt16 nLen;
rIStm >> nLen;
@@ -1499,13 +1499,13 @@ IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen ) :
- MetaAction ( META_STRETCHTEXT_ACTION ),
- maPt ( rPt ),
- maStr ( rStr ),
- mnWidth ( nWidth ),
- mnIndex ( nIndex ),
- mnLen ( nLen )
+ USHORT nIndex, USHORT nLen ) :
+ MetaAction ( META_STRETCHTEXT_ACTION ),
+ maPt ( rPt ),
+ maStr ( rStr ),
+ mnWidth ( nWidth ),
+ mnIndex ( nIndex ),
+ mnLen ( nLen )
{
}
@@ -1537,7 +1537,7 @@ void MetaStretchTextAction::Move( long nHorzMove, long nVertMove )
void MetaStretchTextAction::Scale( double fScaleX, double fScaleY )
{
ImplScalePoint( maPt, fScaleX, fScaleY );
- mnWidth = (sal_uLong)FRound( mnWidth * fabs(fScaleX) );
+ mnWidth = (ULONG)FRound( mnWidth * fabs(fScaleX) );
}
// ------------------------------------------------------------------------
@@ -1556,13 +1556,13 @@ sal_Bool MetaStretchTextAction::Compare( const MetaAction& rMetaAction ) const
void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
- rOStm << maPt;
+ rOStm << maPt;
rOStm.WriteByteString( maStr, pData->meActualCharSet );
- rOStm << mnWidth;
- rOStm << mnIndex;
- rOStm << mnLen;
+ rOStm << mnWidth;
+ rOStm << mnIndex;
+ rOStm << mnLen;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 i, nLen = maStr.Len(); // version 2
rOStm << nLen;
for ( i = 0; i < nLen; i++ )
{
@@ -1576,13 +1576,13 @@ void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
- rIStm >> maPt;
+ rIStm >> maPt;
rIStm.ReadByteString( maStr, pData->meActualCharSet );
- rIStm >> mnWidth;
- rIStm >> mnIndex;
- rIStm >> mnLen;
+ rIStm >> mnWidth;
+ rIStm >> mnIndex;
+ rIStm >> mnLen;
- if ( aCompat.GetVersion() >= 2 ) // Version 2
+ if ( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt16 nLen;
rIStm >> nLen;
@@ -1599,11 +1599,11 @@ IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
// ------------------------------------------------------------------------
MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle ) :
- MetaAction ( META_TEXTRECT_ACTION ),
- maRect ( rRect ),
- maStr ( rStr ),
- mnStyle ( nStyle )
+ const XubString& rStr, USHORT nStyle ) :
+ MetaAction ( META_TEXTRECT_ACTION ),
+ maRect ( rRect ),
+ maStr ( rStr ),
+ mnStyle ( nStyle )
{
}
@@ -1651,11 +1651,11 @@ sal_Bool MetaTextRectAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
- rOStm << maRect;
+ rOStm << maRect;
rOStm.WriteByteString( maStr, pData->meActualCharSet );
- rOStm << mnStyle;
+ rOStm << mnStyle;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 i, nLen = maStr.Len(); // version 2
rOStm << nLen;
for ( i = 0; i < nLen; i++ )
{
@@ -1669,11 +1669,11 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
- rIStm >> maRect;
+ rIStm >> maRect;
rIStm.ReadByteString( maStr, pData->meActualCharSet );
- rIStm >> mnStyle;
+ rIStm >> mnStyle;
- if ( aCompat.GetVersion() >= 2 ) // Version 2
+ if ( aCompat.GetVersion() >= 2 ) // Version 2
{
sal_uInt16 nLen;
rIStm >> nLen;
@@ -1693,9 +1693,9 @@ MetaTextLineAction::MetaTextLineAction( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline ) :
- MetaAction ( META_TEXTLINE_ACTION ),
- maPos ( rPos ),
- mnWidth ( nWidth ),
+ MetaAction ( META_TEXTLINE_ACTION ),
+ maPos ( rPos ),
+ mnWidth ( nWidth ),
meStrikeout ( eStrikeout ),
meUnderline ( eUnderline ),
meOverline ( eOverline )
@@ -1784,9 +1784,9 @@ IMPL_META_ACTION( Bmp, META_BMP_ACTION )
// ------------------------------------------------------------------------
MetaBmpAction::MetaBmpAction( const Point& rPt, const Bitmap& rBmp ) :
- MetaAction ( META_BMP_ACTION ),
- maBmp ( rBmp ),
- maPt ( rPt )
+ MetaAction ( META_BMP_ACTION ),
+ maBmp ( rBmp ),
+ maPt ( rPt )
{
}
@@ -1855,10 +1855,10 @@ IMPL_META_ACTION( BmpScale, META_BMPSCALE_ACTION )
MetaBmpScaleAction::MetaBmpScaleAction( const Point& rPt, const Size& rSz,
const Bitmap& rBmp ) :
- MetaAction ( META_BMPSCALE_ACTION ),
- maBmp ( rBmp ),
- maPt ( rPt ),
- maSz ( rSz )
+ MetaAction ( META_BMPSCALE_ACTION ),
+ maBmp ( rBmp ),
+ maPt ( rPt ),
+ maSz ( rSz )
{
}
@@ -1932,12 +1932,12 @@ IMPL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION )
MetaBmpScalePartAction::MetaBmpScalePartAction( const Point& rDstPt, const Size& rDstSz,
const Point& rSrcPt, const Size& rSrcSz,
const Bitmap& rBmp ) :
- MetaAction ( META_BMPSCALEPART_ACTION ),
- maBmp ( rBmp ),
- maDstPt ( rDstPt ),
- maDstSz ( rDstSz ),
- maSrcPt ( rSrcPt ),
- maSrcSz ( rSrcSz )
+ MetaAction ( META_BMPSCALEPART_ACTION ),
+ maBmp ( rBmp ),
+ maDstPt ( rDstPt ),
+ maDstSz ( rDstSz ),
+ maSrcPt ( rSrcPt ),
+ maSrcSz ( rSrcSz )
{
}
@@ -2011,9 +2011,9 @@ IMPL_META_ACTION( BmpEx, META_BMPEX_ACTION )
// ------------------------------------------------------------------------
MetaBmpExAction::MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx ) :
- MetaAction ( META_BMPEX_ACTION ),
- maBmpEx ( rBmpEx ),
- maPt ( rPt )
+ MetaAction ( META_BMPEX_ACTION ),
+ maBmpEx ( rBmpEx ),
+ maPt ( rPt )
{
}
@@ -2082,10 +2082,10 @@ IMPL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION )
MetaBmpExScaleAction::MetaBmpExScaleAction( const Point& rPt, const Size& rSz,
const BitmapEx& rBmpEx ) :
- MetaAction ( META_BMPEXSCALE_ACTION ),
- maBmpEx ( rBmpEx ),
- maPt ( rPt ),
- maSz ( rSz )
+ MetaAction ( META_BMPEXSCALE_ACTION ),
+ maBmpEx ( rBmpEx ),
+ maPt ( rPt ),
+ maSz ( rSz )
{
}
@@ -2159,12 +2159,12 @@ IMPL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION )
MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz,
const Point& rSrcPt, const Size& rSrcSz,
const BitmapEx& rBmpEx ) :
- MetaAction ( META_BMPEXSCALEPART_ACTION ),
- maBmpEx ( rBmpEx ),
- maDstPt ( rDstPt ),
- maDstSz ( rDstSz ),
- maSrcPt ( rSrcPt ),
- maSrcSz ( rSrcSz )
+ MetaAction ( META_BMPEXSCALEPART_ACTION ),
+ maBmpEx ( rBmpEx ),
+ maDstPt ( rDstPt ),
+ maDstSz ( rDstSz ),
+ maSrcPt ( rSrcPt ),
+ maSrcSz ( rSrcSz )
{
}
@@ -2240,10 +2240,10 @@ IMPL_META_ACTION( Mask, META_MASK_ACTION )
MetaMaskAction::MetaMaskAction( const Point& rPt,
const Bitmap& rBmp,
const Color& rColor ) :
- MetaAction ( META_MASK_ACTION ),
- maBmp ( rBmp ),
- maColor ( rColor ),
- maPt ( rPt )
+ MetaAction ( META_MASK_ACTION ),
+ maBmp ( rBmp ),
+ maColor ( rColor ),
+ maPt ( rPt )
{
}
@@ -2314,11 +2314,11 @@ IMPL_META_ACTION( MaskScale, META_MASKSCALE_ACTION )
MetaMaskScaleAction::MetaMaskScaleAction( const Point& rPt, const Size& rSz,
const Bitmap& rBmp,
const Color& rColor ) :
- MetaAction ( META_MASKSCALE_ACTION ),
- maBmp ( rBmp ),
- maColor ( rColor ),
- maPt ( rPt ),
- maSz ( rSz )
+ MetaAction ( META_MASKSCALE_ACTION ),
+ maBmp ( rBmp ),
+ maColor ( rColor ),
+ maPt ( rPt ),
+ maSz ( rSz )
{
}
@@ -2394,13 +2394,13 @@ MetaMaskScalePartAction::MetaMaskScalePartAction( const Point& rDstPt, const Siz
const Point& rSrcPt, const Size& rSrcSz,
const Bitmap& rBmp,
const Color& rColor ) :
- MetaAction ( META_MASKSCALEPART_ACTION ),
- maBmp ( rBmp ),
- maColor ( rColor ),
- maDstPt ( rDstPt ),
- maDstSz ( rDstSz ),
- maSrcPt ( rSrcPt ),
- maSrcSz ( rSrcSz )
+ MetaAction ( META_MASKSCALEPART_ACTION ),
+ maBmp ( rBmp ),
+ maColor ( rColor ),
+ maDstPt ( rDstPt ),
+ maDstSz ( rDstSz ),
+ maSrcPt ( rSrcPt ),
+ maSrcSz ( rSrcSz )
{
}
@@ -2457,7 +2457,7 @@ void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maBmp;
- maColor.Write( rOStm, sal_True );
+ maColor.Write( rOStm, TRUE );
rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
}
@@ -2468,7 +2468,7 @@ void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maBmp;
- maColor.Read( rIStm, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}
@@ -2479,9 +2479,9 @@ IMPL_META_ACTION( Gradient, META_GRADIENT_ACTION )
// ------------------------------------------------------------------------
MetaGradientAction::MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient ) :
- MetaAction ( META_GRADIENT_ACTION ),
- maRect ( rRect ),
- maGradient ( rGradient )
+ MetaAction ( META_GRADIENT_ACTION ),
+ maRect ( rRect ),
+ maGradient ( rGradient )
{
}
@@ -2542,16 +2542,16 @@ void MetaGradientAction::Read( SvStream& rIStm, ImplMetaReadData* )
// ========================================================================
MetaGradientExAction::MetaGradientExAction() :
- MetaAction ( META_GRADIENTEX_ACTION )
+ MetaAction ( META_GRADIENTEX_ACTION )
{
}
// ------------------------------------------------------------------------
MetaGradientExAction::MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient ) :
- MetaAction ( META_GRADIENTEX_ACTION ),
- maPolyPoly ( rPolyPoly ),
- maGradient ( rGradient )
+ MetaAction ( META_GRADIENTEX_ACTION ),
+ maPolyPoly ( rPolyPoly ),
+ maGradient ( rGradient )
{
}
@@ -2589,7 +2589,7 @@ void MetaGradientExAction::Move( long nHorzMove, long nVertMove )
void MetaGradientExAction::Scale( double fScaleX, double fScaleY )
{
- for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2630,9 +2630,9 @@ IMPL_META_ACTION( Hatch, META_HATCH_ACTION )
// ------------------------------------------------------------------------
MetaHatchAction::MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch ) :
- MetaAction ( META_HATCH_ACTION ),
- maPolyPoly ( rPolyPoly ),
- maHatch ( rHatch )
+ MetaAction ( META_HATCH_ACTION ),
+ maPolyPoly ( rPolyPoly ),
+ maHatch ( rHatch )
{
}
@@ -2663,7 +2663,7 @@ void MetaHatchAction::Move( long nHorzMove, long nVertMove )
void MetaHatchAction::Scale( double fScaleX, double fScaleY )
{
- for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2705,8 +2705,8 @@ IMPL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION )
MetaWallpaperAction::MetaWallpaperAction( const Rectangle& rRect,
const Wallpaper& rPaper ) :
- MetaAction ( META_WALLPAPER_ACTION ),
- maRect ( rRect ),
+ MetaAction ( META_WALLPAPER_ACTION ),
+ maRect ( rRect ),
maWallpaper ( rPaper )
{
}
@@ -2771,10 +2771,10 @@ IMPL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
// ------------------------------------------------------------------------
-MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, sal_Bool bClip ) :
- MetaAction ( META_CLIPREGION_ACTION ),
- maRegion ( rRegion ),
- mbClip ( bClip )
+MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, BOOL bClip ) :
+ MetaAction ( META_CLIPREGION_ACTION ),
+ maRegion ( rRegion ),
+ mbClip ( bClip )
{
}
@@ -2842,8 +2842,8 @@ IMPL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION )
// ------------------------------------------------------------------------
MetaISectRectClipRegionAction::MetaISectRectClipRegionAction( const Rectangle& rRect ) :
- MetaAction ( META_ISECTRECTCLIPREGION_ACTION ),
- maRect ( rRect )
+ MetaAction ( META_ISECTRECTCLIPREGION_ACTION ),
+ maRect ( rRect )
{
}
@@ -2907,8 +2907,8 @@ IMPL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION )
// ------------------------------------------------------------------------
MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const Region& rRegion ) :
- MetaAction ( META_ISECTREGIONCLIPREGION_ACTION ),
- maRegion ( rRegion )
+ MetaAction ( META_ISECTREGIONCLIPREGION_ACTION ),
+ maRegion ( rRegion )
{
}
@@ -2972,9 +2972,9 @@ IMPL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION )
// ------------------------------------------------------------------------
MetaMoveClipRegionAction::MetaMoveClipRegionAction( long nHorzMove, long nVertMove ) :
- MetaAction ( META_MOVECLIPREGION_ACTION ),
- mnHorzMove ( nHorzMove ),
- mnVertMove ( nVertMove )
+ MetaAction ( META_MOVECLIPREGION_ACTION ),
+ mnHorzMove ( nHorzMove ),
+ mnVertMove ( nVertMove )
{
}
@@ -3032,10 +3032,10 @@ IMPL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaLineColorAction::MetaLineColorAction( const Color& rColor, sal_Bool bSet ) :
- MetaAction ( META_LINECOLOR_ACTION ),
- maColor ( rColor ),
- mbSet ( bSet )
+MetaLineColorAction::MetaLineColorAction( const Color& rColor, 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, sal_True );
+ maColor.Write( rOStm, 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, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> mbSet;
}
@@ -3090,10 +3090,10 @@ IMPL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaFillColorAction::MetaFillColorAction( const Color& rColor, sal_Bool bSet ) :
- MetaAction ( META_FILLCOLOR_ACTION ),
- maColor ( rColor ),
- mbSet ( bSet )
+MetaFillColorAction::MetaFillColorAction( const Color& rColor, 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, sal_True );
+ maColor.Write( rOStm, 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, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> mbSet;
}
@@ -3149,8 +3149,8 @@ IMPL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION )
// ------------------------------------------------------------------------
MetaTextColorAction::MetaTextColorAction( const Color& rColor ) :
- MetaAction ( META_TEXTCOLOR_ACTION ),
- maColor ( rColor )
+ MetaAction ( META_TEXTCOLOR_ACTION ),
+ maColor ( rColor )
{
}
@@ -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, sal_True );
+ maColor.Write( rOStm, TRUE );
}
// ------------------------------------------------------------------------
@@ -3190,7 +3190,7 @@ void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, sal_True );
+ maColor.Read( rIStm, TRUE );
}
// ========================================================================
@@ -3199,10 +3199,10 @@ IMPL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, sal_Bool bSet ) :
- MetaAction ( META_TEXTFILLCOLOR_ACTION ),
- maColor ( rColor ),
- mbSet ( bSet )
+MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, 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, sal_True );
+ maColor.Write( rOStm, 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, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> mbSet;
}
@@ -3257,10 +3257,10 @@ IMPL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, sal_Bool bSet ) :
- MetaAction ( META_TEXTLINECOLOR_ACTION ),
- maColor ( rColor ),
- mbSet ( bSet )
+MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, 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, sal_True );
+ maColor.Write( rOStm, 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, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> mbSet;
}
@@ -3315,10 +3315,10 @@ IMPL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, sal_Bool bSet ) :
- MetaAction ( META_OVERLINECOLOR_ACTION ),
- maColor ( rColor ),
- mbSet ( bSet )
+MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, 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, sal_True );
+ maColor.Write( rOStm, 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, sal_True );
+ maColor.Read( rIStm, TRUE );
rIStm >> mbSet;
}
@@ -3374,8 +3374,8 @@ IMPL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION )
// ------------------------------------------------------------------------
MetaTextAlignAction::MetaTextAlignAction( TextAlign aAlign ) :
- MetaAction ( META_TEXTALIGN_ACTION ),
- maAlign ( aAlign )
+ MetaAction ( META_TEXTALIGN_ACTION ),
+ maAlign ( aAlign )
{
}
@@ -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 << (sal_uInt16) maAlign;
+ rOStm << (UINT16) maAlign;
}
// ------------------------------------------------------------------------
void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- sal_uInt16 nTmp16;
+ UINT16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; maAlign = (TextAlign) nTmp16;
@@ -3427,8 +3427,8 @@ IMPL_META_ACTION( MapMode, META_MAPMODE_ACTION )
// ------------------------------------------------------------------------
MetaMapModeAction::MetaMapModeAction( const MapMode& rMapMode ) :
- MetaAction ( META_MAPMODE_ACTION ),
- maMapMode ( rMapMode )
+ MetaAction ( META_MAPMODE_ACTION ),
+ maMapMode ( rMapMode )
{
}
@@ -3488,15 +3488,15 @@ IMPL_META_ACTION( Font, META_FONT_ACTION )
// ------------------------------------------------------------------------
MetaFontAction::MetaFontAction( const Font& rFont ) :
- MetaAction ( META_FONT_ACTION ),
- maFont ( rFont )
+ MetaAction ( META_FONT_ACTION ),
+ maFont ( rFont )
{
// #96876: because RTL_TEXTENCODING_SYMBOL is often set at the StarSymbol font,
// we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
- // to be the right way; changing the textencoding at other sources
+ // to be the right way; changing the textencoding at other sources
// is too dangerous at the moment
if( ( ( maFont.GetName().SearchAscii( "StarSymbol" ) != STRING_NOTFOUND )
- || ( maFont.GetName().SearchAscii( "OpenSymbol" ) != STRING_NOTFOUND ) )
+ || ( maFont.GetName().SearchAscii( "OpenSymbol" ) != STRING_NOTFOUND ) )
&& ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
{
maFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
@@ -3564,9 +3564,9 @@ IMPL_META_ACTION( Push, META_PUSH_ACTION )
// ------------------------------------------------------------------------
-MetaPushAction::MetaPushAction( sal_uInt16 nFlags ) :
- MetaAction ( META_PUSH_ACTION ),
- mnFlags ( nFlags )
+MetaPushAction::MetaPushAction( USHORT nFlags ) :
+ MetaAction ( META_PUSH_ACTION ),
+ mnFlags ( nFlags )
{
}
@@ -3650,8 +3650,8 @@ IMPL_META_ACTION( RasterOp, META_RASTEROP_ACTION )
// ------------------------------------------------------------------------
MetaRasterOpAction::MetaRasterOpAction( RasterOp eRasterOp ) :
- MetaAction ( META_RASTEROP_ACTION ),
- meRasterOp ( eRasterOp )
+ MetaAction ( META_RASTEROP_ACTION ),
+ meRasterOp ( eRasterOp )
{
}
@@ -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 << (sal_uInt16) meRasterOp;
+ rOStm << (UINT16) meRasterOp;
}
// ------------------------------------------------------------------------
void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- sal_uInt16 nTmp16;
+ UINT16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; meRasterOp = (RasterOp) nTmp16;
@@ -3702,10 +3702,10 @@ IMPL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
// ------------------------------------------------------------------------
-MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ) :
- MetaAction ( META_TRANSPARENT_ACTION ),
- maPolyPoly ( rPolyPoly ),
- mnTransPercent ( nTransPercent )
+MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT 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( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -3787,11 +3787,11 @@ IMPL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION )
MetaFloatTransparentAction::MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos,
const Size& rSize, const Gradient& rGradient ) :
- MetaAction ( META_FLOATTRANSPARENT_ACTION ),
- maMtf ( rMtf ),
- maPoint ( rPos ),
- maSize ( rSize ),
- maGradient ( rGradient )
+ MetaAction ( META_FLOATTRANSPARENT_ACTION ),
+ maMtf ( rMtf ),
+ maPoint ( rPos ),
+ maSize ( rSize ),
+ maGradient ( rGradient )
{
}
@@ -3843,7 +3843,7 @@ sal_Bool MetaFloatTransparentAction::Compare( const MetaAction& rMetaAction ) co
void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
-
+
maMtf.Write( rOStm );
rOStm << maPoint << maSize << maGradient;
}
@@ -3864,11 +3864,11 @@ IMPL_META_ACTION( EPS, META_EPS_ACTION )
MetaEPSAction::MetaEPSAction( const Point& rPoint, const Size& rSize,
const GfxLink& rGfxLink, const GDIMetaFile& rSubst ) :
- MetaAction ( META_EPS_ACTION ),
- maGfxLink ( rGfxLink ),
- maSubst ( rSubst ),
- maPoint ( rPoint ),
- maSize ( rSize )
+ MetaAction ( META_EPS_ACTION ),
+ maGfxLink ( rGfxLink ),
+ maSubst ( rSubst ),
+ maPoint ( rPoint ),
+ maSize ( rSize )
{
}
@@ -3943,10 +3943,10 @@ IMPL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
// ------------------------------------------------------------------------
-MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet ) :
- MetaAction ( META_REFPOINT_ACTION ),
- maRefPoint ( rRefPoint ),
- mbSet ( bSet )
+MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, BOOL bSet ) :
+ MetaAction ( META_REFPOINT_ACTION ),
+ maRefPoint ( rRefPoint ),
+ mbSet ( bSet )
{
}
@@ -3996,8 +3996,8 @@ void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
// ========================================================================
MetaCommentAction::MetaCommentAction( sal_Int32 nValue ) :
- MetaAction ( META_COMMENT_ACTION ),
- mnValue ( nValue )
+ MetaAction ( META_COMMENT_ACTION ),
+ mnValue ( nValue )
{
ImplInitDynamicData( NULL, 0UL );
}
@@ -4005,28 +4005,28 @@ MetaCommentAction::MetaCommentAction( sal_Int32 nValue ) :
// ------------------------------------------------------------------------
MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
- MetaAction ( META_COMMENT_ACTION ),
- maComment ( rAct.maComment ),
- mnValue ( rAct.mnValue )
+ MetaAction ( META_COMMENT_ACTION ),
+ maComment ( rAct.maComment ),
+ mnValue ( rAct.mnValue )
{
ImplInitDynamicData( rAct.mpData, rAct.mnDataSize );
}
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
- MetaAction ( META_COMMENT_ACTION ),
- maComment ( rComment ),
- mnValue ( nValue )
+MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const BYTE* pData, sal_uInt32 nDataSize ) :
+ MetaAction ( META_COMMENT_ACTION ),
+ maComment ( rComment ),
+ mnValue ( nValue )
{
ImplInitDynamicData( pData, nDataSize );
}
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ) :
- MetaAction ( META_COMMENT_ACTION ),
- mnValue ( 0L )
+MetaCommentAction::MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize ) :
+ MetaAction ( META_COMMENT_ACTION ),
+ mnValue ( 0L )
{
ImplInitDynamicData( pData, nDataSize );
}
@@ -4041,11 +4041,11 @@ MetaCommentAction::~MetaCommentAction()
// ------------------------------------------------------------------------
-void MetaCommentAction::ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize )
+void MetaCommentAction::ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize )
{
if ( nDataSize && pData )
{
- mnDataSize = nDataSize, mpData = new sal_uInt8[ mnDataSize ];
+ mnDataSize = nDataSize, mpData = new BYTE[ mnDataSize ];
memcpy( mpData, pData, mnDataSize );
}
else
@@ -4081,8 +4081,8 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
{
- SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
- SvMemoryStream aDest;
+ SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
+ SvMemoryStream aDest;
if ( bPathStroke )
{
SvtGraphicStroke aStroke;
@@ -4104,7 +4104,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4124,8 +4124,8 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
{
- SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
- SvMemoryStream aDest;
+ SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
+ SvMemoryStream aDest;
if ( bPathStroke )
{
SvtGraphicStroke aStroke;
@@ -4147,10 +4147,10 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
} else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
- SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
- SvMemoryStream aDest;
+ SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
+ SvMemoryStream aDest;
sal_Int32 nLeft, nRight, nTop, nBottom;
sal_Int32 nPixX, nPixY, nMillX, nMillY;
@@ -4173,7 +4173,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << m11 << m12 << m21 << m22 << mdx << mdy;
// save them
- ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4212,7 +4212,7 @@ void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
if( mnDataSize )
{
- mpData = new sal_uInt8[ mnDataSize ];
+ mpData = new BYTE[ mnDataSize ];
rIStm.Read( mpData, mnDataSize );
}
else
@@ -4226,7 +4226,7 @@ IMPL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION )
// ------------------------------------------------------------------------
MetaLayoutModeAction::MetaLayoutModeAction( sal_uInt32 nLayoutMode ) :
- MetaAction ( META_LAYOUTMODE_ACTION ),
+ MetaAction ( META_LAYOUTMODE_ACTION ),
mnLayoutMode( nLayoutMode )
{
}
@@ -4277,7 +4277,7 @@ IMPL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION )
// ------------------------------------------------------------------------
MetaTextLanguageAction::MetaTextLanguageAction( LanguageType eTextLanguage ) :
- MetaAction ( META_TEXTLANGUAGE_ACTION ),
+ MetaAction ( META_TEXTLANGUAGE_ACTION ),
meTextLanguage( eTextLanguage )
{
}
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 4814d6e3114e..64386cf33059 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,8 +35,6 @@
#include <vector>
#include <set>
-#include <cstdio>
-
// =======================================================================
ImplFontMetric::ImplFontMetric()
@@ -54,7 +52,6 @@ ImplFontMetric::ImplFontMetric()
inline void ImplFontMetric::AddReference()
{
- // TODO: disable refcounting on the default maps?
++mnRefCount;
}
@@ -62,7 +59,6 @@ inline void ImplFontMetric::AddReference()
inline void ImplFontMetric::DeReference()
{
- // TODO: disable refcounting on the default maps?
if( --mnRefCount <= 0 )
delete this;
}
@@ -127,15 +123,15 @@ FontInfo& FontInfo::operator=( const FontInfo& rInfo )
// -----------------------------------------------------------------------
-sal_Bool FontInfo::operator==( const FontInfo& rInfo ) const
+BOOL FontInfo::operator==( const FontInfo& rInfo ) const
{
if( !Font::operator==( rInfo ) )
- return sal_False;
+ return FALSE;
if( mpImplMetric == rInfo.mpImplMetric )
- return sal_True;
+ return TRUE;
if( *mpImplMetric == *rInfo.mpImplMetric )
- return sal_True;
- return sal_False;
+ return TRUE;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -147,28 +143,28 @@ FontType FontInfo::GetType() const
// -----------------------------------------------------------------------
-sal_Bool FontInfo::IsDeviceFont() const
+BOOL FontInfo::IsDeviceFont() const
{
return mpImplMetric->IsDeviceFont();
}
// -----------------------------------------------------------------------
-sal_Bool FontInfo::SupportsLatin() const
+BOOL FontInfo::SupportsLatin() const
{
return mpImplMetric->SupportsLatin();
}
// -----------------------------------------------------------------------
-sal_Bool FontInfo::SupportsCJK() const
+BOOL FontInfo::SupportsCJK() const
{
return mpImplMetric->SupportsCJK();
}
// -----------------------------------------------------------------------
-sal_Bool FontInfo::SupportsCTL() const
+BOOL FontInfo::SupportsCTL() const
{
return mpImplMetric->SupportsCTL();
}
@@ -231,7 +227,7 @@ FontMetric& FontMetric::operator =( const FontMetric& rMetric )
// -----------------------------------------------------------------------
-sal_Bool FontMetric::operator==( const FontMetric& rMetric ) const
+BOOL FontMetric::operator==( const FontMetric& rMetric ) const
{
return FontInfo::operator==( rMetric );
}
@@ -240,13 +236,13 @@ sal_Bool FontMetric::operator==( const FontMetric& rMetric ) const
CmapResult::CmapResult( bool bSymbolic,
const sal_uInt32* pRangeCodes, int nRangeCount,
- const int* pStartGlyphs, const sal_uInt16* pExtraGlyphIds )
-: mpRangeCodes( pRangeCodes)
-, mpStartGlyphs( pStartGlyphs)
-, mpGlyphIds( pExtraGlyphIds)
-, mnRangeCount( nRangeCount)
-, mbSymbolic( bSymbolic)
-, mbRecoded( false)
+ const int* pStartGlyphs, const USHORT* pExtraGlyphIds )
+: mpRangeCodes( pRangeCodes)
+, mpStartGlyphs( pStartGlyphs)
+, mpGlyphIds( pExtraGlyphIds)
+, mnRangeCount( nRangeCount)
+, mbSymbolic( bSymbolic)
+, mbRecoded( false)
{}
// =======================================================================
@@ -257,7 +253,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
, mpGlyphIds( rCR.mpGlyphIds )
, mnRangeCount( rCR.mnRangeCount )
, mnCharCount( 0 )
-, mnRefCount( 0 )
+, mnRefCount( 1 )
{
const sal_uInt32* pRangePtr = mpRangeCodes;
for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 )
@@ -268,8 +264,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
}
}
-static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL;
-static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultImplFontCharMap = NULL;
static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0};
static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100};
@@ -290,60 +285,44 @@ ImplFontCharMap::~ImplFontCharMap()
delete[] mpRangeCodes;
delete[] mpStartGlyphs;
delete[] mpGlyphIds;
- }
+}
// -----------------------------------------------------------------------
-namespace
+ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
{
- ImplFontCharMap *GetDefaultUnicodeMap()
- {
- if( !pDefaultUnicodeImplFontCharMap )
- {
- const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
- int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
- CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
- pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
- pDefaultUnicodeImplFontCharMap->AddReference();
- }
-
- return pDefaultUnicodeImplFontCharMap;
- }
-
- ImplFontCharMap *GetDefaultSymbolMap()
+ if( pDefaultImplFontCharMap )
+ pDefaultImplFontCharMap->AddReference();
+ else
{
- if( !pDefaultSymbolImplFontCharMap )
+ const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
+ int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
+ if( bSymbols )
{
- const sal_uInt32* pRangeCodes = aDefaultSymbolRanges;
- int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
- CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
- pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
- pDefaultSymbolImplFontCharMap->AddReference();
+ pRangeCodes = aDefaultSymbolRanges;
+ nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
}
- return pDefaultSymbolImplFontCharMap;
+ CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 );
+ pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR );
}
-}
-ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
-{
- return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap();
+ return pDefaultImplFontCharMap;
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::AddReference( void ) const
+void ImplFontCharMap::AddReference()
{
- // TODO: disable refcounting on the default maps?
++mnRefCount;
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::DeReference( void ) const
+void ImplFontCharMap::DeReference()
{
if( --mnRefCount <= 0 )
- if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) )
+ if( this != pDefaultImplFontCharMap )
delete this;
}
@@ -399,7 +378,7 @@ int ImplFontCharMap::GetGlyphIndex( sal_uInt32 cChar ) const
// return -1 if the object doesn't know the glyph ids
if( !mpStartGlyphs )
return -1;
-
+
// return 0 if the unicode doesn't have a matching glyph
int nRange = ImplFindRangeIndex( cChar );
// check that we are inside any range
@@ -415,7 +394,7 @@ int ImplFontCharMap::GetGlyphIndex( sal_uInt32 cChar ) const
// check that we are inside a range
if( (nRange & 1) != 0 )
return 0;
-
+
// get glyph index directly or indirectly
int nGlyphIndex = cChar - mpRangeCodes[ nRange ];
const int nStartIndex = mpStartGlyphs[ nRange/2 ];
@@ -555,7 +534,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
{
rResult.mpRangeCodes = NULL;
rResult.mpStartGlyphs= NULL;
- rResult.mpGlyphIds = NULL;
+ rResult.mpGlyphIds = NULL;
rResult.mnRangeCount = 0;
rResult.mbRecoded = false;
rResult.mbSymbolic = false;
@@ -628,7 +607,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
sal_uInt32* pCodePairs = NULL;
int* pStartGlyphs = NULL;
- typedef std::vector<sal_uInt16> U16Vector;
+ typedef std::vector<USHORT> U16Vector;
U16Vector aGlyphIdArray;
aGlyphIdArray.reserve( 0x1000 );
aGlyphIdArray.push_back( 0 );
@@ -666,7 +645,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<sal_uInt16>(nGlyphIndex) );
+ aGlyphIdArray.push_back( static_cast<USHORT>(nGlyphIndex) );
}
}
}
@@ -808,17 +787,17 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// prepare the glyphid-array if needed
// TODO: merge ranges if they are close enough?
- sal_uInt16* pGlyphIds = NULL;
+ USHORT* pGlyphIds = NULL;
if( !aGlyphIdArray.empty())
{
- pGlyphIds = new sal_uInt16[ aGlyphIdArray.size() ];
- sal_uInt16* pOut = pGlyphIds;
+ pGlyphIds = new USHORT[ aGlyphIdArray.size() ];
+ USHORT* pOut = pGlyphIds;
U16Vector::const_iterator it = aGlyphIdArray.begin();
while( it != aGlyphIdArray.end() )
*(pOut++) = *(it++);
}
- // update the result struct
+ // update the result struct
rResult.mpRangeCodes = pCodePairs;
rResult.mpStartGlyphs = pStartGlyphs;
rResult.mnRangeCount = nRangeCount;
@@ -830,9 +809,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
FontCharMap::FontCharMap()
: mpImpl( ImplFontCharMap::GetDefaultMap() )
-{
- mpImpl->AddReference();
-}
+{}
// -----------------------------------------------------------------------
@@ -858,26 +835,31 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
// -----------------------------------------------------------------------
-void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
+void FontCharMap::Reset( ImplFontCharMap* pNewMap )
{
- mpImpl->DeReference();
if( pNewMap == NULL )
+ {
+ mpImpl->DeReference();
mpImpl = ImplFontCharMap::GetDefaultMap();
+ }
else if( pNewMap != mpImpl )
+ {
+ mpImpl->DeReference();
mpImpl = pNewMap;
- mpImpl->AddReference();
+ mpImpl->AddReference();
+ }
}
// -----------------------------------------------------------------------
-sal_Bool FontCharMap::IsDefaultMap() const
+BOOL FontCharMap::IsDefaultMap() const
{
return mpImpl->IsDefaultMap();
}
// -----------------------------------------------------------------------
-sal_Bool FontCharMap::HasChar( sal_uInt32 cChar ) const
+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 c2f0d92f03c3..65c201d03053 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,18 +37,18 @@
// - pMask -
// ---------
-static sal_uInt8 pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+static BYTE pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
// -------------
// - NodeCache -
// -------------
-ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) :
+ImpNodeCache::ImpNodeCache( const ULONG nInitSize ) :
pActNode( NULL )
{
- const sal_uLong nSize = nInitSize + 4;
+ const ULONG nSize = nInitSize + 4;
- for( sal_uLong i = 0; i < nSize; i++ )
+ for( ULONG i = 0; i < nSize; i++ )
{
OctreeNode* pNewNode = new NODE;
@@ -74,7 +74,7 @@ ImpNodeCache::~ImpNodeCache()
// - Octree -
// ----------
-Octree::Octree( sal_uLong nColors ) :
+Octree::Octree( ULONG nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -86,7 +86,7 @@ Octree::Octree( sal_uLong nColors ) :
// ------------------------------------------------------------------------
-Octree::Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors ) :
+Octree::Octree( const BitmapReadAccess& rReadAcc, ULONG nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -167,7 +167,7 @@ void Octree::ImplCreateOctree()
void Octree::ImplDeleteOctree( PPNODE ppNode )
{
- for ( sal_uLong i = 0UL; i < 8UL; i++ )
+ for ( 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 sal_uLong nShift = 7 - nLevel;
- const sal_uInt8 cMask = pImplMask[ nLevel ];
- const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const ULONG nShift = 7 - nLevel;
+ const BYTE cMask = pImplMask[ nLevel ];
+ const 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()
{
- sal_uLong i;
+ ULONG i;
PNODE pNode;
- sal_uLong nRedSum = 0L;
- sal_uLong nGreenSum = 0L;
- sal_uLong nBlueSum = 0L;
- sal_uLong nChilds = 0L;
+ ULONG nRedSum = 0L;
+ ULONG nGreenSum = 0L;
+ ULONG nBlueSum = 0L;
+ ULONG nChilds = 0L;
for ( i = OCTREE_BITS - 1; i && !pReduce[i]; i-- ) {}
@@ -249,7 +249,7 @@ void Octree::ImplReduce()
}
}
- pNode->bLeaf = sal_True;
+ pNode->bLeaf = 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( (sal_uInt8) ( (double) pNode->nRed / pNode->nCount ),
- (sal_uInt8) ( (double) pNode->nGreen / pNode->nCount ),
- (sal_uInt8) ( (double) pNode->nBlue / pNode->nCount ) );
+ aPal[ nPalIndex++ ] = BitmapColor( (BYTE) ( (double) pNode->nRed / pNode->nCount ),
+ (BYTE) ( (double) pNode->nGreen / pNode->nCount ),
+ (BYTE) ( (double) pNode->nBlue / pNode->nCount ) );
}
- else for( sal_uLong i = 0UL; i < 8UL; i++ )
+ else for( 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 sal_uLong nShift = 7 - nLevel;
- const sal_uInt8 cMask = pImplMask[ nLevel++ ];
- const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const ULONG nShift = 7 - nLevel;
+ const BYTE cMask = pImplMask[ nLevel++ ];
+ const 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 )
{
- 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();
+ 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();
const long x = 1L << nBits;
const long x2 = x >> 1L;
- sal_uLong r, g, b;
+ ULONG r, g, b;
long rxx, gxx, bxx;
long rdist, gdist, bdist;
long crinc, cginc, cbinc;
ImplCreateBuffers( nColorMax );
- for( sal_uLong nIndex = 0; nIndex < nColors; nIndex++ )
+ for( ULONG nIndex = 0; nIndex < nColors; nIndex++ )
{
- 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();
+ const BitmapColor& rColor = rPal[ (USHORT) nIndex ];
+ const BYTE cRed = rColor.GetRed();
+ const BYTE cGreen = rColor.GetGreen();
+ const BYTE 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 = (sal_uLong*) pBuffer;
+ cdp = (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 = (sal_uInt8) nIndex;
+ *crgbp = (BYTE) nIndex;
}
}
}
@@ -357,15 +357,15 @@ InverseColorMap::~InverseColorMap()
// ------------------------------------------------------------------------
-void InverseColorMap::ImplCreateBuffers( const sal_uLong nMax )
+void InverseColorMap::ImplCreateBuffers( const ULONG nMax )
{
- const sal_uLong nCount = nMax * nMax * nMax;
- const sal_uLong nSize = nCount * sizeof( sal_uLong );
+ const ULONG nCount = nMax * nMax * nMax;
+ const ULONG nSize = nCount * sizeof( ULONG );
- pMap = (sal_uInt8*) rtl_allocateMemory( nCount );
+ pMap = (BYTE*) rtl_allocateMemory( nCount );
memset( pMap, 0x00, nCount );
- pBuffer = (sal_uInt8*) rtl_allocateMemory( nSize );
+ pBuffer = (BYTE*) rtl_allocateMemory( nSize );
memset( pBuffer, 0xff, nSize );
}
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
index 4d87c06471ee..2846d8d53b6f 100644
--- a/vcl/source/gdi/oldprintadaptor.cxx
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -72,7 +72,7 @@ void OldStylePrintAdaptor::StartPage()
mpData->maPages.back().maPageSize.Width = aPaperSize.getWidth();
mpData->maPages.back().maPageSize.Height = aPaperSize.getHeight();
getPrinter()->SetConnectMetaFile( &mpData->maPages.back().maPage );
-
+
// copy state into metafile
boost::shared_ptr<Printer> pPrinter( getPrinter() );
pPrinter->SetMapMode( pPrinter->GetMapMode() );
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index efd5484dad01..5fe5755f2765 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -100,7 +100,7 @@ const char* ImplDbgCheckOutputDevice( const void* pObj )
// =======================================================================
-#define OUTDEV_POLYPOLY_STACKBUF 32
+#define OUTDEV_POLYPOLY_STACKBUF 32
// =======================================================================
@@ -119,9 +119,9 @@ struct ImplObjStack
Point* mpRefPoint;
TextAlign meTextAlign;
RasterOp meRasterOp;
- sal_uLong mnTextLayoutMode;
+ ULONG mnTextLayoutMode;
LanguageType meTextLanguage;
- sal_uInt16 mnFlags;
+ USHORT mnFlags;
};
// -----------------------------------------------------------------------
@@ -199,6 +199,10 @@ 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 )
@@ -207,8 +211,91 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
pGraphics = mpGraphics;
}
- bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
- OSL_ENSURE( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
+ 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();
return bClipRegion;
}
@@ -229,7 +316,7 @@ Polygon ImplSubdivideBezier( const Polygon& rPoly )
PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
{
- sal_uInt16 i, nPolys = rPolyPoly.Count();
+ USHORT i, nPolys = rPolyPoly.Count();
PolyPolygon aPolyPoly( nPolys );
for( i=0; i<nPolys; ++i )
aPolyPoly.Insert( ImplSubdivideBezier( rPolyPoly.GetObject(i) ) );
@@ -240,42 +327,42 @@ PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
// =======================================================================
// #100127# Extracted from OutputDevice::DrawPolyPolygon()
-void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly )
+void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly )
{
// AW: This crashes on empty PolyPolygons, avoid that
if(!nPoly)
return;
- sal_uInt32 aStackAry1[OUTDEV_POLYPOLY_STACKBUF];
- PCONSTSALPOINT aStackAry2[OUTDEV_POLYPOLY_STACKBUF];
- sal_uInt8* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
- sal_uInt32* pPointAry;
- PCONSTSALPOINT* pPointAryAry;
- const sal_uInt8** pFlagAryAry;
- sal_uInt16 i = 0, j = 0, last = 0;
- sal_Bool bHaveBezier = sal_False;
+ sal_uInt32 aStackAry1[OUTDEV_POLYPOLY_STACKBUF];
+ PCONSTSALPOINT aStackAry2[OUTDEV_POLYPOLY_STACKBUF];
+ BYTE* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
+ sal_uInt32* pPointAry;
+ PCONSTSALPOINT* pPointAryAry;
+ const BYTE** pFlagAryAry;
+ USHORT i = 0, j = 0, last = 0;
+ BOOL bHaveBezier = sal_False;
if ( nPoly > OUTDEV_POLYPOLY_STACKBUF )
{
- pPointAry = new sal_uInt32[nPoly];
- pPointAryAry = new PCONSTSALPOINT[nPoly];
- pFlagAryAry = new const sal_uInt8*[nPoly];
+ pPointAry = new sal_uInt32[nPoly];
+ pPointAryAry = new PCONSTSALPOINT[nPoly];
+ pFlagAryAry = new const BYTE*[nPoly];
}
else
{
- pPointAry = aStackAry1;
- pPointAryAry = aStackAry2;
- pFlagAryAry = (const sal_uInt8**)aStackAry3;
+ pPointAry = aStackAry1;
+ pPointAryAry = aStackAry2;
+ pFlagAryAry = (const BYTE**)aStackAry3;
}
do
{
- const Polygon& rPoly = rPolyPoly.GetObject( i );
- sal_uInt16 nSize = rPoly.GetSize();
+ const Polygon& rPoly = rPolyPoly.GetObject( i );
+ USHORT nSize = rPoly.GetSize();
if ( nSize )
{
- pPointAry[j] = nSize;
+ pPointAry[j] = nSize;
pPointAryAry[j] = (PCONSTSALPOINT)rPoly.GetConstPointAry();
pFlagAryAry[j] = rPoly.GetConstFlagAry();
- last = i;
+ last = i;
if( pFlagAryAry[j] )
bHaveBezier = sal_True;
@@ -338,81 +425,81 @@ OutputDevice::OutputDevice() :
{
DBG_CTOR( OutputDevice, ImplDbgCheckOutputDevice );
- mpGraphics = NULL;
- mpUnoGraphicsList = NULL;
- mpPrevGraphics = NULL;
- mpNextGraphics = NULL;
- mpMetaFile = NULL;
- mpFontEntry = NULL;
- mpFontCache = NULL;
- mpFontList = NULL;
- mpGetDevFontList = NULL;
- mpGetDevSizeList = NULL;
- mpObjStack = NULL;
- mpOutDevData = NULL;
- mpPDFWriter = NULL;
- mpAlphaVDev = NULL;
- mpExtOutDevData = NULL;
- mnOutOffX = 0;
- mnOutOffY = 0;
- mnOutWidth = 0;
- mnOutHeight = 0;
- mnDPIX = 0;
- mnDPIY = 0;
- mnTextOffX = 0;
- mnTextOffY = 0;
- mnOutOffOrigX = 0;
- mnOutOffLogicX = 0;
- mnOutOffOrigY = 0;
- mnOutOffLogicY = 0;
- mnEmphasisAscent = 0;
- mnEmphasisDescent = 0;
- mnDrawMode = 0;
+ mpGraphics = NULL;
+ mpUnoGraphicsList = NULL;
+ mpPrevGraphics = NULL;
+ mpNextGraphics = NULL;
+ mpMetaFile = NULL;
+ mpFontEntry = NULL;
+ mpFontCache = NULL;
+ mpFontList = NULL;
+ mpGetDevFontList = NULL;
+ mpGetDevSizeList = NULL;
+ mpObjStack = NULL;
+ mpOutDevData = NULL;
+ mpPDFWriter = NULL;
+ mpAlphaVDev = NULL;
+ mpExtOutDevData = NULL;
+ mnOutOffX = 0;
+ mnOutOffY = 0;
+ mnOutWidth = 0;
+ mnOutHeight = 0;
+ mnDPIX = 0;
+ mnDPIY = 0;
+ mnTextOffX = 0;
+ mnTextOffY = 0;
+ mnOutOffOrigX = 0;
+ mnOutOffLogicX = 0;
+ mnOutOffOrigY = 0;
+ mnOutOffLogicY = 0;
+ mnEmphasisAscent = 0;
+ mnEmphasisDescent = 0;
+ mnDrawMode = 0;
mnTextLayoutMode = TEXT_LAYOUT_DEFAULT;
if( Application::GetSettings().GetLayoutRTL() ) //#i84553# tip BiDi preference to RTL
mnTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
- meOutDevType = OUTDEV_DONTKNOW;
+ meOutDevType = OUTDEV_DONTKNOW;
meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW;
- 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;
+ mbMap = FALSE;
+ mbMapIsDefault = TRUE;
+ mbClipRegion = FALSE;
+ mbBackground = FALSE;
+ mbOutput = TRUE;
+ mbDevOutput = FALSE;
+ mbOutputClipped = 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 = 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)
+ 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)
// struct ImplMapRes
- maMapRes.mnMapOfsX = 0;
- maMapRes.mnMapOfsY = 0;
- maMapRes.mnMapScNumX = 1;
- maMapRes.mnMapScNumY = 1;
- maMapRes.mnMapScDenomX = 1;
- maMapRes.mnMapScDenomY = 1;
+ maMapRes.mnMapOfsX = 0;
+ maMapRes.mnMapOfsY = 0;
+ maMapRes.mnMapScNumX = 1;
+ maMapRes.mnMapScNumY = 1;
+ maMapRes.mnMapScDenomX = 1;
+ maMapRes.mnMapScDenomY = 1;
// struct ImplThresholdRes
- maThresRes.mnThresLogToPixX = 0;
- maThresRes.mnThresLogToPixY = 0;
- maThresRes.mnThresPixToLogX = 0;
- maThresRes.mnThresPixToLogY = 0;
+ maThresRes.mnThresLogToPixX = 0;
+ maThresRes.mnThresLogToPixY = 0;
+ maThresRes.mnThresPixToLogX = 0;
+ maThresRes.mnThresPixToLogY = 0;
}
// -----------------------------------------------------------------------
@@ -423,7 +510,7 @@ OutputDevice::~OutputDevice()
if ( GetUnoGraphicsList() )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
if ( pWrapper )
pWrapper->ReleaseAllGraphics( this );
delete mpUnoGraphicsList;
@@ -490,7 +577,7 @@ bool OutputDevice::supportsOperation( OutDevSupportType eType ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableRTL( sal_Bool bEnable )
+void OutputDevice::EnableRTL( BOOL bEnable )
{
mbEnableRTL = (bEnable != 0);
if( meOutDevType == OUTDEV_VIRDEV )
@@ -510,16 +597,16 @@ void OutputDevice::EnableRTL( sal_Bool bEnable )
Window* pWin = dynamic_cast<Window*>(this);
if( pWin )
pWin->StateChanged( STATE_CHANGE_MIRRORING );
-
+
if( mpAlphaVDev )
mpAlphaVDev->EnableRTL( bEnable );
}
-sal_Bool OutputDevice::ImplHasMirroredGraphics()
+BOOL OutputDevice::ImplHasMirroredGraphics()
{
// HOTFIX for #i55719#
if( meOutDevType == OUTDEV_PRINTER )
- return sal_False;
+ return FALSE;
return ( ImplGetGraphics() && (mpGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) );
}
@@ -543,12 +630,12 @@ void OutputDevice::ImplReMirror( Rectangle &rRect ) const
}
void OutputDevice::ImplReMirror( Region &rRegion ) const
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ long nX;
+ long nY;
+ long nWidth;
+ long nHeight;
+ ImplRegionInfo aInfo;
+ BOOL bRegionRect;
Region aMirroredRegion;
bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -570,13 +657,13 @@ int OutputDevice::ImplGetGraphics() const
DBG_TESTSOLARMUTEX();
if ( mpGraphics )
- return sal_True;
+ return TRUE;
- mbInitLineColor = sal_True;
- mbInitFillColor = sal_True;
- mbInitFont = sal_True;
- mbInitTextColor = sal_True;
- mbInitClipRegion = sal_True;
+ mbInitLineColor = TRUE;
+ mbInitFillColor = TRUE;
+ mbInitFont = TRUE;
+ mbInitTextColor = TRUE;
+ mbInitClipRegion = TRUE;
ImplSVData* pSVData = ImplGetSVData();
if ( meOutDevType == OUTDEV_WINDOW )
@@ -600,7 +687,7 @@ int OutputDevice::ImplGetGraphics() const
{
// steal the wingraphics from the other outdev
mpGraphics = pReleaseOutDev->mpGraphics;
- pReleaseOutDev->ImplReleaseGraphics( sal_False );
+ pReleaseOutDev->ImplReleaseGraphics( FALSE );
}
else
{
@@ -710,15 +797,15 @@ int OutputDevice::ImplGetGraphics() const
{
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW);
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplReleaseGraphics( sal_Bool bRelease )
+void OutputDevice::ImplReleaseGraphics( BOOL bRelease )
{
DBG_TESTSOLARMUTEX();
@@ -830,9 +917,9 @@ void OutputDevice::ImplReleaseGraphics( sal_Bool bRelease )
}
}
- mpGraphics = NULL;
- mpPrevGraphics = NULL;
- mpNextGraphics = NULL;
+ mpGraphics = NULL;
+ mpPrevGraphics = NULL;
+ mpNextGraphics = NULL;
}
// -----------------------------------------------------------------------
@@ -874,7 +961,7 @@ void OutputDevice::ImplInvalidateViewTransform()
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::ImplIsRecordLayout() const
+BOOL OutputDevice::ImplIsRecordLayout() const
{
return mpOutDevData && mpOutDevData->mpRecordLayout;
}
@@ -915,7 +1002,7 @@ void OutputDevice::ImplInitLineColor()
else
mpGraphics->SetLineColor();
- mbInitLineColor = sal_False;
+ mbInitLineColor = FALSE;
}
// -----------------------------------------------------------------------
@@ -938,7 +1025,7 @@ void OutputDevice::ImplInitFillColor()
else
mpGraphics->SetFillColor();
- mbInitFillColor = sal_False;
+ mbInitFillColor = FALSE;
}
// -----------------------------------------------------------------------
@@ -950,7 +1037,7 @@ void OutputDevice::ImplInitClipRegion()
if ( GetOutDevType() == OUTDEV_WINDOW )
{
Window* pWindow = (Window*)this;
- Region aRegion;
+ Region aRegion;
// Hintergrund-Sicherung zuruecksetzen
if ( pWindow->mpWindowImpl->mpFrameData->mpFirstBackWin )
@@ -968,56 +1055,43 @@ void OutputDevice::ImplInitClipRegion()
if ( mbClipRegion )
aRegion.Intersect( ImplPixelToDevicePixel( maRegion ) );
if ( aRegion.IsEmpty() )
- mbOutputClipped = sal_True;
+ mbOutputClipped = TRUE;
else
{
- mbOutputClipped = sal_False;
+ mbOutputClipped = FALSE;
ImplSelectClipRegion( aRegion );
}
- mbClipRegionSet = sal_True;
+ mbClipRegionSet = TRUE;
}
else
{
if ( mbClipRegion )
{
if ( maRegion.IsEmpty() )
- mbOutputClipped = sal_True;
+ mbOutputClipped = TRUE;
else
{
- 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 );
+ mbOutputClipped = FALSE;
+ ImplSelectClipRegion(
+ // #102532# Respect output offset also for clip region
+ ImplPixelToDevicePixel( maRegion ) );
}
- mbClipRegionSet = sal_True;
+ mbClipRegionSet = TRUE;
}
else
{
if ( mbClipRegionSet )
{
mpGraphics->ResetClipRegion();
- mbClipRegionSet = sal_False;
+ mbClipRegionSet = FALSE;
}
- mbOutputClipped = sal_False;
+ mbOutputClipped = FALSE;
}
}
- mbInitClipRegion = sal_False;
+ mbInitClipRegion = FALSE;
}
// -----------------------------------------------------------------------
@@ -1030,28 +1104,711 @@ void OutputDevice::ImplSetClipRegion( const Region* pRegion )
{
if ( mbClipRegion )
{
- maRegion = Region( REGION_NULL );
- mbClipRegion = sal_False;
- mbInitClipRegion = sal_True;
+ maRegion = Region( REGION_NULL );
+ mbClipRegion = FALSE;
+ mbInitClipRegion = TRUE;
}
}
else
{
- maRegion = *pRegion;
- mbClipRegion = sal_True;
- mbInitClipRegion = sal_True;
+ maRegion = *pRegion;
+ mbClipRegion = TRUE;
+ mbInitClipRegion = 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_TRACE( "OutputDevice::SetClipRegion()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( Region(), sal_False ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( Region(), FALSE ) );
ImplSetClipRegion( NULL );
@@ -1063,12 +1820,12 @@ void OutputDevice::SetClipRegion()
void OutputDevice::SetClipRegion( const Region& rRegion )
{
- OSL_TRACE( "OutputDevice::SetClipRegion( rRegion )" );
+ DBG_TRACE( "OutputDevice::SetClipRegion( rRegion )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, sal_True ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, TRUE ) );
if ( rRegion.GetType() == REGION_NULL )
ImplSetClipRegion( NULL );
@@ -1084,6 +1841,42 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
+void OutputDevice::SetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
+{
+ DBG_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_x);
+
+ // 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 );
@@ -1118,7 +1911,7 @@ Region OutputDevice::GetActiveClipRegion() const
void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
{
- OSL_TRACE( "OutputDevice::MoveClipRegion()" );
+ DBG_TRACE( "OutputDevice::MoveClipRegion()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mbClipRegion )
@@ -1128,7 +1921,7 @@ void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
maRegion.Move( ImplLogicWidthToDevicePixel( nHorzMove ),
ImplLogicHeightToDevicePixel( nVertMove ) );
- mbInitClipRegion = sal_True;
+ mbInitClipRegion = TRUE;
}
if( mpAlphaVDev )
@@ -1139,7 +1932,7 @@ void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
void OutputDevice::IntersectClipRegion( const Rectangle& rRect )
{
- OSL_TRACE( "OutputDevice::IntersectClipRegion( rRect )" );
+ DBG_TRACE( "OutputDevice::IntersectClipRegion( rRect )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -1147,8 +1940,8 @@ void OutputDevice::IntersectClipRegion( const Rectangle& rRect )
Rectangle aRect = LogicToPixel( rRect );
maRegion.Intersect( aRect );
- mbClipRegion = sal_True;
- mbInitClipRegion = sal_True;
+ mbClipRegion = TRUE;
+ mbInitClipRegion = TRUE;
if( mpAlphaVDev )
mpAlphaVDev->IntersectClipRegion( rRect );
@@ -1158,7 +1951,7 @@ void OutputDevice::IntersectClipRegion( const Rectangle& rRect )
void OutputDevice::IntersectClipRegion( const Region& rRegion )
{
- OSL_TRACE( "OutputDevice::IntersectClipRegion( rRegion )" );
+ DBG_TRACE( "OutputDevice::IntersectClipRegion( rRegion )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
@@ -1171,8 +1964,8 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
Region aRegion = LogicToPixel( rRegion );
maRegion.Intersect( aRegion );
- mbClipRegion = sal_True;
- mbInitClipRegion = sal_True;
+ mbClipRegion = TRUE;
+ mbInitClipRegion = TRUE;
}
if( mpAlphaVDev )
@@ -1181,9 +1974,9 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetDrawMode( sal_uLong nDrawMode )
+void OutputDevice::SetDrawMode( ULONG nDrawMode )
{
- OSL_TRACE( "OutputDevice::SetDrawMode( %lx )", nDrawMode );
+ DBG_TRACE1( "OutputDevice::SetDrawMode( %lx )", nDrawMode );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
mnDrawMode = nDrawMode;
@@ -1196,7 +1989,7 @@ void OutputDevice::SetDrawMode( sal_uLong nDrawMode )
void OutputDevice::SetRasterOp( RasterOp eRasterOp )
{
- OSL_TRACE( "OutputDevice::SetRasterOp( %d )", (int)eRasterOp );
+ DBG_TRACE1( "OutputDevice::SetRasterOp( %d )", (int)eRasterOp );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -1205,7 +1998,7 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp )
if ( meRasterOp != eRasterOp )
{
meRasterOp = eRasterOp;
- mbInitLineColor = mbInitFillColor = sal_True;
+ mbInitLineColor = mbInitFillColor = TRUE;
if( mpGraphics || ImplGetGraphics() )
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
@@ -1219,16 +2012,16 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp )
void OutputDevice::SetLineColor()
{
- OSL_TRACE( "OutputDevice::SetLineColor()" );
+ DBG_TRACE( "OutputDevice::SetLineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
if ( mbLineColor )
{
- mbInitLineColor = sal_True;
- mbLineColor = sal_False;
+ mbInitLineColor = TRUE;
+ mbLineColor = FALSE;
maLineColor = Color( COL_TRANSPARENT );
}
@@ -1240,7 +2033,7 @@ void OutputDevice::SetLineColor()
void OutputDevice::SetLineColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetLineColor( %lx )", rColor.GetColor() );
+ DBG_TRACE1( "OutputDevice::SetLineColor( %lx )", rColor.GetColor() );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
@@ -1261,7 +2054,7 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1279,14 +2072,14 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
if( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( aColor, sal_True ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( aColor, TRUE ) );
if( ImplIsColorTransparent( aColor ) )
{
if ( mbLineColor )
{
- mbInitLineColor = sal_True;
- mbLineColor = sal_False;
+ mbInitLineColor = TRUE;
+ mbLineColor = FALSE;
maLineColor = Color( COL_TRANSPARENT );
}
}
@@ -1294,8 +2087,8 @@ void OutputDevice::SetLineColor( const Color& rColor )
{
if( maLineColor != aColor )
{
- mbInitLineColor = sal_True;
- mbLineColor = sal_True;
+ mbInitLineColor = TRUE;
+ mbLineColor = TRUE;
maLineColor = aColor;
}
}
@@ -1308,16 +2101,16 @@ void OutputDevice::SetLineColor( const Color& rColor )
void OutputDevice::SetFillColor()
{
- OSL_TRACE( "OutputDevice::SetFillColor()" );
+ DBG_TRACE( "OutputDevice::SetFillColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color(), FALSE ) );
if ( mbFillColor )
{
- mbInitFillColor = sal_True;
- mbFillColor = sal_False;
+ mbInitFillColor = TRUE;
+ mbFillColor = FALSE;
maFillColor = Color( COL_TRANSPARENT );
}
@@ -1329,7 +2122,7 @@ void OutputDevice::SetFillColor()
void OutputDevice::SetFillColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetFillColor( %lx )", rColor.GetColor() );
+ DBG_TRACE1( "OutputDevice::SetFillColor( %lx )", rColor.GetColor() );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
@@ -1350,7 +2143,7 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_NOFILL )
@@ -1372,14 +2165,14 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( aColor, sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( aColor, TRUE ) );
if ( ImplIsColorTransparent( aColor ) )
{
if ( mbFillColor )
{
- mbInitFillColor = sal_True;
- mbFillColor = sal_False;
+ mbInitFillColor = TRUE;
+ mbFillColor = FALSE;
maFillColor = Color( COL_TRANSPARENT );
}
}
@@ -1387,8 +2180,8 @@ void OutputDevice::SetFillColor( const Color& rColor )
{
if ( maFillColor != aColor )
{
- mbInitFillColor = sal_True;
- mbFillColor = sal_True;
+ mbInitFillColor = TRUE;
+ mbFillColor = TRUE;
maFillColor = aColor;
}
}
@@ -1401,11 +2194,11 @@ void OutputDevice::SetFillColor( const Color& rColor )
void OutputDevice::SetBackground()
{
- OSL_TRACE( "OutputDevice::SetBackground()" );
+ DBG_TRACE( "OutputDevice::SetBackground()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
maBackground = Wallpaper();
- mbBackground = sal_False;
+ mbBackground = FALSE;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground();
@@ -1415,15 +2208,15 @@ void OutputDevice::SetBackground()
void OutputDevice::SetBackground( const Wallpaper& rBackground )
{
- OSL_TRACE( "OutputDevice::SetBackground( rBackground )" );
+ DBG_TRACE( "OutputDevice::SetBackground( rBackground )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
maBackground = rBackground;
if( rBackground.GetStyle() == WALLPAPER_NULL )
- mbBackground = sal_False;
+ mbBackground = FALSE;
else
- mbBackground = sal_True;
+ mbBackground = TRUE;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground( rBackground );
@@ -1433,13 +2226,13 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground )
void OutputDevice::SetRefPoint()
{
- OSL_TRACE( "OutputDevice::SetRefPoint()" );
+ DBG_TRACE( "OutputDevice::SetRefPoint()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( Point(), sal_False ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( Point(), FALSE ) );
- mbRefPoint = sal_False;
+ mbRefPoint = FALSE;
maRefPoint.X() = maRefPoint.Y() = 0L;
if( mpAlphaVDev )
@@ -1450,13 +2243,13 @@ void OutputDevice::SetRefPoint()
void OutputDevice::SetRefPoint( const Point& rRefPoint )
{
- OSL_TRACE( "OutputDevice::SetRefPoint( rRefPoint )" );
+ DBG_TRACE( "OutputDevice::SetRefPoint( rRefPoint )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, sal_True ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, TRUE ) );
- mbRefPoint = sal_True;
+ mbRefPoint = TRUE;
maRefPoint = rRefPoint;
if( mpAlphaVDev )
@@ -1467,7 +2260,7 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint )
void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
{
- OSL_TRACE( "OutputDevice::DrawLine()" );
+ DBG_TRACE( "OutputDevice::DrawLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -1491,7 +2284,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
ImplInitLineColor();
// #i101598# support AA and snap for lines, too
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& IsLineColor())
@@ -1532,7 +2325,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
const LineInfo& rInfo,
basegfx::B2DPolyPolygon aLinePolyPolygon)
{
- const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& IsLineColor());
@@ -1588,19 +2381,19 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
// #i110768# When area geometry has to be created, do not
// use the fallback bezier decomposition inside createAreaGeometry,
// but one that is at least as good as ImplSubdivideBezier was.
- // There, Polygon::AdaptiveSubdivide was used with default parameter
+ // There, Polygon::AdaptiveSubdivide was used with default parameter
// 1.0 as quality index.
aLinePolyPolygon = basegfx::tools::adaptiveSubdivideByDistance(aLinePolyPolygon, 1.0);
}
-
+
for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++)
{
aFillPolyPolygon.append(basegfx::tools::createAreaGeometry(
- aLinePolyPolygon.getB2DPolygon(a),
- fHalfLineWidth,
+ aLinePolyPolygon.getB2DPolygon(a),
+ fHalfLineWidth,
rInfo.GetLineJoin()));
}
-
+
aLinePolyPolygon.clear();
}
@@ -1629,8 +2422,8 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
if(aFillPolyPolygon.count())
{
- const Color aOldLineColor( maLineColor );
- const Color aOldFillColor( maFillColor );
+ const Color aOldLineColor( maLineColor );
+ const Color aOldFillColor( maFillColor );
SetLineColor();
ImplInitLineColor();
@@ -1638,7 +2431,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
ImplInitFillColor();
bool bDone(false);
-
+
if(bTryAA)
{
bDone = mpGraphics->DrawPolyPolygon(aFillPolyPolygon, 0.0, this);
@@ -1652,7 +2445,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
mpGraphics->DrawPolygon(aPolygon.GetSize(), (const SalPoint*)aPolygon.GetConstPointAry(), this);
}
}
-
+
SetFillColor( aOldFillColor );
SetLineColor( aOldLineColor );
}
@@ -1665,7 +2458,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand(
void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
const LineInfo& rLineInfo )
{
- OSL_TRACE( "OutputDevice::DrawLine()" );
+ DBG_TRACE( "OutputDevice::DrawLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( rLineInfo.IsDefault() )
@@ -1719,7 +2512,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
void OutputDevice::DrawRect( const Rectangle& rRect )
{
- OSL_TRACE( "OutputDevice::DrawRect()" );
+ DBG_TRACE( "OutputDevice::DrawRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -1760,14 +2553,14 @@ void OutputDevice::DrawRect( const Rectangle& rRect )
void OutputDevice::DrawPolyLine( const Polygon& rPoly )
{
- OSL_TRACE( "OutputDevice::DrawPolyLine()" );
+ DBG_TRACE( "OutputDevice::DrawPolyLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rPoly, Polygon, NULL );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyLineAction( rPoly ) );
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || !mbLineColor || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -1785,7 +2578,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
if ( mbInitLineColor )
ImplInitLineColor();
- const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& IsLineColor());
@@ -1817,7 +2610,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
+ const BYTE* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -1838,7 +2631,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo )
{
- OSL_TRACE( "OutputDevice::DrawPolyLine()" );
+ DBG_TRACE( "OutputDevice::DrawPolyLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rPoly, Polygon, NULL );
@@ -1850,7 +2643,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
// #i101491#
// Try direct Fallback to B2D-Version of DrawPolyLine
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& LINE_SOLID == rLineInfo.GetStyle())
{
DrawPolyLine( rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin());
@@ -1865,7 +2658,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo)
{
- sal_uInt16 nPoints(rPoly.GetSize());
+ USHORT nPoints(rPoly.GetSize());
if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
return;
@@ -1873,7 +2666,7 @@ void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineI
Polygon aPoly = ImplLogicToDevicePixel( rPoly );
// #100127# LineInfo is not curve-safe, subdivide always
- //
+ //
// What shall this mean? It's wrong to subdivide here when the
// polygon is a fat line. In that case, the painted geometry
// WILL be much different.
@@ -1918,7 +2711,7 @@ void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineI
aPoly = ImplSubdivideBezier( aPoly );
nPoints = aPoly.GetSize();
}
-
+
mpGraphics->DrawPolyLine(nPoints, (const SalPoint*)aPoly.GetConstPointAry(), this);
}
@@ -1930,14 +2723,14 @@ void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineI
void OutputDevice::DrawPolygon( const Polygon& rPoly )
{
- OSL_TRACE( "OutputDevice::DrawPolygon()" );
+ DBG_TRACE( "OutputDevice::DrawPolygon()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rPoly, Polygon, NULL );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -1958,7 +2751,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
ImplInitFillColor();
// use b2dpolygon drawing if possible
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& (IsLineColor() || IsFillColor()))
@@ -2000,7 +2793,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
+ const BYTE* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -2020,14 +2813,14 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
{
- OSL_TRACE( "OutputDevice::DrawPolyPolygon()" );
+ DBG_TRACE( "OutputDevice::DrawPolyPolygon()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) );
- sal_uInt16 nPoly = rPolyPoly.Count();
+ USHORT nPoly = rPolyPoly.Count();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || !nPoly || ImplIsRecordLayout() )
return;
@@ -2048,7 +2841,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
ImplInitFillColor();
// use b2dpolygon drawing if possible
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& (IsLineColor() || IsFillColor()))
@@ -2131,7 +2924,7 @@ void OutputDevice::DrawPolygon( const ::basegfx::B2DPolygon& rB2DPolygon)
void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
- OSL_TRACE( "OutputDevice::DrawPolyPolygon(B2D&)" );
+ DBG_TRACE( "OutputDevice::DrawPolyPolygon(B2D&)" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -2163,7 +2956,7 @@ void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPo
if( mbInitFillColor )
ImplInitFillColor();
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& (IsLineColor() || IsFillColor()))
@@ -2217,7 +3010,7 @@ bool OutputDevice::ImpTryDrawPolyLineDirect(
{
const basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
basegfx::B2DVector aB2DLineWidth(1.0, 1.0);
-
+
// transform the line width if used
if( fLineWidth != 0.0 )
{
@@ -2227,8 +3020,8 @@ bool OutputDevice::ImpTryDrawPolyLineDirect(
// transform the polygon
basegfx::B2DPolygon aB2DPolygon(rB2DPolygon);
aB2DPolygon.transform(aTransform);
-
- if((mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE)
+
+ if((mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE)
&& aB2DPolygon.count() < 1000)
{
// #i98289#, #i101491#
@@ -2247,7 +3040,7 @@ void OutputDevice::DrawPolyLine(
double fLineWidth,
basegfx::B2DLineJoin eLineJoin)
{
- OSL_TRACE( "OutputDevice::DrawPolyLine(B2D&)" );
+ DBG_TRACE( "OutputDevice::DrawPolyLine(B2D&)" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
(void)eLineJoin; // ATM used in UNX, but not in WNT, access it for warning-free
@@ -2278,7 +3071,7 @@ void OutputDevice::DrawPolyLine(
if( mbInitLineColor )
ImplInitLineColor();
- const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ const bool bTryAA((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp()
&& IsLineColor());
@@ -2293,7 +3086,7 @@ void OutputDevice::DrawPolyLine(
// no output yet; fallback to geometry decomposition and use filled polygon paint
// when line is fat and not too complex. ImpDrawPolyPolygonWithB2DPolyPolygon
// will do internal needed AA checks etc.
- if(fLineWidth >= 2.5
+ if(fLineWidth >= 2.5
&& rB2DPolygon.count()
&& rB2DPolygon.count() <= 1000)
{
@@ -2344,23 +3137,9 @@ void OutputDevice::DrawPolyLine(
// -----------------------------------------------------------------------
-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 )
+void OutputDevice::Push( USHORT nFlags )
{
- OSL_TRACE( "OutputDevice::Push()" );
+ DBG_TRACE( "OutputDevice::Push()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -2449,14 +3228,14 @@ void OutputDevice::Push( sal_uInt16 nFlags )
void OutputDevice::Pop()
{
- OSL_TRACE( "OutputDevice::Pop()" );
+ DBG_TRACE( "OutputDevice::Pop()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPopAction() );
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- ImplObjStack* pData = mpObjStack;
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ ImplObjStack* pData = mpObjStack;
mpMetaFile = NULL;
if ( !pData )
@@ -2548,7 +3327,7 @@ void OutputDevice::SetConnectMetaFile( GDIMetaFile* pMtf )
// -----------------------------------------------------------------------
-void OutputDevice::EnableOutput( sal_Bool bEnable )
+void OutputDevice::EnableOutput( BOOL bEnable )
{
mbOutput = (bEnable != 0);
@@ -2568,7 +3347,7 @@ void OutputDevice::SetSettings( const AllSettings& rSettings )
// -----------------------------------------------------------------------
-sal_uInt16 OutputDevice::GetBitCount() const
+USHORT OutputDevice::GetBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -2582,12 +3361,12 @@ sal_uInt16 OutputDevice::GetBitCount() const
return 0;
}
- return (sal_uInt16)mpGraphics->GetBitCount();
+ return (USHORT)mpGraphics->GetBitCount();
}
// -----------------------------------------------------------------------
-sal_uInt16 OutputDevice::GetAlphaBitCount() const
+USHORT OutputDevice::GetAlphaBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -2602,17 +3381,17 @@ sal_uInt16 OutputDevice::GetAlphaBitCount() const
// -----------------------------------------------------------------------
-sal_uLong OutputDevice::GetColorCount() const
+ULONG OutputDevice::GetColorCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- const sal_uInt16 nBitCount = GetBitCount();
- return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (sal_uLong) 1 ) << nBitCount) );
+ const USHORT nBitCount = GetBitCount();
+ return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (ULONG) 1 ) << nBitCount) );
}
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::HasAlpha()
+BOOL OutputDevice::HasAlpha()
{
return mpAlphaVDev != NULL;
}
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 356542952360..271bebb92051 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -64,39 +64,39 @@ DBG_NAMEEX( OutputDevice )
// - Defines -
// -----------
-#define OUTDEV_INIT() \
-{ \
- if ( !IsDeviceOutputNecessary() ) \
- return; \
+#define OUTDEV_INIT() \
+{ \
+ if ( !IsDeviceOutputNecessary() ) \
+ return; \
\
- if ( !mpGraphics ) \
- if ( !ImplGetGraphics() ) \
- return; \
+ if ( !mpGraphics ) \
+ if ( !ImplGetGraphics() ) \
+ return; \
\
- if ( mbInitClipRegion ) \
- ImplInitClipRegion(); \
+ if ( mbInitClipRegion ) \
+ ImplInitClipRegion(); \
\
- if ( mbOutputClipped ) \
- return; \
+ if ( mbOutputClipped ) \
+ return; \
}
-#define TwoRect SalTwoRect
+#define TwoRect SalTwoRect
// -------------
// - externals -
// -------------
-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 ];
+extern ULONG nVCLRLut[ 6 ];
+extern ULONG nVCLGLut[ 6 ];
+extern ULONG nVCLBLut[ 6 ];
+extern ULONG nVCLDitherLut[ 256 ];
+extern ULONG nVCLLut[ 256 ];
// =======================================================================
-sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
+ULONG ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
{
- sal_uLong nMirrFlags = 0;
+ ULONG nMirrFlags = 0;
if ( rTwoRect.mnDestWidth < 0 )
{
@@ -115,13 +115,13 @@ sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
}
if( ( rTwoRect.mnSrcX < 0 ) || ( rTwoRect.mnSrcX >= rSizePix.Width() ) ||
- ( rTwoRect.mnSrcY < 0 ) || ( rTwoRect.mnSrcY >= rSizePix.Height() ) ||
+ ( rTwoRect.mnSrcY < 0 ) || ( rTwoRect.mnSrcY >= rSizePix.Height() ) ||
( ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) > rSizePix.Width() ) ||
( ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) > rSizePix.Height() ) )
{
- const Rectangle aSourceRect( Point( rTwoRect.mnSrcX, rTwoRect.mnSrcY ),
+ const Rectangle aSourceRect( Point( rTwoRect.mnSrcX, rTwoRect.mnSrcY ),
Size( rTwoRect.mnSrcWidth, rTwoRect.mnSrcHeight ) );
- Rectangle aCropRect( aSourceRect );
+ Rectangle aCropRect( aSourceRect );
aCropRect.Intersection( Rectangle( Point(), rSizePix ) );
@@ -129,8 +129,8 @@ sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
rTwoRect.mnSrcWidth = rTwoRect.mnSrcHeight = rTwoRect.mnDestWidth = rTwoRect.mnDestHeight = 0;
else
{
- const double fFactorX = ( rTwoRect.mnSrcWidth > 1 ) ? (double) ( rTwoRect.mnDestWidth - 1 ) / ( rTwoRect.mnSrcWidth - 1 ) : 0.0;
- const double fFactorY = ( rTwoRect.mnSrcHeight > 1 ) ? (double) ( rTwoRect.mnDestHeight - 1 ) / ( rTwoRect.mnSrcHeight - 1 ) : 0.0;
+ const double fFactorX = ( rTwoRect.mnSrcWidth > 1 ) ? (double) ( rTwoRect.mnDestWidth - 1 ) / ( rTwoRect.mnSrcWidth - 1 ) : 0.0;
+ const double fFactorY = ( rTwoRect.mnSrcHeight > 1 ) ? (double) ( rTwoRect.mnDestHeight - 1 ) / ( rTwoRect.mnSrcHeight - 1 ) : 0.0;
const long nDstX1 = rTwoRect.mnDestX + FRound( fFactorX * ( aCropRect.Left() - rTwoRect.mnSrcX ) );
const long nDstY1 = rTwoRect.mnDestY + FRound( fFactorY * ( aCropRect.Top() - rTwoRect.mnSrcY ) );
@@ -155,8 +155,8 @@ sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
void OutputDevice::ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pVoidPosAry )
{
- TwoRect* pPosAry = (TwoRect*)pVoidPosAry;
- SalGraphics* pGraphics2;
+ TwoRect* pPosAry = (TwoRect*)pVoidPosAry;
+ SalGraphics* pGraphics2;
if ( pPosAry->mnSrcWidth && pPosAry->mnSrcHeight && pPosAry->mnDestWidth && pPosAry->mnDestHeight )
{
@@ -199,12 +199,12 @@ void OutputDevice::ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pVoi
}
// #102532# Offset only has to be pseudo window offset
- Rectangle aSrcOutRect( Point( pSrcDev->mnOutOffX, pSrcDev->mnOutOffY ),
+ Rectangle aSrcOutRect( Point( pSrcDev->mnOutOffX, pSrcDev->mnOutOffY ),
Size( pSrcDev->mnOutWidth, pSrcDev->mnOutHeight ) );
- Rectangle aSrcRect( Point( pPosAry->mnSrcX, pPosAry->mnSrcY ),
+ Rectangle aSrcRect( Point( pPosAry->mnSrcX, pPosAry->mnSrcY ),
Size( pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ) );
- const long nOldRight = aSrcRect.Right();
- const long nOldBottom = aSrcRect.Bottom();
+ const long nOldRight = aSrcRect.Right();
+ const long nOldBottom = aSrcRect.Bottom();
if ( !aSrcRect.Intersection( aSrcOutRect ).IsEmpty() )
{
@@ -229,7 +229,7 @@ void OutputDevice::ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pVoi
if( (GetOutDevType() != OUTDEV_WINDOW) && pGraphics2 && (pGraphics2->GetLayout() & SAL_LAYOUT_BIDI_RTL) )
{
SalTwoRect pPosAry2 = *pPosAry;
- pGraphics2->mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth, pSrcDev );
+ pGraphics2->mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth, pSrcDev );
mpGraphics->CopyBits( &pPosAry2, pGraphics2, this, pSrcDev );
}
else
@@ -243,7 +243,7 @@ void OutputDevice::ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pVoi
void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPt, const Size& rSrcSize )
{
- OSL_TRACE( "OutputDevice::DrawOutDev()" );
+ DBG_TRACE( "OutputDevice::DrawOutDev()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
@@ -268,24 +268,24 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
OUTDEV_INIT();
TwoRect aPosAry;
- aPosAry.mnSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
+ aPosAry.mnSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
aPosAry.mnSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
- aPosAry.mnSrcX = ImplLogicXToDevicePixel( rSrcPt.X() );
- aPosAry.mnSrcY = ImplLogicYToDevicePixel( rSrcPt.Y() );
- aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
- aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
+ aPosAry.mnSrcX = ImplLogicXToDevicePixel( rSrcPt.X() );
+ aPosAry.mnSrcY = ImplLogicYToDevicePixel( rSrcPt.Y() );
+ aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
+ aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
- Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
+ Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) );
- Rectangle aSrcRect( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ),
+ Rectangle aSrcRect( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ),
Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) );
- long nOldRight = aSrcRect.Right();
- long nOldBottom = aSrcRect.Bottom();
+ long nOldRight = aSrcRect.Right();
+ long nOldBottom = aSrcRect.Bottom();
if ( !aSrcRect.Intersection( aSrcOutRect ).IsEmpty() )
{
@@ -317,7 +317,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPt, const Size& rSrcSize,
const OutputDevice& rOutDev )
{
- OSL_TRACE( "OutputDevice::DrawOutDev()" );
+ DBG_TRACE( "OutputDevice::DrawOutDev()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rOutDev, OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
@@ -341,12 +341,12 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
OUTDEV_INIT();
TwoRect aPosAry;
- aPosAry.mnSrcX = rOutDev.ImplLogicXToDevicePixel( rSrcPt.X() );
- aPosAry.mnSrcY = rOutDev.ImplLogicYToDevicePixel( rSrcPt.Y() );
- aPosAry.mnSrcWidth = rOutDev.ImplLogicWidthToDevicePixel( rSrcSize.Width() );
+ aPosAry.mnSrcX = rOutDev.ImplLogicXToDevicePixel( rSrcPt.X() );
+ aPosAry.mnSrcY = rOutDev.ImplLogicYToDevicePixel( rSrcPt.Y() );
+ aPosAry.mnSrcWidth = rOutDev.ImplLogicWidthToDevicePixel( rSrcSize.Width() );
aPosAry.mnSrcHeight = rOutDev.ImplLogicHeightToDevicePixel( rSrcSize.Height() );
- aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
- aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
+ aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
+ aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
@@ -388,9 +388,9 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
- OSL_TRACE( "OutputDevice::CopyArea()" );
+ DBG_TRACE( "OutputDevice::CopyArea()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::CopyArea(...) with printer devices!" );
@@ -403,22 +403,22 @@ void OutputDevice::CopyArea( const Point& rDestPt,
OUTDEV_INIT();
TwoRect aPosAry;
- aPosAry.mnSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
+ aPosAry.mnSrcWidth = ImplLogicWidthToDevicePixel( rSrcSize.Width() );
aPosAry.mnSrcHeight = ImplLogicHeightToDevicePixel( rSrcSize.Height() );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight )
{
- aPosAry.mnSrcX = ImplLogicXToDevicePixel( rSrcPt.X() );
- aPosAry.mnSrcY = ImplLogicYToDevicePixel( rSrcPt.Y() );
- aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
- aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
+ aPosAry.mnSrcX = ImplLogicXToDevicePixel( rSrcPt.X() );
+ aPosAry.mnSrcY = ImplLogicYToDevicePixel( rSrcPt.Y() );
+ aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
+ aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
- Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
+ Rectangle aSrcOutRect( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) );
- Rectangle aSrcRect( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ),
+ Rectangle aSrcRect( Point( aPosAry.mnSrcX, aPosAry.mnSrcY ),
Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ) );
- long nOldRight = aSrcRect.Right();
- long nOldBottom = aSrcRect.Bottom();
+ long nOldRight = aSrcRect.Right();
+ long nOldBottom = aSrcRect.Bottom();
if ( !aSrcRect.Intersection( aSrcOutRect ).IsEmpty() )
{
@@ -433,7 +433,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
((Window*)this)->ImplMoveAllInvalidateRegions( aSrcRect,
aPosAry.mnDestX-aPosAry.mnSrcX,
aPosAry.mnDestY-aPosAry.mnSrcY,
- sal_False );
+ FALSE );
mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY,
aPosAry.mnSrcX, aPosAry.mnSrcY,
@@ -462,11 +462,11 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- sal_Bool bOldMap = mbMap;
- RasterOp eOldROP = GetRasterOp();
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ BOOL bOldMap = mbMap;
+ RasterOp eOldROP = GetRasterOp();
mpMetaFile = NULL;
- mbMap = sal_False;
+ mbMap = FALSE;
SetRasterOp( ROP_OVERPAINT );
if ( !IsDeviceOutputNecessary() )
@@ -485,18 +485,18 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
ImplSelectClipRegion( rRegion );
TwoRect aPosAry;
- aPosAry.mnSrcX = rDevPt.X();
- aPosAry.mnSrcY = rDevPt.Y();
- aPosAry.mnSrcWidth = rDevSize.Width();
+ aPosAry.mnSrcX = rDevPt.X();
+ aPosAry.mnSrcY = rDevPt.Y();
+ aPosAry.mnSrcWidth = rDevSize.Width();
aPosAry.mnSrcHeight = rDevSize.Height();
- aPosAry.mnDestX = rPt.X();
- aPosAry.mnDestY = rPt.Y();
+ aPosAry.mnDestX = rPt.X();
+ aPosAry.mnDestY = rPt.Y();
aPosAry.mnDestWidth = rDevSize.Width();
aPosAry.mnDestHeight = rDevSize.Height();
ImplDrawOutDevDirect( &rOutDev, &aPosAry );
// Dafuer sorgen, das ClipRegion neu berechnet und gesetzt wird
- mbInitClipRegion = sal_True;
+ mbInitClipRegion = TRUE;
SetRasterOp( eOldROP );
mbMap = bOldMap;
@@ -510,8 +510,8 @@ void OutputDevice::ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- sal_Bool bOldMap = mbMap;
- mbMap = sal_False;
+ BOOL bOldMap = mbMap;
+ mbMap = FALSE;
rDev.DrawOutDev( rDevPt, rDevSize, rPt, rDevSize, *this );
mbMap = bOldMap;
}
@@ -520,7 +520,7 @@ void OutputDevice::ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const
void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
{
- OSL_TRACE( "OutputDevice::DrawBitmap()" );
+ DBG_TRACE( "OutputDevice::DrawBitmap()" );
if( ImplIsRecordLayout() )
return;
@@ -539,7 +539,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap )
{
- OSL_TRACE( "OutputDevice::DrawBitmap( Size )" );
+ DBG_TRACE( "OutputDevice::DrawBitmap( Size )" );
if( ImplIsRecordLayout() )
return;
@@ -559,7 +559,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap )
{
- OSL_TRACE( "OutputDevice::DrawBitmap( Point, Size )" );
+ DBG_TRACE( "OutputDevice::DrawBitmap( Point, Size )" );
if( ImplIsRecordLayout() )
return;
@@ -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 sal_uLong nAction )
+ const Bitmap& rBitmap, const ULONG nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -590,12 +590,12 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
DrawRect( Rectangle( rDestPt, rDestSize ) );
return;
}
- else if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
+ else if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
DRAWMODE_GRAYBITMAP | DRAWMODE_GHOSTEDBITMAP ) )
{
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
- sal_uInt8 cCmpVal;
+ BYTE cCmpVal;
if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
@@ -654,13 +654,13 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
- const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
+ const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
if ( nMirrFlags )
aBmp.Mirror( nMirrFlags );
-
+
/* #i75264# (corrected with #i81576#)
* sometimes a bitmap is scaled to a ridiculous size and drawn
* to a quite normal VDev, so only a very small part of
@@ -690,7 +690,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth )
{
const double nScaleX = aPosAry.mnDestWidth/double(aPosAry.mnSrcWidth);
-
+
if( aPosAry.mnDestX + aPosAry.mnDestWidth > mnOutWidth )
{
aPosAry.mnDestWidth = Max(long(0),mnOutWidth-aPosAry.mnDestX);
@@ -701,14 +701,14 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX);
aPosAry.mnDestX = 0;
}
-
+
aPosAry.mnSrcWidth = sal::static_int_cast<long>(aPosAry.mnDestWidth / nScaleX);
}
-
+
if( aPosAry.mnDestHeight > 3*mnOutHeight && aPosAry.mnSrcHeight != 0 )
{
const double nScaleY = aPosAry.mnDestHeight/double(aPosAry.mnSrcHeight);
-
+
if( aPosAry.mnDestY + aPosAry.mnDestHeight > mnOutHeight )
{
aPosAry.mnDestHeight = Max(long(0),mnOutHeight-aPosAry.mnDestY);
@@ -719,7 +719,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY);
aPosAry.mnDestY = 0;
}
-
+
aPosAry.mnSrcHeight = sal::static_int_cast<long>(aPosAry.mnDestHeight / nScaleY);
}
}
@@ -737,7 +737,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::DrawBitmapEx( const Point& rDestPt,
const BitmapEx& rBitmapEx )
{
- OSL_TRACE( "OutputDevice::DrawBitmapEx()" );
+ DBG_TRACE( "OutputDevice::DrawBitmapEx()" );
if( ImplIsRecordLayout() )
return;
@@ -756,7 +756,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt,
void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const BitmapEx& rBitmapEx )
{
- OSL_TRACE( "OutputDevice::DrawBitmapEx( Size )" );
+ DBG_TRACE( "OutputDevice::DrawBitmapEx( Size )" );
if( ImplIsRecordLayout() )
return;
@@ -773,7 +773,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const BitmapEx& rBitmapEx )
{
- OSL_TRACE( "OutputDevice::DrawBitmapEx( Point, Size )" );
+ DBG_TRACE( "OutputDevice::DrawBitmapEx( Point, Size )" );
if( ImplIsRecordLayout() )
return;
@@ -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 sal_uLong nAction )
+ const BitmapEx& rBitmapEx, const ULONG nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -801,13 +801,13 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
DrawRect( Rectangle( rDestPt, rDestSize ) );
return;
}
- else if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
+ else if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP |
DRAWMODE_GRAYBITMAP | DRAWMODE_GHOSTEDBITMAP ) )
{
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
- Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 4 : 1 );
- sal_uInt8 cCmpVal;
+ Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 4 : 1 );
+ BYTE 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 sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
+ const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
@@ -947,7 +947,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
aPosAry.mnDestHeight == aPosAry.mnSrcHeight )
{
// now intersect dest rect with clip region
- aClipRegionBounds.Intersection( Rectangle( aPosAry.mnDestX,
+ aClipRegionBounds.Intersection( Rectangle( aPosAry.mnDestX,
aPosAry.mnDestY,
aPosAry.mnDestX + aPosAry.mnDestWidth - 1,
aPosAry.mnDestY + aPosAry.mnDestHeight - 1 ) );
@@ -962,7 +962,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
aPosAry.mnSrcY += aClipRegionBounds.Top() - aPosAry.mnDestY;
aPosAry.mnSrcWidth = aClipRegionBounds.GetWidth();
aPosAry.mnSrcHeight = aClipRegionBounds.GetHeight();
-
+
aPosAry.mnDestX = aClipRegionBounds.Left();
aPosAry.mnDestY = aClipRegionBounds.Top();
aPosAry.mnDestWidth = aClipRegionBounds.GetWidth();
@@ -970,13 +970,13 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
}
}
- mpGraphics->DrawBitmap( &aPosAry, *pImpBmp->ImplGetSalBitmap(),
- *pMaskBmp->ImplGetSalBitmap(),
+ mpGraphics->DrawBitmap( &aPosAry, *pImpBmp->ImplGetSalBitmap(),
+ *pMaskBmp->ImplGetSalBitmap(),
this );
// #110958# Paint mask to alpha channel. Luckily, the
// black and white representation of the mask maps to
- // the alpha channel
+ // the alpha channel
// #i25167# Restrict mask painting to _opaque_ areas
// of the mask, otherwise we spoil areas where no
@@ -984,8 +984,8 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
// enough, this can be achieved by taking the mask as
// the transparency mask of itself
if( mpAlphaVDev )
- mpAlphaVDev->DrawBitmapEx( rDestPt,
- rDestSize,
+ mpAlphaVDev->DrawBitmapEx( rDestPt,
+ rDestSize,
BitmapEx( aBmpEx.GetMask(),
aBmpEx.GetMask() ) );
}
@@ -1008,7 +1008,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
void OutputDevice::DrawMask( const Point& rDestPt,
const Bitmap& rBitmap, const Color& rMaskColor )
{
- OSL_TRACE( "OutputDevice::DrawMask()" );
+ DBG_TRACE( "OutputDevice::DrawMask()" );
if( ImplIsRecordLayout() )
return;
@@ -1025,8 +1025,8 @@ void OutputDevice::DrawMask( const Point& rDestPt,
// bitmap content was ever visible. Interestingly
// enough, this can be achieved by taking the mask as
// the transparency mask of itself
- mpAlphaVDev->DrawBitmapEx( rDestPt,
- PixelToLogic( aSizePix ),
+ mpAlphaVDev->DrawBitmapEx( rDestPt,
+ PixelToLogic( aSizePix ),
BitmapEx( rMask, rMask ) );
}
}
@@ -1036,7 +1036,7 @@ void OutputDevice::DrawMask( const Point& rDestPt,
void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap, const Color& rMaskColor )
{
- OSL_TRACE( "OutputDevice::DrawMask( Size )" );
+ DBG_TRACE( "OutputDevice::DrawMask( Size )" );
if( ImplIsRecordLayout() )
return;
@@ -1053,8 +1053,8 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
// bitmap content was ever visible. Interestingly
// enough, this can be achieved by taking the mask as
// the transparency mask of itself
- mpAlphaVDev->DrawBitmapEx( rDestPt,
- rDestSize,
+ mpAlphaVDev->DrawBitmapEx( rDestPt,
+ rDestSize,
BitmapEx( rMask, rMask ) );
}
}
@@ -1065,7 +1065,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor )
{
- OSL_TRACE( "OutputDevice::DrawMask( Point, Size )" );
+ DBG_TRACE( "OutputDevice::DrawMask( Point, Size )" );
if( ImplIsRecordLayout() )
return;
@@ -1082,9 +1082,9 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
// bitmap content was ever visible. Interestingly
// enough, this can be achieved by taking the mask as
// the transparency mask of itself
- mpAlphaVDev->DrawBitmapEx( rDestPt,
- rDestSize,
- rSrcPtPixel,
+ mpAlphaVDev->DrawBitmapEx( rDestPt,
+ rDestSize,
+ rSrcPtPixel,
rSrcSizePixel,
BitmapEx( rMask, rMask ) );
}
@@ -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 sal_uLong nAction )
+ const 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 sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
+ const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
// check if output is necessary
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
@@ -1172,13 +1172,13 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
// ------------------------------------------------------------------
-void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 nStyle )
+void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
-
+
if( !rImage.mpImplData || ImplIsRecordLayout() )
return;
-
+
switch( rImage.mpImplData->meType )
{
case IMAGETYPE_BITMAP:
@@ -1192,7 +1192,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16
if( !pData->mpImageBitmap )
{
const Size aSize( pData->maBmpEx.GetSizePixel() );
-
+
pData->mpImageBitmap = new ImplImageBmp;
pData->mpImageBitmap->Create( pData->maBmpEx, aSize.Width(), aSize.Height(), 1 );
}
@@ -1209,7 +1209,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16
// ------------------------------------------------------------------
void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, sal_uInt16 nStyle )
+ const Image& rImage, USHORT nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
@@ -1220,23 +1220,23 @@ void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
case IMAGETYPE_BITMAP:
DrawBitmap( rPos, rSize, *static_cast< Bitmap* >( rImage.mpImplData->mpData ) );
break;
-
+
case IMAGETYPE_IMAGE:
{
ImplImageData* pData = static_cast< ImplImageData* >( rImage.mpImplData->mpData );
-
+
if ( !pData->mpImageBitmap )
{
const Size aSize( pData->maBmpEx.GetSizePixel() );
-
+
pData->mpImageBitmap = new ImplImageBmp;
pData->mpImageBitmap->Create( pData->maBmpEx, aSize.Width(), aSize.Height(), 1 );
}
-
+
pData->mpImageBitmap->Draw( 0, this, rPos, nStyle, &rSize );
}
break;
-
+
default:
break;
}
@@ -1249,25 +1249,25 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- Bitmap aBmp;
- long nX = ImplLogicXToDevicePixel( rSrcPt.X() );
- long nY = ImplLogicYToDevicePixel( rSrcPt.Y() );
- long nWidth = ImplLogicWidthToDevicePixel( rSize.Width() );
- long nHeight = ImplLogicHeightToDevicePixel( rSize.Height() );
+ Bitmap aBmp;
+ long nX = ImplLogicXToDevicePixel( rSrcPt.X() );
+ long nY = ImplLogicYToDevicePixel( rSrcPt.Y() );
+ long nWidth = ImplLogicWidthToDevicePixel( rSize.Width() );
+ long nHeight = ImplLogicHeightToDevicePixel( rSize.Height() );
if ( mpGraphics || ( (OutputDevice*) this )->ImplGetGraphics() )
{
if ( nWidth && nHeight )
{
- Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- sal_Bool bClipped = sal_False;
+ Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
+ BOOL bClipped = FALSE;
// X-Koordinate ausserhalb des Bereichs?
if ( nX < mnOutOffX )
{
nWidth -= ( mnOutOffX - nX );
nX = mnOutOffX;
- bClipped = sal_True;
+ bClipped = 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 = sal_True;
+ bClipped = TRUE;
}
// Breite ausserhalb des Bereichs?
if ( (nWidth + nX) > (mnOutWidth + mnOutOffX) )
{
- nWidth = mnOutOffX + mnOutWidth - nX;
- bClipped = sal_True;
+ nWidth = mnOutOffX + mnOutWidth - nX;
+ bClipped = TRUE;
}
// Hoehe ausserhalb des Bereichs?
if ( (nHeight + nY) > (mnOutHeight + mnOutOffY) )
{
nHeight = mnOutOffY + mnOutHeight - nY;
- bClipped = sal_True;
+ bClipped = 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 = sal_False;
+ bClipped = FALSE;
}
else
- bClipped = sal_False;
+ bClipped = FALSE;
}
if ( !bClipped )
@@ -1372,8 +1372,8 @@ void OutputDevice::ImplGetFrameBitmap( const Point& rDestPt, const Size& rSize,
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- sal_Bool bOldMap = mbMap;
- ((OutputDevice*)this)->mbMap = sal_False;
+ BOOL bOldMap = mbMap;
+ ((OutputDevice*)this)->mbMap = FALSE;
rBitmap = GetBitmap( rDestPt, rSize );
((OutputDevice*)this)->mbMap = bOldMap;
}
@@ -1393,9 +1393,9 @@ Color OutputDevice::GetPixel( const Point& rPt ) const
if ( !mbOutputClipped )
{
- const long nX = ImplLogicXToDevicePixel( rPt.X() );
- const long nY = ImplLogicYToDevicePixel( rPt.Y() );
- const SalColor aSalCol = mpGraphics->GetPixel( nX, nY, this );
+ const long nX = ImplLogicXToDevicePixel( rPt.X() );
+ const long nY = ImplLogicYToDevicePixel( rPt.Y() );
+ const SalColor aSalCol = mpGraphics->GetPixel( nX, nY, this );
aColor.SetRed( SALCOLOR_RED( aSalCol ) );
aColor.SetGreen( SALCOLOR_GREEN( aSalCol ) );
aColor.SetBlue( SALCOLOR_BLUE( aSalCol ) );
@@ -1410,8 +1410,8 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- Color* pColors = NULL;
- const sal_uInt16 nSize = rPts.GetSize();
+ Color* pColors = NULL;
+ const USHORT nSize = rPts.GetSize();
if( nSize )
{
@@ -1424,11 +1424,11 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
{
pColors = new Color[ nSize ];
- for( sal_uInt16 i = 0; i < nSize; i++ )
+ for( USHORT i = 0; i < nSize; i++ )
{
- Color& rCol = pColors[ i ];
- const Point& rPt = rPts[ i ];
- const SalColor aSalCol( mpGraphics->GetPixel( ImplLogicXToDevicePixel( rPt.X() ),
+ Color& rCol = pColors[ i ];
+ const Point& rPt = rPts[ i ];
+ const SalColor aSalCol( mpGraphics->GetPixel( ImplLogicXToDevicePixel( rPt.X() ),
ImplLogicYToDevicePixel( rPt.Y() ) , this) );
rCol.SetRed( SALCOLOR_RED( aSalCol ) );
@@ -1446,7 +1446,7 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
void OutputDevice::DrawPixel( const Point& rPt )
{
- OSL_TRACE( "OutputDevice::DrawPixel()" );
+ DBG_TRACE( "OutputDevice::DrawPixel()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -1482,12 +1482,12 @@ void OutputDevice::DrawPixel( const Point& rPt )
void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
{
- OSL_TRACE( "OutputDevice::DrawPixel()" );
+ DBG_TRACE( "OutputDevice::DrawPixel()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
- if( mnDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
+ if( mnDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
DRAWMODE_GRAYLINE | DRAWMODE_GHOSTEDLINE |
DRAWMODE_SETTINGSLINE ) )
{
@@ -1503,7 +1503,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1554,16 +1554,16 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
DrawPixel( rPts, GetLineColor() );
else
{
- OSL_TRACE( "OutputDevice::DrawPixel()" );
+ DBG_TRACE( "OutputDevice::DrawPixel()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( pColors, "OutputDevice::DrawPixel: No color array specified" );
- const sal_uInt16 nSize = rPts.GetSize();
+ const USHORT nSize = rPts.GetSize();
if ( nSize )
{
if ( mpMetaFile )
- for ( sal_uInt16 i = 0; i < nSize; i++ )
+ for ( USHORT 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 ( sal_uInt16 i = 0; i < nSize; i++ )
+ for ( USHORT 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 sal_uInt16 nSize = rPts.GetSize();
- Color* pColArray = new Color[ nSize ];
+ const USHORT nSize = rPts.GetSize();
+ Color* pColArray = new Color[ nSize ];
- for( sal_uInt16 i = 0; i < nSize; i++ )
+ for( USHORT i = 0; i < nSize; i++ )
pColArray[ i ] = rColor;
DrawPixel( rPts, pColArray );
@@ -1615,23 +1615,23 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
namespace
{
- sal_uInt8 lcl_calcColor( const sal_uInt8 nSourceColor, const sal_uInt8 nSourceOpaq, const sal_uInt8 nDestColor )
+ BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor )
{
int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) )
+ (int)nSourceOpaq * (int)nSourceColor;
- return sal_uInt8( c / 255 );
+ return BYTE( c / 255 );
}
}
// ------------------------------------------------------------------------
Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
- BitmapReadAccess* pP,
- BitmapReadAccess* pA,
+ BitmapReadAccess* pP,
+ BitmapReadAccess* pA,
const Rectangle& aDstRect,
- const sal_Int32 nOffY,
- const sal_Int32 nDstHeight,
- const sal_Int32 nOffX,
+ const sal_Int32 nOffY,
+ const sal_Int32 nDstHeight,
+ const sal_Int32 nOffX,
const sal_Int32 nDstWidth,
const long* pMapX,
const long* pMapY )
@@ -1643,18 +1643,18 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
OSL_ENSURE(mpAlphaVDev,
"ImplBlendWithAlpha(): call me only with valid alpha VDev!" );
- sal_Bool bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
- mpAlphaVDev->EnableMapMode(sal_False);
+ BOOL bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
+ mpAlphaVDev->EnableMapMode(FALSE);
Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
- BitmapWriteAccess* pAlphaW = aAlphaBitmap.AcquireWriteAccess();
+ BitmapWriteAccess* pAlphaW = aAlphaBitmap.AcquireWriteAccess();
if( GetBitCount() <= 8 )
{
- Bitmap aDither( aBmp.GetSizePixel(), 8 );
- BitmapColor aIndex( 0 );
- BitmapReadAccess* pB = aBmp.AcquireReadAccess();
- BitmapWriteAccess* pW = aDither.AcquireWriteAccess();
+ Bitmap aDither( aBmp.GetSizePixel(), 8 );
+ BitmapColor aIndex( 0 );
+ BitmapReadAccess* pB = aBmp.AcquireReadAccess();
+ BitmapWriteAccess* pW = aDither.AcquireWriteAccess();
if( pB && pP && pA && pW && pAlphaW )
{
@@ -1665,19 +1665,19 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
- const long nMapX = pMapX[ nX ];
- const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const long nMapX = pMapX[ nX ];
+ const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE 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( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (BYTE) ( 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 sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
- aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] ) );
pAlphaW->SetPixel( nY, nX, aIndex );
@@ -1702,12 +1702,12 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
}
else
{
- BitmapWriteAccess* pB = aBmp.AcquireWriteAccess();
+ BitmapWriteAccess* pB = aBmp.AcquireWriteAccess();
if( pP && pA && pB )
{
for( nY = 0; nY < nDstHeight; nY++ )
{
- const long nMapY = pMapY[ nY ];
+ const long nMapY = pMapY[ nY ];
for( nX = 0; nX < nDstWidth; nX++ )
{
@@ -1715,8 +1715,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE 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 sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) );
}
@@ -1749,13 +1749,13 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// ------------------------------------------------------------------------
Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
- BitmapReadAccess* pP,
- BitmapReadAccess* pA,
- const sal_Int32 nOffY,
- const sal_Int32 nDstHeight,
- const sal_Int32 nOffX,
+ BitmapReadAccess* pP,
+ BitmapReadAccess* pA,
+ const sal_Int32 nOffY,
+ const sal_Int32 nDstHeight,
+ const sal_Int32 nOffX,
const sal_Int32 nDstWidth,
- const Rectangle& aBmpRect,
+ const Rectangle& aBmpRect,
const Size& aOutSz,
const bool bHMirr,
const bool bVMirr,
@@ -1768,10 +1768,10 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
if( GetBitCount() <= 8 )
{
- Bitmap aDither( aBmp.GetSizePixel(), 8 );
- BitmapColor aIndex( 0 );
- BitmapReadAccess* pB = aBmp.AcquireReadAccess();
- BitmapWriteAccess* pW = aDither.AcquireWriteAccess();
+ Bitmap aDither( aBmp.GetSizePixel(), 8 );
+ BitmapColor aIndex( 0 );
+ BitmapReadAccess* pB = aBmp.AcquireReadAccess();
+ BitmapWriteAccess* pW = aDither.AcquireWriteAccess();
if( pB && pP && pA && pW )
{
@@ -1782,12 +1782,12 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
- const long nMapX = pMapX[ nX ];
- const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const long nMapX = pMapX[ nX ];
+ const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aDstCol = pB->GetColor( nY, nX );
- aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (sal_uInt8) pA->GetPixel( nMapY, nMapX ) );
- aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (BYTE) pA->GetPixel( nMapY, nMapX ) );
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
@@ -1801,7 +1801,7 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
}
else
{
- BitmapWriteAccess* pB = aBmp.AcquireWriteAccess();
+ BitmapWriteAccess* pB = aBmp.AcquireWriteAccess();
bool bFastBlend = false;
if( pP && pA && pB )
@@ -1828,9 +1828,9 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
{
for( nY = 0; nY < nDstHeight; nY++ )
{
- const long nMapY = pMapY[ nY ];
- Scanline pPScan = pP->GetScanline( nMapY );
- Scanline pAScan = pA->GetScanline( nMapY );
+ const long nMapY = pMapY[ nY ];
+ Scanline pPScan = pP->GetScanline( nMapY );
+ Scanline pAScan = pA->GetScanline( nMapY );
for( nX = 0; nX < nDstWidth; nX++ )
{
@@ -1847,14 +1847,14 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
{
for( nY = 0; nY < nDstHeight; nY++ )
{
- const long nMapY = pMapY[ nY ];
- Scanline pPScan = pP->GetScanline( nMapY );
- Scanline pAScan = pA->GetScanline( nMapY );
+ const long nMapY = pMapY[ nY ];
+ Scanline pPScan = pP->GetScanline( nMapY );
+ Scanline pAScan = pA->GetScanline( nMapY );
for( nX = 0; nX < nDstWidth; nX++ )
{
- const long nMapX = pMapX[ nX ];
- Scanline pTmp = pPScan + nMapX * 3;
+ const long nMapX = pMapX[ nX ];
+ Scanline pTmp = pPScan + nMapX * 3;
aDstCol = pB->GetPixel( nY, nX );
pB->SetPixel( nY, nX, aDstCol.Merge( pTmp[ 2 ], pTmp[ 1 ], pTmp[ 0 ],
@@ -1868,13 +1868,13 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
{
for( nY = 0; nY < nDstHeight; nY++ )
{
- const long nMapY = pMapY[ nY ];
- Scanline pPScan = pP->GetScanline( nMapY );
- Scanline pAScan = pA->GetScanline( nMapY );
+ const long nMapY = pMapY[ nY ];
+ Scanline pPScan = pP->GetScanline( nMapY );
+ Scanline pAScan = pA->GetScanline( nMapY );
for( nX = 0; nX < nDstWidth; nX++ )
{
- const long nMapX = pMapX[ nX ];
+ const long nMapX = pMapX[ nX ];
Scanline pTmp = pPScan + nMapX * 3;
aDstCol = pB->GetPixel( nY, nX );
@@ -1889,8 +1889,8 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
{
for( nY = 0; nY < nDstHeight; nY++ )
{
- const long nMapY = pMapY[ nY ];
- Scanline pAScan = pA->GetScanline( nMapY );
+ const long nMapY = pMapY[ nY ];
+ Scanline pAScan = pA->GetScanline( nMapY );
for( nX = 0; nX < nDstWidth; nX++ )
{
@@ -1919,10 +1919,10 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rSrcPtPixel, const Size& rSrcSizePixel )
{
const Point aNullPt;
- Point aOutPt( LogicToPixel( rDestPt ) );
+ Point aOutPt( LogicToPixel( rDestPt ) );
Size aOutSz( LogicToPixel( rDestSize ) );
- Rectangle aDstRect( aNullPt, GetOutputSizePixel() );
- const sal_Bool bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
+ Rectangle aDstRect( aNullPt, GetOutputSizePixel() );
+ const BOOL bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
if( OUTDEV_WINDOW == meOutDevType )
{
@@ -1950,7 +1950,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
static const char* pDisableNative = getenv( "SAL_DISABLE_NATIVE_ALPHA");
// #i83087# Naturally, system alpha blending cannot work with
// separate alpha VDev
- if( !mpAlphaVDev && !pDisableNative && !bHMirr && !bVMirr )
+ if( !mpAlphaVDev && !pDisableNative && !bHMirr && !bVMirr )
{
Point aRelPt = aOutPt + Point( mnOutOffX, mnOutOffY );
SalTwoRect aTR = {
@@ -1968,11 +1968,11 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
Rectangle aBmpRect( aNullPt, rBmp.GetSizePixel() );
if( !bNativeAlpha
- && !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
+ && !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
{
- GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = NULL;
- const sal_Bool bOldMap = mbMap; mbMap = sal_False;
- Bitmap aBmp( GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
+ GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = NULL;
+ const BOOL bOldMap = mbMap; mbMap = FALSE;
+ Bitmap aBmp( GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
// #109044# The generated bitmap need not necessarily be
// of aDstRect dimensions, it's internally clipped to
@@ -1983,24 +1983,24 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
if( aBmp.ImplGetImpBitmap() )
aDstRect.SetSize( aBmp.GetSizePixel() );
- BitmapColor aDstCol;
- const long nSrcWidth = aBmpRect.GetWidth(), nSrcHeight = aBmpRect.GetHeight();
- const long nDstWidth = aDstRect.GetWidth(), nDstHeight = aDstRect.GetHeight();
- const long nOutWidth = aOutSz.Width(), nOutHeight = aOutSz.Height();
+ BitmapColor aDstCol;
+ const long nSrcWidth = aBmpRect.GetWidth(), nSrcHeight = aBmpRect.GetHeight();
+ const long nDstWidth = aDstRect.GetWidth(), nDstHeight = aDstRect.GetHeight();
+ const long nOutWidth = aOutSz.Width(), nOutHeight = aOutSz.Height();
// calculate offset in original bitmap
// in RTL case this is a little more complicated since the contents of the
// bitmap is not mirrored (it never is), however the paint region and bmp region
// are in mirrored coordinates, so the intersection of (aOutPt,aOutSz) with these
// is content wise somewhere else and needs to take mirroring into account
- const long nOffX = IsRTLEnabled()
+ const long nOffX = IsRTLEnabled()
? aOutSz.Width() - aDstRect.GetWidth() - (aDstRect.Left() - aOutPt.X())
: aDstRect.Left() - aOutPt.X(),
nOffY = aDstRect.Top() - aOutPt.Y();
- long nX, nOutX, nY, nOutY;
- long nMirrOffX = 0;
- long nMirrOffY = 0;
- long* pMapX = new long[ nDstWidth ];
- long* pMapY = new long[ nDstHeight ];
+ long nX, nOutX, nY, nOutY;
+ long nMirrOffX = 0;
+ long nMirrOffY = 0;
+ long* pMapX = new long[ nDstWidth ];
+ long* pMapY = new long[ nDstHeight ];
// create horizontal mapping table
if( bHMirr )
@@ -2012,7 +2012,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
if( bHMirr )
pMapX[ nX ] = nMirrOffX - pMapX[ nX ];
}
-
+
// create vertical mapping table
if( bVMirr )
nMirrOffY = ( aBmpRect.Top() << 1 ) + nSrcHeight - 1;
@@ -2025,11 +2025,11 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
pMapY[ nY ] = nMirrOffY - pMapY[ nY ];
}
- BitmapReadAccess* pP = ( (Bitmap&) rBmp ).AcquireReadAccess();
- BitmapReadAccess* pA = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
+ BitmapReadAccess* pP = ( (Bitmap&) rBmp ).AcquireReadAccess();
+ BitmapReadAccess* pA = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
DBG_ASSERT( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ||
- pA->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK,
+ pA->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK,
"OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!" );
// #i38887# reading from screen may sometimes fail
@@ -2062,13 +2062,13 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
if( mpAlphaVDev )
mpAlphaVDev = NULL;
- DrawBitmap( aDstRect.TopLeft(),
+ DrawBitmap( aDstRect.TopLeft(),
aTmp );
// #110958# Enable alpha VDev again
mpAlphaVDev = pOldVDev;
}
-
+
( (Bitmap&) rBmp ).ReleaseAccess( pP );
( (AlphaMask&) rAlpha ).ReleaseAccess( pA );
@@ -2086,17 +2086,17 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel )
{
- Point aPt;
- Point aDestPt( LogicToPixel( rDestPt ) );
- Size aDestSz( LogicToPixel( rDestSize ) );
- Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
+ Point aPt;
+ Point aDestPt( LogicToPixel( rDestPt ) );
+ Size aDestSz( LogicToPixel( rDestSize ) );
+ Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
aSrcRect.Justify();
if( !rBmp.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
- Bitmap aPaint( rBmp ), aMask( rMask );
- sal_uLong nMirrFlags = 0UL;
+ Bitmap aPaint( rBmp ), aMask( rMask );
+ ULONG nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2139,13 +2139,13 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
}
// do painting
- const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
- long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
- long* pMapX = new long[ nSrcWidth + 1 ];
- long* pMapY = new long[ nSrcHeight + 1 ];
- const sal_Bool bOldMap = mbMap;
+ const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
+ long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
+ long* pMapX = new long[ nSrcWidth + 1 ];
+ long* pMapY = new long[ nSrcHeight + 1 ];
+ const BOOL bOldMap = mbMap;
- mbMap = sal_False;
+ mbMap = FALSE;
// create forward mapping tables
for( nX = 0L; nX <= nSrcWidth; nX++ )
@@ -2153,11 +2153,11 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
for( nY = 0L; nY <= nSrcHeight; nY++ )
pMapY[ nY ] = aDestPt.Y() + FRound( (double) aDestSz.Height() * nY / nSrcHeight );
-
+
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
- ImplRegionInfo aInfo;
- sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ ImplRegionInfo aInfo;
+ BOOL bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
while( bRgnRect )
{
@@ -2165,7 +2165,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
const Rectangle aBandRect( Point( nWorkX, nWorkY ), Size( nWorkWidth, nWorkHeight ) );
const Point aMapPt( pMapX[ nWorkX ], pMapY[ nWorkY ] );
const Size aMapSz( pMapX[ nWorkX + nWorkWidth ] - aMapPt.X(), pMapY[ nWorkY + nWorkHeight ] - aMapPt.Y() );
-
+
aBandBmp.Crop( aBandRect );
ImplDrawBitmap( aMapPt, aMapSz, Point(), aBandBmp.GetSizePixel(), aBandBmp, META_BMPSCALEPART_ACTION );
bRgnRect = aWorkRgn.ImplGetNextRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
@@ -2184,17 +2184,17 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel )
{
- Point aPt;
- Point aDestPt( LogicToPixel( rDestPt ) );
- Size aDestSz( LogicToPixel( rDestSize ) );
- Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
+ Point aPt;
+ Point aDestPt( LogicToPixel( rDestPt ) );
+ Size aDestSz( LogicToPixel( rDestSize ) );
+ Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
aSrcRect.Justify();
if( !rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
- Bitmap aMask( rMask );
- sal_uLong nMirrFlags = 0UL;
+ Bitmap aMask( rMask );
+ ULONG nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2224,15 +2224,15 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
aMask.Mirror( nMirrFlags );
// do painting
- const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
- long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
- long* pMapX = new long[ nSrcWidth + 1 ];
- long* pMapY = new long[ nSrcHeight + 1 ];
+ const long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight();
+ long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
+ long* pMapX = new long[ nSrcWidth + 1 ];
+ long* pMapY = new long[ nSrcHeight + 1 ];
GDIMetaFile* pOldMetaFile = mpMetaFile;
- const sal_Bool bOldMap = mbMap;
+ const BOOL bOldMap = mbMap;
mpMetaFile = NULL;
- mbMap = sal_False;
+ mbMap = FALSE;
Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
SetLineColor( rMaskColor );
SetFillColor( rMaskColor );
@@ -2245,11 +2245,11 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
for( nY = 0L; nY <= nSrcHeight; nY++ )
pMapY[ nY ] = aDestPt.Y() + FRound( (double) aDestSz.Height() * nY / nSrcHeight );
-
+
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
- ImplRegionInfo aInfo;
- sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ ImplRegionInfo aInfo;
+ 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 f0110047db5c..96bfab559360 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,57 +28,56 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
-#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"
+#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>
#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.hpp"
-#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.hdl>
+#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
@@ -88,7 +87,7 @@
#define GLYPH_FONT_HEIGHT 256
#endif
-#include "sal/alloca.h"
+#include <sal/alloca.h>
#include <cmath>
#include <cstring>
@@ -226,7 +225,7 @@ void OutputDevice::ImplUpdateFontData( bool bNewFontLists )
if( mpFontCache && mpFontCache != pSVData->maGDIData.mpScreenFontCache )
delete mpFontCache;
mpFontList = mpPDFWriter->filterDevFontList( pSVData->maGDIData.mpScreenFontList );
- mpFontCache = new ImplFontCache( sal_False );
+ mpFontCache = new ImplFontCache( FALSE );
}
else
{
@@ -318,7 +317,7 @@ void ImplFreeOutDevFontData()
void OutputDevice::BeginFontSubstitution()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maGDIData.mbFontSubChanged = sal_False;
+ pSVData->maGDIData.mbFontSubChanged = FALSE;
}
// -----------------------------------------------------------------------
@@ -334,7 +333,7 @@ void OutputDevice::EndFontSubstitution()
DataChangedEvent aDCEvt( DATACHANGED_FONTSUBSTITUTION );
pApp->DataChanged( aDCEvt );
pApp->NotifyAllWindows( aDCEvt );
- pSVData->maGDIData.mbFontSubChanged = sal_False;
+ pSVData->maGDIData.mbFontSubChanged = FALSE;
}
}
@@ -342,19 +341,19 @@ void OutputDevice::EndFontSubstitution()
void OutputDevice::AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
ImplDirectFontSubstitution*& rpSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !rpSubst )
rpSubst = new ImplDirectFontSubstitution();
rpSubst->AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
- ImplGetSVData()->maGDIData.mbFontSubChanged = sal_True;
+ ImplGetSVData()->maGDIData.mbFontSubChanged = TRUE;
}
// -----------------------------------------------------------------------
void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
- const String& rSubstFontName, sal_uInt16 nFlags )
+ const String& rSubstFontName, USHORT nFlags )
{
maFontSubstList.push_back( ImplFontSubstEntry( rFontName, rSubstFontName, nFlags ) );
}
@@ -362,7 +361,7 @@ void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
// -----------------------------------------------------------------------
ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
- const String& rSubstFontName, sal_uInt16 nSubstFlags )
+ const String& rSubstFontName, USHORT nSubstFlags )
: maName( rFontName )
, maReplaceName( rSubstFontName )
, mnFlags( nSubstFlags )
@@ -377,7 +376,7 @@ ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
ImplInitOutDevData();
mpOutDevData->maDevFontSubst.AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
@@ -385,7 +384,7 @@ void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
// -----------------------------------------------------------------------
-void OutputDevice::RemoveFontSubstitute( sal_uInt16 n )
+void OutputDevice::RemoveFontSubstitute( USHORT n )
{
ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -404,21 +403,21 @@ void ImplDirectFontSubstitution::RemoveFontSubstitute( int nIndex )
// -----------------------------------------------------------------------
-sal_uInt16 OutputDevice::GetFontSubstituteCount()
+USHORT OutputDevice::GetFontSubstituteCount()
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !pSubst )
return 0;
int nCount = pSubst->GetFontSubstituteCount();
- return (sal_uInt16)nCount;
+ return (USHORT)nCount;
}
// -----------------------------------------------------------------------
-void OutputDevice::GetFontSubstitute( sal_uInt16 n,
+void OutputDevice::GetFontSubstitute( USHORT n,
XubString& rFontName,
XubString& rReplaceFontName,
- sal_uInt16& rFlags )
+ USHORT& rFlags )
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -428,10 +427,10 @@ void OutputDevice::GetFontSubstitute( sal_uInt16 n,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
- String& rFontName, String& rSubstFontName, sal_uInt16& rFlags ) const
+ String& rFontName, String& rSubstFontName, USHORT& rFlags ) const
{
FontSubstList::const_iterator it = maFontSubstList.begin();
- for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
+ for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
if( it == maFontSubstList.end() )
return false;
@@ -445,7 +444,7 @@ bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
- const String& rSearchName, sal_uInt16 nFlags ) const
+ const String& rSearchName, USHORT nFlags ) const
{
// TODO: get rid of O(N) searches
FontSubstList::const_iterator it = maFontSubstList.begin();
@@ -466,7 +465,7 @@ bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
// -----------------------------------------------------------------------
static void ImplFontSubstitute( String& rFontName,
- sal_uInt16 nFlags, ImplDirectFontSubstitution* pDevSpecific )
+ USHORT nFlags, ImplDirectFontSubstitution* pDevSpecific )
{
#ifdef DBG_UTIL
String aTempName = rFontName;
@@ -497,10 +496,10 @@ static void ImplFontSubstitute( String& rFontName,
// -----------------------------------------------------------------------
-Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
- sal_uLong nFlags, const OutputDevice* pOutDev )
+Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
+ ULONG nFlags, const OutputDevice* pOutDev )
{
- OSL_TRACE( "OutputDevice::GetDefaultFont()" );
+ DBG_TRACE( "OutputDevice::GetDefaultFont()" );
com::sun::star::lang::Locale aLocale;
if( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW )
@@ -559,7 +558,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
case DEFAULTFONT_CJK_SPREADSHEET:
case DEFAULTFONT_CJK_HEADING:
case DEFAULTFONT_CJK_DISPLAY:
- aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
+ aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
break;
case DEFAULTFONT_CTL_TEXT:
@@ -567,7 +566,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
case DEFAULTFONT_CTL_SPREADSHEET:
case DEFAULTFONT_CTL_HEADING:
case DEFAULTFONT_CTL_DISPLAY:
- aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
+ aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
break;
}
@@ -608,10 +607,10 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
// No Name, than set all names
if ( !aFont.GetName().Len() )
{
+ xub_StrLen nIndex = 0;
if ( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
{
- xub_StrLen nIndex = 0;
-
+ //aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
if( !pOutDev )
pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin;
if( !pOutDev )
@@ -655,35 +654,35 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
const char* s = "DEFAULTFONT_SANS_UNKNOWN";
switch ( nType )
{
- case DEFAULTFONT_SANS_UNICODE: s = "DEFAULTFONT_SANS_UNICODE"; break;
- case DEFAULTFONT_UI_SANS: s = "DEFAULTFONT_UI_SANS"; break;
+ case DEFAULTFONT_SANS_UNICODE: s = "DEFAULTFONT_SANS_UNICODE"; break;
+ case DEFAULTFONT_UI_SANS: s = "DEFAULTFONT_UI_SANS"; break;
- case DEFAULTFONT_SANS: s = "DEFAULTFONT_SANS"; break;
- case DEFAULTFONT_LATIN_HEADING: s = "DEFAULTFONT_LATIN_HEADING"; break;
- case DEFAULTFONT_LATIN_SPREADSHEET: s = "DEFAULTFONT_LATIN_SPREADSHEET"; break;
- case DEFAULTFONT_LATIN_DISPLAY: s = "DEFAULTFONT_LATIN_DISPLAY"; break;
+ case DEFAULTFONT_SANS: s = "DEFAULTFONT_SANS"; break;
+ case DEFAULTFONT_LATIN_HEADING: s = "DEFAULTFONT_LATIN_HEADING"; break;
+ case DEFAULTFONT_LATIN_SPREADSHEET: s = "DEFAULTFONT_LATIN_SPREADSHEET"; break;
+ case DEFAULTFONT_LATIN_DISPLAY: s = "DEFAULTFONT_LATIN_DISPLAY"; break;
- case DEFAULTFONT_SERIF: s = "DEFAULTFONT_SERIF"; break;
- case DEFAULTFONT_LATIN_TEXT: s = "DEFAULTFONT_LATIN_TEXT"; break;
- case DEFAULTFONT_LATIN_PRESENTATION: s = "DEFAULTFONT_LATIN_PRESENTATION"; break;
+ case DEFAULTFONT_SERIF: s = "DEFAULTFONT_SERIF"; break;
+ case DEFAULTFONT_LATIN_TEXT: s = "DEFAULTFONT_LATIN_TEXT"; break;
+ case DEFAULTFONT_LATIN_PRESENTATION: s = "DEFAULTFONT_LATIN_PRESENTATION"; break;
- case DEFAULTFONT_FIXED: s = "DEFAULTFONT_FIXED"; break;
- case DEFAULTFONT_LATIN_FIXED: s = "DEFAULTFONT_LATIN_FIXED"; break;
- case DEFAULTFONT_UI_FIXED: s = "DEFAULTFONT_UI_FIXED"; break;
+ case DEFAULTFONT_FIXED: s = "DEFAULTFONT_FIXED"; break;
+ case DEFAULTFONT_LATIN_FIXED: s = "DEFAULTFONT_LATIN_FIXED"; break;
+ case DEFAULTFONT_UI_FIXED: s = "DEFAULTFONT_UI_FIXED"; break;
- case DEFAULTFONT_SYMBOL: s = "DEFAULTFONT_SYMBOL"; break;
+ case DEFAULTFONT_SYMBOL: s = "DEFAULTFONT_SYMBOL"; break;
- case DEFAULTFONT_CJK_TEXT: s = "DEFAULTFONT_CJK_TEXT"; break;
- case DEFAULTFONT_CJK_PRESENTATION: s = "DEFAULTFONT_CJK_PRESENTATION"; break;
- case DEFAULTFONT_CJK_SPREADSHEET: s = "DEFAULTFONT_CJK_SPREADSHEET"; break;
- case DEFAULTFONT_CJK_HEADING: s = "DEFAULTFONT_CJK_HEADING"; break;
- case DEFAULTFONT_CJK_DISPLAY: s = "DEFAULTFONT_CJK_DISPLAY"; break;
+ case DEFAULTFONT_CJK_TEXT: s = "DEFAULTFONT_CJK_TEXT"; break;
+ case DEFAULTFONT_CJK_PRESENTATION: s = "DEFAULTFONT_CJK_PRESENTATION"; break;
+ case DEFAULTFONT_CJK_SPREADSHEET: s = "DEFAULTFONT_CJK_SPREADSHEET"; break;
+ case DEFAULTFONT_CJK_HEADING: s = "DEFAULTFONT_CJK_HEADING"; break;
+ case DEFAULTFONT_CJK_DISPLAY: s = "DEFAULTFONT_CJK_DISPLAY"; break;
- case DEFAULTFONT_CTL_TEXT: s = "DEFAULTFONT_CTL_TEXT"; break;
- case DEFAULTFONT_CTL_PRESENTATION: s = "DEFAULTFONT_CTL_PRESENTATION"; break;
- case DEFAULTFONT_CTL_SPREADSHEET: s = "DEFAULTFONT_CTL_SPREADSHEET"; break;
- case DEFAULTFONT_CTL_HEADING: s = "DEFAULTFONT_CTL_HEADING"; break;
- case DEFAULTFONT_CTL_DISPLAY: s = "DEFAULTFONT_CTL_DISPLAY"; break;
+ case DEFAULTFONT_CTL_TEXT: s = "DEFAULTFONT_CTL_TEXT"; break;
+ case DEFAULTFONT_CTL_PRESENTATION: s = "DEFAULTFONT_CTL_PRESENTATION"; break;
+ case DEFAULTFONT_CTL_SPREADSHEET: s = "DEFAULTFONT_CTL_SPREADSHEET"; break;
+ case DEFAULTFONT_CTL_HEADING: s = "DEFAULTFONT_CTL_HEADING"; break;
+ case DEFAULTFONT_CTL_DISPLAY: s = "DEFAULTFONT_CTL_DISPLAY"; break;
}
fprintf( stderr, " OutputDevice::GetDefaultFont() Type=\"%s\" lang=%d flags=%ld FontName=\"%s\"\n",
s, eLang, nFlags,
@@ -731,7 +730,7 @@ static unsigned ImplIsCJKFont( const String& rFontName )
// -----------------------------------------------------------------------
-static void ImplCalcType( sal_uLong& rType, FontWeight& rWeight, FontWidth& rWidth,
+static void ImplCalcType( ULONG& rType, FontWeight& rWeight, FontWidth& rWidth,
FontFamily eFamily, const FontNameAttr* pFontAttr )
{
if ( eFamily != FAMILY_DONTKNOW )
@@ -997,8 +996,8 @@ ImplFontEntry::~ImplFontEntry()
size_t ImplFontEntry::GFBCacheKey_Hash::operator()( const GFBCacheKey& rData ) const
{
- boost::hash<sal_UCS4> a;
- boost::hash<int > b;
+ std::hash<sal_UCS4> a;
+ std::hash<int > b;
return a(rData.first) ^ b(rData.second);
}
@@ -1323,11 +1322,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", "liberationsans", "",
+ "tahoma", "dejavusans", "timesnewroman", "lucidatypewriter", "lucidasans", "nimbussansl", "",
"shree", "mangal", "",
"raavi", "shruti", "tunga", "",
"latha", "gautami", "kartika", "vrinda", "",
- "shayyalmt", "naskmt", "scheherazade", "",
+ "shayyalmt", "naskmt", "",
"david", "nachlieli", "lucidagrande", "",
"norasi", "angsanaupc", "",
"khmerossystem", "",
@@ -1377,7 +1376,6 @@ 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
@@ -1393,6 +1391,15 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
break;
pFallbackList[ j+1 ] = pTestFont;
}
+
+#if defined(HDU_DEBUG)
+ for( int i = 0; i < nMaxLevel; ++i )
+ {
+ ImplDevFontListData* pFont = pFallbackList[ i ];
+ ByteString aFontName( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
+ fprintf( stderr, "GlyphFallbackFont[%d] (quality=%05d): \"%s\"\n",
+ i, pFont->GetMinQuality(), aFontName.GetBuffer() );
+ }
#endif
mnFallbackCount = nMaxLevel;
@@ -1634,25 +1641,10 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
pFoundData = ImplFindBySearchName( aSearchName );
if( 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;
+ break;
}
- return NULL;
+ return pFoundData;
}
// -----------------------------------------------------------------------
@@ -1678,20 +1670,20 @@ void ImplDevFontList::InitMatchData() const
}
//----------------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const
+ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const
{
// get the default font for a specified locale
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
- const String aDefault = rDefaults.getUserInterfaceFont( rLocale );
+ String aDefault = rDefaults.getUserInterfaceFont( lc );
ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault );
if( pFontData )
return pFontData;
- return NULL;
+ return 0;
}
// -----------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchType,
+ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
FontWeight eSearchWeight, FontWidth eSearchWidth, FontFamily /*eSearchFamily*/,
FontItalic eSearchItalic, const String& rSearchFamilyName ) const
{
@@ -1709,7 +1701,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchTyp
long nTestMatch;
long nBestMatch = 40000;
- sal_uLong nBestType = 0;
+ ULONG nBestType = 0;
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
@@ -1717,7 +1709,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchTyp
ImplDevFontListData* pData = (*it).second;
// Get all information about the matching font
- sal_uLong nMatchType = pData->mnMatchType;
+ ULONG nMatchType = pData->mnMatchType;
FontWeight eMatchWeight= pData->meMatchWeight;
FontWidth eMatchWidth = pData->meMatchWidth;
@@ -2428,7 +2420,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
// test if a font in the token list is available
// substitute the font if this was requested
- sal_uInt16 nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
+ USHORT nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
if ( bPrinter )
nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY;
@@ -2557,7 +2549,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aSearchFamilyName;
FontWeight eSearchWeight = rFSD.meWeight;
FontWidth eSearchWidth = rFSD.meWidthType;
- sal_uLong nSearchType = 0;
+ ULONG nSearchType = 0;
FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
@@ -2629,7 +2621,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aTempShortName;
String aTempFamilyName;
- sal_uLong nTempType = 0;
+ ULONG nTempType = 0;
FontWeight eTempWeight = rFSD.meWeight;
FontWidth eTempWidth = WIDTH_DONTKNOW;
FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
@@ -2741,20 +2733,8 @@ ImplFontEntry* ImplFontCache::GetGlyphFallbackFont( ImplDevFontList* pFontList,
// e.g. PsPrint Arial->Helvetica for udiaeresis when Helvetica doesn't support it
if( nFallbackLevel >= 1)
{
- ImplDevFontListData* pFallbackData = NULL;
-
- //fdo#33898 If someone has EUDC installed then they really want that to
- //be used as the first-choice glyph fallback seeing as it's filled with
- //private area codes with don't make any sense in any other font so
- //prioritise it here if it's available. Ideally we would remove from
- //rMissingCodes all the glyphs which it is able to resolve as an
- //optimization, but that's tricky to achieve cross-platform without
- //sufficient heavy-weight code that's likely to undo the value of the
- //optimization
- if (nFallbackLevel == 1)
- pFallbackData = pFontList->FindFontFamily(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUDC")));
- if (!pFallbackData)
- pFallbackData = pFontList->GetGlyphFallbackFont(rFontSelData, rMissingCodes, nFallbackLevel-1);
+ ImplDevFontListData* pFallbackData = pFontList->GetGlyphFallbackFont(
+ rFontSelData, rMissingCodes, nFallbackLevel-1 );
// escape when there are no font candidates
if( !pFallbackData )
return NULL;
@@ -2901,17 +2881,17 @@ FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( const Font& rFont )
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
+BOOL OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
{
if ( !rFont.IsVertical() )
- return sal_False;
+ return FALSE;
if( (LANGUAGE_JAPANESE == rFont.GetLanguage())
|| (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()) )
// the underline is right for Japanese only
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -2926,18 +2906,6 @@ 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 );
- }
}
// =======================================================================
@@ -2976,7 +2944,7 @@ void OutputDevice::ImplInitTextColor()
if ( mbInitTextColor )
{
mpGraphics->SetTextColor( ImplColorToSal( GetTextColor() ) );
- mbInitTextColor = sal_False;
+ mbInitTextColor = FALSE;
}
}
@@ -3033,9 +3001,9 @@ bool OutputDevice::ImplNewFont() const
ImplFontEntry* pFontEntry = mpFontEntry;
// mark when lower layers need to get involved
- mbNewFont = sal_False;
+ mbNewFont = FALSE;
if( pFontEntry != pOldEntry )
- mbInitFont = sal_True;
+ mbInitFont = TRUE;
// select font when it has not been initialized yet
if ( !pFontEntry->mbInit )
@@ -3136,10 +3104,10 @@ bool OutputDevice::ImplNewFont() const
{
Size aOrigSize = maFont.GetSize();
const_cast<Font&>(maFont).SetSize( Size( nNewWidth, aSize.Height() ) );
- mbMap = sal_False;
- mbNewFont = sal_True;
+ mbMap = FALSE;
+ mbNewFont = TRUE;
ImplNewFont(); // recurse once using stretched width
- mbMap = sal_True;
+ mbMap = TRUE;
const_cast<Font&>(maFont).SetSize( aOrigSize );
}
}
@@ -3159,17 +3127,17 @@ long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth, long nHeight )
+ long nX, long nY, 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;
@@ -3197,11 +3165,12 @@ 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 );
@@ -3211,8 +3180,6 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
}
}
- nX += nBaseX;
- nY += nBaseY;
mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
}
@@ -3228,12 +3195,12 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) );
- mbInitFillColor = sal_True;
+ mbInitFillColor = TRUE;
- ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent),
+ ImplDrawTextRect( nX, nY, nX, nY-mpFontEntry->maMetric.mnAscent-mnEmphasisAscent,
nWidth,
mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent );
}
@@ -3299,7 +3266,7 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
mnWidth = rFontSelData.mnWidth;
mnOrientation = sal::static_int_cast<short>(rFontSelData.mnOrientation);
- // intialize the used font name
+ // intialize the used font name
if( rFontSelData.mpFontData )
{
maName = rFontSelData.mpFontData->maName;
@@ -3316,7 +3283,7 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
mbKernableFont = false;
}
- // reset metrics that are usually measured for the font instance
+ // reset metrics that are usually measured for the font instance
mnAscent = 0;
mnDescent = 0;
mnIntLeading = 0;
@@ -3497,7 +3464,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
short nOrientation,
SalGraphics* pGraphics,
OutputDevice* pOutDev,
- sal_Bool bDrawPixAsRect,
+ BOOL bDrawPixAsRect,
long nPixWidth, long nPixHeight )
{
@@ -3518,7 +3485,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
- long nDistX, long nDistY,
+ long nStartX, long nStartY,
long nWidth, long nHeight,
long nLineWidth, short nOrientation,
const Color& rColor )
@@ -3526,14 +3493,11 @@ 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 = sal_True;
+ mbInitLineColor = TRUE;
long nEndX = nStartX+nWidth;
long nEndY = nStartY;
@@ -3543,37 +3507,42 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation );
}
mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
+
}
else
{
long nCurX = nStartX;
long nCurY = nStartY;
+ long nDiffX = 2;
long nDiffY = nHeight-1;
long nCount = nWidth;
+ long nOffY = -1;
+ long nFreq;
+ long i;
long nPixWidth;
long nPixHeight;
- sal_Bool bDrawPixAsRect;
+ BOOL bDrawPixAsRect;
// Auf Druckern die Pixel per DrawRect() ausgeben
if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
{
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( rColor ) );
- mbInitFillColor = sal_True;
- bDrawPixAsRect = sal_True;
+ mbInitFillColor = TRUE;
+ bDrawPixAsRect = TRUE;
nPixWidth = nLineWidth;
nPixHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
}
else
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
nPixWidth = 1;
nPixHeight = 1;
- bDrawPixAsRect = sal_False;
+ bDrawPixAsRect = FALSE;
}
if ( !nDiffY )
@@ -3589,11 +3558,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
}
else
{
- long nDiffX = 2;
- long nOffY = -1;
- long i;
nCurY += nDiffY;
- long nFreq = nCount / (nDiffX+nDiffY);
+ nFreq = nCount / (nDiffX+nDiffY);
while ( nFreq-- )
{
for( i = nDiffY; i; --i )
@@ -3641,10 +3607,10 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth,
+ long nX, long nY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- sal_Bool bIsAbove )
+ BOOL bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight;
@@ -3667,7 +3633,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineWidth = 1;
if ( eTextLine == UNDERLINE_BOLDWAVE )
nLineWidth *= 2;
- nLinePos += nDistY - (nLineHeight / 2);
+ nLinePos += nY - (nLineHeight / 2);
long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
if ( eTextLine == UNDERLINE_DOUBLEWAVE )
{
@@ -3688,16 +3654,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineDY2 = 1;
nLinePos -= nLineWidthHeight-nLineDY2;
- ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
nLinePos += nLineWidthHeight+nLineDY;
- ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
else
{
nLinePos -= nLineWidthHeight/2;
- ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
}
@@ -3705,18 +3671,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth,
+ long nX, long nY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- sal_Bool bIsAbove )
+ 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;
@@ -3779,12 +3743,12 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = sal_True;
+ mbInitFillColor = TRUE;
- long nLeft = nDistX;
+ long nLeft = nX;
switch ( eTextLine )
{
@@ -3937,7 +3901,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth,
+ long nX, long nY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3946,8 +3910,6 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
long nLinePos = 0;
long nLinePos2 = 0;
- long nY = nDistY;
-
if ( eStrikeout > STRIKEOUT_LAST )
eStrikeout = STRIKEOUT_SINGLE;
@@ -3975,12 +3937,12 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = sal_True;
+ mbInitFillColor = TRUE;
- const long& nLeft = nDistX;
+ long nLeft = nX;
switch ( eStrikeout )
{
@@ -4001,15 +3963,10 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth,
+ long nX, long nY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
- //See qadevOOo/testdocs/StrikeThrough.odt for examples if you need
- //to tweak this
- if (!nWidth)
- return;
-
// PDF-export does its own strikeout drawing... why again?
if( mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) )
return;
@@ -4022,23 +3979,35 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
cStrikeoutChar = 'X';
static const int nTestStrLen = 4;
static const int nMaxStrikeStrLen = 2048;
- xub_Unicode aChars[nMaxStrikeStrLen+1]; // +1 for valgrind...
+ xub_Unicode aChars[ nMaxStrikeStrLen +1]; // +1 for valgrind...
for( int i = 0; i < nTestStrLen; ++i)
aChars[i] = cStrikeoutChar;
const String aStrikeoutTest( aChars, nTestStrLen );
// calculate approximation of strikeout atom size
- long nStrikeoutWidth = 0;
+ long nStrikeoutWidth = nWidth;
SalLayout* pLayout = ImplLayout( aStrikeoutTest, 0, nTestStrLen );
if( pLayout )
{
- nStrikeoutWidth = pLayout->GetTextWidth() / (nTestStrLen * pLayout->GetUnitsPerPixel());
+ nStrikeoutWidth = (pLayout->GetTextWidth() +nTestStrLen/2) / (nTestStrLen * pLayout->GetUnitsPerPixel());
pLayout->Release();
}
if( nStrikeoutWidth <= 0 ) // sanity check
return;
- int nStrikeStrLen = (nWidth+(nStrikeoutWidth-1)) / nStrikeoutWidth;
+ // calculate acceptable strikeout length
+ // allow the strikeout to be one pixel larger than the text it strikes out
+ long nMaxWidth = nStrikeoutWidth / 2;
+ if ( nMaxWidth < 2 )
+ nMaxWidth = 2;
+ nMaxWidth += nWidth + 1;
+
+ int nStrikeStrLen = (nMaxWidth + nStrikeoutWidth - 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
+ if( nStrikeStrLen <= 0 )
+ return;
if( nStrikeStrLen > nMaxStrikeStrLen )
nStrikeStrLen = nMaxStrikeStrLen;
@@ -4048,12 +4017,10 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
if( mpFontEntry->mnOrientation )
- ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
- nBaseX += nDistX;
- nBaseY += nDistY;
+ ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
// strikeout text has to be left aligned
- sal_uLong nOrigTLM = mnTextLayoutMode;
+ ULONG nOrigTLM = mnTextLayoutMode;
mnTextLayoutMode = TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_COMPLEX_DISABLED;
pLayout = ImplLayout( aStrikeoutText, 0, STRING_LEN );
mnTextLayoutMode = nOrigTLM;
@@ -4066,30 +4033,9 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
SetTextColor( aColor );
ImplInitTextColor();
- pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
-
- Rectangle aPixelRect;
- aPixelRect.nLeft = nBaseX+mnTextOffX;
- aPixelRect.nRight = aPixelRect.nLeft+nWidth;
- aPixelRect.nBottom = nBaseY+mpFontEntry->maMetric.mnDescent;
- aPixelRect.nTop = nBaseY-mpFontEntry->maMetric.mnAscent;
-
- if (mpFontEntry->mnOrientation)
- {
- Polygon aPoly( aPixelRect );
- aPoly.Rotate( Point(nBaseX+mnTextOffX, nBaseY+mnTextOffY), mpFontEntry->mnOrientation);
- aPixelRect = aPoly.GetBoundRect();
- }
-
- Push( PUSH_CLIPREGION );
- IntersectClipRegion( PixelToLogic(aPixelRect) );
- if( mbInitClipRegion )
- ImplInitClipRegion();
-
+ pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY );
pLayout->DrawText( *mpGraphics );
-
pLayout->Release();
- Pop();
SetTextColor( aOldColor );
ImplInitTextColor();
@@ -4097,12 +4043,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextLine( long nX, long nY,
- long nDistX, long nWidth,
+void OutputDevice::ImplDrawTextLine( long nBaseX,
+ long nX, long nY, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- sal_Bool bUnderlineAbove )
+ BOOL bUnderlineAbove )
{
if ( !nWidth )
return;
@@ -4110,18 +4056,14 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY,
Color aStrikeoutColor = GetTextColor();
Color aUnderlineColor = GetTextLineColor();
Color aOverlineColor = GetOverlineColor();
- sal_Bool bStrikeoutDone = sal_False;
- sal_Bool bUnderlineDone = sal_False;
- sal_Bool bOverlineDone = sal_False;
+ BOOL bStrikeoutDone = FALSE;
+ BOOL bUnderlineDone = FALSE;
+ BOOL bOverlineDone = FALSE;
+ // TODO: fix rotated text
if ( IsRTLEnabled() )
- {
// --- RTL --- mirror at basex
- long nXAdd = nWidth - nDistX;
- if( mpFontEntry->mnOrientation )
- nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) );
- nX += nXAdd - 1;
- }
+ nX = nBaseX - nWidth - (nX - nBaseX - 1);
if ( !IsTextLineColor() )
aUnderlineColor = GetTextColor();
@@ -4134,85 +4076,70 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY,
(eUnderline == UNDERLINE_DOUBLEWAVE) ||
(eUnderline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
- bUnderlineDone = sal_True;
+ ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ bUnderlineDone = TRUE;
}
if ( (eOverline == UNDERLINE_SMALLWAVE) ||
(eOverline == UNDERLINE_WAVE) ||
(eOverline == UNDERLINE_DOUBLEWAVE) ||
(eOverline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
- bOverlineDone = sal_True;
+ ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
+ bOverlineDone = TRUE;
}
if ( (eStrikeout == STRIKEOUT_SLASH) ||
(eStrikeout == STRIKEOUT_X) )
{
- ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
- bStrikeoutDone = sal_True;
+ ImplDrawStrikeoutChar( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
+ bStrikeoutDone = TRUE;
}
if ( !bUnderlineDone )
- ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
if ( !bOverlineDone )
- ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
+ ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
if ( !bStrikeoutDone )
- ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
+ ImplDrawStrikeoutLine( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
- FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove )
+ FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove )
{
if( bWordLine )
{
- // 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;
+ Point aPos, aStartPt;
+ sal_Int32 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 )
{
- // 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) );
- }
+ aStartPt = aPos;//rSalLayout.DrawBase() - (aPos - rSalLayout.DrawOffset());
}
- // update the length of the textline
nWidth += nAdvance;
}
else if( nWidth > 0 )
{
- // draw the textline for each word
- ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
+ ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
}
}
- // draw textline for the last word
if( nWidth > 0 )
{
- ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
+ ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4220,7 +4147,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
{
Point aStartPt = rSalLayout.GetDrawPosition();
int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
- ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth,
+ ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4239,18 +4166,18 @@ void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth )
nX = nBaseX - nWidth - (nX - nBaseX - 1);
}
- ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, sal_False );
+ ImplDrawTextLine( nBaseX, nX, nY, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine,
+void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
Rectangle& rRect1, Rectangle& rRect2,
long& rYOff, long& rWidth,
FontEmphasisMark eEmphasis,
long nHeight, short /*nOrient*/ )
{
- static const sal_uInt8 aAccentPolyFlags[24] =
+ static const BYTE 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
};
@@ -4285,7 +4212,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyL
rWidth = 0;
rYOff = 0;
- rPolyLine = sal_False;
+ rPolyLine = FALSE;
if ( !nHeight )
return;
@@ -4326,7 +4253,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyL
// BorderWidth is 15%
long nBorder = (nDotSize*150)/1000;
if ( nBorder <= 1 )
- rPolyLine = sal_True;
+ rPolyLine = TRUE;
else
{
Polygon aPoly2( Point( nRad, nRad ),
@@ -4400,7 +4327,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyL
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
- const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
+ const PolyPolygon& rPolyPoly, BOOL bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -4449,12 +4376,13 @@ void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
{
+ Color aOldColor = GetTextColor();
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
- sal_Bool bOldMap = mbMap;
+ BOOL bOldMap = mbMap;
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = NULL;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
FontEmphasisMark nEmphasisMark = ImplGetEmphasisMarkStyle( maFont );
PolyPolygon aPolyPoly;
@@ -4463,7 +4391,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
long nEmphasisYOff;
long nEmphasisWidth;
long nEmphasisHeight;
- sal_Bool bPolyLine;
+ BOOL bPolyLine;
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
nEmphasisHeight = mnEmphasisDescent;
@@ -4587,12 +4515,12 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
GDIMetaFile* pOldMetaFile = mpMetaFile;
long nOldOffX = mnOutOffX;
long nOldOffY = mnOutOffY;
- sal_Bool bOldMap = mbMap;
+ BOOL bOldMap = mbMap;
mnOutOffX = 0L;
mnOutOffY = 0L;
mpMetaFile = NULL;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
DrawMask( aPoint, aBmp, GetTextColor() );
@@ -4606,7 +4534,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, sal_Bool bTextLines )
+void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
{
if( mpFontEntry->mnOwnOrientation )
if( ImplDrawRotateText( rSalLayout ) )
@@ -4800,7 +4728,7 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
+ USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
@@ -4815,7 +4743,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
uno::Reference < i18n::XBreakIterator > xBI;
// get service provider
uno::Reference< lang::XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
-
+
uno::Reference< linguistic2::XHyphenator > xHyph;
if( xSMgr.is() )
{
@@ -4825,7 +4753,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
xHyph = xLinguMgr->getHyphenator();
}
}
-
+
i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, uno::Sequence <beans::PropertyValue>(), 1 );
i18n::LineBreakUserOptions aUserOptions;
@@ -4864,20 +4792,22 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// auf mehr als Zwei Zeilen gebrochen wird...
if ( xHyph.is() )
{
+ sal_Unicode cAlternateReplChar = 0;
+ sal_Unicode cAlternateExtraChar = 0;
i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True );
- // sal_uInt16 nWordStart = nBreakPos;
- // sal_uInt16 nBreakPos_OLD = nBreakPos;
+ // sal_uInt16 nWordStart = nBreakPos;
+ // sal_uInt16 nBreakPos_OLD = nBreakPos;
sal_uInt16 nWordStart = nPos;
- sal_uInt16 nWordEnd = (sal_uInt16) aBoundary.endPos;
+ sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos;
DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" );
- sal_uInt16 nWordLen = nWordEnd - nWordStart;
+ USHORT nWordLen = nWordEnd - nWordStart;
if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
{
// #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD
// DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" );
String aWord( aText, nWordStart, nWordLen );
- sal_uInt16 nMinTrail = static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben
+ sal_uInt16 nMinTrail = static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben
uno::Reference< linguistic2::XHyphenatedWord > xHyphWord;
if (xHyph.is())
xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() );
@@ -4935,10 +4865,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate: Falsche Annahme!" );
- sal_Unicode cAlternateReplChar = 0;
-
if ( nTxtEnd > nTxtStart )
cAlternateReplChar = aAlt.GetChar( nAltStart );
+ else
+ cAlternateExtraChar = aAlt.GetChar( nAltStart );
nBreakPos = nWordStart + nTxtStart;
if ( cAlternateReplChar )
@@ -4954,7 +4884,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
else
{
// fallback to something really simple
- sal_uInt16 nSpacePos = STRING_LEN;
+ USHORT nSpacePos = STRING_LEN;
long nW = 0;
do
{
@@ -4966,7 +4896,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
nW = _rLayout.GetTextWidth( rStr, nPos, nSpacePos-nPos );
}
} while( nW > nWidth );
-
+
if( nSpacePos != STRING_NOTFOUND )
{
nBreakPos = nSpacePos;
@@ -4996,7 +4926,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
}
}
#ifdef DBG_UTIL
- for ( sal_uInt16 nL = 0; nL < rLineInfo.Count(); nL++ )
+ for ( USHORT nL = 0; nL < rLineInfo.Count(); nL++ )
{
ImplTextLineInfo* pLine = rLineInfo.GetLine( nL );
String aLine( rStr, pLine->GetIndex(), pLine->GetLen() );
@@ -5010,12 +4940,12 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// =======================================================================
-void OutputDevice::SetAntialiasing( sal_uInt16 nMode )
+void OutputDevice::SetAntialiasing( USHORT nMode )
{
if ( mnAntialiasing != nMode )
{
mnAntialiasing = nMode;
- mbInitFont = sal_True;
+ mbInitFont = TRUE;
if(mpGraphics)
{
@@ -5031,7 +4961,7 @@ void OutputDevice::SetAntialiasing( sal_uInt16 nMode )
void OutputDevice::SetFont( const Font& rNewFont )
{
- OSL_TRACE( "OutputDevice::SetFont()" );
+ DBG_TRACE( "OutputDevice::SetFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rNewFont, Font, NULL );
@@ -5049,7 +4979,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const sal_uInt8 cLum = aTextColor.GetLuminance();
+ const UINT8 cLum = aTextColor.GetLuminance();
aTextColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5064,7 +4994,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aFont.SetColor( aTextColor );
- sal_Bool bTransFill = aFont.IsTransparent();
+ BOOL bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
Color aTextFillColor( aFont.GetFillColor() );
@@ -5075,7 +5005,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextFillColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const sal_uInt8 cLum = aTextFillColor.GetLuminance();
+ const UINT8 cLum = aTextFillColor.GetLuminance();
aTextFillColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5083,7 +5013,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aTextFillColor = Color( COL_TRANSPARENT );
- bTransFill = sal_True;
+ bTransFill = TRUE;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5106,6 +5036,12 @@ void OutputDevice::SetFont( const Font& rNewFont )
mpMetaFile->AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) );
}
+#if (OSL_DEBUG_LEVEL > 2) || defined (HDU_DEBUG)
+ fprintf( stderr, " OutputDevice::SetFont( name=\"%s\", h=%ld)\n",
+ OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
+ aFont.GetSize().Height() );
+#endif
+
if ( !maFont.IsSameInstance( aFont ) )
{
// Optimization MT/HDU: COL_TRANSPARENT means SetFont should ignore the font color,
@@ -5115,12 +5051,12 @@ void OutputDevice::SetFont( const Font& rNewFont )
&& (aFont.GetColor() != maFont.GetColor() || aFont.GetColor() != maTextColor ) )
{
maTextColor = aFont.GetColor();
- mbInitTextColor = sal_True;
+ mbInitTextColor = TRUE;
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextColorAction( aFont.GetColor() ) );
}
maFont = aFont;
- mbNewFont = sal_True;
+ mbNewFont = TRUE;
if( mpAlphaVDev )
{
@@ -5141,9 +5077,9 @@ void OutputDevice::SetFont( const Font& rNewFont )
// -----------------------------------------------------------------------
-void OutputDevice::SetLayoutMode( sal_uLong nTextLayoutMode )
+void OutputDevice::SetLayoutMode( ULONG nTextLayoutMode )
{
- OSL_TRACE( "OutputDevice::SetTextLayoutMode()" );
+ DBG_TRACE( "OutputDevice::SetTextLayoutMode()" );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaLayoutModeAction( nTextLayoutMode ) );
@@ -5158,7 +5094,7 @@ void OutputDevice::SetLayoutMode( sal_uLong nTextLayoutMode )
void OutputDevice::SetDigitLanguage( LanguageType eTextLanguage )
{
- OSL_TRACE( "OutputDevice::SetTextLanguage()" );
+ DBG_TRACE( "OutputDevice::SetTextLanguage()" );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextLanguageAction( eTextLanguage ) );
@@ -5173,7 +5109,7 @@ void OutputDevice::SetDigitLanguage( LanguageType eTextLanguage )
void OutputDevice::SetTextColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetTextColor()" );
+ DBG_TRACE( "OutputDevice::SetTextColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
@@ -5188,7 +5124,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5208,7 +5144,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
if ( maTextColor != aColor )
{
maTextColor = aColor;
- mbInitTextColor = sal_True;
+ mbInitTextColor = TRUE;
}
if( mpAlphaVDev )
@@ -5219,16 +5155,16 @@ void OutputDevice::SetTextColor( const Color& rColor )
void OutputDevice::SetTextFillColor()
{
- OSL_TRACE( "OutputDevice::SetTextFillColor()" );
+ DBG_TRACE( "OutputDevice::SetTextFillColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), FALSE ) );
if ( maFont.GetColor() != Color( COL_TRANSPARENT ) )
maFont.SetFillColor( Color( COL_TRANSPARENT ) );
if ( !maFont.IsTransparent() )
- maFont.SetTransparent( sal_True );
+ maFont.SetTransparent( TRUE );
if( mpAlphaVDev )
mpAlphaVDev->SetTextFillColor();
@@ -5238,11 +5174,11 @@ void OutputDevice::SetTextFillColor()
void OutputDevice::SetTextFillColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetTextFillColor()" );
+ DBG_TRACE( "OutputDevice::SetTextFillColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
- sal_Bool bTransFill = ImplIsColorTransparent( aColor ) ? sal_True : sal_False;
+ BOOL bTransFill = ImplIsColorTransparent( aColor ) ? TRUE : FALSE;
if ( !bTransFill )
{
@@ -5256,7 +5192,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5264,7 +5200,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aColor = Color( COL_TRANSPARENT );
- bTransFill = sal_True;
+ bTransFill = TRUE;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5277,7 +5213,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, sal_True ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, TRUE ) );
if ( maFont.GetFillColor() != aColor )
maFont.SetFillColor( aColor );
@@ -5302,11 +5238,11 @@ Color OutputDevice::GetTextFillColor() const
void OutputDevice::SetTextLineColor()
{
- OSL_TRACE( "OutputDevice::SetTextLineColor()" );
+ DBG_TRACE( "OutputDevice::SetTextLineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), FALSE ) );
maTextLineColor = Color( COL_TRANSPARENT );
@@ -5318,7 +5254,7 @@ void OutputDevice::SetTextLineColor()
void OutputDevice::SetTextLineColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetTextLineColor()" );
+ DBG_TRACE( "OutputDevice::SetTextLineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
@@ -5333,7 +5269,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5349,7 +5285,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, sal_True ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, TRUE ) );
maTextLineColor = aColor;
@@ -5361,11 +5297,11 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
void OutputDevice::SetOverlineColor()
{
- OSL_TRACE( "OutputDevice::SetOverlineColor()" );
+ DBG_TRACE( "OutputDevice::SetOverlineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), FALSE ) );
maOverlineColor = Color( COL_TRANSPARENT );
@@ -5377,7 +5313,7 @@ void OutputDevice::SetOverlineColor()
void OutputDevice::SetOverlineColor( const Color& rColor )
{
- OSL_TRACE( "OutputDevice::SetOverlineColor()" );
+ DBG_TRACE( "OutputDevice::SetOverlineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
@@ -5392,7 +5328,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5408,7 +5344,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, sal_True ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, TRUE ) );
maOverlineColor = aColor;
@@ -5421,7 +5357,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
void OutputDevice::SetTextAlign( TextAlign eAlign )
{
- OSL_TRACE( "OutputDevice::SetTextAlign()" );
+ DBG_TRACE( "OutputDevice::SetTextAlign()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -5430,7 +5366,7 @@ void OutputDevice::SetTextAlign( TextAlign eAlign )
if ( maFont.GetAlign() != eAlign )
{
maFont.SetAlign( eAlign );
- mbNewFont = sal_True;
+ mbNewFont = TRUE;
}
if( mpAlphaVDev )
@@ -5443,9 +5379,9 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- sal_Bool bUnderlineAbove )
+ BOOL bUnderlineAbove )
{
- OSL_TRACE( "OutputDevice::DrawTextLine()" );
+ DBG_TRACE( "OutputDevice::DrawTextLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -5478,7 +5414,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(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+ ImplDrawTextLine( aPos.X(), aPos.X(), aPos.Y(), nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
if( mpAlphaVDev )
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
@@ -5486,7 +5422,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
// ------------------------------------------------------------------------
-sal_Bool OutputDevice::IsTextUnderlineAbove( const Font& rFont )
+BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
{
return ImplIsUnderlineAbove( rFont );
}
@@ -5494,9 +5430,9 @@ sal_Bool OutputDevice::IsTextUnderlineAbove( const Font& rFont )
// ------------------------------------------------------------------------
void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
- OSL_TRACE( "OutputDevice::DrawWaveLine()" );
+ DBG_TRACE( "OutputDevice::DrawWaveLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
@@ -5555,7 +5491,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
- ImplDrawWaveLine( nStartX, nStartY, 0, 0,
+ ImplDrawWaveLine( nStartX, nStartY, nStartX, nStartY,
nEndX-nStartX, nWaveHeight, 1,
nOrientation, GetLineColor() );
if( mpAlphaVDev )
@@ -5575,7 +5511,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
}
- OSL_TRACE( "OutputDevice::DrawText()" );
+ DBG_TRACE( "OutputDevice::DrawText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
#if OSL_DEBUG_LEVEL > 2
@@ -5651,7 +5587,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
long OutputDevice::GetTextWidth( const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
- OSL_TRACE( "OutputDevice::GetTextWidth()" );
+ DBG_TRACE( "OutputDevice::GetTextWidth()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
long nWidth = GetTextArray( rStr, NULL, nIndex, nLen );
@@ -5662,7 +5598,7 @@ long OutputDevice::GetTextWidth( const String& rStr,
long OutputDevice::GetTextHeight() const
{
- OSL_TRACE( "OutputDevice::GetTextHeight()" );
+ DBG_TRACE( "OutputDevice::GetTextHeight()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mbNewFont )
@@ -5686,7 +5622,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
const sal_Int32* pDXAry,
xub_StrLen nIndex, xub_StrLen nLen )
{
- OSL_TRACE( "OutputDevice::DrawTextArray()" );
+ DBG_TRACE( "OutputDevice::DrawTextArray()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -5717,12 +5653,12 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
- OSL_TRACE( "OutputDevice::GetTextArray()" );
+ DBG_TRACE( "OutputDevice::GetTextArray()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
return 0;
- if( (sal_uLong)nIndex+nLen >= rStr.Len() )
+ if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// do layout
@@ -5764,14 +5700,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,
- sal_Bool bCellBreaking ) const
+ BOOL bCellBreaking ) const
{
- OSL_TRACE( "OutputDevice::GetCaretPositions()" );
+ DBG_TRACE( "OutputDevice::GetCaretPositions()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
return false;
- if( (sal_uLong)nIndex+nLen >= rStr.Len() )
+ if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// layout complex text
@@ -5830,11 +5766,11 @@ bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXA
// -----------------------------------------------------------------------
-void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
+void OutputDevice::DrawStretchText( const Point& rStartPt, ULONG nWidth,
const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen )
{
- OSL_TRACE( "OutputDevice::DrawStretchText()" );
+ DBG_TRACE( "OutputDevice::DrawStretchText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -5862,7 +5798,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
{
// get string length for calculating extents
xub_StrLen nEndIndex = rStr.Len();
- if( (sal_uLong)nMinIndex + nLen < nEndIndex )
+ if( (ULONG)nMinIndex + nLen < nEndIndex )
nEndIndex = nMinIndex + nLen;
// don't bother if there is nothing to do
@@ -5931,7 +5867,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<sal_uInt16>(pStr - pBase),
+ rStr.SetChar( static_cast<USHORT>(pStr - pBase),
static_cast<sal_Unicode>(cChar) );
}
}
@@ -6087,58 +6023,6 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
return pSalLayout;
}
-void OutputDevice::forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &rFallbackFont,
- ImplFontSelectData &rFontSelData, int nFallbackLevel,
- ImplLayoutArgs& rLayoutArgs, const ImplFontMetricData& rOrigMetric) const
-{
- Rectangle aBoundRect;
- bool bHaveBounding = false;
- Rectangle aRectangle;
-
- rFallback.AdjustLayout( rLayoutArgs );
-
- //All we care about here is getting the vertical bounds of this text and
- //make sure it will fit inside the available space
- Point aPos;
- for( int nStart = 0;;)
- {
- sal_GlyphId nLGlyph;
- if( !rFallback.GetNextGlyphs( 1, &nLGlyph, aPos, nStart ) )
- break;
-
- int nFontTag = nFallbackLevel << GF_FONTSHIFT;
- nLGlyph |= nFontTag;
-
- // get bounding rectangle of individual glyph
- if( mpGraphics->GetGlyphBoundRect( nLGlyph, aRectangle ) )
- {
- // merge rectangle
- aRectangle += aPos;
- aBoundRect.Union( aRectangle );
- bHaveBounding = true;
- }
- }
-
- //Shrink it down if it won't fit
- if (bHaveBounding)
- {
- long nGlyphsAscent = -aBoundRect.Top();
- float fScaleTop = nGlyphsAscent > rOrigMetric.mnAscent ?
- rOrigMetric.mnAscent/(float)nGlyphsAscent : 1;
- long nGlyphsDescent = aBoundRect.Bottom();
- float fScaleBottom = nGlyphsDescent > rOrigMetric.mnDescent ?
- rOrigMetric.mnDescent/(float)nGlyphsDescent : 1;
- float fScale = fScaleBottom < fScaleTop ? fScaleBottom : fScaleTop;
- if (fScale < 1)
- {
- long nOrigHeight = rFontSelData.mnHeight;
- rFontSelData.mnHeight *= fScale;
- rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel );
- rFontSelData.mnHeight = nOrigHeight;
- }
- }
-}
-
// -----------------------------------------------------------------------
SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLayoutArgs& rLayoutArgs ) const
@@ -6149,6 +6033,17 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
rLayoutArgs.PrepareFallback();
rLayoutArgs.mnFlags |= SAL_LAYOUT_FOR_FALLBACK;
+#if defined(HDU_DEBUG)
+ {
+ int nCharPos = -1;
+ bool bRTL = false;
+ fprintf(stderr,"OD:ImplLayout Glyph Fallback for");
+ for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
+ fprintf(stderr," U+%04X", rLayoutArgs.mpStr[ nCharPos ] );
+ fprintf(stderr,"\n");
+ rLayoutArgs.ResetPos();
+ }
+#endif
// get list of unicodes that need glyph fallback
int nCharPos = -1;
bool bRTL = false;
@@ -6160,9 +6055,8 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
- ImplFontMetricData aOrigMetric( aFontSelData );
- // TODO: use cached metric in fontentry
- mpGraphics->GetFontMetric( &aOrigMetric );
+ ImplFontMetricData aOrigMetric(aFontSelData);
+ 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
@@ -6175,7 +6069,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
for( int nFallbackLevel = 1; nFallbackLevel < MAX_FALLBACK; ++nFallbackLevel )
{
// find a font family suited for glyph fallback
-#ifndef FONTFALLBACK_HOOKS_DISABLED
+#ifndef FONTFALLBACK_HOOKS_DISABLED
// GetGlyphFallbackFont() needs a valid aFontSelData.mpFontEntry
// if the system-specific glyph fallback is active
aFontSelData.mpFontEntry = mpFontEntry; // reset the fontentry to base-level
@@ -6197,7 +6091,33 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
}
}
+#if defined(HDU_DEBUG)
+ {
+ ByteString aOrigFontName( maFont.GetName(), RTL_TEXTENCODING_UTF8);
+ ByteString aFallbackName( aFontSelData.mpFontData->GetFamilyName(),
+ RTL_TEXTENCODING_UTF8);
+ fprintf(stderr,"\tGlyphFallback[lvl=%d] \"%s\" -> \"%s\" (q=%d)\n",
+ nFallbackLevel, aOrigFontName.GetBuffer(), aFallbackName.GetBuffer(),
+ aFontSelData.mpFontData->GetQuality());
+ }
+#endif
+
+ ImplFontMetricData aSubstituteMetric(aFontSelData);
pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ mpGraphics->GetFontMetric(&aSubstituteMetric, nFallbackLevel);
+
+ long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent;
+ long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent;
+ //Too tall, shrink it a bit. Need a better calculation to include extra
+ //factors and any extra wriggle room we might have available ?
+ if (nSubstituteHeight > nOriginalHeight)
+ {
+ float fScale = nOriginalHeight/(float)nSubstituteHeight;
+ long nOrigHeight = aFontSelData.mnHeight;
+ aFontSelData.mnHeight *= fScale;
+ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ aFontSelData.mnHeight = nOrigHeight;
+ }
// create and add glyph fallback layout to multilayout
rLayoutArgs.ResetPos();
@@ -6206,9 +6126,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
{
if( pFallback->LayoutText( rLayoutArgs ) )
{
- forceFallbackFontToFit(*pFallback, *pFallbackFont, aFontSelData,
- nFallbackLevel, rLayoutArgs, aOrigMetric);
-
if( !pMultiSalLayout )
pMultiSalLayout = new MultiSalLayout( *pSalLayout );
pMultiSalLayout->AddFallback( *pFallback,
@@ -6242,7 +6159,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetTextIsRTL(
+BOOL OutputDevice::GetTextIsRTL(
const String& rString,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
@@ -6251,16 +6168,16 @@ sal_Bool OutputDevice::GetTextIsRTL(
bool bRTL = false;
int nCharPos = -1;
aArgs.GetNextPos( &nCharPos, &bRTL );
- return (nCharPos != nIndex) ? sal_True : sal_False;
+ return (nCharPos != nIndex) ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
xub_StrLen nIndex, xub_StrLen nLen,
- long nCharExtra, sal_Bool /*TODO: bCellBreaking*/ ) const
+ long nCharExtra, BOOL /*TODO: bCellBreaking*/ ) const
{
- OSL_TRACE( "OutputDevice::GetTextBreak()" );
+ DBG_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
@@ -6296,7 +6213,7 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra ) const
{
- OSL_TRACE( "OutputDevice::GetTextBreak()" );
+ DBG_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
rHyphenatorPos = STRING_LEN;
@@ -6352,17 +6269,17 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, sal_uInt16 nStyle,
+ const String& rOrigStr, USHORT nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout& _rLayout )
{
Color aOldTextColor;
Color aOldTextFillColor;
- sal_Bool bRestoreFillColor = false;
+ BOOL bRestoreFillColor = false;
if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
{
- sal_Bool bHighContrastBlack = sal_False;
- sal_Bool bHighContrastWhite = sal_False;
+ BOOL bHighContrastBlack = FALSE;
+ BOOL bHighContrastWhite = FALSE;
const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -6374,15 +6291,15 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
// but it may be totally wrong. the background color
// was typically already reset
aCol = rStyleSettings.GetFaceColor();
-
+
bHighContrastBlack = aCol.IsDark();
bHighContrastWhite = aCol.IsBright();
}
-
+
aOldTextColor = rTargetDevice.GetTextColor();
if ( rTargetDevice.IsTextFillColor() )
{
- bRestoreFillColor = sal_True;
+ bRestoreFillColor = TRUE;
aOldTextFillColor = rTargetDevice.GetTextFillColor();
}
if( bHighContrastBlack )
@@ -6511,7 +6428,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nMnemonicWidth;
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * nLineLen );
- /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
+ /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
nIndex, nLineLen );
long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
@@ -6582,7 +6499,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() );
- /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
+ /*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)) );
@@ -6627,10 +6544,10 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
void OutputDevice::AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- sal_uInt16 nStyle,
+ USHORT nStyle,
GDIMetaFile& rMtf )
{
- OSL_TRACE( "OutputDevice::AddTextRectActions( const Rectangle& )" );
+ DBG_TRACE( "OutputDevice::AddTextRectActions( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !rOrigStr.Len() || rRect.IsEmpty() )
@@ -6644,11 +6561,11 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// temporarily swap in passed mtf for action generation, and
// disable output generation.
- const sal_Bool bOutputEnabled( IsOutputEnabled() );
+ const BOOL bOutputEnabled( IsOutputEnabled() );
GDIMetaFile* pMtf = mpMetaFile;
mpMetaFile = &rMtf;
- EnableOutput( sal_False );
+ EnableOutput( FALSE );
// #i47157# Factored out to ImplDrawTextRect(), to be shared
// between us and DrawText()
@@ -6662,7 +6579,7 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle,
+void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout* _pTextLayout )
{
@@ -6672,7 +6589,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal
pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
}
- OSL_TRACE( "OutputDevice::DrawText( const Rectangle& )" );
+ DBG_TRACE( "OutputDevice::DrawText( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
bool bDecomposeTextRectAction = ( _pTextLayout != NULL ) && _pTextLayout->DecomposeTextRectAction();
@@ -6711,11 +6628,11 @@ void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal
// -----------------------------------------------------------------------
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle,
+ const XubString& rStr, USHORT nStyle,
TextRectInfo* pInfo,
const ::vcl::ITextLayout* _pTextLayout ) const
{
- OSL_TRACE( "OutputDevice::GetTextRect()" );
+ DBG_TRACE( "OutputDevice::GetTextRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Rectangle aRect = rRect;
@@ -6741,7 +6658,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
nFormatLines = aMultiLineInfo.Count();
if ( !nTextHeight )
nTextHeight = 1;
- nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight);
+ nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
if ( pInfo )
pInfo->mnLineCount = nFormatLines;
if ( !nLines )
@@ -6755,13 +6672,13 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
else
{
if ( pInfo )
- pInfo->mbEllipsis = sal_True;
+ pInfo->mbEllipsis = TRUE;
nMaxWidth = nWidth;
}
}
if ( pInfo )
{
- sal_Bool bMaxWidth = nMaxWidth == 0;
+ BOOL bMaxWidth = nMaxWidth == 0;
pInfo->mnMaxWidth = 0;
for ( i = 0; i < nLines; i++ )
{
@@ -6796,7 +6713,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ELLIPSIS) )
{
if ( pInfo )
- pInfo->mbEllipsis = sal_True;
+ pInfo->mbEllipsis = TRUE;
nMaxWidth = nWidth;
}
}
@@ -6827,22 +6744,22 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
// -----------------------------------------------------------------------
-static sal_Bool ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
+static BOOL ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
{
while ( *pStr )
{
if ( *pStr == c )
- return sal_True;
+ return TRUE;
pStr++;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
- sal_uInt16 nStyle ) const
+ USHORT nStyle ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
@@ -6852,9 +6769,9 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
// -----------------------------------------------------------------------
String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rOrigStr, long nMaxWidth,
- sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
+ USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
{
- OSL_TRACE( "OutputDevice::ImplGetEllipsisString()" );
+ DBG_TRACE( "OutputDevice::ImplGetEllipsisString()" );
String aStr = rOrigStr;
xub_StrLen nIndex = _rLayout.GetTextBreak( aStr, nMaxWidth, 0, aStr.Len() );
@@ -6862,20 +6779,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
if ( nIndex != STRING_LEN )
{
- 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 )
+ if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
aStr.Erase( nIndex );
if ( nIndex > 1 )
@@ -6921,7 +6825,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
- sal_uInt16 nFirstContent = 0;
+ USHORT nFirstContent = 0;
while ( nFirstContent < nLastContent )
{
nFirstContent++;
@@ -6985,9 +6889,9 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- sal_uInt16 nStyle, MetricVector* pVector, String* pDisplayText )
+ USHORT nStyle, MetricVector* pVector, String* pDisplayText )
{
- OSL_TRACE( "OutputDevice::DrawCtrlText()" );
+ DBG_TRACE( "OutputDevice::DrawCtrlText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !IsDeviceOutputNecessary() || (nIndex >= rStr.Len()) )
@@ -7004,7 +6908,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
if( nIndex >= rStr.Len() )
return;
- if( (sal_uLong)nIndex+nLen >= rStr.Len() )
+ if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
XubString aStr = rStr;
@@ -7026,7 +6930,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
--nLen;
DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
}
- sal_Bool bInvalidPos = sal_False;
+ BOOL bInvalidPos = FALSE;
if( nMnemonicPos >= nLen )
{
@@ -7034,12 +6938,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 = sal_True;
+ bInvalidPos = TRUE;
nMnemonicPos = nLen-1;
}
sal_Int32* pCaretXArray = (sal_Int32*)alloca( 2 * sizeof(sal_Int32) * nLen );
- /*sal_Bool bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
+ /*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));
@@ -7059,9 +6963,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
{
Color aOldTextColor;
Color aOldTextFillColor;
- sal_Bool bRestoreFillColor;
- sal_Bool bHighContrastBlack = sal_False;
- sal_Bool bHighContrastWhite = sal_False;
+ BOOL bRestoreFillColor;
+ BOOL bHighContrastBlack = FALSE;
+ BOOL bHighContrastWhite = FALSE;
const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -7073,15 +6977,15 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
bHighContrastWhite = aCol.IsBright();
}
}
-
+
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
- bRestoreFillColor = sal_True;
+ bRestoreFillColor = TRUE;
aOldTextFillColor = GetTextFillColor();
}
else
- bRestoreFillColor = sal_False;
+ bRestoreFillColor = FALSE;
if( bHighContrastBlack )
SetTextColor( COL_GREEN );
@@ -7118,9 +7022,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
long OutputDevice::GetCtrlTextWidth( const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- sal_uInt16 nStyle ) const
+ USHORT nStyle ) const
{
- OSL_TRACE( "OutputDevice::GetCtrlTextSize()" );
+ DBG_TRACE( "OutputDevice::GetCtrlTextSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( nStyle & TEXT_DRAW_MNEMONIC )
@@ -7132,7 +7036,7 @@ long OutputDevice::GetCtrlTextWidth( const String& rStr,
if ( nMnemonicPos < nIndex )
nIndex--;
else if ( (nLen < STRING_LEN) &&
- (nMnemonicPos >= nIndex) && (nMnemonicPos < (sal_uLong)(nIndex+nLen)) )
+ (nMnemonicPos >= nIndex) && (nMnemonicPos < (ULONG)(nIndex+nLen)) )
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen );
@@ -7179,7 +7083,7 @@ String OutputDevice::GetNonMnemonicString( const String& rStr, xub_StrLen& rMnem
int OutputDevice::GetDevFontCount() const
{
- OSL_TRACE( "OutputDevice::GetDevFontCount()" );
+ DBG_TRACE( "OutputDevice::GetDevFontCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( !mpGetDevFontList )
@@ -7191,7 +7095,7 @@ int OutputDevice::GetDevFontCount() const
FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
{
- OSL_TRACE( "OutputDevice::GetDevFont()" );
+ DBG_TRACE( "OutputDevice::GetDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
FontInfo aFontInfo;
@@ -7221,32 +7125,32 @@ FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
+BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
{
- OSL_TRACE( "OutputDevice::AddTempDevFont()" );
+ DBG_TRACE( "OutputDevice::AddTempDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
ImplInitFontList();
if( !mpGraphics && !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
bool bRC = mpGraphics->AddTempDevFont( mpFontList, rFileURL, rFontName );
if( !bRC )
- return sal_False;
+ return FALSE;
if( mpAlphaVDev )
mpAlphaVDev->AddTempDevFont( rFileURL, rFontName );
mpFontCache->Invalidate();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
int OutputDevice::GetDevFontSizeCount( const Font& rFont ) const
{
- OSL_TRACE( "OutputDevice::GetDevFontSizeCount()" );
+ DBG_TRACE( "OutputDevice::GetDevFontSizeCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
delete mpGetDevSizeList;
@@ -7260,7 +7164,7 @@ int OutputDevice::GetDevFontSizeCount( const Font& rFont ) const
Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
{
- OSL_TRACE( "OutputDevice::GetDevFontSize()" );
+ DBG_TRACE( "OutputDevice::GetDevFontSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
// check range
@@ -7293,9 +7197,9 @@ Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::IsFontAvailable( const String& rFontName ) const
+BOOL OutputDevice::IsFontAvailable( const String& rFontName ) const
{
- OSL_TRACE( "OutputDevice::IsFontAvailable()" );
+ DBG_TRACE( "OutputDevice::IsFontAvailable()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
ImplDevFontListData* pFound = mpFontList->FindFontFamily( rFontName );
@@ -7306,7 +7210,7 @@ sal_Bool OutputDevice::IsFontAvailable( const String& rFontName ) const
FontMetric OutputDevice::GetFontMetric() const
{
- OSL_TRACE( "OutputDevice::GetFontMetric()" );
+ DBG_TRACE( "OutputDevice::GetFontMetric()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
FontMetric aMetric;
@@ -7388,7 +7292,7 @@ SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
if (!mpGraphics) ImplGetGraphics();
if (mpGraphics) aSysFontData = mpGraphics->GetSysFontData(nFallbacklevel);
-
+
return aSysFontData;
}
@@ -7405,7 +7309,7 @@ SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
*
* Export finalized glyph layout data as platform independent SystemTextLayoutData
* (see vcl/inc/vcl/sysdata.hxx)
- *
+ *
* Only parameters rStartPt and rStr are mandatory, the rest is optional
* (default values will be used)
*
@@ -7414,24 +7318,24 @@ SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen,
const sal_Int32* pDXAry) const
{
- OSL_TRACE( "OutputDevice::GetSysTextLayoutData()" );
+ DBG_TRACE( "OutputDevice::GetSysTextLayoutData()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
SystemTextLayoutData aSysLayoutData;
aSysLayoutData.nSize = sizeof(aSysLayoutData);
aSysLayoutData.rGlyphData.reserve( 256 );
-
+
if ( mpMetaFile ) {
if (pDXAry)
mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) );
else
mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) );
}
-
+
if ( !IsDeviceOutputNecessary() ) return aSysLayoutData;
-
+
SalLayout* rLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
-
+
// setup glyphs
Point aPos;
sal_GlyphId aGlyphId;
@@ -7439,7 +7343,7 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
{
// NOTE: Windows backend is producing unicode chars (ucs4), so on windows,
// ETO_GLYPH_INDEX is unusable, unless extra glyph conversion is made.
-
+
SystemGlyphData aGlyph;
aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK);
aGlyph.x = aPos.X();
@@ -7451,7 +7355,7 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
// Get font data
aSysLayoutData.orientation = rLayout->GetOrientation();
-
+
rLayout->Release();
return aSysLayoutData;
@@ -7462,7 +7366,7 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
long OutputDevice::GetMinKashida() const
{
- OSL_TRACE( "OutputDevice::GetMinKashida()" );
+ DBG_TRACE( "OutputDevice::GetMinKashida()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mbNewFont && !ImplNewFont() )
return 0;
@@ -7484,9 +7388,9 @@ long OutputDevice::GetMinKashida( const Font& rFont ) const
}
// -----------------------------------------------------------------------
-xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
+xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
xub_StrLen nIdx, xub_StrLen nLen,
- xub_StrLen nKashCount,
+ xub_StrLen nKashCount,
const xub_StrLen* pKashidaPos,
xub_StrLen* pKashidaPosDropped ) const
{
@@ -7513,9 +7417,9 @@ xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
// TODO: best is to get rid of this method completely
-sal_uLong OutputDevice::GetKerningPairCount() const
+ULONG OutputDevice::GetKerningPairCount() const
{
- OSL_TRACE( "OutputDevice::GetKerningPairCount()" );
+ DBG_TRACE( "OutputDevice::GetKerningPairCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mbNewFont && !ImplNewFont() )
@@ -7539,9 +7443,9 @@ inline bool CmpKernData( const KerningPair& a, const KerningPair& b )
}
// TODO: best is to get rid of this method completely
-void OutputDevice::GetKerningPairs( sal_uLong nRequestedPairs, KerningPair* pKernPairs ) const
+void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPairs ) const
{
- OSL_TRACE( "OutputDevice::GetKerningPairs()" );
+ DBG_TRACE( "OutputDevice::GetKerningPairs()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mbNewFont && !ImplNewFont() )
@@ -7561,10 +7465,10 @@ void OutputDevice::GetKerningPairs( sal_uLong nRequestedPairs, KerningPair* pKer
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
+BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
int nIndex, int nLen, int nBase, MetricVector& rVector )
{
- OSL_TRACE( "OutputDevice::GetGlyphBoundRect_CTL()" );
+ DBG_TRACE( "OutputDevice::GetGlyphBoundRect_CTL()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
rVector.clear();
@@ -7586,14 +7490,14 @@ sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& r
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
+BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- sal_uLong nLayoutWidth, const sal_Int32* pDXAry ) const
+ ULONG nLayoutWidth, const sal_Int32* pDXAry ) const
{
- OSL_TRACE( "OutputDevice::GetTextBoundRect()" );
+ DBG_TRACE( "OutputDevice::GetTextBoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
rRect.SetEmpty();
SalLayout* pSalLayout = NULL;
@@ -7657,8 +7561,8 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
// so we need a monochrome virtual device with matching font
VirtualDevice aVDev( 1 );
Font aFont( GetFont() );
- aFont.SetShadow( sal_False );
- aFont.SetOutline( sal_False );
+ aFont.SetShadow( FALSE );
+ aFont.SetOutline( FALSE );
aFont.SetRelief( RELIEF_NONE );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
@@ -7691,7 +7595,7 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
Bitmap aBmp = aVDev.GetBitmap( Point(), aOutSize );
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
if( !pAcc )
- return sal_False;
+ return FALSE;
const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
const long nW = pAcc->Width();
const long nH = pAcc->Height();
@@ -7756,17 +7660,17 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() );
aTopLeft.Y() = ImplDevicePixelToLogicHeight( aTopLeft.Y() );
rRect = Rectangle( aTopLeft, aSize );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
+BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
+ BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
{
// the fonts need to be initialized
if( mbNewFont )
@@ -7774,9 +7678,9 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return sal_False;
+ return FALSE;
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
rVector.clear();
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
@@ -7784,11 +7688,11 @@ sal_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
- sal_Bool bOldMap = mbMap;
+ BOOL bOldMap = mbMap;
if( bOldMap )
{
- const_cast<OutputDevice&>(*this).mbMap = sal_False;
- const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
+ const_cast<OutputDevice&>(*this).mbMap = FALSE;
+ const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
}
SalLayout* pSalLayout = NULL;
@@ -7848,7 +7752,7 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
{
// restore original font size and map mode
const_cast<OutputDevice&>(*this).mbMap = bOldMap;
- const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
+ const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
}
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
@@ -7895,7 +7799,7 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
pSalLayout->Release();
if( !nWidth || !nHeight )
- return sal_True;
+ return TRUE;
double fScaleX = static_cast< double >(nOrgWidth) / nWidth;
double fScaleY = static_cast< double >(nOrgHeight) / nHeight;
@@ -7952,10 +7856,10 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
else
{
// convert units to logical width
- for (sal_uInt16 j = 0; j < aPolyPoly.Count(); ++j)
+ for (USHORT j = 0; j < aPolyPoly.Count(); ++j)
{
Polygon& rPoly = aPolyPoly[j];
- for (sal_uInt16 k = 0; k < rPoly.GetSize(); ++k)
+ for (USHORT k = 0; k < rPoly.GetSize(); ++k)
{
Point& rPt = rPoly[k];
rPt -= aOffset;
@@ -7970,7 +7874,7 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
// ignore "empty" glyphs:
if( aPolyPoly.Count() > 0 )
{
- // convert to B2DPolyPolygon
+ // convert to B2DPolyPolygon
// TODO: get rid of intermediate tool's PolyPolygon
::basegfx::B2DPolyPolygon aB2DPolyPoly = aPolyPoly.getB2DPolyPolygon();
::basegfx::B2DHomMatrix aMatrix;
@@ -7993,9 +7897,9 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
+BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex,
- xub_StrLen nLen, sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
+ xub_StrLen nLen, BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
{
rResultVector.clear();
@@ -8003,7 +7907,7 @@ sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return sal_False;
+ return FALSE;
// convert to a tool polypolygon vector
rResultVector.reserve( aB2DPolyPolyVector.size() );
@@ -8011,14 +7915,14 @@ sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
rResultVector.push_back(PolyPolygon(*aIt)); // #i76339#
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
+BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
+ BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
{
rPolyPoly.Clear();
@@ -8026,7 +7930,7 @@ sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return sal_False;
+ return FALSE;
// convert and merge into a tool polypolygon
::basegfx::B2DPolyPolygonVector::const_iterator aIt = aB2DPolyPolyVector.begin();
@@ -8034,43 +7938,27 @@ sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
for( unsigned int i = 0; i < aIt->count(); ++i )
rPolyPoly.Insert(Polygon((*aIt).getB2DPolygon( i ))); // #i76339#
- return sal_True;
-}
-
-bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) const
-{
- // we need a graphics
- if( !mpGraphics && !ImplGetGraphics() )
- return false;
-
- if( mbNewFont )
- ImplNewFont();
- if( mbInitFont )
- ImplInitFont();
- if( !mpFontEntry )
- return false;
-
- return mpGraphics->GetImplFontCapabilities(rFontCapabilities);
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
+BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
{
rFontCharMap.Reset();
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
if( mbNewFont )
ImplNewFont();
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return sal_False;
+ return FALSE;
-#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
+ // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
@@ -8083,17 +7971,15 @@ sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
for( i = nUsedItems; --i >= 0; )
if( pFontData == aCache[i].mpFontData )
break;
- if( i >= 0 ) // found in cache
+ if( i >= 0 ) // found in cache
{
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
else // need to cache
-#endif // ENABLE_IFC_CACHE
{
- const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
+ 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;
@@ -8104,12 +7990,11 @@ sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
if( ++nUsedItems >= NMAXITEMS )
nUsedItems = NMAXITEMS;
-#endif // ENABLE_IFC_CACHE
}
if( rFontCharMap.IsDefaultMap() )
- return sal_False;
- return sal_True;
+ return FALSE;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -8120,7 +8005,7 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
if( nIndex >= rStr.Len() )
return nIndex;
xub_StrLen nEnd = nIndex + nLen;
- if( (sal_uLong)nIndex+nLen > rStr.Len() )
+ if( (ULONG)nIndex+nLen > rStr.Len() )
nEnd = rStr.Len();
DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" );
@@ -8130,11 +8015,11 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
const Font aOrigFont = GetFont();
const_cast<OutputDevice&>(*this).SetFont( rTempFont );
FontCharMap aFontCharMap;
- sal_Bool bRet = GetFontCharMap( aFontCharMap );
+ BOOL bRet = GetFontCharMap( aFontCharMap );
const_cast<OutputDevice&>(*this).SetFont( aOrigFont );
// if fontmap is unknown assume it doesn't have the glyphs
- if( bRet == sal_False )
+ if( bRet == FALSE )
return nIndex;
const sal_Unicode* pStr = rStr.GetBuffer();
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 94226e863de5..e550225223d4 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,8 +57,8 @@
// - Defines -
// -----------
-#define HATCH_MAXPOINTS 1024
-#define GRADIENT_DEFAULT_STEPCOUNT 0
+#define HATCH_MAXPOINTS 1024
+#define GRADIENT_DEFAULT_STEPCOUNT 0
// ----------------
// - Cmp-Function -
@@ -87,7 +87,7 @@ void OutputDevice::ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pCl
ImplDrawPolyPolygon( rPoly, pClipPolyPoly );
else
{
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -113,9 +113,9 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if( pPolyPoly->Count() == 1 )
{
- const Polygon rPoly = pPolyPoly->GetObject( 0 );
- sal_uInt16 nSize = rPoly.GetSize();
-
+ const Polygon rPoly = pPolyPoly->GetObject( 0 );
+ USHORT nSize = rPoly.GetSize();
+
if( nSize >= 2 )
{
const SalPoint* pPtAry = (const SalPoint*)rPoly.GetConstPointAry();
@@ -124,17 +124,17 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
}
else if( pPolyPoly->Count() )
{
- sal_uInt16 nCount = pPolyPoly->Count();
- sal_uInt32* pPointAry = new sal_uInt32[nCount];
- PCONSTSALPOINT* pPointAryAry = new PCONSTSALPOINT[nCount];
- sal_uInt16 i = 0;
+ USHORT nCount = pPolyPoly->Count();
+ sal_uInt32* pPointAry = new sal_uInt32[nCount];
+ PCONSTSALPOINT* pPointAryAry = new PCONSTSALPOINT[nCount];
+ USHORT i = 0;
do
{
- const Polygon& rPoly = pPolyPoly->GetObject( i );
- sal_uInt16 nSize = rPoly.GetSize();
+ const Polygon& rPoly = pPolyPoly->GetObject( i );
+ USHORT nSize = rPoly.GetSize();
if ( nSize )
{
- pPointAry[i] = nSize;
+ pPointAry[i] = nSize;
pPointAryAry[i] = (PCONSTSALPOINT)rPoly.GetConstPointAry();
i++;
}
@@ -147,7 +147,7 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
mpGraphics->DrawPolygon( *pPointAry, *pPointAryAry, this );
else
mpGraphics->DrawPolyPolygon( nCount, pPointAry, pPointAryAry, this );
-
+
delete[] pPointAry;
delete[] pPointAryAry;
}
@@ -158,42 +158,59 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
// -----------------------------------------------------------------------
-inline sal_uInt8 ImplGetGradientColorValue( long nValue )
+inline UINT8 ImplGetGradientColorValue( long nValue )
{
if ( nValue < 0 )
return 0;
else if ( nValue > 0xFF )
return 0xFF;
else
- return (sal_uInt8)nValue;
+ return (UINT8)nValue;
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
const Gradient& rGradient,
- sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
+ BOOL bMtf, const PolyPolygon* pClipPolyPoly )
{
// rotiertes BoundRect ausrechnen
- Rectangle aRect;
- Point aCenter;
- sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
-
- rGradient.GetBoundRect( rRect, aRect, aCenter );
+ Rectangle aRect = rRect;
+ aRect.Left()--;
+ aRect.Top()--;
+ aRect.Right()++;
+ aRect.Bottom()++;
+ USHORT nAngle = rGradient.GetAngle() % 3600;
+ double fAngle = nAngle * F_PI1800;
+ double fWidth = aRect.GetWidth();
+ double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) +
+ fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) +
+ fWidth * fabs( sin( fAngle ) );
+ fDX = (fDX - fWidth) * 0.5 + 0.5;
+ fDY = (fDY - fHeight) * 0.5 + 0.5;
+ aRect.Left() -= (long)fDX;
+ aRect.Right() += (long)fDX;
+ aRect.Top() -= (long)fDY;
+ aRect.Bottom() += (long)fDY;
// Rand berechnen und Rechteck neu setzen
- Rectangle aFullRect = aRect;
- long nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100;
+ Point aCenter = rRect.Center();
+ Rectangle aFullRect = aRect;
+ long nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100;
+ BOOL bLinear;
// Rand berechnen und Rechteck neu setzen fuer linearen Farbverlauf
- bool bLinear = (rGradient.GetStyle() == GRADIENT_LINEAR);
- if ( bLinear )
+ if ( rGradient.GetStyle() == GRADIENT_LINEAR )
{
+ bLinear = TRUE;
aRect.Top() += nBorder;
}
// Rand berechnen und Rechteck neu setzen fuer axiale Farbverlauf
else
{
+ bLinear = FALSE;
nBorder >>= 1;
aRect.Top() += nBorder;
@@ -207,35 +224,35 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// Intensitaeten von Start- und Endfarbe ggf. aendern und
// Farbschrittweiten berechnen
- long nFactor;
- Color aStartCol = rGradient.GetStartColor();
- Color aEndCol = rGradient.GetEndColor();
- long nStartRed = aStartCol.GetRed();
- long nStartGreen = aStartCol.GetGreen();
- long nStartBlue = aStartCol.GetBlue();
- long nEndRed = aEndCol.GetRed();
- long nEndGreen = aEndCol.GetGreen();
- long nEndBlue = aEndCol.GetBlue();
- nFactor = rGradient.GetStartIntensity();
- nStartRed = (nStartRed * nFactor) / 100;
+ long nFactor;
+ Color aStartCol = rGradient.GetStartColor();
+ Color aEndCol = rGradient.GetEndColor();
+ long nStartRed = aStartCol.GetRed();
+ long nStartGreen = aStartCol.GetGreen();
+ long nStartBlue = aStartCol.GetBlue();
+ long nEndRed = aEndCol.GetRed();
+ long nEndGreen = aEndCol.GetGreen();
+ long nEndBlue = aEndCol.GetBlue();
+ nFactor = rGradient.GetStartIntensity();
+ nStartRed = (nStartRed * nFactor) / 100;
nStartGreen = (nStartGreen * nFactor) / 100;
- nStartBlue = (nStartBlue * nFactor) / 100;
- nFactor = rGradient.GetEndIntensity();
- nEndRed = (nEndRed * nFactor) / 100;
- nEndGreen = (nEndGreen * nFactor) / 100;
- nEndBlue = (nEndBlue * nFactor) / 100;
- long nRedSteps = nEndRed - nStartRed;
- long nGreenSteps = nEndGreen - nStartGreen;
- long nBlueSteps = nEndBlue - nStartBlue;
+ nStartBlue = (nStartBlue * nFactor) / 100;
+ nFactor = rGradient.GetEndIntensity();
+ nEndRed = (nEndRed * nFactor) / 100;
+ nEndGreen = (nEndGreen * nFactor) / 100;
+ nEndBlue = (nEndBlue * nFactor) / 100;
+ long nRedSteps = nEndRed - nStartRed;
+ long nGreenSteps = nEndGreen - nStartGreen;
+ long nBlueSteps = nEndBlue - nStartBlue;
long nStepCount = rGradient.GetSteps();
// Bei nicht linearen Farbverlaeufen haben wir nur die halben Steps
// pro Farbe
if ( !bLinear )
{
- nRedSteps <<= 1;
+ nRedSteps <<= 1;
nGreenSteps <<= 1;
- nBlueSteps <<= 1;
+ nBlueSteps <<= 1;
}
// Anzahl der Schritte berechnen, falls nichts uebergeben wurde
@@ -281,39 +298,39 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
double fScanInc = (double)aRect.GetHeight() / (double)nSteps;
// Startfarbe berechnen und setzen
- sal_uInt8 nRed;
- sal_uInt8 nGreen;
- sal_uInt8 nBlue;
- long nSteps2;
- long nStepsHalf = 0;
+ UINT8 nRed;
+ UINT8 nGreen;
+ UINT8 nBlue;
+ long nSteps2;
+ long nStepsHalf = 0;
if ( bLinear )
{
// Um 1 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
- nSteps2 = nSteps + 1;
- nRed = (sal_uInt8)nStartRed;
- nGreen = (sal_uInt8)nStartGreen;
- nBlue = (sal_uInt8)nStartBlue;
+ nSteps2 = nSteps + 1;
+ nRed = (UINT8)nStartRed;
+ nGreen = (UINT8)nStartGreen;
+ nBlue = (UINT8)nStartBlue;
}
else
{
// Um 2 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
- nSteps2 = nSteps + 2;
- nRed = (sal_uInt8)nEndRed;
- nGreen = (sal_uInt8)nEndGreen;
- nBlue = (sal_uInt8)nEndBlue;
- nStepsHalf = nSteps >> 1;
+ nSteps2 = nSteps + 2;
+ nRed = (UINT8)nEndRed;
+ nGreen = (UINT8)nEndGreen;
+ nBlue = (UINT8)nEndBlue;
+ nStepsHalf = nSteps >> 1;
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
// Startpolygon erzeugen (== Borderpolygon)
- Polygon aPoly( 4 );
- Polygon aTempPoly( 2 );
+ Polygon aPoly( 4 );
+ Polygon aTempPoly( 2 );
aPoly[0] = aFullRect.TopLeft();
aPoly[1] = aFullRect.TopRight();
aPoly[2] = aRect.TopRight();
@@ -354,9 +371,9 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// fuer lineare FV
if ( bLinear )
{
- nRed = ImplGetGradientColorValue( nStartRed+((nRedSteps*i)/nSteps2) );
- nGreen = ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i)/nSteps2) );
- nBlue = ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i)/nSteps2) );
+ nRed = ImplGetGradientColorValue( nStartRed+((nRedSteps*i)/nSteps2) );
+ nGreen = ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i)/nSteps2) );
+ nBlue = ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i)/nSteps2) );
}
// fuer radiale FV
else
@@ -368,31 +385,31 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// on.
if ( i >= nSteps )
{
- nRed = (sal_uInt8)nEndRed;
- nGreen = (sal_uInt8)nEndGreen;
- nBlue = (sal_uInt8)nEndBlue;
+ nRed = (UINT8)nEndRed;
+ nGreen = (UINT8)nEndGreen;
+ nBlue = (UINT8)nEndBlue;
}
else
{
if ( i <= nStepsHalf )
{
- nRed = ImplGetGradientColorValue( nEndRed-((nRedSteps*i)/nSteps2) );
- nGreen = ImplGetGradientColorValue( nEndGreen-((nGreenSteps*i)/nSteps2) );
- nBlue = ImplGetGradientColorValue( nEndBlue-((nBlueSteps*i)/nSteps2) );
+ nRed = ImplGetGradientColorValue( nEndRed-((nRedSteps*i)/nSteps2) );
+ nGreen = ImplGetGradientColorValue( nEndGreen-((nGreenSteps*i)/nSteps2) );
+ nBlue = ImplGetGradientColorValue( nEndBlue-((nBlueSteps*i)/nSteps2) );
}
// genau die Mitte und hoeher
else
{
long i2 = i - nStepsHalf;
- nRed = ImplGetGradientColorValue( nStartRed+((nRedSteps*i2)/nSteps2) );
- nGreen = ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i2)/nSteps2) );
- nBlue = ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i2)/nSteps2) );
+ nRed = ImplGetGradientColorValue( nStartRed+((nRedSteps*i2)/nSteps2) );
+ nGreen = ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i2)/nSteps2) );
+ nBlue = ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i2)/nSteps2) );
}
}
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -402,7 +419,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
const Gradient& rGradient,
- sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
+ BOOL bMtf, const PolyPolygon* pClipPolyPoly )
{
// Feststellen ob Ausgabe ueber Polygon oder PolyPolygon
// Bei Rasteroperationen ungleich Overpaint immer PolyPolygone,
@@ -413,29 +430,81 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
// Virtuelle Device werden auch ausgeklammert, da einige Treiber
// ansonsten zu langsam sind
PolyPolygon* pPolyPoly;
- Rectangle aRect;
- Point aCenter;
- Color aStartCol( rGradient.GetStartColor() );
- Color aEndCol( rGradient.GetEndColor() );
- long nStartRed = ( (long) aStartCol.GetRed() * rGradient.GetStartIntensity() ) / 100;
- long nStartGreen = ( (long) aStartCol.GetGreen() * rGradient.GetStartIntensity() ) / 100;
- long nStartBlue = ( (long) aStartCol.GetBlue() * rGradient.GetStartIntensity() ) / 100;
- long nEndRed = ( (long) aEndCol.GetRed() * rGradient.GetEndIntensity() ) / 100;
- long nEndGreen = ( (long) aEndCol.GetGreen() * rGradient.GetEndIntensity() ) / 100;
- long nEndBlue = ( (long) aEndCol.GetBlue() * rGradient.GetEndIntensity() ) / 100;
- long nRedSteps = nEndRed - nStartRed;
- long nGreenSteps = nEndGreen - nStartGreen;
- long nBlueSteps = nEndBlue - nStartBlue;
+ Rectangle aRect( rRect );
+ Color aStartCol( rGradient.GetStartColor() );
+ Color aEndCol( rGradient.GetEndColor() );
+ long nStartRed = ( (long) aStartCol.GetRed() * rGradient.GetStartIntensity() ) / 100;
+ long nStartGreen = ( (long) aStartCol.GetGreen() * rGradient.GetStartIntensity() ) / 100;
+ long nStartBlue = ( (long) aStartCol.GetBlue() * rGradient.GetStartIntensity() ) / 100;
+ long nEndRed = ( (long) aEndCol.GetRed() * rGradient.GetEndIntensity() ) / 100;
+ long nEndGreen = ( (long) aEndCol.GetGreen() * rGradient.GetEndIntensity() ) / 100;
+ long nEndBlue = ( (long) aEndCol.GetBlue() * rGradient.GetEndIntensity() ) / 100;
+ long nRedSteps = nEndRed - nStartRed;
+ long nGreenSteps = nEndGreen - nStartGreen;
+ long nBlueSteps = nEndBlue - nStartBlue;
long nStepCount = rGradient.GetSteps();
- sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
-
- rGradient.GetBoundRect( rRect, aRect, aCenter );
-
+ USHORT nAngle = rGradient.GetAngle() % 3600;
+
if( (meRasterOp != ROP_OVERPAINT) || (meOutDevType != OUTDEV_WINDOW) || bMtf )
pPolyPoly = new PolyPolygon( 2 );
else
pPolyPoly = NULL;
+ if( rGradient.GetStyle() == GRADIENT_SQUARE || rGradient.GetStyle() == GRADIENT_RECT )
+ {
+ const double fAngle = nAngle * F_PI1800;
+ const double fWidth = aRect.GetWidth();
+ const double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
+
+ fDX = ( fDX - fWidth ) * 0.5 + 0.5;
+ fDY = ( fDY - fHeight ) * 0.5 + 0.5;
+
+ aRect.Left() -= (long) fDX;
+ aRect.Right() += (long) fDX;
+ aRect.Top() -= (long) fDY;
+ aRect.Bottom() += (long) fDY;
+ }
+
+ Size aSize( aRect.GetSize() );
+
+ if( rGradient.GetStyle() == GRADIENT_RADIAL )
+ {
+ // Radien-Berechnung fuer Kreis
+ aSize.Width() = (long)(0.5 + sqrt((double)aSize.Width()*(double)aSize.Width() + (double)aSize.Height()*(double)aSize.Height()));
+ aSize.Height() = aSize.Width();
+ }
+ else if( rGradient.GetStyle() == GRADIENT_ELLIPTICAL )
+ {
+ // Radien-Berechnung fuer Ellipse
+ aSize.Width() = (long)( 0.5 + (double) aSize.Width() * 1.4142 );
+ aSize.Height() = (long)( 0.5 + (double) aSize.Height() * 1.4142 );
+ }
+ else if( rGradient.GetStyle() == GRADIENT_SQUARE )
+ {
+ if ( aSize.Width() > aSize.Height() )
+ aSize.Height() = aSize.Width();
+ else
+ aSize.Width() = aSize.Height();
+ }
+
+ // neue Mittelpunkte berechnen
+ long nZWidth = aRect.GetWidth() * (long) rGradient.GetOfsX() / 100;
+ long nZHeight = aRect.GetHeight() * (long) rGradient.GetOfsY() / 100;
+ long nBorderX = (long) rGradient.GetBorder() * aSize.Width() / 100;
+ long nBorderY = (long) rGradient.GetBorder() * aSize.Height() / 100;
+ Point aCenter( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
+
+ // Rand beruecksichtigen
+ aSize.Width() -= nBorderX;
+ aSize.Height() -= nBorderY;
+
+ // Ausgaberechteck neu setzen
+ aRect.Left() = aCenter.X() - ( aSize.Width() >> 1 );
+ aRect.Top() = aCenter.Y() - ( aSize.Height() >> 1 );
+
+ aRect.SetSize( aSize );
long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() );
// Anzahl der Schritte berechnen, falls nichts uebergeben wurde
@@ -458,7 +527,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
nStepCount = nMinRect / nInc;
}
-
+
// minimal drei Schritte und maximal die Anzahl der Farbunterschiede
long nSteps = Max( nStepCount, 2L );
long nCalcSteps = Abs( nRedSteps );
@@ -480,16 +549,16 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
double fScanRight = aRect.Right();
double fScanBottom = aRect.Bottom();
double fScanInc = (double) nMinRect / (double) nSteps * 0.5;
- 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
+ UINT8 nRed = (UINT8) nStartRed, nGreen = (UINT8) nStartGreen, nBlue = (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 ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
if( pPolyPoly )
- {
+ {
pPolyPoly->Insert( aPoly = rRect );
pPolyPoly->Insert( aPoly );
}
@@ -552,7 +621,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 ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -560,7 +629,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
{
// #107349# Set fill color _before_ geometry painting
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -572,7 +641,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
if( pPolyPoly )
{
const Polygon& rPoly = pPolyPoly->GetObject( 1 );
-
+
if( !rPoly.GetBoundRect().IsEmpty() )
{
// #107349# Paint last polygon with end color only if loop
@@ -587,7 +656,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
if( bMtf )
{
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
}
else
@@ -606,7 +675,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
void OutputDevice::DrawGradient( const Rectangle& rRect,
const Gradient& rGradient )
{
- OSL_TRACE( "OutputDevice::DrawGradient()" );
+ DBG_TRACE( "OutputDevice::DrawGradient()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
@@ -625,7 +694,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
{
- aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
+ aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
( aColor.GetGreen() >> 1 ) | 0x80,
( aColor.GetBlue() >> 1 ) | 0x80 );
}
@@ -647,18 +716,18 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
-
+
if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
{
- aStartCol = Color( ( aStartCol.GetRed() >> 1 ) | 0x80,
+ aStartCol = Color( ( aStartCol.GetRed() >> 1 ) | 0x80,
( aStartCol.GetGreen() >> 1 ) | 0x80,
( aStartCol.GetBlue() >> 1 ) | 0x80 );
- aEndCol = Color( ( aEndCol.GetRed() >> 1 ) | 0x80,
+ aEndCol = Color( ( aEndCol.GetRed() >> 1 ) | 0x80,
( aEndCol.GetGreen() >> 1 ) | 0x80,
( aEndCol.GetBlue() >> 1 ) | 0x80 );
}
@@ -672,7 +741,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
-
+
// Rechteck in Pixel umrechnen
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
aRect.Justify();
@@ -700,26 +769,26 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mbInitClipRegion )
ImplInitClipRegion();
-
+
if ( !mbOutputClipped )
{
// Gradienten werden ohne Umrandung gezeichnet
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
-
- mbInitFillColor = sal_True;
+
+ mbInitFillColor = 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, sal_False, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, FALSE, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, sal_False, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, FALSE, NULL );
}
Pop();
@@ -737,13 +806,13 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
const Gradient& rGradient )
{
- OSL_TRACE( "OutputDevice::DrawGradient()" );
+ DBG_TRACE( "OutputDevice::DrawGradient()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
if( mbInitClipRegion )
ImplInitClipRegion();
-
+
if( mbOutputClipped )
return;
@@ -766,7 +835,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
{
- aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
+ aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
( aColor.GetGreen() >> 1 ) | 0x80,
( aColor.GetBlue() >> 1 ) | 0x80 );
}
@@ -781,7 +850,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( mpMetaFile )
{
- const Rectangle aRect( rPolyPoly.GetBoundRect() );
+ const Rectangle aRect( rPolyPoly.GetBoundRect() );
mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_BEGIN" ) );
mpMetaFile->AddAction( new MetaGradientExAction( rPolyPoly, rGradient ) );
@@ -795,9 +864,9 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
}
else
{
- const sal_Bool bOldOutput = IsOutputEnabled();
+ const BOOL bOldOutput = IsOutputEnabled();
- EnableOutput( sal_False );
+ EnableOutput( FALSE );
Push( PUSH_RASTEROP );
SetRasterOp( ROP_XOR );
DrawGradient( aRect, rGradient );
@@ -825,18 +894,18 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
-
+
if ( mnDrawMode & DRAWMODE_GHOSTEDGRADIENT )
{
- aStartCol = Color( ( aStartCol.GetRed() >> 1 ) | 0x80,
+ aStartCol = Color( ( aStartCol.GetRed() >> 1 ) | 0x80,
( aStartCol.GetGreen() >> 1 ) | 0x80,
( aStartCol.GetBlue() >> 1 ) | 0x80 );
- aEndCol = Color( ( aEndCol.GetRed() >> 1 ) | 0x80,
+ aEndCol = Color( ( aEndCol.GetRed() >> 1 ) | 0x80,
( aEndCol.GetGreen() >> 1 ) | 0x80,
( aEndCol.GetBlue() >> 1 ) | 0x80 );
}
@@ -847,7 +916,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( OUTDEV_PRINTER == meOutDevType || ImplGetSVData()->maGDIData.mbNoXORClipping )
{
- const Rectangle aBoundRect( rPolyPoly.GetBoundRect() );
+ const Rectangle aBoundRect( rPolyPoly.GetBoundRect() );
if( !Rectangle( PixelToLogic( Point() ), GetOutputSize() ).IsEmpty() )
{
@@ -863,7 +932,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( mbInitClipRegion )
ImplInitClipRegion();
-
+
if( !mbOutputClipped )
{
PolyPolygon aClipPolyPoly( ImplLogicToDevicePixel( rPolyPoly ) );
@@ -872,48 +941,48 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = sal_True;
+ mbInitLineColor = TRUE;
}
-
- mbInitFillColor = sal_True;
+
+ mbInitFillColor = 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, sal_False, &aClipPolyPoly );
+ ImplDrawLinearGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
else
- ImplDrawComplexGradient( aRect, aGradient, sal_False, &aClipPolyPoly );
+ ImplDrawComplexGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
}
}
}
}
else
{
- const PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
- const Rectangle aBoundRect( aPolyPoly.GetBoundRect() );
+ const PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
+ const Rectangle aBoundRect( aPolyPoly.GetBoundRect() );
Point aPoint;
- Rectangle aDstRect( aPoint, GetOutputSizePixel() );
+ Rectangle aDstRect( aPoint, GetOutputSizePixel() );
aDstRect.Intersection( aBoundRect );
if( OUTDEV_WINDOW == meOutDevType )
{
const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
-
+
if( !aPaintRgn.IsNull() )
aDstRect.Intersection( LogicToPixel( aPaintRgn ).GetBoundRect() );
}
if( !aDstRect.IsEmpty() )
{
- VirtualDevice* pVDev;
- const Size aDstSize( aDstRect.GetSize() );
+ VirtualDevice* pVDev;
+ const Size aDstSize( aDstRect.GetSize() );
if( HasAlpha() )
{
- // #110958# Pay attention to alpha VDevs here, otherwise,
+ // #110958# Pay attention to alpha VDevs here, otherwise,
// background will be wrong: Temp VDev has to have alpha, too.
pVDev = new VirtualDevice( *this, 0, GetAlphaBitCount() > 1 ? 0 : 1 );
}
@@ -925,10 +994,10 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( pVDev->SetOutputSizePixel( aDstSize) )
{
- MapMode aVDevMap;
- const sal_Bool bOldMap = mbMap;
+ MapMode aVDevMap;
+ const BOOL bOldMap = mbMap;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
pVDev->DrawOutDev( Point(), aDstSize, aDstRect.TopLeft(), aDstSize, *this );
pVDev->SetRasterOp( ROP_XOR );
@@ -971,13 +1040,13 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
// Wenn Rechteck leer ist, brauchen wir nichts machen
if ( !aRect.IsEmpty() )
{
- Gradient aGradient( rGradient );
- GDIMetaFile* pOldMtf = mpMetaFile;
+ Gradient aGradient( rGradient );
+ GDIMetaFile* pOldMtf = mpMetaFile;
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
mpMetaFile->AddAction( new MetaISectRectClipRegionAction( aRect ) );
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), 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 +1060,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, sal_True, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, TRUE, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, sal_True, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, TRUE, NULL );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
@@ -1004,12 +1073,12 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch )
{
- OSL_TRACE( "OutputDevice::DrawHatch()" );
+ DBG_TRACE( "OutputDevice::DrawHatch()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Hatch aHatch( rHatch );
- if ( mnDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
+ if ( mnDrawMode & ( DRAWMODE_BLACKLINE | DRAWMODE_WHITELINE |
DRAWMODE_GRAYLINE | DRAWMODE_GHOSTEDLINE |
DRAWMODE_SETTINGSLINE ) )
{
@@ -1021,7 +1090,7 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const sal_uInt8 cLum = aColor.GetLuminance();
+ const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1031,8 +1100,8 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
if ( mnDrawMode & DRAWMODE_GHOSTEDLINE )
{
- aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
- ( aColor.GetGreen() >> 1 ) | 0x80,
+ aColor = Color( ( aColor.GetRed() >> 1 ) | 0x80,
+ ( aColor.GetGreen() >> 1 ) | 0x80,
( aColor.GetBlue() >> 1 ) | 0x80);
}
@@ -1055,20 +1124,20 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
return;
if( rPolyPoly.Count() )
- {
- PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- sal_Bool bOldMap = mbMap;
+ {
+ PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ BOOL bOldMap = mbMap;
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
aHatch.SetDistance( ImplLogicWidthToDevicePixel( aHatch.GetDistance() ) );
mpMetaFile = NULL;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
Push( PUSH_LINECOLOR );
SetLineColor( aHatch.GetColor() );
ImplInitLineColor();
- ImplDrawHatch( aPolyPoly, aHatch, sal_False );
+ ImplDrawHatch( aPolyPoly, aHatch, FALSE );
Pop();
EnableMapMode( bOldMap );
mpMetaFile = pOldMetaFile;
@@ -1085,17 +1154,17 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- PolyPolygon aPolyPoly( rPolyPoly );
+ PolyPolygon aPolyPoly( rPolyPoly );
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME | POLY_OPTIMIZE_CLOSE );
if( aPolyPoly.Count() )
- {
+ {
GDIMetaFile* pOldMtf = mpMetaFile;
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
- mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), sal_True ) );
- ImplDrawHatch( aPolyPoly, rHatch, sal_True );
+ mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), TRUE ) );
+ ImplDrawHatch( aPolyPoly, rHatch, TRUE );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
}
@@ -1103,14 +1172,14 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf )
+void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf )
{
- Rectangle aRect( rPolyPoly.GetBoundRect() );
- const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
- const long nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) );
- Point* pPtBuffer = new Point[ HATCH_MAXPOINTS ];
- Point aPt1, aPt2, aEndPt1;
- Size aInc;
+ Rectangle aRect( rPolyPoly.GetBoundRect() );
+ const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
+ const long nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) );
+ Point* pPtBuffer = new Point[ HATCH_MAXPOINTS ];
+ Point aPt1, aPt2, aEndPt1;
+ Size aInc;
// Single hatch
aRect.Left() -= nLogPixelWidth; aRect.Top() -= nLogPixelWidth; aRect.Right() += nLogPixelWidth; aRect.Bottom() += nLogPixelWidth;
@@ -1154,12 +1223,12 @@ void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHa
// -----------------------------------------------------------------------
-void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10,
+void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10,
Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 )
{
- Point aRef;
- long nAngle = nAngle10 % 1800;
- long nOffset = 0;
+ Point aRef;
+ long nAngle = nAngle10 % 1800;
+ long nOffset = 0;
if( nAngle > 900 )
nAngle -= 1800;
@@ -1198,10 +1267,10 @@ void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_
}
else if( nAngle >= -450 && nAngle <= 450 )
{
- const double fAngle = F_PI1800 * labs( nAngle );
- const double fTan = tan( fAngle );
- const long nYOff = FRound( ( rRect.Right() - rRect.Left() ) * fTan );
- long nPY;
+ const double fAngle = F_PI1800 * labs( nAngle );
+ const double fTan = tan( fAngle );
+ const long nYOff = FRound( ( rRect.Right() - rRect.Left() ) * fTan );
+ long nPY;
rInc = Size( 0, nDist = FRound( nDist / cos( fAngle ) ) );
@@ -1232,8 +1301,8 @@ void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_
{
const double fAngle = F_PI1800 * labs( nAngle );
const double fTan = tan( fAngle );
- const long nXOff = FRound( ( rRect.Bottom() - rRect.Top() ) / fTan );
- long nPX;
+ const long nXOff = FRound( ( rRect.Bottom() - rRect.Top() ) / fTan );
+ long nPX;
rInc = Size( nDist = FRound( nDist / sin( fAngle ) ), 0 );
@@ -1265,45 +1334,45 @@ void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_
// ------------------------------------------------------------------------
void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly,
- Point* pPtBuffer, sal_Bool bMtf )
+ Point* pPtBuffer, BOOL bMtf )
{
- double fX, fY;
- long nAdd, nPCounter = 0;
+ double fX, fY;
+ long nAdd, nPCounter = 0;
for( long nPoly = 0, nPolyCount = rPolyPoly.Count(); nPoly < nPolyCount; nPoly++ )
{
- const Polygon& rPoly = rPolyPoly[ (sal_uInt16) nPoly ];
+ const Polygon& rPoly = rPolyPoly[ (USHORT) nPoly ];
if( rPoly.GetSize() > 1 )
{
- Line aCurSegment( rPoly[ 0 ], Point() );
+ Line aCurSegment( rPoly[ 0 ], Point() );
for( long i = 1, nCount = rPoly.GetSize(); i <= nCount; i++ )
{
- aCurSegment.SetEnd( rPoly[ (sal_uInt16)( i % nCount ) ] );
+ aCurSegment.SetEnd( rPoly[ (USHORT)( i % nCount ) ] );
nAdd = 0;
if( rLine.Intersection( aCurSegment, fX, fY ) )
{
- if( ( fabs( fX - aCurSegment.GetStart().X() ) <= 0.0000001 ) &&
+ if( ( fabs( fX - aCurSegment.GetStart().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetStart().Y() ) <= 0.0000001 ) )
{
- 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() );
+ const Line aPrevSegment( rPoly[ (USHORT)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() );
+ const double fPrevDistance = rLine.GetDistance( aPrevSegment.GetStart() );
+ const double fCurDistance = rLine.GetDistance( aCurSegment.GetEnd() );
- if( ( fPrevDistance <= 0.0 && fCurDistance > 0.0 ) ||
+ if( ( fPrevDistance <= 0.0 && fCurDistance > 0.0 ) ||
( fPrevDistance > 0.0 && fCurDistance < 0.0 ) )
{
nAdd = 1;
}
}
- else if( ( fabs( fX - aCurSegment.GetEnd().X() ) <= 0.0000001 ) &&
+ else if( ( fabs( fX - aCurSegment.GetEnd().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetEnd().Y() ) <= 0.0000001 ) )
{
- const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (sal_uInt16)( ( i + 1 ) % nCount ) ] );
+ const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (USHORT)( ( i + 1 ) % nCount ) ] );
- if( ( fabs( rLine.GetDistance( aNextSegment.GetEnd() ) ) <= 0.0000001 ) &&
+ if( ( fabs( rLine.GetDistance( aNextSegment.GetEnd() ) ) <= 0.0000001 ) &&
( rLine.GetDistance( aCurSegment.GetStart() ) > 0.0 ) )
{
nAdd = 1;
diff --git a/vcl/source/gdi/outdev5.cxx b/vcl/source/gdi/outdev5.cxx
index 2df0ff86dc3e..deae3b9de4f3 100644
--- a/vcl/source/gdi/outdev5.cxx
+++ b/vcl/source/gdi/outdev5.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,9 +49,9 @@ DBG_NAMEEX( OutputDevice )
// =======================================================================
void OutputDevice::DrawRect( const Rectangle& rRect,
- sal_uLong nHorzRound, sal_uLong nVertRound )
+ ULONG nHorzRound, ULONG nVertRound )
{
- OSL_TRACE( "OutputDevice::DrawRoundRect()" );
+ DBG_TRACE( "OutputDevice::DrawRoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -94,7 +94,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect,
if ( aRoundRectPoly.GetSize() >= 2 )
{
const SalPoint* pPtAry = (const SalPoint*) aRoundRectPoly.GetConstPointAry();
-
+
if ( !mbFillColor )
mpGraphics->DrawPolyLine( aRoundRectPoly.GetSize(), pPtAry, this );
else
@@ -110,13 +110,13 @@ void OutputDevice::DrawRect( const Rectangle& rRect,
void OutputDevice::DrawEllipse( const Rectangle& rRect )
{
- OSL_TRACE( "OutputDevice::DrawEllipse()" );
+ DBG_TRACE( "OutputDevice::DrawEllipse()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaEllipseAction( rRect ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -161,7 +161,7 @@ void OutputDevice::DrawEllipse( const Rectangle& rRect )
void OutputDevice::DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt )
{
- OSL_TRACE( "OutputDevice::DrawArc()" );
+ DBG_TRACE( "OutputDevice::DrawArc()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -189,9 +189,9 @@ void OutputDevice::DrawArc( const Rectangle& rRect,
if ( mbInitLineColor )
ImplInitLineColor();
- const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
- const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
- Polygon aArcPoly( aRect, aStart, aEnd, POLY_ARC );
+ const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
+ const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
+ Polygon aArcPoly( aRect, aStart, aEnd, POLY_ARC );
if ( aArcPoly.GetSize() >= 2 )
{
@@ -208,7 +208,7 @@ void OutputDevice::DrawArc( const Rectangle& rRect,
void OutputDevice::DrawPie( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt )
{
- OSL_TRACE( "OutputDevice::DrawPie()" );
+ DBG_TRACE( "OutputDevice::DrawPie()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -236,9 +236,9 @@ void OutputDevice::DrawPie( const Rectangle& rRect,
if ( mbInitLineColor )
ImplInitLineColor();
- const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
- const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
- Polygon aPiePoly( aRect, aStart, aEnd, POLY_PIE );
+ const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
+ const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
+ Polygon aPiePoly( aRect, aStart, aEnd, POLY_PIE );
if ( aPiePoly.GetSize() >= 2 )
{
@@ -262,7 +262,7 @@ void OutputDevice::DrawPie( const Rectangle& rRect,
void OutputDevice::DrawChord( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt )
{
- OSL_TRACE( "OutputDevice::DrawChord()" );
+ DBG_TRACE( "OutputDevice::DrawChord()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
@@ -290,9 +290,9 @@ void OutputDevice::DrawChord( const Rectangle& rRect,
if ( mbInitLineColor )
ImplInitLineColor();
- const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
- const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
- Polygon aChordPoly( aRect, aStart, aEnd, POLY_CHORD );
+ const Point aStart( ImplLogicToDevicePixel( rStartPt ) );
+ const Point aEnd( ImplLogicToDevicePixel( rEndPt ) );
+ Polygon aChordPoly( aRect, aStart, aEnd, POLY_CHORD );
if ( aChordPoly.GetSize() >= 2 )
{
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 92898ebfdf3a..bf26e1711b10 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -58,9 +58,9 @@ DBG_NAMEEX( OutputDevice )
// ------------------------------------------------------------------------
-void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags )
+void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags )
{
- OSL_TRACE( "OutputDevice::DrawGrid()" );
+ DBG_TRACE( "OutputDevice::DrawGrid()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() );
@@ -78,18 +78,18 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon
if( mbOutputClipped )
return;
- const long nDistX = Max( rDist.Width(), 1L );
- const long nDistY = Max( rDist.Height(), 1L );
- long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX );
- long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY );
- const long nRight = aDstRect.Right();
- const long nBottom = aDstRect.Bottom();
- const long nStartX = ImplLogicXToDevicePixel( nX );
- const long nEndX = ImplLogicXToDevicePixel( nRight );
- const long nStartY = ImplLogicYToDevicePixel( nY );
- const long nEndY = ImplLogicYToDevicePixel( nBottom );
- long nHorzCount = 0L;
- long nVertCount = 0L;
+ const long nDistX = Max( rDist.Width(), 1L );
+ const long nDistY = Max( rDist.Height(), 1L );
+ long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX );
+ long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY );
+ const long nRight = aDstRect.Right();
+ const long nBottom = aDstRect.Bottom();
+ const long nStartX = ImplLogicXToDevicePixel( nX );
+ const long nEndX = ImplLogicXToDevicePixel( nRight );
+ const long nStartY = ImplLogicYToDevicePixel( nY );
+ const long nEndY = ImplLogicYToDevicePixel( nBottom );
+ long nHorzCount = 0L;
+ long nVertCount = 0L;
::com::sun::star::uno::Sequence< sal_Int32 > aVertBuf;
::com::sun::star::uno::Sequence< sal_Int32 > aHorzBuf;
@@ -116,8 +116,8 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon
if( mbInitFillColor )
ImplInitFillColor();
- const sal_Bool bOldMap = mbMap;
- EnableMapMode( sal_False );
+ const BOOL bOldMap = mbMap;
+ EnableMapMode( FALSE );
if( nFlags & GRID_DOTS )
{
@@ -159,7 +159,7 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon
void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency)
{
- OSL_TRACE( "OutputDevice::DrawTransparent(B2D&,transparency)" );
+ DBG_TRACE( "OutputDevice::DrawTransparent(B2D&,transparency)" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
// AW: Do NOT paint empty PolyPolygons
@@ -181,7 +181,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
if( mbInitFillColor )
ImplInitFillColor();
- if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
+ if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW)
&& mpGraphics->supportsOperation(OutDevSupport_B2DDraw)
&& ROP_OVERPAINT == GetRasterOp() )
{
@@ -192,7 +192,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
// transform the polygon into device space and ensure it is closed
aB2DPolyPolygon.transform( aTransform );
aB2DPolyPolygon.setClosed( true );
-
+
bool bDrawnOk = true;
if( IsFillColor() )
bDrawnOk = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this );
@@ -223,9 +223,9 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
// ------------------------------------------------------------------------
void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
- sal_uInt16 nTransparencePercent )
+ USHORT nTransparencePercent )
{
- OSL_TRACE( "OutputDevice::DrawTransparent()" );
+ DBG_TRACE( "OutputDevice::DrawTransparent()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
// short circuit for drawing an opaque polygon
@@ -268,7 +268,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
// try hard to draw it directly, because the emulation layers are slower
if( !pDisableNative
- && mpGraphics->supportsOperation( OutDevSupport_B2DDraw )
+ && mpGraphics->supportsOperation( OutDevSupport_B2DDraw )
#if defined UNX && ! defined QUARTZ
&& GetBitCount() > 8
#endif
@@ -341,11 +341,11 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
return;
}
- Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
- const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
- const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L );
- long nMove;
- const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
+ Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
+ 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 :
( 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 sal_Bool bOldMap = mbMap;
- EnableMapMode( sal_False );
+ const BOOL bOldMap = mbMap;
+ EnableMapMode( FALSE );
if(nMove)
{
@@ -396,10 +396,10 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
}
else
{
- PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
- Rectangle aPolyRect( aPolyPoly.GetBoundRect() );
- Point aPoint;
- Rectangle aDstRect( aPoint, GetOutputSizePixel() );
+ PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
+ Rectangle aPolyRect( aPolyPoly.GetBoundRect() );
+ Point aPoint;
+ Rectangle aDstRect( aPoint, GetOutputSizePixel() );
aDstRect.Intersection( aPolyRect );
@@ -424,25 +424,25 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( 1 )
{
if ( mbInitClipRegion )
- ImplInitClipRegion();
+ ImplInitClipRegion();
if ( mbInitLineColor )
ImplInitLineColor();
if ( mbInitFillColor )
ImplInitFillColor();
-
+
Rectangle aLogicPolyRect( rPolyPoly.GetBoundRect() );
Rectangle aPixelRect( ImplLogicToDevicePixel( aLogicPolyRect ) );
if( !mbOutputClipped )
{
- bDrawn = mpGraphics->DrawAlphaRect(
- aPixelRect.Left(), aPixelRect.Top(),
+ bDrawn = mpGraphics->DrawAlphaRect(
+ aPixelRect.Left(), aPixelRect.Top(),
// #i98405# use methods with small g, else one pixel too much will be painted.
// This is because the source is a polygon which when painted would not paint
- // the rightmost and lowest pixel line(s), so use one pixel less for the
+ // the rightmost and lowest pixel line(s), so use one pixel less for the
// rectangle, too.
aPixelRect.getWidth(), aPixelRect.getHeight(),
- sal::static_int_cast<sal_uInt8>(nTransparencePercent),
+ sal::static_int_cast<sal_uInt8>(nTransparencePercent),
this );
}
else
@@ -452,64 +452,64 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( !bDrawn )
{
- VirtualDevice aVDev( *this, 1 );
- const Size aDstSz( aDstRect.GetSize() );
- const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
+ VirtualDevice aVDev( *this, 1 );
+ const Size aDstSz( aDstRect.GetSize() );
+ const BYTE cTrans = (BYTE) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
if( aDstRect.Left() || aDstRect.Top() )
aPolyPoly.Move( -aDstRect.Left(), -aDstRect.Top() );
if( aVDev.SetOutputSizePixel( aDstSz ) )
{
- const sal_Bool bOldMap = mbMap;
+ const BOOL bOldMap = mbMap;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
aVDev.SetLineColor( COL_BLACK );
aVDev.SetFillColor( COL_BLACK );
aVDev.DrawPolyPolygon( aPolyPoly );
- Bitmap aPaint( GetBitmap( aDstRect.TopLeft(), aDstSz ) );
- Bitmap aPolyMask( aVDev.GetBitmap( Point(), aDstSz ) );
+ Bitmap aPaint( GetBitmap( aDstRect.TopLeft(), aDstSz ) );
+ Bitmap aPolyMask( aVDev.GetBitmap( Point(), aDstSz ) );
// #107766# check for non-empty bitmaps before accessing them
if( !!aPaint && !!aPolyMask )
{
- BitmapWriteAccess* pW = aPaint.AcquireWriteAccess();
- BitmapReadAccess* pR = aPolyMask.AcquireReadAccess();
+ BitmapWriteAccess* pW = aPaint.AcquireWriteAccess();
+ BitmapReadAccess* pR = aPolyMask.AcquireReadAccess();
if( pW && pR )
{
- BitmapColor aPixCol;
- const BitmapColor aFillCol( GetFillColor() );
- const BitmapColor aWhite( pR->GetBestMatchingColor( Color( COL_WHITE ) ) );
- const BitmapColor aBlack( pR->GetBestMatchingColor( Color( COL_BLACK ) ) );
- const long nWidth = pW->Width(), nHeight = pW->Height();
- const long nR = aFillCol.GetRed(), nG = aFillCol.GetGreen(), nB = aFillCol.GetBlue();
- long nX, nY;
+ BitmapColor aPixCol;
+ const BitmapColor aFillCol( GetFillColor() );
+ const BitmapColor aWhite( pR->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aBlack( pR->GetBestMatchingColor( Color( COL_BLACK ) ) );
+ const long nWidth = pW->Width(), nHeight = pW->Height();
+ const long nR = aFillCol.GetRed(), nG = aFillCol.GetGreen(), nB = aFillCol.GetBlue();
+ long nX, nY;
if( aPaint.GetBitCount() <= 8 )
{
- const BitmapPalette& rPal = pW->GetPalette();
- const sal_uInt16 nCount = rPal.GetEntryCount();
- BitmapColor* pMap = (BitmapColor*) new sal_uInt8[ nCount * sizeof( BitmapColor ) ];
+ const BitmapPalette& rPal = pW->GetPalette();
+ const USHORT nCount = rPal.GetEntryCount();
+ BitmapColor* pMap = (BitmapColor*) new BYTE[ nCount * sizeof( BitmapColor ) ];
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ for( USHORT i = 0; i < nCount; i++ )
{
BitmapColor aCol( rPal[ i ] );
- pMap[ i ] = BitmapColor( (sal_uInt8) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
+ pMap[ i ] = BitmapColor( (BYTE) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
}
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
- const sal_uInt8 cBlack = aBlack.GetIndex();
+ const BYTE cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
- Scanline pWScan = pW->GetScanline( nY );
- Scanline pRScan = pR->GetScanline( nY );
- sal_uInt8 cBit = 128;
+ Scanline pWScan = pW->GetScanline( nY );
+ Scanline pRScan = pR->GetScanline( nY );
+ BYTE 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 = (sal_uInt8) pMap[ *pWScan ].GetIndex();
+ *pWScan = (BYTE) pMap[ *pWScan ].GetIndex();
}
}
}
@@ -529,20 +529,20 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
pW->SetPixel( nY, nX, pMap[ pW->GetPixel( nY, nX ).GetIndex() ] );
}
- delete[] (sal_uInt8*) pMap;
+ delete[] (BYTE*) pMap;
}
else
{
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR )
{
- const sal_uInt8 cBlack = aBlack.GetIndex();
+ const BYTE cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
- Scanline pWScan = pW->GetScanline( nY );
- Scanline pRScan = pR->GetScanline( nY );
- sal_uInt8 cBit = 128;
+ Scanline pWScan = pW->GetScanline( nY );
+ Scanline pRScan = pR->GetScanline( nY );
+ BYTE 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<sal_uInt8>(255*nTransparencePercent/100),
- sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
- sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100)) );
+ 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->DrawTransparent( rPolyPoly, nTransparencePercent );
@@ -622,7 +622,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
const Size& rSize, const Gradient& rTransparenceGradient )
{
- OSL_TRACE( "OutputDevice::DrawTransparent()" );
+ DBG_TRACE( "OutputDevice::DrawTransparent()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
const Color aBlack( COL_BLACK );
@@ -639,10 +639,10 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
}
else
{
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- Rectangle aOutRect( LogicToPixel( rPos ), LogicToPixel( rSize ) );
- Point aPoint;
- Rectangle aDstRect( aPoint, GetOutputSizePixel() );
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ Rectangle aOutRect( LogicToPixel( rPos ), LogicToPixel( rSize ) );
+ Point aPoint;
+ Rectangle aDstRect( aPoint, GetOutputSizePixel() );
mpMetaFile = NULL;
aDstRect.Intersection( aOutRect );
@@ -686,7 +686,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
// copy MapMode state and disable for buffer
const bool bBufferMapModeEnabled(pVDev->IsMapModeEnabled());
pVDev->EnableMapMode(false);
-
+
// copy content from original to buffer
pVDev->DrawOutDev(
aPoint, pVDev->GetOutputSizePixel(), // dest
@@ -711,31 +711,29 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
pVDev->EnableMapMode(false);
const AlphaMask aAlpha(pVDev->GetBitmap(aPoint, pVDev->GetOutputSizePixel()));
- delete pVDev;
-
// draw masked content to target and restore MapMode
DrawBitmapEx(aDstRect.TopLeft(), BitmapEx(aPaint, aAlpha));
EnableMapMode(bOrigMapModeEnabled);
}
else
{
- Bitmap aPaint, aMask;
- AlphaMask aAlpha;
- MapMode aMap( GetMapMode() );
- Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
- const sal_Bool bOldMap = mbMap;
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ MapMode aMap( GetMapMode() );
+ Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
+ const BOOL bOldMap = mbMap;
aMap.SetOrigin( Point( -aOutPos.X(), -aOutPos.Y() ) );
pVDev->SetMapMode( aMap );
- const sal_Bool bVDevOldMap = pVDev->IsMapModeEnabled();
+ const BOOL bVDevOldMap = pVDev->IsMapModeEnabled();
// create paint bitmap
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( sal_False );
+ pVDev->EnableMapMode( FALSE );
aPaint = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
// create mask bitmap
pVDev->SetLineColor( COL_BLACK );
@@ -746,22 +744,22 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( sal_False );
+ pVDev->EnableMapMode( FALSE );
aMask = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
// create alpha mask from gradient
pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
pVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
pVDev->SetDrawMode( DRAWMODE_DEFAULT );
- pVDev->EnableMapMode( sal_False );
+ pVDev->EnableMapMode( FALSE );
pVDev->DrawMask( Point(), pVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
aAlpha = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
delete pVDev;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha ) );
EnableMapMode( bOldMap );
}
@@ -785,8 +783,8 @@ void OutputDevice::ImplDrawColorWallpaper( long nX, long nY,
Color aOldFillColor = GetFillColor();
SetLineColor();
SetFillColor( rWallpaper.GetColor() );
- sal_Bool bMap = mbMap;
- EnableMapMode( sal_False );
+ BOOL bMap = mbMap;
+ EnableMapMode( FALSE );
DrawRect( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
SetLineColor( aOldLineColor );
SetFillColor( aOldFillColor );
@@ -799,16 +797,16 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
long nWidth, long nHeight,
const Wallpaper& rWallpaper )
{
- BitmapEx aBmpEx;
- const BitmapEx* pCached = rWallpaper.ImplGetImpWallpaper()->ImplGetCachedBitmap();
- Point aPos;
- Size aSize;
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- const WallpaperStyle eStyle = rWallpaper.GetStyle();
- const sal_Bool bOldMap = mbMap;
- sal_Bool bDrawn = sal_False;
- sal_Bool bDrawGradientBackground = sal_False;
- sal_Bool bDrawColorBackground = sal_False;
+ BitmapEx aBmpEx;
+ const BitmapEx* pCached = rWallpaper.ImplGetImpWallpaper()->ImplGetCachedBitmap();
+ Point aPos;
+ Size aSize;
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ const WallpaperStyle eStyle = rWallpaper.GetStyle();
+ const BOOL bOldMap = mbMap;
+ BOOL bDrawn = FALSE;
+ BOOL bDrawGradientBackground = FALSE;
+ BOOL bDrawColorBackground = FALSE;
if( pCached )
aBmpEx = *pCached;
@@ -817,13 +815,13 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
const long nBmpWidth = aBmpEx.GetSizePixel().Width();
const long nBmpHeight = aBmpEx.GetSizePixel().Height();
- const sal_Bool bTransparent = aBmpEx.IsTransparent();
+ const BOOL bTransparent = aBmpEx.IsTransparent();
// draw background
if( bTransparent )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = sal_True;
+ bDrawGradientBackground = TRUE;
else
{
if( !pCached && !rWallpaper.GetColor().GetTransparency() )
@@ -835,15 +833,15 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aBmpEx = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
}
- bDrawColorBackground = sal_True;
+ bDrawColorBackground = TRUE;
}
}
else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = sal_True;
+ bDrawGradientBackground = TRUE;
else
- bDrawColorBackground = sal_True;
+ bDrawColorBackground = TRUE;
}
// background of bitmap?
@@ -852,7 +850,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
else if( bDrawColorBackground && bTransparent )
{
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
- bDrawColorBackground = sal_False;
+ bDrawColorBackground = FALSE;
}
// calc pos and size
@@ -869,7 +867,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
}
mpMetaFile = NULL;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -938,10 +936,10 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
default:
{
- const long nRight = nX + nWidth - 1L;
- const long nBottom = nY + nHeight - 1L;
- long nFirstX;
- long nFirstY;
+ const long nRight = nX + nWidth - 1L;
+ const long nBottom = nY + nHeight - 1L;
+ long nFirstX;
+ long nFirstY;
if( eStyle == WALLPAPER_TILE )
{
@@ -954,10 +952,10 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
nFirstY = aPos.Y() + ( ( aSize.Height() - nBmpHeight ) >> 1 );
}
- const long nOffX = ( nFirstX - nX ) % nBmpWidth;
- const long nOffY = ( nFirstY - nY ) % nBmpHeight;
- long nStartX = nX + nOffX;
- long nStartY = nY + nOffY;
+ const long nOffX = ( nFirstX - nX ) % nBmpWidth;
+ const long nOffY = ( nFirstY - nY ) % nBmpHeight;
+ long nStartX = nX + nOffX;
+ long nStartY = nY + nOffY;
if( nOffX > 0L )
nStartX -= nBmpWidth;
@@ -969,7 +967,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
for( long nBmpX = nStartX; nBmpX <= nRight; nBmpX += nBmpWidth )
DrawBitmapEx( Point( nBmpX, nBmpY ), aBmpEx );
- bDrawn = sal_True;
+ bDrawn = TRUE;
}
break;
}
@@ -979,11 +977,11 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
// optimized for non-transparent bitmaps
if( bDrawColorBackground )
{
- const Size aBmpSize( aBmpEx.GetSizePixel() );
- const Point aTmpPoint;
+ const Size aBmpSize( aBmpEx.GetSizePixel() );
+ const Point aTmpPoint;
const Rectangle aOutRect( aTmpPoint, GetOutputSizePixel() );
const Rectangle aColRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- Rectangle aWorkRect;
+ Rectangle aWorkRect;
aWorkRect = Rectangle( 0, 0, aOutRect.Right(), aPos.Y() - 1L );
aWorkRect.Justify();
@@ -1042,10 +1040,10 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
long nWidth, long nHeight,
const Wallpaper& rWallpaper )
{
- Rectangle aBound;
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- const sal_Bool bOldMap = mbMap;
- sal_Bool bNeedGradient = sal_True;
+ Rectangle aBound;
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ const BOOL bOldMap = mbMap;
+ BOOL bNeedGradient = TRUE;
/*
if ( rWallpaper.IsRect() )
@@ -1055,7 +1053,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
mpMetaFile = NULL;
- EnableMapMode( sal_False );
+ EnableMapMode( FALSE );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -1072,7 +1070,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
if( mnOutOffX+nWidth > gradientWidth )
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
if( mnOutOffX > gradientWidth )
- bNeedGradient = sal_False;
+ bNeedGradient = FALSE;
else
aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) );
}
@@ -1122,7 +1120,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect,
rWallpaper );
}
}
-
+
if( mpAlphaVDev )
mpAlphaVDev->DrawWallpaper( rRect, rWallpaper );
}
@@ -1133,20 +1131,20 @@ void OutputDevice::Erase()
{
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
-
- sal_Bool bNativeOK = sal_False;
+
+ BOOL bNativeOK = FALSE;
if( meOutDevType == OUTDEV_WINDOW )
{
Window* pWindow = static_cast<Window*>(this);
- ControlPart aCtrlPart = pWindow->ImplGetWindowImpl()->mnNativeBackground;
+ ControlPart aCtrlPart = pWindow->ImplGetWindowImpl()->mnNativeBackground;
if( aCtrlPart != 0 && ! pWindow->IsControlBackground() )
{
ImplControlValue aControlValue;
Point aGcc3WorkaroundTemporary;
Rectangle aCtrlRegion( aGcc3WorkaroundTemporary, GetOutputSizePixel() );
ControlState nState = 0;
-
- if( pWindow->IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+
+ if( pWindow->IsEnabled() ) nState |= CTRL_STATE_ENABLED;
bNativeOK = pWindow->DrawNativeControl( CTRL_WINDOW_BACKGROUND, aCtrlPart, aCtrlRegion,
nState, aControlValue, rtl::OUString() );
}
@@ -1203,7 +1201,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
if( mbOutputClipped )
return bDrawn;
- Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
+ Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
if( !aRect.IsEmpty() )
{
@@ -1218,7 +1216,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- (sal_uInt8*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
+ (BYTE*) 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 4ac1d4610b3f..746e642edb7c 100644
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -88,10 +88,6 @@ MenubarValue::~MenubarValue()
{
}
-MenupopupValue::~MenupopupValue()
-{
-}
-
PushButtonValue::~PushButtonValue()
{
}
@@ -103,14 +99,14 @@ PushButtonValue::~PushButtonValue()
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if( !lcl_enableNativeWidget( *this ) )
- return sal_False;
+ return FALSE;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
return( mpGraphics->IsNativeControlSupported(nType, nPart) );
}
@@ -118,18 +114,18 @@ sal_Bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::HitTestNativeControl( ControlType nType,
+BOOL OutputDevice::HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- sal_Bool& rIsInside )
+ BOOL& rIsInside )
{
if( !lcl_enableNativeWidget( *this ) )
- return sal_False;
+ return FALSE;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
Point aWinOffs( mnOutOffX, mnOutOffY );
Rectangle screenRegion( rControlRegion );
@@ -205,21 +201,14 @@ 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 !" );
+ OSL_ENSURE( 0, "unknown ImplControlValue type !" );
break;
}
return aResult;
}
-sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
+
+BOOL OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -227,17 +216,31 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return sal_False;
+ return FALSE;
+
+ /*
+ if( !IsInPaint() && IsPaintTransparent() )
+ {
+ // only required if called directly (ie, we're not in Paint() ):
+ // force redraw (Paint()) for transparent controls
+ // to trigger a repaint of the background
+ Region aClipRgn( GetClipRegion() );
+ if( !rControlRegion.IsEmpty() )
+ aClipRgn.Intersect( rControlRegion );
+ Invalidate( aClipRgn, INVALIDATE_UPDATE );
+ return TRUE;
+ }
+ */
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
if ( mbInitClipRegion )
ImplInitClipRegion();
- if ( mbOutputClipped || rControlRegion.IsEmpty() )
- return sal_True;
+ if ( mbOutputClipped )
+ return TRUE;
if ( mbInitLineColor )
ImplInitLineColor();
@@ -253,8 +256,8 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
aTestRegion.Intersect( rControlRegion );
if( aTestRegion == rControlRegion )
nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed
-
- sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+
+ BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -262,7 +265,7 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::DrawNativeControlText(ControlType nType,
+BOOL OutputDevice::DrawNativeControlText(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -270,7 +273,7 @@ sal_Bool OutputDevice::DrawNativeControlText(ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return sal_False;
+ return FALSE;
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
@@ -292,15 +295,15 @@ sal_Bool OutputDevice::DrawNativeControlText(ControlType nType,
boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- sal_Bool bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
-
+ BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool OutputDevice::GetNativeControlRegion( ControlType nType,
+BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -310,23 +313,23 @@ sal_Bool OutputDevice::GetNativeControlRegion( ControlType nType,
Rectangle &rNativeContentRegion )
{
if( !lcl_enableNativeWidget( *this ) )
- return sal_False;
+ return FALSE;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return sal_False;
+ return 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 ) );
- sal_Bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
+ BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
aCaption, rNativeBoundingRegion,
rNativeContentRegion, this );
if( bRet )
{
- // transform back native regions
+ // transform back native regions
rNativeBoundingRegion = ImplDevicePixelToLogic( rNativeBoundingRegion );
rNativeContentRegion = ImplDevicePixelToLogic( rNativeContentRegion );
}
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index a0b2c6521aac..41ce5e10bcc0 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,6 +52,8 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
+#define USE_64BIT_INTS
+
// =======================================================================
DBG_NAMEEX( OutputDevice )
@@ -62,7 +64,7 @@ DBG_NAMEEX( Region )
// =======================================================================
static long aImplNumeratorAry[MAP_PIXEL+1] =
- { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1 };
+ { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1 };
static long aImplDenominatorAry[MAP_PIXEL+1] =
{ 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1 };
@@ -113,10 +115,10 @@ static Fraction ImplMakeFraction( long nN1, long nN2, long nD1, long nD2 )
// -----------------------------------------------------------------------
// Fraction.GetNumerator()
-// Fraction.GetDenominator() > 0
-// rOutRes.nPixPerInch? > 0
+// Fraction.GetDenominator() > 0
+// rOutRes.nPixPerInch? > 0
// rMapRes.nMapScNum?
-// rMapRes.nMapScDenom? > 0
+// rMapRes.nMapScDenom? > 0
static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
const ImplMapRes& rMapRes,
@@ -130,9 +132,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
else
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
- long nDenomHalfX = rMapRes.mnMapScDenomX / 2;
- sal_uLong nDenomX = rMapRes.mnMapScDenomX;
- long nProductX = nDPIX * rMapRes.mnMapScNumX;
+ long nDenomHalfX = rMapRes.mnMapScDenomX / 2;
+ ULONG nDenomX = rMapRes.mnMapScDenomX;
+ long nProductX = nDPIX * rMapRes.mnMapScNumX;
if ( !nProductX )
rThresRes.mnThresLogToPixX = LONG_MAX;
@@ -142,9 +144,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomX )
rThresRes.mnThresPixToLogX = LONG_MAX;
else if ( nProductX >= 0 )
- rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX - (ULONG)( nProductX/2)) / nDenomX);
else
- rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductX/2)) / nDenomX);
}
if ( nDPIY && (LONG_MAX / nDPIY < Abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero
@@ -155,9 +157,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
else
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
- long nDenomHalfY = rMapRes.mnMapScDenomY / 2;
- sal_uLong nDenomY = rMapRes.mnMapScDenomY;
- long nProductY = nDPIY * rMapRes.mnMapScNumY;
+ long nDenomHalfY = rMapRes.mnMapScDenomY / 2;
+ ULONG nDenomY = rMapRes.mnMapScDenomY;
+ long nProductY = nDPIY * rMapRes.mnMapScNumY;
if ( !nProductY )
rThresRes.mnThresLogToPixY = LONG_MAX;
@@ -167,15 +169,17 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomY )
rThresRes.mnThresPixToLogY = LONG_MAX;
else if ( nProductY >= 0 )
- rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX - (ULONG)( nProductY/2)) / nDenomY);
else
- rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductY/2)) / nDenomY);
}
+#ifdef USE_64BIT_INTS
rThresRes.mnThresLogToPixX /= 2;
rThresRes.mnThresLogToPixY /= 2;
rThresRes.mnThresPixToLogX /= 2;
rThresRes.mnThresPixToLogY /= 2;
+#endif
}
// -----------------------------------------------------------------------
@@ -200,16 +204,16 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
rMapRes.mnMapScDenomY = 254;
break;
case MAP_MM:
- rMapRes.mnMapScNumX = 5; // 10
- rMapRes.mnMapScDenomX = 127; // 254
- rMapRes.mnMapScNumY = 5; // 10
- rMapRes.mnMapScDenomY = 127; // 254
+ rMapRes.mnMapScNumX = 5; // 10
+ rMapRes.mnMapScDenomX = 127; // 254
+ rMapRes.mnMapScNumY = 5; // 10
+ rMapRes.mnMapScDenomY = 127; // 254
break;
case MAP_CM:
- rMapRes.mnMapScNumX = 50; // 100
- rMapRes.mnMapScDenomX = 127; // 254
- rMapRes.mnMapScNumY = 50; // 100
- rMapRes.mnMapScDenomY = 127; // 254
+ rMapRes.mnMapScNumX = 50; // 100
+ rMapRes.mnMapScDenomX = 127; // 254
+ rMapRes.mnMapScNumY = 50; // 100
+ rMapRes.mnMapScDenomY = 127; // 254
break;
case MAP_1000TH_INCH:
rMapRes.mnMapScNumX = 1;
@@ -279,7 +283,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
}
break;
default:
- OSL_FAIL( "unhandled MapUnit" );
+ DBG_ERROR( "unhandled MapUnit" );
break;
}
@@ -379,6 +383,7 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
{
// To "use" it...
(void) nThres;
+#ifdef USE_64BIT_INTS
#if (SAL_TYPES_SIZEOFLONG < 8)
if( (+n < nThres) && (-n < nThres) )
{
@@ -406,6 +411,34 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
}
}
return n;
+#else // USE_64BIT_INTS
+ if ( Abs( n ) < nThres )
+ {
+ n *= nDPI * nMapNum;
+ n += n >= 0 ? nMapDenom/2 : -((nMapDenom-1)/2);
+ return (n / nMapDenom);
+ }
+ else
+ {
+ BigInt aTemp( n );
+ aTemp *= BigInt( nDPI );
+ aTemp *= BigInt( nMapNum );
+
+ if ( aTemp.IsNeg() )
+ {
+ BigInt aMapScDenom2( (nMapDenom-1)/2 );
+ aTemp -= aMapScDenom2;
+ }
+ else
+ {
+ BigInt aMapScDenom2( nMapDenom/2 );
+ aTemp += aMapScDenom2;
+ }
+
+ aTemp /= BigInt( nMapDenom );
+ return (long)aTemp;
+ }
+#endif
}
// -----------------------------------------------------------------------
@@ -415,6 +448,7 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
{
// To "use" it...
(void) nThres;
+#ifdef USE_64BIT_INTS
#if (SAL_TYPES_SIZEOFLONG < 8)
if( (+n < nThres) && (-n < nThres) )
n = (2 * n * nMapDenom) / (nDPI * nMapNum);
@@ -428,6 +462,59 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
}
if( n < 0 ) --n; else ++n;
return (n / 2);
+#else // USE_64BIT_INTS
+ if ( Abs( n ) < nThres )
+ {
+ long nDenom = nDPI * nMapNum;
+ long nNum = n * nMapDenom;
+ if( (nNum ^ nDenom) >= 0 )
+ nNum += nDenom/2;
+ else
+ nNum -= nDenom/2;
+ return (nNum / nDenom);
+ }
+ else
+ {
+ BigInt aDenom( nDPI );
+ aDenom *= BigInt( nMapNum );
+
+ BigInt aNum( n );
+ aNum *= BigInt( nMapDenom );
+
+ BigInt aDenom2( aDenom );
+ if ( aNum.IsNeg() )
+ {
+ if ( aDenom.IsNeg() )
+ {
+ aDenom2 /= BigInt(2);
+ aNum += aDenom2;
+ }
+ else
+ {
+ aDenom2 -= 1;
+ aDenom2 /= BigInt(2);
+ aNum -= aDenom2;
+ }
+ }
+ else
+ {
+ if ( aDenom.IsNeg() )
+ {
+ aDenom2 += 1;
+ aDenom2 /= BigInt(2);
+ aNum -= aDenom2;
+ }
+ else
+ {
+ aDenom2 /= BigInt(2);
+ aNum += aDenom2;
+ }
+ }
+
+ aNum /= aDenom;
+ return (long)aNum;
+ }
+#endif
}
// -----------------------------------------------------------------------
@@ -600,8 +687,8 @@ Polygon OutputDevice::ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const
if ( !mbMap && !mnOutOffX && !mnOutOffY )
return rLogicPoly;
- sal_uInt16 i;
- sal_uInt16 nPoints = rLogicPoly.GetSize();
+ USHORT i;
+ USHORT nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -644,8 +731,8 @@ PolyPolygon OutputDevice::ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyP
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- sal_uInt16 nPoly = aPolyPoly.Count();
- for( sal_uInt16 i = 0; i < nPoly; i++ )
+ USHORT nPoly = aPolyPoly.Count();
+ for( USHORT i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = ImplLogicToDevicePixel( rPoly );
@@ -725,12 +812,12 @@ Region OutputDevice::ImplPixelToDevicePixel( const Region& rRegion ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableMapMode( sal_Bool bEnable )
-{
- mbMap = (bEnable != 0);
+void OutputDevice::EnableMapMode( BOOL bEnable )
+{
+ mbMap = (bEnable != 0);
if( mpAlphaVDev )
- mpAlphaVDev->EnableMapMode( bEnable );
+ mpAlphaVDev->EnableMapMode( bEnable );
}
// -----------------------------------------------------------------------
@@ -744,12 +831,12 @@ void OutputDevice::SetMapMode()
if ( mbMap || !maMapMode.IsDefault() )
{
- mbMap = sal_False;
- maMapMode = MapMode();
+ mbMap = FALSE;
+ maMapMode = MapMode();
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = sal_True;
- mbInitFont = sal_True;
+ mbNewFont = TRUE;
+ mbInitFont = TRUE;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -765,7 +852,7 @@ void OutputDevice::SetMapMode()
}
if( mpAlphaVDev )
- mpAlphaVDev->SetMapMode();
+ mpAlphaVDev->SetMapMode();
}
// -----------------------------------------------------------------------
@@ -774,7 +861,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- sal_Bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
+ BOOL bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
if ( mpMetaFile )
{
@@ -793,7 +880,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
mpAlphaVDev->SetMapMode( rNewMapMode );
// Ist Default-MapMode, dann bereche nichts
- sal_Bool bOldMap = mbMap;
+ BOOL bOldMap = mbMap;
mbMap = !rNewMapMode.IsDefault();
if ( mbMap )
{
@@ -801,14 +888,14 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
if ( (rNewMapMode.GetMapUnit() == maMapMode.GetMapUnit()) &&
(rNewMapMode.GetScaleX() == maMapMode.GetScaleX()) &&
(rNewMapMode.GetScaleY() == maMapMode.GetScaleY()) &&
- (bOldMap == mbMap) )
+ (bOldMap == mbMap) )
{
// Offset setzen
Point aOrigin = rNewMapMode.GetOrigin();
maMapRes.mnMapOfsX = aOrigin.X();
maMapRes.mnMapOfsY = aOrigin.Y();
maMapMode = rNewMapMode;
-
+
// #i75163#
ImplInvalidateViewTransform();
@@ -816,12 +903,12 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
}
if ( !bOldMap && bRelMap )
{
- maMapRes.mnMapScNumX = 1;
- maMapRes.mnMapScNumY = 1;
- maMapRes.mnMapScDenomX = mnDPIX;
- maMapRes.mnMapScDenomY = mnDPIY;
- maMapRes.mnMapOfsX = 0;
- maMapRes.mnMapOfsY = 0;
+ maMapRes.mnMapScNumX = 1;
+ maMapRes.mnMapScNumY = 1;
+ maMapRes.mnMapScDenomX = mnDPIX;
+ maMapRes.mnMapScDenomY = mnDPIY;
+ maMapRes.mnMapOfsX = 0;
+ maMapRes.mnMapOfsY = 0;
}
// Neue MapMode-Aufloesung berechnen
@@ -849,8 +936,8 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
maMapMode = rNewMapMode;
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = sal_True;
- mbInitFont = sal_True;
+ mbNewFont = TRUE;
+ mbInitFont = TRUE;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -1014,22 +1101,22 @@ basegfx::B2DHomMatrix OutputDevice::GetInverseViewTransformation() const
basegfx::B2DHomMatrix OutputDevice::GetViewTransformation( const MapMode& rMapMode ) const
{
// #i82615#
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
-
+
basegfx::B2DHomMatrix aTransform;
const double fScaleFactorX((double)mnDPIX * (double)aMapRes.mnMapScNumX / (double)aMapRes.mnMapScDenomX);
const double fScaleFactorY((double)mnDPIY * (double)aMapRes.mnMapScNumY / (double)aMapRes.mnMapScDenomY);
const double fZeroPointX(((double)aMapRes.mnMapOfsX * fScaleFactorX) + (double)mnOutOffOrigX);
const double fZeroPointY(((double)aMapRes.mnMapOfsY * fScaleFactorY) + (double)mnOutOffOrigY);
-
+
aTransform.set(0, 0, fScaleFactorX);
aTransform.set(1, 1, fScaleFactorY);
aTransform.set(0, 2, fZeroPointX);
aTransform.set(1, 2, fZeroPointY);
-
+
return aTransform;
}
@@ -1121,8 +1208,8 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly ) const
if ( !mbMap )
return rLogicPoly;
- sal_uInt16 i;
- sal_uInt16 nPoints = rLogicPoly.GetSize();
+ USHORT i;
+ USHORT nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1155,8 +1242,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly ) cons
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- sal_uInt16 nPoly = aPolyPoly.Count();
- for( sal_uInt16 i = 0; i < nPoly; i++ )
+ USHORT nPoly = aPolyPoly.Count();
+ for( USHORT i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly );
@@ -1196,7 +1283,7 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion ) const
if ( !mbMap || (eType == REGION_EMPTY) || (eType == REGION_NULL) )
return rLogicRegion;
- Region aRegion;
+ Region aRegion;
const ImplRegion& rImplRegion = *rLogicRegion.ImplGetImplRegion();
const PolyPolygon* pPolyPoly = rImplRegion.mpPolyPoly;
const basegfx::B2DPolyPolygon* pB2DPolyPoly = rImplRegion.mpB2DPolyPoly;
@@ -1212,12 +1299,12 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion ) const
}
else
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ long nX;
+ long nY;
+ long nWidth;
+ long nHeight;
+ ImplRegionInfo aInfo;
+ BOOL bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1244,8 +1331,8 @@ Point OutputDevice::LogicToPixel( const Point& rLogicPt,
return rLogicPt;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Point( ImplLogicToPixel( rLogicPt.X() + aMapRes.mnMapOfsX, mnDPIX,
@@ -1267,8 +1354,8 @@ Size OutputDevice::LogicToPixel( const Size& rLogicSize,
return rLogicSize;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Size( ImplLogicToPixel( rLogicSize.Width(), mnDPIX,
@@ -1290,8 +1377,8 @@ Rectangle OutputDevice::LogicToPixel( const Rectangle& rLogicRect,
return rLogicRect;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Rectangle( ImplLogicToPixel( rLogicRect.Left() + aMapRes.mnMapOfsX, mnDPIX,
@@ -1320,12 +1407,12 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly,
return rLogicPoly;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- sal_uInt16 i;
- sal_uInt16 nPoints = rLogicPoly.GetSize();
+ USHORT i;
+ USHORT nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1343,7 +1430,7 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly,
aThresRes.mnThresLogToPixY )+mnOutOffOrigY;
aPoly[i] = aPt;
}
-
+
return aPoly;
}
@@ -1359,8 +1446,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly,
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- sal_uInt16 nPoly = aPolyPoly.Count();
- for( sal_uInt16 i = 0; i < nPoly; i++ )
+ USHORT nPoly = aPolyPoly.Count();
+ for( USHORT i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly, rMapMode );
@@ -1403,19 +1490,19 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion,
if ( rMapMode.IsDefault() || (eType == REGION_EMPTY) || (eType == REGION_NULL) )
return rLogicRegion;
- Region aRegion;
- PolyPolygon* pPolyPoly = rLogicRegion.ImplGetImplRegion()->mpPolyPoly;
+ Region aRegion;
+ PolyPolygon* pPolyPoly = rLogicRegion.ImplGetImplRegion()->mpPolyPoly;
if( pPolyPoly )
aRegion = Region( LogicToPixel( *pPolyPoly, rMapMode ) );
else
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ long nX;
+ long nY;
+ long nWidth;
+ long nHeight;
+ ImplRegionInfo aInfo;
+ BOOL bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1498,8 +1585,8 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly ) const
if ( !mbMap )
return rDevicePoly;
- sal_uInt16 i;
- sal_uInt16 nPoints = rDevicePoly.GetSize();
+ USHORT i;
+ USHORT nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1532,8 +1619,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly ) con
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- sal_uInt16 nPoly = aPolyPoly.Count();
- for( sal_uInt16 i = 0; i < nPoly; i++ )
+ USHORT nPoly = aPolyPoly.Count();
+ for( USHORT i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly );
@@ -1573,19 +1660,19 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion ) const
if ( !mbMap || (eType == REGION_EMPTY) || (eType == REGION_NULL) )
return rDeviceRegion;
- Region aRegion;
- PolyPolygon* pPolyPoly = rDeviceRegion.ImplGetImplRegion()->mpPolyPoly;
+ Region aRegion;
+ PolyPolygon* pPolyPoly = rDeviceRegion.ImplGetImplRegion()->mpPolyPoly;
if ( pPolyPoly )
aRegion = Region( PixelToLogic( *pPolyPoly ) );
else
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ long nX;
+ long nY;
+ long nWidth;
+ long nHeight;
+ ImplRegionInfo aInfo;
+ BOOL bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1613,8 +1700,8 @@ Point OutputDevice::PixelToLogic( const Point& rDevicePt,
return rDevicePt;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Point( ImplPixelToLogic( rDevicePt.X(), mnDPIX,
@@ -1637,8 +1724,8 @@ Size OutputDevice::PixelToLogic( const Size& rDeviceSize,
return rDeviceSize;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Size( ImplPixelToLogic( rDeviceSize.Width(), mnDPIX,
@@ -1661,8 +1748,8 @@ Rectangle OutputDevice::PixelToLogic( const Rectangle& rDeviceRect,
return rDeviceRect;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
return Rectangle( ImplPixelToLogic( rDeviceRect.Left(), mnDPIX,
@@ -1692,12 +1779,12 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly,
return rDevicePoly;
// MapMode-Aufloesung berechnen und Umrechnen
- ImplMapRes aMapRes;
- ImplThresholdRes aThresRes;
+ ImplMapRes aMapRes;
+ ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- sal_uInt16 i;
- sal_uInt16 nPoints = rDevicePoly.GetSize();
+ USHORT i;
+ USHORT nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1731,8 +1818,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly,
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- sal_uInt16 nPoly = aPolyPoly.Count();
- for( sal_uInt16 i = 0; i < nPoly; i++ )
+ USHORT nPoly = aPolyPoly.Count();
+ for( USHORT i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly, rMapMode );
@@ -1775,19 +1862,19 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
if ( rMapMode.IsDefault() || (eType == REGION_EMPTY) || (eType == REGION_NULL) )
return rDeviceRegion;
- Region aRegion;
- PolyPolygon* pPolyPoly = rDeviceRegion.ImplGetImplRegion()->mpPolyPoly;
+ Region aRegion;
+ PolyPolygon* pPolyPoly = rDeviceRegion.ImplGetImplRegion()->mpPolyPoly;
if ( pPolyPoly )
aRegion = Region( PixelToLogic( *pPolyPoly, rMapMode ) );
else
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ long nX;
+ long nY;
+ long nWidth;
+ long nHeight;
+ ImplRegionInfo aInfo;
+ BOOL bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1805,83 +1892,83 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
// -----------------------------------------------------------------------
-#define ENTER0( rSource, pMapModeSource, pMapModeDest ) \
- if ( !pMapModeSource ) \
- pMapModeSource = &maMapMode; \
- if ( !pMapModeDest ) \
- pMapModeDest = &maMapMode; \
- if ( *pMapModeSource == *pMapModeDest ) \
+#define ENTER0( rSource, pMapModeSource, pMapModeDest ) \
+ if ( !pMapModeSource ) \
+ pMapModeSource = &maMapMode; \
+ if ( !pMapModeDest ) \
+ pMapModeDest = &maMapMode; \
+ if ( *pMapModeSource == *pMapModeDest ) \
return rSource
// -----------------------------------------------------------------------
-#define ENTER1( rSource, pMapModeSource, pMapModeDest ) \
- ENTER0( rSource, pMapModeSource, pMapModeDest ); \
+#define ENTER1( rSource, pMapModeSource, pMapModeDest ) \
+ ENTER0( rSource, pMapModeSource, pMapModeDest ); \
\
- ImplMapRes aMapResSource; \
- ImplMapRes aMapResDest; \
+ ImplMapRes aMapResSource; \
+ ImplMapRes aMapResDest; \
\
- if ( !mbMap || pMapModeSource != &maMapMode ) \
- { \
- if ( pMapModeSource->GetMapUnit() == MAP_RELATIVE ) \
- aMapResSource = maMapRes; \
- ImplCalcMapResolution( *pMapModeSource, \
- mnDPIX, mnDPIY, aMapResSource ); \
- } \
- else \
- aMapResSource = maMapRes; \
- if ( !mbMap || pMapModeDest != &maMapMode ) \
- { \
- if ( pMapModeDest->GetMapUnit() == MAP_RELATIVE ) \
- aMapResDest = maMapRes; \
- ImplCalcMapResolution( *pMapModeDest, \
- mnDPIX, mnDPIY, aMapResDest ); \
- } \
- else \
+ if ( !mbMap || pMapModeSource != &maMapMode ) \
+ { \
+ if ( pMapModeSource->GetMapUnit() == MAP_RELATIVE ) \
+ aMapResSource = maMapRes; \
+ ImplCalcMapResolution( *pMapModeSource, \
+ mnDPIX, mnDPIY, aMapResSource ); \
+ } \
+ else \
+ aMapResSource = maMapRes; \
+ if ( !mbMap || pMapModeDest != &maMapMode ) \
+ { \
+ if ( pMapModeDest->GetMapUnit() == MAP_RELATIVE ) \
+ aMapResDest = maMapRes; \
+ ImplCalcMapResolution( *pMapModeDest, \
+ mnDPIX, mnDPIY, aMapResDest ); \
+ } \
+ else \
aMapResDest = maMapRes
// -----------------------------------------------------------------------
-#define ENTER2( eUnitSource, eUnitDest ) \
- DBG_ASSERT( eUnitSource != MAP_SYSFONT \
- && eUnitSource != MAP_APPFONT \
- && eUnitSource != MAP_RELATIVE, \
+#define ENTER2( eUnitSource, eUnitDest ) \
+ DBG_ASSERT( eUnitSource != MAP_SYSFONT \
+ && eUnitSource != MAP_APPFONT \
+ && eUnitSource != MAP_RELATIVE, \
"Source MapUnit nicht erlaubt" ); \
- DBG_ASSERT( eUnitDest != MAP_SYSFONT \
- && eUnitDest != MAP_APPFONT \
- && eUnitDest != MAP_RELATIVE, \
+ DBG_ASSERT( eUnitDest != MAP_SYSFONT \
+ && eUnitDest != MAP_APPFONT \
+ && eUnitDest != MAP_RELATIVE, \
"Destination MapUnit nicht erlaubt" ); \
- DBG_ASSERTWARNING( eUnitSource != MAP_PIXEL, \
+ DBG_ASSERTWARNING( eUnitSource != MAP_PIXEL, \
"MAP_PIXEL mit 72dpi angenaehert" ); \
- DBG_ASSERTWARNING( eUnitDest != MAP_PIXEL, \
+ DBG_ASSERTWARNING( eUnitDest != MAP_PIXEL, \
"MAP_PIXEL mit 72dpi angenaehert" )
// -----------------------------------------------------------------------
-#define ENTER3( eUnitSource, eUnitDest ) \
- long nNumerator = 1; \
- long nDenominator = 1; \
- DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit"); \
- DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit"); \
- if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) ) \
- { \
- nNumerator = aImplNumeratorAry[eUnitSource] * \
- aImplDenominatorAry[eUnitDest]; \
- nDenominator = aImplNumeratorAry[eUnitDest] * \
- aImplDenominatorAry[eUnitSource]; \
+#define ENTER3( eUnitSource, eUnitDest ) \
+ long nNumerator = 1; \
+ long nDenominator = 1; \
+ DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit"); \
+ DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit"); \
+ if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) ) \
+ { \
+ nNumerator = aImplNumeratorAry[eUnitSource] * \
+ aImplDenominatorAry[eUnitDest]; \
+ nDenominator = aImplNumeratorAry[eUnitDest] * \
+ aImplDenominatorAry[eUnitSource]; \
} \
- if ( eUnitSource == MAP_PIXEL ) \
- nDenominator *= 72; \
- else if( eUnitDest == MAP_PIXEL ) \
+ if ( eUnitSource == MAP_PIXEL ) \
+ nDenominator *= 72; \
+ else if( eUnitDest == MAP_PIXEL ) \
nNumerator *= 72
// -----------------------------------------------------------------------
-#define ENTER4( rMapModeSource, rMapModeDest ) \
- ImplMapRes aMapResSource; \
- ImplMapRes aMapResDest; \
+#define ENTER4( rMapModeSource, rMapModeDest ) \
+ ImplMapRes aMapResSource; \
+ ImplMapRes aMapResDest; \
\
- ImplCalcMapResolution( rMapModeSource, 72, 72, aMapResSource ); \
+ ImplCalcMapResolution( rMapModeSource, 72, 72, aMapResSource ); \
ImplCalcMapResolution( rMapModeDest, 72, 72, aMapResDest )
// -----------------------------------------------------------------------
@@ -2026,8 +2113,8 @@ static long fn3( const long n1, const long n2, const long n3 )
} // of if
else
{
- long n4 = n1 * n2;
- const long n3_2 = n3 / 2;
+ long n4 = n1 * n2;
+ const long n3_2 = n3 / 2;
if( n4 < 0 )
{
@@ -2103,7 +2190,7 @@ Rectangle OutputDevice::LogicToLogic( const Rectangle& rRectSource,
// -----------------------------------------------------------------------
-long* OutputDevice::LogicToLogic( long* pX, sal_uInt16 nCount,
+long* OutputDevice::LogicToLogic( long* pX, USHORT nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const
{
@@ -2129,7 +2216,7 @@ Point OutputDevice::LogicToLogic( const Point& rPtSource,
return rPtSource;
MapUnit eUnitSource = rMapModeSource.GetMapUnit();
- MapUnit eUnitDest = rMapModeDest.GetMapUnit();
+ MapUnit eUnitDest = rMapModeDest.GetMapUnit();
ENTER2( eUnitSource, eUnitDest );
if ( rMapModeSource.mpImplMapMode->mbSimple &&
@@ -2165,7 +2252,7 @@ Size OutputDevice::LogicToLogic( const Size& rSzSource,
return rSzSource;
MapUnit eUnitSource = rMapModeSource.GetMapUnit();
- MapUnit eUnitDest = rMapModeDest.GetMapUnit();
+ MapUnit eUnitDest = rMapModeDest.GetMapUnit();
ENTER2( eUnitSource, eUnitDest );
if ( rMapModeSource.mpImplMapMode->mbSimple &&
@@ -2199,7 +2286,7 @@ basegfx::B2DPolygon OutputDevice::LogicToLogic( const basegfx::B2DPolygon& rPoly
return rPolySource;
MapUnit eUnitSource = rMapModeSource.GetMapUnit();
- MapUnit eUnitDest = rMapModeDest.GetMapUnit();
+ MapUnit eUnitDest = rMapModeDest.GetMapUnit();
ENTER2( eUnitSource, eUnitDest );
basegfx::B2DHomMatrix aTransform;
@@ -2244,7 +2331,7 @@ basegfx::B2DPolyPolygon OutputDevice::LogicToLogic( const basegfx::B2DPolyPolygo
return rPolySource;
MapUnit eUnitSource = rMapModeSource.GetMapUnit();
- MapUnit eUnitDest = rMapModeDest.GetMapUnit();
+ MapUnit eUnitDest = rMapModeDest.GetMapUnit();
ENTER2( eUnitSource, eUnitDest );
basegfx::B2DHomMatrix aTransform;
@@ -2289,7 +2376,7 @@ Rectangle OutputDevice::LogicToLogic( const Rectangle& rRectSource,
return rRectSource;
MapUnit eUnitSource = rMapModeSource.GetMapUnit();
- MapUnit eUnitDest = rMapModeDest.GetMapUnit();
+ MapUnit eUnitDest = rMapModeDest.GetMapUnit();
ENTER2( eUnitSource, eUnitDest );
if ( rMapModeSource.mpImplMapMode->mbSimple &&
@@ -2382,7 +2469,7 @@ long Window::ImplLogicUnitToPixelX( long nX, MapUnit eUnit )
// Es wird kein BigInt gebraucht, da diese Funktion nur zur Umrechnung
// von Fensterposition benutzt wird
- nX = nX * mnDPIX * pFrameData->maMapUnitRes.mnMapScNumX;
+ nX = nX * mnDPIX * pFrameData->maMapUnitRes.mnMapScNumX;
nX += nX >= 0 ? (pFrameData->maMapUnitRes.mnMapScDenomX/2) :
-((pFrameData->maMapUnitRes.mnMapScDenomX-1)/2);
nX /= pFrameData->maMapUnitRes.mnMapScDenomX;
@@ -2409,7 +2496,7 @@ long Window::ImplLogicUnitToPixelY( long nY, MapUnit eUnit )
// Es wird kein BigInt gebraucht, da diese Funktion nur zur Umrechnung
// von Fensterposition benutzt wird
- nY = nY * mnDPIY * pFrameData->maMapUnitRes.mnMapScNumY;
+ nY = nY * mnDPIY * pFrameData->maMapUnitRes.mnMapScNumY;
nY += nY >= 0 ? (pFrameData->maMapUnitRes.mnMapScDenomY/2) :
-((pFrameData->maMapUnitRes.mnMapScDenomY-1)/2);
nY /= pFrameData->maMapUnitRes.mnMapScDenomY;
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 2b3173c4b128..c54a1a13f5ae 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -70,31 +70,31 @@ struct PDFExtOutDevDataSync
EndGroupGfxLink
};
- sal_uInt32 nIdx;
- Action eAct;
+ sal_uInt32 nIdx;
+ Action eAct;
};
struct GlobalSyncData
{
- std::deque< PDFExtOutDevDataSync::Action > mActions;
- std::deque< MapMode > mParaMapModes;
- std::deque< Rectangle > mParaRects;
- std::deque< sal_Int32 > mParaInts;
- std::deque< sal_uInt32 > mParauInts;
- std::deque< rtl::OUString > mParaOUStrings;
- std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes;
- std::deque< PDFNote > mParaPDFNotes;
- std::deque< PDFWriter::PageTransition > mParaPageTransitions;
+ std::deque< PDFExtOutDevDataSync::Action > mActions;
+ std::deque< MapMode > mParaMapModes;
+ std::deque< Rectangle > mParaRects;
+ std::deque< sal_Int32 > mParaInts;
+ std::deque< sal_uInt32 > mParauInts;
+ std::deque< rtl::OUString > mParaOUStrings;
+ std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes;
+ std::deque< PDFNote > mParaPDFNotes;
+ std::deque< PDFWriter::PageTransition > mParaPageTransitions;
sal_Int32 GetMappedId();
sal_Int32 GetMappedStructId( sal_Int32 );
- sal_Int32 mCurId;
- std::vector< sal_Int32 > mParaIds;
- std::vector< sal_Int32 > mStructIdMap;
+ sal_Int32 mCurId;
+ std::vector< sal_Int32 > mParaIds;
+ std::vector< sal_Int32 > mStructIdMap;
- sal_Int32 mCurrentStructElement;
- std::vector< sal_Int32 > mStructParents;
+ sal_Int32 mCurrentStructElement;
+ std::vector< sal_Int32 > mStructParents;
GlobalSyncData() :
mCurId ( 0 ),
mCurrentStructElement( 0 )
@@ -119,7 +119,7 @@ sal_Int32 GlobalSyncData::GetMappedId()
nLinkId = mParaIds[ nLinkId ];
else
nLinkId = -1;
-
+
DBG_ASSERT( nLinkId >= 0, "unmapped id in GlobalSyncData" );
}
@@ -273,19 +273,19 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter )
struct PageSyncData
{
- std::deque< PDFExtOutDevDataSync > mActions;
- std::deque< Rectangle > mParaRects;
- std::deque< sal_Int32 > mParaInts;
- std::deque< rtl::OUString > mParaOUStrings;
- std::deque< PDFWriter::StructElement > mParaStructElements;
- std::deque< PDFWriter::StructAttribute > mParaStructAttributes;
- std::deque< PDFWriter::StructAttributeValue > mParaStructAttributeValues;
- std::deque< Graphic > mGraphics;
+ std::deque< PDFExtOutDevDataSync > mActions;
+ std::deque< Rectangle > mParaRects;
+ std::deque< sal_Int32 > mParaInts;
+ std::deque< rtl::OUString > mParaOUStrings;
+ std::deque< PDFWriter::StructElement > mParaStructElements;
+ std::deque< PDFWriter::StructAttribute > mParaStructAttributes;
+ std::deque< PDFWriter::StructAttributeValue > mParaStructAttributeValues;
+ std::deque< Graphic > mGraphics;
std::deque< ::boost::shared_ptr< PDFWriter::AnyWidget > >
mControls;
- GlobalSyncData* mpGlobalData;
+ GlobalSyncData* mpGlobalData;
- sal_Bool mbGroupIgnoreGDIMtfActions;
+ sal_Bool mbGroupIgnoreGDIMtfActions;
PageSyncData( GlobalSyncData* pGlobal ) : mbGroupIgnoreGDIMtfActions ( sal_False ) { mpGlobalData = pGlobal; }
@@ -302,7 +302,7 @@ void PageSyncData::PushAction( const OutputDevice& rOutDev, const PDFExtOutDevDa
if ( pMtf )
aSync.nIdx = pMtf->GetActionCount();
else
- aSync.nIdx = 0x7fffffff; // sync not possible
+ aSync.nIdx = 0x7fffffff; // sync not possible
mActions.push_back( aSync );
}
sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const PDFExtOutDevData& rOutDevData )
@@ -377,7 +377,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
break;
case PDFExtOutDevDataSync::BeginGroup :
{
- /* first determining if this BeginGroup is starting a GfxLink,
+ /* first determining if this BeginGroup is starting a GfxLink,
by searching for a EndGroup or a EndGroupGfxLink */
mbGroupIgnoreGDIMtfActions = sal_False;
std::deque< PDFExtOutDevDataSync >::iterator aBeg = mActions.begin();
@@ -400,7 +400,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
}
break;
}
- ++aBeg;
+ aBeg++;
}
}
break;
@@ -411,11 +411,13 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
break;
case PDFExtOutDevDataSync::EndGroupGfxLink :
{
+ sal_Int32 nTransparency;
Rectangle aOutputRect, aVisibleOutputRect;
Graphic aGraphic( mGraphics.front() );
mGraphics.pop_front();
- mParaInts.pop_front(); //Transparency
+ nTransparency = mParaInts.front();
+ mParaInts.pop_front();
aOutputRect = mParaRects.front();
mParaRects.pop_front();
aVisibleOutputRect = mParaRects.front();
@@ -425,7 +427,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
{
sal_Bool bClippingNeeded = ( aOutputRect != aVisibleOutputRect ) && !aVisibleOutputRect.IsEmpty();
- GfxLink aGfxLink( aGraphic.GetLink() );
+ GfxLink aGfxLink( aGraphic.GetLink() );
if ( aGfxLink.GetType() == GFX_LINK_TYPE_NATIVE_JPG )
{
if ( bClippingNeeded )
@@ -478,17 +480,17 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
TYPEINIT1(PDFExtOutDevData,ExtOutDevData);
PDFExtOutDevData::PDFExtOutDevData( const OutputDevice& rOutDev ) :
- mrOutDev ( rOutDev ),
- mbTaggedPDF ( sal_False ),
- mbExportNotes ( sal_True ),
- mbTransitionEffects ( sal_True ),
+ mrOutDev ( rOutDev ),
+ mbTaggedPDF ( sal_False ),
+ mbExportNotes ( sal_True ),
+ mbTransitionEffects ( sal_True ),
mbUseLosslessCompression( sal_True ),
- mbReduceImageResolution ( sal_False ),
+ mbReduceImageResolution ( sal_False ),
mbExportNDests ( sal_False ),
- mnFormsFormat ( 0 ),
- mnPage ( -1 ),
- mpPageSyncData ( NULL ),
- mpGlobalSyncData ( new GlobalSyncData() )
+ mnFormsFormat ( 0 ),
+ mnPage ( -1 ),
+ mpPageSyncData ( NULL ),
+ mpGlobalSyncData ( new GlobalSyncData() )
{
mpPageSyncData = new PageSyncData( mpGlobalSyncData );
}
@@ -610,7 +612,7 @@ void PDFExtOutDevData::PlayGlobalActions( PDFWriter& rWriter )
//--->i56629
sal_Int32 PDFExtOutDevData::CreateNamedDest(const String& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
{
- mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateNamedDest );
+ mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateNamedDest );
mpGlobalSyncData->mParaOUStrings.push_back( sDestName );
mpGlobalSyncData->mParaRects.push_back( rRect );
mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
@@ -782,10 +784,10 @@ void PDFExtOutDevData::EndGroup()
{
mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndGroup );
}
-void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
- sal_uInt8 nTransparency,
- const Rectangle& rOutputRect,
- const Rectangle& rVisibleOutputRect )
+void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
+ BYTE nTransparency,
+ const Rectangle& rOutputRect,
+ const Rectangle& rVisibleOutputRect )
{
mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndGroupGfxLink );
mpPageSyncData->mGraphics.push_back( rGraphic );
diff --git a/vcl/source/gdi/pdffontcache.cxx b/vcl/source/gdi/pdffontcache.cxx
index 2b5944377eac..30d6786baf5a 100644
--- a/vcl/source/gdi/pdffontcache.cxx
+++ b/vcl/source/gdi/pdffontcache.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/gdi/pdffontcache.hxx b/vcl/source/gdi/pdffontcache.hxx
index 30d075d23e42..791ebe0d2e01 100644
--- a/vcl/source/gdi/pdffontcache.hxx
+++ b/vcl/source/gdi/pdffontcache.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,10 +43,10 @@ namespace vcl
sal_IntPtr m_nFontId;
int m_nMagic;
bool m_bVertical;
-
+
FontIdentifier( const ImplFontData*, bool bVertical );
FontIdentifier() : m_nFontId(0), m_nMagic(0), m_bVertical( false ) {}
-
+
bool operator==( const FontIdentifier& rRight ) const
{
return m_nFontId == rRight.m_nFontId &&
@@ -66,15 +66,15 @@ namespace vcl
Ucs2UIntMap m_aGlyphIdToIndex;
};
typedef std::map< FontIdentifier, sal_uInt32 > FontToIndexMap;
-
+
std::vector< FontData > m_aFonts;
FontToIndexMap m_aFontToIndex;
-
+
FontData& getFont( const ImplFontData*, bool bVertical );
public:
PDFFontCache() {}
~PDFFontCache() {}
-
+
sal_Int32 getGlyphWidth( const ImplFontData*, sal_GlyphId, bool bVertical, SalGraphics* );
};
}
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 881205e0af77..632190d3e7a3 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,9 +39,9 @@ PDFWriter::AnyWidget::~AnyWidget()
{
}
-PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
+PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
:
- pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
+ pImplementation( new PDFWriterImpl( rContext ) )
{
}
@@ -70,6 +70,16 @@ 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 );
@@ -91,7 +101,7 @@ void PDFWriter::DrawTextLine(
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- sal_Bool bUnderlineAbove )
+ BOOL bUnderlineAbove )
{
((PDFWriterImpl*)pImplementation)->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
@@ -108,7 +118,7 @@ void PDFWriter::DrawTextArray(
void PDFWriter::DrawStretchText(
const Point& rStartPt,
- sal_uLong nWidth,
+ ULONG nWidth,
const XubString& rStr,
xub_StrLen nIndex,
xub_StrLen nLen )
@@ -119,7 +129,7 @@ void PDFWriter::DrawStretchText(
void PDFWriter::DrawText(
const Rectangle& rRect,
const XubString& rStr,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
((PDFWriterImpl*)pImplementation)->drawText( rRect, rStr, nStyle );
}
@@ -149,7 +159,7 @@ void PDFWriter::DrawRect( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect );
}
-void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
+void PDFWriter::DrawRect( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
{
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect, nHorzRound, nVertRound );
}
@@ -282,7 +292,7 @@ void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpap
((PDFWriterImpl*)pImplementation)->drawWallpaper( rRect, rWallpaper );
}
-void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
+void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent )
{
((PDFWriterImpl*)pImplementation)->drawTransparent( rPolyPoly, nTransparencePercent );
}
@@ -292,7 +302,7 @@ void PDFWriter::BeginTransparencyGroup()
((PDFWriterImpl*)pImplementation)->beginTransparencyGroup();
}
-void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
+void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, USHORT nTransparentPercent )
{
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, nTransparentPercent );
}
@@ -302,7 +312,7 @@ void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, const Bitmap& rAlp
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, rAlphaMask );
}
-void PDFWriter::Push( sal_uInt16 nFlags )
+void PDFWriter::Push( USHORT nFlags )
{
((PDFWriterImpl*)pImplementation)->push( nFlags );
}
@@ -357,12 +367,12 @@ void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->intersectClipRegion( rRect );
}
-void PDFWriter::SetAntialiasing( sal_uInt16 nMode )
+void PDFWriter::SetAntialiasing( USHORT nMode )
{
((PDFWriterImpl*)pImplementation)->setAntiAlias( (sal_Int32)nMode );
}
-void PDFWriter::SetLayoutMode( sal_uLong nMode )
+void PDFWriter::SetLayoutMode( ULONG nMode )
{
((PDFWriterImpl*)pImplementation)->setLayoutMode( (sal_Int32)nMode );
}
@@ -561,18 +571,4 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
-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
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 66072a48d392..2285fed41bdf 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,6 @@
#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>
@@ -69,17 +68,9 @@
#include "cppuhelper/implbase1.hxx"
#include <icc/sRGB-IEC61966-2.1.hxx>
#include <vcl/lineinfo.hxx>
-#include "vcl/strhelper.hxx"
using namespace vcl;
-
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
-using ::rtl::OString;
-using ::rtl::OStringHash;
-using ::rtl::OUStringHash;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringBuffer;
+using namespace rtl;
#if (OSL_DEBUG_LEVEL < 2)
#define COMPRESS_PAGES
@@ -116,16 +107,18 @@ void doTestCode()
rtl::OUString aTestFile( RTL_CONSTASCII_USTRINGPARAM( "file://" ) );
aTestFile += rtl::OUString( pHome, strlen( pHome ), RTL_TEXTENCODING_MS_1252 );
aTestFile += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/pdf_export_test.pdf" ) );
-
+
PDFWriter::PDFWriterContext aContext;
- aContext.URL = aTestFile;
- aContext.Version = PDFWriter::PDF_1_4;
- aContext.Tagged = true;
+ aContext.URL = aTestFile;
+ 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
@@ -219,7 +212,7 @@ void doTestCode()
aWriter.BeginStructureElement( PDFWriter::Caption );
aWriter.DrawText( Point( 4500, 9000 ), String( RTL_CONSTASCII_USTRINGPARAM( "Some drawing stuff inside the structure" ) ) );
aWriter.EndStructureElement();
-
+
// test clipping
basegfx::B2DPolyPolygon aClip;
basegfx::B2DPolygon aClipPoly;
@@ -230,7 +223,7 @@ void doTestCode()
aClipPoly.setClosed( true );
//aClipPoly.flip();
aClip.append( aClipPoly );
-
+
aWriter.Push( PUSH_CLIPREGION | PUSH_FILLCOLOR );
aWriter.SetClipRegion( aClip );
aWriter.DrawEllipse( Rectangle( Point( 4500, 9600 ), Size( 12000, 3000 ) ) );
@@ -259,7 +252,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( (sal_uInt8)((nX+nY)/2) ) );
+ pAcc->SetPixel( nX, nY, BitmapColor( (BYTE)((nX+nY)/2) ) );
aTransMask.ReleaseAccess( pAcc );
aTransMask.SetPrefMapMode( MAP_MM );
aTransMask.SetPrefSize( Size( 10, 10 ) );
@@ -503,12 +496,6 @@ 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',
@@ -693,7 +680,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
appendHex( (sal_Int8)pStr[i], aBuffer );
}
}
-
+
OString aFullName( aBuffer.makeStringAndClear() );
/* #i82785# create hierarchical fields down to the for each dot in i_rName */
@@ -709,7 +696,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
// find or create a hierarchical field
// first find the fully qualified name up to this field
aDomain = aFullName.copy( 0, nTokenIndex-1 );
- boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
+ std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
if( it == m_aFieldNameMap.end() )
{
// create new hierarchy field
@@ -766,11 +753,11 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
}
}
} while( nTokenIndex != -1 );
-
+
// insert widget into its hierarchy field
if( aDomain.getLength() )
{
- boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
+ std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
if( it != m_aFieldNameMap.end() )
{
OSL_ENSURE( it->second >= 0 && it->second < sal_Int32( m_aWidgets.size() ), "invalid field index" );
@@ -782,7 +769,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
}
}
}
-
+
if( aPartialName.getLength() == 0 )
{
// how funny, an empty field name
@@ -797,11 +784,11 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
if( ! m_aContext.AllowDuplicateFieldNames )
{
- boost::unordered_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aFullName );
-
+ std::hash_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aFullName );
+
if( it != m_aFieldNameMap.end() ) // not unique
{
- boost::unordered_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
+ std::hash_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
OString aTry;
sal_Int32 nTry = 2;
do
@@ -836,11 +823,11 @@ static void appendFixedInt( sal_Int32 nValue, OStringBuffer& rBuffer, sal_Int32
while( nDiv-- )
nFactor *= 10;
- sal_Int32 nInt = nValue / nFactor;
+ sal_Int32 nInt = nValue / nFactor;
rBuffer.append( nInt );
if( nFactor > 1 )
{
- sal_Int32 nDecimal = nValue % nFactor;
+ sal_Int32 nDecimal = nValue % nFactor;
if( nDecimal )
{
rBuffer.append( '.' );
@@ -896,44 +883,34 @@ static void appendDouble( double fValue, OStringBuffer& rBuffer, sal_Int32 nPrec
}
-static void appendColor( const Color& rColor, OStringBuffer& rBuffer, bool bConvertToGrey = false )
+static void appendColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- 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 );
- }
+ 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 );
}
}
-void PDFWriterImpl::appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+static void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
- appendColor( rColor, rBuffer, bGrey );
- rBuffer.append( bGrey ? " G" : " RG" );
+ appendColor( rColor, rBuffer );
+ rBuffer.append( " RG" );
}
}
-void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+static void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
- appendColor( rColor, rBuffer, bGrey );
- rBuffer.append( bGrey ? " g" : " rg" );
+ appendColor( rColor, rBuffer );
+ rBuffer.append( " rg" );
}
}
@@ -941,7 +918,7 @@ void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer&
// TODO: use basegfx matrix class instead or derive from it
namespace vcl // TODO: use anonymous namespace to keep this class local
{
-/* for sparse matrices of the form (2D linear transformations)
+/* for sparse matrices of the form (2D linear transformations)
* f[0] f[1] 0
* f[2] f[3] 0
* f[4] f[5] 1
@@ -1397,7 +1374,7 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
m_pWriter->getReferenceDevice(),
rPoint ) );
- sal_Int32 nValue = aPoint.X();
+ sal_Int32 nValue = aPoint.X();
if( bNeg )
nValue = -nValue;
@@ -1405,7 +1382,7 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
rBuffer.append( ' ' );
- nValue = pointToPixel(getHeight()) - aPoint.Y();
+ nValue = pointToPixel(getHeight()) - aPoint.Y();
if( bNeg )
nValue = -nValue;
@@ -1414,13 +1391,13 @@ void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rB
void PDFWriterImpl::PDFPage::appendPixelPoint( const basegfx::B2DPoint& rPoint, OStringBuffer& rBuffer ) const
{
- double fValue = pixelToPoint(rPoint.getX());
+ double fValue = pixelToPoint(rPoint.getX());
appendDouble( fValue, rBuffer, nLog10Divisor );
rBuffer.append( ' ' );
- fValue = double(getHeight()) - pixelToPoint(rPoint.getY());
+ fValue = double(getHeight()) - pixelToPoint(rPoint.getY());
appendDouble( fValue, rBuffer, nLog10Divisor );
}
@@ -1446,25 +1423,25 @@ void PDFWriterImpl::PDFPage::convertRect( Rectangle& rRect ) const
m_pWriter->m_aMapMode,
m_pWriter->getReferenceDevice(),
rRect.GetSize() );
- rRect.Left() = aLL.X();
- rRect.Right() = aLL.X() + aSize.Width();
- rRect.Top() = pointToPixel(getHeight()) - aLL.Y();
- rRect.Bottom() = rRect.Top() + aSize.Height();
+ rRect.Left() = aLL.X();
+ rRect.Right() = aLL.X() + aSize.Width();
+ rRect.Top() = pointToPixel(getHeight()) - aLL.Y();
+ rRect.Bottom() = rRect.Top() + aSize.Height();
}
void PDFWriterImpl::PDFPage::appendPolygon( const Polygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
/*
* #108582# applications do weird things
*/
sal_uInt32 nBufLen = rBuffer.getLength();
if( nPoints > 0 )
{
- const sal_uInt8* pFlagArray = rPoly.GetConstFlagAry();
+ const BYTE* pFlagArray = rPoly.GetConstFlagAry();
appendPoint( rPoly[0], rBuffer );
rBuffer.append( " m\n" );
- for( sal_uInt16 i = 1; i < nPoints; i++ )
+ for( USHORT i = 1; i < nPoints; i++ )
{
if( pFlagArray && pFlagArray[i] == POLY_CONTROL && nPoints-i > 2 )
{
@@ -1528,7 +1505,7 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
if( i != nPoints || aPoly.isClosed() )
{
sal_uInt32 nCurPoint = i % nPoints;
- sal_uInt32 nLastPoint = i-1;
+ sal_uInt32 nLastPoint = i-1;
basegfx::B2DPoint aPoint( aPoly.getB2DPoint( nCurPoint ) );
if( aPoly.isNextControlPointUsed( nLastPoint ) &&
aPoly.isPrevControlPointUsed( nCurPoint ) )
@@ -1575,8 +1552,8 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
void PDFWriterImpl::PDFPage::appendPolyPolygon( const PolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- sal_uInt16 nPolygons = rPolyPoly.Count();
- for( sal_uInt16 n = 0; n < nPolygons; n++ )
+ USHORT nPolygons = rPolyPoly.Count();
+ for( USHORT n = 0; n < nPolygons; n++ )
appendPolygon( rPolyPoly[n], rBuffer, bClose );
}
@@ -1611,7 +1588,7 @@ void PDFWriterImpl::PDFPage::appendMappedLength( double fLength, OStringBuffer&
Size aSize( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
m_pWriter->m_aMapMode,
m_pWriter->getReferenceDevice(),
- Size( 1000, 1000 ) ) );
+ Size( 1000, 1000 ) ) );
if( pOutLength )
*pOutLength = (sal_Int32)(fLength*(double)(bVertical ? aSize.Height() : aSize.Width())/1000.0);
fLength *= pixelToPoint((double)(bVertical ? aSize.Height() : aSize.Width()) / 1000.0);
@@ -1711,9 +1688,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
- PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
- const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc,
- PDFWriter& i_rOuterFace)
+PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1734,10 +1709,12 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
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_rOuterFace( i_rOuterFace )
+ m_bIsPDF_A1( false )
{
#ifdef DO_TEST_PDF
static bool bOnce = true;
@@ -1749,16 +1726,16 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
#endif
m_aContext = rContext;
m_aStructure.push_back( PDFStructureElement() );
- m_aStructure[0].m_nOwnElement = 0;
- m_aStructure[0].m_nParentElement = 0;
+ m_aStructure[0].m_nOwnElement = 0;
+ m_aStructure[0].m_nParentElement = 0;
Font aFont;
aFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Times" ) ) );
aFont.SetSize( Size( 0, 12 ) );
GraphicsState aState;
- aState.m_aMapMode = m_aMapMode;
- aState.m_aFont = aFont;
+ aState.m_aMapMode = m_aMapMode;
+ aState.m_aFont = aFont;
m_aGraphicsStack.push_front( aState );
oslFileError aError = osl_openFile( m_aContext.URL.pData, &m_aFile, osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
@@ -1776,37 +1753,14 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
m_bOpen = true;
- // setup DocInfo
- setupDocInfo();
+/* prepare the cypher engine, can be done in CTOR, free in DTOR */
- /* 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-" );
@@ -1852,138 +1806,139 @@ PDFWriterImpl::~PDFWriterImpl()
rtl_freeMemory( m_pEncryptionBuffer );
}
-void PDFWriterImpl::setupDocInfo()
+void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
{
- 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;
-}
+ 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;
-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
+//build the document id
rtl::OString aInfoValuesOut;
OStringBuffer aID( 1024 );
- 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 );
+ 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 );
TimeValue aTVal, aGMT;
oslDateTime aDT;
osl_getSystemTime( &aGMT );
osl_getLocalTimeFromSystemTime( &aGMT, &aTVal );
osl_getDateTimeFromTimeValue( &aTVal, &aDT );
- 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)) );
-
+ 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)) );
+ }
sal_uInt32 nDelta = 0;
if( aGMT.Seconds > aTVal.Seconds )
{
- aCreationDateString.append( "-" );
+ m_aCreationDateString.append( "-" );
nDelta = aGMT.Seconds-aTVal.Seconds;
- aCreationMetaDateString.append( "-" );
+ if( m_bIsPDF_A1 )
+ m_aCreationMetaDateString.append( "-" );
}
else if( aGMT.Seconds < aTVal.Seconds )
{
- aCreationDateString.append( "+" );
+ m_aCreationDateString.append( "+" );
nDelta = aTVal.Seconds-aGMT.Seconds;
- aCreationMetaDateString.append( "+" );
+ if( m_bIsPDF_A1 )
+ m_aCreationMetaDateString.append( "+" );
}
else
{
- aCreationDateString.append( "Z" );
- aCreationMetaDateString.append( "Z" );
+ m_aCreationDateString.append( "Z" );
+ if( m_bIsPDF_A1 )
+ m_aCreationMetaDateString.append( "Z" );
}
if( nDelta )
{
- 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( (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( "'" );
- aID.append( aCreationDateString.getStr(), aCreationDateString.getLength() );
+ m_aCreationDateString.append( "'" );
+ aID.append( m_aCreationDateString.getStr(), m_aCreationDateString.getLength() );
aInfoValuesOut = aID.makeStringAndClear();
- o_rCString1 = aCreationDateString.makeStringAndClear();
- o_rCString2 = aCreationMetaDateString.makeStringAndClear();
- rtlDigest aDigest = rtl_digest_createMD5();
- OSL_ENSURE( aDigest != NULL, "PDFWriterImpl::computeDocumentIdentifier: cannot obtain a digest object !" );
- if( aDigest )
+ DBG_ASSERT( m_aDigest != NULL, "PDFWrite_Impl::setDocInfo: cannot obtain a digest object !" );
+
+ m_aDocID.setLength( 0 );
+ if( m_aDigest )
{
- rtlDigestError nError = rtl_digest_updateMD5( aDigest, &aGMT, sizeof( aGMT ) );
+ osl_getSystemTime( &aGMT );
+ rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &aGMT, sizeof( aGMT ) );
if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
+ nError = rtl_digest_updateMD5( m_aDigest, m_aContext.URL.getStr(), m_aContext.URL.getLength()*sizeof(sal_Unicode) );
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( m_aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
if( nError == rtl_Digest_E_None )
{
- 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 );
+//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 );
}
}
}
@@ -1996,7 +1951,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.Encryption.Encrypt() )
+ if( m_aContext.Encrypt )
{
const sal_Unicode* pStr = rInString.getStr();
sal_Int32 nLen = rInString.getLength();
@@ -2033,7 +1988,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.Encryption.Encrypt() && checkEncryptionBufferSize( nChars ) )
+ if( m_aContext.Encrypt && checkEncryptionBufferSize( nChars ) )
{
//encrypt the string in a buffer, then append it
enableStringEncryption( nInObjectNumber );
@@ -2051,25 +2006,9 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OString& rInSt
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
-void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc )
+inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer )
{
- rtl::OString aBufferString( rtl::OUStringToOString( rInString, nEnc ) );
- sal_Int32 nLen = aBufferString.getLength();
- rtl::OStringBuffer aBuf( nLen );
- const sal_Char* pT = aBufferString.getStr();
-
- for( sal_Int32 i = 0; i < nLen; i++, pT++ )
- {
- if( (*pT & 0x80) == 0 )
- aBuf.append( *pT );
- else
- {
- aBuf.append( '<' );
- appendHex( *pT, aBuf );
- aBuf.append( '>' );
- }
- }
- aBufferString = aBuf.makeStringAndClear();
+ rtl::OString aBufferString( rtl::OUStringToOString( rInString, RTL_TEXTENCODING_ASCII_US ) );
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
@@ -2088,12 +2027,12 @@ bool PDFWriterImpl::compressStream( SvMemoryStream* pStream )
{
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
pStream->Seek( STREAM_SEEK_TO_END );
- sal_uLong nEndPos = pStream->Tell();
+ ULONG nEndPos = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const sal_uInt8*)pStream->GetData(), nEndPos );
+ pCodec->Write( aStream, (const BYTE*)pStream->GetData(), nEndPos );
pCodec->EndCompression();
delete pCodec;
nEndPos = aStream.Tell();
@@ -2152,7 +2091,7 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes )
sal_uInt64 nWritten;
if( m_pCodec )
{
- m_pCodec->Write( *m_pMemStream, static_cast<const sal_uInt8*>(pBuffer), (sal_uLong)nBytes );
+ m_pCodec->Write( *m_pMemStream, static_cast<const BYTE*>(pBuffer), (ULONG)nBytes );
nWritten = nBytes;
}
else
@@ -2194,16 +2133,13 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
m_pReferenceDevice = pVDev;
- 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->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
pVDev->SetMapMode( MAP_MM );
m_pReferenceDevice->mpPDFWriter = this;
- m_pReferenceDevice->ImplUpdateFontData( sal_True );
+ m_pReferenceDevice->ImplUpdateFontData( TRUE );
}
return m_pReferenceDevice;
}
@@ -2290,20 +2226,20 @@ void PDFWriterImpl::getFontMetric( ImplFontSelectData* pSelect, ImplFontMetricDa
return;
const BuiltinFont* pBuiltinFont = pFD->GetBuiltinFont();
- pMetric->mnOrientation = sal::static_int_cast<short>(pSelect->mnOrientation);
- pMetric->meFamily = pBuiltinFont->m_eFamily;
- pMetric->mePitch = pBuiltinFont->m_ePitch;
- pMetric->meWeight = pBuiltinFont->m_eWeight;
- pMetric->meItalic = pBuiltinFont->m_eItalic;
- pMetric->mbSymbolFlag = pFD->IsSymbolFont();
- pMetric->mnWidth = pSelect->mnHeight;
- pMetric->mnAscent = ( pSelect->mnHeight * +pBuiltinFont->m_nAscent + 500 ) / 1000;
- pMetric->mnDescent = ( pSelect->mnHeight * -pBuiltinFont->m_nDescent + 500 ) / 1000;
- pMetric->mnIntLeading = 0;
- pMetric->mnExtLeading = 0;
- pMetric->mnSlant = 0;
- pMetric->mbScalableFont = true;
- pMetric->mbDevice = true;
+ pMetric->mnOrientation = sal::static_int_cast<short>(pSelect->mnOrientation);
+ pMetric->meFamily = pBuiltinFont->m_eFamily;
+ pMetric->mePitch = pBuiltinFont->m_ePitch;
+ pMetric->meWeight = pBuiltinFont->m_eWeight;
+ pMetric->meItalic = pBuiltinFont->m_eItalic;
+ pMetric->mbSymbolFlag = pFD->IsSymbolFont();
+ pMetric->mnWidth = pSelect->mnHeight;
+ pMetric->mnAscent = ( pSelect->mnHeight * +pBuiltinFont->m_nAscent + 500 ) / 1000;
+ pMetric->mnDescent = ( pSelect->mnHeight * -pBuiltinFont->m_nDescent + 500 ) / 1000;
+ pMetric->mnIntLeading = 0;
+ pMetric->mnExtLeading = 0;
+ pMetric->mnSlant = 0;
+ pMetric->mbScalableFont = true;
+ pMetric->mbDevice = true;
}
// -----------------------------------------------------------------------
@@ -2439,6 +2375,9 @@ 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 ) );
@@ -2465,7 +2404,7 @@ void PDFWriterImpl::endPage()
// sanity check
if( m_aOutputStreams.begin() != m_aOutputStreams.end() )
{
- OSL_FAIL( "redirection across pages !!!" );
+ DBG_ERROR( "redirection across pages !!!" );
m_aOutputStreams.clear(); // leak !
m_aMapMode.SetOrigin( Point() );
}
@@ -2573,24 +2512,24 @@ const sal_Char* PDFWriterImpl::getAttributeTag( PDFWriter::StructAttribute eAttr
// fill maps once
if( aAttributeStrings.empty() )
{
- aAttributeStrings[ PDFWriter::Placement ] = "Placement";
- aAttributeStrings[ PDFWriter::WritingMode ] = "WritingMode";
- aAttributeStrings[ PDFWriter::SpaceBefore ] = "SpaceBefore";
- aAttributeStrings[ PDFWriter::SpaceAfter ] = "SpaceAfter";
- aAttributeStrings[ PDFWriter::StartIndent ] = "StartIndent";
- aAttributeStrings[ PDFWriter::EndIndent ] = "EndIndent";
- aAttributeStrings[ PDFWriter::TextIndent ] = "TextIndent";
- aAttributeStrings[ PDFWriter::TextAlign ] = "TextAlign";
- aAttributeStrings[ PDFWriter::Width ] = "Width";
- aAttributeStrings[ PDFWriter::Height ] = "Height";
- aAttributeStrings[ PDFWriter::BlockAlign ] = "BlockAlign";
- aAttributeStrings[ PDFWriter::InlineAlign ] = "InlineAlign";
- aAttributeStrings[ PDFWriter::LineHeight ] = "LineHeight";
- aAttributeStrings[ PDFWriter::BaselineShift ] = "BaselineShift";
- aAttributeStrings[ PDFWriter::TextDecorationType ] = "TextDecorationType";
- aAttributeStrings[ PDFWriter::ListNumbering ] = "ListNumbering";
- aAttributeStrings[ PDFWriter::RowSpan ] = "RowSpan";
- aAttributeStrings[ PDFWriter::ColSpan ] = "ColSpan";
+ aAttributeStrings[ PDFWriter::Placement ] = "Placement";
+ aAttributeStrings[ PDFWriter::WritingMode ] = "WritingMode";
+ aAttributeStrings[ PDFWriter::SpaceBefore ] = "SpaceBefore";
+ aAttributeStrings[ PDFWriter::SpaceAfter ] = "SpaceAfter";
+ aAttributeStrings[ PDFWriter::StartIndent ] = "StartIndent";
+ aAttributeStrings[ PDFWriter::EndIndent ] = "EndIndent";
+ aAttributeStrings[ PDFWriter::TextIndent ] = "TextIndent";
+ aAttributeStrings[ PDFWriter::TextAlign ] = "TextAlign";
+ aAttributeStrings[ PDFWriter::Width ] = "Width";
+ aAttributeStrings[ PDFWriter::Height ] = "Height";
+ aAttributeStrings[ PDFWriter::BlockAlign ] = "BlockAlign";
+ aAttributeStrings[ PDFWriter::InlineAlign ] = "InlineAlign";
+ aAttributeStrings[ PDFWriter::LineHeight ] = "LineHeight";
+ aAttributeStrings[ PDFWriter::BaselineShift ] = "BaselineShift";
+ aAttributeStrings[ PDFWriter::TextDecorationType ] = "TextDecorationType";
+ aAttributeStrings[ PDFWriter::ListNumbering ] = "ListNumbering";
+ aAttributeStrings[ PDFWriter::RowSpan ] = "RowSpan";
+ aAttributeStrings[ PDFWriter::ColSpan ] = "ColSpan";
aAttributeStrings[ PDFWriter::LinkAnnotation ] = "LinkAnnotation";
}
@@ -2611,32 +2550,32 @@ const sal_Char* PDFWriterImpl::getAttributeValueTag( PDFWriter::StructAttributeV
if( aValueStrings.empty() )
{
- aValueStrings[ PDFWriter::NONE ] = "None";
- aValueStrings[ PDFWriter::Block ] = "Block";
- aValueStrings[ PDFWriter::Inline ] = "Inline";
- aValueStrings[ PDFWriter::Before ] = "Before";
- aValueStrings[ PDFWriter::After ] = "After";
- aValueStrings[ PDFWriter::Start ] = "Start";
- aValueStrings[ PDFWriter::End ] = "End";
- aValueStrings[ PDFWriter::LrTb ] = "LrTb";
- aValueStrings[ PDFWriter::RlTb ] = "RlTb";
- aValueStrings[ PDFWriter::TbRl ] = "TbRl";
- aValueStrings[ PDFWriter::Center ] = "Center";
- aValueStrings[ PDFWriter::Justify ] = "Justify";
- aValueStrings[ PDFWriter::Auto ] = "Auto";
- aValueStrings[ PDFWriter::Middle ] = "Middle";
- aValueStrings[ PDFWriter::Normal ] = "Normal";
- aValueStrings[ PDFWriter::Underline ] = "Underline";
- aValueStrings[ PDFWriter::Overline ] = "Overline";
- aValueStrings[ PDFWriter::LineThrough ] = "LineThrough";
- aValueStrings[ PDFWriter::Disc ] = "Disc";
- aValueStrings[ PDFWriter::Circle ] = "Circle";
- aValueStrings[ PDFWriter::Square ] = "Square";
- aValueStrings[ PDFWriter::Decimal ] = "Decimal";
- aValueStrings[ PDFWriter::UpperRoman ] = "UpperRoman";
- aValueStrings[ PDFWriter::LowerRoman ] = "LowerRoman";
- aValueStrings[ PDFWriter::UpperAlpha ] = "UpperAlpha";
- aValueStrings[ PDFWriter::LowerAlpha ] = "LowerAlpha";
+ aValueStrings[ PDFWriter::NONE ] = "None";
+ aValueStrings[ PDFWriter::Block ] = "Block";
+ aValueStrings[ PDFWriter::Inline ] = "Inline";
+ aValueStrings[ PDFWriter::Before ] = "Before";
+ aValueStrings[ PDFWriter::After ] = "After";
+ aValueStrings[ PDFWriter::Start ] = "Start";
+ aValueStrings[ PDFWriter::End ] = "End";
+ aValueStrings[ PDFWriter::LrTb ] = "LrTb";
+ aValueStrings[ PDFWriter::RlTb ] = "RlTb";
+ aValueStrings[ PDFWriter::TbRl ] = "TbRl";
+ aValueStrings[ PDFWriter::Center ] = "Center";
+ aValueStrings[ PDFWriter::Justify ] = "Justify";
+ aValueStrings[ PDFWriter::Auto ] = "Auto";
+ aValueStrings[ PDFWriter::Middle ] = "Middle";
+ aValueStrings[ PDFWriter::Normal ] = "Normal";
+ aValueStrings[ PDFWriter::Underline ] = "Underline";
+ aValueStrings[ PDFWriter::Overline ] = "Overline";
+ aValueStrings[ PDFWriter::LineThrough ] = "LineThrough";
+ aValueStrings[ PDFWriter::Disc ] = "Disc";
+ aValueStrings[ PDFWriter::Circle ] = "Circle";
+ aValueStrings[ PDFWriter::Square ] = "Square";
+ aValueStrings[ PDFWriter::Decimal ] = "Decimal";
+ aValueStrings[ PDFWriter::UpperRoman ] = "UpperRoman";
+ aValueStrings[ PDFWriter::LowerRoman ] = "LowerRoman";
+ aValueStrings[ PDFWriter::UpperAlpha ] = "UpperAlpha";
+ aValueStrings[ PDFWriter::LowerAlpha ] = "LowerAlpha";
}
std::map< PDFWriter::StructAttributeValue, const char* >::const_iterator it =
@@ -2716,7 +2655,7 @@ OString PDFWriterImpl::emitStructureAttributes( PDFStructureElement& i_rEle )
}
else
{
- OSL_FAIL( "unresolved link id for Link structure" );
+ DBG_ERROR( "unresolved link id for Link structure" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "unresolved link id %" SAL_PRIdINT32 " for Link structure\n", nLink );
{
@@ -2817,7 +2756,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
emitStructure( rChild );
else
{
- OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure element" );
+ DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure element" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::emitStructure: invalid child structure elemnt with id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -2826,7 +2765,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
}
else
{
- OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure id" );
+ DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure id" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::emitStructure: invalid child structure id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -2849,7 +2788,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
if( ! m_aRoleMap.empty() )
{
aLine.append( "/RoleMap<<" );
- for( boost::unordered_map<OString,OString,OStringHash>::const_iterator
+ for( std::hash_map<OString,OString,OStringHash>::const_iterator
it = m_aRoleMap.begin(); it != m_aRoleMap.end(); ++it )
{
aLine.append( '/' );
@@ -2976,9 +2915,12 @@ bool PDFWriterImpl::emitTilings()
aTilingObj.setLength( 0 );
- #if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::emitTilings" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( "PDFWriterImpl::emitTilings" );
+ emitComment( aLine.getStr() );
+ }
+#endif
sal_Int32 nX = (sal_Int32)it->m_aRectangle.Left();
sal_Int32 nY = (sal_Int32)it->m_aRectangle.Top();
@@ -3093,6 +3035,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
return aRet;
}
+ sal_Int32 nFontObject = 0;
sal_Int32 nFontDescriptor = 0;
rtl::OString aSubType( "/Type1" );
FontSubsetInfo aInfo;
@@ -3128,19 +3071,19 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
Int32Vector aGlyphWidths;
Ucs2UIntMap aUnicodeMap;
m_pReferenceDevice->mpGraphics->GetGlyphWidths( pFont, false, aGlyphWidths, aUnicodeMap );
-
+
OUString aTmpName;
osl_createTempFile( NULL, NULL, &aTmpName.pData );
sal_Int32 pGlyphIDs[ 256 ];
sal_uInt8 pEncoding[ 256 ];
sal_Ucs pUnicodes[ 256 ];
sal_Int32 pDuWidths[ 256 ];
-
+
memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) );
memset( pEncoding, 0, sizeof( pEncoding ) );
memset( pUnicodes, 0, sizeof( pUnicodes ) );
memset( pDuWidths, 0, sizeof( pDuWidths ) );
-
+
for( sal_Ucs c = 32; c < 256; c++ )
{
pUnicodes[c] = c;
@@ -3149,13 +3092,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
if( aUnicodeMap.find( c ) != aUnicodeMap.end() )
pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ];
}
-
+
m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, pGlyphIDs, pEncoding, pDuWidths, 256, aInfo );
osl_removeFile( aTmpName.pData );
}
else
{
- OSL_FAIL( "system font neither embeddable nor subsettable" );
+ DBG_ERROR( "system font neither embeddable nor subsettable" );
}
// write font descriptor
@@ -3189,11 +3132,12 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
aLine.append( " 0 R>>\n"
"endobj\n\n" );
writeBuffer( aLine.getStr(), aLine.getLength() );
-
+
+ nFontObject = nObject;
aRet[ rEmbed.m_nNormalFontID ] = nObject;
}
}
-
+
return aRet;
}
@@ -3242,6 +3186,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
return aRet;
}
+ sal_Int32 nFontObject = 0;
sal_Int32 nStreamObject = 0;
sal_Int32 nFontDescriptor = 0;
@@ -3273,7 +3218,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
}
-
+
FontSubsetInfo aInfo;
sal_Int32 pWidths[256];
const unsigned char* pFontData = NULL;
@@ -3296,13 +3241,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( pFontData[nIndex+1] == 0x03 )
break;
sal_Int32 nBytes =
- ((sal_Int32)pFontData[nIndex+2]) |
- ((sal_Int32)pFontData[nIndex+3]) << 8 |
- ((sal_Int32)pFontData[nIndex+4]) << 16 |
+ ((sal_Int32)pFontData[nIndex+2]) |
+ ((sal_Int32)pFontData[nIndex+3]) << 8 |
+ ((sal_Int32)pFontData[nIndex+4]) << 16 |
((sal_Int32)pFontData[nIndex+5]) << 24;
nIndex += nBytes+6;
}
-
+
// search for eexec
// TODO: use getPfbSegmentLengths() if possible to skip the search thingies below
nIndex = 0;
@@ -3312,7 +3257,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
do
{
while( nIndex < nFontLen-4 &&
- ( pFontData[nIndex] != 'e' ||
+ ( pFontData[nIndex] != 'e' ||
pFontData[nIndex+1] != 'e' ||
pFontData[nIndex+2] != 'x' ||
pFontData[nIndex+3] != 'e' ||
@@ -3327,7 +3272,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// this should end the ascii part
if( nIndex > nFontLen-5 )
throw FontException();
-
+
nEndAsciiIndex = nIndex+4;
// now count backwards until we can account for 512 '0'
// which is the endmarker of the (hopefully) binary data
@@ -3345,19 +3290,19 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// if all fonts complied
if( pFontData[nIndex] == '0' )
nFound++;
- else if( nFound > 0 &&
- pFontData[nIndex] != '\r' &&
- pFontData[nIndex] != '\t' &&
- pFontData[nIndex] != '\n' &&
+ else if( nFound > 0 &&
+ pFontData[nIndex] != '\r' &&
+ pFontData[nIndex] != '\t' &&
+ pFontData[nIndex] != '\n' &&
pFontData[nIndex] != ' ' )
break;
}
nIndex--;
}
-
+
if( nIndex < 1 || nIndex <= nEndAsciiIndex )
throw FontException();
-
+
// nLength3 is the rest of the file - excluding any section headers
// nIndex now points to the first of the 512 '0' characters marking the
// fixed content portion
@@ -3378,7 +3323,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
}
-
+
// there may be whitespace to ignore before the 512 '0'
while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' )
{
@@ -3392,7 +3337,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
}
nEndBinaryIndex = nIndex;
-
+
// search for beginning of binary section
nBeginBinaryIndex = nEndAsciiIndex;
do
@@ -3401,10 +3346,10 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it )
;
} while( nBeginBinaryIndex < nEndBinaryIndex &&
- ( pFontData[nBeginBinaryIndex] == '\r' ||
- pFontData[nBeginBinaryIndex] == '\n' ||
+ ( pFontData[nBeginBinaryIndex] == '\r' ||
+ pFontData[nBeginBinaryIndex] == '\n' ||
it != aSections.end() ) );
-
+
// it seems to be vital to copy the exact whitespace between binary data
// and eexec, else a invalid font results. so make nEndAsciiIndex
// always immediate in front of nBeginBinaryIndex
@@ -3413,11 +3358,11 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
;
if( it != aSections.end() )
nEndAsciiIndex = (*it)-1;
-
+
nLength1 = nEndAsciiIndex+1; // including the last character
for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it )
nLength1 -= 6; // decrease by pfb section size
-
+
// if the first four bytes are all ascii hex characters, then binary data
// has to be converted to real binary data
for( nIndex = 0; nIndex < 4 &&
@@ -3460,10 +3405,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" );
nLength2 /= 2;
}
-
+
// now we can actually write the font stream !
#if OSL_DEBUG_LEVEL > 1
- emitComment( " PDFWriterImpl::emitEmbeddedFont" );
+ {
+ OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
+ emitComment( aLine.getStr() );
+ }
#endif
OStringBuffer aLine( 512 );
nStreamObject = createObject();
@@ -3488,13 +3436,13 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"stream\n" );
if( !writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
sal_uInt64 nBeginStreamPos = 0;
osl_getFilePos( m_aFile, &nBeginStreamPos );
-
+
beginCompression();
checkAndEnableStreamEncryption( nStreamObject );
-
+
// write ascii section
if( aSections.begin() == aSections.end() )
{
@@ -3518,7 +3466,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) )
throw FontException();
}
-
+
// write binary section
if( ! bConvertHexData )
{
@@ -3553,7 +3501,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
boost::shared_array<unsigned char> pWriteBuffer( new unsigned char[ nLength2 ] );
rtl_zeroMemory( pWriteBuffer.get(), nLength2 );
int nWriteIndex = 0;
-
+
int nNextSectionIndex = 0;
for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it )
;
@@ -3613,17 +3561,17 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
endCompression();
disableStreamEncryption();
-
-
+
+
sal_uInt64 nEndStreamPos = 0;
osl_getFilePos( m_aFile, &nEndStreamPos );
-
+
// and finally close the stream
aLine.setLength( 0 );
aLine.append( "\nendstream\nendobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
// write stream length object
aLine.setLength( 0 );
if( ! updateObject( nStreamLengthObject ) )
@@ -3649,21 +3597,21 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
emitComment( aErrorComment.getStr() );
}
-
+
if( nStreamObject )
// write font descriptor
nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, nStreamObject );
-
+
if( nFontDescriptor )
{
if( pEncoding )
nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, SAL_N_ELEMENTS(nEncoding) );
-
+
// write font object
sal_Int32 nObject = createObject();
if( ! updateObject( nObject ) )
throw FontException();
-
+
OStringBuffer aLine( 1024 );
aLine.append( nObject );
aLine.append( " 0 obj\n"
@@ -3692,9 +3640,11 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"endobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
+ nFontObject = nObject;
+
aRet[ rEmbed.m_nNormalFontID ] = nObject;
-
+
// write additional encodings
for( std::list< EmbedEncoding >::iterator enc_it = rEmbed.m_aExtendedEncodings.begin(); enc_it != rEmbed.m_aExtendedEncodings.end(); ++enc_it )
{
@@ -3703,7 +3653,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
sal_Int32 nEncObject = createObject();
if( ! updateObject( nEncObject ) )
throw FontException();
-
+
OutputDevice* pRef = getReferenceDevice();
pRef->Push( PUSH_FONT | PUSH_MAPMODE );
pRef->SetMapMode( MapMode( MAP_PIXEL ) );
@@ -3713,7 +3663,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
aFont.SetPitch( pFont->GetPitch() );
pRef->SetFont( aFont );
pRef->ImplNewFont();
-
+
aLine.setLength( 0 );
aLine.append( nEncObject );
aLine.append( " 0 obj\n"
@@ -3729,7 +3679,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
pEncToUnicodeIndex[nEncoded] = static_cast<sal_Int32>(aUnicodes.size());
aUnicodes.push_back( nEncodedCodes[nEncoded] );
pUnicodesPerGlyph[nEncoded] = 1;
-
+
aLine.append( " /" );
aLine.append( str_it->m_aName );
if( !((++nEncoded) & 15) )
@@ -3737,18 +3687,18 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
}
aLine.append( "]>>\n"
"endobj\n\n" );
-
+
pRef->Pop();
-
+
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nEncoded );
-
+
nObject = createObject();
if( ! updateObject( nObject ) )
throw FontException();
-
+
aLine.setLength( 0 );
aLine.append( nObject );
aLine.append( " 0 obj\n"
@@ -3781,7 +3731,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
"endobj\n\n" );
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
-
+
aRet[ enc_it->m_nFontID ] = nObject;
}
}
@@ -3792,7 +3742,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
endCompression();
disableStreamEncryption();
}
-
+
if( pFontData )
m_pReferenceDevice->mpGraphics->FreeEmbedFontData( pFontData, nFontLen );
@@ -3882,14 +3832,17 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding,
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const sal_uInt8*)aContents.getStr(), aContents.getLength() );
+ pCodec->Write( aStream, (const BYTE*)aContents.getStr(), aContents.getLength() );
pCodec->EndCompression();
delete pCodec;
#endif
- #if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::createToUnicodeCMap" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::createToUnicodeCMap" );
+ emitComment( aLine.getStr() );
+ }
+#endif
OStringBuffer aLine( 40 );
aLine.append( nStream );
@@ -3985,7 +3938,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const ImplFontData* pFont, FontSubs
case FontSubsetInfo::ANY_TYPE1:
break;
default:
- OSL_FAIL( "unknown fonttype in PDF font descriptor" );
+ DBG_ERROR( "unknown fonttype in PDF font descriptor" );
return 0;
}
aLine.append( ' ' );
@@ -4015,11 +3968,11 @@ bool PDFWriterImpl::emitFonts()
{
if( ! m_pReferenceDevice->ImplGetGraphics() )
return false;
-
+
OStringBuffer aLine( 1024 );
-
+
std::map< sal_Int32, sal_Int32 > aFontIDToObject;
-
+
OUString aTmpName;
osl_createTempFile( NULL, NULL, &aTmpName.pData );
for( FontSubsetData::iterator it = m_aSubsets.begin(); it != m_aSubsets.end(); ++it )
@@ -4036,7 +3989,7 @@ bool PDFWriterImpl::emitFonts()
int nGlyphs = 1;
// fill arrays and prepare encoding index map
sal_Int32 nToUnicodeStream = 0;
-
+
rtl_zeroMemory( pGlyphIDs, sizeof( pGlyphIDs ) );
rtl_zeroMemory( pEncoding, sizeof( pEncoding ) );
rtl_zeroMemory( pUnicodesPerGlyph, sizeof( pUnicodesPerGlyph ) );
@@ -4044,10 +3997,10 @@ bool PDFWriterImpl::emitFonts()
for( FontEmitMapping::iterator fit = lit->m_aMapping.begin(); fit != lit->m_aMapping.end();++fit )
{
sal_uInt8 nEnc = fit->second.getGlyphId();
-
+
DBG_ASSERT( pGlyphIDs[nEnc] == 0 && pEncoding[nEnc] == 0, "duplicate glyph" );
DBG_ASSERT( nEnc <= lit->m_aMapping.size(), "invalid glyph encoding" );
-
+
pGlyphIDs[ nEnc ] = fit->first;
pEncoding[ nEnc ] = nEnc;
pEncToUnicodeIndex[ nEnc ] = static_cast<sal_Int32>(aUnicodes.size());
@@ -4060,7 +4013,7 @@ bool PDFWriterImpl::emitFonts()
nGlyphs++;
else
{
- OSL_FAIL( "too many glyphs for subset" );
+ DBG_ERROR( "too many glyphs for subset" );
}
}
FontSubsetInfo aSubsetInfo;
@@ -4074,9 +4027,12 @@ bool PDFWriterImpl::emitFonts()
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_End, 0 ) ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( aFontFile, &nLength1 ) ) );
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
-
+
#if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::emitFonts" );
+ {
+ OStringBuffer aLine1( " PDFWriterImpl::emitFonts" );
+ emitComment( aLine1.getStr() );
+ }
#endif
sal_Int32 nFontStream = createObject();
sal_Int32 nStreamLengthObject = createObject();
@@ -4091,17 +4047,17 @@ bool PDFWriterImpl::emitFonts()
"/Filter/FlateDecode"
#endif
"/Length1 " );
-
+
sal_uInt64 nStartPos = 0;
if( aSubsetInfo.m_nFontType == FontSubsetInfo::SFNT_TTF )
{
aLine.append( (sal_Int32)nLength1 );
-
+
aLine.append( ">>\n"
"stream\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) );
-
+
// copy font file
beginCompression();
checkAndEnableStreamEncryption( nFontStream );
@@ -4118,12 +4074,12 @@ bool PDFWriterImpl::emitFonts()
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::CFF_FONT) != 0 )
{
// TODO: implement
- OSL_FAIL( "PDFWriterImpl does not support CFF-font subsets yet!" );
+ DBG_ERROR( "PDFWriterImpl does not support CFF-font subsets yet!" );
}
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA?
{
boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] );
-
+
sal_uInt64 nBytesRead = 0;
CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) );
DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" );
@@ -4138,12 +4094,12 @@ bool PDFWriterImpl::emitFonts()
aLine.append( (sal_Int32)aSegmentLengths[1] );
aLine.append( "/Length3 " );
aLine.append( (sal_Int32)aSegmentLengths[2] );
-
+
aLine.append( ">>\n"
"stream\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) );
-
+
// emit PFB-sections without section headers
beginCompression();
checkAndEnableStreamEncryption( nFontStream );
@@ -4156,19 +4112,19 @@ bool PDFWriterImpl::emitFonts()
fprintf( stderr, "PDF: CreateFontSubset result in not yet supported format=%d\n",aSubsetInfo.m_nFontType);
aLine.append( "0 >>\nstream\n" );
}
-
+
endCompression();
disableStreamEncryption();
// close the file
osl_closeFile( aFontFile );
-
+
sal_uInt64 nEndPos = 0;
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nEndPos ) ) );
// end the stream
aLine.setLength( 0 );
aLine.append( "\nendstream\nendobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
// emit stream length object
CHECK_RETURN( updateObject( nStreamLengthObject ) );
aLine.setLength( 0 );
@@ -4177,18 +4133,18 @@ bool PDFWriterImpl::emitFonts()
aLine.append( (sal_Int64)(nEndPos-nStartPos) );
aLine.append( "\nendobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
// write font descriptor
sal_Int32 nFontDescriptor = emitFontDescriptor( it->first, aSubsetInfo, lit->m_nFontID, nFontStream );
-
+
if( nToUnicodeStream )
nToUnicodeStream = createToUnicodeCMap( pEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nGlyphs );
-
+
sal_Int32 nFontObject = createObject();
CHECK_RETURN( updateObject( nFontObject ) );
aLine.setLength( 0 );
aLine.append( nFontObject );
-
+
aLine.append( " 0 obj\n" );
aLine.append( ((aSubsetInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) != 0) ?
"<</Type/Font/Subtype/Type1/BaseFont/" :
@@ -4218,7 +4174,7 @@ bool PDFWriterImpl::emitFonts()
aLine.append( ">>\n"
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
-
+
aFontIDToObject[ lit->m_nFontID ] = nFontObject;
}
else
@@ -4239,7 +4195,7 @@ bool PDFWriterImpl::emitFonts()
}
}
osl_removeFile( aTmpName.pData );
-
+
// emit embedded fonts
for( FontEmbedData::iterator eit = m_aEmbeddedFonts.begin(); eit != m_aEmbeddedFonts.end(); ++eit )
{
@@ -4286,7 +4242,7 @@ bool PDFWriterImpl::emitFonts()
}
appendBuiltinFontsToDict( aFontDict );
aFontDict.append( "\n>>\nendobj\n\n" );
-
+
CHECK_RETURN( updateObject( getFontDictObject() ) );
CHECK_RETURN( writeBuffer( aFontDict.getStr(), aFontDict.getLength() ) );
return true;
@@ -4468,8 +4424,8 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, OStringBuffer& rBuffer )
}
- const PDFDest& rDest = m_aDests[ nDestID ];
- const PDFPage& rDestPage = m_aPages[ rDest.m_nPage ];
+ const PDFDest& rDest = m_aDests[ nDestID ];
+ const PDFPage& rDestPage = m_aPages[ rDest.m_nPage ];
rBuffer.append( '[' );
rBuffer.append( rDestPage.m_nPageObject );
@@ -4528,7 +4484,7 @@ bool PDFWriterImpl::emitLinkAnnotations()
int nAnnots = m_aLinks.size();
for( int i = 0; i < nAnnots; i++ )
{
- const PDFLink& rLink = m_aLinks[i];
+ const PDFLink& rLink = m_aLinks[i];
if( ! updateObject( rLink.m_nObject ) )
continue;
@@ -4581,6 +4537,7 @@ we check in the following sequence:
// extract target file type
INetURLObject aDocumentURL( m_aContext.BaseURL );
INetURLObject aTargetURL( rLink.m_aURL );
+ sal_Int32 nChangeFileExtensionToPDF = 0;
sal_Int32 nSetGoToRMode = 0;
sal_Bool bTargetHasPDFExtension = sal_False;
INetProtocol eTargetProtocol = aTargetURL.GetProtocol();
@@ -4619,19 +4576,18 @@ we check in the following sequence:
{
if( m_aContext.ConvertOOoTargetToPDFTarget )
{
- sal_Int32 bChangeFileExtensionToPDF = false;
- //examine the file type (.odm .odt. .odp, odg, ods)
+//examine the file type (.odm .odt. .odp, odg, ods)
if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odm" ) ) ) )
- bChangeFileExtensionToPDF = true;
+ nChangeFileExtensionToPDF++;
if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odt" ) ) ) )
- bChangeFileExtensionToPDF = true;
+ nChangeFileExtensionToPDF++;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odp" ) ) ) )
- bChangeFileExtensionToPDF = true;
+ nChangeFileExtensionToPDF++;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odg" ) ) ) )
- bChangeFileExtensionToPDF = true;
+ nChangeFileExtensionToPDF++;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ods" ) ) ) )
- bChangeFileExtensionToPDF = true;
- if( bChangeFileExtensionToPDF )
+ nChangeFileExtensionToPDF++;
+ if( nChangeFileExtensionToPDF )
aTargetURL.setExtension(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ) );
}
//check if extension is pdf, see if GoToR should be forced
@@ -4647,26 +4603,26 @@ we check in the following sequence:
{
aLine.append( "/Launch/Win<</F" );
// INetURLObject is not good with UNC paths, use original path
- appendLiteralStringEncrypt( rLink.m_aURL, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
+ appendLiteralStringEncrypt( rLink.m_aURL, rLink.m_nObject, aLine );
aLine.append( ">>" );
}
else
{
- bool bSetRelative = false;
- bool bFileSpec = false;
+ sal_Int32 nSetRelative = 0;
//check if relative file link is requested and if the protocol is 'file://'
if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE )
- bSetRelative = true;
+ nSetRelative++;
rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is,
+ bool bIsURI=false; //URI: 12.6.4.7, URI Actions, URI must be encoded in 7-bit-ASCII
if( nSetGoToRMode == 0 )
- {
switch( m_aContext.DefaultLinkAction )
{
default:
case PDFWriter::URIAction :
case PDFWriter::URIActionDestination :
aLine.append( "/URI/URI" );
+ bIsURI=true;
break;
case PDFWriter::LaunchAction:
// now:
@@ -4680,27 +4636,23 @@ we check in the following sequence:
eTargetProtocol != INET_PROT_FILE )
{
aLine.append( "/URI/URI" );
+ bIsURI=true;
}
else
- {
aLine.append( "/Launch/F" );
- bFileSpec = true;
- }
break;
}
- }
//fragment are encoded in the same way as in the named destination processing
+ rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
if( nSetGoToRMode )
{
//add the fragment
- rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
aLine.append("/GoToR");
aLine.append("/F");
- bFileSpec = true;
- appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
+ appendLiteralStringEncrypt( nSetRelative ? 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 );
if( aFragment.getLength() > 0 )
{
aLine.append("/D/");
@@ -4719,12 +4671,23 @@ we check in the following sequence:
//substitute the fragment
aTargetURL.SetMark( aLineLoc.getStr() );
}
- rtl::OUString aURL = aTargetURL.GetMainURL( bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
- appendLiteralStringEncrypt(bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL,
- INetURLObject::WAS_ENCODED,
- bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE
- ) :
- aURL , rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
+ if (bIsURI)
+ {
+ //If we're writing to URI/URI we must e in 7-bit ASCII, so encode anything else as %XX
+ rtl::OUString aURL = aTargetURL.GetMainURL(INetURLObject::NO_DECODE);
+ appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL(m_aContext.BaseURL, aURL) :
+ aURL , rLink.m_nObject, aLine );
+ }
+ else
+ {
+ //TO-DO: Depending on the interpretation of 12.6.4.5 we
+ //may be able to use appendUnicodeTextStringEncrypt
+ //here for the INetURLObject::DECODE_WITH_CHARSET case
+ //to ensure that the string doesn't get mangled
+ rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
+ appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL ) :
+ aURL , rLink.m_nObject, aLine );
+ }
}
//<--- i56629
}
@@ -4748,7 +4711,7 @@ bool PDFWriterImpl::emitNoteAnnotations()
int nAnnots = m_aNotes.size();
for( int i = 0; i < nAnnots; i++ )
{
- const PDFNoteEntry& rNote = m_aNotes[i];
+ const PDFNoteEntry& rNote = m_aNotes[i];
if( ! updateObject( rNote.m_nObject ) )
return false;
@@ -4953,9 +4916,9 @@ Font PDFWriterImpl::drawFieldBorder( PDFWidget& rIntern,
sal_Int32 nDelta = aFont.GetHeight()/4;
if( nDelta < 1 )
nDelta = 1;
- rIntern.m_aRect.Left() += nDelta;
- rIntern.m_aRect.Top() += nDelta;
- rIntern.m_aRect.Right() -= nDelta;
+ rIntern.m_aRect.Left() += nDelta;
+ rIntern.m_aRect.Top() += nDelta;
+ rIntern.m_aRect.Right() -= nDelta;
rIntern.m_aRect.Bottom()-= nDelta;
}
}
@@ -4993,7 +4956,7 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit
aDA.append( ' ' );
m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA );
aDA.append( " Tf" );
-
+
/* create an empty appearance stream, let the viewer create
the appearance at runtime. This is because AR5 seems to
paint the widget appearance always, and a dynamically created
@@ -5091,10 +5054,10 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
Rectangle aCheckRect, aTextRect;
if( rWidget.ButtonIsLeft )
{
- aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5104,17 +5067,17 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
else
{
- aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5124,10 +5087,10 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left();
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left();
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
setLineColor( Color( COL_BLACK ) );
setFillColor( Color( COL_TRANSPARENT ) );
@@ -5216,10 +5179,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
Rectangle aCheckRect, aTextRect;
if( rWidget.ButtonIsLeft )
{
- aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Left() + nDelta;
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5229,17 +5192,17 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta;
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
else
{
- aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
- aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
- aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
- aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
+ aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height();
+ aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2;
+ aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height();
+ aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height();
// #i74206# handle small controls without text area
while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta )
@@ -5249,10 +5212,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
aCheckRect.Bottom() -= nDelta - (nDelta/2);
}
- aTextRect.Left() = rBox.m_aRect.Left();
- aTextRect.Top() = rBox.m_aRect.Top();
- aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
- aTextRect.Bottom() = rBox.m_aRect.Bottom();
+ aTextRect.Left() = rBox.m_aRect.Left();
+ aTextRect.Top() = rBox.m_aRect.Top();
+ aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta;
+ aTextRect.Bottom() = rBox.m_aRect.Bottom();
}
setLineColor( Color( COL_BLACK ) );
setFillColor( Color( COL_TRANSPARENT ) );
@@ -5297,10 +5260,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
writeBuffer( aDA.getStr(), aDA.getLength() );
setFillColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ) );
setLineColor( Color( COL_TRANSPARENT ) );
- aCheckRect.Left() += 3*nDelta;
- aCheckRect.Top() += 3*nDelta;
- aCheckRect.Bottom() -= 3*nDelta;
- aCheckRect.Right() -= 3*nDelta;
+ aCheckRect.Left() += 3*nDelta;
+ aCheckRect.Top() += 3*nDelta;
+ aCheckRect.Bottom() -= 3*nDelta;
+ aCheckRect.Right() -= 3*nDelta;
drawEllipse( aCheckRect );
writeBuffer( "\nEMC\n", 5 );
endRedirect();
@@ -5352,9 +5315,12 @@ 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
- emitComment( "PDFWriterImpl::emitAppearances" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::emitAppearances" );
+ emitComment( aLine.getStr() );
+ }
+#endif
OStringBuffer aLine;
aLine.append( nObject );
@@ -5597,7 +5563,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
{
// create a submit form action
aLine.append( "/AA<</D<</Type/Action/S/SubmitForm/F" );
- appendLiteralStringEncrypt( rWidget.m_aListEntries.front(), rWidget.m_nObject, aLine, osl_getThreadTextEncoding() );
+ appendLiteralStringEncrypt( rWidget.m_aListEntries.front(), rWidget.m_nObject, aLine );
aLine.append( "/Flags " );
sal_Int32 nFlags = 0;
@@ -5894,7 +5860,7 @@ bool PDFWriterImpl::emitCatalog()
}
// viewer preferences, if we had some, then emit
if( m_aContext.HideViewerToolbar ||
- ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
+ ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.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 ) ||
@@ -5911,7 +5877,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_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
+ if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
aLine.append( "/DisplayDocTitle true\n" );
if( m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing )
aLine.append( "/Direction/R2L\n" );
@@ -6015,40 +5981,40 @@ sal_Int32 PDFWriterImpl::emitInfoDict( )
aLine.append( nObject );
aLine.append( " 0 obj\n"
"<<" );
- if( m_aContext.DocumentInfo.Title.Len() )
+ if( m_aDocInfo.Title.Len() )
{
aLine.append( "/Title" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Title, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Title, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.DocumentInfo.Author.Len() )
+ if( m_aDocInfo.Author.Len() )
{
aLine.append( "/Author" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Author, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Author, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.DocumentInfo.Subject.Len() )
+ if( m_aDocInfo.Subject.Len() )
{
aLine.append( "/Subject" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Subject, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Subject, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.DocumentInfo.Keywords.Len() )
+ if( m_aDocInfo.Keywords.Len() )
{
aLine.append( "/Keywords" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Keywords, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Keywords, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.DocumentInfo.Creator.Len() )
+ if( m_aDocInfo.Creator.Len() )
{
aLine.append( "/Creator" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Creator, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Creator, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.DocumentInfo.Producer.Len() )
+ if( m_aDocInfo.Producer.Len() )
{
aLine.append( "/Producer" );
- appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Producer, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aDocInfo.Producer, nObject, aLine );
aLine.append( "\n" );
}
@@ -6294,45 +6260,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_aContext.DocumentInfo.Title.Len() ||
- m_aContext.DocumentInfo.Author.Len() ||
- m_aContext.DocumentInfo.Subject.Len() )
+ if( m_aDocInfo.Title.Len() ||
+ m_aDocInfo.Author.Len() ||
+ m_aDocInfo.Subject.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" );
- if( m_aContext.DocumentInfo.Title.Len() )
+ if( m_aDocInfo.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_aContext.DocumentInfo.Title, aTitle );
+ escapeStringXML( m_aDocInfo.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_aContext.DocumentInfo.Author.Len() )
+ if( m_aDocInfo.Author.Len() )
{
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
rtl::OUString aAuthor;
- escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
+ escapeStringXML( m_aDocInfo.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_aContext.DocumentInfo.Subject.Len() )
+ if( m_aDocInfo.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_aContext.DocumentInfo.Subject, aSubject );
+ escapeStringXML( m_aDocInfo.Subject, aSubject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -6342,24 +6308,24 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
}
//... PDF properties go here
- if( m_aContext.DocumentInfo.Producer.Len() ||
- m_aContext.DocumentInfo.Keywords.Len() )
+ if( m_aDocInfo.Producer.Len() ||
+ m_aDocInfo.Keywords.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" );
- if( m_aContext.DocumentInfo.Producer.Len() )
+ if( m_aDocInfo.Producer.Len() )
{
aMetadataStream.append( " <pdf:Producer>" );
rtl::OUString aProducer;
- escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
+ escapeStringXML( m_aDocInfo.Producer, aProducer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
- if( m_aContext.DocumentInfo.Keywords.Len() )
+ if( m_aDocInfo.Keywords.Len() )
{
aMetadataStream.append( " <pdf:Keywords>" );
rtl::OUString aKeywords;
- escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
+ escapeStringXML( m_aDocInfo.Keywords, aKeywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -6368,11 +6334,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_aContext.DocumentInfo.Creator.Len() )
+ if( m_aDocInfo.Creator.Len() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
rtl::OUString aCreator;
- escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
+ escapeStringXML( m_aDocInfo.Creator, aCreator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -6428,7 +6394,7 @@ bool PDFWriterImpl::emitTrailer()
sal_Int32 nSecObject = 0;
- if( m_aContext.Encryption.Encrypt() )
+ if( m_aContext.Encrypt == true )
{
//emit the security information
//must be emitted as indirect dictionary object, since
@@ -6442,16 +6408,16 @@ bool PDFWriterImpl::emitTrailer()
aLineS.append( " 0 obj\n"
"<</Filter/Standard/V " );
// check the version
- if( m_aContext.Encryption.Security128bit )
+ if( m_aContext.Security128bit == true )
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_aContext.Encryption.OValue[0], sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
+ appendLiteralString( (const sal_Char*)m_nEncryptedOwnerPassword, 32, aLineS );
aLineS.append( ")/U(" );
- appendLiteralString( (const sal_Char*)&m_aContext.Encryption.UValue[0], sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
+ appendLiteralString( (const sal_Char*)m_nEncryptedUserPassword, 32, aLineS );
aLineS.append( ")/P " );// the permission set
aLineS.append( m_nAccessPermissions );
aLineS.append( ">>\nendobj\n\n" );
@@ -6517,21 +6483,13 @@ bool PDFWriterImpl::emitTrailer()
aLine.append( nDocInfoObject );
aLine.append( " 0 R\n" );
}
- if( ! m_aContext.Encryption.DocumentIdentifier.empty() )
+ if( m_aDocID.getLength() )
{
aLine.append( "/ID [ <" );
- 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( m_aDocID.getStr(), m_aDocID.getLength() );
aLine.append( ">\n"
"<" );
- 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( m_aDocID.getStr(), m_aDocID.getLength() );
aLine.append( "> ]\n" );
}
if( aDocChecksum.getLength() )
@@ -6618,7 +6576,7 @@ void PDFWriterImpl::sortWidgets()
{
// sort widget annotations on each page as per their
// TabOrder attribute
- boost::unordered_map< sal_Int32, AnnotSortContainer > sorted;
+ std::hash_map< sal_Int32, AnnotSortContainer > sorted;
int nWidgets = m_aWidgets.size();
for( int nW = 0; nW < nWidgets; nW++ )
{
@@ -6638,7 +6596,7 @@ void PDFWriterImpl::sortWidgets()
}
}
}
- for( boost::unordered_map< sal_Int32, AnnotSortContainer >::iterator it = sorted.begin(); it != sorted.end(); ++it )
+ for( std::hash_map< sal_Int32, AnnotSortContainer >::iterator it = sorted.begin(); it != sorted.end(); ++it )
{
// append entries for non widget annotations
PDFPage& rPage = m_aPages[ it->first ];
@@ -6670,7 +6628,7 @@ void PDFWriterImpl::sortWidgets()
namespace vcl {
class PDFStreamIf :
- public cppu::WeakImplHelper1< com::sun::star::io::XOutputStream >
+ public cppu::WeakImplHelper1< com::sun::star::io::XOutputStream >
{
PDFWriterImpl* m_pWriter;
bool m_bWrite;
@@ -6816,10 +6774,10 @@ sal_Int32 PDFWriterImpl::getSystemFont( const Font& i_rFont )
m_aSystemFonts[ pDevFont ] = EmbedFont();
m_aSystemFonts[ pDevFont ].m_nNormalFontID = nFontID;
}
-
+
getReferenceDevice()->Pop();
getReferenceDevice()->ImplNewFont();
-
+
return nFontID;
}
@@ -7018,7 +6976,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const String& rText, bool bT
Font aSetFont = m_aCurrentPDFState.m_aFont;
aSetFont.SetRelief( RELIEF_NONE );
- aSetFont.SetShadow( sal_False );
+ aSetFont.SetShadow( FALSE );
aSetFont.SetColor( aReliefColor );
setTextLineColor( aReliefColor );
@@ -7055,8 +7013,8 @@ void PDFWriterImpl::drawShadow( SalLayout& rLayout, const String& rText, bool bT
rFont.SetColor( Color( COL_LIGHTGRAY ) );
else
rFont.SetColor( Color( COL_BLACK ) );
- rFont.SetShadow( sal_False );
- rFont.SetOutline( sal_False );
+ rFont.SetShadow( FALSE );
+ rFont.SetOutline( FALSE );
setFont( rFont );
setTextLineColor( rFont.GetColor() );
setOverlineColor( rFont.GetColor() );
@@ -7425,12 +7383,12 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
if( i < nGlyphs-1 )
{
nChars = pCharPosAry[i+1] - pCharPosAry[i];
- // #i115618# fix for simple RTL+CTL cases
- // TODO: sanitize for RTL ligatures, more complex CTL, etc.
+ // #i115618# fix for simple RTL+CTL cases
+ // TODO: sanitize for RTL ligatures, more complex CTL, etc.
if( nChars < 0 )
- nChars = -nChars;
+ nChars = -nChars;
else if( nChars == 0 )
- nChars = 1;
+ nChars = 1;
pUnicodesPerGlyph[i] = nChars;
for( int n = 1; n < nChars; n++ )
aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]+n) ) );
@@ -7510,7 +7468,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
)
)
{
- sal_Bool bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
+ BOOL bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
if( m_aCurrentPDFState.m_aFont.IsWordLineMode() )
{
Point aPos, aStartPt;
@@ -7557,14 +7515,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
// write eventual emphasis marks
if( m_aCurrentPDFState.m_aFont.GetEmphasisMark() & EMPHASISMARK_STYLE )
{
- PolyPolygon aEmphPoly;
- Rectangle aEmphRect1;
- Rectangle aEmphRect2;
- long nEmphYOff;
- long nEmphWidth;
- long nEmphHeight;
- sal_Bool bEmphPolyLine;
- FontEmphasisMark nEmphMark;
+ PolyPolygon aEmphPoly;
+ Rectangle aEmphRect1;
+ Rectangle aEmphRect2;
+ long nEmphYOff;
+ long nEmphWidth;
+ long nEmphHeight;
+ BOOL bEmphPolyLine;
+ FontEmphasisMark nEmphMark;
push( PUSH_ALL );
@@ -7644,7 +7602,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
}
void PDFWriterImpl::drawEmphasisMark( long nX, long nY,
- const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
+ const PolyPolygon& rPolyPoly, BOOL bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -7714,7 +7672,7 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const String& rText, const
}
}
-void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
+void PDFWriterImpl::drawStretchText( const Point& rPos, ULONG nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
{
MARK( "drawStretchText" );
@@ -7730,7 +7688,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const
}
}
-void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle, bool bTextLines )
+void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, bool bTextLines )
{
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
@@ -7753,7 +7711,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
Point aPos = rRect.TopLeft();
- long nTextHeight = m_pReferenceDevice->GetTextHeight();
+ long nTextHeight = m_pReferenceDevice->GetTextHeight();
xub_StrLen nMnemonicPos = STRING_NOTFOUND;
String aStr = rOrigStr;
@@ -7766,6 +7724,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
XubString aLastLine;
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
+ long nMaxTextWidth;
xub_StrLen i;
xub_StrLen nLines;
xub_StrLen nFormatLines;
@@ -7773,7 +7732,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
if ( nTextHeight )
{
::vcl::DefaultTextLayout aLayout( *m_pReferenceDevice );
- OutputDevice::ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, aLayout );
+ nMaxTextWidth = OutputDevice::ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, aLayout );
nLines = (xub_StrLen)(nHeight/nTextHeight);
nFormatLines = aMultiLineInfo.Count();
if ( !nLines )
@@ -7962,9 +7921,9 @@ void PDFWriterImpl::drawWaveLine( const Point& rStart, const Point& rStop, sal_I
void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
appendStrokingColor( aColor, aLine );
aLine.append( "\n" );
@@ -8032,10 +7991,10 @@ void PDFWriterImpl::drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnd
void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
- long nLinePos2 = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
+ long nLinePos2 = 0;
if ( eTextLine > UNDERLINE_BOLDWAVE )
eTextLine = UNDERLINE_SINGLE;
@@ -8201,10 +8160,10 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon
void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontStrikeout eStrikeout, Color aColor )
{
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- long nLineHeight = 0;
- long nLinePos = 0;
- long nLinePos2 = 0;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ long nLineHeight = 0;
+ long nLinePos = 0;
+ long nLinePos2 = 0;
if ( eStrikeout > STRIKEOUT_X )
eStrikeout = STRIKEOUT_SINGLE;
@@ -8264,9 +8223,6 @@ void PDFWriterImpl::drawStrikeoutLine( OStringBuffer& aLine, long nWidth, FontSt
void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrikeout eStrikeout )
{
- //See qadevOOo/testdocs/StrikeThrough.odt for examples if you need
- //to tweak this
-
String aStrikeoutChar = String::CreateFromAscii( eStrikeout == STRIKEOUT_SLASH ? "/" : "X" );
String aStrikeout = aStrikeoutChar;
while( m_pReferenceDevice->GetTextWidth( aStrikeout ) < nWidth )
@@ -8276,45 +8232,25 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
while( m_pReferenceDevice->GetTextWidth( aStrikeout ) >= nWidth )
aStrikeout.Erase( 0, 1 );
aStrikeout.Append( aStrikeoutChar );
- sal_Bool bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
+ BOOL bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( sal_False );
+ aFont.SetShadow( FALSE );
setFont( aFont );
updateGraphicsState();
}
// strikeout string is left aligned non-CTL text
- sal_uLong nOrigTLM = m_pReferenceDevice->GetLayoutMode();
+ ULONG nOrigTLM = m_pReferenceDevice->GetLayoutMode();
m_pReferenceDevice->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG|TEXT_LAYOUT_COMPLEX_DISABLED );
-
- push( PUSH_CLIPREGION );
- FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric();
- Rectangle aRect;
- aRect.nLeft = rPos.X();
- aRect.nRight = aRect.nLeft+nWidth;
- aRect.nBottom = rPos.Y()+aRefDevFontMetric.GetDescent();
- aRect.nTop = rPos.Y()-aRefDevFontMetric.GetAscent();
-
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- if (pFontEntry->mnOrientation)
- {
- Polygon aPoly( aRect );
- aPoly.Rotate( rPos, pFontEntry->mnOrientation);
- aRect = aPoly.GetBoundRect();
- }
-
- intersectClipRegion( aRect );
drawText( rPos, aStrikeout, 0, aStrikeout.Len(), false );
- pop();
-
m_pReferenceDevice->SetLayoutMode( nOrigTLM );
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( sal_True );
+ aFont.SetShadow( TRUE );
setFont( aFont );
updateGraphicsState();
}
@@ -8332,13 +8268,13 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout
updateGraphicsState();
// note: units in pFontEntry are ref device pixel
- ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
- Color aUnderlineColor = m_aCurrentPDFState.m_aTextLineColor;
- Color aOverlineColor = m_aCurrentPDFState.m_aOverlineColor;
- Color aStrikeoutColor = m_aCurrentPDFState.m_aFont.GetColor();
- bool bStrikeoutDone = false;
- bool bUnderlineDone = false;
- bool bOverlineDone = false;
+ ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
+ Color aUnderlineColor = m_aCurrentPDFState.m_aTextLineColor;
+ Color aOverlineColor = m_aCurrentPDFState.m_aOverlineColor;
+ Color aStrikeoutColor = m_aCurrentPDFState.m_aFont.GetColor();
+ bool bStrikeoutDone = false;
+ bool bUnderlineDone = false;
+ bool bOverlineDone = false;
if ( (eStrikeout == STRIKEOUT_SLASH) || (eStrikeout == STRIKEOUT_X) )
{
@@ -8480,12 +8416,12 @@ void PDFWriterImpl::drawTransparent( const PolyPolygon& rPolyPoly, sal_uInt32 nT
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
// FIXME: polygons with beziers may yield incorrect bound rect
- m_aTransparentObjects.back().m_aBoundRect = rPolyPoly.GetBoundRect();
+ m_aTransparentObjects.back().m_aBoundRect = rPolyPoly.GetBoundRect();
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_nObject = createObject();
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
+ m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
m_aTransparentObjects.back().m_pContentStream = new SvMemoryStream( 256, 256 );
// create XObject's content stream
OStringBuffer aContent( 256 );
@@ -8592,8 +8528,8 @@ SvStream* PDFWriterImpl::endRedirect()
SvStream* pStream = NULL;
if( ! m_aOutputStreams.empty() )
{
- pStream = m_aOutputStreams.front().m_pStream;
- m_aMapMode = m_aOutputStreams.front().m_aMapMode;
+ pStream = m_aOutputStreams.front().m_pStream;
+ m_aMapMode = m_aOutputStreams.front().m_aMapMode;
m_aOutputStreams.pop_front();
}
@@ -8626,11 +8562,11 @@ void PDFWriterImpl::endTransparencyGroup( const Rectangle& rBoundingBox, sal_uIn
{
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
- m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
+ m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
+ m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_fAlpha = (double)(100-nTransparentPercent) / 100.0;
// get XObject's content stream
m_aTransparentObjects.back().m_pContentStream = static_cast<SvMemoryStream*>(endRedirect());
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
@@ -8663,11 +8599,11 @@ void PDFWriterImpl::endTransparencyGroup( const Rectangle& rBoundingBox, const B
{
// create XObject
m_aTransparentObjects.push_back( TransparencyEmit() );
- m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
+ m_aTransparentObjects.back().m_aBoundRect = rBoundingBox;
// convert rectangle to default user space
m_aPages.back().convertRect( m_aTransparentObjects.back().m_aBoundRect );
- m_aTransparentObjects.back().m_nObject = createObject();
- m_aTransparentObjects.back().m_fAlpha = 0.0;
+ m_aTransparentObjects.back().m_nObject = createObject();
+ m_aTransparentObjects.back().m_fAlpha = 0.0;
// get XObject's content stream
m_aTransparentObjects.back().m_pContentStream = static_cast<SvMemoryStream*>(endRedirect());
m_aTransparentObjects.back().m_nExtGStateObject = createObject();
@@ -8981,7 +8917,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly )
{
MARK( "drawPolyLine" );
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if( nPoints < 2 )
return;
@@ -9174,7 +9110,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly, const PDFWriter::ExtLine
aBoundRect.Right() += nLW;
aBoundRect.Bottom() += nLW;
}
- endTransparencyGroup( aBoundRect, (sal_uInt16)(100.0*rInfo.m_fTransparency) );
+ endTransparencyGroup( aBoundRect, (USHORT)(100.0*rInfo.m_fTransparency) );
}
}
@@ -9215,7 +9151,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
if( m_aGraphicsStack.front().m_aLineColor == Color( COL_TRANSPARENT ) && ! pColors )
return;
- sal_uInt16 nPoints = rPoints.GetSize();
+ USHORT nPoints = rPoints.GetSize();
OStringBuffer aLine( nPoints*40 );
aLine.append( "q " );
if( ! pColors )
@@ -9230,7 +9166,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
aPixel.append( ' ' );
appendDouble( 1.0/double(getReferenceDevice()->ImplGetDPIY()), aPixel );
OString aPixelStr = aPixel.makeStringAndClear();
- for( sal_uInt16 i = 0; i < nPoints; i++ )
+ for( USHORT i = 0; i < nPoints; i++ )
{
if( pColors )
{
@@ -9262,11 +9198,14 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
bool bFlateFilter = compressStream( rObject.m_pContentStream );
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_END );
- sal_uLong nSize = rObject.m_pContentStream->Tell();
+ ULONG nSize = rObject.m_pContentStream->Tell();
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_BEGIN );
- #if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::writeTransparentObject" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::writeTransparentObject" );
+ emitComment( aLine.getStr() );
+ }
+#endif
OStringBuffer aLine( 512 );
CHECK_RETURN( updateObject( rObject.m_nObject ) );
aLine.append( rObject.m_nObject );
@@ -9399,25 +9338,28 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
sal_Int32 nFunctionObject = createObject();
CHECK_RETURN( updateObject( nFunctionObject ) );
- 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 );
+ 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 );
- Bitmap aSample = aDev.GetBitmap( Point( 0, 0 ), rObject.m_aSize );
+ Bitmap aSample = pRefDevice->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
- emitComment( "PDFWriterImpl::writeGradientFunction" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::writeGradientFunction" );
+ emitComment( aLine.getStr() );
+ }
+#endif
OStringBuffer aLine( 120 );
aLine.append( nFunctionObject );
aLine.append( " 0 obj\n"
@@ -9430,7 +9372,6 @@ 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"
@@ -9446,7 +9387,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
checkAndEnableStreamEncryption( nFunctionObject );
beginCompression();
- for( int y = aSize.Height()-1; y >= 0; y-- )
+ for( int y = 0; y < aSize.Height(); y++ )
{
for( int x = 0; x < aSize.Width(); x++ )
{
@@ -9497,6 +9438,8 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
+ pRefDevice->Pop();
+
return true;
}
@@ -9525,9 +9468,12 @@ bool PDFWriterImpl::writeJPG( JPGEmit& rObject )
m_aErrors.insert( PDFWriter::Warning_Transparency_Omitted_PDF13 );
}
- #if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::writeJPG" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::writeJPG" );
+ emitComment( aLine.getStr() );
+ }
+#endif
OStringBuffer aLine(200);
aLine.append( rObject.m_nObject );
@@ -9578,9 +9524,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
CHECK_RETURN( updateObject( rObject.m_nObject ) );
- Bitmap aBitmap;
- Color aTransparentColor( COL_TRANSPARENT );
- bool bWriteMask = false;
+ Bitmap aBitmap;
+ Color aTransparentColor( COL_TRANSPARENT );
+ bool bWriteMask = false;
if( ! bMask )
{
aBitmap = rObject.m_aBitmap.GetBitmap();
@@ -9644,35 +9590,29 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
break;
}
- sal_Int32 nStreamLengthObject = createObject();
- sal_Int32 nMaskObject = 0;
+ sal_Int32 nStreamLengthObject = createObject();
+ sal_Int32 nMaskObject = 0;
- #if OSL_DEBUG_LEVEL > 1
- emitComment( "PDFWriterImpl::writeBitmapObject" );
- #endif
+#if OSL_DEBUG_LEVEL > 1
+ {
+ OStringBuffer aLine( " PDFWriterImpl::writeBitmapObject" );
+ emitComment( aLine.getStr() );
+ }
+#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
- 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" );
- }
+ aLine.append( "/Filter/FlateDecode" );
#endif
if( ! bMask )
{
@@ -9696,15 +9636,15 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( "[ /Indexed/DeviceRGB " );
aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) );
aLine.append( "\n<" );
- if( m_aContext.Encryption.Encrypt() )
+ if( m_aContext.Encrypt )
{
enableStringEncryption( rObject.m_nObject );
//check encryption buffer size
if( checkEncryptionBufferSize( pAccess->GetPaletteEntryCount()*3 ) )
{
- int nChar = 0;
+ int nChar = 0;
//fill the encryption buffer
- for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
m_pEncryptionBuffer[nChar++] = rColor.GetRed();
@@ -9715,7 +9655,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( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
appendHex(m_pEncryptionBuffer[nChar++], aLine );
appendHex(m_pEncryptionBuffer[nChar++], aLine );
@@ -9725,7 +9665,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
}
else //no encryption requested (PDF/A-1a program flow drops here)
{
- for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
appendHex( rColor.GetRed(), aLine );
@@ -9740,7 +9680,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 )
@@ -9802,42 +9742,33 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) );
checkAndEnableStreamEncryption( rObject.m_nObject );
-#ifndef DEBUG_DISABLE_PDFCOMPRESSION
- if( nBitsPerComponent == 1 )
+ beginCompression();
+ if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
{
- writeG4Stream( pAccess );
+ 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 ) );
+ }
}
else
-#endif
{
- beginCompression();
- if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
+ const int nScanLineBytes = pAccess->Width()*3;
+ boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
+ for( int y = 0; y < pAccess->Height(); y++ )
{
- const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
-
- for( int i = 0; i < pAccess->Height(); i++ )
+ for( int x = 0; x < pAccess->Width(); x++ )
{
- CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
+ 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 ) );
}
- 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;
@@ -9856,8 +9787,8 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
if( nMaskObject )
{
BitmapEmit aEmit;
- aEmit.m_nObject = nMaskObject;
- aEmit.m_aBitmap = rObject.m_aBitmap;
+ aEmit.m_nObject = nMaskObject;
+ aEmit.m_aBitmap = rObject.m_aBitmap;
return writeBitmapObject( aEmit, true );
}
@@ -9877,35 +9808,18 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
if( ! (rSizePixel.Width() && rSizePixel.Height()) )
return;
- 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;
+ rDCTData.Seek( 0 );
*pStream << rDCTData;
pStream->Seek( STREAM_SEEK_TO_END );
BitmapID aID;
- aID.m_aPixelSize = rSizePixel;
- aID.m_nSize = pStream->Tell();
+ aID.m_aPixelSize = rSizePixel;
+ aID.m_nSize = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
- aID.m_nChecksum = rtl_crc32( 0, pStream->GetData(), aID.m_nSize );
+ aID.m_nChecksum = rtl_crc32( 0, pStream->GetData(), aID.m_nSize );
if( ! rMask.IsEmpty() )
- aID.m_nMaskChecksum = rMask.GetChecksum();
+ aID.m_nMaskChecksum = rMask.GetChecksum();
std::list< JPGEmit >::const_iterator it;
for( it = m_aJPGs.begin(); it != m_aJPGs.end() && ! (aID == it->m_aID); ++it )
@@ -9914,12 +9828,12 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
{
m_aJPGs.push_front( JPGEmit() );
JPGEmit& rEmit = m_aJPGs.front();
- rEmit.m_nObject = createObject();
- rEmit.m_aID = aID;
- rEmit.m_pStream = pStream;
+ rEmit.m_nObject = createObject();
+ rEmit.m_aID = aID;
+ rEmit.m_pStream = pStream;
rEmit.m_bTrueColor = bIsTrueColor;
if( !! rMask && rMask.GetSizePixel() == rSizePixel )
- rEmit.m_aMask = rMask;
+ rEmit.m_aMask = rMask;
it = m_aJPGs.begin();
}
@@ -9929,7 +9843,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
aLine.append( "q " );
sal_Int32 nCheckWidth = 0;
m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetWidth(), aLine, false, &nCheckWidth );
- aLine.append( " 0 0 " );
+ aLine.append( " 0 0 " );
sal_Int32 nCheckHeight = 0;
m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetHeight(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
@@ -9986,28 +9900,18 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
writeBuffer( aLine.getStr(), aLine.getLength() );
}
-const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, bool bDrawMask )
+const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& 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 = aBitmap.GetSizePixel();
- aID.m_nSize = aBitmap.GetBitCount();
- aID.m_nChecksum = aBitmap.GetBitmap().GetChecksum();
- aID.m_nMaskChecksum = 0;
- if( aBitmap.IsAlpha() )
- aID.m_nMaskChecksum = aBitmap.GetAlpha().GetChecksum();
+ aID.m_aPixelSize = rBitmap.GetSizePixel();
+ aID.m_nSize = rBitmap.GetBitCount();
+ aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
+ aID.m_nMaskChecksum = 0;
+ if( rBitmap.IsAlpha() )
+ aID.m_nMaskChecksum = rBitmap.GetAlpha().GetChecksum();
else
{
- Bitmap aMask = aBitmap.GetMask();
+ Bitmap aMask = rBitmap.GetMask();
if( ! aMask.IsEmpty() )
aID.m_nMaskChecksum = aMask.GetChecksum();
}
@@ -10020,10 +9924,10 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
if( it == m_aBitmaps.end() )
{
m_aBitmaps.push_front( BitmapEmit() );
- m_aBitmaps.front().m_aID = aID;
- m_aBitmaps.front().m_aBitmap = aBitmap;
- m_aBitmaps.front().m_nObject = createObject();
- m_aBitmaps.front().m_bDrawMask = bDrawMask;
+ m_aBitmaps.front().m_aID = aID;
+ m_aBitmaps.front().m_aBitmap = rBitmap;
+ m_aBitmaps.front().m_nObject = createObject();
+ m_aBitmaps.front().m_bDrawMask = bDrawMask;
it = m_aBitmaps.begin();
}
@@ -10084,24 +9988,23 @@ 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 == aPtSize )
- break;
+ 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_aGradients.end() )
{
m_aGradients.push_front( GradientEmit() );
- m_aGradients.front().m_aGradient = rGradient;
- m_aGradients.front().m_nObject = createObject();
- m_aGradients.front().m_aSize = aPtSize;
+ m_aGradients.front().m_aGradient = rGradient;
+ m_aGradients.front().m_nObject = createObject();
+ m_aGradients.front().m_aSize = aPtSize;
it = m_aGradients.begin();
}
@@ -10168,12 +10071,12 @@ void PDFWriterImpl::drawGradient( const PolyPolygon& rPolyPoly, const Gradient&
return;
}
- Rectangle aBoundRect = rPolyPoly.GetBoundRect();
- sal_Int32 nGradient = createGradient( rGradient, aBoundRect.GetSize() );
+ sal_Int32 nGradient = createGradient( rGradient, rPolyPoly.GetBoundRect().GetSize() );
updateGraphicsState();
- Point aTranslate = aBoundRect.BottomLeft();
+ Rectangle aBoundRect = rPolyPoly.GetBoundRect();
+ Point aTranslate = aBoundRect.BottomLeft() + Point( 0, 1 );
int nPolygons = rPolyPoly.Count();
OStringBuffer aLine( 80*nPolygons );
@@ -10207,12 +10110,12 @@ void PDFWriterImpl::drawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
return;
if( rPolyPoly.Count() )
{
- PolyPolygon aPolyPoly( rPolyPoly );
+ PolyPolygon aPolyPoly( rPolyPoly );
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
push( PUSH_LINECOLOR );
setLineColor( rHatch.GetColor() );
- getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, sal_False );
+ getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, FALSE );
pop();
}
}
@@ -10221,9 +10124,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
{
MARK( "drawWallpaper" );
- bool bDrawColor = false;
- bool bDrawGradient = false;
- bool bDrawBitmap = false;
+ bool bDrawColor = false;
+ bool bDrawGradient = false;
+ bool bDrawBitmap = false;
BitmapEx aBitmap;
Point aBmpPos = rRect.TopLeft();
@@ -10246,7 +10149,7 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
{
if( rWall.GetStyle() != WALLPAPER_TILE )
{
- bDrawBitmap = true;
+ bDrawBitmap = true;
if( rWall.IsGradient() )
bDrawGradient = true;
else
@@ -10311,8 +10214,8 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
aTilingStream.append( " Do\n" );
m_aTilings.push_back( TilingEmit() );
- m_aTilings.back().m_nObject = createObject();
- m_aTilings.back().m_aRectangle = Rectangle( Point( 0, 0 ), aConvertRect.GetSize() );
+ m_aTilings.back().m_nObject = createObject();
+ m_aTilings.back().m_aRectangle = Rectangle( Point( 0, 0 ), aConvertRect.GetSize() );
m_aTilings.back().m_pTilingStream = new SvMemoryStream();
m_aTilings.back().m_pTilingStream->Write( aTilingStream.getStr(), aTilingStream.getLength() );
// phase the tiling so wallpaper begins on upper left
@@ -10340,9 +10243,9 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
}
else
{
- aBmpPos = aRect.TopLeft();
- aBmpSize = aRect.GetSize();
- bDrawBitmap = true;
+ aBmpPos = aRect.TopLeft();
+ aBmpSize = aRect.GetSize();
+ bDrawBitmap = true;
}
if( aBitmap.IsTransparent() )
@@ -10632,7 +10535,7 @@ void PDFWriterImpl::pop()
OSL_ENSURE( m_aGraphicsStack.size() > 1, "pop without push" );
if( m_aGraphicsStack.size() < 2 )
return;
-
+
GraphicsState aState = m_aGraphicsStack.front();
m_aGraphicsStack.pop_front();
GraphicsState& rOld = m_aGraphicsStack.front();
@@ -10743,9 +10646,9 @@ void PDFWriterImpl::createNote( const Rectangle& rRect, const PDFNote& rNote, sa
return;
m_aNotes.push_back( PDFNoteEntry() );
- m_aNotes.back().m_nObject = createObject();
- m_aNotes.back().m_aContents = rNote;
- m_aNotes.back().m_aRect = rRect;
+ m_aNotes.back().m_nObject = createObject();
+ m_aNotes.back().m_aContents = rNote;
+ m_aNotes.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aNotes.back().m_aRect );
@@ -10764,9 +10667,9 @@ sal_Int32 PDFWriterImpl::createLink( const Rectangle& rRect, sal_Int32 nPageNr )
sal_Int32 nRet = m_aLinks.size();
m_aLinks.push_back( PDFLink() );
- m_aLinks.back().m_nObject = createObject();
- m_aLinks.back().m_nPage = nPageNr;
- m_aLinks.back().m_aRect = rRect;
+ m_aLinks.back().m_nObject = createObject();
+ m_aLinks.back().m_nPage = nPageNr;
+ m_aLinks.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aLinks.back().m_aRect );
@@ -10811,7 +10714,7 @@ sal_Int32 PDFWriterImpl::createDest( const Rectangle& rRect, sal_Int32 nPageNr,
m_aDests.push_back( PDFDest() );
m_aDests.back().m_nPage = nPageNr;
- m_aDests.back().m_eType = eType;
+ m_aDests.back().m_eType = eType;
m_aDests.back().m_aRect = rRect;
// convert to default user space now, since the mapmode may change
m_aPages[nPageNr].convertRect( m_aDests.back().m_aRect );
@@ -10836,7 +10739,7 @@ sal_Int32 PDFWriterImpl::setLinkURL( sal_Int32 nLinkId, const OUString& rURL )
if( nLinkId < 0 || nLinkId >= (sal_Int32)m_aLinks.size() )
return -1;
- m_aLinks[ nLinkId ].m_nDest = -1;
+ m_aLinks[ nLinkId ].m_nDest = -1;
using namespace ::com::sun::star;
@@ -10856,7 +10759,7 @@ sal_Int32 PDFWriterImpl::setLinkURL( sal_Int32 nLinkId, const OUString& rURL )
if (m_xTrans.is())
m_xTrans->parseStrict( aURL );
- m_aLinks[ nLinkId ].m_aURL = aURL.Complete;
+ m_aLinks[ nLinkId ].m_aURL = aURL.Complete;
return 0;
}
@@ -10920,7 +10823,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 = psp::WhitespaceToSpace( rText );
+ m_aOutline[ nItem ].m_aTitle = rText;
return 0;
}
@@ -10940,42 +10843,42 @@ const sal_Char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType )
if( aTagStrings.empty() )
{
aTagStrings[ PDFWriter::NonStructElement] = "NonStruct";
- aTagStrings[ PDFWriter::Document ] = "Document";
- aTagStrings[ PDFWriter::Part ] = "Part";
- aTagStrings[ PDFWriter::Article ] = "Art";
- aTagStrings[ PDFWriter::Section ] = "Sect";
- aTagStrings[ PDFWriter::Division ] = "Div";
- aTagStrings[ PDFWriter::BlockQuote ] = "BlockQuote";
- aTagStrings[ PDFWriter::Caption ] = "Caption";
- aTagStrings[ PDFWriter::TOC ] = "TOC";
- aTagStrings[ PDFWriter::TOCI ] = "TOCI";
- aTagStrings[ PDFWriter::Index ] = "Index";
- aTagStrings[ PDFWriter::Paragraph ] = "P";
- aTagStrings[ PDFWriter::Heading ] = "H";
- aTagStrings[ PDFWriter::H1 ] = "H1";
- aTagStrings[ PDFWriter::H2 ] = "H2";
- aTagStrings[ PDFWriter::H3 ] = "H3";
- aTagStrings[ PDFWriter::H4 ] = "H4";
- aTagStrings[ PDFWriter::H5 ] = "H5";
- aTagStrings[ PDFWriter::H6 ] = "H6";
- aTagStrings[ PDFWriter::List ] = "L";
- aTagStrings[ PDFWriter::ListItem ] = "LI";
- aTagStrings[ PDFWriter::LILabel ] = "Lbl";
- aTagStrings[ PDFWriter::LIBody ] = "LBody";
- aTagStrings[ PDFWriter::Table ] = "Table";
- aTagStrings[ PDFWriter::TableRow ] = "TR";
- aTagStrings[ PDFWriter::TableHeader ] = "TH";
- aTagStrings[ PDFWriter::TableData ] = "TD";
- aTagStrings[ PDFWriter::Span ] = "Span";
- aTagStrings[ PDFWriter::Quote ] = "Quote";
- aTagStrings[ PDFWriter::Note ] = "Note";
- aTagStrings[ PDFWriter::Reference ] = "Reference";
- aTagStrings[ PDFWriter::BibEntry ] = "BibEntry";
- aTagStrings[ PDFWriter::Code ] = "Code";
- aTagStrings[ PDFWriter::Link ] = "Link";
- aTagStrings[ PDFWriter::Figure ] = "Figure";
- aTagStrings[ PDFWriter::Formula ] = "Formula";
- aTagStrings[ PDFWriter::Form ] = "Form";
+ aTagStrings[ PDFWriter::Document ] = "Document";
+ aTagStrings[ PDFWriter::Part ] = "Part";
+ aTagStrings[ PDFWriter::Article ] = "Art";
+ aTagStrings[ PDFWriter::Section ] = "Sect";
+ aTagStrings[ PDFWriter::Division ] = "Div";
+ aTagStrings[ PDFWriter::BlockQuote ] = "BlockQuote";
+ aTagStrings[ PDFWriter::Caption ] = "Caption";
+ aTagStrings[ PDFWriter::TOC ] = "TOC";
+ aTagStrings[ PDFWriter::TOCI ] = "TOCI";
+ aTagStrings[ PDFWriter::Index ] = "Index";
+ aTagStrings[ PDFWriter::Paragraph ] = "P";
+ aTagStrings[ PDFWriter::Heading ] = "H";
+ aTagStrings[ PDFWriter::H1 ] = "H1";
+ aTagStrings[ PDFWriter::H2 ] = "H2";
+ aTagStrings[ PDFWriter::H3 ] = "H3";
+ aTagStrings[ PDFWriter::H4 ] = "H4";
+ aTagStrings[ PDFWriter::H5 ] = "H5";
+ aTagStrings[ PDFWriter::H6 ] = "H6";
+ aTagStrings[ PDFWriter::List ] = "L";
+ aTagStrings[ PDFWriter::ListItem ] = "LI";
+ aTagStrings[ PDFWriter::LILabel ] = "Lbl";
+ aTagStrings[ PDFWriter::LIBody ] = "LBody";
+ aTagStrings[ PDFWriter::Table ] = "Table";
+ aTagStrings[ PDFWriter::TableRow ] = "TR";
+ aTagStrings[ PDFWriter::TableHeader ] = "TH";
+ aTagStrings[ PDFWriter::TableData ] = "TD";
+ aTagStrings[ PDFWriter::Span ] = "Span";
+ aTagStrings[ PDFWriter::Quote ] = "Quote";
+ aTagStrings[ PDFWriter::Note ] = "Note";
+ aTagStrings[ PDFWriter::Reference ] = "Reference";
+ aTagStrings[ PDFWriter::BibEntry ] = "BibEntry";
+ aTagStrings[ PDFWriter::Code ] = "Code";
+ aTagStrings[ PDFWriter::Link ] = "Link";
+ aTagStrings[ PDFWriter::Figure ] = "Figure";
+ aTagStrings[ PDFWriter::Formula ] = "Formula";
+ aTagStrings[ PDFWriter::Form ] = "Form";
}
std::map< PDFWriter::StructElement, const char* >::const_iterator it = aTagStrings.find( eType );
@@ -10985,7 +10888,7 @@ const sal_Char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType )
void PDFWriterImpl::beginStructureElementMCSeq()
{
- if( m_bEmitStructure &&
+ if( m_bEmitStructure &&
m_nCurrentStructElement > 0 && // StructTreeRoot
! m_aStructure[ m_nCurrentStructElement ].m_bOpenMCSeq // already opened sequence
)
@@ -11097,21 +11000,21 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
DBG_ASSERT( 0, "Structure element inserted to StructTreeRoot that is not a document" );
}
else {
- OSL_FAIL( "document structure in disorder !" );
+ DBG_ERROR( "document structure in disorder !" );
}
}
else {
- OSL_FAIL( "PDF document structure MUST be contained in a Document element" );
+ DBG_ERROR( "PDF document structure MUST be contained in a Document element" );
}
}
sal_Int32 nNewId = sal_Int32(m_aStructure.size());
m_aStructure.push_back( PDFStructureElement() );
PDFStructureElement& rEle = m_aStructure.back();
- rEle.m_eType = eType;
- rEle.m_nOwnElement = nNewId;
- rEle.m_nParentElement = m_nCurrentStructElement;
- rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject;
+ rEle.m_eType = eType;
+ rEle.m_nOwnElement = nNewId;
+ rEle.m_nParentElement = m_nCurrentStructElement;
+ rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject;
m_aStructure[ m_nCurrentStructElement ].m_aChildren.push_back( nNewId );
m_nCurrentStructElement = nNewId;
@@ -11144,7 +11047,7 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
if( m_bEmitStructure ) // don't create nonexistant objects
{
- rEle.m_nObject = createObject();
+ rEle.m_nObject = createObject();
// update parent's kids list
m_aStructure[ rEle.m_nParentElement ].m_aKids.push_back( rEle.m_nObject );
}
@@ -11199,7 +11102,7 @@ void PDFWriterImpl::endStructureElement()
* This function adds an internal structure list container to overcome the 8191 elements array limitation
* in kids element emission.
* Recursive function
- *
+ *
*/
void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
{
@@ -11219,7 +11122,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
addInternalStructureContainer( rChild );//examine the child
else
{
- OSL_FAIL( "PDFWriterImpl::addInternalStructureContainer: invalid child structure element" );
+ DBG_ERROR( "PDFWriterImpl::addInternalStructureContainer: invalid child structure element" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure elemnt with id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -11228,7 +11131,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
}
else
{
- OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure id" );
+ DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure id" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -11257,21 +11160,21 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
m_aStructure.push_back( PDFStructureElement() );
PDFStructureElement& rEleNew = m_aStructure.back();
rEleNew.m_aAlias = aAliasName;
- rEleNew.m_eType = PDFWriter::Division; // a new Div type container
- rEleNew.m_nOwnElement = nNewId;
- rEleNew.m_nParentElement = nCurrentStructElement;
+ rEleNew.m_eType = PDFWriter::Division; // a new Div type container
+ rEleNew.m_nOwnElement = nNewId;
+ rEleNew.m_nParentElement = nCurrentStructElement;
//inherit the same page as the first child to be reparented
- rEleNew.m_nFirstPageObject = m_aStructure[ rEle.m_aChildren.front() ].m_nFirstPageObject;
+ rEleNew.m_nFirstPageObject = m_aStructure[ rEle.m_aChildren.front() ].m_nFirstPageObject;
rEleNew.m_nObject = createObject();//assign a PDF object number
//add the object to the kid list of the parent
aNewKids.push_back( PDFStructureElementKid( rEleNew.m_nObject ) );
aNewChildren.push_back( nNewId );
-
+
std::list< sal_Int32 >::iterator aChildEndIt( rEle.m_aChildren.begin() );
std::list< PDFStructureElementKid >::iterator aKidEndIt( rEle.m_aKids.begin() );
advance( aChildEndIt, ncMaxPDFArraySize );
advance( aKidEndIt, ncMaxPDFArraySize );
-
+
rEleNew.m_aKids.splice( rEleNew.m_aKids.begin(),
rEle.m_aKids,
rEle.m_aKids.begin(),
@@ -11290,7 +11193,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
//finally add the new kids resulting from the container added
rEle.m_aKids.insert( rEle.m_aKids.begin(), aNewKids.begin(), aNewKids.end() );
rEle.m_aChildren.insert( rEle.m_aChildren.begin(), aNewChildren.begin(), aNewChildren.end() );
- }
+ }
}
}
}
@@ -11345,42 +11248,42 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
switch( eAttr )
{
case PDFWriter::Placement:
- if( eVal == PDFWriter::Block ||
- eVal == PDFWriter::Inline ||
- eVal == PDFWriter::Before ||
- eVal == PDFWriter::Start ||
+ if( eVal == PDFWriter::Block ||
+ eVal == PDFWriter::Inline ||
+ eVal == PDFWriter::Before ||
+ eVal == PDFWriter::Start ||
eVal == PDFWriter::End )
bInsert = true;
break;
case PDFWriter::WritingMode:
- if( eVal == PDFWriter::LrTb ||
- eVal == PDFWriter::RlTb ||
+ if( eVal == PDFWriter::LrTb ||
+ eVal == PDFWriter::RlTb ||
eVal == PDFWriter::TbRl )
{
bInsert = true;
}
break;
case PDFWriter::TextAlign:
- if( eVal == PDFWriter::Start ||
- eVal == PDFWriter::Center ||
- eVal == PDFWriter::End ||
+ if( eVal == PDFWriter::Start ||
+ eVal == PDFWriter::Center ||
+ eVal == PDFWriter::End ||
eVal == PDFWriter::Justify )
{
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11391,11 +11294,11 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
case PDFWriter::Height:
if( eVal == PDFWriter::Auto )
{
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11403,12 +11306,12 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::BlockAlign:
- if( eVal == PDFWriter::Before ||
- eVal == PDFWriter::Middle ||
- eVal == PDFWriter::After ||
+ if( eVal == PDFWriter::Before ||
+ eVal == PDFWriter::Middle ||
+ eVal == PDFWriter::After ||
eVal == PDFWriter::Justify )
{
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11416,11 +11319,11 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::InlineAlign:
- if( eVal == PDFWriter::Start ||
- eVal == PDFWriter::Center ||
+ if( eVal == PDFWriter::Start ||
+ eVal == PDFWriter::Center ||
eVal == PDFWriter::End )
{
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11428,32 +11331,32 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::LineHeight:
- if( eVal == PDFWriter::Normal ||
+ if( eVal == PDFWriter::Normal ||
eVal == PDFWriter::Auto )
{
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11461,34 +11364,34 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::TextDecorationType:
- if( eVal == PDFWriter::NONE ||
- eVal == PDFWriter::Underline ||
- eVal == PDFWriter::Overline ||
+ if( eVal == PDFWriter::NONE ||
+ eVal == PDFWriter::Underline ||
+ eVal == PDFWriter::Overline ||
eVal == PDFWriter::LineThrough )
{
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11496,14 +11399,14 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr
}
break;
case PDFWriter::ListNumbering:
- if( eVal == PDFWriter::NONE ||
- eVal == PDFWriter::Disc ||
- eVal == PDFWriter::Circle ||
- eVal == PDFWriter::Square ||
- eVal == PDFWriter::Decimal ||
- eVal == PDFWriter::UpperRoman ||
- eVal == PDFWriter::LowerRoman ||
- eVal == PDFWriter::UpperAlpha ||
+ if( eVal == PDFWriter::NONE ||
+ eVal == PDFWriter::Disc ||
+ eVal == PDFWriter::Circle ||
+ eVal == PDFWriter::Square ||
+ eVal == PDFWriter::Decimal ||
+ eVal == PDFWriter::UpperRoman ||
+ eVal == PDFWriter::LowerRoman ||
+ eVal == PDFWriter::UpperAlpha ||
eVal == PDFWriter::LowerAlpha )
{
if( eType == PDFWriter::List )
@@ -11551,21 +11454,21 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::StartIndent:
case PDFWriter::EndIndent:
// just for BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11573,17 +11476,17 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
break;
case PDFWriter::TextIndent:
// paragraph like BLSE and additional elements
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11591,11 +11494,11 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
break;
case PDFWriter::Width:
case PDFWriter::Height:
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11604,28 +11507,28 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::LineHeight:
case PDFWriter::BaselineShift:
// only for ILSE and BLSE
- if( eType == PDFWriter::Paragraph ||
- eType == PDFWriter::Heading ||
- eType == PDFWriter::H1 ||
- eType == PDFWriter::H2 ||
- eType == PDFWriter::H3 ||
- eType == PDFWriter::H4 ||
- eType == PDFWriter::H5 ||
- eType == PDFWriter::H6 ||
- eType == PDFWriter::List ||
- eType == PDFWriter::ListItem ||
- eType == PDFWriter::LILabel ||
- eType == PDFWriter::LIBody ||
- eType == PDFWriter::Table ||
- eType == PDFWriter::TableRow ||
- eType == PDFWriter::TableHeader ||
- eType == PDFWriter::TableData ||
- eType == PDFWriter::Span ||
- eType == PDFWriter::Quote ||
- eType == PDFWriter::Note ||
- eType == PDFWriter::Reference ||
- eType == PDFWriter::BibEntry ||
- eType == PDFWriter::Code ||
+ if( eType == PDFWriter::Paragraph ||
+ eType == PDFWriter::Heading ||
+ eType == PDFWriter::H1 ||
+ eType == PDFWriter::H2 ||
+ eType == PDFWriter::H3 ||
+ eType == PDFWriter::H4 ||
+ eType == PDFWriter::H5 ||
+ eType == PDFWriter::H6 ||
+ eType == PDFWriter::List ||
+ eType == PDFWriter::ListItem ||
+ eType == PDFWriter::LILabel ||
+ eType == PDFWriter::LIBody ||
+ eType == PDFWriter::Table ||
+ eType == PDFWriter::TableRow ||
+ eType == PDFWriter::TableHeader ||
+ eType == PDFWriter::TableData ||
+ eType == PDFWriter::Span ||
+ eType == PDFWriter::Quote ||
+ eType == PDFWriter::Note ||
+ eType == PDFWriter::Reference ||
+ eType == PDFWriter::BibEntry ||
+ eType == PDFWriter::Code ||
eType == PDFWriter::Link )
{
bInsert = true;
@@ -11634,7 +11537,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( enum PDFWriter::StructAttrib
case PDFWriter::RowSpan:
case PDFWriter::ColSpan:
// only for table cells
- if( eType == PDFWriter::TableHeader ||
+ if( eType == PDFWriter::TableHeader ||
eType == PDFWriter::TableData )
{
bInsert = true;
@@ -11672,9 +11575,9 @@ void PDFWriterImpl::setStructureBoundingBox( const Rectangle& rRect )
if( m_nCurrentStructElement > 0 && m_bEmitStructure )
{
PDFWriter::StructElement eType = m_aStructure[ m_nCurrentStructElement ].m_eType;
- if( eType == PDFWriter::Figure ||
- eType == PDFWriter::Formula ||
- eType == PDFWriter::Form ||
+ if( eType == PDFWriter::Figure ||
+ eType == PDFWriter::Formula ||
+ eType == PDFWriter::Form ||
eType == PDFWriter::Table )
{
m_aStructure[ m_nCurrentStructElement ].m_aBBox = rRect;
@@ -11719,8 +11622,8 @@ void PDFWriterImpl::setPageTransition( PDFWriter::PageTransition eType, sal_uInt
if( nPageNr < 0 || nPageNr >= (sal_Int32)m_aPages.size() )
return;
- m_aPages[ nPageNr ].m_eTransition = eType;
- m_aPages[ nPageNr ].m_nTransTime = nMilliSec;
+ m_aPages[ nPageNr ].m_eTransition = eType;
+ m_aPages[ nPageNr ].m_nTransTime = nMilliSec;
}
void PDFWriterImpl::ensureUniqueRadioOnValues()
@@ -11731,7 +11634,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
{
PDFWidget& rGroupWidget = m_aWidgets[ group->second ];
// check whether all kids have a unique OnValue
- boost::unordered_map< OUString, sal_Int32, OUStringHash > aOnValues;
+ std::hash_map< OUString, sal_Int32, OUStringHash > aOnValues;
int nChildren = rGroupWidget.m_aKidsIndex.size();
bool bIsUnique = true;
for( int nKid = 0; nKid < nChildren && bIsUnique; nKid++ )
@@ -11761,7 +11664,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
int nKidIndex = rGroupWidget.m_aKidsIndex[nKid];
PDFWidget& rKid = m_aWidgets[nKidIndex];
rKid.m_aOnValue = OUString::valueOf( sal_Int32(nKid+1) );
- if( ! rKid.m_aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Off" ) ) )
+ if( ! rKid.m_aValue.equalsAscii( "Off" ) )
rKid.m_aValue = rKid.m_aOnValue;
}
}
@@ -11788,7 +11691,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
#endif
}
// update selected radio button
- if( ! rKid.m_aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Off" ) ) )
+ if( ! rKid.m_aValue.equalsAscii( "Off" ) )
{
rGroupWidget.m_aValue = rKid.m_aValue;
}
@@ -11809,9 +11712,9 @@ sal_Int32 PDFWriterImpl::findRadioGroupWidget( const PDFWriter::RadioButtonWidge
// new group, insert the radiobutton
m_aWidgets.push_back( PDFWidget() );
- m_aWidgets.back().m_nObject = createObject();
- m_aWidgets.back().m_nPage = m_nCurrentPage;
- m_aWidgets.back().m_eType = PDFWriter::RadioButton;
+ m_aWidgets.back().m_nObject = createObject();
+ m_aWidgets.back().m_nPage = m_nCurrentPage;
+ m_aWidgets.back().m_eType = PDFWriter::RadioButton;
m_aWidgets.back().m_nRadioGroup = rBtn.RadioGroup;
m_aWidgets.back().m_nFlags |= 0x0000C000; // NoToggleToOff and Radio bits
@@ -11834,10 +11737,10 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
sal_Int32 nNewWidget = m_aWidgets.size();
m_aWidgets.push_back( PDFWidget() );
- m_aWidgets.back().m_nObject = createObject();
- m_aWidgets.back().m_aRect = rControl.Location;
- m_aWidgets.back().m_nPage = nPageNr;
- m_aWidgets.back().m_eType = rControl.getType();
+ m_aWidgets.back().m_nObject = createObject();
+ m_aWidgets.back().m_aRect = rControl.Location;
+ m_aWidgets.back().m_nPage = nPageNr;
+ m_aWidgets.back().m_eType = rControl.getType();
sal_Int32 nRadioGroupWidget = -1;
// for unknown reasons the radio buttons of a radio group must not have a
@@ -11851,10 +11754,10 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
}
// caution: m_aWidgets must not be changed after here or rNewWidget may be invalid
- PDFWidget& rNewWidget = m_aWidgets[nNewWidget];
- rNewWidget.m_aDescription = rControl.Description;
- rNewWidget.m_aText = rControl.Text;
- rNewWidget.m_nTextStyle = rControl.TextStyle &
+ PDFWidget& rNewWidget = m_aWidgets[nNewWidget];
+ rNewWidget.m_aDescription = rControl.Description;
+ rNewWidget.m_aText = rControl.Text;
+ rNewWidget.m_nTextStyle = rControl.TextStyle &
( TEXT_DRAW_LEFT | TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT | TEXT_DRAW_TOP |
TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM |
TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
@@ -11891,8 +11794,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
* so we need to create a radio button on demand for a new group
* and insert a checkbox for each RadioButtonWidget as its child
*/
- rNewWidget.m_eType = PDFWriter::CheckBox;
- rNewWidget.m_nRadioGroup = rBtn.RadioGroup;
+ rNewWidget.m_eType = PDFWriter::CheckBox;
+ rNewWidget.m_nRadioGroup = rBtn.RadioGroup;
DBG_ASSERT( nRadioGroupWidget >= 0 && nRadioGroupWidget < (sal_Int32)m_aWidgets.size(), "no radio group parent" );
@@ -11905,8 +11808,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_aOnValue = rBtn.OnValue;
if( ! rRadioButton.m_aValue.getLength() && rBtn.Selected )
{
- rNewWidget.m_aValue = rNewWidget.m_aOnValue;
- rRadioButton.m_aValue = rNewWidget.m_aOnValue;
+ rNewWidget.m_aValue = rNewWidget.m_aOnValue;
+ rRadioButton.m_aValue = rNewWidget.m_aOnValue;
}
createDefaultRadioButtonAppearance( rNewWidget, rBtn );
@@ -11922,7 +11825,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle =
TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
- rNewWidget.m_aValue = rBox.Checked ? OUString(RTL_CONSTASCII_USTRINGPARAM("Yes")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Off" ));
+ rNewWidget.m_aValue = OUString::createFromAscii( rBox.Checked ? "Yes" : "Off" );
// create default appearance before m_aRect gets transformed
createDefaultCheckBoxAppearance( rNewWidget, rBox );
}
@@ -11932,9 +11835,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
const PDFWriter::ListBoxWidget& rLstBox = static_cast<const PDFWriter::ListBoxWidget&>(rControl);
- rNewWidget.m_aListEntries = rLstBox.Entries;
+ rNewWidget.m_aListEntries = rLstBox.Entries;
rNewWidget.m_aSelectedEntries = rLstBox.SelectedEntries;
- rNewWidget.m_aValue = rLstBox.Text;
+ rNewWidget.m_aValue = rLstBox.Text;
if( rLstBox.DropDown )
rNewWidget.m_nFlags |= 0x00020000;
if( rLstBox.Sort )
@@ -11950,28 +11853,28 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
const PDFWriter::ComboBoxWidget& rBox = static_cast<const PDFWriter::ComboBoxWidget&>(rControl);
- rNewWidget.m_aValue = rBox.Text;
- rNewWidget.m_aListEntries = rBox.Entries;
+ rNewWidget.m_aValue = rBox.Text;
+ rNewWidget.m_aListEntries = rBox.Entries;
rNewWidget.m_nFlags |= 0x00060000; // combo and edit flag
if( rBox.Sort )
rNewWidget.m_nFlags |= 0x00080000;
PDFWriter::ListBoxWidget aLBox;
- aLBox.Name = rBox.Name;
- aLBox.Description = rBox.Description;
- aLBox.Text = rBox.Text;
- aLBox.TextStyle = rBox.TextStyle;
- aLBox.ReadOnly = rBox.ReadOnly;
- aLBox.Border = rBox.Border;
- aLBox.BorderColor = rBox.BorderColor;
- aLBox.Background = rBox.Background;
- aLBox.BackgroundColor = rBox.BackgroundColor;
- aLBox.TextFont = rBox.TextFont;
- aLBox.TextColor = rBox.TextColor;
- aLBox.DropDown = true;
- aLBox.Sort = rBox.Sort;
- aLBox.MultiSelect = false;
- aLBox.Entries = rBox.Entries;
+ aLBox.Name = rBox.Name;
+ aLBox.Description = rBox.Description;
+ aLBox.Text = rBox.Text;
+ aLBox.TextStyle = rBox.TextStyle;
+ aLBox.ReadOnly = rBox.ReadOnly;
+ aLBox.Border = rBox.Border;
+ aLBox.BorderColor = rBox.BorderColor;
+ aLBox.Background = rBox.Background;
+ aLBox.BackgroundColor = rBox.BackgroundColor;
+ aLBox.TextFont = rBox.TextFont;
+ aLBox.TextColor = rBox.TextColor;
+ aLBox.DropDown = true;
+ aLBox.Sort = rBox.Sort;
+ aLBox.MultiSelect = false;
+ aLBox.Entries = rBox.Entries;
createDefaultListBoxAppearance( rNewWidget, aLBox );
}
@@ -12119,6 +12022,269 @@ 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 ];
+ 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 09459e40a896..ce72411fbe08 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,7 +51,7 @@
#include <vector>
#include <map>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <list>
#include <boost/shared_array.hpp>
@@ -60,8 +60,6 @@ class ImplFontSelectData;
class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
-class EncHashTransporter;
-struct BitStreamState;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -88,19 +86,19 @@ public:
// definition of structs
struct BuiltinFont
{
- const char * m_pName; // Name
- const char * m_pStyleName; // StyleName
- const char * m_pPSName; // PSName
- int m_nAscent;
- int m_nDescent;
- FontFamily m_eFamily; // Family
- CharSet m_eCharSet; // CharSet
- FontPitch m_ePitch; // Pitch
- FontWidth m_eWidthType; // WidthType
- FontWeight m_eWeight; // Weight
- FontItalic m_eItalic; // Italic
- int m_aWidths[256]; // character metrics
-
+ const char * m_pName; // Name
+ const char * m_pStyleName; // StyleName
+ const char * m_pPSName; // PSName
+ int m_nAscent;
+ int m_nDescent;
+ FontFamily m_eFamily; // Family
+ CharSet m_eCharSet; // CharSet
+ FontPitch m_ePitch; // Pitch
+ FontWidth m_eWidthType; // WidthType
+ FontWeight m_eWeight; // Weight
+ FontItalic m_eItalic; // Italic
+ int m_aWidths[256]; // character metrics
+
rtl::OString getNameObject() const;
};
@@ -114,26 +112,26 @@ public:
ResourceMap m_aExtGStates;
ResourceMap m_aShadings;
ResourceMap m_aPatterns;
-
+
void append( rtl::OStringBuffer&, sal_Int32 nFontDictObject );
};
-
+
struct PDFPage
{
- PDFWriterImpl* m_pWriter;
- sal_Int32 m_nPageWidth; // in inch/72
- sal_Int32 m_nPageHeight; // in inch/72
- PDFWriter::Orientation m_eOrientation;
- sal_Int32 m_nPageObject;
- sal_Int32 m_nPageIndex;
- std::vector<sal_Int32> m_aStreamObjects;
- sal_Int32 m_nStreamLengthObject;
- sal_uInt64 m_nBeginStreamPos;
- std::vector<sal_Int32> m_aAnnotations;
- std::vector<sal_Int32> m_aMCIDParents;
- PDFWriter::PageTransition m_eTransition;
- sal_uInt32 m_nTransTime;
- sal_uInt32 m_nDuration;
+ PDFWriterImpl* m_pWriter;
+ sal_Int32 m_nPageWidth; // in inch/72
+ sal_Int32 m_nPageHeight; // in inch/72
+ PDFWriter::Orientation m_eOrientation;
+ sal_Int32 m_nPageObject;
+ sal_Int32 m_nPageIndex;
+ std::vector<sal_Int32> m_aStreamObjects;
+ sal_Int32 m_nStreamLengthObject;
+ sal_uInt64 m_nBeginStreamPos;
+ std::vector<sal_Int32> m_aAnnotations;
+ std::vector<sal_Int32> m_aMCIDParents;
+ PDFWriter::PageTransition m_eTransition;
+ sal_uInt32 m_nTransTime;
+ sal_uInt32 m_nDuration;
bool m_bHasWidgets;
PDFPage( PDFWriterImpl* pWriter, sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation );
@@ -168,7 +166,7 @@ public:
// can be important if the source MapMode is not
// symmetrical) to page length and appends it to the buffer
// if pOutLength is set it will be updated to the emitted length
- // (in PDF map mode, that is 10th of point)
+ // (in PDF map mode, that is 10th of point)
void appendMappedLength( sal_Int32 nLength, rtl::OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = NULL ) const;
// the same for double values
void appendMappedLength( double fLength, rtl::OStringBuffer& rBuffer, bool bVertical = true, sal_Int32* pOutLength = NULL, sal_Int32 nPrecision = 5 ) const;
@@ -187,23 +185,23 @@ public:
struct BitmapID
{
- Size m_aPixelSize;
- sal_Int32 m_nSize;
- sal_Int32 m_nChecksum;
- sal_Int32 m_nMaskChecksum;
-
+ Size m_aPixelSize;
+ sal_Int32 m_nSize;
+ sal_Int32 m_nChecksum;
+ sal_Int32 m_nMaskChecksum;
+
BitmapID() : m_nSize( 0 ), m_nChecksum( 0 ), m_nMaskChecksum( 0 ) {}
BitmapID& operator=( const BitmapID& rCopy )
{
- m_aPixelSize = rCopy.m_aPixelSize;
- m_nSize = rCopy.m_nSize;
- m_nChecksum = rCopy.m_nChecksum;
- m_nMaskChecksum = rCopy.m_nMaskChecksum;
+ m_aPixelSize = rCopy.m_aPixelSize;
+ m_nSize = rCopy.m_nSize;
+ m_nChecksum = rCopy.m_nChecksum;
+ m_nMaskChecksum = rCopy.m_nMaskChecksum;
return *this;
}
- bool operator==( const BitmapID& rComp ) const
+ bool operator==( const BitmapID& rComp )
{
return (m_aPixelSize == rComp.m_aPixelSize &&
m_nSize == rComp.m_nSize &&
@@ -214,31 +212,31 @@ public:
struct BitmapEmit
{
- BitmapID m_aID;
- BitmapEx m_aBitmap;
- sal_Int32 m_nObject;
- bool m_bDrawMask;
+ BitmapID m_aID;
+ BitmapEx m_aBitmap;
+ sal_Int32 m_nObject;
+ bool m_bDrawMask;
BitmapEmit() : m_bDrawMask( false ) {}
};
struct JPGEmit
{
- BitmapID m_aID;
- SvMemoryStream* m_pStream;
- Bitmap m_aMask;
- sal_Int32 m_nObject;
+ BitmapID m_aID;
+ SvMemoryStream* m_pStream;
+ Bitmap m_aMask;
+ sal_Int32 m_nObject;
bool m_bTrueColor;
- JPGEmit() : m_pStream( NULL ), m_bTrueColor( false ) {}
+ JPGEmit() : m_pStream( NULL ) {}
~JPGEmit() { delete m_pStream; }
};
struct GradientEmit
{
- Gradient m_aGradient;
- Size m_aSize;
- sal_Int32 m_nObject;
+ Gradient m_aGradient;
+ Size m_aSize;
+ sal_Int32 m_nObject;
};
// for tilings (drawWallpaper, begin/endPattern)
@@ -250,7 +248,7 @@ public:
SvtGraphicFill::Transform m_aTransform;
ResourceDict m_aResources;
SvMemoryStream* m_pTilingStream;
-
+
TilingEmit()
: m_nObject( 0 ),
m_pTilingStream( NULL )
@@ -260,12 +258,12 @@ public:
// for transparency group XObjects
struct TransparencyEmit
{
- sal_Int32 m_nObject;
- sal_Int32 m_nExtGStateObject;
- double m_fAlpha;
- Rectangle m_aBoundRect;
- SvMemoryStream* m_pContentStream;
- SvMemoryStream* m_pSoftMaskStream;
+ sal_Int32 m_nObject;
+ sal_Int32 m_nExtGStateObject;
+ double m_fAlpha;
+ Rectangle m_aBoundRect;
+ SvMemoryStream* m_pContentStream;
+ SvMemoryStream* m_pSoftMaskStream;
TransparencyEmit()
: m_nObject( 0 ),
@@ -285,12 +283,12 @@ public:
class GlyphEmit
{
// performance: actually this should probably a vector;
- sal_Ucs m_aBufferedUnicodes[3];
+ sal_Ucs m_aBufferedUnicodes[3];
sal_Int32 m_nUnicodes;
sal_Int32 m_nMaxUnicodes;
boost::shared_array<sal_Ucs> m_pUnicodes;
sal_uInt8 m_nSubsetGlyphID;
-
+
public:
GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0)
{
@@ -303,7 +301,7 @@ public:
void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; }
sal_uInt8 getGlyphId() const { return m_nSubsetGlyphID; }
-
+
void addCode( sal_Ucs i_cCode )
{
if( m_nUnicodes == m_nMaxUnicodes )
@@ -333,73 +331,73 @@ public:
typedef std::map< sal_GlyphId, GlyphEmit > FontEmitMapping;
struct FontEmit
{
- sal_Int32 m_nFontID;
- FontEmitMapping m_aMapping;
+ sal_Int32 m_nFontID;
+ FontEmitMapping m_aMapping;
FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
};
typedef std::list< FontEmit > FontEmitList;
struct Glyph
{
- sal_Int32 m_nFontID;
- sal_uInt8 m_nSubsetGlyphID;
+ sal_Int32 m_nFontID;
+ sal_uInt8 m_nSubsetGlyphID;
};
typedef std::map< sal_GlyphId, Glyph > FontMapping;
struct FontSubset
{
- FontEmitList m_aSubsets;
- FontMapping m_aMapping;
+ FontEmitList m_aSubsets;
+ FontMapping m_aMapping;
};
typedef std::map< const ImplFontData*, FontSubset > FontSubsetData;
struct EmbedCode
{
- sal_Ucs m_aUnicode;
- rtl::OString m_aName;
+ sal_Ucs m_aUnicode;
+ rtl::OString m_aName;
};
struct EmbedEncoding
{
- sal_Int32 m_nFontID;
- std::vector< EmbedCode > m_aEncVector;
- std::map< sal_Ucs, sal_Int8 > m_aCMap;
+ sal_Int32 m_nFontID;
+ std::vector< EmbedCode > m_aEncVector;
+ std::map< sal_Ucs, sal_Int8 > m_aCMap;
};
struct EmbedFont
{
- sal_Int32 m_nNormalFontID;
- std::list< EmbedEncoding > m_aExtendedEncodings;
-
+ sal_Int32 m_nNormalFontID;
+ std::list< EmbedEncoding > m_aExtendedEncodings;
+
EmbedFont() : m_nNormalFontID( 0 ) {}
};
typedef std::map< const ImplFontData*, EmbedFont > FontEmbedData;
struct PDFDest
{
- sal_Int32 m_nPage;
- PDFWriter::DestAreaType m_eType;
- Rectangle m_aRect;
+ sal_Int32 m_nPage;
+ PDFWriter::DestAreaType m_eType;
+ Rectangle m_aRect;
};
//--->i56629
struct PDFNamedDest
{
rtl::OUString m_aDestName;
- sal_Int32 m_nPage;
- PDFWriter::DestAreaType m_eType;
- Rectangle m_aRect;
+ sal_Int32 m_nPage;
+ PDFWriter::DestAreaType m_eType;
+ Rectangle m_aRect;
};
//<---
-
+
struct PDFOutlineEntry
{
- sal_Int32 m_nParentID;
- sal_Int32 m_nObject;
- sal_Int32 m_nParentObject;
- sal_Int32 m_nNextObject;
- sal_Int32 m_nPrevObject;
- std::vector< sal_Int32 > m_aChildren;
- rtl::OUString m_aTitle;
- sal_Int32 m_nDestID;
-
- PDFOutlineEntry()
+ sal_Int32 m_nParentID;
+ sal_Int32 m_nObject;
+ sal_Int32 m_nParentObject;
+ sal_Int32 m_nNextObject;
+ sal_Int32 m_nPrevObject;
+ std::vector< sal_Int32 > m_aChildren;
+ rtl::OUString m_aTitle;
+ sal_Int32 m_nDestID;
+
+ PDFOutlineEntry()
: m_nParentID( -1 ),
m_nObject( 0 ),
m_nParentObject( 0 ),
@@ -411,9 +409,9 @@ public:
struct PDFAnnotation
{
- sal_Int32 m_nObject;
- Rectangle m_aRect;
- sal_Int32 m_nPage;
+ sal_Int32 m_nObject;
+ Rectangle m_aRect;
+ sal_Int32 m_nPage;
PDFAnnotation()
: m_nObject( -1 ),
@@ -423,11 +421,11 @@ public:
struct PDFLink : public PDFAnnotation
{
- sal_Int32 m_nDest; // set to -1 for URL, to a dest else
- rtl::OUString m_aURL;
+ sal_Int32 m_nDest; // set to -1 for URL, to a dest else
+ rtl::OUString m_aURL;
sal_Int32 m_nStructParent; // struct parent entry
-
- PDFLink()
+
+ PDFLink()
: m_nDest( -1 ),
m_nStructParent( -1 )
{}
@@ -435,45 +433,45 @@ public:
struct PDFNoteEntry : public PDFAnnotation
{
- PDFNote m_aContents;
+ PDFNote m_aContents;
PDFNoteEntry()
{}
};
- typedef boost::unordered_map< rtl::OString, SvMemoryStream*, rtl::OStringHash > PDFAppearanceStreams;
- typedef boost::unordered_map< rtl::OString, PDFAppearanceStreams, rtl::OStringHash > PDFAppearanceMap;
+ typedef std::hash_map< rtl::OString, SvMemoryStream*, rtl::OStringHash > PDFAppearanceStreams;
+ typedef std::hash_map< rtl::OString, PDFAppearanceStreams, rtl::OStringHash > PDFAppearanceMap;
struct PDFWidget : public PDFAnnotation
{
- PDFWriter::WidgetType m_eType;
- rtl::OString m_aName;
- rtl::OUString m_aDescription;
- rtl::OUString m_aText;
- sal_uInt16 m_nTextStyle;
- rtl::OUString m_aValue;
+ PDFWriter::WidgetType m_eType;
+ rtl::OString m_aName;
+ rtl::OUString m_aDescription;
+ rtl::OUString m_aText;
+ USHORT m_nTextStyle;
+ rtl::OUString m_aValue;
rtl::OString m_aDAString;
rtl::OString m_aDRDict;
- rtl::OString m_aMKDict;
- rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string
+ rtl::OString m_aMKDict;
+ rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string
// since the object number is not known at the moment
// of filling m_aMKDict, the string will be encrypted when emitted.
// the /CA string MUST BE the last added to m_aMKDict
// see code for details
- sal_Int32 m_nFlags;
- sal_Int32 m_nParent; // if not 0, parent's object number
- std::vector<sal_Int32> m_aKids; // widget children, contains object numbers
+ sal_Int32 m_nFlags;
+ sal_Int32 m_nParent; // if not 0, parent's object number
+ std::vector<sal_Int32> m_aKids; // widget children, contains object numbers
std::vector<sal_Int32> m_aKidsIndex; // widget children, contains index to m_aWidgets
rtl::OUString m_aOnValue;
sal_Int32 m_nTabOrder; // lowest number gets first in tab order
- sal_Int32 m_nRadioGroup;
- sal_Int32 m_nMaxLen;
+ sal_Int32 m_nRadioGroup;
+ sal_Int32 m_nMaxLen;
bool m_bSubmit;
bool m_bSubmitGet;
sal_Int32 m_nDest;
- std::vector<rtl::OUString> m_aListEntries;
+ std::vector<rtl::OUString> m_aListEntries;
std::vector<sal_Int32> m_aSelectedEntries;
- PDFAppearanceMap m_aAppearances;
+ PDFAppearanceMap m_aAppearances;
PDFWidget()
: m_eType( PDFWriter::PushButton ),
m_nTextStyle( 0 ),
@@ -486,11 +484,11 @@ public:
m_nDest( -1 )
{}
};
-
+
struct PDFStructureAttribute
{
- PDFWriter::StructAttributeValue eValue;
- sal_Int32 nValue;
+ PDFWriter::StructAttributeValue eValue;
+ sal_Int32 nValue;
PDFStructureAttribute()
: eValue( PDFWriter::Invalid ),
@@ -515,26 +513,26 @@ public:
sal_Int32 nObject; // an object number if nMCID is -1,
// else the page object relevant to MCID
sal_Int32 nMCID; // an MCID if >= 0
-
+
PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {}
PDFStructureElementKid( sal_Int32 MCID, sal_Int32 nPage ) : nObject( nPage ), nMCID( MCID ) {}
};
-
+
struct PDFStructureElement
{
- sal_Int32 m_nObject;
- PDFWriter::StructElement m_eType;
+ sal_Int32 m_nObject;
+ PDFWriter::StructElement m_eType;
rtl::OString m_aAlias;
- sal_Int32 m_nOwnElement; // index into structure vector
- sal_Int32 m_nParentElement; // index into structure vector
- sal_Int32 m_nFirstPageObject;
- bool m_bOpenMCSeq;
- std::list< sal_Int32 > m_aChildren; // indexes into structure vector
+ sal_Int32 m_nOwnElement; // index into structure vector
+ sal_Int32 m_nParentElement; // index into structure vector
+ sal_Int32 m_nFirstPageObject;
+ bool m_bOpenMCSeq;
+ std::list< sal_Int32 > m_aChildren; // indexes into structure vector
std::list< PDFStructureElementKid > m_aKids;
- PDFStructAttributes m_aAttributes;
- Rectangle m_aBBox;
- rtl::OUString m_aActualText;
- rtl::OUString m_aAltText;
+ PDFStructAttributes m_aAttributes;
+ Rectangle m_aBBox;
+ rtl::OUString m_aActualText;
+ rtl::OUString m_aAltText;
com::sun::star::lang::Locale m_aLocale;
// m_aContents contains the element's marked content sequence
@@ -551,18 +549,18 @@ public:
}
};
-
+
struct PDFAddStream
{
rtl::OUString m_aMimeType;
PDFOutputStream* m_pStream;
sal_Int32 m_nStreamObject;
bool m_bCompress;
-
+
PDFAddStream() : m_pStream( NULL ), m_nStreamObject( 0 ), m_bCompress( true ) {}
};
-
-
+
+
// helper structure for drawLayout and friends
struct PDFGlyph
{
@@ -571,7 +569,7 @@ public:
sal_Int32 m_nGlyphId;
sal_Int32 m_nMappedFontId;
sal_uInt8 m_nMappedGlyphId;
-
+
PDFGlyph( const Point& rPos,
sal_Int32 nNativeWidth,
sal_Int32 nGlyphId,
@@ -586,7 +584,7 @@ public:
static const sal_Char* getStructureTag( PDFWriter::StructElement );
static const sal_Char* getAttributeTag( PDFWriter::StructAttribute eAtr );
static const sal_Char* getAttributeValueTag( PDFWriter::StructAttributeValue eVal );
-
+
// returns true if compression was done
// else false
static bool compressStream( SvMemoryStream* );
@@ -595,98 +593,99 @@ public:
private:
static const BuiltinFont m_aBuiltinFonts[14];
- OutputDevice* m_pReferenceDevice;
+ OutputDevice* m_pReferenceDevice;
- MapMode m_aMapMode; // PDFWriterImpl scaled units
- std::vector< PDFPage > m_aPages;
+ 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;
+ std::vector< sal_uInt64 > m_aObjects;
/* contains Bitmaps until they are written to the
* file stream as XObjects*/
- std::list< BitmapEmit > m_aBitmaps;
+ std::list< BitmapEmit > m_aBitmaps;
/* contains JPG streams until written to file */
- std::list<JPGEmit> m_aJPGs;
+ std::list<JPGEmit> m_aJPGs;
/*--->i56629 contains all named destinations ever set during the PDF creation,
destination id is always the destination's position in this vector
*/
- std::vector<PDFNamedDest> m_aNamedDests;
+ std::vector<PDFNamedDest> m_aNamedDests;
//<---
/* contains all dests ever set during the PDF creation,
dest id is always the dest's position in this vector
*/
- std::vector<PDFDest> m_aDests;
+ std::vector<PDFDest> m_aDests;
/* contains all links ever set during PDF creation,
link id is always the link's position in this vector
*/
- std::vector<PDFLink> m_aLinks;
+ std::vector<PDFLink> m_aLinks;
/* makes correctly encoded for export to PDF URLS
*/
com::sun::star::uno::Reference< com::sun::star::util::XURLTransformer > m_xTrans;
/* maps arbitrary link ids for structure attributes to real link ids
(for setLinkPropertyId)
*/
- std::map<sal_Int32, sal_Int32> m_aLinkPropertyMap;
+ std::map<sal_Int32, sal_Int32> m_aLinkPropertyMap;
/* contains all outline items,
object 0 is the outline root
*/
- std::vector<PDFOutlineEntry> m_aOutline;
+ std::vector<PDFOutlineEntry> m_aOutline;
/* contains all notes set during PDF creation
*/
- std::vector<PDFNoteEntry> m_aNotes;
+ std::vector<PDFNoteEntry> m_aNotes;
/* the root of the structure tree
*/
- std::vector<PDFStructureElement> m_aStructure;
+ std::vector<PDFStructureElement> m_aStructure;
/* current object in the structure hierarchy
*/
- sal_Int32 m_nCurrentStructElement;
+ sal_Int32 m_nCurrentStructElement;
/* structure parent tree */
std::vector< rtl::OString > m_aStructParentTree;
/* emit strucure marks currently (aka. NonStructElement or not)
*/
- bool m_bEmitStructure;
- bool m_bNewMCID;
+ bool m_bEmitStructure;
+ bool m_bNewMCID;
/* role map of struct tree root */
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >
+ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >
m_aRoleMap;
/* contains all widgets used in the PDF
*/
- std::vector<PDFWidget> m_aWidgets;
+ std::vector<PDFWidget> m_aWidgets;
/* maps radio group id to index of radio group control in m_aWidgets */
- std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets;
+ std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets;
/* used to store control id during beginControlAppearance/endControlAppearance */
- sal_Int32 m_nCurrentControl;
- /* boost::unordered_map for field names, used to ensure unique field names */
- boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash > m_aFieldNameMap;
+ sal_Int32 m_nCurrentControl;
+ /* hash_map for field names, used to ensure unique field names */
+ std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash > m_aFieldNameMap;
/* contains Bitmaps for gradient functions until they are written
* to the file stream */
- std::list< GradientEmit > m_aGradients;
+ std::list< GradientEmit > m_aGradients;
/* contains bitmap tiling patterns */
- std::vector< TilingEmit > m_aTilings;
- std::list< TransparencyEmit > m_aTransparentObjects;
+ std::vector< TilingEmit > m_aTilings;
+ std::list< TransparencyEmit > m_aTransparentObjects;
/* contains all font subsets in use */
- FontSubsetData m_aSubsets;
+ FontSubsetData m_aSubsets;
bool m_bEmbedStandardFonts;
- FontEmbedData m_aEmbeddedFonts;
+ FontEmbedData m_aEmbeddedFonts;
FontEmbedData m_aSystemFonts;
- sal_Int32 m_nNextFID;
+ sal_Int32 m_nNextFID;
PDFFontCache m_aFontCache;
- sal_Int32 m_nInheritedPageWidth; // in inch/72
- sal_Int32 m_nInheritedPageHeight; // in inch/72
- PDFWriter::Orientation m_eInheritedOrientation;
- sal_Int32 m_nCurrentPage;
+ sal_Int32 m_nInheritedPageWidth; // in inch/72
+ sal_Int32 m_nInheritedPageHeight; // in inch/72
+ PDFWriter::Orientation m_eInheritedOrientation;
+ sal_Int32 m_nCurrentPage;
- sal_Int32 m_nCatalogObject;
- sal_Int32 m_nResourceDict;
+ sal_Int32 m_nCatalogObject;
+ sal_Int32 m_nResourceDict;
ResourceDict m_aGlobalResourceDict;
sal_Int32 m_nFontDictObject;
std::map< sal_Int32, sal_Int32 > m_aBuiltinFontToObjectMap;
- PDFWriter::PDFWriterContext m_aContext;
- oslFileHandle m_aFile;
- bool m_bOpen;
+ PDFWriter::PDFWriterContext m_aContext;
+ oslFileHandle m_aFile;
+ bool m_bOpen;
/* output redirection; e.g. to accumulate content streams for
@@ -694,31 +693,31 @@ private:
*/
struct StreamRedirect
{
- SvStream* m_pStream;
- MapMode m_aMapMode;
+ SvStream* m_pStream;
+ MapMode m_aMapMode;
Rectangle m_aTargetRect;
ResourceDict m_aResourceDict;
};
- std::list< StreamRedirect > m_aOutputStreams;
+ std::list< StreamRedirect > m_aOutputStreams;
// graphics state
struct GraphicsState
{
- Font m_aFont;
- MapMode m_aMapMode;
- Color m_aLineColor;
- Color m_aFillColor;
- Color m_aTextLineColor;
- Color m_aOverlineColor;
- basegfx::B2DPolyPolygon m_aClipRegion;
+ Font m_aFont;
+ MapMode m_aMapMode;
+ Color m_aLineColor;
+ Color m_aFillColor;
+ Color m_aTextLineColor;
+ Color m_aOverlineColor;
+ basegfx::B2DPolyPolygon m_aClipRegion;
bool m_bClipRegion;
- sal_Int32 m_nAntiAlias;
- sal_Int32 m_nLayoutMode;
+ sal_Int32 m_nAntiAlias;
+ sal_Int32 m_nLayoutMode;
LanguageType m_aDigitLanguage;
- sal_Int32 m_nTransparentPercent;
- sal_uInt16 m_nFlags;
+ sal_Int32 m_nTransparentPercent;
+ sal_uInt16 m_nFlags;
sal_uInt16 m_nUpdateFlags;
-
+
static const sal_uInt16 updateFont = 0x0001;
static const sal_uInt16 updateMapMode = 0x0002;
static const sal_uInt16 updateLineColor = 0x0004;
@@ -764,77 +763,156 @@ private:
GraphicsState& operator=(const GraphicsState& rState )
{
- m_aFont = rState.m_aFont;
- m_aMapMode = rState.m_aMapMode;
- m_aLineColor = rState.m_aLineColor;
- m_aFillColor = rState.m_aFillColor;
- m_aTextLineColor = rState.m_aTextLineColor;
- m_aOverlineColor = rState.m_aOverlineColor;
- m_aClipRegion = rState.m_aClipRegion;
+ m_aFont = rState.m_aFont;
+ m_aMapMode = rState.m_aMapMode;
+ m_aLineColor = rState.m_aLineColor;
+ m_aFillColor = rState.m_aFillColor;
+ m_aTextLineColor = rState.m_aTextLineColor;
+ m_aOverlineColor = rState.m_aOverlineColor;
+ m_aClipRegion = rState.m_aClipRegion;
m_bClipRegion = rState.m_bClipRegion;
- m_nAntiAlias = rState.m_nAntiAlias;
- m_nLayoutMode = rState.m_nLayoutMode;
+ m_nAntiAlias = rState.m_nAntiAlias;
+ m_nLayoutMode = rState.m_nLayoutMode;
m_aDigitLanguage = rState.m_aDigitLanguage;
- m_nTransparentPercent = rState.m_nTransparentPercent;
- m_nFlags = rState.m_nFlags;
+ m_nTransparentPercent = rState.m_nTransparentPercent;
+ m_nFlags = rState.m_nFlags;
m_nUpdateFlags = rState.m_nUpdateFlags;
return *this;
}
};
- std::list< GraphicsState > m_aGraphicsStack;
- GraphicsState m_aCurrentPDFState;
-
- ZCodec* m_pCodec;
- SvMemoryStream* m_pMemStream;
+ std::list< GraphicsState > m_aGraphicsStack;
+ GraphicsState m_aCurrentPDFState;
+ ZCodec* m_pCodec;
+ SvMemoryStream* m_pMemStream;
+
std::vector< PDFAddStream > m_aAdditionalStreams;
std::set< PDFWriter::ErrorCode > m_aErrors;
-
+
rtlDigest m_aDocDigest;
/*
variables for PDF security
-i12626
+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 */
- static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE];
+ 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];
+ 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() */
+ sal_Bool m_bEncryptThisStream;
+
+/* 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 */
+ sal_uInt8 *m_pEncryptionBuffer;
+/* 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
+ };
- /* 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
+ for(sal_uInt32 i = 0; i < sizeof( nPadString ); i++ )
+ m_nPadString[i] = nPadString[i];
- /* set to true if the following stream must be encrypted, used inside writeBuffer() */
- sal_Bool m_bEncryptThisStream;
+ };
+/* initialize the encryption engine */
+ void initEncryption();
- /* the numerical value of the access permissions, according to PDF spec, must be signed */
- sal_Int32 m_nAccessPermissions;
- /* 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 */
- sal_Int32 m_nEncryptionBufferSize;
-
- /* 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 );
+/* 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 );
+ }
+ };
void disableStreamEncryption() { m_bEncryptThisStream = false; };
- /* */
- void enableStringEncryption( register sal_Int32 nObject );
+/* */
+ 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 );
+ };
// 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 );
- void appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc = RTL_TEXTENCODING_ASCII_US );
+ void appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
void appendLiteralStringEncrypt( const rtl::OString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
void appendLiteralStringEncrypt( rtl::OStringBuffer& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -957,7 +1035,7 @@ i12626
bool emitAdditionalStreams();
// emits info dict (if applicable)
sal_Int32 emitInfoDict( );
-
+
// acrobat reader 5 and 6 use the order of the annotations
// as their tab order; since PDF1.5 one can make the
// tab order explicit by using the structure tree
@@ -972,10 +1050,10 @@ i12626
Font replaceFont( const Font& rControlFont, const Font& rAppSetFont );
sal_Int32 getBestBuiltinFont( const Font& rFont );
sal_Int32 getSystemFont( const Font& i_rFont );
-
+
// used for edit and listbox
Font drawFieldBorder( PDFWidget&, const PDFWriter::AnyWidget&, const StyleSettings& );
-
+
void createDefaultPushButtonAppearance( PDFWidget&, const PDFWriter::PushButtonWidget& rWidget );
void createDefaultCheckBoxAppearance( PDFWidget&, const PDFWriter::CheckBoxWidget& rWidget );
void createDefaultRadioButtonAppearance( PDFWidget&, const PDFWriter::RadioButtonWidget& rWidget );
@@ -991,7 +1069,7 @@ i12626
/* sets the offset of object n to the current position of output file+1
*/
bool updateObject( sal_Int32 n );
-
+
bool writeBuffer( const void* pBuffer, sal_uInt64 nBytes );
void beginCompression();
void endCompression();
@@ -1015,71 +1093,31 @@ i12626
bool checkEmitStructure();
/* draws an emphasis mark */
- void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
/* true if PDF/A-1a or PDF/A-1b is output */
sal_Bool m_bIsPDF_A1;
- 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 );
+
+/*
+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();
+
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext );
~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
+ /* for OutputDevice so the reference device can have a list
+ * that contains only suitable fonts (subsettable or builtin)
+ * produces a new font list
*/
ImplDevFontList* filterDevFontList( ImplDevFontList* pFontList );
/* for OutputDevice: get layout for builtin fonts
@@ -1098,8 +1136,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
{
Size aSize;
@@ -1109,7 +1146,9 @@ 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; }
@@ -1135,19 +1174,19 @@ public:
void setFillColor( const Color& rColor )
{
m_aGraphicsStack.front().m_aFillColor = ImplIsColorTransparent(rColor) ? Color( COL_TRANSPARENT ) : rColor;
- m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFillColor;
+ m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFillColor;
}
void setTextLineColor()
{
m_aGraphicsStack.front().m_aTextLineColor = Color( COL_TRANSPARENT );
- m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor;
+ m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor;
}
void setTextLineColor( const Color& rColor )
{
m_aGraphicsStack.front().m_aTextLineColor = rColor;
- m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor;
+ m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateTextLineColor;
}
void setOverlineColor()
@@ -1165,13 +1204,13 @@ public:
void setTextFillColor( const Color& rColor )
{
m_aGraphicsStack.front().m_aFont.SetFillColor( rColor );
- m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? sal_True : sal_False );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? TRUE : 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( sal_True );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( TRUE );
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont;
}
void setTextColor( const Color& rColor )
@@ -1200,7 +1239,7 @@ public:
m_aGraphicsStack.front().m_nLayoutMode = nLayoutMode;
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateLayoutMode;
}
-
+
void setDigitLanguage( LanguageType eLang )
{
m_aGraphicsStack.front().m_aDigitLanguage = eLang;
@@ -1222,10 +1261,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, sal_uLong nWidth, const String& rText,
+ void drawStretchText( const Point& rPos, 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, sal_uInt16 nStyle, bool bTextLines = true );
+ void drawText( const Rectangle& rRect, const String& rOrigStr, USHORT 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 );
@@ -1312,7 +1351,7 @@ public:
sal_Int32 createControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr = -1 );
void beginControlAppearance( sal_Int32 nControl );
bool endControlAppearance( PDFWriter::WidgetState eState );
-
+
// additional streams
void addStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
deleted file mode 100644
index 3e957d175897..000000000000
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ /dev/null
@@ -1,2037 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "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 66e3cd1bea1a..9e27f79541d1 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,24 +46,24 @@
// - Defines -
// -----------
-#define PNGCHUNK_IHDR 0x49484452
-#define PNGCHUNK_PLTE 0x504c5445
-#define PNGCHUNK_IDAT 0x49444154
-#define PNGCHUNK_IEND 0x49454e44
-#define PNGCHUNK_bKGD 0x624b4744
-#define PNGCHUNK_cHRM 0x6348524d
-#define PNGCHUNK_gAMA 0x67414d41
-#define PNGCHUNK_hIST 0x68495354
-#define PNGCHUNK_pHYs 0x70485973
-#define PNGCHUNK_sBIT 0x73425420
-#define PNGCHUNK_tIME 0x74494d45
-#define PNGCHUNK_tEXt 0x74455874
-#define PNGCHUNK_tRNS 0x74524e53
-#define PNGCHUNK_zTXt 0x7a545874
-#define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF
-
-#define VIEWING_GAMMA 2.35
-#define DISPLAY_GAMMA 1.0
+#define PNGCHUNK_IHDR 0x49484452
+#define PNGCHUNK_PLTE 0x504c5445
+#define PNGCHUNK_IDAT 0x49444154
+#define PNGCHUNK_IEND 0x49454e44
+#define PNGCHUNK_bKGD 0x624b4744
+#define PNGCHUNK_cHRM 0x6348524d
+#define PNGCHUNK_gAMA 0x67414d41
+#define PNGCHUNK_hIST 0x68495354
+#define PNGCHUNK_pHYs 0x70485973
+#define PNGCHUNK_sBIT 0x73425420
+#define PNGCHUNK_tIME 0x74494d45
+#define PNGCHUNK_tEXt 0x74455874
+#define PNGCHUNK_tRNS 0x74524e53
+#define PNGCHUNK_zTXt 0x7a545874
+#define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF
+
+#define VIEWING_GAMMA 2.35
+#define DISPLAY_GAMMA 1.0
namespace vcl
{
@@ -73,8 +73,8 @@ namespace vcl
// ------------------------------------------------------------------------------
-static const sal_uInt8 mpDefaultColorTable[ 256 ] =
-{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+static const BYTE 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,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
@@ -106,17 +106,17 @@ private:
std::vector< vcl::PNGReader::ChunkData >::iterator maChunkIter;
std::vector< sal_uInt8 >::iterator maDataIter;
- Bitmap* mpBmp;
- BitmapWriteAccess* mpAcc;
- Bitmap* mpMaskBmp;
- AlphaMask* mpAlphaMask;
- BitmapWriteAccess* mpMaskAcc;
- ZCodec* mpZCodec;
- 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; //
+ Bitmap* mpBmp;
+ BitmapWriteAccess* mpAcc;
+ Bitmap* mpMaskBmp;
+ 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_Size mnStreamSize; // estimate of PNG file size
sal_uInt32 mnChunkType; // Type of current PNG chunk
sal_Int32 mnChunkLen; // Length of current PNG chunk
@@ -132,50 +132,51 @@ 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)
- 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"
- 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;
+ 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;
+ 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 mbIgnoreGammaChunk;
bool ReadNextChunk();
void ReadRemainingChunks();
+ void SkipRemainingChunks();
void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor & );
- 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();
+ 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 ImplReadIDAT();
bool ImplPreparePass();
void ImplApplyFilter();
void ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd );
- sal_Bool ImplReadTransparent();
- void ImplGetGamma();
- void ImplGetBackground();
- sal_uInt8 ImplScaleColor();
- sal_Bool ImplReadHeader( const Size& rPreviewSizeHint );
- sal_Bool ImplReadPalette();
- void ImplGetGrayPalette( sal_uInt16 );
- sal_uInt32 ImplReadsal_uInt32();
+ BOOL ImplReadTransparent();
+ void ImplGetGamma();
+ void ImplGetBackground();
+ BYTE ImplScaleColor();
+ BOOL ImplReadHeader( const Size& rPreviewSizeHint );
+ BOOL ImplReadPalette();
+ void ImplGetGrayPalette( sal_uInt16 );
+ sal_uInt32 ImplReadsal_uInt32();
public:
@@ -184,31 +185,29 @@ public:
BitmapEx GetBitmapEx( const Size& rPreviewSizeHint );
const std::vector< PNGReader::ChunkData >& GetAllChunks();
- void SetIgnoreGammaChunk( sal_Bool bIgnore ){ mbIgnoreGammaChunk = bIgnore; };
+ void SetIgnoreGammaChunk( sal_Bool bIgnore ){ mbIgnoreGammaChunk = bIgnore; };
};
// ------------------------------------------------------------------------------
PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
: mrPNGStream( rPNGStream ),
- mpBmp ( NULL ),
- mpAcc ( NULL ),
- mpMaskBmp ( NULL ),
- mpAlphaMask ( NULL ),
- mpMaskAcc ( NULL ),
- mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
- mpInflateInBuf ( NULL ),
- mpScanPrior ( NULL ),
- mpTransTab ( NULL ),
- mpScanCurrent ( NULL ),
- mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
- mnPass ( 0 ),
- mbzCodecInUse ( sal_False ),
- mbStatus( sal_True),
- mbIDAT( sal_False ),
- mbGamma ( sal_False ),
- mbpHYs ( sal_False ),
- mbIgnoreGammaChunk ( sal_False )
+ mpBmp ( NULL ),
+ mpAcc ( NULL ),
+ mpMaskBmp ( NULL ),
+ mpAlphaMask ( NULL ),
+ mpMaskAcc ( NULL ),
+ mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
+ mpInflateInBuf ( NULL ),
+ mpScanPrior ( NULL ),
+ mpTransTab ( NULL ),
+ mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
+ mbzCodecInUse ( sal_False ),
+ mbStatus( TRUE),
+ mbIDAT( FALSE ),
+ mbGamma ( sal_False ),
+ mbpHYs ( sal_False ),
+ mbIgnoreGammaChunk ( sal_False )
{
// prepare the PNG data stream
mnOrigStreamMode = mrPNGStream.GetNumberFormatInt();
@@ -218,7 +217,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
maChunkSeq.reserve( 16 );
maChunkIter = maChunkSeq.begin();
- // estimate PNG file size (to allow sanity checks)
+ // estimate PNG file size (to allow sanity checks)
const sal_Size nStreamPos = mrPNGStream.Tell();
mrPNGStream.Seek( STREAM_SEEK_TO_END );
mnStreamSize = mrPNGStream.Tell();
@@ -335,6 +334,30 @@ void PNGReaderImpl::ReadRemainingChunks()
// ------------------------------------------------------------------------
+// move position of mrPNGStream to the end of the file
+void PNGReaderImpl::SkipRemainingChunks()
+{
+ // nothing to skip if the last chunk was read
+ if( !maChunkSeq.empty() && (maChunkSeq.back().nType == PNGCHUNK_IEND) )
+ return;
+
+ // read from the stream until the IEND chunk is found
+ const sal_Size nStreamPos = mrPNGStream.Tell();
+ while( !mrPNGStream.IsEof() && (mrPNGStream.GetError() == ERRCODE_NONE) )
+ {
+ mrPNGStream >> mnChunkLen >> mnChunkType;
+ if( mnChunkLen < 0 )
+ break;
+ if( nStreamPos + mnChunkLen >= mnStreamSize )
+ break;
+ mrPNGStream.SeekRel( mnChunkLen + 4 ); // skip data + CRC
+ if( mnChunkType == PNGCHUNK_IEND )
+ break;
+ }
+}
+
+// ------------------------------------------------------------------------
+
const std::vector< vcl::PNGReader::ChunkData >& PNGReaderImpl::GetAllChunks()
{
ReadRemainingChunks();
@@ -359,9 +382,9 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
}
break;
- case PNGCHUNK_gAMA : // the gamma chunk must precede
- { // the 'IDAT' and also the 'PLTE'(if available )
- if ( !mbIgnoreGammaChunk && ( mbIDAT == sal_False ) )
+ case PNGCHUNK_gAMA : // the gamma chunk must precede
+ { // the 'IDAT' and also the 'PLTE'(if available )
+ if ( !mbIgnoreGammaChunk && ( mbIDAT == FALSE ) )
ImplGetGamma();
}
break;
@@ -375,23 +398,23 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_tRNS :
{
- if ( !mbIDAT ) // the tRNS chunk must precede the IDAT
+ if ( !mbIDAT ) // the tRNS chunk must precede the IDAT
mbStatus = ImplReadTransparent();
}
break;
- case PNGCHUNK_bKGD : // the background chunk must appear
+ case PNGCHUNK_bKGD : // the background chunk must appear
{
- if ( ( mbIDAT == sal_False ) && mbPalette ) // before the 'IDAT' and after the
- ImplGetBackground(); // PLTE(if available ) chunk.
+ if ( ( mbIDAT == FALSE ) && mbPalette ) // before the 'IDAT' and after the
+ ImplGetBackground(); // PLTE(if available ) chunk.
}
break;
case PNGCHUNK_IDAT :
{
- if ( !mpInflateInBuf ) // taking care that the header has properly been read
- mbStatus = sal_False;
- else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
+ if ( !mpInflateInBuf ) // taking care that the header has properly been read
+ mbStatus = FALSE;
+ else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
ImplReadIDAT();
}
break;
@@ -463,27 +486,27 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// ------------------------------------------------------------------------
-sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
+BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
if( mnChunkLen < 13 )
- return sal_False;
+ return FALSE;
maOrigSize.Width() = ImplReadsal_uInt32();
maOrigSize.Height() = ImplReadsal_uInt32();
if ( !maOrigSize.Width() || !maOrigSize.Height() )
- return sal_False;
+ return FALSE;
mnPngDepth = *(maDataIter++);
mnColorType = *(maDataIter++);
mnCompressionType = *(maDataIter++);
if( mnCompressionType != 0 ) // unknown compression type
- return sal_False;
+ return FALSE;
mnFilterType = *(maDataIter++);
if( mnFilterType != 0 ) // unknown filter type
- return sal_False;
+ return FALSE;
mnInterlaceType = *(maDataIter++);
switch ( mnInterlaceType ) // filter type valid ?
@@ -495,110 +518,110 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnPass = 0;
break;
default:
- return sal_False;
+ return FALSE;
}
- mbPalette = sal_True;
- mbIDAT = mbAlphaChannel = mbTransparent = sal_False;
- mbGrayScale = mbRGBTriple = sal_False;
+ mbPalette = TRUE;
+ mbIDAT = mbAlphaChannel = mbTransparent = FALSE;
+ mbGrayScale = mbRGBTriple = FALSE;
mnTargetDepth = mnPngDepth;
sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3;
// valid color types are 0,2,3,4 & 6
switch ( mnColorType )
{
- case 0 : // each pixel is a grayscale
+ case 0 : // each pixel is a grayscale
{
switch ( mnPngDepth )
{
case 2 : // 2bit target not available -> use four bits
- mnTargetDepth = 4; // we have to expand the bitmap
- mbGrayScale = sal_True;
+ mnTargetDepth = 4; // we have to expand the bitmap
+ mbGrayScale = TRUE;
break;
case 16 :
- mnTargetDepth = 8; // we have to reduce the bitmap
+ mnTargetDepth = 8; // we have to reduce the bitmap
// fall through
case 1 :
case 4 :
case 8 :
- mbGrayScale = sal_True;
+ mbGrayScale = TRUE;
break;
default :
- return sal_False;
+ return FALSE;
}
}
break;
- case 2 : // each pixel is an RGB triple
+ case 2 : // each pixel is an RGB triple
{
- mbRGBTriple = sal_True;
+ mbRGBTriple = TRUE;
nScansize64 *= 3;
switch ( mnPngDepth )
{
- case 16 : // we have to reduce the bitmap
+ case 16 : // we have to reduce the bitmap
case 8 :
mnTargetDepth = 24;
break;
default :
- return sal_False;
+ return FALSE;
}
}
break;
- case 3 : // each pixel is a palette index
+ case 3 : // each pixel is a palette index
{
switch ( mnPngDepth )
{
case 2 :
- mnTargetDepth = 4; // we have to expand the bitmap
+ mnTargetDepth = 4; // we have to expand the bitmap
// fall through
case 1 :
case 4 :
case 8 :
- mbPalette = sal_False;
+ mbPalette = FALSE;
break;
default :
- return sal_False;
+ return FALSE;
}
}
break;
- case 4 : // each pixel is a grayscale sample followed by an alpha sample
+ case 4 : // each pixel is a grayscale sample followed by an alpha sample
{
nScansize64 *= 2;
- mbAlphaChannel = sal_True;
+ mbAlphaChannel = TRUE;
switch ( mnPngDepth )
{
case 16 :
- mnTargetDepth = 8; // we have to reduce the bitmap
+ mnTargetDepth = 8; // we have to reduce the bitmap
case 8 :
- mbGrayScale = sal_True;
+ mbGrayScale = TRUE;
break;
default :
- return sal_False;
+ return FALSE;
}
}
break;
- case 6 : // each pixel is an RGB triple followed by an alpha sample
+ case 6 : // each pixel is an RGB triple followed by an alpha sample
{
- mbRGBTriple = sal_True;
+ mbRGBTriple = TRUE;
nScansize64 *= 4;
- mbAlphaChannel = sal_True;
+ mbAlphaChannel = TRUE;
switch (mnPngDepth )
{
- case 16 : // we have to reduce the bitmap
+ case 16 : // we have to reduce the bitmap
case 8 :
mnTargetDepth = 24;
break;
default :
- return sal_False;
+ return FALSE;
}
}
break;
default :
- return sal_False;
+ return FALSE;
}
mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() );
@@ -608,17 +631,17 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
nScansize64++; // each scanline includes one filterbyte
if ( nScansize64 > SAL_MAX_UINT32 )
- return sal_False;
+ return FALSE;
mnScansize = static_cast< sal_uInt32 >( nScansize64 );
// TODO: switch between both scanlines instead of copying
- mpInflateInBuf = new (std::nothrow) sal_uInt8[ mnScansize ];
+ mpInflateInBuf = new (std::nothrow) BYTE[ mnScansize ];
mpScanCurrent = mpInflateInBuf;
- mpScanPrior = new (std::nothrow) sal_uInt8[ mnScansize ];
+ mpScanPrior = new (std::nothrow) BYTE[ mnScansize ];
if ( !mpInflateInBuf || !mpScanPrior )
- return sal_False;
+ return FALSE;
// calculate target size from original size and the preview hint
if( rPreviewSizeHint.Width() || rPreviewSizeHint.Height() )
@@ -657,7 +680,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpBmp = new Bitmap( maTargetSize, mnTargetDepth );
mpAcc = mpBmp->AcquireWriteAccess();
if( !mpAcc )
- return sal_False;
+ return FALSE;
mpBmp->SetSourceSizePixel( maOrigSize );
@@ -667,7 +690,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpAlphaMask->Erase( 128 );
mpMaskAcc = mpAlphaMask->AcquireWriteAccess();
if( !mpMaskAcc )
- return sal_False;
+ return FALSE;
}
if ( mbGrayScale )
@@ -675,7 +698,7 @@ sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
ImplPreparePass();
- return sal_True;
+ return TRUE;
}
// ------------------------------------------------------------------------
@@ -695,38 +718,38 @@ void PNGReaderImpl::ImplGetGrayPalette( sal_uInt16 nBitDepth )
mpAcc->SetPaletteEntryCount( nPaletteEntryCount );
for ( sal_uInt32 i = 0, nStart = 0; nStart < 256; i++, nStart += nAdd )
- mpAcc->SetPaletteColor( (sal_uInt16)i, BitmapColor( mpColorTable[ nStart ],
+ mpAcc->SetPaletteColor( (USHORT)i, BitmapColor( mpColorTable[ nStart ],
mpColorTable[ nStart ], mpColorTable[ nStart ] ) );
}
// ------------------------------------------------------------------------
-sal_Bool PNGReaderImpl::ImplReadPalette()
+BOOL PNGReaderImpl::ImplReadPalette()
{
sal_uInt16 nCount = static_cast<sal_uInt16>( mnChunkLen / 3 );
if ( ( ( mnChunkLen % 3 ) == 0 ) && ( ( 0 < nCount ) && ( nCount <= 256 ) ) && mpAcc )
{
- mbPalette = sal_True;
- mpAcc->SetPaletteEntryCount( (sal_uInt16) nCount );
+ mbPalette = TRUE;
+ mpAcc->SetPaletteEntryCount( (USHORT) nCount );
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- sal_uInt8 nRed = mpColorTable[ *maDataIter++ ];
- sal_uInt8 nGreen = mpColorTable[ *maDataIter++ ];
- sal_uInt8 nBlue = mpColorTable[ *maDataIter++ ];
+ BYTE nRed = mpColorTable[ *maDataIter++ ];
+ BYTE nGreen = mpColorTable[ *maDataIter++ ];
+ BYTE nBlue = mpColorTable[ *maDataIter++ ];
mpAcc->SetPaletteColor( i, Color( nRed, nGreen, nBlue ) );
}
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
return mbStatus;
}
// ------------------------------------------------------------------------
-sal_Bool PNGReaderImpl::ImplReadTransparent()
+BOOL PNGReaderImpl::ImplReadTransparent()
{
bool bNeedAlpha = false;
@@ -765,7 +788,7 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
{
if ( mnChunkLen <= 256 )
{
- mpTransTab = new sal_uInt8 [ 256 ];
+ mpTransTab = new BYTE [ 256 ];
rtl_fillMemory( mpTransTab, 256, 0xff );
rtl_copyMemory( mpTransTab, &(*maDataIter), mnChunkLen );
maDataIter += mnChunkLen;
@@ -793,13 +816,13 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
}
mbTransparent = (mpMaskAcc != NULL);
if( !mbTransparent )
- return sal_False;
+ return FALSE;
mcOpaqueColor = BitmapColor( 0x00 );
mcTranspColor = BitmapColor( 0xFF );
mpMaskAcc->Erase( 0x00 );
}
- return sal_True;
+ return TRUE;
}
// ------------------------------------------------------------------------
@@ -809,17 +832,17 @@ void PNGReaderImpl::ImplGetGamma()
if( mnChunkLen < 4 )
return;
- sal_uInt32 nGammaValue = ImplReadsal_uInt32();
- double fGamma = ( ( VIEWING_GAMMA / DISPLAY_GAMMA ) * ( (double)nGammaValue / 100000 ) );
- double fInvGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
+ sal_uInt32 nGammaValue = ImplReadsal_uInt32();
+ double fGamma = ( ( VIEWING_GAMMA / DISPLAY_GAMMA ) * ( (double)nGammaValue / 100000 ) );
+ double fInvGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
if ( fInvGamma != 1.0 )
{
- mbGamma = sal_True;
-
+ mbGamma = TRUE;
+
if ( mpColorTable == mpDefaultColorTable )
mpColorTable = new sal_uInt8[ 256 ];
-
+
for ( sal_Int32 i = 0; i < 256; i++ )
mpColorTable[ i ] = (sal_uInt8)(pow((double)i/255.0, fInvGamma) * 255.0 + 0.5);
@@ -838,10 +861,10 @@ void PNGReaderImpl::ImplGetBackground()
{
if ( mnChunkLen == 1 )
{
- sal_uInt16 nCol = *maDataIter++;
+ UINT16 nCol = *maDataIter++;
if ( nCol < mpAcc->GetPaletteEntryCount() )
{
- mpAcc->Erase( mpAcc->GetPaletteColor( (sal_uInt8)nCol ) );
+ mpAcc->Erase( mpAcc->GetPaletteColor( (BYTE)nCol ) );
break;
}
}
@@ -860,7 +883,7 @@ void PNGReaderImpl::ImplGetBackground()
}
}
break;
-
+
case 2 :
case 6 :
{
@@ -884,12 +907,12 @@ sal_uInt8 PNGReaderImpl::ImplScaleColor()
{
sal_uInt32 nMask = ( ( 1 << mnPngDepth ) - 1 );
sal_uInt16 nCol = ( *maDataIter++ << 8 );
-
+
nCol += *maDataIter++ & (sal_uInt16)nMask;
-
- if ( mnPngDepth > 8 ) // convert 16bit graphics to 8
+
+ if ( mnPngDepth > 8 ) // convert 16bit graphics to 8
nCol >>= 8;
-
+
return (sal_uInt8) nCol;
}
@@ -900,9 +923,9 @@ void PNGReaderImpl::ImplReadIDAT()
{
if( mnChunkLen > 0 )
{
- if ( mbzCodecInUse == sal_False )
+ if ( mbzCodecInUse == FALSE )
{
- mbzCodecInUse = sal_True;
+ mbzCodecInUse = TRUE;
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT );
}
mpZCodec->SetBreak( mnChunkLen );
@@ -915,7 +938,7 @@ void PNGReaderImpl::ImplReadIDAT()
sal_Int32 nRead = mpZCodec->ReadAsynchron( aIStrm, mpScanCurrent, nToRead );
if ( nRead < 0 )
{
- mbStatus = sal_False;
+ mbStatus = FALSE;
break;
}
if ( nRead < nToRead )
@@ -946,7 +969,7 @@ void PNGReaderImpl::ImplReadIDAT()
if( mbIDAT )
{
mpZCodec->EndCompression();
- mbzCodecInUse = sal_False;
+ mbzCodecInUse = FALSE;
}
}
@@ -1021,9 +1044,9 @@ bool PNGReaderImpl::ImplPreparePass()
void PNGReaderImpl::ImplApplyFilter()
{
OSL_ASSERT( mnScansize >= mnBPP + 1 );
- const sal_uInt8* const pScanEnd = mpInflateInBuf + mnScansize;
+ const BYTE* const pScanEnd = mpInflateInBuf + mnScansize;
- sal_uInt8 nFilterType = *mpInflateInBuf; // the filter type may change each scanline
+ BYTE nFilterType = *mpInflateInBuf; // the filter type may change each scanline
switch ( nFilterType )
{
default: // unknown Scanline Filter Type
@@ -1033,26 +1056,26 @@ void PNGReaderImpl::ImplApplyFilter()
case 1: // Scanline Filter Type "Sub"
{
- sal_uInt8* p1 = mpInflateInBuf + 1;
- const sal_uInt8* p2 = p1;
+ BYTE* p1 = mpInflateInBuf + 1;
+ const BYTE* p2 = p1;
p1 += mnBPP;
// use left pixels
do
- *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
+ *p1 = static_cast<BYTE>( *p1 + *(p2++) );
while( ++p1 < pScanEnd );
}
break;
case 2: // Scanline Filter Type "Up"
{
- sal_uInt8* p1 = mpInflateInBuf + 1;
- const sal_uInt8* p2 = mpScanPrior + 1;
+ BYTE* p1 = mpInflateInBuf + 1;
+ const BYTE* p2 = mpScanPrior + 1;
// use pixels from prior line
while( p1 < pScanEnd )
{
- *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
+ *p1 = static_cast<BYTE>( *p1 + *(p2++) );
++p1;
}
}
@@ -1060,18 +1083,18 @@ void PNGReaderImpl::ImplApplyFilter()
case 3: // Scanline Filter Type "Average"
{
- sal_uInt8* p1 = mpInflateInBuf + 1;
- const sal_uInt8* p2 = mpScanPrior + 1;
- const sal_uInt8* p3 = p1;
+ BYTE* p1 = mpInflateInBuf + 1;
+ const BYTE* p2 = mpScanPrior + 1;
+ const BYTE* p3 = p1;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1, ++p2)
- *p1 = static_cast<sal_uInt8>( *p1 + (*p2 >> 1) );
+ *p1 = static_cast<BYTE>( *p1 + (*p2 >> 1) );
// predict by averaging the left and prior line pixels
while( p1 < pScanEnd )
{
- *p1 = static_cast<sal_uInt8>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
+ *p1 = static_cast<BYTE>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
++p1;
}
}
@@ -1079,14 +1102,14 @@ void PNGReaderImpl::ImplApplyFilter()
case 4: // Scanline Filter Type "PaethPredictor"
{
- sal_uInt8* p1 = mpInflateInBuf + 1;
- const sal_uInt8* p2 = mpScanPrior + 1;
- const sal_uInt8* p3 = p1;
- const sal_uInt8* p4 = p2;
+ BYTE* p1 = mpInflateInBuf + 1;
+ const BYTE* p2 = mpScanPrior + 1;
+ const BYTE* p3 = p1;
+ const BYTE* p4 = p2;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1)
- *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
+ *p1 = static_cast<BYTE>( *p1 + *(p2++) );
// predict by using the left and the prior line pixels
while( p1 < pScanEnd )
@@ -1111,7 +1134,7 @@ void PNGReaderImpl::ImplApplyFilter()
if( npa > npc )
na = nc;
- *p1 = static_cast<sal_uInt8>( *p1 + na );
+ *p1 = static_cast<BYTE>( *p1 + na );
++p1;
}
}
@@ -1137,7 +1160,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 sal_uInt8* pTmp = mpInflateInBuf + 1;
+ const BYTE* pTmp = mpInflateInBuf + 1;
if ( mpAcc->HasPalette() ) // alphachannel is not allowed by pictures including palette entries
{
switch ( mpAcc->GetBitCount() )
@@ -1148,12 +1171,12 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nShift = 0; nX < maOrigSize.Width(); nX += nXAdd )
{
- sal_uInt8 nCol;
+ BYTE nCol;
nShift = (nShift - 1) & 7;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
+ nCol = static_cast<BYTE>( *pTmp >> nShift );
nCol &= 1;
ImplSetAlphaPixel( nY, nX, nCol, mpTransTab[ nCol ] );
@@ -1165,11 +1188,11 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
nShift = (nShift - 1) & 7;
- sal_uInt8 nCol;
+ BYTE nCol;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
+ nCol = static_cast<BYTE>( *pTmp >> nShift );
nCol &= 1;
ImplSetPixel( nY, nX, nCol );
@@ -1182,7 +1205,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
if ( mbTransparent )
{
- if ( mnPngDepth == 4 ) // check if source has a two bit pixel format
+ if ( mnPngDepth == 4 ) // check if source has a two bit pixel format
{
for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, ++nXIndex )
{
@@ -1201,7 +1224,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, nXIndex++ )
{
- sal_uInt8 nCol;
+ BYTE nCol;
switch( nXIndex & 3 )
{
case 0 :
@@ -1231,7 +1254,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
}
else
{
- if ( mnPngDepth == 4 ) // maybe the source is a two bitmap graphic
+ if ( mnPngDepth == 4 ) // maybe the source is a two bitmap graphic
{ // BMP_FORMAT_4BIT_LSN_PAL
for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, nXIndex++ )
{
@@ -1273,7 +1296,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
if ( mbAlphaChannel )
{
- if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
+ if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
{
for ( sal_Int32 nX = nXStart; nX < maOrigSize.Width(); nX += nXAdd, pTmp += 2 )
ImplSetAlphaPixel( nY, nX, pTmp[ 0 ], pTmp[ 1 ] );
@@ -1286,7 +1309,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
}
else if ( mbTransparent )
{
- if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
+ if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
{
for ( sal_Int32 nX = nXStart; nX < maOrigSize.Width(); nX += nXAdd, pTmp++ )
ImplSetAlphaPixel( nY, nX, *pTmp, mpTransTab[ *pTmp ] );
@@ -1299,7 +1322,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
}
else // neither alpha nor transparency
{
- if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
+ if ( mnPngDepth == 8 ) // maybe the source is a 16 bit grayscale
{
if( nXAdd == 1 && mnPreviewShift == 0 ) // copy raw line data if possible
{
@@ -1323,7 +1346,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
break;
default :
- mbStatus = sal_False;
+ mbStatus = FALSE;
break;
}
}
@@ -1449,7 +1472,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColo
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIndex )
+void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, BYTE nPalIndex )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1461,7 +1484,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIn
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, sal_Bool bTrans )
+void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, BOOL bTrans )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1479,7 +1502,7 @@ void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const Bitm
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- sal_uInt8 nPalIndex, sal_uInt8 nAlpha )
+ BYTE nPalIndex, BYTE nAlpha )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1493,7 +1516,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- const BitmapColor& rBitmapColor, sal_uInt8 nAlpha )
+ const BitmapColor& rBitmapColor, BYTE 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 b87457c35054..4b394aea5d6d 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -78,68 +78,68 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData = NULL );
~PNGWriterImpl();
- sal_Bool Write( SvStream& rOStm );
+ sal_Bool Write( SvStream& rOStm );
- std::vector< vcl::PNGWriter::ChunkData >& GetChunks();
+ std::vector< vcl::PNGWriter::ChunkData >& GetChunks();
private:
- std::vector< vcl::PNGWriter::ChunkData > maChunkSeq;
-
- sal_Int32 mnCompLevel;
- sal_Int32 mnInterlaced;
- sal_uInt32 mnMaxChunkSize;
- sal_Bool mbStatus;
-
- BitmapReadAccess* mpAccess;
- BitmapReadAccess* mpMaskAccess;
- ZCodec* mpZCodec;
-
- 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;
- sal_uLong mnLastPercent;
-
- void ImplWritepHYs( const BitmapEx& rBitmapEx );
- void ImplWriteIDAT();
- sal_uLong ImplGetFilter( sal_uLong nY, sal_uLong nXStart=0, sal_uLong nXAdd=1 );
- void ImplClearFirstScanline();
- void ImplWriteTransparent();
- sal_Bool ImplWriteHeader();
- void ImplWritePalette();
- 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;
+ std::vector< vcl::PNGWriter::ChunkData > maChunkSeq;
+
+ sal_Int32 mnCompLevel;
+ sal_Int32 mnInterlaced;
+ sal_uInt32 mnMaxChunkSize;
+ 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;
+ long mnChunkDatSize;
+ ULONG mnLastPercent;
+
+ void ImplWritepHYs( const BitmapEx& rBitmapEx );
+ void ImplWriteIDAT();
+ ULONG ImplGetFilter( ULONG nY, ULONG nXStart=0, ULONG nXAdd=1 );
+ void ImplClearFirstScanline();
+ void ImplWriteTransparent();
+ BOOL ImplWriteHeader();
+ void ImplWritePalette();
+ void ImplOpenChunk( ULONG nChunkType );
+ void ImplWriteChunk( BYTE nNumb );
+ void ImplWriteChunk( sal_uInt32 nNumb );
+ void ImplWriteChunk( unsigned char* pSource, sal_uInt32 nDatSize );
+ void ImplCloseChunk( void );
};
// ------------------------------------------------------------------------
PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData ) :
- mnCompLevel ( PNG_DEF_COMPRESSION ),
- mbStatus ( sal_True ),
- mpAccess ( NULL ),
- mpMaskAccess ( NULL ),
- mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
+ mnCompLevel ( PNG_DEF_COMPRESSION ),
+ mbStatus ( TRUE ),
+ mpAccess ( NULL ),
+ mpMaskAccess ( NULL ),
+ mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
mnCRC(0UL),
- mnLastPercent ( 0UL )
+ mnLastPercent ( 0UL )
{
if ( !rBmpEx.IsEmpty() )
{
Bitmap aBmp( rBmpEx.GetBitmap() );
-
- mnInterlaced = 0; // ( aBmp.GetSizePixel().Width() > 128 ) || ( aBmp.GetSizePixel().Height() > 128 ) ? 1 : 0; #i67236#
+
+ mnInterlaced = 0; // ( aBmp.GetSizePixel().Width() > 128 ) || ( aBmp.GetSizePixel().Height() > 128 ) ? 1 : 0; #i67236#
// #i67234# defaulting max chunk size to 256kb when using interlace mode
mnMaxChunkSize = mnInterlaced == 0 ? std::numeric_limits< sal_uInt32 >::max() : 0x40000;
@@ -149,11 +149,11 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
sal_Int32 i = 0;
for ( i = 0; i < pFilterData->getLength(); i++ )
{
- if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Compression" ) ) )
+ if ( (*pFilterData)[ i ].Name.equalsAscii( "Compression" ) )
(*pFilterData)[ i ].Value >>= mnCompLevel;
- else if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Interlaced" ) ) )
+ else if ( (*pFilterData)[ i ].Name.equalsAscii( "Interlaced" ) )
(*pFilterData)[ i ].Value >>= mnInterlaced;
- else if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MaxChunkSize" ) ) )
+ else if ( (*pFilterData)[ i ].Name.equalsAscii( "MaxChunkSize" ) )
{
sal_Int32 nVal = 0;
if ( (*pFilterData)[ i ].Value >>= nVal )
@@ -161,8 +161,8 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
}
}
}
- mnBitsPerPixel = (sal_uInt8)aBmp.GetBitCount();
-
+ mnBitsPerPixel = (BYTE)aBmp.GetBitCount();
+
if( rBmpEx.IsTransparent() )
{
if ( mnBitsPerPixel <= 8 && rBmpEx.IsAlpha() )
@@ -170,8 +170,8 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.Convert( BMP_CONVERSION_24BIT );
mnBitsPerPixel = 24;
}
-
- if ( mnBitsPerPixel <= 8 ) // transparent palette
+
+ if ( mnBitsPerPixel <= 8 ) // transparent palette
{
aBmp.Convert( BMP_CONVERSION_8BIT_TRANS );
aBmp.Replace( rBmpEx.GetMask(), BMP_COL_TRANS );
@@ -189,14 +189,14 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
}
else
{
- mpAccess = aBmp.AcquireReadAccess(); // sal_True RGB with alphachannel
+ mpAccess = aBmp.AcquireReadAccess(); // TRUE RGB with alphachannel
if( mpAccess )
{
- if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != sal_False )
+ if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != FALSE )
{
AlphaMask aMask( rBmpEx.GetAlpha() );
mpMaskAccess = aMask.AcquireReadAccess();
@@ -210,7 +210,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
}
else
{
@@ -226,17 +226,17 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
}
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
}
}
else
{
- mpAccess = aBmp.AcquireReadAccess(); // palette + RGB without alphachannel
+ mpAccess = aBmp.AcquireReadAccess(); // palette + RGB without alphachannel
if( mpAccess )
{
if ( ImplWriteHeader() )
@@ -250,11 +250,11 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
}
if ( mbStatus )
{
- ImplOpenChunk( PNGCHUNK_IEND ); // create an IEND chunk
+ ImplOpenChunk( PNGCHUNK_IEND ); // create an IEND chunk
ImplCloseChunk();
}
}
@@ -309,7 +309,7 @@ std::vector< vcl::PNGWriter::ChunkData >& PNGWriterImpl::GetChunks()
// ------------------------------------------------------------------------
-sal_Bool PNGWriterImpl::ImplWriteHeader()
+BOOL PNGWriterImpl::ImplWriteHeader()
{
ImplOpenChunk(PNGCHUNK_IHDR);
ImplWriteChunk( sal_uInt32( mnWidth = mpAccess->Width() ) );
@@ -317,16 +317,16 @@ sal_Bool PNGWriterImpl::ImplWriteHeader()
if ( mnWidth && mnHeight && mnBitsPerPixel && mbStatus )
{
- sal_uInt8 nBitDepth = mnBitsPerPixel;
+ BYTE nBitDepth = mnBitsPerPixel;
if ( mnBitsPerPixel <= 8 )
mnFilterType = 0;
else
mnFilterType = 4;
- sal_uInt8 nColorType = 2; // colortype:
+ BYTE nColorType = 2; // colortype:
// bit 0 -> palette is used
- if ( mpAccess->HasPalette() ) // bit 1 -> color is used
- nColorType |= 1; // bit 2 -> alpha channel is used
+ if ( mpAccess->HasPalette() ) // bit 1 -> color is used
+ nColorType |= 1; // bit 2 -> alpha channel is used
else
nBitDepth /= 3;
@@ -334,14 +334,14 @@ sal_Bool PNGWriterImpl::ImplWriteHeader()
nColorType |= 4;
ImplWriteChunk( nBitDepth );
- ImplWriteChunk( nColorType ); // colortype
- ImplWriteChunk((sal_uInt8) 0 ); // compression type
- ImplWriteChunk((sal_uInt8) 0 ); // filter type - is not supported in this version
- ImplWriteChunk((sal_uInt8) mnInterlaced ); // interlace type
+ ImplWriteChunk( nColorType ); // colortype
+ ImplWriteChunk((BYTE) 0 ); // compression type
+ ImplWriteChunk((BYTE) 0 ); // filter type - is not supported in this version
+ ImplWriteChunk((BYTE) mnInterlaced ); // interlace type
ImplCloseChunk();
}
else
- mbStatus = sal_False;
+ mbStatus = FALSE;
return mbStatus;
}
@@ -349,13 +349,13 @@ sal_Bool PNGWriterImpl::ImplWriteHeader()
void PNGWriterImpl::ImplWritePalette()
{
- const sal_uLong nCount = mpAccess->GetPaletteEntryCount();
- sal_uInt8* pTempBuf = new sal_uInt8[ nCount*3 ];
- sal_uInt8* pTmp = pTempBuf;
+ const ULONG nCount = mpAccess->GetPaletteEntryCount();
+ BYTE* pTempBuf = new BYTE[ nCount*3 ];
+ BYTE* pTmp = pTempBuf;
ImplOpenChunk( PNGCHUNK_PLTE );
- for ( sal_uInt16 i = 0; i < nCount; i++ )
+ for ( USHORT 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 sal_uLong nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
+ const ULONG nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
ImplOpenChunk( PNGCHUNK_tRNS );
- for ( sal_uLong n = 0UL; n <= nTransIndex; n++ )
- ImplWriteChunk( ( nTransIndex == n ) ? (sal_uInt8) 0x0 : (sal_uInt8) 0xff );
+ for ( ULONG n = 0UL; n <= nTransIndex; n++ )
+ ImplWriteChunk( ( nTransIndex == n ) ? (BYTE) 0x0 : (BYTE) 0xff );
ImplCloseChunk();
}
@@ -415,12 +415,12 @@ void PNGWriterImpl::ImplWriteIDAT ()
mnDeflateInSize = mnBBP * mnWidth + 1;
- mpDeflateInBuf = new sal_uInt8[ mnDeflateInSize ];
+ mpDeflateInBuf = new BYTE[ mnDeflateInSize ];
- if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
+ if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
{
- mpPreviousScan = new sal_uInt8[ mnDeflateInSize ];
- mpCurrentScan = new sal_uInt8[ mnDeflateInSize ];
+ mpPreviousScan = new BYTE[ mnDeflateInSize ];
+ mpCurrentScan = new BYTE[ mnDeflateInSize ];
ImplClearFirstScanline();
}
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT + mnCompLevel );
@@ -428,44 +428,44 @@ void PNGWriterImpl::ImplWriteIDAT ()
SvMemoryStream aOStm;
if ( mnInterlaced == 0 )
{
- for ( sal_uLong nY = 0; nY < mnHeight; nY++ )
+ for ( ULONG nY = 0; nY < mnHeight; nY++ )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter( nY ) );
}
else
{
// interlace mode
- sal_uLong nY;
- for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 1
+ ULONG nY;
+ for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 1
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 8 ) );
ImplClearFirstScanline();
- for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 2
+ for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 2
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 4, 8 ) );
ImplClearFirstScanline();
- if ( mnHeight >= 5 ) // pass 3
+ if ( mnHeight >= 5 ) // pass 3
{
for ( nY = 4; nY < mnHeight; nY+=8 )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 4 ) );
ImplClearFirstScanline();
}
- for ( nY = 0; nY < mnHeight; nY+=4 ) // pass 4
+ for ( nY = 0; nY < mnHeight; nY+=4 ) // pass 4
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 2, 4 ) );
ImplClearFirstScanline();
- if ( mnHeight >= 3 ) // pass 5
+ if ( mnHeight >= 3 ) // pass 5
{
for ( nY = 2; nY < mnHeight; nY+=4 )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 2 ) );
ImplClearFirstScanline();
}
- for ( nY = 0; nY < mnHeight; nY+=2 ) // pass 6
+ for ( nY = 0; nY < mnHeight; nY+=2 ) // pass 6
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 1, 2 ) );
ImplClearFirstScanline();
- if ( mnHeight >= 2 ) // pass 7
+ if ( mnHeight >= 2 ) // pass 7
{
for ( nY = 1; nY < mnHeight; nY+=2 )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 1 ) );
@@ -474,7 +474,7 @@ void PNGWriterImpl::ImplWriteIDAT ()
mpZCodec->EndCompression();
mnCRC = mpZCodec->GetCRC();
- if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
+ if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
{
delete[] mpCurrentScan;
delete[] mpPreviousScan;
@@ -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!
-sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uLong nXAdd )
+ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
- sal_uInt8* pDest;
+ BYTE* pDest;
if ( mnFilterType )
pDest = mpCurrentScan;
@@ -509,38 +509,38 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
if ( nXStart < mnWidth )
{
- *pDest++ = mnFilterType; // in this version the filter type is either 0 or 4
+ *pDest++ = mnFilterType; // in this version the filter type is either 0 or 4
- if ( mpAccess->HasPalette() ) // alphachannel is not allowed by pictures including palette entries
+ if ( mpAccess->HasPalette() ) // alphachannel is not allowed by pictures including palette entries
{
switch ( mnBitsPerPixel )
{
case( 1 ):
{
- sal_uLong nX, nXIndex;
+ ULONG nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+=nXAdd, nXIndex++ )
{
- sal_uLong nShift = ( nXIndex & 7 ) ^ 7;
+ ULONG nShift = ( nXIndex & 7 ) ^ 7;
if ( nShift == 7)
- *pDest = (sal_uInt8)(mpAccess->GetPixel( nY, nX ) << nShift);
+ *pDest = (BYTE)(mpAccess->GetPixel( nY, nX ) << nShift);
else if ( nShift == 0 )
- *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
else
- *pDest |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
}
- if ( ( nXIndex & 7 ) != 0 ) pDest++; // byte is not completely used, so the
- } // bufferpointer is to correct
+ if ( ( nXIndex & 7 ) != 0 ) pDest++; // byte is not completely used, so the
+ } // bufferpointer is to correct
break;
case( 4 ):
{
- sal_uLong nX, nXIndex;
+ ULONG nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+= nXAdd, nXIndex++ )
{
if( nXIndex & 1 )
- *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX );
+ *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX );
else
- *pDest = (sal_uInt8) mpAccess->GetPixel( nY, nX ) << 4;
+ *pDest = (BYTE) mpAccess->GetPixel( nY, nX ) << 4;
}
if ( nXIndex & 1 ) pDest++;
}
@@ -548,23 +548,23 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
case( 8 ):
{
- for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
*pDest++ = mpAccess->GetPixel( nY, nX );
}
break;
default :
- mbStatus = sal_False;
+ mbStatus = FALSE;
break;
}
}
else
{
- if ( mpMaskAccess ) // mpMaskAccess != NULL -> alphachannel is to create
+ if ( mpMaskAccess ) // mpMaskAccess != NULL -> alphachannel is to create
{
if ( mbTrueAlpha )
{
- for ( sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd )
+ for ( ULONG nX = nXStart; nX < mnWidth; nX += nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -577,7 +577,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
{
const BitmapColor aTrans( mpMaskAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
- for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -593,7 +593,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
}
else
{
- for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -608,15 +608,15 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
{
mnDeflateInSize = pDest - mpCurrentScan;
pDest = mpDeflateInBuf;
- *pDest++ = 4; // filter type
+ *pDest++ = 4; // filter type
- sal_uLong na, nb, nc;
+ ULONG na, nb, nc;
long np, npa, npb, npc;
- 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;
+ BYTE* p1 = mpCurrentScan + 1; // Current Pixel
+ BYTE* p2 = p1 - mnBBP; // left pixel
+ BYTE* p3 = mpPreviousScan; // upper pixel
+ BYTE* p4 = p3 - mnBBP; // upperleft Pixel;
while ( pDest < mpDeflateInBuf + mnDeflateInSize )
{
@@ -640,9 +640,9 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
npb =-npb;
if ( npc < 0 )
npc =-npc;
- 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;
+ if ( ( npa <= npb ) && ( npa <= npc ) ) *pDest++ = *p1++ - (BYTE)na;
+ else if ( npb <= npc ) *pDest++ = *p1++ - (BYTE)nb;
+ else *pDest++ = *p1++ - (BYTE)nc;
p4++;
p2++;
}
@@ -664,7 +664,7 @@ void PNGWriterImpl::ImplClearFirstScanline()
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplOpenChunk ( sal_uLong nChunkType )
+void PNGWriterImpl::ImplOpenChunk ( ULONG nChunkType )
{
maChunkSeq.resize( maChunkSeq.size() + 1 );
maChunkSeq.back().nType = nChunkType;
@@ -672,7 +672,7 @@ void PNGWriterImpl::ImplOpenChunk ( sal_uLong nChunkType )
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplWriteChunk ( sal_uInt8 nSource )
+void PNGWriterImpl::ImplWriteChunk ( BYTE nSource )
{
maChunkSeq.back().aData.push_back( nSource );
}
@@ -699,7 +699,7 @@ void PNGWriterImpl::ImplWriteChunk ( unsigned char* pSource, sal_uInt32 nDatSize
// ------------------------------------------------------------------------
// nothing to do
-void PNGWriterImpl::ImplCloseChunk ( void ) const
+void PNGWriterImpl::ImplCloseChunk ( void )
{
}
diff --git a/vcl/source/gdi/polyscan.cxx b/vcl/source/gdi/polyscan.cxx
index 81d05bf33354..4ae653857fdc 100644
--- a/vcl/source/gdi/polyscan.cxx
+++ b/vcl/source/gdi/polyscan.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,11 +40,11 @@
// ----------------
PolyScanline::PolyScanline() :
- mpFirst ( NULL ),
- mpLast ( NULL ),
- mpAct ( NULL ),
- mnLeft ( 0L ),
- mnRight ( 0L )
+ mpFirst ( NULL ),
+ mpLast ( NULL ),
+ mpAct ( NULL ),
+ mnLeft ( 0L ),
+ mnRight ( 0L )
{
}
@@ -90,7 +90,7 @@ void PolyScanline::Insert( long nX )
{
ScanlinePoint* pLast = mpFirst;
ScanlinePoint* pAct = mpFirst->mpNext;
-
+
while( pAct )
{
// insert in the midlle of the scanline?
@@ -99,10 +99,10 @@ void PolyScanline::Insert( long nX )
pLast->mpNext = new ScanlinePoint( nX, pAct );
break;
}
-
+
pLast = pAct;
pAct = pAct->mpNext;
- }
+ }
}
}
}
@@ -122,9 +122,9 @@ void PolyScanline::Set( long nStart, long nEnd )
// ------------------------------------------------------------------------
-sal_Bool PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
+BOOL PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
{
- sal_Bool bRet = GetFirstX( rSegment.mnStart );
+ BOOL bRet = GetFirstX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -134,9 +134,9 @@ sal_Bool PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
// ------------------------------------------------------------------------
-sal_Bool PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
+BOOL PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
{
- sal_Bool bRet = GetNextX( rSegment.mnStart );
+ BOOL bRet = GetNextX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -152,8 +152,8 @@ PolyScanner::PolyScanner( const Rectangle& rRect )
{
if( !rRect.IsEmpty() )
{
- Rectangle aRect( rRect );
- sal_uLong nHeight;
+ Rectangle aRect( rRect );
+ 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( sal_uLong i = 0UL; i < nHeight; i++ )
+ for( ULONG i = 0UL; i < nHeight; i++ )
mpArray[ i ].Set( mnLeft, mnRight );
}
else
@@ -180,12 +180,12 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
if( nCount )
{
- long nLast = nCount - 1;
- Point aFirst( rPoly[ 0 ] );
- Point aLast( rPoly[ (sal_uInt16) nLast ] );
+ long nLast = nCount - 1;
+ Point aFirst( rPoly[ 0 ] );
+ Point aLast( rPoly[ (USHORT) nLast ] );
while( nLast && ( aLast == aFirst ) )
- aLast = rPoly[ (sal_uInt16) --nLast ];
+ aLast = rPoly[ (USHORT) --nLast ];
if( !nLast )
{
@@ -198,10 +198,10 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
else
{
const Rectangle aRect( rPoly.GetBoundRect() );
- sal_uLong nHeight;
+ ULONG nHeight;
mnLeft = aRect.Left();
- mnTop = aRect.Top();
+ mnTop = aRect.Top();
mnRight = aRect.Right();
mnBottom = aRect.Bottom();
aLast = aFirst;
@@ -209,7 +209,7 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
for( long i = 1L; i <= nLast; i++ )
{
- const Point& rPt = rPoly[ (sal_uInt16) i ];
+ const Point& rPt = rPoly[ (USHORT) i ];
if( rPt != aLast )
{
@@ -241,7 +241,7 @@ PolyScanner::~PolyScanner()
// ------------------------------------------------------------------------
-PolyScanline* PolyScanner::operator[]( sal_uLong nPos ) const
+PolyScanline* PolyScanner::operator[]( ULONG nPos ) const
{
DBG_ASSERT( nPos < Count(), "nPos out of range!" );
return( mpArray ? ( mpArray + nPos ) : NULL );
@@ -268,21 +268,21 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nY++ - mnTop ].Insert( nX );
else
while( nY > nEndY )
- mpArray[ nY-- - mnTop ].Insert( nX );
+ mpArray[ nY-- - mnTop ].Insert( nX );
}
else
{
const long nDX = labs( rEnd.X() - rStart.X() );
const long nDY = labs( rEnd.Y() - rStart.Y() );
- const long nStartX = rStart.X();
- const long nStartY = rStart.Y();
- const long nEndX = rEnd.X();
- const long nEndY = rEnd.Y();
- const long nXInc = ( nStartX < nEndX ) ? 1L : -1L;
- const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
- long nLastX = nStartX;
- long nLastY = nStartY;
- sal_Bool bLast = sal_False;
+ const long nStartX = rStart.X();
+ const long nStartY = rStart.Y();
+ const long nEndX = rEnd.X();
+ const long nEndY = rEnd.Y();
+ const long nXInc = ( nStartX < nEndX ) ? 1L : -1L;
+ const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
+ long nLastX = nStartX;
+ long nLastY = nStartY;
+ BOOL bLast = FALSE;
mpArray[ nStartY - mnTop ].Insert( nStartX );
@@ -300,14 +300,14 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = sal_False;
+ bLast = FALSE;
}
else
- bLast = sal_True;
+ bLast = TRUE;
nLastX = nX;
nLastY = nY;
-
+
if( nD < 0L )
nD += nDY2;
else
@@ -333,10 +333,10 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = sal_False;
+ bLast = FALSE;
}
else
- bLast = sal_True;
+ bLast = TRUE;
nLastX = nX;
nLastY = nY;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 15964d9da09f..27d6b9f19b24 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,6 @@
#include <vcl/unohelp.hxx>
#include <tools/debug.hxx>
-#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <vcl/svdata.hxx>
@@ -54,18 +53,11 @@
#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;
@@ -118,16 +110,16 @@ void ImplUpdateJobSetupPaper( JobSetup& rJobSetup )
// ------------------
PrinterOptions::PrinterOptions() :
- mbReduceTransparency( sal_False ),
+ mbReduceTransparency( FALSE ),
meReducedTransparencyMode( PRINTER_TRANSPARENCY_AUTO ),
- mbReduceGradients( sal_False ),
+ mbReduceGradients( FALSE ),
meReducedGradientsMode( PRINTER_GRADIENT_STRIPES ),
mnReducedGradientStepCount( 64 ),
- mbReduceBitmaps( sal_False ),
+ mbReduceBitmaps( FALSE ),
meReducedBitmapMode( PRINTER_BITMAP_NORMAL ),
mnReducedBitmapResolution( 200 ),
- mbReducedBitmapsIncludeTransparency( sal_True ),
- mbConvertToGreyscales( sal_False )
+ mbReducedBitmapsIncludeTransparency( TRUE ),
+ mbConvertToGreyscales( FALSE )
{
}
@@ -137,113 +129,14 @@ 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 -
// -------------
QueueInfo::QueueInfo()
{
- mnStatus = 0;
- mnJobs = 0;
+ mnStatus = 0;
+ mnJobs = 0;
}
// -----------------------------------------------------------------------
@@ -269,12 +162,12 @@ QueueInfo::~QueueInfo()
bool QueueInfo::operator==( const QueueInfo& rInfo ) const
{
return
- maPrinterName == rInfo.maPrinterName &&
- maDriver == rInfo.maDriver &&
- maLocation == rInfo.maLocation &&
- maComment == rInfo.maComment &&
- mnStatus == rInfo.mnStatus &&
- mnJobs == rInfo.mnJobs;
+ maPrinterName == rInfo.maPrinterName &&
+ maDriver == rInfo.maDriver &&
+ maLocation == rInfo.maLocation &&
+ maComment == rInfo.maComment &&
+ mnStatus == rInfo.mnStatus &&
+ mnJobs == rInfo.mnJobs;
}
// -----------------------------------------------------------------------
@@ -313,9 +206,9 @@ SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo )
SalPrinterQueueInfo::SalPrinterQueueInfo()
{
- mnStatus = 0;
- mnJobs = QUEUE_JOBS_DONTKNOW;
- mpSysData = NULL;
+ mnStatus = 0;
+ mnJobs = QUEUE_JOBS_DONTKNOW;
+ mpSysData = NULL;
}
// -----------------------------------------------------------------------
@@ -328,7 +221,7 @@ SalPrinterQueueInfo::~SalPrinterQueueInfo()
ImplPrnQueueList::~ImplPrnQueueList()
{
- ImplSVData* pSVData = ImplGetSVData();
+ ImplSVData* pSVData = ImplGetSVData();
for( unsigned int i = 0; i < m_aQueueInfos.size(); i++ )
{
delete m_aQueueInfos[i].mpQueueInfo;
@@ -340,7 +233,7 @@ ImplPrnQueueList::~ImplPrnQueueList()
void ImplPrnQueueList::Add( SalPrinterQueueInfo* pData )
{
- boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash >::iterator it =
+ std::hash_map< rtl::OUString, sal_Int32, rtl::OUStringHash >::iterator it =
m_aNameToIndex.find( pData->maPrinterName );
if( it == m_aNameToIndex.end() )
{
@@ -365,7 +258,7 @@ void ImplPrnQueueList::Add( SalPrinterQueueInfo* pData )
ImplPrnQueueData* ImplPrnQueueList::Get( const rtl::OUString& rPrinter )
{
ImplPrnQueueData* pData = NULL;
- boost::unordered_map<rtl::OUString,sal_Int32,rtl::OUStringHash>::iterator it =
+ std::hash_map<rtl::OUString,sal_Int32,rtl::OUStringHash>::iterator it =
m_aNameToIndex.find( rPrinter );
if( it != m_aNameToIndex.end() )
pData = &m_aQueueInfos[it->second];
@@ -389,8 +282,8 @@ static void ImplInitPrnQueueList()
void ImplDeletePrnQueueList()
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList;
+ ImplSVData* pSVData = ImplGetSVData();
+ ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList;
if ( pPrnList )
{
@@ -403,9 +296,9 @@ void ImplDeletePrnQueueList()
const std::vector<rtl::OUString>& Printer::GetPrinterQueues()
{
- ImplSVData* pSVData = ImplGetSVData();
+ ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maGDIData.mpPrinterQueueList )
- ImplInitPrnQueueList();
+ ImplInitPrnQueueList();
return pSVData->maGDIData.mpPrinterQueueList->m_aPrinterList;
}
@@ -422,16 +315,16 @@ const QueueInfo* Printer::GetQueueInfo( const String& rPrinterName, bool bStatus
{
if( !pInfo->mpQueueInfo || bStatusUpdate )
pSVData->mpDefInst->GetPrinterQueueState( pInfo->mpSalQueueInfo );
-
+
if ( !pInfo->mpQueueInfo )
pInfo->mpQueueInfo = new QueueInfo;
-
- pInfo->mpQueueInfo->maPrinterName = pInfo->mpSalQueueInfo->maPrinterName;
- pInfo->mpQueueInfo->maDriver = pInfo->mpSalQueueInfo->maDriver;
- pInfo->mpQueueInfo->maLocation = pInfo->mpSalQueueInfo->maLocation;
- pInfo->mpQueueInfo->maComment = pInfo->mpSalQueueInfo->maComment;
- pInfo->mpQueueInfo->mnStatus = pInfo->mpSalQueueInfo->mnStatus;
- pInfo->mpQueueInfo->mnJobs = pInfo->mpSalQueueInfo->mnJobs;
+
+ pInfo->mpQueueInfo->maPrinterName = pInfo->mpSalQueueInfo->maPrinterName;
+ pInfo->mpQueueInfo->maDriver = pInfo->mpSalQueueInfo->maDriver;
+ pInfo->mpQueueInfo->maLocation = pInfo->mpSalQueueInfo->maLocation;
+ pInfo->mpQueueInfo->maComment = pInfo->mpSalQueueInfo->maComment;
+ pInfo->mpQueueInfo->mnStatus = pInfo->mpSalQueueInfo->mnStatus;
+ pInfo->mpQueueInfo->mnJobs = pInfo->mpSalQueueInfo->mnJobs;
return pInfo->mpQueueInfo;
}
return NULL;
@@ -445,34 +338,34 @@ XubString Printer::GetDefaultPrinterName()
if( !pEnv || !*pEnv )
{
ImplSVData* pSVData = ImplGetSVData();
-
+
return pSVData->mpDefInst->GetDefaultPrinter();
}
- return XubString();
+ return XubString();
}
// =======================================================================
void Printer::ImplInitData()
{
- mbDevOutput = sal_False;
- meOutDevType = OUTDEV_PRINTER;
- mbDefPrinter = sal_False;
- mnError = 0;
- mnCurPage = 0;
- mnCurPrintPage = 0;
- mnPageQueueSize = 0;
- mnCopyCount = 1;
- 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 = sal_False;
+ mbDevOutput = FALSE;
+ meOutDevType = OUTDEV_PRINTER;
+ mbDefPrinter = FALSE;
+ mnError = 0;
+ mnCurPage = 0;
+ mnCurPrintPage = 0;
+ mnPageQueueSize = 0;
+ mnCopyCount = 1;
+ mbCollateCopy = FALSE;
+ mbPrinting = FALSE;
+ mbJobActive = FALSE;
+ mbPrintFile = FALSE;
+ mbInPrintPage = FALSE;
+ mbNewJobSetup = FALSE;
+ mpInfoPrinter = NULL;
+ mpPrinter = NULL;
+ mpDisplayDev = NULL;
+ mbIsQueuePrinter = FALSE;
mpPrinterOptions = new PrinterOptions;
// Printer in die Liste eintragen
@@ -516,9 +409,9 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
pJobSetup->maPrinterName = maPrinterName;
pJobSetup->maDriver = maDriver;
- mpInfoPrinter = pSVData->mpDefInst->CreateInfoPrinter( pInfo, pJobSetup );
- mpPrinter = NULL;
- mpJobGraphics = NULL;
+ mpInfoPrinter = pSVData->mpDefInst->CreateInfoPrinter( pInfo, pJobSetup );
+ mpPrinter = NULL;
+ mpJobGraphics = NULL;
ImplUpdateJobSetupPaper( maJobSetup );
if ( !mpInfoPrinter )
@@ -537,7 +430,7 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
// Daten initialisieren
ImplUpdatePageData();
mpFontList = new ImplDevFontList();
- mpFontCache = new ImplFontCache( sal_True );
+ mpFontCache = new ImplFontCache( TRUE );
mpGraphics->GetDevFontList( mpFontList );
}
@@ -547,18 +440,18 @@ void Printer::ImplInitDisplay( const Window* pWindow )
{
ImplSVData* pSVData = ImplGetSVData();
- mpInfoPrinter = NULL;
- mpPrinter = NULL;
- mpJobGraphics = NULL;
+ mpInfoPrinter = NULL;
+ mpPrinter = NULL;
+ mpJobGraphics = NULL;
if ( pWindow )
mpDisplayDev = new VirtualDevice( *pWindow );
else
mpDisplayDev = new VirtualDevice();
- mpFontList = pSVData->maGDIData.mpScreenFontList;
- mpFontCache = pSVData->maGDIData.mpScreenFontCache;
- mnDPIX = mpDisplayDev->mnDPIX;
- mnDPIY = mpDisplayDev->mnDPIY;
+ mpFontList = pSVData->maGDIData.mpScreenFontList;
+ mpFontCache = pSVData->maGDIData.mpScreenFontCache;
+ mnDPIX = mpDisplayDev->mnDPIX;
+ mnDPIY = mpDisplayDev->mnDPIY;
}
// -----------------------------------------------------------------------
@@ -646,7 +539,7 @@ void Printer::ImplUpdatePageData()
void Printer::ImplUpdateFontList()
{
- ImplUpdateFontData( sal_True );
+ ImplUpdateFontData( TRUE );
}
// -----------------------------------------------------------------------
@@ -659,7 +552,7 @@ Printer::Printer()
{
ImplInit( pInfo );
if ( !IsDisplayPrinter() )
- mbDefPrinter = sal_True;
+ mbDefPrinter = TRUE;
}
else
ImplInitDisplay( NULL );
@@ -777,57 +670,57 @@ void Printer::Compat_OldPrinterMetrics( bool bSet )
mpInfoPrinter->m_bCompatMetrics = bSet;
// get new font data
- ImplUpdateFontData( sal_True );
+ ImplUpdateFontData( TRUE );
}
// -----------------------------------------------------------------------
-sal_uLong Printer::GetCapabilities( sal_uInt16 nType ) const
+ULONG Printer::GetCapabilities( USHORT nType ) const
{
if ( IsDisplayPrinter() )
- return sal_False;
+ return FALSE;
if( mpInfoPrinter )
return mpInfoPrinter->GetCapabilities( maJobSetup.ImplGetConstData(), nType );
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::HasSupport( PrinterSupport eFeature ) const
+BOOL Printer::HasSupport( PrinterSupport eFeature ) const
{
switch ( eFeature )
{
case SUPPORT_SET_ORIENTATION:
- return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
+ return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
case SUPPORT_SET_PAPERBIN:
- return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
+ return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
case SUPPORT_SET_PAPERSIZE:
- return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
+ return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
case SUPPORT_SET_PAPER:
- return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPER );
+ return (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 (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
+ return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
case SUPPORT_FAX:
- return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_FAX );
+ return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_FAX );
case SUPPORT_PDF:
- return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_PDF );
+ return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_PDF );
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::SetJobSetup( const JobSetup& rSetup )
+BOOL Printer::SetJobSetup( const JobSetup& rSetup )
{
if ( IsDisplayPrinter() || mbInPrintPage )
- return sal_False;
+ return FALSE;
JobSetup aJobSetup = rSetup;
@@ -835,68 +728,68 @@ sal_Bool Printer::SetJobSetup( const JobSetup& rSetup )
if ( mpInfoPrinter->SetPrinterData( aJobSetup.ImplGetData() ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::Setup( Window* pWindow )
+BOOL Printer::Setup( Window* pWindow )
{
if ( IsDisplayPrinter() )
- return sal_False;
+ return FALSE;
if ( IsJobActive() || IsPrinting() )
- return sal_False;
+ return FALSE;
JobSetup aJobSetup = maJobSetup;
SalFrame* pFrame;
if ( !pWindow )
pWindow = ImplGetDefaultWindow();
if( !pWindow )
- return sal_False;
+ return FALSE;
pFrame = pWindow->ImplGetFrame();
ImplReleaseGraphics();
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mnModalMode++;
nImplSysDialog++;
- sal_Bool bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
+ BOOL bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
pSVData->maAppData.mnModalMode--;
nImplSysDialog--;
if ( bSetup )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
+BOOL Printer::SetPrinterProps( const Printer* pPrinter )
{
if ( IsJobActive() || IsPrinting() )
- return sal_False;
+ return FALSE;
ImplSVData* pSVData = ImplGetSVData();
- mbDefPrinter = pPrinter->mbDefPrinter;
- maPrintFile = pPrinter->maPrintFile;
- mbPrintFile = pPrinter->mbPrintFile;
- mnCopyCount = pPrinter->mnCopyCount;
- mbCollateCopy = pPrinter->mbCollateCopy;
+ mbDefPrinter = pPrinter->mbDefPrinter;
+ maPrintFile = pPrinter->maPrintFile;
+ mbPrintFile = pPrinter->mbPrintFile;
+ mnCopyCount = pPrinter->mnCopyCount;
+ mbCollateCopy = pPrinter->mbCollateCopy;
mnPageQueueSize = pPrinter->mnPageQueueSize;
*mpPrinterOptions = *pPrinter->mpPrinterOptions;
@@ -928,14 +821,14 @@ sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = sal_True;
- mbNewFont = sal_True;
+ mbInitFont = TRUE;
+ mbNewFont = TRUE;
mpInfoPrinter = NULL;
}
// Neuen Printer bauen
ImplInitDisplay( NULL );
- return sal_True;
+ return TRUE;
}
// Alten Printer zerstoeren?
@@ -970,8 +863,8 @@ sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
delete mpFontList;
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = sal_True;
- mbNewFont = sal_True;
+ mbInitFont = TRUE;
+ mbNewFont = TRUE;
mpInfoPrinter = NULL;
}
@@ -989,44 +882,44 @@ sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
else
SetJobSetup( pPrinter->GetJobSetup() );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::SetOrientation( Orientation eOrientation )
+BOOL Printer::SetOrientation( Orientation eOrientation )
{
if ( mbInPrintPage )
- return sal_False;
+ return FALSE;
if ( maJobSetup.ImplGetConstData()->meOrientation != eOrientation )
{
- JobSetup aJobSetup = maJobSetup;
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ JobSetup aJobSetup = maJobSetup;
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
pSetupData->meOrientation = eOrientation;
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
- return sal_True;
+ return TRUE;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1038,45 +931,45 @@ Orientation Printer::GetOrientation() const
// -----------------------------------------------------------------------
-sal_Bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
+BOOL Printer::SetPaperBin( USHORT nPaperBin )
{
if ( mbInPrintPage )
- return sal_False;
+ return FALSE;
if ( (maJobSetup.ImplGetConstData()->mnPaperBin != nPaperBin) &&
(nPaperBin < GetPaperBinCount()) )
{
- JobSetup aJobSetup = maJobSetup;
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ JobSetup aJobSetup = maJobSetup;
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
pSetupData->mnPaperBin = nPaperBin;
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
- return sal_True;
+ return TRUE;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERBIN, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_uInt16 Printer::GetPaperBin() const
+USHORT Printer::GetPaperBin() const
{
return maJobSetup.ImplGetConstData()->mnPaperBin;
}
@@ -1086,10 +979,10 @@ sal_uInt16 Printer::GetPaperBin() const
// Map user paper format to a available printer paper formats
void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNearest )
{
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
- int nLandscapeAngle = GetLandscapeAngle();
- int nPaperCount = GetPaperInfoCount();
+ int nLandscapeAngle = GetLandscapeAngle();
+ int nPaperCount = GetPaperInfoCount();
bool bFound = false;
PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
@@ -1133,7 +1026,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
}
}
}
-
+
if( ! bFound && bMatchNearest )
{
sal_Int64 nBestMatch = SAL_MAX_INT64;
@@ -1142,11 +1035,11 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
for( int i = 0; i < nPaperCount; i++ )
{
const PaperInfo& rPaperInfo = GetPaperInfo( i );
-
+
// check protrait match
sal_Int64 nDX = pSetupData->mnPaperWidth - rPaperInfo.getWidth();
sal_Int64 nDY = pSetupData->mnPaperHeight - rPaperInfo.getHeight();
- sal_Int64 nMatch = nDX*nDX + nDY*nDY;
+ sal_Int64 nMatch = nDX*nDX + nDY*nDY;
if( nMatch < nBestMatch )
{
nBestMatch = nMatch;
@@ -1174,15 +1067,15 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
// -----------------------------------------------------------------------
-sal_Bool Printer::SetPaper( Paper ePaper )
+BOOL Printer::SetPaper( Paper ePaper )
{
if ( mbInPrintPage )
- return sal_False;
+ return FALSE;
if ( maJobSetup.ImplGetConstData()->mePaperFormat != ePaper )
{
- JobSetup aJobSetup = maJobSetup;
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ JobSetup aJobSetup = maJobSetup;
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
pSetupData->mePaperFormat = ePaper;
if ( ePaper != PAPER_USER )
{
@@ -1193,9 +1086,9 @@ sal_Bool Printer::SetPaper( Paper ePaper )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
- return sal_True;
+ return TRUE;
}
ImplReleaseGraphics();
@@ -1204,48 +1097,48 @@ sal_Bool Printer::SetPaper( Paper ePaper )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Printer::SetPaperSizeUser( const Size& rSize )
+BOOL Printer::SetPaperSizeUser( const Size& rSize )
{
return SetPaperSizeUser( rSize, false );
}
-sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
+BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
{
if ( mbInPrintPage )
- return sal_False;
+ return FALSE;
- Size aPixSize = LogicToPixel( rSize );
- Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
- if ( (maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER) ||
+ Size aPixSize = LogicToPixel( rSize );
+ Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
+ if ( (maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER) ||
(maJobSetup.ImplGetConstData()->mnPaperWidth != aPageSize.Width()) ||
(maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height()) )
{
- JobSetup aJobSetup = maJobSetup;
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
- pSetupData->mePaperFormat = PAPER_USER;
- pSetupData->mnPaperWidth = aPageSize.Width();
- pSetupData->mnPaperHeight = aPageSize.Height();
+ JobSetup aJobSetup = maJobSetup;
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ pSetupData->mePaperFormat = PAPER_USER;
+ pSetupData->mnPaperWidth = aPageSize.Width();
+ pSetupData->mnPaperHeight = aPageSize.Height();
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
- return sal_True;
+ return TRUE;
}
ImplReleaseGraphics();
@@ -1255,17 +1148,17 @@ sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1281,48 +1174,6 @@ 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 )
@@ -1343,39 +1194,39 @@ DuplexMode Printer::GetDuplexMode() const
// -----------------------------------------------------------------------
-sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex )
+BOOL Printer::SetDuplexMode( DuplexMode eDuplex )
{
if ( mbInPrintPage )
- return sal_False;
+ return FALSE;
if ( maJobSetup.ImplGetConstData()->meDuplexMode != eDuplex )
{
- JobSetup aJobSetup = maJobSetup;
- ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+ JobSetup aJobSetup = maJobSetup;
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
pSetupData->meDuplexMode = eDuplex;
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
- return sal_True;
+ return TRUE;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_DUPLEXMODE, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = sal_True;
+ mbNewJobSetup = TRUE;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1394,17 +1245,17 @@ Paper Printer::GetPaper() const
// -----------------------------------------------------------------------
-sal_uInt16 Printer::GetPaperBinCount() const
+USHORT Printer::GetPaperBinCount() const
{
if ( IsDisplayPrinter() )
return 0;
- return (sal_uInt16)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
+ return (USHORT)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
}
// -----------------------------------------------------------------------
-XubString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
+XubString Printer::GetPaperBinName( USHORT nPaperBin ) const
{
if ( IsDisplayPrinter() )
return ImplGetSVEmptyStr();
@@ -1417,11 +1268,11 @@ XubString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
// -----------------------------------------------------------------------
-sal_Bool Printer::SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate )
+BOOL Printer::SetCopyCount( USHORT nCopy, BOOL bCollate )
{
mnCopyCount = nCopy;
mbCollateCopy = bCollate;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1434,9 +1285,9 @@ void Printer::Error()
// -----------------------------------------------------------------------
-sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
+ULONG Printer::ImplSalPrinterErrorCodeToVCL( ULONG nError )
{
- sal_uLong nVCLError;
+ ULONG nVCLError;
switch ( nError )
{
case 0:
@@ -1457,8 +1308,8 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
void Printer::ImplEndPrint()
{
- mbPrinting = sal_False;
- mnCurPrintPage = 0;
+ mbPrinting = FALSE;
+ mnCurPrintPage = 0;
maJobName.Erase();
}
@@ -1474,15 +1325,15 @@ IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter )
// -----------------------------------------------------------------------
-sal_Bool Printer::EndJob()
+BOOL Printer::EndJob()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if ( !IsJobActive() )
return bRet;
DBG_ASSERT( !mbInPrintPage, "Printer::EndJob() - StartPage() without EndPage() called" );
- mbJobActive = sal_False;
+ mbJobActive = FALSE;
if ( mpPrinter )
{
@@ -1490,13 +1341,13 @@ sal_Bool Printer::EndJob()
mnCurPage = 0;
- bRet = sal_True;
+ bRet = TRUE;
- mbPrinting = sal_False;
- mnCurPrintPage = 0;
+ mbPrinting = FALSE;
+ mnCurPrintPage = 0;
maJobName.Erase();
- mbDevOutput = sal_False;
+ mbDevOutput = FALSE;
bRet = mpPrinter->EndJob();
// Hier den Drucker nicht asyncron zerstoeren, da es
// W95 nicht verkraftet, wenn gleichzeitig gedruckt wird
@@ -1510,34 +1361,34 @@ sal_Bool Printer::EndJob()
// -----------------------------------------------------------------------
-sal_Bool Printer::AbortJob()
+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 sal_False;
+ return FALSE;
- mbJobActive = sal_False;
- mbInPrintPage = sal_False;
- mpJobGraphics = NULL;
+ mbJobActive = FALSE;
+ mbInPrintPage = FALSE;
+ mpJobGraphics = NULL;
if ( mpPrinter )
{
- mbPrinting = sal_False;
- mnCurPage = 0;
- mnCurPrintPage = 0;
+ mbPrinting = FALSE;
+ mnCurPage = 0;
+ mnCurPrintPage = 0;
maJobName.Erase();
ImplReleaseGraphics();
- mbDevOutput = sal_False;
+ mbDevOutput = FALSE;
mpPrinter->AbortJob();
Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter );
mpPrinter = NULL;
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1555,12 +1406,12 @@ void Printer::ImplStartPage()
ImplReleaseGraphics();
mpJobGraphics = pGraphics;
}
- mbDevOutput = sal_True;
+ mbDevOutput = TRUE;
// PrintJob not aborted ???
if ( IsJobActive() )
{
- mbInPrintPage = sal_True;
+ mbInPrintPage = TRUE;
mnCurPage++;
mnCurPrintPage++;
}
@@ -1574,16 +1425,16 @@ void Printer::ImplEndPage()
if ( !IsJobActive() )
return;
- mbInPrintPage = sal_False;
+ mbInPrintPage = FALSE;
if ( mpPrinter )
{
mpPrinter->EndPage();
ImplReleaseGraphics();
- mbDevOutput = sal_False;
+ mbDevOutput = FALSE;
mpJobGraphics = NULL;
- mbNewJobSetup = sal_False;
+ mbNewJobSetup = FALSE;
}
}
@@ -1591,14 +1442,14 @@ void Printer::ImplEndPage()
void Printer::updatePrinters()
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList;
+ ImplSVData* pSVData = ImplGetSVData();
+ ImplPrnQueueList* pPrnList = pSVData->maGDIData.mpPrinterQueueList;
if ( pPrnList )
{
ImplPrnQueueList* pNewList = new ImplPrnQueueList;
pSVData->mpDefInst->GetPrinterQueueInfo( pNewList );
-
+
bool bChanged = pPrnList->m_aQueueInfos.size() != pNewList->m_aQueueInfos.size();
for( unsigned int i = 0; ! bChanged && i < pPrnList->m_aQueueInfos.size(); i++ )
{
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 38c589eb12b2..b016bd9f13e5 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -67,7 +67,7 @@ typedef ::std::list< Component > ComponentList;
// List of (intersecting) actions, plus overall bounds
struct ConnectedComponents
{
- ConnectedComponents() :
+ ConnectedComponents() :
aComponentList(),
aBounds(),
aBgColor(COL_WHITE),
@@ -75,14 +75,14 @@ struct ConnectedComponents
bIsFullyTransparent(false)
{}
- ComponentList aComponentList;
- Rectangle aBounds;
+ ComponentList aComponentList;
+ Rectangle aBounds;
Color aBgColor;
- bool bIsSpecial;
- bool bIsFullyTransparent;
+ bool bIsSpecial;
+ bool bIsFullyTransparent;
};
-typedef ::std::list< ConnectedComponents > ConnectedComponentsList;
+typedef ::std::list< ConnectedComponents > ConnectedComponentsList;
// -----------
@@ -127,7 +127,7 @@ static bool checkRect( Rectangle& io_rPrevRect,
{
// shape needs to fully cover previous content, and have uniform
// color
- const bool bRet(
+ const bool bRet(
rMapModeVDev.LogicToPixel(rCurrRect).IsInside(io_rPrevRect) &&
rMapModeVDev.IsFillColor() );
@@ -136,7 +136,7 @@ static bool checkRect( Rectangle& io_rPrevRect,
io_rPrevRect = rCurrRect;
o_rBgColor = rMapModeVDev.GetFillColor();
}
-
+
return bRet;
}
@@ -155,7 +155,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
if( rAct.GetType() == META_TRANSPARENT_ACTION )
{
const MetaTransparentAction* pTransAct = static_cast<const MetaTransparentAction*>(&rAct);
- sal_uInt16 nTransparency( pTransAct->GetTransparence() );
+ USHORT 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<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) );
+ 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) );
Color aFillColor( rStateOutDev.GetFillColor() );
- 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) );
+ 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) );
}
o_rMtf.AddAction( new MetaPolyPolygonAction(pTransAct->GetPolyPolygon()) );
@@ -190,7 +190,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
case META_BMPEX_ACTION:
aBmpEx = static_cast<const MetaBmpExAction&>(rAct).GetBitmapEx();
break;
-
+
case META_BMPEXSCALE_ACTION:
aBmpEx = static_cast<const MetaBmpExScaleAction&>(rAct).GetBitmapEx();
break;
@@ -202,7 +202,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
case META_TRANSPARENT_ACTION:
default:
- OSL_FAIL("Printer::GetPreparedMetafile impossible state reached");
+ DBG_ERROR("Printer::GetPreparedMetafile impossible state reached");
break;
}
@@ -219,7 +219,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
if( pRA->HasPalette() )
aActualColor = pRA->GetBestPaletteColor( aBgColor ).operator Color();
-
+
aBmp.ReleaseAccess(pRA);
// did we get true white?
@@ -248,26 +248,26 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
switch( rAct.GetType() )
{
case META_BMPEX_ACTION:
- o_rMtf.AddAction( new MetaBmpAction(
- static_cast<const MetaBmpExAction&>(rAct).GetPoint(),
+ o_rMtf.AddAction( new MetaBmpAction(
+ static_cast<const MetaBmpExAction&>(rAct).GetPoint(),
aBmp ));
break;
case META_BMPEXSCALE_ACTION:
- o_rMtf.AddAction( new MetaBmpScaleAction(
- static_cast<const MetaBmpExScaleAction&>(rAct).GetPoint(),
- static_cast<const MetaBmpExScaleAction&>(rAct).GetSize(),
+ o_rMtf.AddAction( new MetaBmpScaleAction(
+ static_cast<const MetaBmpExScaleAction&>(rAct).GetPoint(),
+ static_cast<const MetaBmpExScaleAction&>(rAct).GetSize(),
aBmp ));
break;
case META_BMPEXSCALEPART_ACTION:
- o_rMtf.AddAction( new MetaBmpScalePartAction(
- static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestPoint(),
- static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestSize(),
- static_cast<const MetaBmpExScalePartAction&>(rAct).GetSrcPoint(),
- static_cast<const MetaBmpExScalePartAction&>(rAct).GetSrcSize(),
+ o_rMtf.AddAction( new MetaBmpScalePartAction(
+ static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestPoint(),
+ static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestSize(),
+ static_cast<const MetaBmpExScalePartAction&>(rAct).GetSrcPoint(),
+ static_cast<const MetaBmpExScalePartAction&>(rAct).GetSrcSize(),
aBmp ));
break;
default:
- OSL_FAIL("Unexpected case");
+ DBG_ERROR("Unexpected case");
break;
}
}
@@ -277,9 +277,9 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
// Returns true, if given action creates visible (i.e. non-transparent) output
static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rOut )
{
- const bool bLineTransparency( rOut.IsLineColor() ? rOut.GetLineColor().GetTransparency() == 255 : true );
- const bool bFillTransparency( rOut.IsFillColor() ? rOut.GetFillColor().GetTransparency() == 255 : true );
- bool bRet( false );
+ const bool bLineTransparency( rOut.IsLineColor() ? rOut.GetLineColor().GetTransparency() == 255 : true );
+ const bool bFillTransparency( rOut.IsFillColor() ? rOut.GetFillColor().GetTransparency() == 255 : true );
+ bool bRet( false );
switch( rAct.GetType() )
{
@@ -405,21 +405,9 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_LINE_ACTION:
- {
- 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;
- }
+ aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(),
+ static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
break;
- }
case META_RECT_ACTION:
aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
@@ -459,20 +447,8 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_POLYLINE_ACTION:
- {
- 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;
- }
+ aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
break;
- }
case META_POLYGON_ACTION:
aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();
@@ -483,47 +459,47 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_BMP_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpAction&>(rAct).GetPoint(),
rOut.PixelToLogic( static_cast<const MetaBmpAction&>(rAct).GetBitmap().GetSizePixel() ) );
break;
case META_BMPSCALE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpScaleAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpScaleAction&>(rAct).GetPoint(),
static_cast<const MetaBmpScaleAction&>(rAct).GetSize() );
break;
case META_BMPSCALEPART_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpScalePartAction&>(rAct).GetDestPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpScalePartAction&>(rAct).GetDestPoint(),
static_cast<const MetaBmpScalePartAction&>(rAct).GetDestSize() );
break;
case META_BMPEX_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpExAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpExAction&>(rAct).GetPoint(),
rOut.PixelToLogic( static_cast<const MetaBmpExAction&>(rAct).GetBitmapEx().GetSizePixel() ) );
break;
case META_BMPEXSCALE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpExScaleAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpExScaleAction&>(rAct).GetPoint(),
static_cast<const MetaBmpExScaleAction&>(rAct).GetSize() );
break;
case META_BMPEXSCALEPART_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestPoint(),
static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestSize() );
break;
case META_MASK_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaMaskAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaMaskAction&>(rAct).GetPoint(),
rOut.PixelToLogic( static_cast<const MetaMaskAction&>(rAct).GetBitmap().GetSizePixel() ) );
break;
case META_MASKSCALE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaMaskScaleAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaMaskScaleAction&>(rAct).GetPoint(),
static_cast<const MetaMaskScaleAction&>(rAct).GetSize() );
break;
case META_MASKSCALEPART_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaMaskScalePartAction&>(rAct).GetDestPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaMaskScalePartAction&>(rAct).GetDestPoint(),
static_cast<const MetaMaskScalePartAction&>(rAct).GetDestSize() );
break;
@@ -548,12 +524,12 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_FLOATTRANSPARENT_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaFloatTransparentAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaFloatTransparentAction&>(rAct).GetPoint(),
static_cast<const MetaFloatTransparentAction&>(rAct).GetSize() );
break;
case META_EPS_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaEPSAction&>(rAct).GetPoint(),
+ aActionBounds = Rectangle( static_cast<const MetaEPSAction&>(rAct).GetPoint(),
static_cast<const MetaEPSAction&>(rAct).GetSize() );
break;
@@ -568,7 +544,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
// #105987# Use API method instead of Impl* methods
// #107490# Set base parameter equal to index parameter
- rOut.GetTextBoundRect( aActionBounds, rTextAct.GetText(), rTextAct.GetIndex(),
+ rOut.GetTextBoundRect( aActionBounds, rTextAct.GetText(), rTextAct.GetIndex(),
rTextAct.GetIndex(), rTextAct.GetLen() );
aActionBounds.Move( aPtLog.X(), aPtLog.Y() );
}
@@ -577,15 +553,15 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
case META_TEXTARRAY_ACTION:
{
- const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- const long nLen = aString.Len();
+ const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
+ const long nLen = aString.Len();
if( nLen )
{
// #105987# ImplLayout takes everything in logical coordinates
- SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
- rTextAct.GetLen(), rTextAct.GetPoint(),
+ SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
+ rTextAct.GetLen(), rTextAct.GetPoint(),
0, rTextAct.GetDXArray() );
if( pSalLayout )
{
@@ -604,8 +580,8 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction& rTextAct = static_cast<const MetaStretchTextAction&>(rAct);
- const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- const long nLen = aString.Len();
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
+ const long nLen = aString.Len();
// #i16195# Literate copy from TextArray action, the
// semantics for the ImplLayout call are copied from the
@@ -615,8 +591,8 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
if( nLen )
{
// #105987# ImplLayout takes everything in logical coordinates
- SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
- rTextAct.GetLen(), rTextAct.GetPoint(),
+ SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
+ rTextAct.GetLen(), rTextAct.GetPoint(),
rTextAct.GetWidth() );
if( pSalLayout )
{
@@ -629,7 +605,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_TEXTLINE_ACTION:
- OSL_FAIL("META_TEXTLINE_ACTION not supported");
+ DBG_ERROR("META_TEXTLINE_ACTION not supported");
break;
default:
@@ -665,7 +641,7 @@ static bool ImplIsActionHandlingTransparency( const MetaAction& rAct )
}
// remove comment to enable highlighting of generated output
-bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
+bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
long nMaxBmpDPIX, long nMaxBmpDPIY,
bool bReduceTransparency, bool bTransparencyAutoMode,
bool bDownsampleBitmaps,
@@ -673,15 +649,15 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
)
{
MetaAction* pCurrAct;
- bool bTransparent( false );
+ bool bTransparent( false );
rOutMtf.Clear();
if( ! bReduceTransparency || bTransparencyAutoMode )
{
// watch for transparent drawing actions
- for( pCurrAct = ( (GDIMetaFile&) rInMtf ).FirstAction();
- pCurrAct && !bTransparent;
+ for( pCurrAct = ( (GDIMetaFile&) rInMtf ).FirstAction();
+ pCurrAct && !bTransparent;
pCurrAct = ( (GDIMetaFile&) rInMtf ).NextAction() )
{
// #i10613# Extracted "specialness" predicate into extra method
@@ -700,7 +676,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
}
}
- // #i10613# Determine set of connected components containing transparent objects. These are
+ // #i10613# Determine set of connected components containing transparent objects. These are
// then processed as bitmaps, the original actions are removed from the metafile.
if( !bTransparent )
{
@@ -709,7 +685,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
}
else
{
- // #i10613#
+ // #i10613#
// This works as follows: we want a number of distinct sets of
// connected components, where each set contains metafile
// actions that are intersecting (note: there are possibly
@@ -748,7 +724,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
VirtualDevice aMapModeVDev;
aMapModeVDev.mnDPIX = mnDPIX;
aMapModeVDev.mnDPIY = mnDPIY;
- aMapModeVDev.EnableOutput(sal_False);
+ aMapModeVDev.EnableOutput(FALSE);
int nLastBgAction, nActionNum;
@@ -851,17 +827,18 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// execute action to get correct MapModes etc.
pCurrAct->Execute( &aMapModeVDev );
-
+
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction();
++nActionNum;
}
- // clean up aMapModeVDev
- sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth();
- while( nCount-- )
- aMapModeVDev.Pop();
+ ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
- ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
+ // create an OutputDevice to record mapmode changes and the like
+ VirtualDevice aMapModeVDev2;
+ aMapModeVDev2.mnDPIX = mnDPIX;
+ aMapModeVDev2.mnDPIY = mnDPIY;
+ aMapModeVDev2.EnableOutput(FALSE);
// fast-forward until one after the last background action
// (need to reconstruct map mode vdev state)
@@ -871,12 +848,12 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
{
// up to and including last ink-generating background
// action go to background component
- aBackgroundComponent.aComponentList.push_back(
+ aBackgroundComponent.aComponentList.push_back(
::std::make_pair(
pCurrAct, nActionNum) );
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev );
+ pCurrAct->Execute( &aMapModeVDev2 );
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction();
++nActionNum;
}
@@ -888,26 +865,26 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// iterate over all actions (start where background action
// search left off)
- for( ;
- pCurrAct;
+ for( ;
+ pCurrAct;
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev );
+ pCurrAct->Execute( &aMapModeVDev2 );
- // cache bounds of current action
- const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) );
+ // cache bounds of current action
+ const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev2) );
// accumulate collected bounds here, initialize with current action
- Rectangle aTotalBounds( aBBCurrAct ); // thus,
+ Rectangle aTotalBounds( aBBCurrAct ); // thus,
// aTotalComponents.aBounds
// is
// empty
// for
// non-output-generating
// actions
- bool bTreatSpecial( false );
- ConnectedComponents aTotalComponents;
+ bool bTreatSpecial( false );
+ ConnectedComponents aTotalComponents;
//
// STAGE 2.1: Search for intersecting cc entries
@@ -925,9 +902,9 @@ 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, aMapModeVDev);
+ aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev2);
- if( !aBBCurrAct.IsEmpty() &&
+ if( !aBBCurrAct.IsEmpty() &&
!aTotalComponents.bIsFullyTransparent )
{
if( !aBackgroundComponent.aComponentList.empty() &&
@@ -936,18 +913,18 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// it seems the background is not large enough. to
// be on the safe side, combine with this component.
aTotalBounds.Union( aBackgroundComponent.aBounds );
-
+
// extract all aCurr actions to aTotalComponents
- aTotalComponents.aComponentList.splice( aTotalComponents.aComponentList.end(),
+ aTotalComponents.aComponentList.splice( aTotalComponents.aComponentList.end(),
aBackgroundComponent.aComponentList );
-
+
if( aBackgroundComponent.bIsSpecial )
bTreatSpecial = true;
}
- ConnectedComponentsList::iterator aCurrCC;
+ ConnectedComponentsList::iterator aCurrCC;
const ConnectedComponentsList::iterator aLastCC( aCCList.end() );
- bool bSomeComponentsChanged;
+ bool bSomeComponentsChanged;
// now, this is unfortunate: since changing anyone of
// the aCCList elements (e.g. by merging or addition
@@ -981,11 +958,11 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// calc union bounding box
aTotalBounds.Union( aCurrCC->aBounds );
-
+
// extract all aCurr actions to aTotalComponents
- aTotalComponents.aComponentList.splice( aTotalComponents.aComponentList.end(),
+ aTotalComponents.aComponentList.splice( aTotalComponents.aComponentList.end(),
aCurrCC->aComponentList );
-
+
if( aCurrCC->bIsSpecial )
bTreatSpecial = true;
@@ -1038,7 +1015,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
{
// added action is special and none of prev components
// special -> do the detailed tests
-
+
// can the action handle transparency correctly
// (i.e. when painted on white background, does the
// action still look correct)?
@@ -1082,19 +1059,19 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// set new bounds and add action to list
aTotalComponents.aBounds = aTotalBounds;
- aTotalComponents.aComponentList.push_back(
+ aTotalComponents.aComponentList.push_back(
::std::make_pair(
pCurrAct, nActionNum) );
// add aTotalComponents as a new entry to aCCList
aCCList.push_back( aTotalComponents );
- DBG_ASSERT( !aTotalComponents.aComponentList.empty(),
+ DBG_ASSERT( !aTotalComponents.aComponentList.empty(),
"Printer::GetPreparedMetaFile empty component" );
- DBG_ASSERT( !aTotalComponents.aBounds.IsEmpty() ||
+ DBG_ASSERT( !aTotalComponents.aBounds.IsEmpty() ||
(aTotalComponents.aBounds.IsEmpty() && aTotalComponents.aComponentList.size() == 1),
"Printer::GetPreparedMetaFile non-output generating actions must be solitary");
- DBG_ASSERT( !aTotalComponents.bIsFullyTransparent ||
+ DBG_ASSERT( !aTotalComponents.bIsFullyTransparent ||
(aTotalComponents.bIsFullyTransparent && aTotalComponents.aComponentList.size() == 1),
"Printer::GetPreparedMetaFile fully transparent actions must be solitary");
}
@@ -1112,11 +1089,11 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
::std::vector< const ConnectedComponents* > aCCList_MemberMap( rInMtf.GetActionCount() );
// iterate over all aCCList members and their contained metaactions
- ConnectedComponentsList::iterator aCurr( aCCList.begin() );
+ ConnectedComponentsList::iterator aCurr( aCCList.begin() );
const ConnectedComponentsList::iterator aLast( aCCList.end() );
for( ; aCurr != aLast; ++aCurr )
{
- ComponentList::iterator aCurrentAction( aCurr->aComponentList.begin() );
+ ComponentList::iterator aCurrentAction( aCurr->aComponentList.begin() );
const ComponentList::iterator aLastAction( aCurr->aComponentList.end() );
for( ; aCurrentAction != aLastAction; ++aCurrentAction )
{
@@ -1130,7 +1107,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// ===========================================================
//
- ComponentList::iterator aCurrAct( aBackgroundComponent.aComponentList.begin() );
+ ComponentList::iterator aCurrAct( aBackgroundComponent.aComponentList.begin() );
const ComponentList::iterator aLastAct( aBackgroundComponent.aComponentList.end() );
for( ; aCurrAct != aLastAct; ++aCurrAct )
{
@@ -1151,7 +1128,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
{
aTmpSize = mpPDFWriter->getCurPageSize();
aTmpSize = LogicToPixel( aTmpSize, MapMode( MAP_POINT ) );
-
+
// also add error code to PDFWriter
mpPDFWriter->insertError( vcl::PDFWriter::Warning_Transparency_Converted );
}
@@ -1170,7 +1147,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
{
if( aCurr->bIsSpecial )
{
- Rectangle aBoundRect( aCurr->aBounds );
+ Rectangle aBoundRect( aCurr->aBounds );
aBoundRect.Intersection( aOutputRect );
const double fBmpArea( (double) aBoundRect.GetWidth() * aBoundRect.GetHeight() );
@@ -1190,18 +1167,18 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
{
Point aDstPtPix( aBoundRect.TopLeft() );
- Size aDstSzPix;
+ Size aDstSzPix;
- VirtualDevice aMapVDev; // here, we record only mapmode information
- aMapVDev.EnableOutput(sal_False);
+ VirtualDevice aMapVDev; // here, we record only mapmode information
+ aMapVDev.EnableOutput(FALSE);
- VirtualDevice aPaintVDev; // into this one, we render.
+ VirtualDevice aPaintVDev; // into this one, we render.
rOutMtf.AddAction( new MetaPushAction( PUSH_MAPMODE ) );
rOutMtf.AddAction( new MetaMapModeAction() );
aPaintVDev.SetDrawMode( GetDrawMode() );
-
+
while( aDstPtPix.Y() <= aBoundRect.Bottom() )
{
aDstPtPix.X() = aBoundRect.Left();
@@ -1224,11 +1201,11 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
aMapVDev.mnDPIX = aPaintVDev.mnDPIX = mnDPIX;
aMapVDev.mnDPIY = aPaintVDev.mnDPIY = mnDPIY;
- aPaintVDev.EnableOutput(sal_False);
+ aPaintVDev.EnableOutput(FALSE);
// iterate over all actions
- for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
- pCurrAct;
+ for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
+ pCurrAct;
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
// enable output only for
@@ -1236,16 +1213,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// the current aCCList element
// (aCurr)
if( aCCList_MemberMap[nActionNum] == &(*aCurr) )
- aPaintVDev.EnableOutput(sal_True);
+ aPaintVDev.EnableOutput(TRUE);
// but process every action
- const sal_uInt16 nType( pCurrAct->GetType() );
+ const USHORT nType( pCurrAct->GetType() );
if( META_MAPMODE_ACTION == nType )
{
pCurrAct->Execute( &aMapVDev );
- MapMode aMtfMap( aMapVDev.GetMapMode() );
+ MapMode aMtfMap( aMapVDev.GetMapMode() );
const Point aNewOrg( aMapVDev.PixelToLogic( aDstPtPix ) );
aMtfMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) );
@@ -1274,15 +1251,15 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Application::Reschedule();
}
- const sal_Bool bOldMap = mbMap;
- mbMap = aPaintVDev.mbMap = sal_False;
+ const BOOL bOldMap = mbMap;
+ mbMap = aPaintVDev.mbMap = FALSE;
Bitmap aBandBmp( aPaintVDev.GetBitmap( Point(), aDstSzPix ) );
// scale down bitmap, if requested
if( bDownsampleBitmaps )
{
- aBandBmp = GetDownsampledBitmap( aDstSzPix,
+ aBandBmp = GetDownsampledBitmap( aDstSzPix,
Point(), aBandBmp.GetSizePixel(),
aBandBmp, nMaxBmpDPIX, nMaxBmpDPIY );
}
@@ -1291,7 +1268,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( new MetaBmpScaleAction( aDstPtPix, aDstSzPix, aBandBmp ) );
rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_END" ) );
- aPaintVDev.mbMap = sal_True;
+ aPaintVDev.mbMap = TRUE;
mbMap = bOldMap;
aMapVDev.Pop();
aPaintVDev.Pop();
@@ -1311,20 +1288,22 @@ 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;
- pCurrAct;
+ for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
+ pCurrAct;
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
const ConnectedComponents* pCurrAssociatedComponent = aCCList_MemberMap[nActionNum];
@@ -1348,7 +1327,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// given background color
ImplConvertTransparentAction(rOutMtf,
*pCurrAct,
- aMapModeVDev,
+ aMapModeVDev3,
aBackgroundComponent.aBgColor);
}
else
@@ -1357,7 +1336,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) );
}
- pCurrAct->Execute(&aMapModeVDev);
+ pCurrAct->Execute(&aMapModeVDev3);
}
}
@@ -1369,7 +1348,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// -----------------------------------------------------------------------------
-Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz,
+Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz,
const Point& rSrcPt, const Size& rSrcSz,
const Bitmap& rBmp, long nMaxBmpDPIX, long nMaxBmpDPIY )
{
@@ -1405,8 +1384,8 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz,
const double fMaxPixelY = aDstSizeTwip.Height() * nMaxBmpDPIY / 1440.0;
// check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
- if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
- ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
{
// do scaling
@@ -1463,7 +1442,7 @@ BitmapEx OutputDevice::GetDownsampledBitmapEx( const Size& rDstSz,
{
// do downsampling if neccessary
Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) );
-
+
// #103209# Normalize size (mirroring has to happen outside of this method)
aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) );
@@ -1474,8 +1453,8 @@ BitmapEx OutputDevice::GetDownsampledBitmapEx( const Size& rDstSz,
const double fMaxPixelY = aDstSizeTwip.Height() * nMaxBmpDPIY / 1440.0;
// check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
- if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
- ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
{
// do scaling
@@ -1535,7 +1514,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( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
+ const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pOut->SetLineColor( aColor );
@@ -1578,7 +1557,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( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
+ const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) 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 4fd2f1c6d6c6..4951e08eca91 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,8 +50,8 @@
#include "com/sun/star/awt/Size.hpp"
#include "comphelper/processfactory.hxx"
-#include <boost/unordered_map.hpp>
-#include <boost/unordered_set.hpp>
+#include <hash_map>
+#include <hash_set>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -65,23 +65,28 @@ class ImplPageCache
GDIMetaFile aPage;
PrinterController::PageSize aSize;
};
-
+
std::vector< CacheEntry > maPages;
std::vector< sal_Int32 > maPageNumbers;
std::vector< sal_Int32 > maCacheRanking;
-
+
static const sal_Int32 nCacheSize = 6;
-
+
void updateRanking( sal_Int32 nLastHit )
{
if( maCacheRanking[0] != nLastHit )
{
+ bool bMove = false;
for( sal_Int32 i = nCacheSize-1; i > 0; i-- )
+ {
+ if( maCacheRanking[i] == nLastHit )
+ bMove = true;
maCacheRanking[i] = maCacheRanking[i-1];
+ }
maCacheRanking[0] = nLastHit;
}
}
-
+
public:
ImplPageCache()
: maPages( nCacheSize )
@@ -91,7 +96,7 @@ public:
for( sal_Int32 i = 0; i < nCacheSize; i++ )
maCacheRanking[i] = nCacheSize - i - 1;
}
-
+
// caution: does not ensure uniqueness
void insert( sal_Int32 i_nPageNo, const GDIMetaFile& i_rPage, const PrinterController::PageSize& i_rSize )
{
@@ -103,7 +108,7 @@ public:
// so update the ranking
updateRanking( nReplacePage );
}
-
+
// caution: bad algorithm; should there ever be reason to increase the cache size beyond 6
// this needs to be urgently rewritten. However do NOT increase the cache size lightly,
// whole pages can be rather memory intensive
@@ -121,7 +126,7 @@ public:
}
return false;
}
-
+
void invalidate()
{
for( sal_Int32 i = 0; i < nCacheSize; ++i )
@@ -135,19 +140,18 @@ public:
class vcl::ImplPrinterControllerData
{
-public:
+public:
struct ControlDependency
{
rtl::OUString maDependsOnName;
sal_Int32 mnDependsOnEntry;
-
+
ControlDependency() : mnDependsOnEntry( -1 ) {}
};
-
- 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;
-
+
+ typedef std::hash_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
+ typedef std::hash_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
std::vector< PropertyValue > maUIProperties;
@@ -155,24 +159,23 @@ public:
PropertyToIndexMap maPropertyToIndex;
Link maOptionChangeHdl;
ControlDependencyMap maControlDependencies;
- ChoiceDisableMap maChoiceDisableMap;
sal_Bool mbFirstPage;
sal_Bool mbLastPage;
sal_Bool mbReversePageOrder;
view::PrintableState meJobState;
vcl::PrinterController::MultiPageSetup maMultiPage;
-
+
vcl::PrintProgressDialog* mpProgress;
-
+
ImplPageCache maPageCache;
-
+
// set by user through printer config dialog
// if set, pages are centered and trimmed onto the fixed page
Size maFixedPageSize;
sal_Int32 mnDefaultPaperBin;
sal_Int32 mnFixedPaperBin;
-
+
ImplPrinterControllerData() :
mbFirstPage( sal_True ),
mbLastPage( sal_False ),
@@ -183,18 +186,18 @@ public:
mnFixedPaperBin( -1 )
{}
~ImplPrinterControllerData() { delete mpProgress; }
-
- Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
+
+ Size getRealPaperSize( const Size& i_rPageSize ) const
{
if( maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0 )
return maFixedPageSize;
- if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP )
+ if( maMultiPage.nRows * maMultiPage.nColumns > 1 )
return maMultiPage.aPaperSize;
return i_rPageSize;
}
bool isFixedPageSize() const
{ return maFixedPageSize.Width() != 0 && maFixedPageSize.Height() != 0; }
- PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP );
+ PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps );
};
PrinterController::PrinterController()
@@ -269,23 +272,23 @@ struct PrintJobAsync
{
boost::shared_ptr<PrinterController> mpController;
JobSetup maInitSetup;
-
+
PrintJobAsync( const boost::shared_ptr<PrinterController>& i_pController,
const JobSetup& i_rInitSetup
)
: mpController( i_pController ), maInitSetup( i_rInitSetup )
{}
-
+
DECL_LINK( ExecJob, void* );
};
IMPL_LINK( PrintJobAsync, ExecJob, void*, EMPTYARG )
{
Printer::ImplPrintJob( mpController, maInitSetup );
-
+
// clean up, do not access members after this
delete this;
-
+
return 0;
}
@@ -325,20 +328,33 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
}
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ),
makeAny( sal_False ) );
- }
-
+ }
+
// setup printer
- // #i114306# changed behavior back from persistence
- // if no specific printer is already set, create the default printer
+ // if no specific printer is already set, create one
+
+ // #i108686#
+ // in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs
+ // however if no printer was already set by the print job's originator,
+ // and this is an API job, then use the system default location (because
+ // this is the only sensible default available if the user has no means of changing
+ // the destination
if( ! pController->getPrinter() )
{
rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() );
+ if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() )
+ {
+ // get printer name from configuration
+ SettingsConfigItem* pItem = SettingsConfigItem::get();
+ aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) );
+ }
+
boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) );
- pPrinter->SetJobSetup( i_rInitSetup );
pController->setPrinter( pPrinter );
}
-
+
// reset last page property
i_pController->setLastPage( sal_False );
@@ -348,7 +364,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
// case 2: "All pages" is selected
// update "Page range" attribute to have a sensible default,
// but leave "All" as selected
-
+
// "Pages" attribute from API is now equivalent to "PageRange"
// AND "PrintContent" = 1 except calc where it is "PrintRange" = 1
// Argh ! That sure needs cleaning up
@@ -382,25 +398,17 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
{
if( nContent == 0 )
{
- // do not overwrite PageRange if it is already set
- beans::PropertyValue* pRangeVal = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) );
- rtl::OUString aRange;
- if( pRangeVal )
- pRangeVal->Value >>= aRange;
- if( aRange.getLength() == 0 )
+ sal_Int32 nPages = i_pController->getPageCount();
+ if( nPages > 0 )
{
- sal_Int32 nPages = i_pController->getPageCount();
- if( nPages > 0 )
+ rtl::OUStringBuffer aBuf( 32 );
+ aBuf.appendAscii( "1" );
+ if( nPages > 1 )
{
- rtl::OUStringBuffer aBuf( 32 );
- aBuf.appendAscii( "1" );
- if( nPages > 1 )
- {
- aBuf.appendAscii( "-" );
- aBuf.append( nPages );
- }
- i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) );
+ aBuf.appendAscii( "-" );
+ aBuf.append( nPages );
}
+ i_pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), makeAny( aBuf.makeStringAndClear() ) );
}
}
}
@@ -425,7 +433,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
return;
}
}
-
+
// check if the printer brings up its own dialog
// in that case leave the work to that dialog
if( ! pController->getPrinter()->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) &&
@@ -463,16 +471,16 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
{
}
}
-
+
pController->pushPropertiesToPrinter();
-
+
rtl::OUString aJobName;
beans::PropertyValue* pJobNameVal = pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ) );
if( pJobNameVal )
pJobNameVal->Value >>= aJobName;
-
+
pController->getPrinter()->StartJob( String( aJobName ), pController );
-
+
pController->jobFinished( pController->getJobState() );
}
@@ -481,18 +489,18 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
mnError = PRINTER_OK;
if ( IsDisplayPrinter() )
- return sal_False;
+ return FALSE;
if ( IsJobActive() || IsPrinting() )
- return sal_False;
-
- sal_uLong nCopies = mnCopyCount;
+ return FALSE;
+
+ ULONG nCopies = mnCopyCount;
bool bCollateCopy = mbCollateCopy;
- bool bUserCopy = sal_False;
+ bool bUserCopy = FALSE;
if ( nCopies > 1 )
{
- sal_uLong nDevCopy;
+ ULONG nDevCopy;
if ( bCollateCopy )
nDevCopy = GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES );
@@ -502,20 +510,20 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
// need to do copies by hand ?
if ( nCopies > nDevCopy )
{
- bUserCopy = sal_True;
+ bUserCopy = TRUE;
nCopies = 1;
- bCollateCopy = sal_False;
+ bCollateCopy = FALSE;
}
}
else
- bCollateCopy = sal_False;
+ bCollateCopy = FALSE;
ImplSVData* pSVData = ImplGetSVData();
mpPrinter = pSVData->mpDefInst->CreatePrinter( mpInfoPrinter );
if ( !mpPrinter )
- return sal_False;
+ return FALSE;
sal_Bool bSinglePrintJobs = sal_False;
beans::PropertyValue* pSingleValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
@@ -523,7 +531,11 @@ 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 )
{
@@ -531,7 +543,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pFileValue->Value >>= aFile;
if( aFile.getLength() )
{
- mbPrintFile = sal_True;
+ mbPrintFile = TRUE;
maPrintFile = aFile;
bSinglePrintJobs = sal_False;
}
@@ -540,15 +552,14 @@ 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 = sal_True;
- if( GetCapabilities( PRINTER_CAPABILITIES_USEPULLMODEL ) )
+ maJobName = i_rJobName;
+ mnCurPage = 1;
+ mnCurPrintPage = 1;
+ mbPrinting = TRUE;
+ if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
{
- mbJobActive = sal_True;
+ mbJobActive = 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
@@ -567,11 +578,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
if ( !mnError )
mnError = PRINTER_GENERALERROR;
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
- mnCurPage = 0;
- mnCurPrintPage = 0;
- mbPrinting = sal_False;
+ mnCurPage = 0;
+ mnCurPrintPage = 0;
+ mbPrinting = FALSE;
mpPrinter = NULL;
-
+
return false;
}
}
@@ -581,7 +592,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
// now the real job starts
i_pController->setJobState( view::PrintableState_JOB_STARTED );
i_pController->jobStarted();
-
+
int nJobs = 1;
int nOuterRepeatCount = 1;
int nInnerRepeatCount = 1;
@@ -598,7 +609,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
nCopies = 1;
nOuterRepeatCount = nInnerRepeatCount = 1;
}
-
+
for( int nJobIteration = 0; nJobIteration < nJobs; nJobIteration++ )
{
bool bError = false, bAborted = false;
@@ -610,7 +621,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
i_pController->isDirectPrint(),
maJobSetup.ImplGetConstData() ) )
{
- mbJobActive = sal_True;
+ mbJobActive = TRUE;
i_pController->createProgressDialog();
int nPages = i_pController->getFilteredPageCount();
for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ )
@@ -637,17 +648,17 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
// FIXME: duplex ?
}
EndJob();
-
+
if( nJobIteration < nJobs-1 )
{
mpPrinter = pSVData->mpDefInst->CreatePrinter( mpInfoPrinter );
-
+
if ( mpPrinter )
{
- maJobName = i_rJobName;
- mnCurPage = 1;
- mnCurPrintPage = 1;
- mbPrinting = sal_True;
+ maJobName = i_rJobName;
+ mnCurPage = 1;
+ mnCurPrintPage = 1;
+ mbPrinting = TRUE;
}
else
bError = true;
@@ -655,7 +666,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
}
else
bError = true;
-
+
if( bError )
{
mnError = ImplSalPrinterErrorCodeToVCL( mpPrinter->GetErrorCode() );
@@ -666,11 +677,11 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
: view::PrintableState_JOB_FAILED );
if( mpPrinter )
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
- mnCurPage = 0;
- mnCurPrintPage = 0;
- mbPrinting = sal_False;
+ mnCurPage = 0;
+ mnCurPrintPage = 0;
+ mbPrinting = FALSE;
mpPrinter = NULL;
-
+
return false;
}
}
@@ -678,7 +689,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
if( i_pController->getJobState() == view::PrintableState_JOB_STARTED )
i_pController->setJobState( view::PrintableState_JOB_SPOOLED );
}
-
+
// make last used printer persistent for UI jobs
if( i_pController->isShowDialogs() && ! i_pController->isDirectPrint() )
{
@@ -688,7 +699,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
GetName()
);
}
-
+
return true;
}
@@ -721,13 +732,6 @@ 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;
@@ -736,7 +740,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
// get old data
Size aPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- sal_uInt16 nPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin();
// call driver setup
bRet = mpImplData->mpPrinter->Setup( i_pParent );
@@ -745,7 +749,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 ) ) );
- sal_uInt16 nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
{
mpImplData->maFixedPageSize = aNewPaperSize;
@@ -762,7 +766,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
return bRet;
}
-PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP )
+PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps )
{
PrinterController::PageSize aPageSize;
aPageSize.aSize = mpPrinter->GetPaperSize();
@@ -770,21 +774,21 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
sal_Int32 nPaperBin = mnDefaultPaperBin;
for( sal_Int32 nProperty = 0, nPropertyCount = i_rProps.getLength(); nProperty < nPropertyCount; ++nProperty )
{
- if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreferredPageSize" ) ) )
+ if( i_rProps[ nProperty ].Name.equalsAscii( "PreferredPageSize" ) )
{
i_rProps[ nProperty ].Value >>= aSetSize;
}
- else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageSize" ) ) )
+ else if( i_rProps[ nProperty ].Name.equalsAscii( "PageSize" ) )
{
i_rProps[ nProperty ].Value >>= aIsSize;
}
- else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageIncludesNonprintableArea" ) ) )
+ else if( i_rProps[ nProperty ].Name.equalsAscii( "PageIncludesNonprintableArea" ) )
{
sal_Bool bVal = sal_False;
i_rProps[ nProperty ].Value >>= bVal;
aPageSize.bFullPaper = static_cast<bool>(bVal);
}
- else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrinterPaperTray" ) ) )
+ else if( i_rProps[ nProperty ].Name.equalsAscii( "PrinterPaperTray" ) )
{
sal_Int32 nBin = -1;
i_rProps[ nProperty ].Value >>= nBin;
@@ -797,7 +801,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
if( aSetSize.Width && aSetSize.Height )
{
Size aSetPaperSize( aSetSize.Width, aSetSize.Height );
- Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) );
+ Size aRealPaperSize( getRealPaperSize( aSetPaperSize ) );
if( aRealPaperSize != aCurSize )
aIsSize = aSetSize;
}
@@ -806,15 +810,15 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
{
aPageSize.aSize.Width() = aIsSize.Width;
aPageSize.aSize.Height() = aIsSize.Height;
-
- Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) );
+
+ Size aRealPaperSize( getRealPaperSize( aPageSize.aSize ) );
if( aRealPaperSize != aCurSize )
mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
-
+
if( nPaperBin != -1 && nPaperBin != mpPrinter->GetPaperBin() )
mpPrinter->SetPaperBin( nPaperBin );
-
+
return aPageSize;
}
@@ -851,7 +855,7 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->mpProgress->tick();
Application::Reschedule( true );
}
-
+
if( i_bMayUseCache )
{
PrinterController::PageSize aPageSize;
@@ -864,21 +868,21 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->maPageCache.invalidate();
o_rMtf.Clear();
-
+
// get page parameters
Sequence< PropertyValue > aPageParm( getPageParametersProtected( i_nUnfilteredPage ) );
const MapMode aMapMode( MAP_100TH_MM );
mpImplData->mpPrinter->Push();
mpImplData->mpPrinter->SetMapMode( aMapMode );
-
+
// modify job setup if necessary
- PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true );
+ PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm );
o_rMtf.SetPrefSize( aPageSize.aSize );
o_rMtf.SetPrefMapMode( aMapMode );
- mpImplData->mpPrinter->EnableOutput( sal_False );
+ mpImplData->mpPrinter->EnableOutput( FALSE );
o_rMtf.Record( mpImplData->mpPrinter.get() );
@@ -887,13 +891,13 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
o_rMtf.Stop();
o_rMtf.WindStart();
mpImplData->mpPrinter->Pop();
-
+
if( i_bMayUseCache )
mpImplData->maPageCache.insert( i_nUnfilteredPage, o_rMtf, aPageSize );
// reset "FirstPage" property to false now we've gotten at least our first one
mpImplData->mbFirstPage = sal_False;
-
+
return aPageSize;
}
@@ -907,7 +911,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 ), sal_True ) );
+ o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), TRUE ) );
// append the subpage
io_rSubPage.WindStart();
@@ -924,8 +928,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 ), sal_True ) );
- o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), sal_False ) );
+ o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), TRUE ) );
+ o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), FALSE ) );
o_rMtf.AddAction( new MetaRectAction( aBorderRect ) );
// restore gstate
@@ -939,14 +943,14 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
int nSubPages = rMPS.nRows * rMPS.nColumns;
if( nSubPages < 1 )
nSubPages = 1;
-
+
// reverse sheet order
if( mpImplData->mbReversePageOrder )
{
int nDocPages = getFilteredPageCount();
i_nFilteredPage = nDocPages - 1 - i_nFilteredPage;
}
-
+
// there is no filtering to be done (and possibly the page size of the
// original page is to be set), when N-Up is "neutral" that is there is
// only one subpage and the margins are 0
@@ -955,7 +959,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, true );
+ Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize );
mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
if( aPaperSize != aPageSize.aSize )
@@ -971,13 +975,13 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
}
return aPageSize;
}
-
+
// set last page property really only on the very last page to be rendered
// that is on the last subpage of a NUp run
sal_Bool bIsLastPage = mpImplData->mbLastPage;
mpImplData->mbLastPage = sal_False;
-
- Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize, false ) );
+
+ Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize ) );
// 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
@@ -998,7 +1002,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
o_rMtf.SetPrefSize( aPaperSize );
o_rMtf.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
o_rMtf.AddAction( new MetaMapModeAction( MapMode( MAP_100TH_MM ) ) );
-
+
int nDocPages = getPageCountProtected();
for( int nSubPage = 0; nSubPage < nSubPages; nSubPage++ )
{
@@ -1026,22 +1030,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());
double fScaleY = double(aSubPageSize.Height())/double(aPageSize.aSize.Height());
- double fScale = std::min( fScaleX, fScaleY );
+ double fScale = std::min( fScaleX, fScaleY );
aPageFile.Scale( fScale, fScale );
aPageFile.WindStart();
-
+
// move the subpage so it is centered in its "cell"
long nOffX = (aSubPageSize.Width() - long(double(aPageSize.aSize.Width()) * fScale)) / 2;
long nOffY = (aSubPageSize.Height() - long(double(aPageSize.aSize.Height()) * fScale)) / 2;
@@ -1053,7 +1049,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
Rectangle aSubPageRect( Point( nX, nY ),
Size( long(double(aPageSize.aSize.Width())*fScale),
long(double(aPageSize.aSize.Height())*fScale) ) );
-
+
// append subpage to page
appendSubPage( o_rMtf, aSubPageRect, aPageFile, rMPS.bDrawBorder );
}
@@ -1064,7 +1060,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
// subsequent getPageFile calls have changed the paper, reset it to current value
mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
-
+
return PrinterController::PageSize( aPaperSize, true );
}
@@ -1076,9 +1072,9 @@ int PrinterController::getFilteredPageCount()
return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv;
}
-sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
+ULONG PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
{
- sal_uLong nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
+ ULONG nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
sal_Int32 nMaxBmpDPIX = mpImplData->mpPrinter->ImplGetDPIX();
sal_Int32 nMaxBmpDPIY = mpImplData->mpPrinter->ImplGetDPIY();
@@ -1112,7 +1108,7 @@ sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFi
if( rPrinterOptions.IsConvertToGreyscales() )
{
mpImplData->mpPrinter->SetDrawMode( mpImplData->mpPrinter->GetDrawMode() |
- ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
}
@@ -1143,7 +1139,7 @@ void PrinterController::printFilteredPage( int i_nPage )
{
if( mpImplData->meJobState != view::PrintableState_JOB_STARTED )
return;
-
+
GDIMetaFile aPageFile;
PrinterController::PageSize aPageSize = getFilteredPageFile( i_nPage, aPageFile );
@@ -1174,22 +1170,22 @@ void PrinterController::printFilteredPage( int i_nPage )
aPageFile.WindStart();
aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y(), mpImplData->mpPrinter->ImplGetDPIX(), mpImplData->mpPrinter->ImplGetDPIY() );
}
-
+
GDIMetaFile aCleanedFile;
- sal_uLong nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
-
- mpImplData->mpPrinter->EnableOutput( sal_True );
+ ULONG nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
+
+ mpImplData->mpPrinter->EnableOutput( TRUE );
// actually print the page
mpImplData->mpPrinter->ImplStartPage();
-
+
mpImplData->mpPrinter->Push();
aCleanedFile.WindStart();
aCleanedFile.Play( mpImplData->mpPrinter.get() );
mpImplData->mpPrinter->Pop();
-
+
mpImplData->mpPrinter->ImplEndPage();
-
+
mpImplData->mpPrinter->SetDrawMode( nRestoreDrawMode );
}
@@ -1230,8 +1226,8 @@ bool PrinterController::getReversePrint() const
Sequence< PropertyValue > PrinterController::getJobProperties( const Sequence< PropertyValue >& i_rMergeList ) const
{
- boost::unordered_set< rtl::OUString, rtl::OUStringHash > aMergeSet;
- size_t nResultLen = size_t(i_rMergeList.getLength()) + mpImplData->maUIProperties.size() + 3;
+ std::hash_set< rtl::OUString, rtl::OUStringHash > aMergeSet;
+ size_t nResultLen = size_t(i_rMergeList.getLength()) + mpImplData->maUIProperties.size() + 3;
for( int i = 0; i < i_rMergeList.getLength(); i++ )
aMergeSet.insert( i_rMergeList[i].Name );
@@ -1279,14 +1275,14 @@ const Sequence< beans::PropertyValue >& PrinterController::getUIOptions() const
beans::PropertyValue* PrinterController::getValue( const rtl::OUString& i_rProperty )
{
- boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
return it != mpImplData->maPropertyToIndex.end() ? &mpImplData->maUIProperties[it->second] : NULL;
}
const beans::PropertyValue* PrinterController::getValue( const rtl::OUString& i_rProperty ) const
{
- boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
return it != mpImplData->maPropertyToIndex.end() ? &mpImplData->maUIProperties[it->second] : NULL;
}
@@ -1310,13 +1306,13 @@ void PrinterController::setValue( const rtl::OUString& i_rName, const Any& i_rVa
beans::PropertyValue aVal;
aVal.Name = i_rName;
aVal.Value = i_rValue;
-
+
setValue( aVal );
}
void PrinterController::setValue( const beans::PropertyValue& i_rValue )
{
- boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rValue.Name );
if( it != mpImplData->maPropertyToIndex.end() )
mpImplData->maUIProperties[ it->second ] = i_rValue;
@@ -1343,11 +1339,10 @@ 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 ] );
- if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
+ if( rEntry.Name.equalsAscii( "Property" ) )
{
PropertyValue aVal;
rEntry.Value >>= aVal;
@@ -1357,24 +1352,20 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
aPropName = aVal.Name;
bHaveProperty = true;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Enabled" ) ) )
+ else if( rEntry.Name.equalsAscii( "Enabled" ) )
{
sal_Bool bValue = sal_True;
rEntry.Value >>= bValue;
bIsEnabled = bValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnName" ) ) )
+ else if( rEntry.Name.equalsAscii( "DependsOnName" ) )
{
rEntry.Value >>= aDep.maDependsOnName;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnEntry" ) ) )
+ else if( rEntry.Name.equalsAscii( "DependsOnEntry" ) )
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
- else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
- {
- rEntry.Value >>= aChoicesDisabled;
- }
}
if( bHaveProperty )
{
@@ -1387,15 +1378,13 @@ 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;
}
}
}
void PrinterController::enableUIOption( const rtl::OUString& i_rProperty, bool i_bEnable )
{
- boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
if( it != mpImplData->maPropertyToIndex.end() )
{
@@ -1413,12 +1402,12 @@ void PrinterController::enableUIOption( const rtl::OUString& i_rProperty, bool i
bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) const
{
bool bEnabled = false;
- boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator prop_it =
+ std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator prop_it =
mpImplData->maPropertyToIndex.find( i_rProperty );
if( prop_it != mpImplData->maPropertyToIndex.end() )
{
bEnabled = mpImplData->maUIPropertyEnabled[prop_it->second];
-
+
if( bEnabled )
{
// check control dependencies
@@ -1429,7 +1418,7 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
// check if the dependency is enabled
// if the dependency is disabled, we are too
bEnabled = isUIOptionEnabled( it->second.maDependsOnName );
-
+
if( bEnabled )
{
// does the dependency have the correct value ?
@@ -1448,12 +1437,12 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
// could be a dependency on a checked boolean
// in this case the dependency is on a non zero for checked value
bEnabled = ( bDepVal && it->second.mnDependsOnEntry != 0) ||
- ( ! bDepVal && it->second.mnDependsOnEntry == 0);
+ ( ! bDepVal && it->second.mnDependsOnEntry == 0);
}
else
{
// if the type does not match something is awry
- OSL_FAIL( "strange type in control dependency" );
+ OSL_ENSURE( 0, "strange type in control dependency" );
bEnabled = false;
}
}
@@ -1464,20 +1453,6 @@ 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;
@@ -1486,7 +1461,7 @@ rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty
mpImplData->maControlDependencies.find( i_rProperty );
if( it != mpImplData->maControlDependencies.end() )
aDependency = it->second.maDependsOnName;
-
+
return aDependency;
}
@@ -1521,12 +1496,12 @@ rtl::OUString PrinterController::makeEnabled( const rtl::OUString& i_rProperty )
else
{
// if the type does not match something is awry
- OSL_FAIL( "strange type in control dependency" );
+ OSL_ENSURE( 0, "strange type in control dependency" );
}
}
}
}
-
+
return aDependency;
}
@@ -1553,7 +1528,7 @@ void PrinterController::createProgressDialog()
bShow = ! bApi;
}
}
-
+
if( bShow && ! Application::IsHeadlessModeEnabled() )
{
mpImplData->mpProgress = new PrintProgressDialog( NULL, getPageCountProtected() );
@@ -1590,7 +1565,7 @@ void PrinterController::pushPropertiesToPrinter()
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) );
if( pVal )
pVal->Value >>= bCollate;
- mpImplData->mpPrinter->SetCopyCount( static_cast<sal_uInt16>(nCopyCount), bCollate );
+ mpImplData->mpPrinter->SetCopyCount( static_cast<USHORT>(nCopyCount), bCollate );
// duplex mode
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DuplexMode" ) ) );
@@ -1602,7 +1577,7 @@ void PrinterController::pushPropertiesToPrinter()
{
case view::DuplexMode::OFF: mpImplData->mpPrinter->SetDuplexMode( DUPLEX_OFF ); break;
case view::DuplexMode::LONGEDGE: mpImplData->mpPrinter->SetDuplexMode( DUPLEX_LONGEDGE ); break;
- case view::DuplexMode::SHORTEDGE: mpImplData->mpPrinter->SetDuplexMode( DUPLEX_SHORTEDGE ); break;
+ case view::DuplexMode::SHORTEDGE: mpImplData->mpPrinter->SetDuplexMode( DUPLEX_SHORTEDGE ); break;
}
}
}
@@ -1634,7 +1609,7 @@ sal_Bool PrinterController::getBoolProperty( const rtl::OUString& i_rProperty, s
Any PrinterOptionsHelper::getValue( const rtl::OUString& i_rPropertyName ) const
{
Any aRet;
- boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
m_aPropertyMap.find( i_rPropertyName );
if( it != m_aPropertyMap.end() )
aRet = it->second;
@@ -1649,7 +1624,7 @@ void PrinterOptionsHelper::setValue( const rtl::OUString& i_rPropertyName, const
bool PrinterOptionsHelper::hasProperty( const rtl::OUString& i_rPropertyName ) const
{
Any aRet;
- boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
+ std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
m_aPropertyMap.find( i_rPropertyName );
return it != m_aPropertyMap.end();
}
@@ -1689,7 +1664,7 @@ bool PrinterOptionsHelper::processProperties( const Sequence< PropertyValue >& i
for( sal_Int32 i = 0; i < nElements; i++ )
{
bool bElementChanged = false;
- boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::iterator it =
+ std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::iterator it =
m_aPropertyMap.find( pVals[ i ].Name );
if( it != m_aPropertyMap.end() )
{
@@ -1724,16 +1699,16 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV
}
Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpIds,
+ const Sequence< rtl::OUString >& i_rHelpTexts,
const rtl::OUString& i_rType,
const PropertyValue* i_pVal,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
-{
+{
sal_Int32 nElements =
1 // ControlType
+ (i_rTitle.getLength() ? 1 : 0) // Text
- + (i_rHelpIds.getLength() ? 1 : 0) // HelpId
+ + (i_rHelpTexts.getLength() ? 1 : 0) // HelpText
+ (i_pVal ? 1 : 0) // Property
+ i_rControlOptions.maAddProps.getLength() // additional props
+ (i_rControlOptions.maGroupHint.getLength() ? 1 : 0) // grouping
@@ -1756,10 +1731,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_rHelpIds.getLength() )
+ if( i_rHelpTexts.getLength() )
{
- aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpId" ) );
- aCtrl[nUsed++].Value = makeAny( i_rHelpIds );
+ aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
+ aCtrl[nUsed++].Value = makeAny( i_rHelpTexts );
}
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) );
aCtrl[nUsed++].Value = makeAny( i_rType );
@@ -1798,7 +1773,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) );
aCtrl[nUsed++].Value <<= sal_False;
}
-
+
sal_Int32 nAddProps = i_rControlOptions.maAddProps.getLength();
for( sal_Int32 i = 0; i < nAddProps; i++ )
aCtrl[ nUsed++ ] = i_rControlOptions.maAddProps[i];
@@ -1808,80 +1783,74 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
return makeAny( aCtrl );
}
-Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
+Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText )
{
- Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpText;
+ if( i_rHelpText.getLength() > 0 )
{
- aHelpId.realloc( 1 );
- *aHelpId.getArray() = i_rHelpId;
+ aHelpText.realloc( 1 );
+ *aHelpText.getArray() = i_rHelpText;
}
- return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+ return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
}
Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpId,
+ const rtl::OUString& i_rHelpText,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpText;
+ if( i_rHelpText.getLength() > 0 )
{
- aHelpId.realloc( 1 );
- *aHelpId.getArray() = i_rHelpId;
+ aHelpText.realloc( 1 );
+ *aHelpText.getArray() = i_rHelpText;
}
- return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
+ return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
NULL, i_rControlOptions );
}
Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpText;
+ if( i_rHelpText.getLength() > 0 )
{
- aHelpId.realloc( 1 );
- *aHelpId.getArray() = i_rHelpId;
+ aHelpText.realloc( 1 );
+ *aHelpText.getArray() = i_rHelpText;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_bValue );
- return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
+ return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
}
Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpId,
+ const Sequence< rtl::OUString >& i_rHelpText,
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 + (i_rDisabledChoices.getLength() ? 1 : 0) );
+ aOpt.maAddProps.realloc( nUsed + 1 );
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_rHelpId, i_rType, &aVal, aOpt );
+ return getUIControlOpt( i_rTitle, i_rHelpText, i_rType, &aVal, aOpt );
}
Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue,
@@ -1900,17 +1869,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
aOpt.maAddProps[nUsed++].Value = makeAny( i_nMaxValue );
}
- Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpText;
+ if( i_rHelpText.getLength() > 0 )
{
- aHelpId.realloc( 1 );
- *aHelpId.getArray() = i_rHelpId;
+ aHelpText.realloc( 1 );
+ *aHelpText.getArray() = i_rHelpText;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
return getUIControlOpt( i_rTitle,
- aHelpId,
+ aHelpText,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ),
&aVal,
aOpt
@@ -1918,23 +1887,23 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
}
Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpId,
+ const rtl::OUString& i_rHelpText,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpText;
+ if( i_rHelpText.getLength() > 0 )
{
- aHelpId.realloc( 1 );
- *aHelpId.getArray() = i_rHelpId;
+ aHelpText.realloc( 1 );
+ *aHelpText.getArray() = i_rHelpText;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_rValue );
return getUIControlOpt( i_rTitle,
- aHelpId,
+ aHelpText,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ),
&aVal,
i_rControlOptions
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index 21c82cd51f3a..1539f856570d 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,15 +56,15 @@
ImplRegionBand::ImplRegionBand( long nTop, long nBottom )
{
// save boundaries
- mnYTop = nTop;
- mnYBottom = nBottom;
+ mnYTop = nTop;
+ mnYBottom = nBottom;
// initialize lists
- mpNextBand = NULL;
- mpPrevBand = NULL;
- mpFirstSep = NULL;
- mpFirstBandPoint = NULL;
- mbTouched = sal_False;
+ mpNextBand = NULL;
+ mpPrevBand = NULL;
+ mpFirstSep = NULL;
+ mpFirstBandPoint = NULL;
+ mbTouched = FALSE;
}
// -----------------------------------------------------------------------
@@ -74,15 +74,15 @@ ImplRegionBand::ImplRegionBand(
const bool bIgnorePoints)
{
// copy boundaries
- mnYTop = rRegionBand.mnYTop;
- mnYBottom = rRegionBand.mnYBottom;
- mbTouched = rRegionBand.mbTouched;
+ mnYTop = rRegionBand.mnYTop;
+ mnYBottom = rRegionBand.mnYBottom;
+ mbTouched = rRegionBand.mbTouched;
// initialisation
- mpNextBand = NULL;
- mpPrevBand = NULL;
- mpFirstSep = NULL;
- mpFirstBandPoint = NULL;
+ mpNextBand = NULL;
+ mpPrevBand = NULL;
+ mpFirstSep = NULL;
+ mpFirstBandPoint = NULL;
// copy all elements of the list with separations
ImplRegionBandSep* pNewSep;
@@ -91,11 +91,11 @@ ImplRegionBand::ImplRegionBand(
while ( pSep )
{
// create new and copy data
- pNewSep = new ImplRegionBandSep;
- pNewSep->mnXLeft = pSep->mnXLeft;
- pNewSep->mnXRight = pSep->mnXRight;
- pNewSep->mbRemoved = pSep->mbRemoved;
- pNewSep->mpNextSep = NULL;
+ pNewSep = new ImplRegionBandSep;
+ pNewSep->mnXLeft = pSep->mnXLeft;
+ pNewSep->mnXRight = pSep->mnXRight;
+ pNewSep->mbRemoved = pSep->mbRemoved;
+ pNewSep->mpNextSep = NULL;
if ( pSep == rRegionBand.mpFirstSep )
mpFirstSep = pNewSep;
else
@@ -117,7 +117,7 @@ ImplRegionBand::ImplRegionBand(
pPointCopy->mnLineId = pPoint->mnLineId;
pPointCopy->mbEndPoint = pPoint->mbEndPoint;
pPointCopy->meLineType = pPoint->meLineType;
-
+
if (pPrevPointCopy != NULL)
pPrevPointCopy->mpNextBandPoint = pPointCopy;
else
@@ -213,18 +213,18 @@ void ImplRegionBand::ProcessPoints()
// generate separations from lines and process union with existing
// separations
-sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
- sal_Bool bEndPoint, LineType eLineType )
+BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
+ BOOL bEndPoint, LineType eLineType )
{
if ( !mpFirstBandPoint )
{
- mpFirstBandPoint = new ImplRegionBandPoint;
- mpFirstBandPoint->mnX = nX;
- mpFirstBandPoint->mnLineId = nLineId;
- mpFirstBandPoint->mbEndPoint = bEndPoint;
- mpFirstBandPoint->meLineType = eLineType;
+ mpFirstBandPoint = new ImplRegionBandPoint;
+ mpFirstBandPoint->mnX = nX;
+ mpFirstBandPoint->mnLineId = nLineId;
+ mpFirstBandPoint->mbEndPoint = bEndPoint;
+ mpFirstBandPoint->meLineType = eLineType;
mpFirstBandPoint->mpNextBandPoint = NULL;
- return sal_True;
+ return TRUE;
}
// look if line allready touched the band
@@ -243,8 +243,8 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
{
// if we've only got one point => replace first point
pRegionBandPoint->mnX = nX;
- pRegionBandPoint->mbEndPoint = sal_True;
- return sal_True;
+ pRegionBandPoint->mbEndPoint = TRUE;
+ return TRUE;
}
else
{
@@ -268,7 +268,7 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
}
}
else
- return sal_False;
+ return FALSE;
}
// use next element
@@ -278,7 +278,7 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
// search appropriate position and insert point into the list
ImplRegionBandPoint* pNewRegionBandPoint;
-
+
pRegionBandPoint = mpFirstBandPoint;
pLastTestedRegionBandPoint = NULL;
while ( pRegionBandPoint )
@@ -286,12 +286,12 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
// new point completly left? -> insert as first point
if ( nX <= pRegionBandPoint->mnX )
{
- pNewRegionBandPoint = new ImplRegionBandPoint;
- pNewRegionBandPoint->mnX = nX;
- pNewRegionBandPoint->mnLineId = nLineId;
- pNewRegionBandPoint->mbEndPoint = bEndPoint;
- pNewRegionBandPoint->meLineType = eLineType;
- pNewRegionBandPoint->mpNextBandPoint = pRegionBandPoint;
+ pNewRegionBandPoint = new ImplRegionBandPoint;
+ pNewRegionBandPoint->mnX = nX;
+ pNewRegionBandPoint->mnLineId = nLineId;
+ pNewRegionBandPoint->mbEndPoint = bEndPoint;
+ pNewRegionBandPoint->meLineType = eLineType;
+ pNewRegionBandPoint->mpNextBandPoint = pRegionBandPoint;
// connections to the new point
if ( !pLastTestedRegionBandPoint )
@@ -299,7 +299,7 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
else
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return sal_True;
+ return TRUE;
}
// use next element
@@ -308,17 +308,17 @@ sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
}
// not inserted -> add to the end of the list
- pNewRegionBandPoint = new ImplRegionBandPoint;
- pNewRegionBandPoint->mnX = nX;
- pNewRegionBandPoint->mnLineId = nLineId;
- pNewRegionBandPoint->mbEndPoint = bEndPoint;
- pNewRegionBandPoint->meLineType = eLineType;
- pNewRegionBandPoint->mpNextBandPoint = NULL;
+ pNewRegionBandPoint = new ImplRegionBandPoint;
+ pNewRegionBandPoint->mnX = nX;
+ pNewRegionBandPoint->mnLineId = nLineId;
+ pNewRegionBandPoint->mbEndPoint = bEndPoint;
+ pNewRegionBandPoint->meLineType = eLineType;
+ pNewRegionBandPoint->mpNextBandPoint = NULL;
// connections to the new point
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -342,8 +342,8 @@ void ImplRegionBand::ScaleX( double fHorzScale )
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
- pSep->mnXLeft = FRound( pSep->mnXLeft * fHorzScale );
- pSep->mnXRight = FRound( pSep->mnXRight * fHorzScale );
+ pSep->mnXLeft = FRound( pSep->mnXLeft * fHorzScale );
+ pSep->mnXRight = FRound( pSep->mnXRight * fHorzScale );
pSep = pSep->mpNextSep;
}
}
@@ -352,7 +352,7 @@ void ImplRegionBand::ScaleX( double fHorzScale )
//
// combine overlaping sparations
-sal_Bool ImplRegionBand::OptimizeBand()
+BOOL ImplRegionBand::OptimizeBand()
{
ImplRegionBandSep* pPrevSep = 0;
ImplRegionBandSep* pSep = mpFirstSep;
@@ -390,7 +390,7 @@ sal_Bool ImplRegionBand::OptimizeBand()
pSep = pSep->mpNextSep;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -402,11 +402,11 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
// band empty? -> add element
if ( !mpFirstSep )
{
- mpFirstSep = new ImplRegionBandSep;
- mpFirstSep->mnXLeft = nXLeft;
- mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = sal_False;
- mpFirstSep->mpNextSep = NULL;
+ mpFirstSep = new ImplRegionBandSep;
+ mpFirstSep->mnXLeft = nXLeft;
+ mpFirstSep->mnXRight = nXRight;
+ mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mpNextSep = NULL;
return;
}
@@ -423,10 +423,10 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
// new separation completly left? -> new separation!
if ( nXRight < pSep->mnXLeft )
{
- pNewSep = new ImplRegionBandSep;
- pNewSep->mnXLeft = nXLeft;
- pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = sal_False;
+ pNewSep = new ImplRegionBandSep;
+ pNewSep->mnXLeft = nXLeft;
+ pNewSep->mnXRight = nXRight;
+ pNewSep->mbRemoved = FALSE;
pNewSep->mpNextSep = pSep;
if ( pSep == mpFirstSep )
@@ -450,13 +450,13 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
// not inserted, but last element? -> add to the end of the list
if ( !pSep->mpNextSep && (nXLeft > pSep->mnXRight) )
{
- pNewSep = new ImplRegionBandSep;
- pNewSep->mnXLeft = nXLeft;
- pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = sal_False;
+ pNewSep = new ImplRegionBandSep;
+ pNewSep->mnXLeft = nXLeft;
+ pNewSep->mnXRight = nXRight;
+ pNewSep->mbRemoved = FALSE;
- pSep->mpNextSep = pNewSep;
- pNewSep->mpNextSep = NULL;
+ pSep->mpNextSep = pNewSep;
+ pNewSep->mpNextSep = NULL;
break;
}
@@ -474,7 +474,7 @@ void ImplRegionBand::Intersect( long nXLeft, long nXRight )
DBG_ASSERT( nXLeft <= nXRight, "ImplRegionBand::Intersect(): nxLeft > nXRight" );
// band has been touched
- mbTouched = sal_True;
+ mbTouched = 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 = sal_True;
+ pSep->mbRemoved = 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 = sal_True;
+ mbTouched = TRUE;
// band empty? -> nothing to do
if ( !mpFirstSep )
@@ -533,14 +533,14 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
- sal_Bool bSepProcessed = sal_False;
+ BOOL bSepProcessed = FALSE;
// new separation completely overlapping? -> remove separation
if ( (nXLeft <= pSep->mnXLeft) && (nXRight >= pSep->mnXRight) )
{
// will be removed from the optimizer
- pSep->mbRemoved = sal_True;
- bSepProcessed = sal_True;
+ pSep->mbRemoved = TRUE;
+ bSepProcessed = 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 = sal_True;
+ bSepProcessed = TRUE;
}
}
@@ -559,7 +559,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
if ( (nXLeft <= pSep->mnXRight) && (nXRight > pSep->mnXRight) )
{
pSep->mnXRight = nXLeft-1;
- bSepProcessed = sal_True;
+ bSepProcessed = TRUE;
}
}
@@ -569,10 +569,10 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
{
if ( (nXLeft >= pSep->mnXLeft) && (nXRight <= pSep->mnXRight) )
{
- pNewSep = new ImplRegionBandSep;
- pNewSep->mnXLeft = pSep->mnXLeft;
- pNewSep->mnXRight = nXLeft-1;
- pNewSep->mbRemoved = sal_False;
+ pNewSep = new ImplRegionBandSep;
+ pNewSep->mnXLeft = pSep->mnXLeft;
+ pNewSep->mnXRight = nXLeft-1;
+ pNewSep->mbRemoved = FALSE;
pSep->mnXLeft = nXRight+1;
@@ -609,29 +609,29 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// order, and added four more cases. The code below references
// those numbers via #1, #2, etc.
//
- // Num Mnem newX:oldX newY:oldY Description Result Can quit?
+ // Num Mnem newX:oldX newY:oldY Description Result Can quit?
//
- // #1 Empty band - - The band is empty, thus, simply add new bandSep just add Yes
+ // #1 Empty band - - The band is empty, thus, simply add new bandSep just add Yes
//
- // #2 apart - - The rectangles are disjunct, add new one as is just add Yes
+ // #2 apart - - The rectangles are disjunct, add new one as is just add Yes
//
- // #3 atop == == The rectangles are _exactly_ the same, remove existing just remove Yes
+ // #3 atop == == The rectangles are _exactly_ the same, remove existing just remove Yes
//
- // #4 around < > The new rectangle extends the old to both sides intersect No
+ // #4 around < > The new rectangle extends the old to both sides intersect No
//
- // #5 left < < The new rectangle is left of the old (but intersects) intersect Yes
+ // #5 left < < The new rectangle is left of the old (but intersects) intersect Yes
//
- // #5b left-atop < == The new is left of the old, and coincides on the right intersect Yes
+ // #5b left-atop < == The new is left of the old, and coincides on the right intersect Yes
//
- // #6 right > > The new is right of the old (but intersects) intersect No
+ // #6 right > > The new is right of the old (but intersects) intersect No
//
- // #6b right-atop == > The new is right of the old, and coincides on the left intersect No
+ // #6b right-atop == > The new is right of the old, and coincides on the left intersect No
//
- // #7 inside > < The new is fully inside the old intersect Yes
+ // #7 inside > < The new is fully inside the old intersect Yes
//
- // #8 inside-right > == The new is fully inside the old, coincides on the right intersect Yes
+ // #8 inside-right > == The new is fully inside the old, coincides on the right intersect Yes
//
- // #9 inside-left == < The new is fully inside the old, coincides on the left intersect Yes
+ // #9 inside-left == < The new is fully inside the old, coincides on the left intersect Yes
//
//
// Then, to correctly perform XOr, the segment that's switched off
@@ -645,15 +645,15 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// trailing band sep from 11 to 14. This mimicks the xor look of a
// bitmap operation.
//
-
+
// band empty? -> add element
if ( !mpFirstSep )
{
- mpFirstSep = new ImplRegionBandSep;
- mpFirstSep->mnXLeft = nXLeft;
- mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = sal_False;
- mpFirstSep->mpNextSep = NULL;
+ mpFirstSep = new ImplRegionBandSep;
+ mpFirstSep->mnXLeft = nXLeft;
+ mpFirstSep->mnXRight = nXRight;
+ mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mpNextSep = NULL;
return;
}
@@ -681,11 +681,11 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep;
- pNewSep->mbRemoved = sal_False;
-
+ pNewSep->mbRemoved = FALSE;
+
// connections from the new separation
pNewSep->mpNextSep = pSep;
-
+
// connections to the new separation
if ( pSep == mpFirstSep )
mpFirstSep = pNewSep;
@@ -697,7 +697,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
else if( nXLeft == nOldLeft && nXRight == nOldRight )
{
// #3
- pSep->mbRemoved = sal_True;
+ pSep->mbRemoved = TRUE;
pPrevSep = NULL; // do not run accidentally into the "right" case when breaking the loop
break;
}
@@ -730,12 +730,12 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// cannot break here, simply mark segment as removed,
// and go on with adapted nXLeft/nXRight
- pSep->mbRemoved = sal_True;
+ pSep->mbRemoved = TRUE;
}
else
{
pSep->mnXLeft = nXRight+1; // 9
-
+
pPrevSep = NULL; // do not run accidentally into the "right" case when breaking the loop
break;
}
@@ -747,7 +747,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
"ImplRegionBand::XOr(): Case 4,5,6,7 expected all coordinates to be not equal!" );
// The plain-jane check would look like this:
- //
+ //
// if( nXLeft < nOldLeft )
// {
// // #4,5
@@ -772,7 +772,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// // #7 done!
// }
// }
- //
+ //
// but since we generally don't have to care whether
// it's 4 or 6 (only that we must not stop processing
// here), condensed that in such a way that only the
@@ -810,17 +810,17 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep->mpNextSep;
- pNewSep->mbRemoved = sal_False;
-
+ pNewSep->mbRemoved = FALSE;
+
// connections from the new separation
pSep->mpNextSep = pNewSep;
-
+
pPrevSep = NULL; // do not run accidentally into the "right" case when breaking the loop
break;
}
}
}
-
+
pPrevSep = pSep;
pSep = pSep->mpNextSep;
}
@@ -832,61 +832,61 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = NULL;
- pNewSep->mbRemoved = sal_False;
-
+ pNewSep->mbRemoved = FALSE;
+
// connections from the new separation
pPrevSep->mpNextSep = pNewSep;
}
-
+
OptimizeBand();
}
// -----------------------------------------------------------------------
-sal_Bool ImplRegionBand::IsInside( long nX )
+BOOL ImplRegionBand::IsInside( long nX )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft <= nX) && (pSep->mnXRight >= nX) )
- return sal_True;
+ return TRUE;
pSep = pSep->mpNextSep;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplRegionBand::IsOver( long nLeft, long nRight )
+BOOL ImplRegionBand::IsOver( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft < nRight) && (pSep->mnXRight > nLeft) )
- return sal_True;
+ return TRUE;
pSep = pSep->mpNextSep;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplRegionBand::IsInside( long nLeft, long nRight )
+BOOL ImplRegionBand::IsInside( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft >= nLeft) && (nRight <= pSep->mnXRight) )
- return sal_True;
+ return TRUE;
pSep = pSep->mpNextSep;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -913,22 +913,22 @@ long ImplRegionBand::GetXRightBoundary() const
// -----------------------------------------------------------------------
-sal_Bool ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
+BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
{
- ImplRegionBandSep* pOwnRectBandSep = mpFirstSep;
- ImplRegionBandSep* pSecondRectBandSep = rRegionBand.mpFirstSep;
+ ImplRegionBandSep* pOwnRectBandSep = mpFirstSep;
+ ImplRegionBandSep* pSecondRectBandSep = rRegionBand.mpFirstSep;
while ( pOwnRectBandSep && pSecondRectBandSep )
{
// get boundaries of current rectangle
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return sal_False;
+ return FALSE;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return sal_False;
+ return FALSE;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -939,9 +939,9 @@ sal_Bool ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
// differnt number of separations?
if ( pOwnRectBandSep || pSecondRectBandSep )
- return sal_False;
+ return FALSE;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 480a17a9f88b..48a5d62feee5 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,8 +41,6 @@
#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>
@@ -81,19 +79,19 @@ namespace {
bool ImplIsPolygonRectilinear (const PolyPolygon& rPolyPoly)
{
// Iterate over all polygons.
- const sal_uInt16 nPolyCount = rPolyPoly.Count();
- for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const USHORT nPolyCount = rPolyPoly.Count();
+ for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
- const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
+ const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const sal_uInt16 nSize = aPoly.GetSize();
+ const USHORT nSize = aPoly.GetSize();
if (nSize < 2)
continue;
Point aPoint (aPoly.GetPoint(0));
const Point aLastPoint (aPoint);
- for (sal_uInt16 nPoint = 1; nPoint < nSize; ++nPoint)
+ for (USHORT nPoint = 1; nPoint < nSize; ++nPoint)
{
const Point aNextPoint (aPoly.GetPoint(nPoint));
// When there is at least one edge that is neither vertical nor
@@ -185,20 +183,20 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
long nLineId = 0L;
// Iterate over all polygons.
- const sal_uInt16 nPolyCount = rPolyPoly.Count();
- for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const USHORT nPolyCount = rPolyPoly.Count();
+ for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
- const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
+ const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const sal_uInt16 nSize = aPoly.GetSize();
+ const USHORT 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 (sal_uInt16 nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
+ for (USHORT nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
{
// We take the implicit closing edge into account by mapping
// index nSize to 0.
@@ -218,7 +216,7 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
const long nTop (::std::min(aStart.Y(), aEnd.Y()));
const long nBottom (::std::max(aStart.Y(), aEnd.Y()));
const LineType eLineType (aStart.Y() > aEnd.Y() ? LINE_DESCENDING : LINE_ASCENDING);
-
+
// Make sure that the current line is covered by bands.
ImplAddMissingBands(pImplRegion, nTop,nBottom);
@@ -264,7 +262,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++, sal_True, eLineType);
+ pBand->InsertPoint(aStart.X(), nLineId++, TRUE, eLineType);
}
}
@@ -286,21 +284,21 @@ ImplRegion* ImplGeneralPolygonToBands (
// initialisation and creation of Bands
ImplRegion* pImplRegion = new ImplRegion();
pImplRegion->CreateBandRange( rPolygonBoundingBox.Top(), rPolygonBoundingBox.Bottom() );
-
+
// insert polygons
- const sal_uInt16 nPolyCount = rPolyPoly.Count();
- for ( sal_uInt16 nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ const USHORT nPolyCount = rPolyPoly.Count();
+ for ( USHORT nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
// get reference to current polygon
- const Polygon& aPoly = rPolyPoly.GetObject( nPoly );
- const sal_uInt16 nSize = aPoly.GetSize();
+ const Polygon& aPoly = rPolyPoly.GetObject( nPoly );
+ const USHORT nSize = aPoly.GetSize();
// not enough points ( <= 2 )? -> nothing to do!
if ( nSize <= 2 )
continue;
// band the polygon
- for ( sal_uInt16 nPoint = 1; nPoint < nSize; nPoint++ )
+ for ( USHORT 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
@@ -322,7 +320,7 @@ ImplRegion* ImplGeneralPolygonToBands (
#ifdef DBG_UTIL
const char* ImplDbgTestRegion( const void* pObj )
{
- Region* pRegion = (Region*)pObj;
+ Region* pRegion = (Region*)pObj;
ImplRegion* pImplRegion = pRegion->ImplGetImplRegion();
if ( aImplNullRegion.mnRefCount )
@@ -340,8 +338,8 @@ const char* ImplDbgTestRegion( const void* pObj )
if ( (pImplRegion != &aImplEmptyRegion) && (pImplRegion != &aImplNullRegion) )
{
- sal_uLong nCount = 0;
- const ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand();
+ ULONG nCount = 0;
+ const ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand();
while ( pBand )
{
if ( pBand->mnYBottom < pBand->mnYTop )
@@ -422,27 +420,27 @@ inline void Region::ImplPolyPolyRegionToBandRegion()
// =======================================================================
ImplRegionBase::ImplRegionBase( int nRefCount )
-: mnRefCount( nRefCount )
-, mnRectCount( 0 )
-, mpPolyPoly( NULL )
-, mpB2DPolyPoly( NULL )
+: mnRefCount( nRefCount )
+, mnRectCount( 0 )
+, mpPolyPoly( NULL )
+, mpB2DPolyPoly( NULL )
{}
// ------------------------------------------------------------------------
ImplRegion::ImplRegion()
{
- mpFirstBand = NULL;
- mpLastCheckedBand = NULL;
+ mpFirstBand = NULL;
+ mpLastCheckedBand = NULL;
}
// ------------------------------------------------------------------------
ImplRegion::ImplRegion( const PolyPolygon& rPolyPoly )
{
- mpFirstBand = NULL;
- mpLastCheckedBand = NULL;
- mpPolyPoly = new PolyPolygon( rPolyPoly );
+ mpFirstBand = NULL;
+ mpLastCheckedBand = NULL;
+ mpPolyPoly = new PolyPolygon( rPolyPoly );
}
// ------------------------------------------------------------------------
@@ -457,7 +455,7 @@ ImplRegion::ImplRegion( const basegfx::B2DPolyPolygon& rPolyPoly )
// -----------------------------------------------------------------------
ImplRegion::ImplRegion( const ImplRegion& rImplRegion )
-: ImplRegionBase()
+: ImplRegionBase()
{
mpFirstBand = NULL;
mpLastCheckedBand = NULL;
@@ -538,14 +536,14 @@ void ImplRegion::CreateBandRange( long nYTop, long nYBottom )
// -----------------------------------------------------------------------
-sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
+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 sal_True;
+ return TRUE;
LineType eLineType = (rStartPt.Y() > rEndPt.Y()) ? LINE_DESCENDING : LINE_ASCENDING;
if ( rStartPt.X() == rEndPt.X() )
@@ -579,20 +577,20 @@ sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
}
else if ( rStartPt.Y() != rEndPt.Y() )
{
- const long nDX = labs( rEndPt.X() - rStartPt.X() );
- const long nDY = labs( rEndPt.Y() - rStartPt.Y() );
- const long nStartX = rStartPt.X();
- const long nStartY = rStartPt.Y();
- const long nEndX = rEndPt.X();
- const long nEndY = rEndPt.Y();
- const long nXInc = ( nStartX < nEndX ) ? 1L : -1L;
- const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
+ const long nDX = labs( rEndPt.X() - rStartPt.X() );
+ const long nDY = labs( rEndPt.Y() - rStartPt.Y() );
+ const long nStartX = rStartPt.X();
+ const long nStartY = rStartPt.Y();
+ const long nEndX = rEndPt.X();
+ const long nEndY = rEndPt.Y();
+ const long nXInc = ( nStartX < nEndX ) ? 1L : -1L;
+ const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
if ( nDX >= nDY )
{
- const long nDYX = ( nDY - nDX ) << 1;
- const long nDY2 = nDY << 1;
- long nD = nDY2 - nDX;
+ const long nDYX = ( nDY - nDX ) << 1;
+ const long nDY2 = nDY << 1;
+ long nD = nDY2 - nDX;
for ( nX = nStartX, nY = nStartY; nX != nEndX; nX += nXInc )
{
@@ -606,9 +604,9 @@ sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
}
else
{
- const long nDYX = ( nDX - nDY ) << 1;
- const long nDY2 = nDX << 1;
- long nD = nDY2 - nDY;
+ const long nDYX = ( nDX - nDY ) << 1;
+ const long nDY2 = nDX << 1;
+ long nD = nDY2 - nDY;
for ( nX = nStartX, nY = nStartY; nY != nEndY; nY += nYInc )
{
@@ -622,25 +620,25 @@ sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
}
// last point
- InsertPoint( Point( nEndX, nEndY ), nLineId, sal_True, eLineType );
+ InsertPoint( Point( nEndX, nEndY ), nLineId, TRUE, eLineType );
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
//
// search for appropriate place for the new point
-sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
- sal_Bool bEndPoint, LineType eLineType )
+BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
+ 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 sal_True;
+ return TRUE;
}
if ( rPoint.Y() > mpLastCheckedBand->mnYTop )
@@ -652,13 +650,13 @@ sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return sal_True;
+ return TRUE;
}
mpLastCheckedBand = mpLastCheckedBand->mpNextBand;
}
- OSL_FAIL( "ImplRegion::InsertPoint reached the end of the list!" );
+ DBG_ERROR( "ImplRegion::InsertPoint reached the end of the list!" );
}
else
{
@@ -669,21 +667,21 @@ sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return sal_True;
+ return TRUE;
}
mpLastCheckedBand = mpLastCheckedBand->mpPrevBand;
}
- OSL_FAIL( "ImplRegion::InsertPoint reached the beginning of the list!" );
+ DBG_ERROR( "ImplRegion::InsertPoint reached the beginning of the list!" );
}
- OSL_FAIL( "ImplRegion::InsertPoint point not inserted!" );
+ DBG_ERROR( "ImplRegion::InsertPoint point not inserted!" );
// reinitialize pointer (should never be reached!)
mpLastCheckedBand = mpFirstBand;
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -701,9 +699,9 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
}
// find/insert bands for the boundaries of the rectangle
- sal_Bool bTopBoundaryInserted = sal_False;
- sal_Bool bTop2BoundaryInserted = sal_False;
- sal_Bool bBottomBoundaryInserted = sal_False;
+ BOOL bTopBoundaryInserted = FALSE;
+ BOOL bTop2BoundaryInserted = FALSE;
+ BOOL bBottomBoundaryInserted = FALSE;
// special case: top boundary is above the first band
ImplRegionBand* pNewBand;
@@ -718,7 +716,7 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
pNewBand->mpNextBand = mpFirstBand;
mpFirstBand = pNewBand;
- bTopBoundaryInserted = sal_True;
+ bTopBoundaryInserted = TRUE;
}
// insert band(s) into the list
@@ -762,13 +760,13 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
//
// create new band and insert it into the list
-sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
+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 sal_True;
+ return TRUE;
// insert single height band on top?
ImplRegionBand* pNewBand;
@@ -783,7 +781,7 @@ sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition;
pBand->mpNextBand = pNewBand;
- return sal_True;
+ return TRUE;
}
// top of new rectangle within the current band? -> insert new band and copy data
@@ -810,7 +808,7 @@ sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition - 1;
pBand->mpNextBand = pNewBand;
- return sal_True;
+ return TRUE;
}
// create new band behind the current in the list
@@ -827,7 +825,7 @@ sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return sal_True;
+ return TRUE;
}
if ( nYBandPosition > pBand->mnYBottom )
@@ -837,11 +835,11 @@ sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
// ------------------------------------------------------------------------
@@ -891,7 +889,7 @@ void ImplRegion::Union( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- OSL_FAIL( "ImplRegion::Union() - Bands not sorted!" );
+ DBG_ERROR( "ImplRegion::Union() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -928,7 +926,7 @@ void ImplRegion::Exclude( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- OSL_FAIL( "ImplRegion::Exclude() - Bands not sorted!" );
+ DBG_ERROR( "ImplRegion::Exclude() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -965,7 +963,7 @@ void ImplRegion::XOr( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- OSL_FAIL( "ImplRegion::XOr() - Bands not sorted!" );
+ DBG_ERROR( "ImplRegion::XOr() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -982,7 +980,7 @@ void ImplRegion::XOr( long nLeft, long nTop, long nRight, long nBottom )
//
// remove empty bands
-sal_Bool ImplRegion::OptimizeBandList()
+BOOL ImplRegion::OptimizeBandList()
{
DBG_ASSERT( (this != &aImplNullRegion) && (this != &aImplEmptyRegion),
"ImplRegion::OptimizeBandList() - Empty oder NULL-Region" );
@@ -993,7 +991,7 @@ sal_Bool ImplRegion::OptimizeBandList()
ImplRegionBand* pBand = mpFirstBand;
while ( pBand )
{
- const sal_Bool bBTEqual = pBand->mpNextBand &&
+ const BOOL bBTEqual = pBand->mpNextBand &&
(pBand->mnYBottom == pBand->mpNextBand->mnYTop);
// no separation? -> remove!
@@ -1056,12 +1054,12 @@ sal_Bool ImplRegion::OptimizeBandList()
"Exiting ImplRegion::OptimizeBandList(): empty band in region!" );
if ( pBand->mnYBottom < pBand->mnYTop )
- OSL_FAIL( "ImplRegion::OptimizeBandList(): YBottomBoundary < YTopBoundary" );
+ DBG_ERROR( "ImplRegion::OptimizeBandList(): YBottomBoundary < YTopBoundary" );
if ( pBand->mpNextBand )
{
if ( pBand->mnYBottom >= pBand->mpNextBand->mnYTop )
- OSL_FAIL( "ImplRegion::OptimizeBandList(): overlapping bands in region!" );
+ DBG_ERROR( "ImplRegion::OptimizeBandList(): overlapping bands in region!" );
}
pBand = pBand->mpNextBand;
@@ -1180,10 +1178,10 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect )
else
{
// get justified rectangle
- long nTop = Min( rRect.Top(), rRect.Bottom() );
- long nBottom = Max( rRect.Top(), rRect.Bottom() );
- long nLeft = Min( rRect.Left(), rRect.Right() );
- long nRight = Max( rRect.Left(), rRect.Right() );
+ long nTop = Min( rRect.Top(), rRect.Bottom() );
+ long nBottom = Max( rRect.Top(), rRect.Bottom() );
+ long nLeft = Min( rRect.Left(), rRect.Right() );
+ long nRight = Max( rRect.Left(), rRect.Right() );
// create instance of implementation class
mpImplRegion = new ImplRegion();
@@ -1201,7 +1199,7 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect )
void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
{
- const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ const USHORT nPolyCount = rPolyPoly.Count();
if ( nPolyCount )
{
// polypolygon empty? -> empty region
@@ -1365,35 +1363,13 @@ void Region::Scale( double fScaleX, double fScaleY )
// -----------------------------------------------------------------------
-sal_Bool Region::Union( const Rectangle& rRect )
+BOOL Region::Union( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- 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;
- }
+ return TRUE;
ImplPolyPolyRegionToBandRegion();
@@ -1406,10 +1382,10 @@ sal_Bool Region::Union( const Rectangle& rRect )
ImplCopyData();
// get justified rectangle
- long nLeft = Min( rRect.Left(), rRect.Right() );
- long nTop = Min( rRect.Top(), rRect.Bottom() );
- long nRight = Max( rRect.Left(), rRect.Right() );
- long nBottom = Max( rRect.Top(), rRect.Bottom() );
+ long nLeft = Min( rRect.Left(), rRect.Right() );
+ long nTop = Min( rRect.Top(), rRect.Bottom() );
+ long nRight = Max( rRect.Left(), rRect.Right() );
+ long nBottom = Max( rRect.Top(), rRect.Bottom() );
// insert bands if the boundaries are not allready in the list
mpImplRegion->InsertBands( nTop, nBottom );
@@ -1424,12 +1400,12 @@ sal_Bool Region::Union( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Region::Intersect( const Rectangle& rRect )
+BOOL Region::Intersect( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -1445,7 +1421,7 @@ sal_Bool Region::Intersect( const Rectangle& rRect )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return sal_True;
+ return TRUE;
}
// #103137# Avoid banding for special cases
@@ -1463,36 +1439,20 @@ sal_Bool Region::Intersect( const Rectangle& rRect )
// unnecessary banding
mpImplRegion->mpPolyPoly->Clip( rRect );
- 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;
+ return TRUE;
}
else
ImplPolyPolyRegionToBandRegion();
// is region empty? -> nothing to do!
if ( mpImplRegion == &aImplEmptyRegion )
- return sal_True;
+ return TRUE;
// get justified rectangle
- long nLeft = Min( rRect.Left(), rRect.Right() );
- long nTop = Min( rRect.Top(), rRect.Bottom() );
- long nRight = Max( rRect.Left(), rRect.Right() );
- long nBottom = Max( rRect.Top(), rRect.Bottom() );
+ long nLeft = Min( rRect.Left(), rRect.Right() );
+ long nTop = Min( rRect.Top(), rRect.Bottom() );
+ long nRight = Max( rRect.Left(), rRect.Right() );
+ long nBottom = Max( rRect.Top(), rRect.Bottom() );
// is own region NULL-region? -> copy data!
if ( mpImplRegion == &aImplNullRegion )
@@ -1507,7 +1467,7 @@ sal_Bool Region::Intersect( const Rectangle& rRect )
mpImplRegion->mpFirstBand->Union( nLeft, nRight );
mpImplRegion->mnRectCount = 1;
- return sal_True;
+ return TRUE;
}
// no own instance data? -> make own copy!
@@ -1551,53 +1511,34 @@ sal_Bool Region::Intersect( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Region::Exclude( const Rectangle& rRect )
+BOOL Region::Exclude( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- 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;
- }
+ return TRUE;
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_True;
+ return TRUE;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
ImplCopyData();
// get justified rectangle
- long nLeft = Min( rRect.Left(), rRect.Right() );
- long nTop = Min( rRect.Top(), rRect.Bottom() );
- long nRight = Max( rRect.Left(), rRect.Right() );
- long nBottom = Max( rRect.Top(), rRect.Bottom() );
+ long nLeft = Min( rRect.Left(), rRect.Right() );
+ long nTop = Min( rRect.Top(), rRect.Bottom() );
+ long nRight = Max( rRect.Left(), rRect.Right() );
+ long nBottom = Max( rRect.Top(), rRect.Bottom() );
// insert bands if the boundaries are not allready in the list
mpImplRegion->InsertBands( nTop, nBottom );
@@ -1612,40 +1553,18 @@ sal_Bool Region::Exclude( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool Region::XOr( const Rectangle& rRect )
+BOOL Region::XOr( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- 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;
- }
+ return TRUE;
ImplPolyPolyRegionToBandRegion();
@@ -1658,10 +1577,10 @@ sal_Bool Region::XOr( const Rectangle& rRect )
ImplCopyData();
// get justified rectangle
- long nLeft = Min( rRect.Left(), rRect.Right() );
- long nTop = Min( rRect.Top(), rRect.Bottom() );
- long nRight = Max( rRect.Left(), rRect.Right() );
- long nBottom = Max( rRect.Top(), rRect.Bottom() );
+ long nLeft = Min( rRect.Left(), rRect.Right() );
+ long nTop = Min( rRect.Top(), rRect.Bottom() );
+ long nRight = Max( rRect.Left(), rRect.Right() );
+ long nBottom = Max( rRect.Top(), rRect.Bottom() );
// insert bands if the boundaries are not allready in the list
mpImplRegion->InsertBands( nTop, nBottom );
@@ -1676,48 +1595,21 @@ sal_Bool Region::XOr( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return 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 );
-
- basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
-
- *this = Region( aClip );
-}
-
-sal_Bool Region::Union( const Region& rRegion )
+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 sal_True;
+ return TRUE;
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
@@ -1753,50 +1645,28 @@ sal_Bool Region::Union( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-void Region::ImplIntersectWithPolyPolygon( const Region& i_rRegion )
-{
- // get this B2DPolyPolygon
- basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
- if( aThisPolyPoly.count() == 0 )
- {
- *this = i_rRegion;
- return;
- }
-
- // 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 )
+BOOL Region::Intersect( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// same instance data? -> nothing to do!
if ( mpImplRegion == rRegion.mpImplRegion )
- return sal_True;
-
- if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
- {
- ImplIntersectWithPolyPolygon( rRegion );
- return sal_True;
- }
-
+ return TRUE;
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
if ( mpImplRegion == &aImplEmptyRegion )
- return sal_True;
+ return TRUE;
// is region null? -> nothing to do
if ( rRegion.mpImplRegion == &aImplNullRegion )
- return sal_True;
+ return TRUE;
// is rectangle empty? -> nothing to do
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
@@ -1810,7 +1680,7 @@ sal_Bool Region::Intersect( const Region& rRegion )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return sal_True;
+ return TRUE;
}
// is own region NULL-region? -> copy data!
@@ -1818,7 +1688,7 @@ sal_Bool Region::Intersect( const Region& rRegion )
{
mpImplRegion = rRegion.mpImplRegion;
rRegion.mpImplRegion->mnRefCount++;
- return sal_True;
+ return TRUE;
}
// Wenn wir weniger Rechtecke haben, drehen wir den Intersect-Aufruf um
@@ -1838,7 +1708,7 @@ sal_Bool Region::Intersect( const Region& rRegion )
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
while ( pBand )
{
- pBand->mbTouched = sal_False;
+ pBand->mbTouched = FALSE;
pBand = pBand->mpNextBand;
}
@@ -1914,46 +1784,25 @@ sal_Bool Region::Intersect( const Region& rRegion )
}
}
- return sal_True;
+ return 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 );
-}
-
-sal_Bool Region::Exclude( const Region& rRegion )
+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 sal_True;
+ return TRUE;
// no instance data? -> nothing to do
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_True;
+ return TRUE;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
@@ -1988,51 +1837,27 @@ sal_Bool Region::Exclude( const Region& rRegion )
pBand = pBand->mpNextBand;
}
- return sal_True;
+ return 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 );
-}
-sal_Bool Region::XOr( const Region& rRegion )
+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 sal_True;
+ return TRUE;
// no own instance data? -> XOr = copy
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
{
*this = rRegion;
- return sal_True;
+ return TRUE;
}
// no own instance data? -> make own copy!
@@ -2065,7 +1890,7 @@ sal_Bool Region::XOr( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2096,7 +1921,7 @@ Rectangle Region::GetBoundRect() const
return aRect;
// get the boundaries of the first band
- long nYTop = mpImplRegion->mpFirstBand->mnYTop;
+ long nYTop = mpImplRegion->mpFirstBand->mnYTop;
long nYBottom = mpImplRegion->mpFirstBand->mnYBottom;
long nXLeft = mpImplRegion->mpFirstBand->GetXLeftBoundary();
long nXRight = mpImplRegion->mpFirstBand->GetXRightBoundary();
@@ -2105,9 +1930,9 @@ Rectangle Region::GetBoundRect() const
ImplRegionBand* pBand = mpImplRegion->mpFirstBand->mpNextBand;
while ( pBand )
{
- nYBottom = pBand->mnYBottom;
- nXLeft = Min( nXLeft, pBand->GetXLeftBoundary() );
- nXRight = Max( nXRight, pBand->GetXRightBoundary() );
+ nYBottom = pBand->mnYBottom;
+ nXLeft = Min( nXLeft, pBand->GetXLeftBoundary() );
+ nXRight = Max( nXRight, pBand->GetXRightBoundary() );
pBand = pBand->mpNextBand;
}
@@ -2119,7 +1944,7 @@ Rectangle Region::GetBoundRect() const
// -----------------------------------------------------------------------
-sal_Bool Region::HasPolyPolygon() const
+BOOL Region::HasPolyPolygon() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if( !mpImplRegion )
@@ -2169,7 +1994,7 @@ const basegfx::B2DPolyPolygon Region::GetB2DPolyPolygon() const
// TODO: cache the converted polygon?
// mpImplRegion->mpB2DPolyPoly = aRet;
}
-
+
return aRet;
}
@@ -2195,13 +2020,13 @@ basegfx::B2DPolyPolygon Region::ConvertToB2DPolyPolygon()
}
EndEnumRects( aHdl );
}
-
+
return aRet;
}
// -----------------------------------------------------------------------
-bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2211,36 +2036,36 @@ 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;
- ImplRegionBandSep* pCurrRectBandSep = pCurrRectBand->mpFirstSep;
+ ImplRegionBand* pCurrRectBand = mpImplRegion->mpFirstBand;
+ ImplRegionBandSep* pCurrRectBandSep = pCurrRectBand->mpFirstSep;
DBG_ASSERT( pCurrRectBandSep != NULL, "Erstes Band wurde nicht optimiert." );
if ( !pCurrRectBandSep )
- return false;
+ return FALSE;
// get boundaries of current rectangle
- rX = pCurrRectBandSep->mnXLeft;
- rY = pCurrRectBand->mnYTop;
- rWidth = pCurrRectBandSep->mnXRight - pCurrRectBandSep->mnXLeft + 1;
+ rX = pCurrRectBandSep->mnXLeft;
+ rY = pCurrRectBand->mnYTop;
+ rWidth = pCurrRectBandSep->mnXRight - pCurrRectBandSep->mnXLeft + 1;
rHeight = pCurrRectBand->mnYBottom - pCurrRectBand->mnYTop + 1;
// save pointers
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
{
@@ -2248,11 +2073,11 @@ 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;
- ImplRegionBandSep* pCurrRectBandSep = (ImplRegionBandSep*)rImplRegionInfo.mpVoidCurrRectBandSep;
+ ImplRegionBand* pCurrRectBand = (ImplRegionBand*)rImplRegionInfo.mpVoidCurrRectBand;
+ ImplRegionBandSep* pCurrRectBandSep = (ImplRegionBandSep*)rImplRegionInfo.mpVoidCurrRectBandSep;
// get next separation from current band
pCurrRectBandSep = pCurrRectBandSep->mpNextSep;
@@ -2265,23 +2090,23 @@ 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;
}
// get boundaries of current rectangle
- rX = pCurrRectBandSep->mnXLeft;
- rY = pCurrRectBand->mnYTop;
- rWidth = pCurrRectBandSep->mnXRight - pCurrRectBandSep->mnXLeft + 1;
+ rX = pCurrRectBandSep->mnXLeft;
+ rY = pCurrRectBand->mnYTop;
+ rWidth = pCurrRectBandSep->mnXRight - pCurrRectBandSep->mnXLeft + 1;
rHeight = pCurrRectBand->mnYBottom - pCurrRectBand->mnYTop + 1;
// save new pointers
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return true;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2300,7 +2125,7 @@ RegionType Region::GetType() const
// -----------------------------------------------------------------------
-sal_Bool Region::IsInside( const Point& rPoint ) const
+BOOL Region::IsInside( const Point& rPoint ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -2313,7 +2138,7 @@ sal_Bool Region::IsInside( const Point& rPoint ) const
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return FALSE;
// search band list
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
@@ -2325,30 +2150,30 @@ sal_Bool Region::IsInside( const Point& rPoint ) const
{
// is point within separation of the band?
if ( pBand->IsInside( rPoint.X() ) )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
pBand = pBand->mpNextBand;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Region::IsInside( const Rectangle& rRect ) const
+BOOL Region::IsInside( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> not inside
if ( rRect.IsEmpty() )
- return sal_False;
+ return FALSE;
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return FALSE;
// create region from rectangle and intersect own region
Region aRegion = rRect;
@@ -2360,12 +2185,12 @@ sal_Bool Region::IsInside( const Rectangle& rRect ) const
// -----------------------------------------------------------------------
-sal_Bool Region::IsOver( const Rectangle& rRect ) const
+BOOL Region::IsOver( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return FALSE;
// Can we optimize this ??? - is used in StarDraw for brushes pointers
// Why we have no IsOver for Regions ???
@@ -2462,20 +2287,20 @@ Region& Region::operator=( const Rectangle& rRect )
// -----------------------------------------------------------------------
-sal_Bool Region::operator==( const Region& rRegion ) const
+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 sal_True;
+ return TRUE;
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return FALSE;
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return FALSE;
if ( rRegion.mpImplRegion->mpPolyPoly && mpImplRegion->mpPolyPoly )
return *rRegion.mpImplRegion->mpPolyPoly == *mpImplRegion->mpPolyPoly;
@@ -2486,42 +2311,42 @@ sal_Bool Region::operator==( const Region& rRegion ) const
// Eine der beiden Regions kann jetzt Empty sein
if ( mpImplRegion == rRegion.mpImplRegion )
- return sal_True;
+ return TRUE;
if ( mpImplRegion == &aImplEmptyRegion )
- return sal_False;
+ return FALSE;
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
- return sal_False;
+ return FALSE;
}
// initialise pointers
- ImplRegionBand* pOwnRectBand = mpImplRegion->mpFirstBand;
- ImplRegionBandSep* pOwnRectBandSep = pOwnRectBand->mpFirstSep;
- ImplRegionBand* pSecondRectBand = rRegion.mpImplRegion->mpFirstBand;
- ImplRegionBandSep* pSecondRectBandSep = pSecondRectBand->mpFirstSep;
+ ImplRegionBand* pOwnRectBand = mpImplRegion->mpFirstBand;
+ ImplRegionBandSep* pOwnRectBandSep = pOwnRectBand->mpFirstSep;
+ ImplRegionBand* pSecondRectBand = rRegion.mpImplRegion->mpFirstBand;
+ ImplRegionBandSep* pSecondRectBandSep = pSecondRectBand->mpFirstSep;
while ( pOwnRectBandSep && pSecondRectBandSep )
{
// get boundaries of current rectangle
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return sal_False;
+ return FALSE;
long nOwnYTop = pOwnRectBand->mnYTop;
long nSecondYTop = pSecondRectBand->mnYTop;
if ( nOwnYTop != nSecondYTop )
- return sal_False;
+ return FALSE;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return sal_False;
+ return FALSE;
long nOwnYBottom = pOwnRectBand->mnYBottom;
long nSecondYBottom = pSecondRectBand->mnYBottom;
if ( nOwnYBottom != nSecondYBottom )
- return sal_False;
+ return FALSE;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -2552,13 +2377,13 @@ sal_Bool Region::operator==( const Region& rRegion ) const
}
if ( pOwnRectBandSep && !pSecondRectBandSep )
- return sal_False;
+ return FALSE;
if ( !pOwnRectBandSep && pSecondRectBandSep )
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2569,9 +2394,9 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
{
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
- VersionCompat aCompat( rIStrm, STREAM_READ );
- sal_uInt16 nVersion;
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStrm, STREAM_READ );
+ UINT16 nVersion;
+ UINT16 nTmp16;
// statische Object haben RefCount von 0
if ( rRegion.mpImplRegion->mnRefCount )
@@ -2649,10 +2474,10 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
rRegion.mpImplRegion->mnRectCount++;
}
}
-
+
if( rIStrm.IsEof() )
{
- OSL_FAIL( "premature end of region stream" );
+ DBG_ERROR( "premature end of region stream" );
delete rRegion.mpImplRegion;
rRegion.mpImplRegion = (ImplRegion*)&aImplEmptyRegion;
return rIStrm;
@@ -2664,7 +2489,7 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
if( aCompat.GetVersion() >= 2 )
{
- sal_Bool bHasPolyPolygon;
+ BOOL bHasPolyPolygon;
rIStrm >> bHasPolyPolygon;
@@ -2688,7 +2513,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
{
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
- sal_uInt16 nVersion = 2;
+ UINT16 nVersion = 2;
VersionCompat aCompat( rOStrm, STREAM_WRITE, nVersion );
Region aTmpRegion( rRegion );
@@ -2699,7 +2524,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
rOStrm << nVersion;
// put type
- rOStrm << (sal_uInt16)aTmpRegion.GetType();
+ rOStrm << (UINT16)aTmpRegion.GetType();
// put all bands if not null or empty
if ( (aTmpRegion.mpImplRegion != &aImplEmptyRegion) && (aTmpRegion.mpImplRegion != &aImplNullRegion) )
@@ -2708,7 +2533,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pBand )
{
// put boundaries
- rOStrm << (sal_uInt16) STREAMENTRY_BANDHEADER;
+ rOStrm << (UINT16) STREAMENTRY_BANDHEADER;
rOStrm << pBand->mnYTop;
rOStrm << pBand->mnYBottom;
@@ -2717,7 +2542,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pSep )
{
// put separation
- rOStrm << (sal_uInt16) STREAMENTRY_SEPARATION;
+ rOStrm << (UINT16) STREAMENTRY_SEPARATION;
rOStrm << pSep->mnXLeft;
rOStrm << pSep->mnXRight;
@@ -2729,10 +2554,10 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
}
// put endmarker
- rOStrm << (sal_uInt16) STREAMENTRY_END;
-
+ rOStrm << (UINT16) STREAMENTRY_END;
+
// write polypolygon if available
- const sal_Bool bHasPolyPolygon = rRegion.HasPolyPolygon();
+ const BOOL bHasPolyPolygon = rRegion.HasPolyPolygon();
rOStrm << bHasPolyPolygon;
if( bHasPolyPolygon )
@@ -2740,7 +2565,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
// #i105373#
PolyPolygon aNoCurvePolyPolygon;
rRegion.GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon);
-
+
rOStrm << aNoCurvePolyPolygon;
}
}
@@ -2769,12 +2594,12 @@ void Region::ImplBeginAddRect()
// -----------------------------------------------------------------------
-sal_Bool Region::ImplAddRect( const Rectangle& rRect )
+BOOL Region::ImplAddRect( const Rectangle& rRect )
{
// Hier kein CheckThis, da nicht alle Daten auf Stand
if ( rRect.IsEmpty() )
- return sal_True;
+ return TRUE;
// get justified rectangle
long nTop;
@@ -2834,7 +2659,7 @@ sal_Bool Region::ImplAddRect( const Rectangle& rRect )
mpImplRegion->mpLastCheckedBand->Union( nLeft, nRight );
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2903,14 +2728,14 @@ void Region::ImplEndAddRect()
// -----------------------------------------------------------------------
-sal_uLong Region::GetRectCount() const
+ULONG Region::GetRectCount() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
((Region*)this)->ImplPolyPolyRegionToBandRegion();
#ifdef DBG_UTIL
- sal_uLong nCount = 0;
+ ULONG nCount = 0;
// all bands if not null or empty
if ( (mpImplRegion != &aImplEmptyRegion) && (mpImplRegion != &aImplNullRegion) )
@@ -2956,7 +2781,7 @@ RegionHandle Region::BeginEnumRects()
ImplRegionHandle* pData = new ImplRegionHandle;
pData->mpRegion = new Region( *this );
- pData->mbFirst = sal_True;
+ pData->mbFirst = TRUE;
// save pointers
pData->mpCurrRectBand = pData->mpRegion->mpImplRegion->mpFirstBand;
@@ -2967,16 +2792,16 @@ RegionHandle Region::BeginEnumRects()
// -----------------------------------------------------------------------
-sal_Bool Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
+BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
ImplRegionHandle* pData = (ImplRegionHandle*)pVoidData;
if ( !pData )
- return sal_False;
+ return FALSE;
if ( pData->mbFirst )
- pData->mbFirst = sal_False;
+ pData->mbFirst = FALSE;
else
{
// get next separation from current band
@@ -2990,7 +2815,7 @@ sal_Bool Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
// no band found? -> not further rectangles!
if ( !pData->mpCurrRectBand )
- return sal_False;
+ return FALSE;
// get first separation in current band
pData->mpCurrRectBandSep = pData->mpCurrRectBand->mpFirstSep;
@@ -2998,11 +2823,11 @@ sal_Bool Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
}
// get boundaries of current rectangle
- rRect.Top() = pData->mpCurrRectBand->mnYTop;
- rRect.Bottom() = pData->mpCurrRectBand->mnYBottom;
- rRect.Left() = pData->mpCurrRectBandSep->mnXLeft;
- rRect.Right() = pData->mpCurrRectBandSep->mnXRight;
- return sal_True;
+ rRect.Top() = pData->mpCurrRectBand->mnYTop;
+ rRect.Bottom() = pData->mpCurrRectBand->mnYBottom;
+ rRect.Left() = pData->mpCurrRectBandSep->mnXLeft;
+ rRect.Right() = pData->mpCurrRectBandSep->mnXRight;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -3026,7 +2851,7 @@ static inline bool ImplPolygonRectTest( const Polygon& rPoly, Rectangle* pRectOu
{
bool bIsRect = false;
const Point* pPoints = rPoly.GetConstPointAry();
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if( nPoints == 4 || (nPoints == 5 && pPoints[0] == pPoints[4]) )
{
long nX1 = pPoints[0].X(), nX2 = pPoints[2].X(),
@@ -3070,14 +2895,14 @@ static inline bool ImplPolygonRectTest( const Polygon& rPoly, Rectangle* pRectOu
Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
{
//return Region( rPolyPoly );
-
+
// check if it's worth extracting the XOr'ing the Rectangles
// empiricism shows that break even between XOr'ing rectangles separately
// and ImplPolyPolyRegionToBandRegion is at half rectangles/half polygons
int nPolygonRects = 0, nPolygonPolygons = 0;
int nPolygons = rPolyPoly.Count();
-
- for( sal_uInt16 i = 0; i < nPolygons; i++ )
+
+ for( USHORT i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
if( ImplPolygonRectTest( rPoly ) )
@@ -3087,10 +2912,10 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
}
if( nPolygonPolygons > nPolygonRects )
return Region( rPolyPoly );
-
+
Region aResult;
Rectangle aRect;
- for( sal_uInt16 i = 0; i < nPolygons; i++ )
+ for( USHORT 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 9fa4d813b2b7..c01cd8add7ad 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -75,7 +75,7 @@ SalFrameGeometry SalFrame::GetGeometry()
// ----------------------------------------------------------------------------
-SalGraphics::SalGraphics()
+SalGraphics::SalGraphics()
: m_nLayout( 0 ),
m_bAntiAliasB2DDraw(false)
{
@@ -171,7 +171,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
}
}
-sal_Bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
+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,37 +244,22 @@ sal_Bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoi
pPtAry2[j].mnY = pPtAry[i].mnY;
}
}
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
void SalGraphics::mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
{
- 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 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;
- 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;
- }
+ mirror( x, nWidth, pOutDev, bBack );
+ rRgn.Move( x - x_org, 0 );
}
void SalGraphics::mirror( Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
@@ -294,7 +279,7 @@ basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint& i_rPoint, const
w = i_pOutDev->GetOutputWidthPixel();
else
w = GetGraphicsWidth();
-
+
DBG_ASSERT( w, "missing graphics width" );
basegfx::B2DPoint aRet( i_rPoint );
@@ -323,9 +308,9 @@ basegfx::B2DPolygon SalGraphics::mirror( const basegfx::B2DPolygon& i_rPoly, con
w = i_pOutDev->GetOutputWidthPixel();
else
w = GetGraphicsWidth();
-
+
DBG_ASSERT( w, "missing graphics width" );
-
+
basegfx::B2DPolygon aRet;
if( w )
{
@@ -334,9 +319,9 @@ basegfx::B2DPolygon SalGraphics::mirror( const basegfx::B2DPolygon& i_rPoly, con
{
aRet.append( mirror( i_rPoly.getB2DPoint( i ), i_pOutDev, i_bBack ) );
if( i_rPoly.isPrevControlPointUsed( i ) )
- aRet.setPrevControlPoint( i, mirror( i_rPoly.getPrevControlPoint( i ), i_pOutDev, i_bBack ) );
+ aRet.setPrevControlPoint( i, mirror( i_rPoly.getPrevControlPoint( i ), i_pOutDev, i_bBack ) );
if( i_rPoly.isNextControlPointUsed( i ) )
- aRet.setNextControlPoint( i, mirror( i_rPoly.getNextControlPoint( i ), i_pOutDev, i_bBack ) );
+ aRet.setNextControlPoint( i, mirror( i_rPoly.getNextControlPoint( i ), i_pOutDev, i_bBack ) );
}
aRet.setClosed( i_rPoly.isClosed() );
aRet.flip();
@@ -353,9 +338,9 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
w = i_pOutDev->GetOutputWidthPixel();
else
w = GetGraphicsWidth();
-
+
DBG_ASSERT( w, "missing graphics width" );
-
+
basegfx::B2DPolyPolygon aRet;
if( w )
{
@@ -372,30 +357,37 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
// ----------------------------------------------------------------------------
-bool SalGraphics::SetClipRegion( const Region& i_rClip, const OutputDevice *pOutDev )
+BOOL SalGraphics::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
{
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
- {
- Region aMirror( i_rClip );
- mirror( aMirror, pOutDev );
- return setClipRegion( aMirror );
- }
- return setClipRegion( i_rClip );
+ 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 );
}
-void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
drawPixel( nX, nY );
}
-void SalGraphics::DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
drawPixel( nX, nY, nSalColor );
}
-void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
+void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -404,27 +396,27 @@ void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const Out
}
drawLine( nX1, nY1, nX2, nY2 );
}
-void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
drawRect( nX, nY, nWidth, nHeight );
}
-bool SalGraphics::drawPolyLine(
+bool SalGraphics::drawPolyLine(
const basegfx::B2DPolygon& /*rPolyPolygon*/,
double /*fTransparency*/,
- const basegfx::B2DVector& /*rLineWidths*/,
+ const basegfx::B2DVector& /*rLineWidths*/,
basegfx::B2DLineJoin /*eLineJoin*/)
{
return false;
}
-void SalGraphics::DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolyLine( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -432,12 +424,12 @@ void SalGraphics::DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const
drawPolyLine( nPoints, pPtAry );
}
-void SalGraphics::DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolygon( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -451,12 +443,12 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[nPoly];
- sal_uLong i;
+ ULONG i;
for(i=0; i<nPoly; i++)
{
- sal_uLong nPoints = pPoints[i];
+ ULONG nPoints = pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
- mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
+ mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
}
drawPolyPolygon( nPoly, pPoints, (PCONSTSALPOINT*)pPtAry2 );
@@ -472,7 +464,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) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
basegfx::B2DPolyPolygon aMirror( mirror( i_rPolyPolygon, i_pOutDev ) );
bRet = drawPolyPolygon( aMirror, i_fTransparency );
@@ -487,13 +479,13 @@ bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT
return false;
}
-sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -502,13 +494,13 @@ sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPt
return bResult;
}
-sal_Bool SalGraphics::DrawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -518,19 +510,19 @@ sal_Bool SalGraphics::DrawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtA
}
sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
- const SalPoint* const* i_pPtAry, const sal_uInt8* const* i_pFlgAry, const OutputDevice* i_pOutDev )
+ const SalPoint* const* i_pPtAry, const BYTE* const* i_pFlgAry, const OutputDevice* i_pOutDev )
{
sal_Bool bRet = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[i_nPoly];
- sal_uLong i;
+ ULONG i;
for(i=0; i<i_nPoly; i++)
{
- sal_uLong nPoints = i_pPoints[i];
+ ULONG nPoints = i_pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
- mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
+ mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
}
bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, (PCONSTSALPOINT*)pPtAry2, i_pFlgAry );
@@ -549,7 +541,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin );
@@ -559,54 +551,54 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
return bRet;
}
-void SalGraphics::CopyArea( long nDestX, long nDestY,
+void SalGraphics::CopyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- sal_uInt16 nFlags, const OutputDevice *pOutDev )
+ USHORT nFlags, const OutputDevice *pOutDev )
{
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
mirror( nDestX, nSrcWidth, pOutDev );
mirror( nSrcX, nSrcWidth, pOutDev );
}
copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, nFlags );
}
-void SalGraphics::CopyBits( const SalTwoRect* pPosAry,
+void SalGraphics::CopyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
{
- if( ( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
+ if( ( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
(pSrcGraphics && ( (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) )
{
SalTwoRect pPosAry2 = *pPosAry;
if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) )
- mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth, pSrcOutDev );
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth, pSrcOutDev );
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
copyBits( &pPosAry2, pSrcGraphics );
}
else
copyBits( pPosAry, pSrcGraphics );
}
-void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry,
+void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalTwoRect pPosAry2 = *pPosAry;
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
drawBitmap( &pPosAry2, rSalBitmap );
}
else
drawBitmap( pPosAry, rSalBitmap );
}
-void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry,
+void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalTwoRect pPosAry2 = *pPosAry;
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
drawBitmap( &pPosAry2, rSalBitmap, nTransparentColor );
}
else
@@ -619,49 +611,49 @@ void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry,
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalTwoRect pPosAry2 = *pPosAry;
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
drawBitmap( &pPosAry2, rSalBitmap, rTransparentBitmap );
}
else
drawBitmap( pPosAry, rSalBitmap, rTransparentBitmap );
}
-void SalGraphics::DrawMask( const SalTwoRect* pPosAry,
+void SalGraphics::DrawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalTwoRect pPosAry2 = *pPosAry;
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
drawMask( &pPosAry2, rSalBitmap, nMaskColor );
}
else
drawMask( pPosAry, rSalBitmap, nMaskColor );
}
-SalBitmap* SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+SalBitmap* SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
return getBitmap( nX, nY, nWidth, nHeight );
}
-SalColor SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
+SalColor SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
return getPixel( nX, nY );
}
-void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
invert( nX, nY, nWidth, nHeight, nFlags );
}
-void SalGraphics::Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( 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];
- sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
invert( nPoints, bCopied ? pPtAry2 : pPtAry, nFlags );
delete [] pPtAry2;
}
@@ -669,15 +661,15 @@ void SalGraphics::Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInver
invert( nPoints, pPtAry, nFlags );
}
-sal_Bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev )
+BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, 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 );
}
-sal_Bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, sal_Bool& rIsInside, const OutputDevice *pOutDev )
+BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, BOOL& rIsInside, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -726,7 +718,7 @@ void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const Outp
}
}
-sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -735,7 +727,7 @@ sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, c
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- sal_Bool bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
+ BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -743,7 +735,7 @@ sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, c
return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -752,7 +744,7 @@ sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPar
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- sal_Bool bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
+ BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -760,7 +752,7 @@ sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPar
return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-sal_Bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+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 )
{
@@ -769,41 +761,41 @@ sal_Bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPa
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, aCaption,
+ if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, aCaption,
rNativeBoundingRegion, rNativeContentRegion ) )
{
mirror( rNativeBoundingRegion, pOutDev, true );
mirror( rNativeContentRegion, pOutDev, true );
mirror( nType, aValue, pOutDev, true );
- return sal_True;
+ return TRUE;
}
else
{
mirror( nType, aValue, pOutDev, true );
- return sal_False;
+ return FALSE;
}
}
else
- return getNativeControlRegion( nType, nPart, rControlRegion, nState, aValue, aCaption,
+ return getNativeControlRegion( nType, nPart, rControlRegion, nState, aValue, aCaption,
rNativeBoundingRegion, rNativeContentRegion );
}
bool SalGraphics::DrawAlphaBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSourceBitmap,
- const SalBitmap& rAlphaBitmap,
+ const SalBitmap& rAlphaBitmap,
const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalTwoRect pPosAry2 = rPosAry;
- mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
+ mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev );
return drawAlphaBitmap( pPosAry2, rSourceBitmap, rAlphaBitmap );
}
else
return drawAlphaBitmap( rPosAry, rSourceBitmap, rAlphaBitmap );
}
-bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
+bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
sal_uInt8 nTransparency, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
@@ -820,7 +812,7 @@ bool SalGraphics::filterText( const String&, String&, xub_StrLen, xub_StrLen&, x
void SalGraphics::AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
pOutDev->ImplAddDevFontSubstitute( rFontName, rReplaceFontName, nFlags );
}
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 970b0ff3cd0b..ded9d9e148ff 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,7 +54,7 @@
#include <unicode/uchar.h>
#if defined _MSC_VER
#pragma warning(pop)
-#endif
+#endif
#include <algorithm>
@@ -109,7 +109,7 @@ bool IsDiacritic( sal_UCS4 nChar )
if( (pRange->mnMin <= nChar) && (nChar < pRange->mnEnd) )
return true;
- return false;
+ return false;
}
// =======================================================================
@@ -265,7 +265,7 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang )
case LANGUAGE_FARSI & LANGUAGE_MASK_PRIMARY:
case LANGUAGE_URDU & LANGUAGE_MASK_PRIMARY:
case LANGUAGE_PUNJABI & LANGUAGE_MASK_PRIMARY: //???
- case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY:
+ case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY:
nOffset = 0x06F0 - '0'; // eastern arabic-indic digits
break;
case LANGUAGE_BENGALI & LANGUAGE_MASK_PRIMARY:
@@ -554,7 +554,7 @@ ImplLayoutArgs::ImplLayoutArgs( const xub_Unicode* pStr, int nLen,
UBiDi* pParaBidi = ubidi_openSized( mnLength, 0, &rcI18n );
if( !pParaBidi )
return;
- ubidi_setPara( pParaBidi, reinterpret_cast<const UChar *>(mpStr), mnLength, nLevel, NULL, &rcI18n ); // UChar != sal_Unicode in MinGW
+ ubidi_setPara( pParaBidi, reinterpret_cast<const UChar *>(mpStr), mnLength, nLevel, NULL, &rcI18n ); // UChar != sal_Unicode in MinGW
UBiDi* pLineBidi = pParaBidi;
int nSubLength = mnEndCharPos - mnMinCharPos;
@@ -983,7 +983,7 @@ bool GenericSalLayout::GetCharWidths( sal_Int32* pCharWidths ) const
if( pN->IsClusterStart() )
break;
if( pN->IsDiacritic() )
- continue; // ignore diacritics
+ continue; // ignore diacritics
if( nXPosMax > pN->maLinearPos.X() )
nXPosMax = pN->maLinearPos.X();
}
@@ -1246,10 +1246,10 @@ void GenericSalLayout::ApplyAsianKerning( const sal_Unicode* pStr, int nLength )
{
// ignore code ranges that are not affected by asian punctuation compression
const sal_Unicode cHere = pStr[n];
- if( ((0x3000 != (cHere & 0xFF00)) && (0x2010 != (cHere & 0xFFF0))) || (0xFF00 != (cHere & 0xFF00)) )
+ if( ((0x3000 != (cHere & 0xFF00)) && (0x2010 != (cHere & 0xFFF0))) || (0xFF00 != (cHere & 0xFF00)) )
continue;
const sal_Unicode cNext = pStr[n+1];
- if( ((0x3000 != (cNext & 0xFF00)) && (0x2010 != (cNext & 0xFFF0))) || (0xFF00 != (cNext & 0xFF00)) )
+ if( ((0x3000 != (cNext & 0xFF00)) && (0x2010 != (cNext & 0xFFF0))) || (0xFF00 != (cNext & 0xFF00)) )
continue;
// calculate compression values
@@ -1509,7 +1509,7 @@ void GenericSalLayout::MoveGlyph( int nStart, long nNewXPos )
return;
GlyphItem* pG = mpGlyphItems + nStart;
- // the nNewXPos argument determines the new cell position
+ // the nNewXPos argument determines the new cell position
// as RTL-glyphs are right justified in their cell
// the cell position needs to be adjusted to the glyph position
if( pG->IsRTLGlyph() )
@@ -1829,7 +1829,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
if( n > 0 )
{
// drop the NotDef glyphs in the base layout run if a fallback run exists
- while (
+ while (
(maFallbackRuns[ n-1 ].PosIsInRun( nCharPos[0] ) ) &&
(!maFallbackRuns[ n ].PosIsInAnyRun( nCharPos[0] ) )
)
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 3a9bd669f54f..9cbe0fd2f082 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,35 +37,35 @@
// - Defines -
// -----------
-#define IMPL_CASE_GET_FORMAT( Format ) \
-case( BMP_FORMAT##Format ): \
- pFncGetPixel = BitmapReadAccess::GetPixelFor##Format; \
+#define IMPL_CASE_GET_FORMAT( Format ) \
+case( BMP_FORMAT##Format ): \
+ pFncGetPixel = BitmapReadAccess::GetPixelFor##Format; \
break
// -----------------------------------------------------------------------------
-#define IMPL_CASE_SET_FORMAT( Format, BitCount ) \
-case( BMP_FORMAT##Format ): \
-{ \
- pFncSetPixel = BitmapReadAccess::SetPixelFor##Format; \
- pDstBuffer->mnBitCount = BitCount; \
-} \
+#define IMPL_CASE_SET_FORMAT( Format, BitCount ) \
+case( BMP_FORMAT##Format ): \
+{ \
+ pFncSetPixel = BitmapReadAccess::SetPixelFor##Format; \
+ pDstBuffer->mnBitCount = BitCount; \
+} \
break
// -----------------------------------------------------------------------------
-#define DOUBLE_SCANLINES() \
-while( ( nActY < nHeight1 ) && ( pMapY[ nActY + 1 ] == nMapY ) ) \
-{ \
- memcpy( pDstScanMap[ nActY + 1L ], pDstScan, rDstBuffer.mnScanlineSize ); \
- nActY++; \
+#define DOUBLE_SCANLINES() \
+while( ( nActY < nHeight1 ) && ( pMapY[ nActY + 1 ] == nMapY ) ) \
+{ \
+ memcpy( pDstScanMap[ nActY + 1L ], pDstScan, rDstBuffer.mnScanlineSize ); \
+ nActY++; \
}
// -----------
// - Inlines -
// -----------
-#define TC_TO_PAL_COLORS 4096
+#define TC_TO_PAL_COLORS 4096
static long ImplIndexFromColor( const BitmapColor& rCol )
{
@@ -85,29 +85,29 @@ static long ImplIndexFromColor( const BitmapColor& rCol )
}
-#define COLOR_TO_INDEX( _def_rCol )
+#define COLOR_TO_INDEX( _def_rCol )
// ------------------------
// - conversion functions -
// ------------------------
-static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
+static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
Scanline* pSrcScanMap, Scanline* pDstScanMap, long* pMapX, long* pMapY )
{
- const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
- const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
- const ColorMask& rDstMask = rDstBuffer.maColorMask;
- BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
- BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
- BitmapColor aIndex( 0 );
-
- for( sal_uInt16 i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
+ const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
+ const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
+ const ColorMask& rDstMask = rDstBuffer.maColorMask;
+ BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
+ BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
+ BitmapColor aIndex( 0 );
+
+ for( USHORT 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<sal_uInt8>(i) );
+ aIndex.SetIndex( sal::static_int_cast<BYTE>(i) );
else
- aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
+ aIndex.SetIndex( sal::static_int_cast<BYTE>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
pColMapBuf[ i ] = aIndex;
}
@@ -125,20 +125,20 @@ static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuff
// -----------------------------------------------------------------------------
-static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
+static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
Scanline* pSrcScanMap, Scanline* pDstScanMap, long* pMapX, long* pMapY )
{
- const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
- const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
- const ColorMask& rDstMask = rDstBuffer.maColorMask;
- const BitmapColor* pColBuf = rSrcBuffer.maPalette.ImplGetColorBuffer();
+ const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
+ const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
+ const ColorMask& rDstMask = rDstBuffer.maColorMask;
+ const BitmapColor* pColBuf = rSrcBuffer.maPalette.ImplGetColorBuffer();
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_1BIT_MSB_PAL )
{
- const BitmapColor aCol0( pColBuf[ 0 ] );
- const BitmapColor aCol1( pColBuf[ 1 ] );
- long nMapX;
+ const BitmapColor aCol0( pColBuf[ 0 ] );
+ const BitmapColor aCol1( pColBuf[ 1 ] );
+ long nMapX;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
@@ -147,7 +147,7 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
for( long nX = 0L; nX < nWidth; )
{
nMapX = pMapX[ nX ];
- pFncSetPixel( pDstScan, nX++,
+ pFncSetPixel( pDstScan, nX++,
pSrcScan[ nMapX >> 3 ] & ( 1 << ( 7 - ( nMapX & 7 ) ) ) ? aCol1 : aCol0,
rDstMask );
}
@@ -166,7 +166,7 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
for( long nX = 0L; nX < nWidth; )
{
nMapX = pMapX[ nX ];
- pFncSetPixel( pDstScan, nX++,
+ pFncSetPixel( pDstScan, nX++,
pColBuf[ ( pSrcScan[ nMapX >> 1 ] >> ( nMapX & 1 ? 0 : 4 ) ) & 0x0f ],
rDstMask );
}
@@ -202,18 +202,18 @@ static void ImplPALToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
// -----------------------------------------------------------------------------
-static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
+static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
Scanline* pSrcScanMap, Scanline* pDstScanMap, long* pMapX, long* pMapY )
{
- const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
- const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
- const ColorMask& rDstMask = rDstBuffer.maColorMask;
+ const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
+ const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
+ const ColorMask& rDstMask = rDstBuffer.maColorMask;
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR )
{
BitmapColor aCol;
- sal_uInt8* pPixel = NULL;
+ BYTE* pPixel;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
@@ -246,16 +246,16 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer
// -----------------------------------------------------------------------------
-static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
+static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer,
FncGetPixel pFncGetPixel, FncSetPixel pFncSetPixel,
Scanline* pSrcScanMap, Scanline* pDstScanMap, long* pMapX, long* pMapY )
{
- const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
- const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
- const ColorMask& rDstMask = rDstBuffer.maColorMask;
- BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
- sal_uInt8* pColToPalMap = new sal_uInt8[ TC_TO_PAL_COLORS ];
- BitmapColor aIndex( 0 );
+ const long nWidth = rDstBuffer.mnWidth, nHeight = rDstBuffer.mnHeight, nHeight1 = nHeight - 1;
+ const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
+ const ColorMask& rDstMask = rDstBuffer.maColorMask;
+ BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
+ BYTE* pColToPalMap = new BYTE[ 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<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 );
+ 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 );
}
}
}
@@ -293,12 +293,12 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
// - StretchAndConvert -
// ---------------------
-BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
+BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
+ ULONG nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
{
- FncGetPixel pFncGetPixel;
- FncSetPixel pFncSetPixel;
- BitmapBuffer* pDstBuffer = new BitmapBuffer;
+ FncGetPixel pFncGetPixel;
+ FncSetPixel pFncSetPixel;
+ BitmapBuffer* pDstBuffer = new BitmapBuffer;
long i;
// set function for getting pixels
@@ -326,12 +326,12 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// initialize pFncGetPixel to something valid that is
// least likely to crash
pFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL;
- OSL_FAIL( "unknown read format" );
+ DBG_ERROR( "unknown read format" );
break;
}
// set function for setting pixels
- const sal_uLong nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
+ const ULONG nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
switch( nDstScanlineFormat )
{
IMPL_CASE_SET_FORMAT( _1BIT_MSB_PAL, 1 );
@@ -357,7 +357,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// least likely to crash
pFncSetPixel = BitmapReadAccess::SetPixelFor_1BIT_MSB_PAL;
pDstBuffer->mnBitCount = 1;
- OSL_FAIL( "unknown write format" );
+ DBG_ERROR( "unknown write format" );
break;
}
@@ -368,7 +368,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
pDstBuffer->mnScanlineSize = AlignedWidth4Bytes( pDstBuffer->mnBitCount * pDstBuffer->mnWidth );
try
{
- pDstBuffer->mpBits = new sal_uInt8[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
+ pDstBuffer->mpBits = new BYTE[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
}
catch( const std::bad_alloc& )
{
@@ -402,7 +402,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
bool bFastConvert = ImplFastBitmapConversion( *pDstBuffer, rSrcBuffer, rTwoRect );
if( bFastConvert )
return pDstBuffer;
-
+
const long nSrcX = rTwoRect.mnSrcX, nSrcY = rTwoRect.mnSrcY;
const long nSrcDX = rTwoRect.mnSrcWidth, nSrcDY = rTwoRect.mnSrcHeight;
const long nDstDX = rTwoRect.mnDestWidth, nDstDY = rTwoRect.mnDestHeight;
@@ -431,7 +431,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
delete pDstBuffer;
return NULL;
}
-
+
// horizontal mapping table
if( nDstDX != nSrcDX )
{
@@ -488,7 +488,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// do buffer scaling and conversion
if( rSrcBuffer.mnBitCount <= 8 && pDstBuffer->mnBitCount <= 8 )
{
- ImplPALToPAL( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
+ ImplPALToPAL( rSrcBuffer, *pDstBuffer, pFncGetPixel, pFncSetPixel,
pSrcScan, pDstScan, pMapX, pMapY );
}
else if( rSrcBuffer.mnBitCount <= 8 && pDstBuffer->mnBitCount > 8 )
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index cc204069c2c4..6ed2079755c6 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,7 @@
#include <vcl/salgdi.hxx>
-using ::rtl::OUString;
+using namespace rtl;
/****************************************************************
* Placeholder for no native widgets
@@ -41,29 +41,29 @@ using ::rtl::OUString;
/*
* IsNativeControlSupported()
*
- * Returns sal_True if the platform supports native
+ * Returns TRUE if the platform supports native
* drawing of the control defined by nPart
*/
-sal_Bool SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
+BOOL SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
{
- return( sal_False );
+ return( FALSE );
}
/*
* HitTestNativeControl()
*
- * If the return value is sal_True, bIsInside contains information whether
+ * If the return value is TRUE, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-sal_Bool SalGraphics::hitTestNativeControl( ControlType,
+BOOL SalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- sal_Bool& )
+ BOOL& )
{
- return( sal_False );
+ return( FALSE );
}
@@ -72,18 +72,18 @@ sal_Bool SalGraphics::hitTestNativeControl( ControlType,
*
* Draws the requested control described by nPart/nState.
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool SalGraphics::drawNativeControl( ControlType,
+BOOL SalGraphics::drawNativeControl( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( sal_False );
+ return( FALSE );
}
@@ -93,35 +93,35 @@ sal_Bool SalGraphics::drawNativeControl( ControlType,
* OPTIONAL. Draws the requested text for the control described by nPart/nState.
* Used if text not drawn by DrawNativeControl().
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool SalGraphics::drawNativeControlText( ControlType,
+BOOL SalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( sal_False );
+ return( FALSE );
}
/*
* GetNativeControlRegion()
*
- * If the return value is sal_True, rNativeBoundingRegion
- * contains the sal_True bounding region covered by the control
+ * If the return value is 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.
*
- * rControlRegion: The bounding region of the control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool SalGraphics::getNativeControlRegion( ControlType,
+BOOL SalGraphics::getNativeControlRegion( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -130,7 +130,7 @@ sal_Bool SalGraphics::getNativeControlRegion( ControlType,
Rectangle &,
Rectangle & )
{
- return( sal_False );
+ return( FALSE );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/svcompat.cxx b/vcl/source/gdi/svcompat.cxx
index c594dd1f93d7..31f61d92b45b 100644
--- a/vcl/source/gdi/svcompat.cxx
+++ b/vcl/source/gdi/svcompat.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
// - ImplCompat -
// --------------
-ImplCompat::ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) :
+ImplCompat::ImplCompat( SvStream& rStm, USHORT nStreamMode, USHORT nVersion ) :
mpRWStm ( &rStm ),
mnStmMode ( nStreamMode ),
mnVersion ( nVersion )
@@ -63,7 +63,7 @@ ImplCompat::~ImplCompat()
{
if( STREAM_WRITE == mnStmMode )
{
- const sal_uInt32 nEndPos = mpRWStm->Tell();
+ const UINT32 nEndPos = mpRWStm->Tell();
mpRWStm->Seek( mnCompatPos );
*mpRWStm << ( nEndPos - mnTotalSize );
@@ -71,7 +71,7 @@ ImplCompat::~ImplCompat()
}
else
{
- const sal_uInt32 nReadSize = mpRWStm->Tell() - mnCompatPos;
+ const 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 1afa8840fcf3..d0f00a932491 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText );
+ Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText );
protected:
void onBeginDrawText()
@@ -227,7 +227,7 @@ namespace vcl
aTrace.append( ", " );
}
aTrace.append( ")" );
- OSL_TRACE( "%s", aTrace.makeStringAndClear().getStr() );
+ OSL_TRACE( aTrace.makeStringAndClear().getStr() );
}
#endif
return nTextWidth;
@@ -310,13 +310,13 @@ namespace vcl
}
//--------------------------------------------------------------------
- Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText )
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _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
- sal_uLong nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
+ 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, sal_uInt16 _nStyle,
+ Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _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 981fc38b7375..22e3a3211446 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
- long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
{
DBG_ASSERT( nBitCount <= 1,
"VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
@@ -76,17 +76,17 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
if ( !mpVirDev )
{
// do not abort but throw an exception, may be the current thread terminates anyway (plugin-scenario)
- throw ::com::sun::star::uno::RuntimeException(
+ throw ::com::sun::star::uno::RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM( "Could not create system bitmap!" ) ),
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
//GetpApp()->Exception( EXC_SYSOBJNOTCREATED );
}
- mnBitCount = ( nBitCount ? nBitCount : pOutDev->GetBitCount() );
- mnOutWidth = nDX;
- mnOutHeight = nDY;
- mbScreenComp = sal_True;
- mnAlphaDepth = -1;
+ mnBitCount = ( nBitCount ? nBitCount : pOutDev->GetBitCount() );
+ mnOutWidth = nDX;
+ mnOutHeight = nDY;
+ mbScreenComp = TRUE;
+ mnAlphaDepth = -1;
// #i59315# init vdev size from system object, when passed a
// SystemGraphicsData. Otherwise, output size will always
@@ -98,21 +98,21 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
- mbScreenComp = sal_False;
+ mbScreenComp = FALSE;
else if ( pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
mbScreenComp = ((VirtualDevice*)pOutDev)->mbScreenComp;
- meOutDevType = OUTDEV_VIRDEV;
- mbDevOutput = sal_True;
- mpFontList = pSVData->maGDIData.mpScreenFontList;
- mpFontCache = pSVData->maGDIData.mpScreenFontCache;
- mnDPIX = pOutDev->mnDPIX;
- mnDPIY = pOutDev->mnDPIY;
- maFont = pOutDev->maFont;
+ meOutDevType = OUTDEV_VIRDEV;
+ mbDevOutput = TRUE;
+ mpFontList = pSVData->maGDIData.mpScreenFontList;
+ mpFontCache = pSVData->maGDIData.mpScreenFontCache;
+ mnDPIX = pOutDev->mnDPIX;
+ mnDPIY = pOutDev->mnDPIY;
+ maFont = pOutDev->maFont;
if( maTextColor != pOutDev->maTextColor )
{
- maTextColor = pOutDev->maTextColor;
+ maTextColor = pOutDev->maTextColor;
mbInitTextColor = true;
}
@@ -135,33 +135,33 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( sal_uInt16 nBitCount )
+VirtualDevice::VirtualDevice( USHORT nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- OSL_TRACE( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
+ DBG_TRACE1( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount );
}
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- OSL_TRACE( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
+ DBG_TRACE1( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
ImplInitVirDev( &rCompDev, 1, 1, nBitCount );
}
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, USHORT nAlphaBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- OSL_TRACE( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
+ DBG_TRACE1( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
ImplInitVirDev( &rCompDev, 1, 1, nBitCount );
@@ -171,11 +171,11 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount )
+VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- OSL_TRACE( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
+ DBG_TRACE1( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount, pData );
}
@@ -184,7 +184,7 @@ VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCo
VirtualDevice::~VirtualDevice()
{
- OSL_TRACE( "VirtualDevice::~VirtualDevice()" );
+ DBG_TRACE( "VirtualDevice::~VirtualDevice()" );
ImplSVData* pSVData = ImplGetSVData();
@@ -207,20 +207,20 @@ VirtualDevice::~VirtualDevice()
// -----------------------------------------------------------------------
-sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
+BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
{
- OSL_TRACE( "VirtualDevice::ImplSetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
+ DBG_TRACE3( "VirtualDevice::ImplSetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
if ( !mpVirDev )
- return sal_False;
+ return FALSE;
else if ( rNewSize == GetOutputSizePixel() )
{
if ( bErase )
Erase();
- return sal_True;
+ return TRUE;
}
- sal_Bool bRet;
+ BOOL bRet;
long nNewWidth = rNewSize.Width(), nNewHeight = rNewSize.Height();
if ( nNewWidth < 1 )
@@ -235,21 +235,21 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
if ( bRet )
{
- mnOutWidth = rNewSize.Width();
+ mnOutWidth = rNewSize.Width();
mnOutHeight = rNewSize.Height();
Erase();
}
}
else
{
- SalVirtualDevice* pNewVirDev;
- ImplSVData* pSVData = ImplGetSVData();
+ SalVirtualDevice* pNewVirDev;
+ ImplSVData* pSVData = ImplGetSVData();
// we need a graphics
if ( !mpGraphics )
{
if ( !ImplGetGraphics() )
- return sal_False;
+ return FALSE;
}
pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice( mpGraphics, nNewWidth, nNewHeight, mnBitCount );
@@ -269,12 +269,12 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
nHeight = mnOutHeight;
else
nHeight = nNewHeight;
- aPosAry.mnSrcX = 0;
- aPosAry.mnSrcY = 0;
- aPosAry.mnSrcWidth = nWidth;
+ aPosAry.mnSrcX = 0;
+ aPosAry.mnSrcY = 0;
+ aPosAry.mnSrcWidth = nWidth;
aPosAry.mnSrcHeight = nHeight;
- aPosAry.mnDestX = 0;
- aPosAry.mnDestY = 0;
+ aPosAry.mnDestX = 0;
+ aPosAry.mnDestY = 0;
aPosAry.mnDestWidth = nWidth;
aPosAry.mnDestHeight = nHeight;
@@ -283,18 +283,18 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
ImplReleaseGraphics();
pSVData->mpDefInst->DestroyVirtualDevice( mpVirDev );
mpVirDev = pNewVirDev;
- mnOutWidth = rNewSize.Width();
+ mnOutWidth = rNewSize.Width();
mnOutHeight = rNewSize.Height();
- bRet = sal_True;
+ bRet = TRUE;
}
else
{
- bRet = sal_False;
+ bRet = FALSE;
pSVData->mpDefInst->DestroyVirtualDevice( pNewVirDev );
}
}
else
- bRet = sal_False;
+ bRet = FALSE;
}
return bRet;
@@ -302,11 +302,11 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
// -----------------------------------------------------------------------
-// #i32109#: Fill opaque areas correctly (without relying on
+// #i32109#: Fill opaque areas correctly (without relying on
// fill/linecolor state)
void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
{
- // Set line and fill color to black (->opaque),
+ // Set line and fill color to black (->opaque),
// fill rect with that (linecolor, too, because of
// those pesky missing pixel problems)
Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
@@ -318,7 +318,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
// -----------------------------------------------------------------------
-sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
+BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
{
if( ImplSetOutputSizePixel(rNewSize, bErase) )
{
@@ -347,10 +347,10 @@ sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bEras
mpAlphaVDev->SetMapMode( GetMapMode() );
}
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -362,7 +362,7 @@ void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode )
{
case REFDEV_NONE:
default:
- DBG_ASSERT( sal_False, "VDev::SetRefDev illegal argument!" );
+ DBG_ASSERT( 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( sal_False ); // prevent output on reference device
- mbScreenComp = sal_False;
+ EnableOutput( FALSE ); // prevent output on reference device
+ mbScreenComp = FALSE;
// invalidate currently selected fonts
- mbInitFont = sal_True;
- mbNewFont = sal_True;
+ mbInitFont = TRUE;
+ mbNewFont = TRUE;
// avoid adjusting font lists when already in refdev mode
- sal_uInt8 nOldRefDevMode = meRefDevMode;
- sal_uInt8 nOldCompatFlag = (sal_uInt8)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
- meRefDevMode = (sal_uInt8)(i_eRefDevMode | nOldCompatFlag);
+ BYTE nOldRefDevMode = meRefDevMode;
+ BYTE nOldCompatFlag = (BYTE)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (BYTE)(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 = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (BYTE)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 600f78941cbe..fd9d1a51657a 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,12 +45,12 @@ DBG_NAME( Wallpaper );
ImplWallpaper::ImplWallpaper() :
maColor( COL_TRANSPARENT )
{
- mnRefCount = 1;
- mpBitmap = NULL;
- mpCache = NULL;
- mpGradient = NULL;
- mpRect = NULL;
- meStyle = WALLPAPER_NULL;
+ mnRefCount = 1;
+ mpBitmap = NULL;
+ mpCache = NULL;
+ mpGradient = NULL;
+ mpRect = NULL;
+ meStyle = WALLPAPER_NULL;
}
// -----------------------------------------------------------------------
@@ -111,8 +111,8 @@ void ImplWallpaper::ImplReleaseCachedBitmap()
SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
{
- VersionCompat aCompat( rIStm, STREAM_READ );
- sal_uInt16 nTmp16;
+ VersionCompat aCompat( rIStm, STREAM_READ );
+ UINT16 nTmp16;
delete rImplWallpaper.mpRect;
rImplWallpaper.mpRect = NULL;
@@ -130,7 +130,7 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
// version 2
if( aCompat.GetVersion() >= 2 )
{
- sal_Bool bRect, bGrad, bBmp, bDummy;
+ 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, sal_True );
+ rImplWallpaper.maColor.Read( rIStm, TRUE );
}
}
@@ -166,14 +166,14 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper )
{
- VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
- sal_Bool bRect = ( rImplWallpaper.mpRect != NULL );
- sal_Bool bGrad = ( rImplWallpaper.mpGradient != NULL );
- sal_Bool bBmp = ( rImplWallpaper.mpBitmap != NULL );
- sal_Bool bDummy = sal_False;
+ VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
+ BOOL bRect = ( rImplWallpaper.mpRect != NULL );
+ BOOL bGrad = ( rImplWallpaper.mpGradient != NULL );
+ BOOL bBmp = ( rImplWallpaper.mpBitmap != NULL );
+ BOOL bDummy = FALSE;
// version 1
- rOStm << rImplWallpaper.maColor << (sal_uInt16) rImplWallpaper.meStyle;
+ rOStm << rImplWallpaper.maColor << (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, sal_True );
+ ( (Color&) rImplWallpaper.maColor ).Write( rOStm, TRUE );
return rOStm;
}
// -----------------------------------------------------------------------
-inline void Wallpaper::ImplMakeUnique( sal_Bool bReleaseCache )
+inline void Wallpaper::ImplMakeUnique( BOOL bReleaseCache )
{
// Falls noch andere Referenzen bestehen, dann kopieren
if ( mpImplWallpaper->mnRefCount != 1 )
@@ -242,9 +242,9 @@ Wallpaper::Wallpaper( const Color& rColor )
{
DBG_CTOR( Wallpaper, NULL );
- mpImplWallpaper = new ImplWallpaper;
- mpImplWallpaper->maColor = rColor;
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper = new ImplWallpaper;
+ mpImplWallpaper->maColor = rColor;
+ mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
// -----------------------------------------------------------------------
@@ -253,9 +253,9 @@ Wallpaper::Wallpaper( const BitmapEx& rBmpEx )
{
DBG_CTOR( Wallpaper, NULL );
- mpImplWallpaper = new ImplWallpaper;
- mpImplWallpaper->mpBitmap = new BitmapEx( rBmpEx );
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper = new ImplWallpaper;
+ mpImplWallpaper->mpBitmap = new BitmapEx( rBmpEx );
+ mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
// -----------------------------------------------------------------------
@@ -264,9 +264,9 @@ Wallpaper::Wallpaper( const Gradient& rGradient )
{
DBG_CTOR( Wallpaper, NULL );
- mpImplWallpaper = new ImplWallpaper;
+ mpImplWallpaper = new ImplWallpaper;
mpImplWallpaper->mpGradient = new Gradient( rGradient );
- mpImplWallpaper->meStyle = WALLPAPER_TILE;
+ mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
// -----------------------------------------------------------------------
@@ -301,11 +301,11 @@ void Wallpaper::SetColor( const Color& rColor )
// -----------------------------------------------------------------------
-const Color& Wallpaper::GetColor() const
-{
+const Color& Wallpaper::GetColor() const
+{
DBG_CHKTHIS( Wallpaper, NULL );
- return mpImplWallpaper->maColor;
+ return mpImplWallpaper->maColor;
}
// -----------------------------------------------------------------------
@@ -314,7 +314,7 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( sal_False );
+ ImplMakeUnique( FALSE );
if( eStyle == WALLPAPER_APPLICATIONGRADIENT )
// set a dummy gradient, the correct gradient
@@ -326,11 +326,11 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
// -----------------------------------------------------------------------
-WallpaperStyle Wallpaper::GetStyle() const
-{
+WallpaperStyle Wallpaper::GetStyle() const
+{
DBG_CHKTHIS( Wallpaper, NULL );
- return mpImplWallpaper->meStyle;
+ return mpImplWallpaper->meStyle;
}
// -----------------------------------------------------------------------
@@ -392,11 +392,11 @@ BitmapEx Wallpaper::GetBitmap() const
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::IsBitmap() const
-{
+BOOL Wallpaper::IsBitmap() const
+{
DBG_CHKTHIS( Wallpaper, NULL );
- return (mpImplWallpaper->mpBitmap != 0);
+ return (mpImplWallpaper->mpBitmap != 0);
}
@@ -450,11 +450,11 @@ Gradient Wallpaper::GetGradient() const
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::IsGradient() const
-{
+BOOL Wallpaper::IsGradient() const
+{
DBG_CHKTHIS( Wallpaper, NULL );
- return (mpImplWallpaper->mpGradient != 0);
+ return (mpImplWallpaper->mpGradient != 0);
}
@@ -480,7 +480,7 @@ void Wallpaper::SetRect( const Rectangle& rRect )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( sal_False );
+ ImplMakeUnique( FALSE );
if ( rRect.IsEmpty() )
{
@@ -507,7 +507,7 @@ void Wallpaper::SetRect()
if ( mpImplWallpaper->mpRect )
{
- ImplMakeUnique( sal_False );
+ ImplMakeUnique( FALSE );
delete mpImplWallpaper->mpRect;
mpImplWallpaper->mpRect = NULL;
}
@@ -530,36 +530,36 @@ Rectangle Wallpaper::GetRect() const
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::IsRect() const
-{
+BOOL Wallpaper::IsRect() const
+{
DBG_CHKTHIS( Wallpaper, NULL );
- return (mpImplWallpaper->mpRect != 0);
+ return (mpImplWallpaper->mpRect != 0);
}
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::IsFixed() const
+BOOL Wallpaper::IsFixed() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return sal_False;
+ return FALSE;
else
return (!mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient);
}
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::IsScrollable() const
+BOOL Wallpaper::IsScrollable() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return sal_False;
+ return FALSE;
else if ( !mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient )
- return sal_True;
+ return TRUE;
else if ( mpImplWallpaper->mpBitmap )
return (mpImplWallpaper->meStyle == WALLPAPER_TILE);
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -591,37 +591,37 @@ Wallpaper& Wallpaper::operator=( const Wallpaper& rWallpaper )
// -----------------------------------------------------------------------
-sal_Bool Wallpaper::operator==( const Wallpaper& rWallpaper ) const
+BOOL Wallpaper::operator==( const Wallpaper& rWallpaper ) const
{
DBG_CHKTHIS( Wallpaper, NULL );
DBG_CHKOBJ( &rWallpaper, Wallpaper, NULL );
if ( mpImplWallpaper == rWallpaper.mpImplWallpaper )
- return sal_True;
+ return TRUE;
if ( ( mpImplWallpaper->meStyle != rWallpaper.mpImplWallpaper->meStyle ) ||
- ( mpImplWallpaper->maColor != rWallpaper.mpImplWallpaper->maColor ) )
- return sal_False;
+ ( mpImplWallpaper->maColor != rWallpaper.mpImplWallpaper->maColor ) )
+ return FALSE;
if ( mpImplWallpaper->mpRect != rWallpaper.mpImplWallpaper->mpRect
&& ( !mpImplWallpaper->mpRect
|| !rWallpaper.mpImplWallpaper->mpRect
|| *(mpImplWallpaper->mpRect) != *(rWallpaper.mpImplWallpaper->mpRect) ) )
- return sal_False;
+ return FALSE;
if ( mpImplWallpaper->mpBitmap != rWallpaper.mpImplWallpaper->mpBitmap
&& ( !mpImplWallpaper->mpBitmap
|| !rWallpaper.mpImplWallpaper->mpBitmap
|| *(mpImplWallpaper->mpBitmap) != *(rWallpaper.mpImplWallpaper->mpBitmap) ) )
- return sal_False;
+ return FALSE;
if ( mpImplWallpaper->mpGradient != rWallpaper.mpImplWallpaper->mpGradient
&& ( !mpImplWallpaper->mpGradient
|| !rWallpaper.mpImplWallpaper->mpGradient
|| *(mpImplWallpaper->mpGradient) != *(rWallpaper.mpImplWallpaper->mpGradient) ) )
- return sal_False;
+ return FALSE;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 82fa925097ee..543df46e3894 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,10 +39,6 @@
#include "vcl/svapp.hxx"
#include "vcl/outfont.hxx"
#include "vcl/impfont.hxx"
-#ifdef ENABLE_GRAPHITE
-#include <graphite2/Font.h>
-#include "vcl/graphite_layout.hxx"
-#endif
#include "tools/poly.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
@@ -52,8 +48,6 @@
#include "osl/file.hxx"
#include "osl/thread.hxx"
-#include "sft.hxx"
-
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
@@ -84,8 +78,10 @@ typedef FT_Vector* FT_Vector_CPtr;
// TODO: move file mapping stuff to OSL
#if defined(UNX)
- // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
- #include <dlfcn.h>
+ #if !defined(HPUX)
+ // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
+ #include <dlfcn.h>
+ #endif
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -140,8 +136,7 @@ FT_Error (*pFTOblique)(FT_GlyphSlot);
static bool bEnableSizeFT = false;
struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } };
-struct HashStr { size_t operator()( const char* s ) const { return rtl_str_hashCode(s); } };
-typedef ::boost::unordered_map<const char*,boost::shared_ptr<FtFontFile>,HashStr, EqStr> FontFileList;
+typedef ::std::hash_map<const char*,FtFontFile*,::std::hash<const char*>, EqStr> FontFileList;
namespace { struct vclFontFileList : public rtl::Static< FontFileList, vclFontFileList > {}; }
// -----------------------------------------------------------------------
@@ -216,12 +211,12 @@ FtFontFile* FtFontFile::FindFontFile( const ::rtl::OString& rNativeFileName )
FontFileList &rFontFileList = vclFontFileList::get();
FontFileList::const_iterator it = rFontFileList.find( pFileName );
if( it != rFontFileList.end() )
- return it->second.get();
+ return (*it).second;
// no => create new one
FtFontFile* pFontFile = new FtFontFile( rNativeFileName );
pFileName = pFontFile->maNativeFileName.getStr();
- rFontFileList[pFileName].reset(pFontFile);
+ rFontFileList[ pFileName ] = pFontFile;
return pFontFile;
}
@@ -243,7 +238,7 @@ bool FtFontFile::Map()
mpFileMap = (const unsigned char*)
mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 );
if( mpFileMap == MAP_FAILED )
- mpFileMap = NULL;
+ mpFileMap = NULL;
close( nFile );
#elif defined(WNT)
void* pFileDesc = ::CreateFile( pFileName, GENERIC_READ, FILE_SHARE_READ,
@@ -294,33 +289,6 @@ void FtFontFile::Unmap()
mpFileMap = NULL;
}
-#ifdef ENABLE_GRAPHITE
-// wrap FtFontInfo's table function
-const void * graphiteFontTable(const void* appFaceHandle, unsigned int name, size_t *len)
-{
- const FtFontInfo * pFontInfo = reinterpret_cast<const FtFontInfo*>(appFaceHandle);
- typedef union {
- char m_c[5];
- unsigned int m_id;
- } TableId;
- TableId tableId;
- tableId.m_id = name;
-#ifndef WORDS_BIGENDIAN
- TableId swapped;
- swapped.m_c[3] = tableId.m_c[0];
- swapped.m_c[2] = tableId.m_c[1];
- swapped.m_c[1] = tableId.m_c[2];
- swapped.m_c[0] = tableId.m_c[3];
- tableId.m_id = swapped.m_id;
-#endif
- tableId.m_c[4] = '\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;
-}
-#endif
-
// =======================================================================
FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
@@ -332,13 +300,8 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
mnFaceNum( nFaceNum ),
mnRefCount( 0 ),
mnSynthetic( nSynthetic ),
-#ifdef ENABLE_GRAPHITE
- mbCheckedGraphite(false),
- mpGraphiteFace(NULL),
-#endif
mnFontId( nFontId ),
maDevFontAttributes( rDevFontAttributes ),
- mpFontCharMap( NULL ),
mpChar2Glyph( NULL ),
mpGlyph2Char( NULL ),
mpExtraKernInfo( pExtraKernInfo )
@@ -356,15 +319,9 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
FtFontInfo::~FtFontInfo()
{
- if( mpFontCharMap )
- mpFontCharMap->DeReference();
delete mpExtraKernInfo;
delete mpChar2Glyph;
delete mpGlyph2Char;
-#ifdef ENABLE_GRAPHITE
- if (mpGraphiteFace)
- delete mpGraphiteFace;
-#endif
}
void FtFontInfo::InitHashes() const
@@ -393,30 +350,6 @@ FT_FaceRec_* FtFontInfo::GetFaceFT()
return maFaceFT;
}
-#ifdef ENABLE_GRAPHITE
-GraphiteFaceWrapper * FtFontInfo::GetGraphiteFace()
-{
- if (mbCheckedGraphite)
- return mpGraphiteFace;
- // test for graphite here so that it is cached most efficiently
- if (GetTable("Silf", 0))
- {
- int graphiteSegCacheSize = 10000;
- static const char* pGraphiteCacheStr = getenv( "SAL_GRAPHITE_CACHE_SIZE" );
- graphiteSegCacheSize = pGraphiteCacheStr ? (atoi(pGraphiteCacheStr)) : 0;
- gr_face * pGraphiteFace;
- if (graphiteSegCacheSize > 500)
- pGraphiteFace = gr_make_face_with_seg_cache(this, graphiteFontTable, graphiteSegCacheSize, gr_face_cacheCmap);
- else
- pGraphiteFace = gr_make_face(this, graphiteFontTable, gr_face_cacheCmap);
- if (pGraphiteFace)
- mpGraphiteFace = new GraphiteFaceWrapper(pGraphiteFace);
- }
- mbCheckedGraphite = true;
- return mpGraphiteFace;
-}
-#endif
-
// -----------------------------------------------------------------------
void FtFontInfo::ReleaseFaceFT( FT_FaceRec_* pFaceFT )
@@ -472,7 +405,7 @@ static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
// -----------------------------------------------------------------------
-const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
+const unsigned char* FtFontInfo::GetTable( const char* pTag, ULONG* pLength ) const
{
const unsigned char* pBuffer = mpFontFile->GetBuffer();
int nFileSize = mpFontFile->GetFileSize();
@@ -495,7 +428,7 @@ const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength
{
if( p[0]==pTag[0] && p[1]==pTag[1] && p[2]==pTag[2] && p[3]==pTag[3] )
{
- sal_uLong nLength = GetUInt( p + 12 );
+ ULONG nLength = GetUInt( p + 12 );
if( pLength != NULL )
*pLength = nLength;
const unsigned char* pTable = pBuffer + GetUInt( p + 8 );
@@ -572,7 +505,6 @@ FreetypeManager::FreetypeManager()
nDefaultPrioAutoHint = pEnv[0] - '0';
InitGammaTable();
- vclFontFileList::get();
}
// -----------------------------------------------------------------------
@@ -589,8 +521,7 @@ void* FreetypeServerFont::GetFtFace() const
FreetypeManager::~FreetypeManager()
{
- ClearFontList();
-// This crashes on Solaris 10
+// This crashes on Solaris 10
// TODO: check which versions have this problem
//
// FT_Error rcFT = FT_Done_FreeType( aLibFT );
@@ -659,7 +590,7 @@ long FreetypeManager::AddFontDir( const String& rUrlName )
aDFA.maName = String::CreateFromAscii( aFaceFT->family_name );
if ( aFaceFT->style_name )
- aDFA.maStyleName = String::CreateFromAscii( aFaceFT->style_name );
+ aDFA.maStyleName = String::CreateFromAscii( aFaceFT->style_name );
aDFA.mbSymbolFlag = false;
for( int i = aFaceFT->num_charmaps; --i >= 0; )
@@ -776,6 +707,11 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
{
maFaceFT = pFI->GetFaceFT();
+#ifdef HDU_DEBUG
+ fprintf( stderr, "FTSF::FTSF(\"%s\", h=%d, w=%d, sy=%d) => %d\n",
+ pFI->GetFontFileName()->getStr(), rFSD.mnHeight, rFSD.mnWidth, pFI->IsSymbolFont(), maFaceFT!=0 );
+#endif
+
if( !maFaceFT )
return;
@@ -915,14 +851,9 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
-void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFontOptions)
+void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions)
{
- mpFontOptions = pFontOptions;
-
- if (!mpFontOptions)
- return;
-
- FontAutoHint eHint = mpFontOptions->GetUseAutoHint();
+ FontAutoHint eHint = rFontOptions.GetUseAutoHint();
if( eHint == AUTOHINT_DONTKNOW )
eHint = mbUseGamma ? AUTOHINT_TRUE : AUTOHINT_FALSE;
@@ -933,11 +864,11 @@ void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFon
mnLoadFlags |= FT_LOAD_NO_HINTING;
mnLoadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; //#88334#
- if( mpFontOptions->DontUseAntiAlias() )
+ if( rFontOptions.DontUseAntiAlias() )
mnPrioAntiAlias = 0;
- if( mpFontOptions->DontUseEmbeddedBitmaps() )
+ if( rFontOptions.DontUseEmbeddedBitmaps() )
mnPrioEmbedded = 0;
- if( mpFontOptions->DontUseHinting() )
+ if( rFontOptions.DontUseHinting() )
mnPrioAutoHint = 0;
#if (FTVERSION >= 2005) || defined(TT_CONFIG_OPTION_BYTECODE_INTERPRETER)
@@ -949,7 +880,7 @@ void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFon
if( !(mnLoadFlags & FT_LOAD_NO_HINTING) && (nFTVERSION >= 2103))
{
mnLoadFlags |= FT_LOAD_TARGET_NORMAL;
- switch( mpFontOptions->GetHintStyle() )
+ switch( rFontOptions.GetHintStyle() )
{
case HINT_NONE:
mnLoadFlags |= FT_LOAD_NO_HINTING;
@@ -970,11 +901,6 @@ void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFon
mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
-boost::shared_ptr<ImplFontOptions> FreetypeServerFont::GetFontOptions() const
-{
- return mpFontOptions;
-}
-
// -----------------------------------------------------------------------
bool FreetypeServerFont::TestFont() const
@@ -1100,7 +1026,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
- sal_Bool bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
+ BOOL bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
if ( bCJKCapable && (pOS2->usWinAscent || pOS2->usWinDescent) )
{
@@ -1369,7 +1295,7 @@ void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
int nLoadFlags = mnLoadFlags;
// if( mbArtItalic )
-// nLoadFlags |= FT_LOAD_NO_BITMAP;
+// nLoadFlags |= FT_LOAD_NO_BITMAP;
FT_Error rc = -1;
#if (FTVERSION <= 2008)
@@ -1511,7 +1437,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
// becomes an expensive nop when a glyph covers no pixels.
FT_BBox cbox;
FT_Glyph_Get_CBox(pGlyphFT, ft_glyph_bbox_unscaled, &cbox);
-
+
if( (cbox.xMax - cbox.xMin) == 0 || (cbox.yMax - cbox.yMin == 0) )
{
nAngle = 0;
@@ -1519,7 +1445,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
FT_Done_Glyph( pGlyphFT );
return true;
}
-
+
if( pGlyphFT->format != FT_GLYPH_FORMAT_BITMAP )
{
if( pGlyphFT->format == FT_GLYPH_FORMAT_OUTLINE )
@@ -1527,7 +1453,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, sal_True );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, nRenderMode, NULL, TRUE );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1555,7 +1481,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
rRawBitmap.mnScanlineSize = rBitmapFT.pitch;
}
- const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
@@ -1581,10 +1507,10 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
}
unsigned char* p = rRawBitmap.mpBits;
- for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
+ for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( sal_uLong x=0; x < rRawBitmap.mnScanlineSize; x++ )
+ for( ULONG x=0; x < rRawBitmap.mnScanlineSize; x++ )
{
unsigned char nTmp = p[x] << 7;
p[x] |= (p[x] >> 1) | nLastByte;
@@ -1623,7 +1549,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
FT_Int nLoadFlags = mnLoadFlags;
if( mbArtItalic )
- nLoadFlags |= FT_LOAD_NO_BITMAP;
+ nLoadFlags |= FT_LOAD_NO_BITMAP;
#if (FTVERSION <= 2004) && !defined(TT_CONFIG_OPTION_BYTECODE_INTERPRETER)
// autohinting in FT<=2.0.4 makes antialiased glyphs look worse
@@ -1682,7 +1608,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, sal_True );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, FT_RENDER_MODE_NORMAL, NULL, TRUE );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1706,7 +1632,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
}
rRawBitmap.mnScanlineSize = (rRawBitmap.mnScanlineSize + 3) & -4;
- const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
delete[] rRawBitmap.mpBits;
@@ -1746,10 +1672,10 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
{
// overlay with glyph image shifted by one left pixel
unsigned char* p = rRawBitmap.mpBits;
- for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
+ for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
+ for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
{
unsigned char nTmp = p[x];
p[x] |= p[x] | nLastByte;
@@ -1762,9 +1688,9 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
if( !bEmbedded && mbUseGamma )
{
unsigned char* p = rRawBitmap.mpBits;
- for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
+ for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
{
- for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
+ for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
{
p[x] = aGammaTable[ p[x] ];
}
@@ -1792,39 +1718,16 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
// determine unicode ranges in font
// -----------------------------------------------------------------------
-const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
+// TODO: replace with GetFontCharMap()
+bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const
{
- 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;
-}
+ rResult.mbSymbolic = mpFontInfo->IsSymbolFont();
-// TODO: merge into method GetFontCharMap()
-bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
-{
- rResult.mbSymbolic = IsSymbolFont();
-
- // TODO: is the full CmapResult needed on platforms calling this?
+ // TODO: is the full CmapResult needed on platforms calling this?
if( FT_IS_SFNT( maFaceFT ) )
{
- sal_uLong nLength = 0;
- const unsigned char* pCmap = GetTable( "cmap", &nLength );
+ ULONG nLength = 0;
+ const unsigned char* pCmap = mpFontInfo->GetTable( "cmap", &nLength );
if( pCmap && (nLength > 0) )
if( ParseCMAP( pCmap, nLength, rResult ) )
return true;
@@ -1839,11 +1742,11 @@ bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
for( sal_uInt32 cCode = FT_Get_First_Char( maFaceFT, &nGlyphIndex );; )
{
if( !nGlyphIndex )
- break;
- aCodes.push_back( cCode ); // first code inside range
+ break;
+ aCodes.push_back( cCode ); // first code inside range
sal_uInt32 cNext = cCode;
do cNext = FT_Get_Next_Char( maFaceFT, cCode, &nGlyphIndex ); while( cNext == ++cCode );
- aCodes.push_back( cCode ); // first code outside range
+ aCodes.push_back( cCode ); // first code outside range
cCode = cNext;
}
@@ -1865,29 +1768,6 @@ bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
return true;
}
-bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- bool bRet = false;
-
- sal_uLong nLength = 0;
- // load GSUB table
- const FT_Byte* pGSUB = mpFontInfo->GetTable("GSUB", &nLength);
- if (pGSUB)
- vcl::getTTScripts(rFontCapabilities.maGSUBScriptTags, pGSUB, nLength);
-
- // load OS/2 table
- const FT_Byte* pOS2 = mpFontInfo->GetTable("OS/2", &nLength);
- if (pOS2)
- {
- bRet = vcl::getTTCoverage(
- rFontCapabilities.maUnicodeRange,
- rFontCapabilities.maCodePageRange,
- pOS2, nLength);
- }
-
- return bRet;
-}
-
// -----------------------------------------------------------------------
// kerning stuff
// -----------------------------------------------------------------------
@@ -1922,7 +1802,7 @@ int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) con
// -----------------------------------------------------------------------
-sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
+ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
// if no kerning info is available in the font file
*ppKernPairs = NULL;
@@ -1948,7 +1828,7 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
pFTActivateSize( maSizeFT );
// first figure out which glyph pairs are involved in kerning
- sal_uLong nKernLength = 0;
+ ULONG nKernLength = 0;
const FT_Byte* const pKern = mpFontInfo->GetTable( "kern", &nKernLength );
if( !pKern )
return 0;
@@ -1966,19 +1846,19 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
aKernPair.mnKern = 0; // To prevent "is used uninitialized" warning...
const FT_Byte* pBuffer = pKern;
- sal_uLong nVersion = GetUShort( pBuffer+0 );
- sal_uInt16 nTableCnt = GetUShort( pBuffer+2 );
+ ULONG nVersion = GetUShort( pBuffer+0 );
+ USHORT nTableCnt = GetUShort( pBuffer+2 );
// Microsoft/Old TrueType style kern table
if ( nVersion == 0 )
{
pBuffer += 4;
- for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- // sal_uInt16 nSubVersion = GetUShort( pBuffer+0 );
- // sal_uInt16 nSubLength = GetUShort( pBuffer+2 );
- sal_uInt16 nSubCoverage = GetUShort( pBuffer+4 );
+ // USHORT nSubVersion = GetUShort( pBuffer+0 );
+ // USHORT nSubLength = GetUShort( pBuffer+2 );
+ USHORT nSubCoverage = GetUShort( pBuffer+4 );
pBuffer += 6;
if( (nSubCoverage&0x03) != 0x01 ) // no interest in minimum info here
continue;
@@ -1986,7 +1866,7 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
{
case 0: // version 0, kerning format 0
{
- sal_uInt16 nPairs = GetUShort( pBuffer );
+ USHORT nPairs = GetUShort( pBuffer );
pBuffer += 8; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -2003,21 +1883,21 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = pBuffer;
- //sal_uInt16 nRowWidth = GetUShort( pBuffer+0 );
- sal_uInt16 nOfsLeft = GetUShort( pBuffer+2 );
- sal_uInt16 nOfsRight = GetUShort( pBuffer+4 );
- sal_uInt16 nOfsArray = GetUShort( pBuffer+6 );
+ //USHORT nRowWidth = GetUShort( pBuffer+0 );
+ USHORT nOfsLeft = GetUShort( pBuffer+2 );
+ USHORT nOfsRight = GetUShort( pBuffer+4 );
+ USHORT nOfsArray = GetUShort( pBuffer+6 );
pBuffer += 8;
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- sal_uInt16 nFirstLeft = GetUShort( pTmp+0 );
- sal_uInt16 nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
+ USHORT nFirstLeft = GetUShort( pTmp+0 );
+ USHORT nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- sal_uInt16 nFirstRight = GetUShort( pTmp+0 );
- sal_uInt16 nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
+ USHORT nFirstRight = GetUShort( pTmp+0 );
+ USHORT nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
- sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2046,11 +1926,11 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
nTableCnt = NEXT_U32( pBuffer );
if ( nVersion == 0x00010000 )
{
- for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- /*sal_uLong nLength =*/ NEXT_U32( pBuffer );
- sal_uInt16 nCoverage = NEXT_U16( pBuffer );
- /*sal_uInt16 nTupleIndex =*/ NEXT_U16( pBuffer );
+ /*ULONG nLength =*/ NEXT_U32( pBuffer );
+ USHORT nCoverage = NEXT_U16( pBuffer );
+ /*USHORT nTupleIndex =*/ NEXT_U16( pBuffer );
// Kerning sub-table format, 0 through 3
sal_uInt8 nSubTableFormat = nCoverage & 0x00FF;
@@ -2059,7 +1939,7 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
{
case 0: // version 0, kerning format 0
{
- sal_uInt16 nPairs = NEXT_U16( pBuffer );
+ USHORT nPairs = NEXT_U16( pBuffer );
pBuffer += 6; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -2072,23 +1952,23 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
}
break;
- case 2: // version 0, kerning format 2
+ case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = 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 );
+ /*USHORT nRowWidth =*/ NEXT_U16( pBuffer );
+ USHORT nOfsLeft = NEXT_U16( pBuffer );
+ USHORT nOfsRight = NEXT_U16( pBuffer );
+ USHORT nOfsArray = NEXT_U16( pBuffer );
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- sal_uInt16 nFirstLeft = NEXT_U16( pTmp );
- sal_uInt16 nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
+ USHORT nFirstLeft = NEXT_U16( pTmp );
+ USHORT nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- sal_uInt16 nFirstRight = NEXT_U16( pTmp );
- sal_uInt16 nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
+ USHORT nFirstRight = NEXT_U16( pTmp );
+ USHORT nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
- sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2115,17 +1995,17 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
}
// now create VCL's ImplKernPairData[] format for all glyph pairs
- sal_uLong nKernCount = aKernGlyphVector.size();
+ 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<sal_uInt16,sal_Unicode> Cmap;
+ typedef std::hash_multimap<USHORT,sal_Unicode> Cmap;
Cmap aCmap;
for( sal_Unicode aChar = 0x0020; aChar < 0xFFFE; ++aChar )
{
- sal_uInt16 nGlyphIndex = GetGlyphIndex( aChar );
+ USHORT nGlyphIndex = GetGlyphIndex( aChar );
if( nGlyphIndex )
aCmap.insert( Cmap::value_type( nGlyphIndex, aChar ) );
}
@@ -2180,7 +2060,7 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
class PolyArgs
{
public:
- PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints );
+ PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints );
~PolyArgs();
void AddPoint( long nX, long nY, PolyFlags);
@@ -2193,28 +2073,27 @@ private:
PolyPolygon& mrPolyPoly;
Point* mpPointAry;
- sal_uInt8* mpFlagAry;
+ BYTE* mpFlagAry;
FT_Vector maPosition;
- sal_uInt16 mnMaxPoints;
- sal_uInt16 mnPoints;
- sal_uInt16 mnPoly;
+ USHORT mnMaxPoints;
+ USHORT mnPoints;
+ USHORT mnPoly;
long mnHeight;
bool bHasOffline;
};
// -----------------------------------------------------------------------
-PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints )
+PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints )
: mrPolyPoly(rPolyPoly),
mnMaxPoints(nMaxPoints),
mnPoints(0),
mnPoly(0),
- mnHeight(0),
bHasOffline(false)
{
mpPointAry = new Point[ mnMaxPoints ];
- mpFlagAry = new sal_uInt8 [ mnMaxPoints ];
+ mpFlagAry = new BYTE [ mnMaxPoints ];
}
// -----------------------------------------------------------------------
@@ -2269,7 +2148,7 @@ void PolyArgs::ClosePolygon()
const sal_uInt16 nPolySize(aPoly.GetSize());
if(nPolySize)
{
- if((aPoly.HasFlags() && POLY_CONTROL == aPoly.GetFlags(nPolySize - 1))
+ if((aPoly.HasFlags() && POLY_CONTROL == aPoly.GetFlags(nPolySize - 1))
|| (aPoly.GetPoint(nPolySize - 1) != aPoly.GetPoint(0)))
{
aPoly.SetSize(nPolySize + 1);
@@ -2422,56 +2301,56 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
#define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
- typedef std::vector<sal_uLong> ReqFeatureTagList;
+ typedef std::vector<ULONG> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
if( rFSD.mbVertical )
aReqFeatureTagList.push_back( MKTAG("vert") );
- sal_uLong nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
- sal_uLong nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys?
+ ULONG nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
+ 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
- sal_uLong nLength = 0;
+ 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 sal_uInt16 nOfsScriptList = GetUShort( pGsubHeader+4 );
- const sal_uInt16 nOfsFeatureTable = GetUShort( pGsubHeader+6 );
- const sal_uInt16 nOfsLookupList = GetUShort( pGsubHeader+8 );
+ const USHORT nOfsScriptList = GetUShort( pGsubHeader+4 );
+ const USHORT nOfsFeatureTable = GetUShort( pGsubHeader+6 );
+ const USHORT nOfsLookupList = GetUShort( pGsubHeader+8 );
pGsubHeader += 10;
- typedef std::vector<sal_uInt16> UshortList;
+ typedef std::vector<USHORT> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const sal_uInt16 nCntScript = GetUShort( pScriptHeader+0 );
+ const USHORT nCntScript = GetUShort( pScriptHeader+0 );
pScriptHeader += 2;
- for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- const sal_uLong nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
- const sal_uInt16 nOfsScriptTable= GetUShort( pScriptHeader+4 );
+ const ULONG nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
+ const USHORT nOfsScriptTable= GetUShort( pScriptHeader+4 );
pScriptHeader += 6; //###
if( (nScriptTag != nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
- const sal_uInt16 nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
- const sal_uInt16 nCntLangSystem = GetUShort( pScriptTable+2 );
+ const USHORT nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
+ const USHORT nCntLangSystem = GetUShort( pScriptTable+2 );
pScriptTable += 4;
- sal_uInt16 nLangsysOffset = 0;
+ USHORT nLangsysOffset = 0;
- for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- const sal_uLong nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
- const sal_uInt16 nOffset= GetUShort( pScriptTable+4 );
+ const ULONG nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
+ const USHORT nOffset= GetUShort( pScriptTable+4 );
pScriptTable += 6;
if( (nTag != nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
@@ -2482,13 +2361,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
- const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
- const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
+ const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const USHORT nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
+ for( USHORT i = 0; i < nCntFeature; ++i )
{
- const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
+ const USHORT nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2497,13 +2376,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( nLangsysOffset != 0 )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
- const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
- const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
+ const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const USHORT nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( sal_uInt16 i = 0; i < nCntFeature; ++i )
+ for( USHORT i = 0; i < nCntFeature; ++i )
{
- const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
+ const USHORT nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2518,12 +2397,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Feature Table
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
- const sal_uInt16 nCntFeature = GetUShort( pFeatureHeader );
+ const USHORT nCntFeature = GetUShort( pFeatureHeader );
pFeatureHeader += 2;
- for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const sal_uLong nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const sal_uInt16 nOffset= GetUShort( pFeatureHeader+4 );
+ const ULONG nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const USHORT nOffset= GetUShort( pFeatureHeader+4 );
pFeatureHeader += 6;
// short circuit some feature lookups
@@ -2538,11 +2417,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
}
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
- const sal_uInt16 nCntLookups = GetUShort( pFeatureTable+0 );
+ const USHORT nCntLookups = GetUShort( pFeatureTable+0 );
pFeatureTable += 2;
- for( sal_uInt16 i = 0; i < nCntLookups; ++i )
+ for( USHORT i = 0; i < nCntLookups; ++i )
{
- const sal_uInt16 nLookupIndex = GetUShort( pFeatureTable );
+ const USHORT nLookupIndex = GetUShort( pFeatureTable );
pFeatureTable += 2;
aLookupIndexList.push_back( nLookupIndex );
}
@@ -2552,11 +2431,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Lookup List
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
- const sal_uInt16 nCntLookupTable = GetUShort( pLookupHeader );
+ const USHORT nCntLookupTable = GetUShort( pLookupHeader );
pLookupHeader += 2;
- for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const sal_uInt16 nOffset = GetUShort( pLookupHeader );
+ const USHORT nOffset = GetUShort( pLookupHeader );
pLookupHeader += 2;
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
@@ -2565,43 +2444,43 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
UshortList::const_iterator lookup_it = aLookupOffsetList.begin();
for(; lookup_it != aLookupOffsetList.end(); ++lookup_it )
{
- const sal_uInt16 nOfsLookupTable = *lookup_it;
+ const USHORT nOfsLookupTable = *lookup_it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
- const sal_uInt16 eLookupType = GetUShort( pLookupTable+0 );
- const sal_uInt16 nCntLookupSubtable = GetUShort( pLookupTable+4 );
+ const USHORT eLookupType = GetUShort( pLookupTable+0 );
+ const USHORT nCntLookupSubtable = GetUShort( pLookupTable+4 );
pLookupTable += 6;
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
continue;
- for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const sal_uInt16 nOfsSubLookupTable = GetUShort( pLookupTable );
+ const USHORT nOfsSubLookupTable = GetUShort( pLookupTable );
pLookupTable += 2;
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
- const sal_uInt16 nFmtSubstitution = GetUShort( pSubLookup+0 );
- const sal_uInt16 nOfsCoverage = GetUShort( pSubLookup+2 );
+ const USHORT nFmtSubstitution = GetUShort( pSubLookup+0 );
+ const USHORT nOfsCoverage = GetUShort( pSubLookup+2 );
pSubLookup += 4;
- typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
+ typedef std::pair<USHORT,USHORT> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
const FT_Byte* pCoverage = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
- const sal_uInt16 nFmtCoverage = GetUShort( pCoverage+0 );
+ const USHORT nFmtCoverage = GetUShort( pCoverage+0 );
pCoverage += 2;
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const sal_uInt16 nCntGlyph = GetUShort( pCoverage );
+ const USHORT nCntGlyph = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.reserve( nCntGlyph );
- for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
+ for( USHORT i = 0; i < nCntGlyph; ++i )
{
- const sal_uInt16 nGlyphId = GetUShort( pCoverage );
+ const USHORT nGlyphId = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
@@ -2610,16 +2489,16 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Coverage Format 2
{
- const sal_uInt16 nCntRange = GetUShort( pCoverage );
+ const USHORT nCntRange = GetUShort( pCoverage );
pCoverage += 2;
for( int i = nCntRange; --i >= 0; )
{
- const sal_uInt32 nGlyph0 = GetUShort( pCoverage+0 );
- const sal_uInt32 nGlyph1 = GetUShort( pCoverage+2 );
- const sal_uInt16 nCovIdx = GetUShort( pCoverage+4 );
+ const UINT32 nGlyph0 = GetUShort( pCoverage+0 );
+ const UINT32 nGlyph1 = GetUShort( pCoverage+2 );
+ const USHORT nCovIdx = GetUShort( pCoverage+4 );
pCoverage += 6;
- for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
+ for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
}
}
break;
@@ -2631,7 +2510,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
case 1: // Single Substitution Format 1
{
- const sal_uInt16 nDeltaGlyphId = GetUShort( pSubLookup );
+ const USHORT nDeltaGlyphId = GetUShort( pSubLookup );
pSubLookup += 2;
for(; it != aSubstVector.end(); ++it )
(*it).second = (*it).first + nDeltaGlyphId;
@@ -2640,11 +2519,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Single Substitution Format 2
{
- const sal_uInt16 nCntGlyph = GetUShort( pSubLookup );
+ const USHORT nCntGlyph = GetUShort( pSubLookup );
pSubLookup += 2;
for( int i = nCntGlyph; (it != aSubstVector.end()) && (--i>=0); ++it )
{
- const sal_uInt16 nGlyphId = GetUShort( pSubLookup );
+ const USHORT 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 6b461fe59143..9dded55f37bb 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,10 +36,6 @@
#include FT_FREETYPE_H
class FreetypeServerFont;
-#ifdef ENABLE_GRAPHITE
-class GraphiteFaceWrapper;
-#endif
-
struct FT_GlyphRec_;
// -----------------------------------------------------------------------
@@ -82,12 +78,9 @@ public:
const ExtraKernInfo* );
~FtFontInfo();
- const unsigned char* GetTable( const char*, sal_uLong* pLength=0 ) const;
+ const unsigned char* GetTable( const char*, ULONG* pLength=0 ) const;
FT_FaceRec_* GetFaceFT();
-#ifdef ENABLE_GRAPHITE
- GraphiteFaceWrapper* GetGraphiteFace();
-#endif
void ReleaseFaceFT( FT_FaceRec_* );
const ::rtl::OString* GetFontFileName() const { return mpFontFile->GetFileName(); }
@@ -102,9 +95,6 @@ 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;
@@ -115,18 +105,13 @@ private:
const int mnFaceNum;
int mnRefCount;
const int mnSynthetic;
-#ifdef ENABLE_GRAPHITE
- bool mbCheckedGraphite;
- GraphiteFaceWrapper * mpGraphiteFace;
-#endif
+
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;
+ // TODO: change to hash_multimap when a use case requires a m:n mapping
+ typedef ::std::hash_map<int,int> Int2IntMap;
mutable Int2IntMap* mpChar2Glyph;
mutable Int2IntMap* mpGlyph2Char;
void InitHashes() const;
@@ -172,7 +157,7 @@ public:
FreetypeServerFont* CreateFont( const ImplFontSelectData& );
private:
- typedef ::boost::unordered_map<sal_IntPtr,FtFontInfo*> FontList;
+ typedef ::std::hash_map<sal_IntPtr,FtFontInfo*> FontList;
FontList maFontList;
sal_IntPtr mnMaxFontId;
@@ -191,14 +176,12 @@ public:
virtual int GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); }
virtual bool TestFont() const;
virtual void* GetFtFace() const;
- virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> );
- virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const;
+ virtual void SetFontOptions( const ImplFontOptions&);
virtual int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
virtual bool NeedsArtificialBold() const { return mbArtBold; }
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;
@@ -209,22 +192,19 @@ 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 sal_uLong GetKernPairs( ImplKernPairData** ) const;
+ virtual ULONG GetKernPairs( ImplKernPairData** ) const;
- const unsigned char* GetTable( const char* pName, sal_uLong* pLength )
+ const unsigned char* GetTable( const char* pName, ULONG* pLength )
{ return mpFontInfo->GetTable( pName, pLength ); }
int GetEmUnits() const;
const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
-#ifdef ENABLE_GRAPHITE
- GraphiteFaceWrapper* GetGraphiteFace() const { return mpFontInfo->GetGraphiteFace(); }
-#endif
protected:
friend class GlyphCache;
int ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
- virtual bool GetFontCapabilities(vcl::FontCapabilities &) const;
+ virtual bool GetFontCodeRanges( CmapResult& ) const;
bool ApplyGSUB( const ImplFontSelectData& );
virtual ServerFontLayoutEngine* GetLayoutEngine();
@@ -239,14 +219,12 @@ private:
FT_FaceRec_* maFaceFT;
FT_SizeRec_* maSizeFT;
- boost::shared_ptr<ImplFontOptions> mpFontOptions;
-
bool mbFaceOk;
- bool mbArtItalic;
- bool mbArtBold;
- bool mbUseGamma;
+ bool mbArtItalic;
+ bool mbArtBold;
+ bool mbUseGamma;
- typedef ::boost::unordered_map<int,int> GlyphSubstitution;
+ typedef ::std::hash_map<int,int> GlyphSubstitution;
GlyphSubstitution maGlyphSubstitution;
rtl_UnicodeToTextConverter maRecodeConverter;
diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx
index 63a332869664..cda874968d1a 100644
--- a/vcl/source/glyphs/gcach_layout.cxx
+++ b/vcl/source/glyphs/gcach_layout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -229,7 +229,7 @@ const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
pTagName[3] = (char)(nICUTableTag);
pTagName[4] = 0;
- sal_uLong nLength;
+ ULONG nLength;
const unsigned char* pBuffer = mrServerFont.GetTable( pTagName, &nLength );
#ifdef VERBOSE_DEBUG
fprintf(stderr,"IcuGetTable(\"%s\") => %p\n", pTagName, pBuffer);
@@ -336,7 +336,7 @@ void IcuFontFromServerFont::getGlyphAdvance( LEGlyphID nGlyphIndex,
// -----------------------------------------------------------------------
le_bool IcuFontFromServerFont::getGlyphPoint( LEGlyphID,
- le_int32
+ le_int32
#if OSL_DEBUG_LEVEL > 1
pointNumber
#endif
@@ -390,9 +390,6 @@ static bool lcl_CharIsJoiner(sal_Unicode cChar)
return ((cChar == 0x200C) || (cChar == 0x200D));
}
-//See https://bugs.freedesktop.org/show_bug.cgi?id=31016
-#define ARABIC_BANDAID
-
bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rArgs )
{
LEUnicode* pIcuChars;
@@ -537,40 +534,12 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
aNewPos = Point( (int)(pPos->fX+0.5), (int)(pPos->fY+0.5) );
const GlyphMetric& rGM = rFont.GetGlyphMetric( nGlyphIndex );
int nGlyphWidth = rGM.GetCharWidth();
- int nNewWidth = nGlyphWidth;
if( nGlyphWidth <= 0 )
bDiacritic |= true;
// #i99367# force all diacritics to zero width
// TODO: we need mnOrigWidth/mnLogicWidth/mnNewWidth
else if( bDiacritic )
- nGlyphWidth = nNewWidth = 0;
- else
- {
- // Hack, find next +ve width glyph and calculate current
- // glyph width by substracting the two posituons
- const IcuPosition* pNextPos = pPos+1;
- for ( int j = i + 1; j <= nRawRunGlyphCount; ++j, ++pNextPos )
- {
- if ( j == nRawRunGlyphCount )
- {
- nNewWidth = pNextPos->fX - pPos->fX;
- break;
- }
-
- LEGlyphID nNextGlyphIndex = pIcuGlyphs[j];
- if( (nNextGlyphIndex == ICU_MARKED_GLYPH)
- || (nNextGlyphIndex == ICU_DELETED_GLYPH) )
- continue;
-
- const GlyphMetric& rNextGM = rFont.GetGlyphMetric( nNextGlyphIndex );
- int nNextGlyphWidth = rNextGM.GetCharWidth();
- if ( nNextGlyphWidth > 0 )
- {
- nNewWidth = pNextPos->fX - pPos->fX;
- break;
- }
- }
- }
+ nGlyphWidth = 0;
// heuristic to detect glyph clusters
bool bInCluster = true;
@@ -583,13 +552,13 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
{
// left-to-right case
if( nClusterMinPos > nCharPos )
- nClusterMinPos = nCharPos; // extend cluster
+ nClusterMinPos = nCharPos; // extend cluster
else if( nCharPos <= nClusterMaxPos )
- /*NOTHING*/; // inside cluster
+ /*NOTHING*/; // inside cluster
else if( bDiacritic )
- nClusterMaxPos = nCharPos; // add diacritic to cluster
+ nClusterMaxPos = nCharPos; // add diacritic to cluster
else {
- nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster
+ nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster
bInCluster = false;
}
}
@@ -597,12 +566,12 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
{
// right-to-left case
if( nClusterMaxPos < nCharPos )
- nClusterMaxPos = nCharPos; // extend cluster
+ nClusterMaxPos = nCharPos; // extend cluster
else if( nCharPos >= nClusterMinPos )
- /*NOTHING*/; // inside cluster
+ /*NOTHING*/; // inside cluster
else if( bDiacritic )
{
- nClusterMinPos = nCharPos; // ICU often has [diacritic* baseglyph*]
+ nClusterMinPos = nCharPos; // ICU often has [diacritic* baseglyph*]
if( bClusterStart ) {
nClusterMaxPos = nCharPos;
bInCluster = false;
@@ -610,7 +579,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
}
else
{
- nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster
+ nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster
bInCluster = !bClusterStart;
}
}
@@ -624,10 +593,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
nGlyphFlags |= GlyphItem::IS_DIACRITIC;
// add resulting glyph item to layout
- GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth );
-#ifdef ARABIC_BANDAID
- aGI.mnNewWidth = nNewWidth;
-#endif
+ const GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth );
rLayout.AppendGlyph( aGI );
++nFilteredRunGlyphCount;
nLastCharPos = nCharPos;
diff --git a/vcl/source/glyphs/gcach_rbmp.cxx b/vcl/source/glyphs/gcach_rbmp.cxx
index 161e4c6314e7..aad08d09793a 100644
--- a/vcl/source/glyphs/gcach_rbmp.cxx
+++ b/vcl/source/glyphs/gcach_rbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -172,9 +172,9 @@ static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2,
bool RawBitmap::Rotate( int nAngle )
{
- sal_uLong nNewScanlineSize = 0;
- sal_uLong nNewHeight = 0;
- sal_uLong nNewWidth = 0;
+ ULONG nNewScanlineSize = 0;
+ ULONG nNewHeight = 0;
+ ULONG nNewWidth = 0;
// do inplace rotation or prepare double buffered rotation
switch( nAngle )
@@ -212,7 +212,7 @@ bool RawBitmap::Rotate( int nAngle )
unsigned char* pBuf = new unsigned char[ nBufSize ];
if( !pBuf )
return false;
-
+
memset( pBuf, 0, nBufSize );
int i;
diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx
index 944d9aee16a3..aecde028fc64 100644
--- a/vcl/source/glyphs/gcach_vdev.cxx
+++ b/vcl/source/glyphs/gcach_vdev.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,22 +57,22 @@ void VirtDevServerFont::AnnounceFonts( ImplDevFontList* pToAdd )
ImplFontData& rData = *new ImplFontData;
rData.SetSysData( new FontSysData( (void*)SERVERFONT_MAGIC ) );
- rData.maName = aFontInfo.GetName();
- rData.maStyleName = aFontInfo.GetStyleName();
- rData.mnWidth = aFontInfo.GetWidth();
- rData.mnHeight = aFontInfo.GetHeight();
- rData.meFamily = aFontInfo.GetFamily();
- rData.meCharSet = aFontInfo.GetCharSet();
- rData.mePitch = aFontInfo.GetPitch();
- rData.meWidthType = aFontInfo.GetWidthType();
- rData.meWeight = aFontInfo.GetWeight();
- rData.meItalic = aFontInfo.GetItalic();
- rData.meType = aFontInfo.GetType();
- rData.meFamily = aFontInfo.GetFamily();
-
- rData.mbOrientation = true; // TODO: where to get this info?
- rData.mbDevice = false;
- rData.mnQuality = 0; // prefer client-side fonts if available
+ rData.maName = aFontInfo.GetName();
+ rData.maStyleName = aFontInfo.GetStyleName();
+ rData.mnWidth = aFontInfo.GetWidth();
+ rData.mnHeight = aFontInfo.GetHeight();
+ rData.meFamily = aFontInfo.GetFamily();
+ rData.meCharSet = aFontInfo.GetCharSet();
+ rData.mePitch = aFontInfo.GetPitch();
+ rData.meWidthType = aFontInfo.GetWidthType();
+ rData.meWeight = aFontInfo.GetWeight();
+ rData.meItalic = aFontInfo.GetItalic();
+ rData.meType = aFontInfo.GetType();
+ rData.meFamily = aFontInfo.GetFamily();
+
+ rData.mbOrientation = true; // TODO: where to get this info?
+ rData.mbDevice = false;
+ rData.mnQuality = 0; // prefer client-side fonts if available
pToAdd->Add( &rData );
}
@@ -98,7 +98,7 @@ VirtDevServerFont* VirtDevServerFont::CreateFont( const ImplFontSelectData& rFSD
// -----------------------------------------------------------------------
VirtDevServerFont::VirtDevServerFont( const ImplFontSelectData& rFSD )
-: ServerFont( rFSD)
+: ServerFont( rFSD)
{}
// -----------------------------------------------------------------------
@@ -108,37 +108,37 @@ void VirtDevServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
const ImplFontSelectData& aFSD = GetFontSelData();
Font aFont;
- aFont.SetName ( aFSD.maName );
- aFont.SetStyleName ( aFSD.maStyleName );
- aFont.SetHeight ( aFSD.mnHeight );
- aFont.SetWidth ( aFSD.mnWidth );
+ aFont.SetName ( aFSD.maName );
+ aFont.SetStyleName ( aFSD.maStyleName );
+ aFont.SetHeight ( aFSD.mnHeight );
+ aFont.SetWidth ( aFSD.mnWidth );
aFont.SetOrientation( aFSD.mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
+ aFont.SetVertical ( GetFontSelData().mbVertical );
VirtualDevice vdev( 1 );
FontMetric aMetric( vdev.GetFontMetric( aFont ) );
rFactor = 0x100;
- rTo.mnAscent = aMetric.GetAscent();
- rTo.mnDescent = aMetric.GetDescent();
- rTo.mnIntLeading = aMetric.GetIntLeading();
- rTo.mnExtLeading = aMetric.GetExtLeading();
- rTo.mnSlant = aMetric.GetSlant();
- rTo.meType = aMetric.GetType();
- rTo.mnFirstChar = 0x0020; // TODO: where to get this info?
- rTo.mnLastChar = 0xFFFE; // TODO: where to get this info?
-
- rTo.mnWidth = aFSD.mnWidth;
- rTo.maName = aFSD.maName;
- rTo.maStyleName = aFSD.maStyleName;
- rTo.mnOrientation = aFSD.mnOrientation;
- rTo.meFamily = aFSD.meFamily;
- rTo.meCharSet = aFSD.meCharSet;
- rTo.meWeight = aFSD.meWeight;
- rTo.meItalic = aFSD.meItalic;
- rTo.mePitch = aFSD.mePitch;
- rTo.mbDevice = sal_False;
+ rTo.mnAscent = aMetric.GetAscent();
+ rTo.mnDescent = aMetric.GetDescent();
+ rTo.mnIntLeading = aMetric.GetIntLeading();
+ rTo.mnExtLeading = aMetric.GetExtLeading();
+ rTo.mnSlant = aMetric.GetSlant();
+ rTo.meType = aMetric.GetType();
+ rTo.mnFirstChar = 0x0020; // TODO: where to get this info?
+ rTo.mnLastChar = 0xFFFE; // TODO: where to get this info?
+
+ rTo.mnWidth = aFSD.mnWidth;
+ rTo.maName = aFSD.maName;
+ rTo.maStyleName = aFSD.maStyleName;
+ rTo.mnOrientation = aFSD.mnOrientation;
+ rTo.meFamily = aFSD.meFamily;
+ rTo.meCharSet = aFSD.meCharSet;
+ rTo.meWeight = aFSD.meWeight;
+ rTo.meItalic = aFSD.meItalic;
+ rTo.mePitch = aFSD.mePitch;
+ rTo.mbDevice = FALSE;
}
// -----------------------------------------------------------------------
@@ -153,19 +153,19 @@ int VirtDevServerFont::GetGlyphIndex( sal_Unicode aChar ) const
void VirtDevServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
{
Font aFont;
- aFont.SetName ( GetFontSelData().maName );
- aFont.SetStyleName ( GetFontSelData().maStyleName );
- aFont.SetHeight ( GetFontSelData().mnHeight );
- aFont.SetWidth ( GetFontSelData().mnWidth );
+ aFont.SetName ( GetFontSelData().maName );
+ aFont.SetStyleName ( GetFontSelData().maStyleName );
+ aFont.SetHeight ( GetFontSelData().mnHeight );
+ aFont.SetWidth ( GetFontSelData().mnWidth );
aFont.SetOrientation( GetFontSelData().mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
+ aFont.SetVertical ( GetFontSelData().mbVertical );
VirtualDevice vdev( 1 );
vdev.SetFont( aFont );
// get glyph metrics
sal_Int32 nCharWidth = 10;
-// TODO: vdev.GetCharWidth( nGlyphIndex, nGlyphIndex, &nCharWidth );
+// TODO: vdev.GetCharWidth( nGlyphIndex, nGlyphIndex, &nCharWidth );
rGD.SetCharWidth( nCharWidth );
sal_Unicode aChar = nGlyphIndex;
@@ -195,7 +195,7 @@ bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const
String aGlyphStr( &aChar, 1 );
// draw bitmap
- vdev.SetOutputSizePixel( aSize, sal_True );
+ vdev.SetOutputSizePixel( aSize, TRUE );
vdev.DrawText( Point(0,0)-rGD.GetMetric().GetOffset(), aGlyphStr );
// create new glyph item
@@ -209,7 +209,7 @@ bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const
// -----------------------------------------------------------------------
-bool VirtDevServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const
+bool VirtDevServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const
{
return false;
}
@@ -223,20 +223,20 @@ int VirtDevServerFont::GetGlyphKernValue( int, int ) const
// -----------------------------------------------------------------------
-sal_uLong VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
+ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
{
Font aFont;
- aFont.SetName ( GetFontSelData().maName );
- aFont.SetStyleName ( GetFontSelData().maStyleName );
- aFont.SetHeight ( GetFontSelData().mnHeight );
- aFont.SetWidth ( GetFontSelData().mnWidth );
+ aFont.SetName ( GetFontSelData().maName );
+ aFont.SetStyleName ( GetFontSelData().maStyleName );
+ aFont.SetHeight ( GetFontSelData().mnHeight );
+ aFont.SetWidth ( GetFontSelData().mnWidth );
aFont.SetOrientation( GetFontSelData().mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
+ aFont.SetVertical ( GetFontSelData().mbVertical );
VirtualDevice vdev( 1 );
vdev.SetFont( aFont );
- sal_uLong nPairs = vdev.GetKerningPairCount();
+ ULONG nPairs = vdev.GetKerningPairCount();
if( nPairs > 0 )
{
KerningPair* const pKernPairs = new KerningPair[ nPairs ];
@@ -245,11 +245,11 @@ sal_uLong VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs )
*ppImplKernPairs = new ImplKernPairData[ nPairs ];
ImplKernPairData* pTo = *ppImplKernPairs;
KerningPair* pFrom = pKernPairs;
- for ( sal_uLong n = 0; n < nPairs; n++ )
+ for ( ULONG n = 0; n < nPairs; n++ )
{
- pTo->mnChar1 = pFrom->nChar1;
- pTo->mnChar2 = pFrom->nChar2;
- pTo->mnKern = pFrom->nKern;
+ pTo->mnChar1 = pFrom->nChar1;
+ pTo->mnChar2 = pFrom->nChar2;
+ pTo->mnKern = pFrom->nKern;
++pFrom;
++pTo;
}
@@ -267,12 +267,12 @@ bool VirtDevServerFont::GetGlyphOutline( int nGlyphIndex, PolyPolygon& rPolyPoly
return false;
/*
Font aFont;
- aFont.SetName ( GetFontSelData().maName );
- aFont.SetStyleName ( GetFontSelData().maStyleName );
- aFont.SetHeight ( GetFontSelData().mnHeight );
- aFont.SetWidth ( GetFontSelData().mnWidth );
+ aFont.SetName ( GetFontSelData().maName );
+ aFont.SetStyleName ( GetFontSelData().maStyleName );
+ aFont.SetHeight ( GetFontSelData().mnHeight );
+ aFont.SetWidth ( GetFontSelData().mnWidth );
aFont.SetOrientation( GetFontSelData().mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
+ aFont.SetVertical ( GetFontSelData().mbVertical );
VirtualDevice vdev( 1 );
vdev.SetFont( aFont );
diff --git a/vcl/source/glyphs/gcach_vdev.hxx b/vcl/source/glyphs/gcach_vdev.hxx
index 61cd02b1f9cc..fecfff6f3fd1 100644
--- a/vcl/source/glyphs/gcach_vdev.hxx
+++ b/vcl/source/glyphs/gcach_vdev.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,23 +33,23 @@
class VirtDevServerFont : public ServerFont
{
public:
- virtual bool GetAntialiasAdvice( void ) const;
- virtual bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const;
- virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
- virtual bool GetGlyphOutline( int nGlyphIndex, PolyPolygon& ) const;
+ virtual bool GetAntialiasAdvice( void ) const;
+ virtual bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const;
+ virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
+ virtual bool GetGlyphOutline( int nGlyphIndex, PolyPolygon& ) const;
protected:
friend class GlyphCache;
- static void AnnounceFonts( ImplDevFontList* );
- static void ClearFontList();
+ static void AnnounceFonts( ImplDevFontList* );
+ static void ClearFontList();
- static VirtDevServerFont* CreateFont( const ImplFontSelectData& );
- virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
- virtual sal_uLong GetKernPairs( ImplKernPairData** ) const;
+ static VirtDevServerFont* CreateFont( const ImplFontSelectData& );
+ virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+ virtual ULONG GetKernPairs( ImplKernPairData** ) const;
virtual int GetGlyphKernValue( int, int ) const;
- virtual int GetGlyphIndex( sal_Unicode ) const;
- virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
+ virtual int GetGlyphIndex( sal_Unicode ) const;
+ virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
private:
VirtDevServerFont( const ImplFontSelectData& );
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index ab56853dcf65..a528244eab63 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@
#include <vcl/graphite_features.hxx>
#endif
-#include <rtl/ustring.hxx> // used only for string=>hashvalue
+#include <rtl/ustring.hxx> // used only for string=>hashvalue
#include <osl/file.hxx>
#include <tools/debug.hxx>
@@ -71,12 +71,6 @@ GlyphCache::GlyphCache( GlyphCachePeer& rPeer )
GlyphCache::~GlyphCache()
{
InvalidateAllGlyphs();
- for( FontList::iterator it = maFontList.begin(), end = maFontList.end(); it != end; ++it )
- {
- ServerFont* pServerFont = it->second;
- mrPeer.RemovingFont(*pServerFont);
- delete pServerFont;
- }
if( mpFtManager )
delete mpFtManager;
}
@@ -85,18 +79,6 @@ 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;
- }
}
// -----------------------------------------------------------------------
@@ -241,9 +223,9 @@ ServerFont* GlyphCache::CacheFont( const ImplFontSelectData& rFontSelData )
if( nFontId <= 0 )
return NULL;
- // the FontList's key mpFontData member is reinterpreted as font id
+ // the FontList's key mpFontData member is reinterpreted as font id
ImplFontSelectData aFontSelData = rFontSelData;
- aFontSelData.mpFontData = reinterpret_cast<ImplFontData*>( nFontId );
+ aFontSelData.mpFontData = reinterpret_cast<ImplFontData*>( nFontId );
FontList::iterator it = maFontList.find( aFontSelData );
if( it != maFontList.end() )
{
@@ -301,9 +283,9 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
// -----------------------------------------------------------------------
-sal_uLong GlyphCache::CalcByteCount() const
+ULONG GlyphCache::CalcByteCount() const
{
- sal_uLong nCacheSize = sizeof(*this);
+ ULONG nCacheSize = sizeof(*this);
for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
{
const ServerFont* pSF = it->second;
@@ -349,7 +331,7 @@ void GlyphCache::GarbageCollect()
pServerFont->GarbageCollect( mnLruIndex+0x10000000 );
if( pServerFont == mpCurrentGCFont )
mpCurrentGCFont = NULL;
- const ImplFontSelectData& rIFSD = pServerFont->GetFontSelData();
+ const ImplFontSelectData& rIFSD = pServerFont->GetFontSelData();
maFontList.erase( rIFSD );
mrPeer.RemovingFont( *pServerFont );
mnBytesUsed -= pServerFont->GetByteCount();
@@ -535,6 +517,7 @@ ImplServerFontEntry::ImplServerFontEntry( ImplFontSelectData& rFSD )
: ImplFontEntry( rFSD )
, mpServerFont( NULL )
, mbGotFontOptions( false )
+, mbValidFontOptions( false )
{}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
new file mode 100644
index 000000000000..6e3591b9277e
--- /dev/null
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -0,0 +1,339 @@
+/* -*- 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.
+ *
+ ************************************************************************/
+
+// Description: Implements the Graphite interfaces with access to the
+// platform's font and graphics systems.
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+// We need this to enable namespace support in libgrengine headers.
+#define GR_NAMESPACE
+
+// Header files
+//
+// Standard Library
+#include <string>
+#include <cassert>
+// Libraries
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+#include <i18npool/mslangid.hxx>
+// Platform
+#ifndef WNT
+#include <saldisp.hxx>
+
+#include <vcl/salgdi.hxx>
+
+#include <freetype/ftsynth.h>
+
+// Module
+#include "gcach_ftyp.hxx"
+
+#include <vcl/graphite_features.hxx>
+#include <vcl/graphite_adaptors.hxx>
+
+// Module private type definitions and forward declarations.
+//
+using gr::GrResult;
+namespace
+{
+ inline float from_hinted(const int x) {
+ return static_cast<float>(x + 32) / 64.0;
+ }
+ typedef std::hash_map<long,bool> SilfMap;
+}
+extern FT_Error (*pFTEmbolden)(FT_GlyphSlot);
+extern FT_Error (*pFTOblique)(FT_GlyphSlot);
+
+// class CharacterRenderProperties implentation.
+//
+FontProperties::FontProperties(const FreetypeServerFont &font) throw()
+{
+ clrFore = gr::kclrBlack;
+ clrBack = gr::kclrTransparent;
+
+ pixHeight = from_hinted(font.GetMetricsFT().height);
+
+ switch (font.GetFontSelData().meWeight)
+ {
+ case WEIGHT_SEMIBOLD: case WEIGHT_BOLD:
+ case WEIGHT_ULTRABOLD: case WEIGHT_BLACK:
+ fBold = true;
+ break;
+ default :
+ fBold = false;
+ }
+
+ switch (font.GetFontSelData().meItalic)
+ {
+ case ITALIC_NORMAL: case ITALIC_OBLIQUE:
+ fItalic = true;
+ break;
+ default :
+ fItalic = false;
+ }
+
+ // Get the font name, but prefix with file name hash in case
+ // there are 2 fonts on the system with the same face name
+ sal_Int32 nHashCode = font.GetFontFileName()->hashCode();
+ ::rtl::OUStringBuffer nHashFaceName;
+ nHashFaceName.append(nHashCode, 16);
+ const sal_Unicode * name = font.GetFontSelData().maName.GetBuffer();
+ nHashFaceName.append(name);
+
+ const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1,
+ static_cast<size_t>(nHashFaceName.getLength()));
+
+ std::copy(nHashFaceName.getStr(), nHashFaceName.getStr() + name_sz, szFaceName);
+ szFaceName[name_sz] = '\0';
+}
+
+// class GraphiteFontAdaptor implementaion.
+//
+GraphiteFontAdaptor::GraphiteFontAdaptor(ServerFont & sfont, const sal_Int32 dpiX, const sal_Int32 dpiY)
+ : mrFont(static_cast<FreetypeServerFont &>(sfont)),
+ maFontProperties(static_cast<FreetypeServerFont &>(sfont)),
+ mnDpiX(dpiX),
+ mnDpiY(dpiY),
+ mfAscent(from_hinted(static_cast<FreetypeServerFont &>(sfont).GetMetricsFT().ascender)),
+ mfDescent(from_hinted(static_cast<FreetypeServerFont &>(sfont).GetMetricsFT().descender)),
+ mfEmUnits(static_cast<FreetypeServerFont &>(sfont).GetMetricsFT().y_ppem),
+ mpFeatures(NULL)
+{
+ const rtl::OString aLang = MsLangId::convertLanguageToIsoByteString( sfont.GetFontSelData().meLanguage );
+ rtl::OString name = rtl::OUStringToOString(
+ sfont.GetFontSelData().maTargetName, RTL_TEXTENCODING_UTF8 );
+#ifdef DEBUG
+ printf("GraphiteFontAdaptor %lx %s italic=%u bold=%u\n", (long)this, name.getStr(),
+ maFontProperties.fItalic, maFontProperties.fBold);
+#endif
+ sal_Int32 nFeat = name.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + 1;
+ if (nFeat > 0)
+ {
+ rtl::OString aFeat = name.copy(nFeat, name.getLength() - nFeat);
+ mpFeatures = new grutils::GrFeatureParser(*this, aFeat.getStr(), aLang.getStr());
+#ifdef DEBUG
+ printf("GraphiteFontAdaptor %s/%s/%s %x language %d features %d errors\n",
+ rtl::OUStringToOString( sfont.GetFontSelData().maName,
+ RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( sfont.GetFontSelData().maTargetName,
+ RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( sfont.GetFontSelData().maSearchName,
+ RTL_TEXTENCODING_UTF8 ).getStr(),
+ sfont.GetFontSelData().meLanguage,
+ (int)mpFeatures->getFontFeatures(NULL), mpFeatures->parseErrors());
+#endif
+ }
+ else
+ {
+ mpFeatures = new grutils::GrFeatureParser(*this, aLang.getStr());
+ }
+}
+
+GraphiteFontAdaptor::GraphiteFontAdaptor(const GraphiteFontAdaptor &rhs) throw()
+ : Font(rhs),
+ mrFont (rhs.mrFont), maFontProperties(rhs.maFontProperties),
+ mnDpiX(rhs.mnDpiX), mnDpiY(rhs.mnDpiY),
+ mfAscent(rhs.mfAscent), mfDescent(rhs.mfDescent), mfEmUnits(rhs.mfEmUnits),
+ mpFeatures(NULL)
+{
+ if (rhs.mpFeatures) mpFeatures = new grutils::GrFeatureParser(*(rhs.mpFeatures));
+}
+
+
+GraphiteFontAdaptor::~GraphiteFontAdaptor() throw()
+{
+ maGlyphMetricMap.clear();
+ if (mpFeatures) delete mpFeatures;
+ mpFeatures = NULL;
+}
+
+void GraphiteFontAdaptor::UniqueCacheInfo(ext_std::wstring & face_name_out, bool & bold_out, bool & italic_out)
+{
+ face_name_out = maFontProperties.szFaceName;
+ bold_out = maFontProperties.fBold;
+ italic_out = maFontProperties.fItalic;
+}
+
+bool GraphiteFontAdaptor::IsGraphiteEnabledFont(ServerFont & font) throw()
+{
+ static SilfMap sSilfMap;
+ // NOTE: this assumes that the same FTFace pointer won't be reused,
+ // so FtFontInfo::ReleaseFaceFT must only be called at shutdown.
+ FreetypeServerFont & aFtFont = dynamic_cast<FreetypeServerFont &>(font);
+ FT_Face aFace = reinterpret_cast<FT_FaceRec_*>(aFtFont.GetFtFace());
+ SilfMap::iterator i = sSilfMap.find(reinterpret_cast<long>(aFace));
+ if (i != sSilfMap.end())
+ {
+#ifdef DEBUG
+ if (static_cast<bool>(aFtFont.GetTable("Silf", 0)) != (*i).second)
+ printf("Silf cache font mismatch\n");
+#endif
+ return (*i).second;
+ }
+ bool bHasSilf = aFtFont.GetTable("Silf", 0);
+ sSilfMap[reinterpret_cast<long>(aFace)] = bHasSilf;
+ return bHasSilf;
+}
+
+
+gr::Font * GraphiteFontAdaptor::copyThis() {
+ return new GraphiteFontAdaptor(*this);
+}
+
+
+unsigned int GraphiteFontAdaptor::getDPIx() {
+ return mnDpiX;
+}
+
+
+unsigned int GraphiteFontAdaptor::getDPIy() {
+ return mnDpiY;
+}
+
+
+float GraphiteFontAdaptor::ascent() {
+ return mfAscent;
+}
+
+
+float GraphiteFontAdaptor::descent() {
+ return mfDescent;
+}
+
+
+bool GraphiteFontAdaptor::bold() {
+ return maFontProperties.fBold;
+}
+
+
+bool GraphiteFontAdaptor::italic() {
+ return maFontProperties.fItalic;
+}
+
+
+float GraphiteFontAdaptor::height() {
+ return maFontProperties.pixHeight;
+}
+
+
+void GraphiteFontAdaptor::getFontMetrics(float * ascent_out, float * descent_out, float * em_square_out) {
+ if (ascent_out) *ascent_out = mfAscent;
+ if (descent_out) *descent_out = mfDescent;
+ if (em_square_out) *em_square_out = mfEmUnits;
+}
+
+
+const void * GraphiteFontAdaptor::getTable(gr::fontTableId32 table_id, size_t * buffer_sz)
+{
+ char tag_name[5] = {char(table_id >> 24), char(table_id >> 16), char(table_id >> 8), char(table_id), 0};
+ ULONG temp = *buffer_sz;
+
+ const void * const tbl_buf = static_cast<FreetypeServerFont &>(mrFont).GetTable(tag_name, &temp);
+ *buffer_sz = temp;
+
+ return tbl_buf;
+}
+
+#define fix26_6(x) (x >> 6) + (x & 32 ? (x > 0 ? 1 : 0) : (x < 0 ? -1 : 0))
+
+// Return the glyph's metrics in pixels.
+void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBounding, gr::Point & advances)
+{
+ // There used to be problems when orientation was set however, this no
+ // longer seems to be the case and the Glyph Metric cache in
+ // FreetypeServerFont is more efficient since it lasts between calls to VCL
+#if 1
+ const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId);
+
+ aBounding.right = aBounding.left = metric.GetOffset().X();
+ aBounding.bottom = aBounding.top = -metric.GetOffset().Y();
+ aBounding.right += metric.GetSize().Width();
+ aBounding.bottom -= metric.GetSize().Height();
+
+ advances.x = metric.GetDelta().X();
+ advances.y = -metric.GetDelta().Y();
+
+#else
+ // The problem with the code below is that the cache only lasts
+ // as long as the life time of the GraphiteFontAdaptor, which
+ // is created once per call to X11SalGraphics::GetTextLayout
+ GlyphMetricMap::const_iterator gm_itr = maGlyphMetricMap.find(nGlyphId);
+ if (gm_itr != maGlyphMetricMap.end())
+ {
+ // We've cached the results from last time.
+ aBounding = gm_itr->second.first;
+ advances = gm_itr->second.second;
+ }
+ else
+ {
+ // We need to look up the glyph.
+ FT_Int nLoadFlags = mrFont.GetLoadFlags();
+
+ FT_Face aFace = reinterpret_cast<FT_Face>(mrFont.GetFtFace());
+ if (!aFace)
+ {
+ aBounding.top = aBounding.bottom = aBounding.left = aBounding.right = 0;
+ advances.x = advances.y = 0;
+ return;
+ }
+ FT_Error aStatus = -1;
+ aStatus = FT_Load_Glyph(aFace, nGlyphId, nLoadFlags);
+ if( aStatus != FT_Err_Ok || (!aFace->glyph))
+ {
+ aBounding.top = aBounding.bottom = aBounding.left = aBounding.right = 0;
+ advances.x = advances.y = 0;
+ return;
+ }
+ // check whether we need synthetic bold/italic otherwise metric is wrong
+ if (mrFont.NeedsArtificialBold() && pFTEmbolden)
+ (*pFTEmbolden)(aFace->glyph);
+
+ if (mrFont.NeedsArtificialItalic() && pFTOblique)
+ (*pFTOblique)(aFace->glyph);
+
+ const FT_Glyph_Metrics &gm = aFace->glyph->metrics;
+
+ // Fill out the bounding box an advances.
+ aBounding.top = aBounding.bottom = fix26_6(gm.horiBearingY);
+ aBounding.bottom -= fix26_6(gm.height);
+ aBounding.left = aBounding.right = fix26_6(gm.horiBearingX);
+ aBounding.right += fix26_6(gm.width);
+ advances.x = fix26_6(gm.horiAdvance);
+ advances.y = 0;
+
+ // Now add an entry to our metrics map.
+ maGlyphMetricMap[nGlyphId] = std::make_pair(aBounding, advances);
+ }
+#endif
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
new file mode 100644
index 000000000000..20f354b5b9f3
--- /dev/null
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -0,0 +1,203 @@
+/* -*- 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"
+
+#ifdef WNT
+#include <tools/svwin.h>
+#include <svsys.h>
+#endif
+
+#include <tools/debug.hxx>
+#include <vcl/sallayout.hxx>
+
+#include <preextstl.h>
+#include <graphite/GrClient.h>
+#include <graphite/Segment.h>
+#include <postextstl.h>
+
+#include <rtl/ustring.hxx>
+#include <vcl/graphite_layout.hxx>
+#include <vcl/graphite_cache.hxx>
+
+#include "graphite_textsrc.hxx"
+
+GrSegRecord::GrSegRecord(rtl::OUString * rope, TextSourceAdaptor * textSrc, gr::Segment * seg, bool bIsRtl)
+ : m_rope(rope), m_text(textSrc), m_seg(seg), m_nextKey(NULL),
+ m_fontScale(0.0f), mbIsRtl(bIsRtl), m_lockCount(0)
+{
+ m_pStr = textSrc->getLayoutArgs().mpStr + seg->startCharacter();
+ m_startChar = seg->startCharacter();
+}
+
+GrSegRecord::~GrSegRecord()
+{
+ clear();
+}
+
+void GrSegRecord::reuse(rtl::OUString * rope, TextSourceAdaptor * textSrc, gr::Segment * seg, bool bIsRtl)
+{
+ clear();
+ mnWidth = 0;
+ m_rope = rope;
+ m_text = textSrc;
+ m_seg = seg;
+ m_nextKey = NULL;
+ m_pStr = textSrc->getLayoutArgs().mpStr + seg->startCharacter();
+ m_startChar = seg->startCharacter();
+ mbIsRtl = bIsRtl;
+}
+
+void GrSegRecord::clearVectors()
+{
+ mvGlyphs.clear();
+ mvCharDxs.clear();
+ mvChar2BaseGlyph.clear();
+ mvGlyph2Char.clear();
+}
+
+void GrSegRecord::clear()
+{
+#ifdef GR_DEBUG_TEXT
+ if (m_lockCount != 0)
+ OutputDebugString("GrSegRecord locked!");
+#endif
+ clearVectors();
+ delete m_rope;
+ delete m_seg;
+ delete m_text;
+ m_rope = NULL;
+ m_seg = NULL;
+ m_text = NULL;
+ m_fontScale = 0.0f;
+ m_lockCount = 0;
+}
+
+GrSegRecord * GraphiteSegmentCache::cacheSegment(TextSourceAdaptor * adapter, gr::Segment * seg, bool bIsRtl)
+{
+ GrSegRecord * record = NULL;
+ // We keep a record of the oldest key and the last key added
+ // when the next key is added, the record for the prevKey's m_nextKey field
+ // is updated to the newest key so that m_oldestKey can be updated to the
+ // next oldest key when the record for m_oldestKey is deleted
+ if (m_segMap.size() > m_nSegCacheSize)
+ {
+ GraphiteSegMap::iterator oldestPair = m_segMap.find(reinterpret_cast<long>(m_oldestKey));
+ // oldest record may no longer exist if a buffer was changed
+ if (oldestPair != m_segMap.end())
+ {
+ record = oldestPair->second;
+ m_segMap.erase(reinterpret_cast<long>(m_oldestKey));
+ GrRMEntry range = m_ropeMap.equal_range((*(record->m_rope)).hashCode());
+ while (range.first != range.second)
+ {
+ if (range.first->second == record)
+ {
+ m_ropeMap.erase(range.first);
+ break;
+ }
+ ++range.first;
+ }
+ m_oldestKey = record->m_nextKey;
+ // record will be reused, so don't delete
+ }
+ }
+
+
+// const int seg_char_limit = min(adapter->maLayoutArgs().mnLength,
+// adapter->maLayoutArgs().mnEndCharPos
+// + GraphiteLayout::EXTRA_CONTEXT_LENGTH);
+// if (seg->stopCharacter() - seg->startCharacter() <= 0)
+// OutputDebugString("Invalid seg indices\n");
+ rtl::OUString * pRope = new rtl::OUString(adapter->getLayoutArgs().mpStr + seg->startCharacter(),
+ seg->stopCharacter() - seg->startCharacter());
+ if (!pRope) return NULL;
+ bool reuse = false;
+ if (record)
+ record->reuse(pRope, adapter, seg, bIsRtl);
+ else
+ record = new GrSegRecord(pRope, adapter, seg, bIsRtl);
+ if (!record)
+ {
+ delete pRope;
+ return NULL;
+ }
+ GraphiteSegMap::iterator iMap =
+ m_segMap.find(reinterpret_cast<long>(record->m_pStr));
+ if (iMap != m_segMap.end())
+ {
+ // the buffer has changed, so the old cached Segment is useless
+ reuse = true;
+ GrSegRecord * found = iMap->second;
+ // Note: we reuse the old next key to avoid breaking our history
+ // chain. This means it will be prematurely deleted, but this is
+ // unlikely to happen very often.
+ record->m_nextKey = found->m_nextKey;
+ // overwrite the old record
+ m_segMap[reinterpret_cast<long>(record->m_pStr)] = record;
+ // erase the old rope key and save the new one
+ GrRMEntry range = m_ropeMap.equal_range((*(found->m_rope)).hashCode());
+ while (range.first != range.second)
+ {
+ if (range.first->second == found)
+ {
+ m_ropeMap.erase(range.first);
+ break;
+ }
+ ++range.first;
+ }
+ GraphiteRopeMap::value_type mapEntry(record->m_rope->hashCode(), record);
+ m_ropeMap.insert(mapEntry);
+ // remove the old record
+ delete found;
+ record->m_lockCount++;
+ return record;
+ }
+ m_segMap[reinterpret_cast<long>(record->m_pStr)] = record;
+ GraphiteRopeMap::value_type mapEntry((*(record->m_rope)).hashCode(), record);
+ m_ropeMap.insert(mapEntry);
+
+ if (m_oldestKey == NULL)
+ {
+ m_oldestKey = record->m_pStr;
+ m_prevKey = record->m_pStr;
+ }
+ else if (reuse == false)
+ {
+ DBG_ASSERT(m_segMap.count(reinterpret_cast<long>(m_prevKey)),
+ "Previous key got lost somehow!");
+ m_segMap.find(reinterpret_cast<long>(m_prevKey))
+ ->second->m_nextKey = record->m_pStr;
+ m_prevKey = record->m_pStr;
+ }
+ record->m_lockCount++;
+ return record;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx
index 175656e25515..7b0ba0afa1ac 100644
--- a/vcl/source/glyphs/graphite_features.cxx
+++ b/vcl/source/glyphs/graphite_features.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
// Description:
// Parse a string of features specified as & separated pairs.
// e.g.
@@ -37,7 +37,8 @@
#include <sal/types.h>
#ifdef WNT
-#include <windows.h>
+#include <tools/svwin.h>
+#include <svsys.h>
#endif
#include <vcl/graphite_features.hxx>
@@ -48,107 +49,79 @@ const char GrFeatureParser::FEAT_PREFIX = ':';
const char GrFeatureParser::FEAT_SEPARATOR = '&';
const char GrFeatureParser::FEAT_ID_VALUE_SEPARATOR = '=';
-GrFeatureParser::GrFeatureParser(const gr_face * pFace, const ::rtl::OString lang)
- : mnNumSettings(0), mbErrors(false), mpSettings(NULL)
+GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string lang)
+ : mnNumSettings(0), mbErrors(false)
{
- maLang.label[0] = maLang.label[1] = maLang.label[2] = maLang.label[3] = '\0';
- setLang(pFace, lang);
+ maLang.rgch[0] = maLang.rgch[1] = maLang.rgch[2] = maLang.rgch[3] = '\0';
+ setLang(font, lang);
}
-GrFeatureParser::GrFeatureParser(const gr_face * pFace, const ::rtl::OString features, const ::rtl::OString lang)
- : mnNumSettings(0), mbErrors(false), mpSettings(NULL)
+GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string features, const std::string lang)
+ : mnNumSettings(0), mbErrors(false)
{
- sal_Int32 nEquals = 0;
- sal_Int32 nFeatEnd = 0;
- sal_Int32 pos = 0;
- maLang.num = 0u;
- setLang(pFace, lang);
- while ((pos < features.getLength()) && (mnNumSettings < MAX_FEATURES))
+ size_t nEquals = 0;
+ size_t nFeatEnd = 0;
+ size_t pos = 0;
+ maLang.rgch[0] = maLang.rgch[1] = maLang.rgch[2] = maLang.rgch[3] = '\0';
+ setLang(font, lang);
+ while (pos < features.length() && mnNumSettings < MAX_FEATURES)
{
- nEquals = features.indexOf(FEAT_ID_VALUE_SEPARATOR, pos);
- if (nEquals == -1)
+ nEquals = features.find(FEAT_ID_VALUE_SEPARATOR,pos);
+ if (nEquals == std::string::npos)
{
mbErrors = true;
break;
}
// check for a lang=xxx specification
- const ::rtl::OString aLangPrefix("lang");
- if (features.match(aLangPrefix, pos ))
+ if (features.compare(pos, nEquals - pos, "lang") == 0)
{
pos = nEquals + 1;
- nFeatEnd = features.indexOf(FEAT_SEPARATOR, pos);
- if (nFeatEnd == -1)
+ nFeatEnd = features.find(FEAT_SEPARATOR, pos);
+ if (nFeatEnd == std::string::npos)
{
- nFeatEnd = features.getLength();
+ nFeatEnd = features.length();
}
if (nFeatEnd - pos > 3)
mbErrors = true;
else
{
- FeatId aLang = maLang;
- aLang.num = 0;
- for (sal_Int32 i = pos; i < nFeatEnd; i++)
- aLang.label[i-pos] = features[i];
-
- //ext_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
- // = font.getSupportedLanguages();
- //gr::LanguageIterator iL = aSupported.first;
- unsigned short i = 0;
- for (; i < gr_face_n_languages(pFace); i++)
+ gr::isocode aLang = maLang;
+ for (size_t i = pos; i < nFeatEnd; i++)
+ aLang.rgch[i-pos] = features[i];
+ ext_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
+ = font.getSupportedLanguages();
+ gr::LanguageIterator iL = aSupported.first;
+ while (iL != aSupported.second)
{
- gr_uint32 nFaceLang = gr_face_lang_by_index(pFace, i);
- FeatId aSupportedLang;
- aSupportedLang.num = nFaceLang;
-#ifdef __BIG_ENDIAN__
+ gr::isocode aSupportedLang = *iL;
// here we only expect full 3 letter codes
- if (aLang.label[0] == aSupportedLang.label[0] &&
- aLang.label[1] == aSupportedLang.label[1] &&
- aLang.label[2] == aSupportedLang.label[2] &&
- aLang.label[3] == aSupportedLang.label[3])
-#else
- if (aLang.label[0] == aSupportedLang.label[3] &&
- aLang.label[1] == aSupportedLang.label[2] &&
- aLang.label[2] == aSupportedLang.label[1] &&
- aLang.label[3] == aSupportedLang.label[0])
-#endif
- {
- maLang = aSupportedLang;
- break;
- }
- }
- if (i == gr_face_n_languages(pFace)) mbErrors = true;
- else
- {
- mnHash = maLang.num;
- mpSettings = gr_face_featureval_for_lang(pFace, maLang.num);
+ if (aLang.rgch[0] == aSupportedLang.rgch[0] &&
+ aLang.rgch[1] == aSupportedLang.rgch[1] &&
+ aLang.rgch[2] == aSupportedLang.rgch[2] &&
+ aLang.rgch[3] == aSupportedLang.rgch[3]) break;
+ ++iL;
}
+ if (iL == aSupported.second) mbErrors = true;
+ else maLang = aLang;
}
}
else
{
- sal_uInt32 featId = 0;
if (isCharId(features, pos, nEquals - pos))
- {
- featId = getCharId(features, pos, nEquals - pos);
- }
- else
- {
- featId = getIntValue(features, pos, nEquals - pos);
- }
- const gr_feature_ref * pFref = gr_face_find_fref(pFace, featId);
+ maSettings[mnNumSettings].id = getCharId(features, pos, nEquals - pos);
+ else maSettings[mnNumSettings].id = getIntValue(features, pos, nEquals - pos);
pos = nEquals + 1;
- nFeatEnd = features.indexOf(FEAT_SEPARATOR, pos);
- if (nFeatEnd == -1)
+ nFeatEnd = features.find(FEAT_SEPARATOR, pos);
+ if (nFeatEnd == std::string::npos)
{
- nFeatEnd = features.getLength();
+ nFeatEnd = features.length();
}
- sal_Int16 featValue = 0;
- featValue = getIntValue(features, pos, nFeatEnd - pos);
- if (pFref && gr_fref_set_feature_value(pFref, featValue, mpSettings))
- {
- mnHash = (mnHash << 16) ^ ((featId << 8) | featValue);
+ if (isCharId(features, pos, nFeatEnd - pos))
+ maSettings[mnNumSettings].value = getCharId(features, pos, nFeatEnd - pos);
+ else
+ maSettings[mnNumSettings].value= getIntValue(features, pos, nFeatEnd - pos);
+ if (isValid(font, maSettings[mnNumSettings]))
mnNumSettings++;
- }
else
mbErrors = true;
}
@@ -156,76 +129,89 @@ GrFeatureParser::GrFeatureParser(const gr_face * pFace, const ::rtl::OString fea
}
}
-void GrFeatureParser::setLang(const gr_face * pFace, const rtl::OString & lang)
+void GrFeatureParser::setLang(gr::Font & font, const std::string & lang)
{
- FeatId aLang;
- aLang.num = 0;
- if (lang.getLength() >= 2)
+ gr::isocode aLang = {{0,0,0,0}};
+ if (lang.length() > 2)
{
- for (sal_Int32 i = 0; i < lang.getLength() && i < 3; i++)
+ for (size_t i = 0; i < lang.length() && i < 3; i++)
{
if (lang[i] == '-') break;
- aLang.label[i] = lang[i];
- }
- unsigned short i = 0;
- for (; i < gr_face_n_languages(pFace); i++)
- {
- gr_uint32 nFaceLang = gr_face_lang_by_index(pFace, i);
- FeatId aSupportedLang;
- aSupportedLang.num = nFaceLang;
- // here we only expect full 2 & 3 letter codes
-#ifdef __BIG_ENDIAN__
- if (aLang.label[0] == aSupportedLang.label[0] &&
- aLang.label[1] == aSupportedLang.label[1] &&
- aLang.label[2] == aSupportedLang.label[2] &&
- aLang.label[3] == aSupportedLang.label[3])
-#else
- if (aLang.label[0] == aSupportedLang.label[3] &&
- aLang.label[1] == aSupportedLang.label[2] &&
- aLang.label[2] == aSupportedLang.label[1] &&
- aLang.label[3] == aSupportedLang.label[0])
-#endif
- {
- maLang = aSupportedLang;
- break;
- }
+ aLang.rgch[i] = lang[i];
}
- if (i != gr_face_n_languages(pFace))
+ ext_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
+ = font.getSupportedLanguages();
+ gr::LanguageIterator iL = aSupported.first;
+ while (iL != aSupported.second)
{
- if (mpSettings)
- gr_featureval_destroy(mpSettings);
- mpSettings = gr_face_featureval_for_lang(pFace, maLang.num);
- mnHash = maLang.num;
+ gr::isocode aSupportedLang = *iL;
+ if (aLang.rgch[0] == aSupportedLang.rgch[0] &&
+ aLang.rgch[1] == aSupportedLang.rgch[1] &&
+ aLang.rgch[2] == aSupportedLang.rgch[2] &&
+ aLang.rgch[3] == aSupportedLang.rgch[3]) break;
+ ++iL;
}
+ if (iL != aSupported.second)
+ maLang = aLang;
+#ifdef DEBUG
+ else
+ printf("%s has no features\n", aLang.rgch);
+#endif
}
- if (!mpSettings)
- mpSettings = gr_face_featureval_for_lang(pFace, 0);
+}
+
+GrFeatureParser::GrFeatureParser(const GrFeatureParser & aCopy)
+ : maLang(aCopy.maLang), mbErrors(aCopy.mbErrors)
+{
+ mnNumSettings = aCopy.getFontFeatures(maSettings);
}
GrFeatureParser::~GrFeatureParser()
{
- if (mpSettings)
+}
+
+size_t GrFeatureParser::getFontFeatures(gr::FeatureSetting settings[64]) const
+{
+ if (settings)
{
- gr_featureval_destroy(mpSettings);
- mpSettings = NULL;
+ std::copy(maSettings, maSettings + mnNumSettings, settings);
}
+ return mnNumSettings;
}
-bool GrFeatureParser::isCharId(const rtl::OString & id, size_t offset, size_t length)
+bool GrFeatureParser::isValid(gr::Font & font, gr::FeatureSetting & setting)
+{
+ gr::FeatureIterator i = font.featureWithID(setting.id);
+ if (font.getFeatures().second == i)
+ {
+ return false;
+ }
+ ext_std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator >
+ validValues = font.getFeatureSettings(i);
+ gr::FeatureSettingIterator j = validValues.first;
+ while (j != validValues.second)
+ {
+ if (*j == setting.value) return true;
+ ++j;
+ }
+ return false;
+}
+
+bool GrFeatureParser::isCharId(const std::string & id, size_t offset, size_t length)
{
if (length > 4) return false;
for (size_t i = 0; i < length; i++)
{
if (i > 0 && id[offset+i] == '\0') continue;
- if ((id[offset+i] < 0x20) || (id[offset+i] < 0))
+ if ((id[offset+i]) < 0x20 || (id[offset+i]) < 0)
return false;
- if (i==0 && (id[offset+i] < 0x41))
+ if (i==0 && id[offset+i] < 0x41)
return false;
}
return true;
}
-gr_uint32 GrFeatureParser::getCharId(const rtl::OString & id, size_t offset, size_t length)
+int GrFeatureParser::getCharId(const std::string & id, size_t offset, size_t length)
{
FeatId charId;
charId.num = 0;
@@ -243,9 +229,9 @@ gr_uint32 GrFeatureParser::getCharId(const rtl::OString & id, size_t offset, siz
return charId.num;
}
-short GrFeatureParser::getIntValue(const rtl::OString & id, size_t offset, size_t length)
+int GrFeatureParser::getIntValue(const std::string & id, size_t offset, size_t length)
{
- short value = 0;
+ int value = 0;
int sign = 1;
for (size_t i = 0; i < length; i++)
{
@@ -285,4 +271,18 @@ short GrFeatureParser::getIntValue(const rtl::OString & id, size_t offset, size_
return value;
}
+
+sal_Int32 GrFeatureParser::hashCode() const
+{
+ union IsoHash { sal_Int32 mInt; gr::isocode mCode; };
+ IsoHash isoHash;
+ isoHash.mCode = maLang;
+ sal_Int32 hash = isoHash.mInt;
+ for (size_t i = 0; i < mnNumSettings; i++)
+ {
+ hash = (hash << 16) ^ ((maSettings[i].id << 8) | maSettings[i].value);
+ }
+ return hash;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index ab5b59025724..0a674a21d492 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
// Description: An implementation of the SalLayout interface that uses the
// Graphite engine.
@@ -37,9 +37,8 @@
// Enable lots of debug info
#ifdef DEBUG
-#include <cstdio>
//#define GRLAYOUT_DEBUG 1
-#undef NDEBUG
+//#undef NDEBUG
#endif
// Header files
@@ -53,7 +52,14 @@
#include <deque>
// Platform
+#ifdef WNT
+#include <tools/svwin.h>
#include <svsys.h>
+#endif
+
+#ifdef UNX
+#include <vcl/graphite_adaptors.hxx>
+#endif
#include <vcl/salgdi.hxx>
@@ -62,10 +68,18 @@
#include <unicode/uscript.h>
// Graphite Libraries (must be after vcl headers on windows)
-#include <graphite2/Segment.h>
+#include <preextstl.h>
+#include <graphite/GrClient.h>
+#include <graphite/Font.h>
+#include <graphite/ITextSource.h>
+#include <graphite/Segment.h>
+#include <graphite/SegmentPainter.h>
+#include <postextstl.h>
+
+#include <vcl/graphite_layout.hxx>
+#include <vcl/graphite_features.hxx>
+#include "graphite_textsrc.hxx"
-#include "vcl/graphite_layout.hxx"
-#include "vcl/graphite_features.hxx"
// Module private type definitions and forward declarations.
//
@@ -73,38 +87,48 @@
//
#ifdef GRLAYOUT_DEBUG
-static FILE * grLogFile = NULL;
-static FILE * grLog()
+FILE * grLogFile = NULL;
+FILE * grLog()
{
#ifdef WNT
std::string logFileName(getenv("TEMP"));
- logFileName.append("/graphitelayout.log");
+ logFileName.append("\\graphitelayout.log");
if (grLogFile == NULL) grLogFile = fopen(logFileName.c_str(),"w");
else fflush(grLogFile);
return grLogFile;
#else
- fflush(stdout);
return stdout;
#endif
}
#endif
+#ifdef GRCACHE
+#include <vcl/graphite_cache.hxx>
+#endif
+
+
namespace
{
+ typedef ext_std::pair<gr::GlyphIterator, gr::GlyphIterator> glyph_range_t;
+ typedef ext_std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyph_set_range_t;
+
inline long round(const float n) {
return long(n + (n < 0 ? -0.5 : 0.5));
}
+
template<typename T>
inline bool in_range(const T i, const T b, const T e) {
return !(b > i) && i < e;
}
+
template<typename T>
inline bool is_subrange(const T sb, const T se, const T b, const T e) {
return !(b > sb || se > e);
}
+
template<typename T>
inline bool is_subrange(const std::pair<T, T> &s, const T b, const T e) {
return is_subrange(s.first, s.second, b, e);
@@ -127,19 +151,10 @@ namespace
return limit;
}
- template <typename T>
- T maximum(T a, T b)
- {
- return (a > b)? a : b;
- }
- template <typename T>
- T minimum(T a, T b)
- {
- return (a < b)? a : b;
- }
-
} // namespace
+
+
// Impementation of the GraphiteLayout::Glyphs container class.
// This is an extended vector class with methods added to enable
// o Correctly filling with glyphs.
@@ -147,368 +162,413 @@ namespace
// o manipulations that affect neighouring glyphs.
const int GraphiteLayout::EXTRA_CONTEXT_LENGTH = 10;
-
-// find first slot of cluster and first slot of subsequent cluster
-static void findFirstClusterSlot(const gr_slot* base, gr_slot const** first, gr_slot const** after, int * firstChar, int * lastChar, bool bRtl)
-{
- if (gr_slot_attached_to(base) == NULL)
- {
- *first = base;
- *after = (bRtl)? gr_slot_prev_in_segment(base) :
- gr_slot_next_in_segment(base);
- *firstChar = gr_slot_before(base);
- *lastChar = gr_slot_after(base);
- }
- const gr_slot * attachment = gr_slot_first_attachment(base);
- while (attachment)
- {
- if (gr_slot_origin_X(*first) > gr_slot_origin_X(attachment))
- *first = attachment;
- const gr_slot* attachmentNext = (bRtl)?
- gr_slot_prev_in_segment(attachment) : gr_slot_next_in_segment(attachment);
- if (attachmentNext)
- {
- if (*after && (gr_slot_origin_X(*after) < gr_slot_origin_X(attachmentNext)))
- *after = attachmentNext;
- }
- else
- {
- *after = NULL;
- }
- if (gr_slot_before(attachment) < *firstChar)
- *firstChar = gr_slot_before(attachment);
- if (gr_slot_after(attachment) > *lastChar)
- *lastChar = gr_slot_after(attachment);
- if (gr_slot_first_attachment(attachment))
- findFirstClusterSlot(attachment, first, after, firstChar, lastChar, bRtl);
- attachment = gr_slot_next_sibling_attachment(attachment);
- }
-}
+#ifdef GRCACHE
+GraphiteCacheHandler GraphiteCacheHandler::instance;
+#endif
// The Graphite glyph stream is really a sequence of glyph attachment trees
-// each rooted at a non-attached base glyph. fill_from walks the glyph stream,
-// finds each non-attached base glyph and calls append to record them as a
+// each rooted at a non-attached base glyph. fill_from walks the glyph stream
+// find each non-attached base glyph and calls append to record them as a
// sequence of clusters.
void
-GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fScaling)
+GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
+ bool bRtl, long &rWidth, float fScaling, std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs)
{
- bool bRtl = (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL);
- int nCharRequested = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
- int nChar = gr_seg_n_cinfo(pSegment);
- float fMinX = gr_seg_advance_X(pSegment);
+ // Create a glyph item for each of the glyph and append it to the base class glyph list.
+ typedef ext_std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet;
+ int nChar = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
+ glyph_range_t iGlyphs = rSegment.glyphs();
+ int nGlyphs = iGlyphs.second - iGlyphs.first;
+ gr::GlyphIterator prevBase = iGlyphs.second;
+ float fSegmentAdvance = rSegment.advanceWidth();
+ float fMinX = fSegmentAdvance;
float fMaxX = 0.0f;
- long nDxOffset = 0; // from dropped glyphs
- int nFirstCharInCluster = 0;
- int nLastCharInCluster = 0;
- unsigned int nGlyphs = gr_seg_n_slots(pSegment);
- mvGlyph2Char.assign(nGlyphs, -1);
- mvGlyphs.reserve(nGlyphs);
-
- if (bRtl)
+ rGlyph2Char.assign(nGlyphs, -1);
+ long nDxOffset = 0;
+ int nGlyphIndex = (bRtl)? (nGlyphs - 1) : 0;
+ // OOo always expects the glyphs in ltr order
+ int nDelta = (bRtl)? -1 : 1;
+
+ int nLastGlyph = (bRtl)? nGlyphs - 1: 0;
+ int nNextChar = (bRtl)? (rSegment.stopCharacter() - 1) : rSegment.startCharacter();//rArgs.mnMinCharPos;
+ // current glyph number (Graphite glyphs)
+ //int currGlyph = 0;
+ int nFirstCharInCluster = nNextChar;
+ int nFirstGlyphInCluster = nLastGlyph;
+
+ // ltr first char in cluster is lowest, same is true for rtl
+ // ltr first glyph in cluster is lowest, rtl first glyph is highest
+
+ // loop over the glyphs determining which characters are linked to them
+ gr::GlyphIterator gi;
+ for (gi = iGlyphs.first + nGlyphIndex;
+ nGlyphIndex >= 0 && nGlyphIndex < nGlyphs;
+ nGlyphIndex+= nDelta, gi = iGlyphs.first + nGlyphIndex)
{
- const gr_slot* baseSlot = gr_seg_last_slot(pSegment);
- // find first base
- while (baseSlot && (gr_slot_attached_to(baseSlot) != NULL))
- baseSlot = gr_slot_prev_in_segment(baseSlot);
- int iChar = nChar - 1;
- int iNextChar = nChar - 1;
- bool reordered = false;
- int nBaseGlyphIndex = 0;
- // now loop over bases
- while (baseSlot)
+ gr::GlyphInfo info = (*gi);
+#ifdef GRLAYOUT_DEBUG
+ fprintf(grLog(),"Glyph %d %f,%f\n", (int)info.logicalIndex(), info.origin(), info.yOffset());
+#endif
+ // the last character associated with this glyph is after
+ // our current cluster buffer position
+ if ((bRtl && ((signed)info.firstChar() <= nNextChar)) ||
+ (!bRtl && ((signed)info.lastChar() >= nNextChar)))
{
- bool bCluster = !reordered;
- const gr_slot * clusterFirst = NULL;
- const gr_slot * clusterAfter = NULL;
- int firstChar = -1;
- int lastChar = -1;
- findFirstClusterSlot(baseSlot, &clusterFirst, &clusterAfter, &firstChar, &lastChar, bRtl);
- iNextChar = minimum<int>(firstChar, iNextChar);
- if (bCluster)
- {
- nBaseGlyphIndex = mvGlyphs.size();
- mvGlyph2Char[nBaseGlyphIndex] = iChar + mnSegCharOffset;
- nFirstCharInCluster = firstChar;
- nLastCharInCluster = lastChar;
- }
- else
- {
- mvGlyph2Char[mvGlyphs.size()] = firstChar + mnSegCharOffset;
- nFirstCharInCluster = minimum<int>(firstChar, nFirstCharInCluster);
- nLastCharInCluster = maximum<int>(firstChar, nLastCharInCluster);
- }
- float leftBoundary = gr_slot_origin_X(clusterFirst);
- float rightBoundary = (clusterAfter)?
- gr_slot_origin_X(clusterAfter) : gr_seg_advance_X(pSegment);
- if (
- lastChar < iChar &&
- (gr_cinfo_after(gr_seg_cinfo(pSegment, iChar)) >
- static_cast<int>(gr_slot_index(clusterAfter)))
- )
- {
- reordered = true;
- }
- else
- {
- reordered = false;
- iChar = iNextChar - 1;
- }
- if (mnSegCharOffset + nFirstCharInCluster >= mnMinCharPos &&
- mnSegCharOffset + nFirstCharInCluster < mnEndCharPos)
+ if ((bRtl && nGlyphIndex < nLastGlyph) ||
+ (!bRtl && nGlyphIndex > nLastGlyph))
{
- fMinX = minimum<float>(fMinX, leftBoundary);
- fMaxX = maximum<float>(fMaxX, rightBoundary);
- if (!reordered)
+ // this glyph is after the previous one left->right
+ // if insertion is allowed before it then we are in a
+ // new cluster
+ int nAttachedBase = (*(info.attachedClusterBase())).logicalIndex();
+ if (!info.isAttached() ||
+ !in_range(nAttachedBase, nFirstGlyphInCluster, nGlyphIndex))
{
- for (int i = nFirstCharInCluster; i <= nLastCharInCluster; i++)
+ if (in_range(nFirstCharInCluster, rArgs.mnMinCharPos, rArgs.mnEndCharPos) &&
+ nFirstGlyphInCluster != nGlyphIndex)
{
- if (mnSegCharOffset + i >= mnEndCharPos)
- break;
- // from the point of view of the dx array, the xpos is
- // the origin of the first glyph of the cluster rtl
- mvCharDxs[mnSegCharOffset + i - mnMinCharPos] =
- static_cast<int>(leftBoundary * fScaling) + nDxOffset;
- mvCharBreaks[mnSegCharOffset + i - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, i));
+ std::pair <float,float> aBounds =
+ appendCluster(rSegment, rArgs, bRtl,
+ fSegmentAdvance, nFirstCharInCluster,
+ nNextChar, nFirstGlyphInCluster, nGlyphIndex, fScaling,
+ rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
+ fMinX = std::min(aBounds.first, fMinX);
+ fMaxX = std::max(aBounds.second, fMaxX);
}
- mvChar2BaseGlyph[mnSegCharOffset + nFirstCharInCluster - mnMinCharPos] = nBaseGlyphIndex;
+ nFirstCharInCluster = (bRtl)? info.lastChar() : info.firstChar();
+ nFirstGlyphInCluster = nGlyphIndex;
}
- append(pSegment, rArgs, baseSlot, rightBoundary, fScaling,
- nDxOffset, bCluster, mnSegCharOffset + firstChar);
+ nLastGlyph = (bRtl)? std::min(nGlyphIndex, nAttachedBase) :
+ std::max(nGlyphIndex, nAttachedBase);
}
- if (mnSegCharOffset + nLastCharInCluster < mnMinCharPos)
- break;
- baseSlot = gr_slot_next_sibling_attachment(baseSlot);
- }
- }
- else
- {
- const gr_slot* baseSlot = gr_seg_first_slot(pSegment);
- // find first base
- while (baseSlot && (gr_slot_attached_to(baseSlot) != NULL))
- baseSlot = gr_slot_next_in_segment(baseSlot);
- int iChar = 0; // relative to segment
- int iNextChar = 0;
- bool reordered = false;
- int nBaseGlyphIndex = 0;
- // now loop over bases
- while (baseSlot)
- {
- bool bCluster = !reordered;
- const gr_slot * clusterFirst = NULL;
- const gr_slot * clusterAfter = NULL;
- int firstChar = -1;
- int lastChar = -1;
- findFirstClusterSlot(baseSlot, &clusterFirst, &clusterAfter, &firstChar, &lastChar, bRtl);
- iNextChar = maximum<int>(lastChar, iNextChar);
- if (bCluster)
- {
- nBaseGlyphIndex = mvGlyphs.size();
- mvGlyph2Char[nBaseGlyphIndex] = iChar + mnSegCharOffset;
- nFirstCharInCluster = firstChar;
- nLastCharInCluster = lastChar;
- }
- else
- {
- mvGlyph2Char[mvGlyphs.size()] = firstChar + mnSegCharOffset;
- nFirstCharInCluster = minimum<int>(firstChar, nFirstCharInCluster);
- nLastCharInCluster = maximum<int>(lastChar, nLastCharInCluster);
- }
- if (
- firstChar > iChar &&
- (gr_cinfo_before(gr_seg_cinfo(pSegment, iChar)) >
- static_cast<int>(gr_slot_index(clusterFirst)))
- )
+ // loop over chacters associated with this glyph and characters
+ // between nextChar and the last character associated with this glyph
+ // giving them the current cluster id. This allows for character /glyph
+ // order reversal.
+ // For each character we do a reverse glyph id look up
+ // and store the glyph id with the highest logical index in nLastGlyph
+ while ((bRtl && ((signed)info.firstChar() <= nNextChar)) ||
+ (!bRtl && (signed)info.lastChar() >= nNextChar))
{
- reordered = true;
+ GrGlyphSet charGlyphs = rSegment.charToGlyphs(nNextChar);
+ nNextChar += nDelta;
+ gr::GlyphSetIterator gj = charGlyphs.first;
+ while (gj != charGlyphs.second)
+ {
+ nLastGlyph = (bRtl)? min(nLastGlyph, (signed)(*gj).logicalIndex()) : max(nLastGlyph, (signed)(*gj).logicalIndex());
+ ++gj;
+ }
}
- else
+ // Loop over attached glyphs and make sure they are all in the cluster since you
+ // can have glyphs attached with another base glyph in between
+ glyph_set_range_t iAttached = info.attachedClusterGlyphs();
+ for (gr::GlyphSetIterator agi = iAttached.first; agi != iAttached.second; ++agi)
{
- reordered = false;
- iChar = iNextChar + 1;
+ nLastGlyph = (bRtl)? min(nLastGlyph, (signed)(*agi).logicalIndex()) : max(nLastGlyph, (signed)(*agi).logicalIndex());
}
- float leftBoundary = gr_slot_origin_X(clusterFirst);
- float rightBoundary = (clusterAfter)?
- gr_slot_origin_X(clusterAfter) : gr_seg_advance_X(pSegment);
- if (mnSegCharOffset + nFirstCharInCluster >= mnMinCharPos &&
- mnSegCharOffset + nFirstCharInCluster < mnEndCharPos)
+
+ // if this is a rtl attached glyph, then we need to include its
+ // base in the cluster, which will have a lower graphite index
+ if (bRtl)
{
- fMinX = minimum<float>(fMinX, leftBoundary);
- fMaxX = maximum<float>(fMaxX, rightBoundary);
- if (!reordered)
+ if ((signed)info.attachedClusterBase()->logicalIndex() < nLastGlyph)
{
- for (int i = nFirstCharInCluster; i <= nLastCharInCluster; i++)
- {
- if (mnSegCharOffset + i >= mnEndCharPos)
- break;
- // from the point of view of the dx array, the xpos is
- // the origin of the first glyph of the next cluster ltr
- mvCharDxs[mnSegCharOffset + i - mnMinCharPos] =
- static_cast<int>(rightBoundary * fScaling) + nDxOffset;
- mvCharBreaks[mnSegCharOffset + i - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, i));
- }
- // only set mvChar2BaseGlyph for first character of cluster
- mvChar2BaseGlyph[mnSegCharOffset + nFirstCharInCluster - mnMinCharPos] = nBaseGlyphIndex;
+ nLastGlyph = info.attachedClusterBase()->logicalIndex();
}
- append(pSegment, rArgs, baseSlot, rightBoundary, fScaling,
- nDxOffset, true, mnSegCharOffset + firstChar);
}
- if (mnSegCharOffset + nFirstCharInCluster >= mnEndCharPos)
- break;
- baseSlot = gr_slot_next_sibling_attachment(baseSlot);
}
+
+ // it is possible for the lastChar to be after nextChar and
+ // firstChar to be before the nFirstCharInCluster in rare
+ // circumstances e.g. Myanmar word for cemetery
+ if ((bRtl && ((signed)info.lastChar() > nFirstCharInCluster)) ||
+ (!bRtl && ((signed)info.firstChar() < nFirstCharInCluster)))
+ {
+ nFirstCharInCluster = info.firstChar();
+ }
+ }
+ // process last cluster
+ if (in_range(nFirstCharInCluster, rArgs.mnMinCharPos, rArgs.mnEndCharPos) &&
+ nFirstGlyphInCluster != nGlyphIndex)
+ {
+ std::pair <float,float> aBounds =
+ appendCluster(rSegment, rArgs, bRtl, fSegmentAdvance,
+ nFirstCharInCluster, nNextChar,
+ nFirstGlyphInCluster, nGlyphIndex, fScaling,
+ rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
+ fMinX = std::min(aBounds.first, fMinX);
+ fMaxX = std::max(aBounds.second, fMaxX);
}
long nXOffset = round(fMinX * fScaling);
- mnWidth = round(fMaxX * fScaling) - nXOffset + nDxOffset;
- if (mnWidth < 0)
+ rWidth = round(fMaxX * fScaling) - nXOffset + nDxOffset;
+ if (rWidth < 0)
{
// This can happen when there was no base inside the range
- mnWidth = 0;
+ rWidth = 0;
}
// fill up non-base char dx with cluster widths from previous base glyph
if (bRtl)
{
- if (mvCharDxs[nCharRequested-1] == -1)
- mvCharDxs[nCharRequested-1] = 0;
+ if (rCharDxs[nChar-1] == -1)
+ rCharDxs[nChar-1] = 0;
else
- mvCharDxs[nCharRequested-1] -= nXOffset;
- for (int i = nCharRequested - 2; i >= 0; i--)
+ rCharDxs[nChar-1] -= nXOffset;
+ for (int i = nChar - 2; i >= 0; i--)
{
- if (mvCharDxs[i] == -1) mvCharDxs[i] = mvCharDxs[i+1];
- else mvCharDxs[i] -= nXOffset;
+ if (rCharDxs[i] == -1) rCharDxs[i] = rCharDxs[i+1];
+ else rCharDxs[i] -= nXOffset;
}
}
else
{
- if (mvCharDxs[0] == -1)
- mvCharDxs[0] = 0;
+ if (rCharDxs[0] == -1)
+ rCharDxs[0] = 0;
else
- mvCharDxs[0] -= nXOffset;
- for (int i = 1; i < nCharRequested; i++)
+ rCharDxs[0] -= nXOffset;
+ for (int i = 1; i < nChar; i++)
{
- if (mvCharDxs[i] == -1) mvCharDxs[i] = mvCharDxs[i-1];
- else mvCharDxs[i] -= nXOffset;
-#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"%d,%d ", (int)i, (int)mvCharDxs[i]);
-#endif
+ if (rCharDxs[i] == -1) rCharDxs[i] = rCharDxs[i-1];
+ else rCharDxs[i] -= nXOffset;
}
}
+#ifdef GRLAYOUT_DEBUG
+ fprintf(grLog(),"Glyphs xOff%ld dropDx%ld w%ld\n", nXOffset, nDxOffset, rWidth);
+#endif
// remove offset due to context if there is one
if (nXOffset != 0)
{
- for (size_t i = 0; i < mvGlyphs.size(); i++)
- mvGlyphs[i].maLinearPos.X() -= nXOffset;
+ for (size_t i = 0; i < size(); i++)
+ (*this)[i].maLinearPos.X() -= nXOffset;
+ }
+}
+
+std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment& rSeg,
+ ImplLayoutArgs & rArgs, bool bRtl,float fSegmentAdvance,
+ int nFirstCharInCluster, int nNextChar, int nFirstGlyphInCluster,
+ int nNextGlyph, float fScaling, std::vector<int> & rChar2Base,
+ std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs, long & rDXOffset)
+{
+ glyph_range_t iGlyphs = rSeg.glyphs();
+ int nGlyphs = iGlyphs.second - iGlyphs.first;
+ int nDelta = (bRtl)? -1 : 1;
+ gr::GlyphInfo aFirstGlyph = *(iGlyphs.first + nFirstGlyphInCluster);
+ std::pair <float, float> aBounds;
+ aBounds.first = aFirstGlyph.origin();
+ aBounds.second = aFirstGlyph.origin();
+ // before we add the glyphs to this vector, we record the
+ // glyph's index in the vector (which is not the same as
+ // the Segment's glyph index!)
+ assert(size() < rGlyph2Char.size());
+ rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] = size();
+ rGlyph2Char[size()] = nFirstCharInCluster;
+
+ // can we break before this cluster?
+ // Glyphs may have either a positive or negative breakWeight refering to
+ // the position after or before the glyph respectively
+ int nPrevBreakWeight = 0;
+ if (nFirstGlyphInCluster > 0)
+ {
+ nPrevBreakWeight = (iGlyphs.first + (nFirstGlyphInCluster - 1))->breakweight();
+ }
+ int nBreakWeight = aFirstGlyph.breakweight();
+ if (nBreakWeight < 0)
+ {
+ // negative means it applies to the position before the glyph's character
+ nBreakWeight *= -1;
+ if (nPrevBreakWeight > 0 && nPrevBreakWeight < nBreakWeight)
+ {
+ // prevBreakWeight wins
+ nBreakWeight = nPrevBreakWeight;
+ }
+ }
+ else
+ {
+ nBreakWeight = 0;
+ // positive means break after
+ if (nPrevBreakWeight > 0)
+ nBreakWeight = nPrevBreakWeight;
+ }
+ if (nBreakWeight > gr::klbNoBreak/*0*/ &&
+ // nBreakWeight <= gr::klbHyphenBreak) // uses Graphite hyphenation
+ nBreakWeight <= gr::klbLetterBreak) // Needed for issue 111272
+ {
+ if (nBreakWeight < gr::klbHyphenBreak)
+ rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= WORD_BREAK_BEFORE;
+ else
+ rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= HYPHEN_BREAK_BEFORE;
+ }
+ // always allow a break before a space even if graphite doesn't
+ if (rArgs.mpStr[nFirstCharInCluster] == 0x20)
+ rChar2Base[nFirstCharInCluster-rArgs.mnMinCharPos] |= WORD_BREAK_BEFORE;
+
+ bool bBaseGlyph = true;
+ for (int j = nFirstGlyphInCluster;
+ j != nNextGlyph; j += nDelta)
+ {
+ long nNextOrigin;
+ float fNextOrigin;
+ gr::GlyphInfo aGlyph = *(iGlyphs.first + j);
+ if (j + nDelta >= nGlyphs || j + nDelta < 0) // at rhs ltr,rtl
+ {
+ fNextOrigin = fSegmentAdvance;
+ nNextOrigin = round(fSegmentAdvance * fScaling + rDXOffset);
+ aBounds.second = std::max(fSegmentAdvance, aBounds.second);
+ }
+ else
+ {
+ gr::GlyphInfo aNextGlyph = *(iGlyphs.first + j + nDelta);
+ fNextOrigin = std::max(aNextGlyph.attachedClusterBase()->origin(), aNextGlyph.origin());
+ aBounds.second = std::max(fNextOrigin, aBounds.second);
+ nNextOrigin = round(fNextOrigin * fScaling + rDXOffset);
+ }
+ aBounds.first = std::min(aGlyph.origin(), aBounds.first);
+ if ((signed)aGlyph.firstChar() < rArgs.mnEndCharPos &&
+ (signed)aGlyph.firstChar() >= rArgs.mnMinCharPos)
+ {
+ rCharDxs[aGlyph.firstChar()-rArgs.mnMinCharPos] = nNextOrigin;
+ }
+ if ((signed)aGlyph.attachedClusterBase()->logicalIndex() == j)
+ {
+ append(rSeg, rArgs, aGlyph, fNextOrigin, fScaling, rChar2Base, rGlyph2Char, rCharDxs, rDXOffset, bBaseGlyph);
+ bBaseGlyph = false;
+ }
+ }
+ // from the point of view of the dx array, the xpos is
+ // the origin of the first glyph of the next cluster ltr
+ // rtl it is the origin of the 1st glyph of the cluster
+ long nXPos = (bRtl)?
+ round(aFirstGlyph.attachedClusterBase()->origin() * fScaling) + rDXOffset :
+ round(aBounds.second * fScaling) + rDXOffset;
+ // force the last char in range to have the width of the cluster
+ if (bRtl)
+ {
+ for (int n = nNextChar + 1; n <= nFirstCharInCluster; n++)
+ {
+ if ((n < rArgs.mnEndCharPos) && (n >= rArgs.mnMinCharPos))
+ rCharDxs[n-rArgs.mnMinCharPos] = nXPos;
+ }
+ }
+ else
+ {
+ for (int n = nNextChar - 1; n >= nFirstCharInCluster; n--)
+ {
+ if (n < rArgs.mnEndCharPos && n >= rArgs.mnMinCharPos)
+ rCharDxs[n-rArgs.mnMinCharPos] = nXPos;
+ }
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(), "fillFrom %d glyphs offset %ld width %d\n", mvGlyphs.size(), nXOffset, mnWidth);
+ fprintf(grLog(),"Cluster g[%d-%d) c[%d-%d)%x x%ld y%f bw%d\n", nFirstGlyphInCluster, nNextGlyph, nFirstCharInCluster, nNextChar, rArgs.mpStr[nFirstCharInCluster], nXPos, aFirstGlyph.yOffset(), nBreakWeight);
#endif
+ return aBounds;
}
// append walks an attachment tree, flattening it, and converting it into a
// sequence of GlyphItem objects which we can later manipulate.
void
-GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
- const gr_slot * gi, float nextGlyphOrigin, float scaling, long & rDXOffset,
- bool bIsBase, int baseChar)
+GraphiteLayout::Glyphs::append(gr::Segment &segment, ImplLayoutArgs &args, gr::GlyphInfo & gi, float nextGlyphOrigin, float scaling, std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs, long & rDXOffset, bool bIsBase)
{
- bool bRtl = (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL);
float nextOrigin = nextGlyphOrigin;
- assert(gi);
- assert(gr_slot_before(gi) <= gr_slot_after(gi));
- int firstChar = gr_slot_before(gi) + mnSegCharOffset;
- assert(mvGlyphs.size() < mvGlyph2Char.size());
- if (!bIsBase) mvGlyph2Char[mvGlyphs.size()] = baseChar;//firstChar;
+ int firstChar = std::min(gi.firstChar(), gi.lastChar());
+ assert(size() < rGlyph2Char.size());
+ if (!bIsBase) rGlyph2Char[size()] = firstChar;
// is the next glyph attached or in the next cluster?
- //glyph_set_range_t iAttached = gi.attachedClusterGlyphs();
- const gr_slot * pFirstAttached = gr_slot_first_attachment(gi);
- if (pFirstAttached)
+ glyph_set_range_t iAttached = gi.attachedClusterGlyphs();
+ if (iAttached.first != iAttached.second)
{
- nextOrigin = gr_slot_origin_X(pFirstAttached);
+ nextOrigin = iAttached.first->origin();
}
- long glyphId = gr_slot_gid(gi);
+ long glyphId = gi.glyphID();
long deltaOffset = 0;
- int scaledGlyphPos = round(gr_slot_origin_X(gi) * scaling);
- int glyphWidth = round(nextOrigin * scaling) - scaledGlyphPos;
- if (glyphWidth < 0)
- glyphWidth = 0;
+ int glyphWidth = round(nextOrigin * scaling) - round(gi.origin() * scaling);
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"c%d g%ld,X%d W%d nX%f ", firstChar, glyphId,
- (int)(gr_slot_origin_X(gi) * scaling), glyphWidth, nextOrigin * scaling);
+ fprintf(grLog(),"c%d g%d gWidth%d x%f ", firstChar, (int)gi.logicalIndex(), glyphWidth, nextOrigin);
#endif
if (glyphId == 0)
{
- rArgs.NeedFallback(firstChar, bRtl);
- if( (SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags ))
+ args.NeedFallback(
+ firstChar,
+ gr::RightToLeftDir(gr::DirCode(gi.directionality())));
+ if( (SAL_LAYOUT_FOR_FALLBACK & args.mnFlags ))
{
glyphId = GF_DROPPED;
deltaOffset -= glyphWidth;
glyphWidth = 0;
}
}
- else if(rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK)
+ else if(args.mnFlags & SAL_LAYOUT_FOR_FALLBACK)
{
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"fallback c%d %x in run %d\n", firstChar, rArgs.mpStr[firstChar],
- rArgs.maRuns.PosIsInAnyRun(firstChar));
+ fprintf(grLog(),"fallback c%d %x in run %d\n", firstChar, args.mpStr[firstChar],
+ args.maRuns.PosIsInAnyRun(firstChar));
#endif
// glyphs that aren't requested for fallback will be taken from base
// layout, so mark them as dropped (should this wait until Simplify(false) is called?)
- if (!rArgs.maRuns.PosIsInAnyRun(firstChar) &&
- in_range(firstChar, rArgs.mnMinCharPos, rArgs.mnEndCharPos))
+ if (!args.maRuns.PosIsInAnyRun(firstChar) &&
+ in_range(firstChar, args.mnMinCharPos, args.mnEndCharPos))
{
glyphId = GF_DROPPED;
deltaOffset -= glyphWidth;
glyphWidth = 0;
}
}
- // append this glyph. Set the cluster flag if this glyph is attached to another
+ // append this glyph.
long nGlyphFlags = bIsBase ? 0 : GlyphItem::IS_IN_CLUSTER;
- nGlyphFlags |= (bRtl)? GlyphItem::IS_RTL_GLYPH : 0;
- GlyphItem aGlyphItem(mvGlyphs.size(),
+ // directionality seems to be unreliable
+ //nGlyphFlags |= gr::RightToLeftDir(gr::DirCode(gi.attachedClusterBase()->directionality())) ? GlyphItem::IS_RTL_GLYPH : 0;
+ nGlyphFlags |= (gi.directionLevel() & 0x1)? GlyphItem::IS_RTL_GLYPH : 0;
+ GlyphItem aGlyphItem(size(),//gi.logicalIndex(),
glyphId,
- Point(scaledGlyphPos + rDXOffset,
- round((-gr_slot_origin_Y(gi) * scaling))),
+ Point(round(gi.origin() * scaling + rDXOffset),
+ round((-gi.yOffset() * scaling) - segment.AscentOffset()* scaling)),
nGlyphFlags,
glyphWidth);
- if (glyphId != static_cast<long>(GF_DROPPED))
- aGlyphItem.mnOrigWidth = round(gr_slot_advance_X(gi, mpFace, mpFont) * scaling);
- mvGlyphs.push_back(aGlyphItem);
+ aGlyphItem.mnOrigWidth = round(gi.advanceWidth() * scaling);
+ push_back(aGlyphItem);
// update the offset if this glyph was dropped
rDXOffset += deltaOffset;
- // Recursively append all the attached glyphs.
- for (const gr_slot * agi = gr_slot_first_attachment(gi); agi != NULL;
- agi = gr_slot_next_sibling_attachment(agi))
+ // Recursively apply append all the attached glyphs.
+ for (gr::GlyphSetIterator agi = iAttached.first; agi != iAttached.second; ++agi)
{
- if (gr_slot_next_sibling_attachment(agi) == NULL)
- append(pSeg, rArgs, agi, nextGlyphOrigin, scaling, rDXOffset,
- false, baseChar);
+ if (agi + 1 == iAttached.second)
+ append(segment, args, *agi, nextGlyphOrigin, scaling, rChar2Base, rGlyph2Char,rCharDxs, rDXOffset, false);
else
- append(pSeg, rArgs, agi, gr_slot_origin_X(gr_slot_next_sibling_attachment(agi)),
- scaling, rDXOffset, false, baseChar);
+ append(segment, args, *agi, (agi + 1)->origin(), scaling, rChar2Base, rGlyph2Char, rCharDxs, rDXOffset, false);
}
}
//
// An implementation of the SalLayout interface to enable Graphite enabled fonts to be used.
//
-GraphiteLayout::GraphiteLayout(const gr_face * face, gr_font * font,
- const grutils::GrFeatureParser * pFeatures) throw()
- : mpFace(face),
- mpFont(font),
+GraphiteLayout::GraphiteLayout(const gr::Font & font, const grutils::GrFeatureParser * pFeatures) throw()
+ : mpTextSrc(0),
+ mrFont(font),
mnWidth(0),
mfScaling(1.0),
mpFeatures(pFeatures)
{
-
+ // Line settings can have subtle affects on space handling
+ // since we don't really know whether it is the end of a line or just a run
+ // in the middle, it is hard to know what to set them to.
+ // If true, it can cause end of line spaces to be hidden e.g. Doulos SIL
+ maLayout.setStartOfLine(false);
+ maLayout.setEndOfLine(false);
+ maLayout.setDumbFallback(true);
+ // trailing ws doesn't seem to always take affect if end of line is true
+ maLayout.setTrailingWs(gr::ktwshAll);
+#ifdef GRLAYOUT_DEBUG
+ gr::ScriptDirCode aDirCode = font.getSupportedScriptDirections();
+ fprintf(grLog(),"GraphiteLayout scripts %x %lx\n", aDirCode, long(this));
+#endif
}
+
GraphiteLayout::~GraphiteLayout() throw()
{
clear();
- // the features and font are owned by the platform layers
+ // the features are owned by the platform layers
mpFeatures = NULL;
- mpFont = NULL;
}
void GraphiteLayout::clear()
@@ -520,7 +580,12 @@ void GraphiteLayout::clear()
mvChar2BaseGlyph.clear();
mvGlyph2Char.clear();
+#ifndef GRCACHE
+ delete mpTextSrc;
+#endif
+
// Reset the state to the empty state.
+ mpTextSrc=0;
mnWidth = 0;
// Don't reset the scaling, because it is set before LayoutText
}
@@ -528,7 +593,28 @@ void GraphiteLayout::clear()
// This method shouldn't be called on windows, since it needs the dc reset
bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs)
{
- gr_segment * pSegment = NULL;
+#ifdef GRCACHE
+ GrSegRecord * pSegRecord = NULL;
+ gr::Segment * pSegment = NULL;
+ // Graphite can in rare cases crash with a zero length
+ if (rArgs.mnMinCharPos < rArgs.mnEndCharPos)
+ {
+ pSegment = CreateSegment(rArgs, &pSegRecord);
+ if (!pSegment)
+ return false;
+ }
+ else
+ {
+ clear();
+ return true;
+ }
+ // layout the glyphs as required by OpenOffice
+ bool success = LayoutGlyphs(rArgs, pSegment, pSegRecord);
+
+ if (pSegRecord) pSegRecord->unlock();
+ else delete pSegment;
+#else
+ gr::Segment * pSegment = NULL;
bool success = true;
if (rArgs.mnMinCharPos < rArgs.mnEndCharPos)
{
@@ -536,25 +622,88 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs)
if (!pSegment)
return false;
success = LayoutGlyphs(rArgs, pSegment);
- if (pSegment)
- {
- gr_seg_destroy(pSegment);
- pSegment = NULL;
- }
+ if (pSegment) delete pSegment;
}
else
{
clear();
}
+#endif
return success;
}
+#ifdef GRCACHE
+class GrFontHasher : public gr::Font
+{
+public:
+ GrFontHasher(const gr::Font & aFont) : gr::Font(aFont), mrRealFont(const_cast<gr::Font&>(aFont)) {};
+ ~GrFontHasher(){};
+ virtual bool bold() { return mrRealFont.bold(); };
+ virtual bool italic() { return mrRealFont.italic(); };
+ virtual float ascent() { return mrRealFont.ascent(); };
+ virtual float descent() { return mrRealFont.descent(); };
+ virtual float height() { return mrRealFont.height(); };
+ virtual gr::Font* copyThis() { return mrRealFont.copyThis(); };
+ virtual unsigned int getDPIx() { return mrRealFont.getDPIx(); };
+ virtual unsigned int getDPIy() { return mrRealFont.getDPIy(); };
+ virtual const void* getTable(gr::fontTableId32 nId, size_t* nSize)
+ { return mrRealFont.getTable(nId,nSize); }
+ virtual void getFontMetrics(float*pA, float*pB, float*pC) { mrRealFont.getFontMetrics(pA,pB,pC); };
+
+ sal_Int32 hashCode(const grutils::GrFeatureParser * mpFeatures)
+ {
+ // is this sufficient?
+ ext_std::wstring aFace;
+ bool bBold;
+ bool bItalic;
+ UniqueCacheInfo(aFace, bBold, bItalic);
+ sal_Unicode uName[32]; // max length used in gr::Font
+ // Note: graphite stores font names as UTF-16 even if wchar_t is 32bit
+ // this conversion should be OK.
+ for (size_t i = 0; i < aFace.size() && i < 32; i++)
+ {
+ uName[i] = aFace[i];
+ }
+ size_t iSize = aFace.size();
+ if (0 == iSize) return 0;
+ sal_Int32 hash = rtl_ustr_hashCode_WithLength(uName, iSize);
+ hash ^= static_cast<sal_Int32>(height());
+ hash |= (bBold)? 0x1000000 : 0;
+ hash |= (bItalic)? 0x2000000 : 0;
+ if (mpFeatures)
+ hash ^= mpFeatures->hashCode();
+#ifdef GRLAYOUT_DEBUG
+ fprintf(grLog(), "font hash %x size %f\n", (int)hash, height());
+#endif
+ return hash;
+ };
+protected:
+ virtual void UniqueCacheInfo( ext_std::wstring& stuFace, bool& fBold, bool& fItalic )
+ {
+#ifdef WIN32
+ dynamic_cast<GraphiteWinFont&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#ifdef UNX
+ dynamic_cast<GraphiteFontAdaptor&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#error Unknown base type for gr::Font::UniqueCacheInfo
+#endif
+#endif
+ }
+private:
+ gr::Font & mrRealFont;
+};
+#endif
-gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
+#ifdef GRCACHE
+gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs, GrSegRecord ** pSegRecord)
+#else
+gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
+#endif
{
assert(rArgs.mnLength >= 0);
- gr_segment * pSegment = NULL;
+ gr::Segment * pSegment = NULL;
// Set the SalLayouts values to be the inital ones.
SalLayout::AdjustLayout(rArgs);
@@ -569,47 +718,89 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
{
// Don't set RTL if font doesn't support it otherwise it forces rtl on
// everything
- //if (bRtl && (mrFont.getSupportedScriptDirections() & gr::kfsdcHorizRtl))
- // maLayout.setRightToLeft(bRtl);
+ if (bRtl && (mrFont.getSupportedScriptDirections() & gr::kfsdcHorizRtl))
+ maLayout.setRightToLeft(bRtl);
// Context is often needed beyond the specified end, however, we don't
// want it if there has been a direction change, since it is hard
// to tell between reordering within one direction and multi-directional
// text. Extra context, can also cause problems with ligatures stradling
// a hyphenation point, so disable if CTL is disabled.
- mnSegCharOffset = rArgs.mnMinCharPos;
+ const int nSegCharLimit = min(rArgs.mnLength, mnEndCharPos + EXTRA_CONTEXT_LENGTH);
int limit = rArgs.mnEndCharPos;
- if (!(SAL_LAYOUT_COMPLEX_DISABLED & rArgs.mnFlags))
+ if ((nSegCharLimit > limit) && !(SAL_LAYOUT_COMPLEX_DISABLED & rArgs.mnFlags))
{
- const int nSegCharMin = maximum<int>(0, mnMinCharPos - EXTRA_CONTEXT_LENGTH);
- const int nSegCharLimit = minimum(rArgs.mnLength, mnEndCharPos + EXTRA_CONTEXT_LENGTH);
- if (nSegCharMin < mnSegCharOffset)
- {
- int sameDirEnd = findSameDirLimit(rArgs.mpStr + nSegCharMin,
- rArgs.mnEndCharPos - nSegCharMin, bRtl);
- if (sameDirEnd == rArgs.mnEndCharPos)
- mnSegCharOffset = nSegCharMin;
- }
- if (nSegCharLimit > limit)
+ limit += findSameDirLimit(rArgs.mpStr + rArgs.mnEndCharPos,
+ nSegCharLimit - rArgs.mnEndCharPos, bRtl);
+ }
+
+#ifdef GRCACHE
+ GrFontHasher hasher(mrFont);
+ sal_Int32 aFontHash = hasher.hashCode(mpFeatures);
+ GraphiteSegmentCache * pCache =
+ (GraphiteCacheHandler::instance).getCache(aFontHash);
+ if (pCache)
+ {
+ *pSegRecord = pCache->getSegment(rArgs, bRtl, limit);
+ if (*pSegRecord)
{
- limit += findSameDirLimit(rArgs.mpStr + rArgs.mnEndCharPos,
- nSegCharLimit - rArgs.mnEndCharPos, bRtl);
+ pSegment = (*pSegRecord)->getSegment();
+ mpTextSrc = (*pSegRecord)->getTextSrc();
+ maLayout.setRightToLeft((*pSegRecord)->isRtl());
+ if (rArgs.mpStr != mpTextSrc->getLayoutArgs().mpStr ||
+ rArgs.mnMinCharPos != mpTextSrc->getLayoutArgs().mnMinCharPos ||
+ rArgs.mnEndCharPos != mpTextSrc->getLayoutArgs().mnEndCharPos ||
+ (SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags) )
+ {
+ (*pSegRecord)->clearVectors();
+ }
+ mpTextSrc->switchLayoutArgs(rArgs);
+ if (limit > rArgs.mnMinCharPos && limit == rArgs.mnEndCharPos
+ && pSegment->stopCharacter() != limit)
+ {
+ // check that the last character is not part of a ligature
+ glyph_set_range_t aGlyphSet = pSegment->charToGlyphs(limit - 1);
+ if (aGlyphSet.first == aGlyphSet.second)
+ {
+ // no glyphs associated with this glyph - occurs mid ligature
+ pSegment = NULL;
+ *pSegRecord = NULL;
+ }
+ else
+ {
+ while (aGlyphSet.first != aGlyphSet.second)
+ {
+ int lastChar = static_cast<int>((*aGlyphSet.first).lastChar());
+ if (lastChar >= limit)
+ {
+ pSegment = NULL;
+ *pSegRecord = NULL;
+ break;
+ }
+ aGlyphSet.first++;
+ }
+ }
+ }
+ if (pSegment)
+ return pSegment;
}
}
+#endif
- if (mpFeatures)
- pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16,
- rArgs.mpStr + mnSegCharOffset, limit - mnSegCharOffset, bRtl);
- else
- pSegment = gr_make_seg(mpFont, mpFace, 0, NULL, gr_utf16,
- rArgs.mpStr + mnSegCharOffset, limit - mnSegCharOffset, bRtl);
+ // Create a new TextSource object for the engine.
+ mpTextSrc = new TextSourceAdaptor(rArgs, limit);
+ if (mpFeatures) mpTextSrc->setFeatures(mpFeatures);
- //pSegment = new gr::RangeSegment((gr::Font *)&mrFont, mpTextSrc, &maLayout, mnMinCharPos, limit);
+ pSegment = new gr::RangeSegment((gr::Font *)&mrFont, mpTextSrc, &maLayout, mnMinCharPos, limit);
if (pSegment != NULL)
{
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"Gr::LayoutText %d-%d, context %d,len%d rtl%d scaling %f\n", rArgs.mnMinCharPos,
- rArgs.mnEndCharPos, limit, rArgs.mnLength, bRtl, mfScaling);
+ fprintf(grLog(),"Gr::LayoutText %d-%d, context %d,len%d rtl%d/%d scaling %f\n", rArgs.mnMinCharPos,
+ rArgs.mnEndCharPos, limit, rArgs.mnLength, maLayout.rightToLeft(), pSegment->rightToLeft(), mfScaling);
+#endif
+#ifdef GRCACHE
+ // on a new segment rightToLeft should be correct
+ *pSegRecord = pCache->cacheSegment(mpTextSrc, pSegment, pSegment->rightToLeft());
#endif
}
else
@@ -634,20 +825,47 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
return pSegment;
}
-bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr_segment * pSegment)
+#ifdef GRCACHE
+bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment, GrSegRecord * pSegRecord)
+#else
+bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment)
+#endif
{
+#ifdef GRCACHE
+#ifdef GRCACHE_REUSE_VECTORS
+ // if we have an exact match, then we can reuse the glyph vectors from before
+ if (pSegRecord && (pSegRecord->glyphs().size() > 0) &&
+ (pSegRecord->fontScale() == mfScaling) &&
+ !(SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags) )
+ {
+ mnWidth = pSegRecord->width();
+ mvGlyphs = pSegRecord->glyphs();
+ mvCharDxs = pSegRecord->charDxs();
+ mvChar2BaseGlyph = pSegRecord->char2BaseGlyph();
+ mvGlyph2Char = pSegRecord->glyph2Char();
+ return true;
+ }
+#endif
+#endif
// Calculate the initial character dxs.
mvCharDxs.assign(mnEndCharPos - mnMinCharPos, -1);
mvChar2BaseGlyph.assign(mnEndCharPos - mnMinCharPos, -1);
- mvCharBreaks.assign(mnEndCharPos - mnMinCharPos, 0);
mnWidth = 0;
if (mvCharDxs.size() > 0)
{
// Discover all the clusters.
try
{
- bool bRtl = mnLayoutFlags & SAL_LAYOUT_BIDI_RTL;
- fillFrom(pSegment, rArgs, mfScaling);
+ // Note: we use the layout rightToLeft() because in cached segments
+ // rightToLeft() may no longer be valid if the engine has been run
+ // ltr since the segment was created.
+#ifdef GRCACHE
+ bool bRtl = pSegRecord? pSegRecord->isRtl() : pSegment->rightToLeft();
+#else
+ bool bRtl = pSegment->rightToLeft();
+#endif
+ mvGlyphs.fill_from(*pSegment, rArgs, bRtl,
+ mnWidth, mfScaling, mvChar2BaseGlyph, mvGlyph2Char, mvCharDxs);
if (bRtl)
{
@@ -657,6 +875,17 @@ bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr_segment * pSegment)
// fixup last dx to ensure it always equals the width
mvCharDxs[mvCharDxs.size() - 1] = mnWidth;
}
+#ifdef GRCACHE
+#ifdef GRCACHE_REUSE_VECTORS
+ if (pSegRecord && rArgs.maReruns.IsEmpty() &&
+ !(SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags))
+ {
+ pSegRecord->setGlyphVectors(mnWidth, mvGlyphs, mvCharDxs,
+ mvChar2BaseGlyph, mvGlyph2Char,
+ mfScaling);
+ }
+#endif
+#endif
}
catch (std::exception e)
{
@@ -692,36 +921,24 @@ int GraphiteLayout::GetTextBreak(long maxmnWidth, long char_extra, int factor) c
return STRING_LEN;
long nWidth = mvCharDxs[0] * factor;
- long wLastBreak = 0;
int nLastBreak = -1;
- int nEmergency = -1;
for (size_t i = 1; i < mvCharDxs.size(); i++)
{
nWidth += char_extra;
if (nWidth > maxmnWidth) break;
if (mvChar2BaseGlyph[i] != -1)
{
- if (
- (mvCharBreaks[i] > -25 || (mvCharBreaks[i-1] > 0 && mvCharBreaks[i-1] < 25)) &&
- (mvCharBreaks[i-1] < 25 || (mvCharBreaks[i] < 0 && mvCharBreaks[i] > -25))
- )
- {
+ if (mvChar2BaseGlyph[i] & (WORD_BREAK_BEFORE | HYPHEN_BREAK_BEFORE))
nLastBreak = static_cast<int>(i);
- wLastBreak = nWidth;
- }
- nEmergency = static_cast<int>(i);
}
nWidth += (mvCharDxs[i] - mvCharDxs[i-1]) * factor;
}
int nBreak = mnMinCharPos;
- if (wLastBreak > 9 * maxmnWidth / 10)
+ if (nLastBreak > -1)
nBreak += nLastBreak;
- else
- if (nEmergency > -1)
- nBreak += nEmergency;
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(), "Gr::GetTextBreak break after %d, weights(%d, %d)\n", nBreak - mnMinCharPos, mvCharBreaks[nBreak - mnMinCharPos], mvCharBreaks[nBreak - mnMinCharPos - 1]);
+ fprintf(grLog(), "Gr::GetTextBreak break after %d\n", nBreak - mnMinCharPos);
#endif
if (nBreak > mnEndCharPos) nBreak = STRING_LEN;
@@ -729,6 +946,7 @@ int GraphiteLayout::GetTextBreak(long maxmnWidth, long char_extra, int factor) c
return nBreak;
}
+
long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const
{
if (mnEndCharPos == mnMinCharPos)
@@ -740,9 +958,9 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const
for (size_t i = 0; i < mvCharDxs.size(); i++)
{
assert( (mvChar2BaseGlyph[i] == -1) ||
- ((signed)(mvChar2BaseGlyph[i]) < (signed)mvGlyphs.size()));
+ ((signed)(mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK) < (signed)mvGlyphs.size()));
if (mvChar2BaseGlyph[i] != -1 &&
- mvGlyphs[mvChar2BaseGlyph[i]].mnGlyphIndex == GF_DROPPED)
+ mvGlyphs[mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK].mnGlyphIndex == GF_DROPPED)
{
// when used in MultiSalLayout::GetTextBreak dropped glyphs
// must have zero width
@@ -763,11 +981,12 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const
//fprintf(grLog(),"FillDX %ld,%d\n", mnWidth, std::accumulate(pDXArray, pDXArray + mvCharDxs.size(), 0));
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"FillDXArray %d-%d=%ld\n", mnMinCharPos, mnEndCharPos, mnWidth);
+ fprintf(grLog(),"FillDXArray %d-%d,%d=%ld\n", mnMinCharPos, mnEndCharPos, (int)mpTextSrc->getLength(), mnWidth);
#endif
return mnWidth;
}
+
void GraphiteLayout::AdjustLayout(ImplLayoutArgs& rArgs)
{
SalLayout::AdjustLayout(rArgs);
@@ -813,9 +1032,6 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
int nDeltaWidth = rArgs.mnLayoutWidth - mnWidth;
if (nDeltaWidth > 0) // expand, just expand between clusters
{
- // NOTE: for expansion we can use base glyphs (which have IsClusterStart set)
- // even though they may have been reordered in which case they will have
- // been placed in a bigger cluster for other purposes.
int nClusterCount = 0;
for (size_t j = 0; j < mvGlyphs.size(); j++)
{
@@ -833,18 +1049,15 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
{
if (mvGlyphs[i].IsClusterStart())
{
- nOffset = static_cast<int>(fExtraPerCluster * nCluster);
- int nCharIndex = mvGlyph2Char[i];
- assert(nCharIndex > -1);
- mvCharDxs[nCharIndex-mnMinCharPos] += nOffset;
+ nOffset = fExtraPerCluster * nCluster;
+ size_t nCharIndex = mvGlyph2Char[i];
+ mvCharDxs[nCharIndex] += nOffset;
// adjust char dxs for rest of characters in cluster
- while (++nCharIndex < static_cast<int>(mvGlyph2Char.size()))
+ while (++nCharIndex < mvGlyph2Char.size())
{
- int nChar2Base = mvChar2BaseGlyph[nCharIndex-mnMinCharPos];
+ int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK;
if (nChar2Base == -1 || nChar2Base == static_cast<int>(i))
- mvCharDxs[nCharIndex-mnMinCharPos] += nOffset;
- else
- break;
+ mvCharDxs[nCharIndex] += nOffset;
}
++nCluster;
}
@@ -852,27 +1065,25 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
}
}
}
- else if (nDeltaWidth < 0)// condense - apply a factor to all glyph positions
+ else // condense - apply a factor to all glyph positions
{
if (mvGlyphs.size() == 0) return;
Glyphs::iterator iLastGlyph = mvGlyphs.begin() + (mvGlyphs.size() - 1);
// position last glyph using original width
float fXFactor = static_cast<float>(rArgs.mnLayoutWidth - iLastGlyph->mnOrigWidth) / static_cast<float>(iLastGlyph->maLinearPos.X());
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(), "Condense by factor %f last x%ld\n", fXFactor, iLastGlyph->maLinearPos.X());
+ fprintf(grLog(), "Condense by factor %f\n", fXFactor);
#endif
- if (fXFactor < 0)
- return; // probably a bad mnOrigWidth value
iLastGlyph->maLinearPos.X() = rArgs.mnLayoutWidth - iLastGlyph->mnOrigWidth;
Glyphs::iterator iGlyph = mvGlyphs.begin();
while (iGlyph != iLastGlyph)
{
- iGlyph->maLinearPos.X() = static_cast<int>(static_cast<float>(iGlyph->maLinearPos.X()) * fXFactor);
+ iGlyph->maLinearPos.X() = static_cast<float>(iGlyph->maLinearPos.X()) * fXFactor;
++iGlyph;
}
for (size_t i = 0; i < mvCharDxs.size(); i++)
{
- mvCharDxs[i] = static_cast<int>(fXFactor * static_cast<float>(mvCharDxs[i]));
+ mvCharDxs[i] = fXFactor * static_cast<float>(mvCharDxs[i]);
}
}
mnWidth = rArgs.mnLayoutWidth;
@@ -898,7 +1109,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
int nPrevClusterLastChar = -1;
for (size_t i = 0; i < nChars; i++)
{
- int nChar2Base = mvChar2BaseGlyph[i];
+ int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK;
if ((nChar2Base > -1) && (nChar2Base != nPrevClusterGlyph))
{
assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size()));
@@ -910,14 +1121,13 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
size_t j = i + 1;
int nLastChar = i;
int nLastGlyph = nChar2Base;
- int nChar2BaseJ = -1;
for (; j < nChars; j++)
{
- nChar2BaseJ = mvChar2BaseGlyph[j];
+ int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK;
assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size()));
- if (nChar2BaseJ != -1 )
+ if (nChar2BaseJ != -1 && mvGlyphs[nChar2BaseJ].IsClusterStart())
{
- nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1);
+ nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1);
nLastChar = j - 1;
break;
}
@@ -943,12 +1153,6 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
nLastChar = nChars - 1;
if (!bRtl) nLastGlyph = mvGlyphs.size() - 1;
}
- int nBaseCount = 0;
- // count bases within cluster - may be more than 1 with reordering
- for (int k = nChar2Base; k <= nLastGlyph; k++)
- {
- if (mvGlyphs[k].IsClusterStart()) ++nBaseCount;
- }
assert((nLastChar > -1) && (nLastChar < (signed)nChars));
long nNewClusterWidth = args.mpDXArray[nLastChar];
long nOrigClusterWidth = mvCharDxs[nLastChar];
@@ -970,25 +1174,21 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
mvGlyphs[nLastGlyph].mnNewWidth += nDWidth;
else
nDGlyphOrigin += nDWidth;
- long nDOriginPerBase = (nBaseCount > 0)? nDWidth / nBaseCount : 0;
- nBaseCount = -1;
// update glyph positions
if (bRtl)
{
for (int n = nChar2Base; n <= nLastGlyph; n++)
{
- if (mvGlyphs[n].IsClusterStart()) ++nBaseCount;
assert((n > - 1) && (n < (signed)mvGlyphs.size()));
- mvGlyphs[n].maLinearPos.X() += -(nDGlyphOrigin + nDOriginPerBase * nBaseCount) + nXOffset;
+ mvGlyphs[n].maLinearPos.X() += -nDGlyphOrigin + nXOffset;
}
}
else
{
for (int n = nChar2Base; n <= nLastGlyph; n++)
{
- if (mvGlyphs[n].IsClusterStart()) ++nBaseCount;
assert((n > - 1) && (n < (signed)mvGlyphs.size()));
- mvGlyphs[n].maLinearPos.X() += nDGlyphOrigin + (nDOriginPerBase * nBaseCount) + nXOffset;
+ mvGlyphs[n].maLinearPos.X() += nDGlyphOrigin + nXOffset;
}
}
rDeltaWidth[nChar2Base] = nDWidth;
@@ -1063,7 +1263,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId
{
(*(i)).maLinearPos.X() -= nGapWidth;
nGapWidth -= nKashidaWidth;
- ++i;
+ i++;
}
// fixup rightmost kashida for gap remainder
@@ -1091,15 +1291,15 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
std::fill(pCaretXArray, pCaretXArray + nArraySize, -1);
// the layout method doesn't modify the layout even though it isn't
// const in the interface
- bool bRtl = (mnLayoutFlags & SAL_LAYOUT_BIDI_RTL);//const_cast<GraphiteLayout*>(this)->maLayout.rightToLeft();
+ bool bRtl = const_cast<GraphiteLayout*>(this)->maLayout.rightToLeft();
int prevBase = -1;
long prevClusterWidth = 0;
for (int i = 0, nCharSlot = 0; i < nArraySize && nCharSlot < static_cast<int>(mvCharDxs.size()); ++nCharSlot, i+=2)
{
if (mvChar2BaseGlyph[nCharSlot] != -1)
{
- int nChar2Base = mvChar2BaseGlyph[nCharSlot];
- assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size()));
+ int nChar2Base = mvChar2BaseGlyph[nCharSlot] & GLYPH_INDEX_MASK;
+ assert((mvChar2BaseGlyph[nCharSlot] > -1) && (nChar2Base < (signed)mvGlyphs.size()));
GlyphItem gi = mvGlyphs[nChar2Base];
if (gi.mnGlyphIndex == GF_DROPPED)
{
@@ -1116,8 +1316,8 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
origClusterWidth += mvGlyphs[nCluster].mnNewWidth;
if (mvGlyph2Char[nCluster] == nCharSlot)
{
- nMin = minimum(nMin, mvGlyphs[nCluster].maLinearPos.X());
- nMax = maximum(nMax, mvGlyphs[nCluster].maLinearPos.X() + mvGlyphs[nCluster].mnNewWidth);
+ nMin = std::min(nMin, mvGlyphs[nCluster].maLinearPos.X());
+ nMax = std::min(nMax, mvGlyphs[nCluster].maLinearPos.X() + mvGlyphs[nCluster].mnNewWidth);
}
}
if (bRtl)
@@ -1149,10 +1349,12 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
break;
}
}
+ long nGWidth = gi.mnNewWidth;
// if no match position at end of cluster
if (nGlyph == static_cast<int>(mvGlyphs.size()) ||
mvGlyphs[nGlyph].IsClusterStart())
{
+ nGWidth = prevClusterWidth;
if (bRtl)
{
pCaretXArray[i+1] = gi.maLinearPos.X();
@@ -1191,6 +1393,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
#endif
}
+
// GetNextGlyphs returns a contiguous sequence of glyphs that can be
// rendered together. It should never return a dropped glyph.
// The glyph_slot returned should be the index of the next visible
@@ -1218,7 +1421,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
++glyph_slot) {};
// Update the length
- const int nGlyphSlotEnd = minimum(size_t(glyph_slot + length), mvGlyphs.size());
+ const int nGlyphSlotEnd = std::min(size_t(glyph_slot + length), mvGlyphs.size());
// We're all out of glyphs here.
if (glyph_slot == nGlyphSlotEnd)
@@ -1236,23 +1439,17 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
//aPosOut = glyph_itr->maLinearPos;
aPosOut = GetDrawPosition(aStartPos);
+
for (;;) // Forever
{
// last index of the range from glyph_to_chars does not include this glyph
if (char_index)
{
- if (glyph_slot >= (signed)mvGlyph2Char.size())
- {
- *char_index++ = mnMinCharPos + mvCharDxs.size();
- }
- else
- {
- assert(glyph_slot > -1);
- if (mvGlyph2Char[glyph_slot] == -1)
- *char_index++ = mnMinCharPos + mvCharDxs.size();
- else
- *char_index++ = mvGlyph2Char[glyph_slot];
- }
+ assert((glyph_slot >= -1) && (glyph_slot < (signed)mvGlyph2Char.size()));
+ if (mvGlyph2Char[glyph_slot] == -1)
+ *char_index++ = mvCharDxs.size();
+ else
+ *char_index++ = mvGlyph2Char[glyph_slot];
}
// Copy out this glyphs data.
++glyph_slot;
@@ -1265,9 +1462,8 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
((glyph_itr+1)->maLinearPos.X() - glyph_itr->maLinearPos.X());
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"GetNextGlyphs g%d gid%d c%d x%ld,%ld adv%ld, pos %ld,%ld\n",
- glyph_slot - 1, glyph_itr->mnGlyphIndex,
- mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), nGlyphAdvance,
+ fprintf(grLog(),"GetNextGlyphs g%d c%d x%ld,%ld adv%ld, pos %ld,%ld\n", glyph_slot - 1,
+ GLYPH_INDEX_MASK&mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), nGlyphAdvance,
aPosOut.X(), aPosOut.Y());
#endif
@@ -1297,6 +1493,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
return numGlyphs;
}
+
void GraphiteLayout::MoveGlyph( int nGlyphIndex, long nNewPos )
{
// TODO it might be better to actualy implement simplify properly, but this
@@ -1323,6 +1520,7 @@ void GraphiteLayout::MoveGlyph( int nGlyphIndex, long nNewPos )
mnWidth += dx;
}
+
void GraphiteLayout::DropGlyph( int nGlyphIndex )
{
if(nGlyphIndex >= signed(mvGlyphs.size()))
@@ -1354,6 +1552,7 @@ void GraphiteLayout::Simplify( bool isBaseLayout )
{
deltaX = 0;
}
+ //mvCharDxs[mvGlyph2Char[gi->mnCharPos]] -= deltaX;
++gi;
}
#ifdef GRLAYOUT_DEBUG
diff --git a/vcl/source/glyphs/graphite_serverfont.cxx b/vcl/source/glyphs/graphite_serverfont.cxx
index ec1388d9bb29..dcf9768f78cc 100644
--- a/vcl/source/glyphs/graphite_serverfont.cxx
+++ b/vcl/source/glyphs/graphite_serverfont.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,120 +36,44 @@
//
// Platform
-#include <i18npool/mslangid.hxx>
#include <vcl/sallayout.hxx>
// Module
#include "gcach_ftyp.hxx"
-#include <vcl/glyphcache.hxx>
#include <vcl/graphite_features.hxx>
-//#include "graphite_textsrc.hxx"
+#include "graphite_textsrc.hxx"
#include <vcl/graphite_serverfont.hxx>
#ifndef WNT
-float freetypeServerFontAdvance(const void* appFontHandle, gr_uint16 glyphId)
-{
- FreetypeServerFont * pServerFont =
- const_cast<FreetypeServerFont*>
- (reinterpret_cast<const FreetypeServerFont*>(appFontHandle));
- if (pServerFont)
- {
- return static_cast<float>(pServerFont->GetGlyphMetric(glyphId).GetCharWidth());
- }
- return .0f;
-}
-
//
// An implementation of the GraphiteLayout interface to enable Graphite enabled fonts to be used.
//
-GraphiteServerFontLayout::GraphiteServerFontLayout(ServerFont & rServerFont) throw()
- : ServerFontLayout(rServerFont),
- maImpl(dynamic_cast<FreetypeServerFont&>(rServerFont).GetGraphiteFace()->face(),
- rServerFont),
- mpFeatures(NULL)
+GraphiteServerFontLayout::GraphiteServerFontLayout(GraphiteFontAdaptor * pFont) throw()
+ : ServerFontLayout(pFont->font()), mpFont(pFont),
+ maImpl(*mpFont, mpFont->features(), pFont)
{
- FreetypeServerFont& rFTServerFont = dynamic_cast<FreetypeServerFont&>(rServerFont);
- gr_font * pFont = rFTServerFont.GetGraphiteFace()->font(rServerFont.GetFontSelData().mnHeight);
- if (!pFont)
- {
- pFont = gr_make_font_with_advance_fn(
- // need to use mnHeight here, mfExactHeight can give wrong values
- static_cast<float>(rServerFont.GetFontSelData().mnHeight),
- &rFTServerFont,
- freetypeServerFontAdvance,
- rFTServerFont.GetGraphiteFace()->face());
- rFTServerFont.GetGraphiteFace()->addFont(rServerFont.GetFontSelData().mnHeight, pFont);
- }
- maImpl.SetFont(pFont);
- rtl::OString aLang("");
- if (rServerFont.GetFontSelData().meLanguage != LANGUAGE_DONTKNOW)
- {
- aLang = MsLangId::convertLanguageToIsoByteString(
- rServerFont.GetFontSelData().meLanguage );
- }
- rtl::OString name = rtl::OUStringToOString(
- rServerFont.GetFontSelData().maTargetName, RTL_TEXTENCODING_UTF8 );
-#ifdef DEBUG
- printf("GraphiteServerFontLayout %lx %s size %d %f\n", (long unsigned int)this, name.getStr(),
- rFTServerFont.GetMetricsFT().x_ppem,
- rServerFont.GetFontSelData().mfExactHeight);
-#endif
- sal_Int32 nFeat = name.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + 1;
- if (nFeat > 0)
- {
- rtl::OString aFeat = name.copy(nFeat, name.getLength() - nFeat);
- mpFeatures = new grutils::GrFeatureParser(
- rFTServerFont.GetGraphiteFace()->face(), aFeat, aLang);
-#ifdef DEBUG
- if (mpFeatures)
- printf("GraphiteServerFontLayout %s/%s/%s %x language %d features %d errors\n",
- rtl::OUStringToOString( rServerFont.GetFontSelData().maName,
- RTL_TEXTENCODING_UTF8 ).getStr(),
- rtl::OUStringToOString( rServerFont.GetFontSelData().maTargetName,
- RTL_TEXTENCODING_UTF8 ).getStr(),
- rtl::OUStringToOString( rServerFont.GetFontSelData().maSearchName,
- RTL_TEXTENCODING_UTF8 ).getStr(),
- rServerFont.GetFontSelData().meLanguage,
- (int)mpFeatures->numFeatures(), mpFeatures->parseErrors());
-#endif
- }
- else
- {
- mpFeatures = new grutils::GrFeatureParser(
- rFTServerFont.GetGraphiteFace()->face(), aLang);
- }
- maImpl.SetFeatures(mpFeatures);
+ // Nothing needed here
}
GraphiteServerFontLayout::~GraphiteServerFontLayout() throw()
{
- delete mpFeatures;
- mpFeatures = NULL;
+ delete mpFont;
+ mpFont = NULL;
}
-bool GraphiteServerFontLayout::IsGraphiteEnabledFont(ServerFont * pServerFont)
+const sal_Unicode* GraphiteServerFontLayout::getTextPtr() const
{
- FreetypeServerFont * pFtServerFont = dynamic_cast<FreetypeServerFont*>(pServerFont);
- if (pFtServerFont)
- {
- if (pFtServerFont->GetGraphiteFace())
- {
-#ifdef DEBUG
- printf("IsGraphiteEnabledFont\n");
-#endif
- return true;
- }
- }
- return false;
+ return maImpl.textSrc()->getLayoutArgs().mpStr +
+ maImpl.textSrc()->getLayoutArgs().mnMinCharPos;
}
sal_GlyphId GraphiteLayoutImpl::getKashidaGlyph(int & width)
{
- int nKashidaIndex = mrServerFont.GetGlyphIndex( 0x0640 );
+ int nKashidaIndex = mpFont->font().GetGlyphIndex( 0x0640 );
if( nKashidaIndex != 0 )
{
- const GlyphMetric& rGM = mrServerFont.GetGlyphMetric( nKashidaIndex );
+ const GlyphMetric& rGM = mpFont->font().GetGlyphMetric( nKashidaIndex );
width = rGM.GetCharWidth();
}
else
diff --git a/vcl/source/glyphs/graphite_textsrc.cxx b/vcl/source/glyphs/graphite_textsrc.cxx
index 33508ae34712..abea305da96e 100644
--- a/vcl/source/glyphs/graphite_textsrc.cxx
+++ b/vcl/source/glyphs/graphite_textsrc.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -136,16 +136,16 @@ gr::isocode TextSourceAdaptor::getLanguage(gr::toffset)
return unknown;
}
-std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx)
+ext_std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx)
{
if (nCharIdx < unsigned(maLayoutArgs.mnMinCharPos))
- return std::make_pair(0, maLayoutArgs.mnMinCharPos);
+ return ext_std::make_pair(0, maLayoutArgs.mnMinCharPos);
if (nCharIdx < mnEnd)
- return std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd);
+ return ext_std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd);
- return std::make_pair(mnEnd, maLayoutArgs.mnLength);
+ return ext_std::make_pair(mnEnd, maLayoutArgs.mnLength);
}
size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * settings)
@@ -157,7 +157,7 @@ size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * sett
bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2)
{
- const std::pair<gr::toffset, gr::toffset>
+ const ext_std::pair<gr::toffset, gr::toffset>
range1 = propertyRange(char_idx1),
range2 = propertyRange(char_idx2);
diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx
index b5251cff2922..7c675c6f5b38 100644
--- a/vcl/source/glyphs/graphite_textsrc.hxx
+++ b/vcl/source/glyphs/graphite_textsrc.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _SV_GRAPHITETEXTSRC_HXX
#define _SV_GRAPHITETEXTSRC_HXX
// Description: Implements the Graphite interfaces IGrTextSource and
@@ -40,9 +40,9 @@
#include <stdexcept>
// Platform
-#ifdef WNT
-#include <windows.h>
-#endif
+#include <tools/svwin.h>
+
+#include <svsys.h>
#include <vcl/salgdi.hxx>
@@ -52,9 +52,11 @@
#include "vcl/dllapi.h"
// Libraries
+#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
+#include <postextstl.h>
// Module type definitions and forward declarations.
//
@@ -81,7 +83,7 @@ public:
virtual float getVerticalOffset(gr::toffset ich);
virtual gr::isocode getLanguage(gr::toffset ich);
- virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
+ virtual ext_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2);
virtual bool featureVariations() { return false; }
diff --git a/vcl/source/glyphs/makefile.mk b/vcl/source/glyphs/makefile.mk
index cbc9a38b4f9e..74811aba6204 100644
--- a/vcl/source/glyphs/makefile.mk
+++ b/vcl/source/glyphs/makefile.mk
@@ -52,25 +52,25 @@ SLOFILES=\
.IF "$(ENABLE_GRAPHITE)" != ""
# Graphite support using the glyphcache infrastructure
CFLAGS+=-DENABLE_GRAPHITE
-SLOFILES+=\
+SLOFILES+= $(SLO)$/graphite_adaptors.obj \
$(SLO)$/graphite_features.obj \
+ $(SLO)$/graphite_cache.obj \
+ $(SLO)$/graphite_textsrc.obj \
$(SLO)$/graphite_serverfont.obj \
$(SLO)$/graphite_layout.obj
-
.ENDIF
.ELSE
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
# Graphite support on non-UNX platforms
+# make use of stlport headerfiles
+EXT_USE_STLPORT=TRUE
SLOFILES=\
+ $(SLO)$/graphite_textsrc.obj \
+ $(SLO)$/graphite_cache.obj \
$(SLO)$/graphite_features.obj \
$(SLO)$/graphite_layout.obj
-
-.IF "$(SYSTEM_GRAPHITE)" != "YES"
-CDEFS+=-DGR2_STATIC
-.ENDIF
-
.ENDIF
.ENDIF
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index 3138c55b2bb5..8cb4bd4ec757 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -66,7 +66,7 @@ namespace
}
}
-void VclCanvasBitmap::setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift )
+void VclCanvasBitmap::setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift )
{
// sort channels in increasing order of appearance in the pixel
// (starting with the least significant bits)
@@ -368,7 +368,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) :
break;
default:
- OSL_FAIL( "unsupported bitmap format" );
+ DBG_ERROR( "unsupported bitmap format" );
break;
}
@@ -467,7 +467,7 @@ uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap(
}
// XIntegerReadOnlyBitmap
-uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerBitmapLayout& bitmapLayout,
+uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerBitmapLayout& bitmapLayout,
const geometry::IntegerRectangle2D& rect ) throw( lang::IndexOutOfBoundsException,
rendering::VolatileContentDestroyedException,
uno::RuntimeException)
@@ -572,8 +572,8 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB
return aRet;
}
-uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::IntegerBitmapLayout& bitmapLayout,
- const geometry::IntegerPoint2D& pos ) throw (lang::IndexOutOfBoundsException,
+uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::IntegerBitmapLayout& bitmapLayout,
+ const geometry::IntegerPoint2D& pos ) throw (lang::IndexOutOfBoundsException,
rendering::VolatileContentDestroyedException,
uno::RuntimeException)
{
@@ -683,14 +683,14 @@ sal_Bool SAL_CALL VclCanvasBitmap::getIndex( uno::Sequence< double >& o_entry, s
{
SolarMutexGuard aGuard;
- const sal_uInt16 nCount( m_pBmpAcc ?
+ const USHORT 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")),
+ throw lang::IndexOutOfBoundsException(::rtl::OUString::createFromAscii("Palette index out of range"),
static_cast<rendering::XBitmapPalette*>(this));
- const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<sal_uInt16>(nIndex));
+ const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<USHORT>(nIndex));
o_entry.realloc(3);
double* pColor=o_entry.getArray();
pColor[0] = aCol.GetRed();
@@ -704,12 +704,12 @@ sal_Bool SAL_CALL VclCanvasBitmap::setIndex( const uno::Sequence< double >&, sal
{
SolarMutexGuard aGuard;
- const sal_uInt16 nCount( m_pBmpAcc ?
+ const USHORT 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")),
+ throw lang::IndexOutOfBoundsException(::rtl::OUString::createFromAscii("Palette index out of range"),
static_cast<rendering::XBitmapPalette*>(this));
return sal_False; // read-only implementation
@@ -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<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<USHORT>(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<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<USHORT>(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<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<USHORT>(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<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<USHORT>(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 sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
+ const BYTE* pIn( reinterpret_cast<const BYTE*>(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<sal_uInt16>(
+ sal::static_int_cast<USHORT>(
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 sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
+ const BYTE* pIn( reinterpret_cast<const BYTE*>(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<sal_uInt16>(
+ sal::static_int_cast<USHORT>(
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 sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
+ const BYTE* pIn( reinterpret_cast<const BYTE*>(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<sal_uInt16>(
+ sal::static_int_cast<USHORT>(
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);
- sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
+ BYTE* pColors=reinterpret_cast<BYTE*>(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
pColors += nNonAlphaBytes;
- *pColors++ = sal_uInt8(255);
+ *pColors++ = BYTE(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(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);
- sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
+ BYTE* pColors=reinterpret_cast<BYTE*>(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(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);
- sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
+ BYTE* pColors=reinterpret_cast<BYTE*>(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(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<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<BYTE>(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 3bf73ca7588d..d57c9f4ec767 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -72,7 +72,7 @@
#include <vcl/canvasbitmap.hxx>
#include <vcl/canvastools.hxx>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
using namespace ::com::sun::star;
@@ -81,7 +81,7 @@ namespace vcl
{
namespace unotools
{
- // #i79917# removed helpers bezierSequenceFromPolygon and
+ // #i79917# removed helpers bezierSequenceFromPolygon and
// pointSequenceFromPolygon here
// Also all helpers using tools Polygon and PolyPolygon will get mapped to the
// B2DPolygon helpers for these cases, see comments with the same TaskID below.
@@ -89,8 +89,8 @@ namespace vcl
//---------------------------------------------------------------------------------------
- uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice,
- const ::Polygon& inputPolygon )
+ uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice,
+ const ::Polygon& inputPolygon )
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xPolyPolygonFromPolygon()" );
@@ -102,7 +102,7 @@ namespace vcl
//---------------------------------------------------------------------------------------
uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice,
- const ::PolyPolygon& inputPolyPolygon )
+ const ::PolyPolygon& inputPolyPolygon )
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xPolyPolygonFromPolyPolygon()" );
@@ -117,11 +117,11 @@ namespace vcl
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::polygonFromPoint2DSequence()" );
- const sal_uInt16 nCurrSize( sal::static_int_cast<sal_uInt16>(points.getLength()) );
+ const USHORT nCurrSize( sal::static_int_cast<USHORT>(points.getLength()) );
::Polygon aPoly( nCurrSize );
- sal_uInt16 nCurrPoint;
+ USHORT nCurrPoint;
for( nCurrPoint=0; nCurrPoint<nCurrSize; ++nCurrPoint )
aPoly[nCurrPoint] = pointFromRealPoint2D( points[nCurrPoint] );
@@ -165,8 +165,8 @@ namespace vcl
//---------------------------------------------------------------------------------------
- uno::Reference< rendering::XBitmap > xBitmapFromBitmap( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/,
- const ::Bitmap& inputBitmap )
+ uno::Reference< rendering::XBitmap > xBitmapFromBitmap( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/,
+ const ::Bitmap& inputBitmap )
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xBitmapFromBitmap()" );
@@ -175,8 +175,8 @@ namespace vcl
//---------------------------------------------------------------------------------------
- uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/,
- const ::BitmapEx& inputBitmap )
+ uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/,
+ const ::BitmapEx& inputBitmap )
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xBitmapFromBitmapEx()" );
@@ -187,8 +187,8 @@ namespace vcl
const uno::Sequence< sal_Int8 > getTunnelIdentifier( TunnelIdentifierType eType )
{
- static boost::unordered_map< int, uno::Sequence< sal_Int8 > > aIds;
- boost::unordered_map< int, uno::Sequence< sal_Int8 > >::iterator it =
+ static std::hash_map< int, uno::Sequence< sal_Int8 > > aIds;
+ std::hash_map< int, uno::Sequence< sal_Int8 > >::iterator it =
aIds.find( eType );
if( it == aIds.end() )
{
@@ -204,10 +204,10 @@ namespace vcl
namespace
{
- inline bool operator==( const rendering::IntegerBitmapLayout& rLHS,
+ inline bool operator==( const rendering::IntegerBitmapLayout& rLHS,
const rendering::IntegerBitmapLayout& rRHS )
{
- return
+ return
rLHS.ScanLineBytes == rRHS.ScanLineBytes &&
rLHS.ScanLineStride == rRHS.ScanLineStride &&
rLHS.PlaneStride == rRHS.PlaneStride &&
@@ -255,7 +255,7 @@ namespace vcl
{
const rendering::ARGBColor& rColor=aARGBColors[x];
rWriteAcc->SetPixel( aRect.Y1, x,
- (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
+ (BYTE)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,
- (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
+ (BYTE)rWriteAcc->GetBestPaletteIndex(
BitmapColor( toByteColor(rColor.Red),
toByteColor(rColor.Green),
toByteColor(rColor.Blue))) );
@@ -343,16 +343,16 @@ namespace vcl
OSL_ENSURE(aLayout.ColorSpace.is(),
"Cannot convert image without color space!");
if( !aLayout.ColorSpace.is() )
- return ::BitmapEx();
+ return ::BitmapEx();
nDepth = aLayout.ColorSpace->getBitsPerPixel();
if( xInputBitmap->hasAlpha() )
{
// determine alpha channel depth
- const uno::Sequence<sal_Int8> aTags(
+ const uno::Sequence<sal_Int8> aTags(
aLayout.ColorSpace->getComponentTags() );
- const uno::Sequence<sal_Int32> aDepths(
+ const uno::Sequence<sal_Int32> aDepths(
aLayout.ColorSpace->getComponentBitCounts() );
const sal_Int8* pStart(aTags.getConstArray());
const sal_Size nLen(aTags.getLength());
@@ -385,8 +385,8 @@ namespace vcl
else
nDepth = 8;
- const sal_uInt16 nPaletteEntries(
- sal::static_int_cast<sal_uInt16>(
+ const USHORT nPaletteEntries(
+ sal::static_int_cast<USHORT>(
std::min(sal_Int32(255), nEntryCount)));
// copy palette entries
@@ -395,9 +395,9 @@ namespace vcl
uno::Reference<rendering::XColorSpace> xPalColorSpace( xPalette->getColorSpace() );
uno::Sequence<double> aPaletteEntry;
- for( sal_uInt16 j=0; j<nPaletteEntries; ++j )
+ for( USHORT j=0; j<nPaletteEntries; ++j )
{
- if( !xPalette->getIndex(aPaletteEntry,j) &&
+ if( !xPalette->getIndex(aPaletteEntry,j) &&
nAlphaDepth == 0 )
{
nAlphaDepth = 1;
@@ -413,26 +413,26 @@ namespace vcl
}
}
- const ::Size aPixelSize(
+ const ::Size aPixelSize(
sizeFromIntegerSize2D(xInputBitmap->getSize()));
// normalize bitcount
- nDepth =
+ nDepth =
( nDepth <= 1 ) ? 1 :
( nDepth <= 4 ) ? 4 :
- ( nDepth <= 8 ) ? 8 : 24;
+ ( nDepth <= 8 ) ? 8 : 24;
::Bitmap aBitmap( aPixelSize,
- sal::static_int_cast<sal_uInt16>(nDepth),
+ sal::static_int_cast<USHORT>(nDepth),
aLayout.Palette.is() ? &aPalette : NULL );
::Bitmap aAlpha;
if( nAlphaDepth )
- aAlpha = ::Bitmap( aPixelSize,
- sal::static_int_cast<sal_uInt16>(nAlphaDepth),
+ aAlpha = ::Bitmap( aPixelSize,
+ sal::static_int_cast<USHORT>(nAlphaDepth),
&::Bitmap::GetGreyPalette(
- sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) );
+ sal::static_int_cast<USHORT>(1L << nAlphaDepth)) );
- { // limit scoped access
+ { // limit scoped access
ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
aBitmap );
ScopedBitmapWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL,
@@ -447,7 +447,7 @@ namespace vcl
if( !readBmp(nWidth,nHeight,aLayout,xInputBitmap,
pWriteAccess,pAlphaWriteAccess) )
continue;
- } // limit scoped access
+ } // limit scoped access
if( nAlphaDepth )
return ::BitmapEx( aBitmap,
@@ -639,8 +639,8 @@ namespace vcl
{
return uno::Sequence< beans::PropertyValue >();
}
- virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor,
- const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor,
+ const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
// TODO(P3): if we know anything about target
@@ -653,7 +653,7 @@ namespace vcl
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
- ENSURE_ARG_OR_THROW2(nLen%4==0,
+ ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
@@ -670,7 +670,7 @@ namespace vcl
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
- ENSURE_ARG_OR_THROW2(nLen%4==0,
+ ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
@@ -687,7 +687,7 @@ namespace vcl
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
- ENSURE_ARG_OR_THROW2(nLen%4==0,
+ ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
@@ -786,7 +786,7 @@ namespace vcl
return aRet;
}
- Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor )
+ Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor )
{
ENSURE_ARG_OR_THROW( rColor.getLength() == 4,
"color must have 4 channels" );
@@ -802,7 +802,7 @@ namespace vcl
return aColor;
}
- uno::Sequence< double > VCL_DLLPUBLIC colorToDoubleSequence(
+ uno::Sequence< double > VCL_DLLPUBLIC colorToDoubleSequence(
const Color& rColor,
const uno::Reference< rendering::XColorSpace >& xColorSpace )
{
@@ -816,7 +816,7 @@ namespace vcl
return xColorSpace->convertFromARGB(aSeq);
}
- Color VCL_DLLPUBLIC doubleSequenceToColor(
+ Color VCL_DLLPUBLIC doubleSequenceToColor(
const uno::Sequence< double > rColor,
const uno::Reference< rendering::XColorSpace >& xColorSpace )
{
diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx
index a8a68640ec36..b97e6d9e770f 100644
--- a/vcl/source/helper/evntpost.cxx
+++ b/vcl/source/helper/evntpost.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index 9173474af759..d2612a028c9e 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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, sal_True )) ? true : false;
+ return (left != right && right->IsChild( left, TRUE )) ? true : false;
}
// specialized is_less function for Menu
@@ -99,7 +99,7 @@ void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
DBG_ASSERT( ! pSVData->mbDeInit, "DeleteOnDeinit added after DeiInitVCL !" );
if( pSVData->mbDeInit )
return;
-
+
if( pSVData->mpDeinitDeleteList == NULL )
pSVData->mpDeinitDeleteList = new std::list< DeleteOnDeinitBase* >();
pSVData->mpDeinitDeleteList->push_back( i_pContainer );
@@ -107,7 +107,7 @@ void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
void DeleteOnDeinitBase::ImplDeleteOnDeInit()
{
- ImplSVData* pSVData = ImplGetSVData();
+ ImplSVData* pSVData = ImplGetSVData();
if( pSVData->mpDeinitDeleteList )
{
for( std::list< vcl::DeleteOnDeinitBase* >::iterator it = pSVData->mpDeinitDeleteList->begin();
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index 1a417417dbe4..e708bdec9eaa 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,6 +46,7 @@ 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
new file mode 100644
index 000000000000..d96539494906
--- /dev/null
+++ b/vcl/source/helper/smartid.cxx
@@ -0,0 +1,267 @@
+/* -*- 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 c8b5cc7fbf22..bfbf85ebf21e 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -127,12 +127,12 @@ String GetCommandLineToken( int nToken, const String& rLine )
int nLen = rLine.Len();
if( ! nLen )
return String();
-
+
int nActualToken = 0;
sal_Unicode* pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*( nLen + 1 ) );
const sal_Unicode* pRun = rLine.GetBuffer();
sal_Unicode* pLeap = NULL;
-
+
while( *pRun && nActualToken <= nToken )
{
while( *pRun && isSpace( *pRun ) )
@@ -168,7 +168,7 @@ String GetCommandLineToken( int nToken, const String& rLine )
}
*pLeap = 0;
-
+
String aRet( pBuffer );
return aRet;
}
@@ -178,12 +178,12 @@ ByteString GetCommandLineToken( int nToken, const ByteString& rLine )
int nLen = rLine.Len();
if( ! nLen )
return ByteString();
-
+
int nActualToken = 0;
char* pBuffer = (char*)alloca( nLen + 1 );
const char* pRun = rLine.GetBuffer();
char* pLeap = NULL;
-
+
while( *pRun && nActualToken <= nToken )
{
while( *pRun && isSpace( *pRun ) )
@@ -219,7 +219,7 @@ ByteString GetCommandLineToken( int nToken, const ByteString& rLine )
}
*pLeap = 0;
-
+
ByteString aRet( pBuffer );
return aRet;
}
@@ -228,10 +228,10 @@ int GetCommandLineTokenCount( const String& rLine )
{
if( ! rLine.Len() )
return 0;
-
+
int nTokenCount = 0;
const sal_Unicode *pRun = rLine.GetBuffer();
-
+
while( *pRun )
{
@@ -271,7 +271,7 @@ int GetCommandLineTokenCount( const String& rLine )
}
nTokenCount++;
}
-
+
return nTokenCount;
}
@@ -279,10 +279,10 @@ int GetCommandLineTokenCount( const ByteString& rLine )
{
if( ! rLine.Len() )
return 0;
-
+
int nTokenCount = 0;
const char *pRun = rLine.GetBuffer();
-
+
while( *pRun )
{
@@ -322,16 +322,16 @@ int GetCommandLineTokenCount( const ByteString& rLine )
}
nTokenCount++;
}
-
+
return nTokenCount;
}
-String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
+String WhitespaceToSpace( const String& rLine, BOOL bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
return String();
-
+
sal_Unicode *pBuffer = (sal_Unicode*)alloca( sizeof(sal_Unicode)*(nLen + 1) );
const sal_Unicode *pRun = rLine.GetBuffer();
sal_Unicode *pLeap = pBuffer;
@@ -358,11 +358,11 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', sal_True );
+ CopyUntil( pLeap, pRun, '`', TRUE );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', sal_True );
+ CopyUntil( pLeap, pRun, '\'', TRUE );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', sal_True );
+ CopyUntil( pLeap, pRun, '"', TRUE );
else
{
*pLeap = *pRun;
@@ -380,15 +380,15 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
*pLeap = 0;
String aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer );
- return aRet;
+ return aRet;
}
-ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
+ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
return ByteString();
-
+
char *pBuffer = (char*)alloca( nLen + 1 );
const char *pRun = rLine.GetBuffer();
char *pLeap = pBuffer;
@@ -415,11 +415,11 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', sal_True );
+ CopyUntil( pLeap, pRun, '`', TRUE );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', sal_True );
+ CopyUntil( pLeap, pRun, '\'', TRUE );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', sal_True );
+ CopyUntil( pLeap, pRun, '"', TRUE );
else
{
*pLeap = *pRun;
@@ -437,7 +437,7 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
*pLeap = 0;
ByteString aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer );
- return aRet;
+ return aRet;
}
} // namespace
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index ad351410e2c2..e929009ed18c 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -112,8 +112,8 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
{
osl_resetCondition( m_aStart );
osl_resetCondition( m_aFinish );
- sal_uLong nSolarMutexCount = Application::ReleaseSolarMutex();
- sal_uLong nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
+ ULONG nSolarMutexCount = Application::ReleaseSolarMutex();
+ 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 d6aa0429bcf3..976af9f0420c 100644
--- a/vcl/source/helper/xconnection.cxx
+++ b/vcl/source/helper/xconnection.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,30 +30,27 @@
#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 rtl;
using namespace osl;
using namespace vcl;
using namespace com::sun::star::uno;
using namespace com::sun::star::awt;
-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 = ImplGetSVData()->mpDefInst->GetConnectionIdentifier( eType, nBytes );
+ void* pBytes = pSVData->mpDefInst->GetConnectionIdentifier( eType, nBytes );
switch( eType )
{
case SalInstance::AsciiCString:
@@ -66,54 +63,39 @@ 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 );
+ pSVData->mpDefInst->SetEventCallback( NULL, NULL );
+ pSVData->mpDefInst->SetErrorEventCallback( NULL, 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 css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
+
+void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const 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 css::uno::Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.remove( handler );
}
-void SAL_CALL DisplayConnection::addErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::addErrorHandler( const Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aErrorHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeErrorHandler( const Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
@@ -125,37 +107,52 @@ Any SAL_CALL DisplayConnection::getIdentifier() throw()
return m_aAny;
}
-bool DisplayConnection::dispatchEvent( void* pData, int nBytes )
+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 )
{
SolarMutexReleaser aRel;
+ DisplayConnection* This = (DisplayConnection*)pThis;
+
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< css::uno::Reference< XEventHandler > > handlers;
+ ::std::list< Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( m_aMutex );
- handlers = m_aHandlers;
+ MutexGuard aGuard( This->m_aMutex );
+ handlers = This->m_aHandlers;
}
- for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
return false;
}
-bool DisplayConnection::dispatchErrorEvent( void* pData, int nBytes )
+bool DisplayConnection::dispatchErrorEvent( void* pThis, void* pData, int nBytes )
{
SolarMutexReleaser aRel;
+ DisplayConnection* This = (DisplayConnection*)pThis;
+
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< css::uno::Reference< XEventHandler > > handlers;
+ ::std::list< Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( m_aMutex );
- handlers = m_aErrorHandlers;
+ MutexGuard aGuard( This->m_aMutex );
+ handlers = This->m_aErrorHandlers;
}
- for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< 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 9c790bf28d75..de085b482c4d 100644
--- a/vcl/source/salmain/makefile.mk
+++ b/vcl/source/salmain/makefile.mk
@@ -28,14 +28,11 @@
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/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index e5135b9aa241..138aa7987434 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,7 @@
SAL_IMPLEMENT_MAIN() {
tools::extendApplicationEnvironment();
- return SVMain();
+ return SVMain() ? EXIT_SUCCESS : EXIT_FAILURE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index a6792b202b3d..99579f00b107 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -80,3 +80,68 @@ String SV_BUTTONTEXT_ABORT
{
Text [ en-US ] = "~Abort";
};
+
+/* HelpTexte, die wir derzeit nicht mehr verwenden:
+SV_BUTTONHELPTEXT_OK
+{
+ Text = "Schließt dieses Dialogfeld und speichert alle vorgenommenen Änderungen." ;
+};
+
+SV_BUTTONHELPTEXT_CANCEL
+{
+ Text = "Schließt dieses Dialogfeld, ohne Ihre Änderungen zu speichern." ;
+};
+
+SV_BUTTONHELPTEXT_HELP
+{
+ Text = "Zeigt Hilfe zu diesem Fenster an." ;
+};
+
+SV_BUTTONHELPTEXT_MORE
+{
+ Text = "Zeigt weitere EinstellmÖglichkeiten an oder versteckt diese wieder." ;
+};
+
+Finnische-Texte:
+OK OK
+CANCEL Peruuta
+HELP ~Ohje
+MORE ~Enemmän
+YES ~Kyllä
+NO ~Ei
+RETRY ~Yritäuudelleen
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vcl/source/src/helptext.src b/vcl/source/src/helptext.src
index 59d7ea3d443e..327266c13b50 100644
--- a/vcl/source/src/helptext.src
+++ b/vcl/source/src/helptext.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -138,3 +138,26 @@ String SV_SHORTCUT_SPLITTER
{
Text [ en-US ] = "Split window separator" ;
};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index 541ac34c29e7..20ba1cbd3dd0 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -35,9 +35,28 @@
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
{
- File = "check.png";
+ File = "check.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_WINOFFSET)
+{
+ File = "checkwin.bmp";
};
+Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_OS2OFFSET)
+{
+ File = "checkos2.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MACOFFSET)
+{
+ File = "checkmac.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_UNIXOFFSET)
+{
+ File = "checkunx.bmp";
+};
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
{
@@ -46,19 +65,39 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
Bitmap (SV_RESID_BITMAP_SCROLLBMP)
{
- File = "scrbmp.png";
+ File = "scrbmp.bmp";
};
Bitmap (SV_RESID_BITMAP_SCROLLMSK)
{
- File = "scrmsk.png";
+ File = "scrmsk.bmp";
};
// -----------------------------------------------------------------------
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
{
- File = "radio.png";
+ File = "radio.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_WINOFFSET)
+{
+ File = "radiowin.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_OS2OFFSET)
+{
+ File = "radioos2.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MACOFFSET)
+{
+ File = "radiomac.bmp";
+};
+
+Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_UNIXOFFSET)
+{
+ File = "radiounx.bmp";
};
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
@@ -66,41 +105,63 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
File = "radiomono.bmp";
};
+// -----------------------------------------------------------------------
+
Bitmap SV_RESID_BITMAP_MSGBOX
{
File = "msgbox.png";
};
+// -----------------------------------------------------------------------
+
+Bitmap SV_RESID_BITMAP_MSGBOX_HC
+{
+ File = "msgbox_hc.png";
+};
+
+// -----------------------------------------------------------------------
+
Bitmap SV_RESID_BITMAP_PIN
{
- File = "pin.png";
+ File = "pin.bmp";
};
+// -----------------------------------------------------------------------
+
Bitmap SV_RESID_BITMAP_CLOSEDOC
{
- File = "closedoc.png";
+ File = "closedoc.bmp";
+};
+
+Bitmap SV_RESID_BITMAP_CLOSEDOCHC
+{
+ File = "closedochc.bmp";
};
+// -----------------------------------------------------------------------
+
Bitmap SV_RESID_BITMAP_SPLITHPIN
{
- File = "splhpin.png";
+ File = "splhpin.bmp";
};
Bitmap SV_RESID_BITMAP_SPLITVPIN
{
- File = "splvpin.png";
+ File = "splvpin.bmp";
};
Bitmap SV_RESID_BITMAP_SPLITHARW
{
- File = "splharw.png";
+ File = "splharw.bmp";
};
Bitmap SV_RESID_BITMAP_SPLITVARW
{
- File = "splvarw.png";
+ File = "splvarw.bmp";
};
+// -----------------------------------------------------------------------
+
Bitmap (SV_ICON_SIZE48_START)
{
File = "mainapp_48_8.png" ;
@@ -399,6 +460,16 @@ Bitmap (SV_ICON_SMALL_START)
File = "mainapp_16.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START)
+{
+ File = "mainapp_32_h.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START)
+{
+ File = "mainapp_16_h.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_OFFICE)
{
File = "mainapp_32.png" ;
@@ -409,6 +480,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_OFFICE)
File = "mainapp_16.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_OFFICE)
+{
+ File = "mainapp_32_h.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_OFFICE)
+{
+ File = "mainapp_16_h" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEXT)
{
File = "lx03251.png" ;
@@ -419,6 +500,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEXT)
File = "sx03251.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEXT)
+{
+ File = "lxh03251.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEXT)
+{
+ File = "sxh03251.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEXT_TEMPLATE)
{
File = "lx03255.png" ;
@@ -429,6 +520,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEXT_TEMPLATE)
File = "sx03255.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEXT_TEMPLATE)
+{
+ File = "lxh03255.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEXT_TEMPLATE)
+{
+ File = "sxh03255.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_SPREADSHEET)
{
File = "lx03250.png" ;
@@ -439,6 +540,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_SPREADSHEET)
File = "sx03250.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_SPREADSHEET)
+{
+ File = "lxh03250.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_SPREADSHEET)
+{
+ File = "sxh03250.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
{
File = "lx03254.png" ;
@@ -449,6 +560,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
File = "sx03254.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
+{
+ File = "lxh03254.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
+{
+ File = "sxh03254.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DRAWING)
{
File = "lx03246.png" ;
@@ -459,6 +580,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DRAWING)
File = "sx03246.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DRAWING)
+{
+ File = "lxh03246.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DRAWING)
+{
+ File = "sxh03246.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DRAWING_TEMPLATE)
{
File = "lx03252.png" ;
@@ -469,6 +600,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DRAWING_TEMPLATE)
File = "sx03252.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DRAWING_TEMPLATE)
+{
+ File = "lxh03252.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DRAWING_TEMPLATE)
+{
+ File = "sxh03252.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION)
{
File = "lx03249.png" ;
@@ -479,6 +620,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION)
File = "sx03249.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION)
+{
+ File = "lxh03249.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION)
+{
+ File = "sxh03249.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
{
File = "lx03253.png" ;
@@ -489,6 +640,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
File = "sx03253.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
+{
+ File = "lxh03253.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
+{
+ File = "sxh03253.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
{
File = "lx03241.png" ;
@@ -499,6 +660,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
File = "sx03241.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
+{
+ File = "lxh03241.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
+{
+ File = "sxh03241.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_MASTER_DOCUMENT)
{
File = "lx03248.png" ;
@@ -509,6 +680,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_MASTER_DOCUMENT)
File = "sx03248.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_MASTER_DOCUMENT)
+{
+ File = "lxh03248.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_MASTER_DOCUMENT)
+{
+ File = "sxh03248.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_HTML_DOCUMENT)
{
File = "lx03139.png" ;
@@ -519,6 +700,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_HTML_DOCUMENT)
File = "sx03139.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_HTML_DOCUMENT)
+{
+ File = "lxh03139.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_HTML_DOCUMENT)
+{
+ File = "sxh03139.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_CHART)
{
File = "lx03128.png" ;
@@ -529,6 +720,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_CHART)
File = "sx03128.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_CHART)
+{
+ File = "lxh03128.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_CHART)
+{
+ File = "sxh03128.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DATABASE)
{
File = "lx03245.png" ;
@@ -539,6 +740,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DATABASE)
File = "sx03245.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DATABASE)
+{
+ File = "lxh03245.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DATABASE)
+{
+ File = "sxh03245.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_FORMULA)
{
File = "lx03247.png" ;
@@ -549,6 +760,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_FORMULA)
File = "sx03247.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_FORMULA)
+{
+ File = "lxh03247.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_FORMULA)
+{
+ File = "sxh03247.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEMPLATE)
{
File = "lx03242.png" ;
@@ -559,6 +780,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEMPLATE)
File = "sx03242.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEMPLATE)
+{
+ File = "lxh03242.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEMPLATE)
+{
+ File = "sxh03242.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_MACRO)
{
File = "lx03216.png" ;
@@ -569,6 +800,16 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_MACRO)
File = "sx03216.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_MACRO)
+{
+ File = "lxh03216.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_MACRO)
+{
+ File = "sxh03216.png" ;
+};
+
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRINTERADMIN)
{
File = "printeradmin_32.png" ;
@@ -579,13 +820,33 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRINTERADMIN)
File = "printeradmin_16.png" ;
};
+Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRINTERADMIN)
+{
+ File = "printeradmin_32_h.png" ;
+};
+
+Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRINTERADMIN)
+{
+ File = "printeradmin_16_h.png" ;
+};
+
Bitmap SV_DISCLOSURE_PLUS
{
File = "plus.png";
};
+Bitmap SV_DISCLOSURE_PLUS_HC
+{
+ File = "plus_sch.png";
+};
+
Bitmap SV_DISCLOSURE_MINUS
{
File = "minus.png";
};
+Bitmap SV_DISCLOSURE_MINUS_HC
+{
+ File = "minus_sch.png";
+};
+
diff --git a/vcl/source/src/makefile.mk b/vcl/source/src/makefile.mk
index 2db77b7ffc74..40b7d4e75dfe 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/menu.src b/vcl/source/src/menu.src
index 1833093adfac..f4e59c1c8030 100644
--- a/vcl/source/src/menu.src
+++ b/vcl/source/src/menu.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -36,46 +36,46 @@ String SV_RESID_STRING_NOSELECTIONPOSSIBLE
Menu SV_RESID_MENU_EDIT
{
- ItemList =
+ ItemList =
{
MenuItem
{
- Identifier = SV_MENU_EDIT_UNDO ;
+ Identifier = SV_MENU_EDIT_UNDO ;
Text [ en-US ] = "~Undo" ;
};
- MenuItem { Separator = TRUE ; };
+ MenuItem { Separator = TRUE ; };
MenuItem
{
- Identifier = SV_MENU_EDIT_CUT ;
+ Identifier = SV_MENU_EDIT_CUT ;
Text [ en-US ] = "Cu~t" ;
};
MenuItem
{
- Identifier = SV_MENU_EDIT_COPY ;
+ Identifier = SV_MENU_EDIT_COPY ;
Text [ en-US ] = "~Copy" ;
};
MenuItem
{
- Identifier = SV_MENU_EDIT_PASTE ;
+ Identifier = SV_MENU_EDIT_PASTE ;
Text [ en-US ] = "~Paste" ;
};
MenuItem
{
- Identifier = SV_MENU_EDIT_DELETE ;
+ Identifier = SV_MENU_EDIT_DELETE ;
Text [ en-US ] = "~Delete" ;
};
- MenuItem { Separator = TRUE ; };
+ MenuItem { Separator = TRUE ; };
MenuItem
{
- Identifier = SV_MENU_EDIT_SELECTALL ;
+ Identifier = SV_MENU_EDIT_SELECTALL ;
Text [ en-US ] = "Select ~All" ;
};
- MenuItem { Separator = TRUE ; };
+ MenuItem { Separator = TRUE ; };
MenuItem
{
Identifier = SV_MENU_EDIT_INSERTSYMBOL;
Text [ en-US ] = "~Special Character...";
-
+
};
};
};
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index b4f4d56029e1..34519022560b 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -29,43 +29,38 @@
ModalDialog SV_DLG_PRINT
{
- HelpID = ".HelpID:vcl:PrintDialog:Dialog";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
Moveable = TRUE;
Maxable = TRUE;
SVLook = TRUE;
-
+
Size = MAP_APPFONT( 350, 215 );
-
+
OKButton SV_PRINT_OK
{
DefButton = TRUE;
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
{
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 130, 130 );
Border = FALSE;
- HelpID = ".HelpID:vcl:PrintDialog:Preview";
};
NumericField SV_PRINT_PAGE_EDIT
{
@@ -74,7 +69,7 @@ ModalDialog SV_DLG_PRINT
SVLook = TRUE;
Spin = FALSE;
Border = TRUE;
- HelpID = ".HelpID:vcl:PrintDialog:PageEdit";
+ HelpText [en-US] = "Select page to display in preview.";
};
FixedText SV_PRINT_PAGE_TXT
{
@@ -82,25 +77,23 @@ 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 );
- HelpID = ".HelpID:vcl:PrintDialog:ForwardBtn";
+ HelpText [en-US] = "Scroll one page forward.";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpID = ".HelpID:vcl:PrintDialog:BackwardBtn";
+ HelpText [en-US] = "Scroll one page backward.";
};
TabControl SV_PRINT_TABCTRL
{
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
- HelpID = ".HelpID:vcl:PrintDialog:TabPages";
};
FixedLine SV_PRINT_BUTTONLINE
{
@@ -121,7 +114,7 @@ ModalDialog SV_DLG_PRINT
{
Text [en-US] = "Default printer";
};
-
+
String SV_PRINT_PRINTPREVIEW_TXT
{
@@ -130,38 +123,43 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
- HelpID = ".HelpID:vcl:PrintDialog:NUpPage";
Text [en-US] = "Page Layout";
Hide = TRUE;
-
+
FixedLine SV_PRINT_PRT_NUP_LAYOUT_FL
{
Pos = MAP_APPFONT( 5, 5 );
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; >;
@@ -182,7 +180,6 @@ 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;
@@ -190,6 +187,7 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
+ HelpText [en-US] = "Select number of columns.";
};
FixedText SV_PRINT_PRT_NUP_TIMES_TXT
{
@@ -200,7 +198,6 @@ 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;
@@ -208,6 +205,7 @@ 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
{
@@ -217,13 +215,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
{
@@ -239,13 +237,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
{
@@ -261,7 +259,6 @@ 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;
@@ -273,6 +270,7 @@ 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
{
@@ -282,35 +280,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, 50 );
+ Size = MAP_APPFONT( 10, 20 );
DropDown = TRUE;
Border = TRUE;
CurPos = 0;
StringList [en-US] =
{
- < "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; >;
+ < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
+ < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
};
+ 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;
-
+
FixedLine SV_PRINT_PRINTERS_FL
{
Pos = MAP_APPFONT( 5, 5 );
@@ -319,18 +314,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
{
@@ -352,10 +347,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
{
@@ -371,7 +366,6 @@ 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;
@@ -379,6 +373,7 @@ 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
{
@@ -387,28 +382,30 @@ 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
{
ImageBitmap = Bitmap { File = "collate.png" ; };
};
-
+
Image SV_PRINT_NOCOLLATE_IMG
{
ImageBitmap = Bitmap { File = "ncollate.png" ; };
};
-
- CheckBox SV_PRINT_OPT_REVERSE
+
+ Image SV_PRINT_COLLATE_HC_IMG
{
- HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
- Pos = MAP_APPFONT( 10, 50 );
- Size = MAP_APPFONT( 200, 12 );
- Text [en-US] = "Print in ~reverse page order";
+ ImageBitmap = Bitmap { File = "collate_h.png" ; };
+ };
+
+ Image SV_PRINT_NOCOLLATE_HC_IMG
+ {
+ ImageBitmap = Bitmap { File = "ncollate_h.png" ; };
};
};
@@ -416,7 +413,6 @@ ModalDialog SV_DLG_PRINT
{
Text [en-US] = "Options";
Hide = TRUE;
- HelpID = ".HelpID:vcl:PrintDialog:OptPage";
FixedLine SV_PRINT_OPT_PRINT_FL
{
@@ -426,32 +422,38 @@ 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;
Moveable = TRUE;
SVLook = TRUE;
-
+
Size = MAP_APPFONT( 120, 70 );
-
+
CancelButton SV_PRINT_PROGRESS_CANCEL
{
Pos = MAP_APPFONT( 35, 50 );
@@ -486,51 +488,5 @@ 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 1b95f7bb1d72..90787a620e14 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -101,11 +101,6 @@ 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
deleted file mode 100644
index d3c5ea44035c..000000000000
--- a/vcl/source/src/throbber.src
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// 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/src/units.src b/vcl/source/src/units.src
index 0a680fcb1913..aff92ad105b5 100644
--- a/vcl/source/src/units.src
+++ b/vcl/source/src/units.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx
index d60dbb83b6c5..e334cc37ac48 100644
--- a/vcl/source/window/abstdlg.cxx
+++ b/vcl/source/window/abstdlg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,7 +45,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
static ::osl::Module aDialogLibrary;
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ) ) )
fp = ( VclAbstractDialogFactory* (__LOADONCALLAPI*)() )
- aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory")) );
+ aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
if ( fp )
return fp();
return 0;
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 50d288b71686..96f9f2023171 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,29 +28,30 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
+#include <tools/list.hxx>
#include <tools/table.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <vcl/accel.h>
#include <vcl/accel.hxx>
#include <tools/rc.h>
-#include <vector>
+
+
// =======================================================================
DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
-typedef ::std::vector< ImplAccelEntry* > ImplAccelList;
+DECLARE_LIST( ImplAccelList, ImplAccelEntry* )
-#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define ACCELENTRY_NOTFOUND ((USHORT)0xFFFF)
// =======================================================================
class ImplAccelData
{
public:
- ImplAccelTable maKeyTable; // Fuer KeyCodes, die mit einem Code erzeugt wurden
- ImplAccelList maIdList; // Id-List
+ ImplAccelTable maKeyTable; // Fuer KeyCodes, die mit einem Code erzeugt wurden
+ ImplAccelList maIdList; // Id-List
};
// =======================================================================
@@ -59,17 +60,17 @@ DBG_NAME( Accelerator )
// =======================================================================
-sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
- sal_uInt16* pIndex = NULL )
+USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
+ USHORT* pIndex = NULL )
{
- size_t nLow;
- size_t nHigh;
- size_t nMid;
- size_t nCount = pList->size();
- sal_uInt16 nCompareId;
+ ULONG nLow;
+ ULONG nHigh;
+ ULONG nMid;
+ ULONG nCount = pList->Count();
+ USHORT nCompareId;
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
- if ( !nCount || (nId < (*pList)[ 0 ]->mnId) )
+ if ( !nCount || (nId < pList->GetObject( 0 )->mnId) )
{
if ( pIndex )
*pIndex = 0;
@@ -82,7 +83,7 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
do
{
nMid = (nLow + nHigh) / 2;
- nCompareId = (*pList)[ nMid ]->mnId;
+ nCompareId = pList->GetObject( nMid )->mnId;
if ( nId < nCompareId )
nHigh = nMid-1;
else
@@ -90,7 +91,7 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
if ( nId > nCompareId )
nLow = nMid + 1;
else
- return (sal_uInt16)nMid;
+ return (USHORT)nMid;
}
}
while ( nLow <= nHigh );
@@ -98,9 +99,9 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
if ( pIndex )
{
if ( nId > nCompareId )
- *pIndex = (sal_uInt16)(nMid+1);
+ *pIndex = (USHORT)(nMid+1);
else
- *pIndex = (sal_uInt16)nMid;
+ *pIndex = (USHORT)nMid;
}
return ACCELENTRY_NOTFOUND;
@@ -110,54 +111,41 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
{
- sal_uInt16 nInsIndex;
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
+ USHORT nInsIndex;
+ USHORT nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
do
{
nIndex++;
- ImplAccelEntry* pTempEntry = (*pList)[ nIndex ];
+ ImplAccelEntry* pTempEntry = pList->GetObject( nIndex );
if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) )
break;
}
- while ( nIndex < pList->size() );
-
- if ( nIndex < pList->size() ) {
- ImplAccelList::iterator it = pList->begin();
- ::std::advance( it, nIndex );
- pList->insert( it, pEntry );
- } else {
- pList->push_back( pEntry );
- }
- }
- else {
- if ( nInsIndex < pList->size() ) {
- ImplAccelList::iterator it = pList->begin();
- ::std::advance( it, nInsIndex );
- pList->insert( it, pEntry );
- } else {
- pList->push_back( pEntry );
- }
+ while ( nIndex < pList->Count() );
+
+ pList->Insert( pEntry, (ULONG)nIndex );
}
+ else
+ pList->Insert( pEntry, (ULONG)nInsIndex );
}
// -----------------------------------------------------------------------
-static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId )
+static USHORT ImplAccelEntryGetFirstPos( ImplAccelList* pList, USHORT nId )
{
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId );
+ USHORT nIndex = ImplAccelEntryGetIndex( pList, nId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
while ( nIndex )
{
nIndex--;
- if ( (*pList)[ nIndex ]->mnId != nId )
+ if ( pList->GetObject( nIndex )->mnId != nId )
break;
}
- if ( (*pList)[ nIndex ]->mnId != nId )
+ if ( pList->GetObject( nIndex )->mnId != nId )
nIndex++;
}
@@ -168,10 +156,10 @@ static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nI
void Accelerator::ImplInit()
{
- mnCurId = 0;
- mnCurRepeat = 0;
- mbIsCancel = sal_False;
- mpDel = NULL;
+ mnCurId = 0;
+ mnCurRepeat = 0;
+ mbIsCancel = FALSE;
+ mpDel = NULL;
}
// -----------------------------------------------------------------------
@@ -186,9 +174,10 @@ ImplAccelEntry* Accelerator::ImplGetAccelData( const KeyCode& rKeyCode ) const
void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
{
// Tabellen kopieren
- for ( size_t i = 0, n = rAccelData.maIdList.size(); i < n; ++i )
+ ImplAccelEntry* pEntry = rAccelData.maIdList.First();
+ while ( pEntry )
{
- ImplAccelEntry* pEntry = new ImplAccelEntry( *rAccelData.maIdList[ i ] );
+ pEntry = new ImplAccelEntry( *pEntry );
// Folge-Accelerator, dann auch kopieren
if ( pEntry->mpAccel )
@@ -199,8 +188,10 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
else
pEntry->mpAutoAccel = NULL;
- mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
- mpData->maIdList.push_back( pEntry );
+ mpData->maKeyTable.Insert( (ULONG)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
+ mpData->maIdList.Insert( pEntry, LIST_APPEND );
+
+ pEntry = rAccelData.maIdList.Next();
}
}
@@ -209,30 +200,32 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
void Accelerator::ImplDeleteData()
{
// Accelerator-Eintraege ueber die Id-Tabelle loeschen
- for ( size_t i = 0, n = mpData->maIdList.size(); i < n; ++i ) {
- ImplAccelEntry* pEntry = mpData->maIdList[ i ];
- if ( pEntry->mpAutoAccel ) {
+ ImplAccelEntry* pEntry = mpData->maIdList.First();
+ while ( pEntry )
+ {
+ // AutoResAccel zerstoeren
+ if ( pEntry->mpAutoAccel )
delete pEntry->mpAutoAccel;
- }
delete pEntry;
+
+ pEntry = mpData->maIdList.Next();
}
- mpData->maIdList.clear();
}
// -----------------------------------------------------------------------
-void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
- sal_Bool bEnable, Accelerator* pAutoAccel )
+void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
+ BOOL bEnable, Accelerator* pAutoAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" );
if ( rKeyCode.IsFunction() )
{
- sal_uInt16 nCode1;
- sal_uInt16 nCode2;
- sal_uInt16 nCode3;
- sal_uInt16 nCode4;
+ USHORT nCode1;
+ USHORT nCode2;
+ USHORT nCode3;
+ USHORT nCode4;
ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 );
if ( nCode1 )
ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel );
@@ -252,23 +245,23 @@ void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
}
// Neuen Eintrag holen und fuellen
- ImplAccelEntry* pEntry = new ImplAccelEntry;
- pEntry->mnId = nItemId;
- pEntry->maKeyCode = rKeyCode;
- pEntry->mpAccel = pAutoAccel;
- pEntry->mpAutoAccel = pAutoAccel;
- pEntry->mbEnabled = bEnable;
+ ImplAccelEntry* pEntry = new ImplAccelEntry;
+ pEntry->mnId = nItemId;
+ pEntry->maKeyCode = rKeyCode;
+ pEntry->mpAccel = pAutoAccel;
+ pEntry->mpAutoAccel = pAutoAccel;
+ pEntry->mbEnabled = bEnable;
// Ab in die Tabellen
- sal_uLong nCode = rKeyCode.GetFullKeyCode();
+ ULONG nCode = rKeyCode.GetFullKeyCode();
if ( !nCode )
{
- OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
+ DBG_ERROR( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
delete pEntry;
}
else if ( !mpData->maKeyTable.Insert( nCode, pEntry ) )
{
- OSL_TRACE( "Accelerator::InsertItem(): KeyCode (Key: %lx) already exists", nCode );
+ DBG_ERROR1( "Accelerator::InsertItem(): KeyCode (Key: %lx) already exists", nCode );
delete pEntry;
}
else
@@ -319,9 +312,9 @@ void Accelerator::ImplLoadRes( const ResId& rResId )
GetRes( rResId );
maHelpStr = ReadStringRes();
- sal_uLong nObjFollows = ReadLongRes();
+ ULONG nObjFollows = ReadLongRes();
- for( sal_uLong i = 0; i < nObjFollows; i++ )
+ for( ULONG i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -336,7 +329,7 @@ Accelerator::~Accelerator()
// AccelManager benachrichtigen, das Accelrator geloescht wurde
if ( mpDel )
- *mpDel = sal_True;
+ *mpDel = TRUE;
ImplDeleteData();
delete mpData;
@@ -365,9 +358,9 @@ void Accelerator::Select()
// -----------------------------------------------------------------------
-void Accelerator::InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode )
+void Accelerator::InsertItem( USHORT nItemId, const KeyCode& rKeyCode )
{
- ImplInsertAccel( nItemId, rKeyCode, sal_True, NULL );
+ ImplInsertAccel( nItemId, rKeyCode, TRUE, NULL );
}
// -----------------------------------------------------------------------
@@ -376,16 +369,16 @@ void Accelerator::InsertItem( const ResId& rResId )
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uLong nObjMask;
- sal_uInt16 nAccelKeyId;
- sal_uInt16 bDisable;
- KeyCode aKeyCode;
- Accelerator* pAutoAccel = NULL;
+ ULONG nObjMask;
+ USHORT nAccelKeyId;
+ USHORT bDisable;
+ KeyCode aKeyCode;
+ Accelerator* pAutoAccel = NULL;
GetRes( rResId.SetRT( RSC_ACCELITEM ) );
- nObjMask = ReadLongRes();
- nAccelKeyId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
- bDisable = ReadShortRes();
+ nObjMask = ReadLongRes();
+ nAccelKeyId = sal::static_int_cast<USHORT>(ReadLongRes());
+ bDisable = ReadShortRes();
if ( nObjMask & ACCELITEM_KEY )
{
@@ -407,25 +400,22 @@ void Accelerator::InsertItem( const ResId& rResId )
// -----------------------------------------------------------------------
-void Accelerator::RemoveItem( sal_uInt16 nItemId )
+void Accelerator::RemoveItem( USHORT nItemId )
{
DBG_CHKTHIS( Accelerator, NULL );
// Aus der Id-Liste entfernen
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- sal_uInt16 nItemCount = GetItemCount();
+ USHORT nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
+ ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (ULONG)nIndex );
if ( pEntry && pEntry->mnId == nItemId )
{
mpData->maKeyTable.Remove( pEntry->maKeyCode.GetFullKeyCode() );
-
- ImplAccelList::iterator it = mpData->maIdList.begin();
- ::std::advance( it, nIndex );
- mpData->maIdList.erase( it );
+ mpData->maIdList.Remove( (ULONG)nIndex );
// AutoResAccel zerstoeren
if ( pEntry->mpAutoAccel )
@@ -450,21 +440,18 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode )
if ( pEntry )
{
// Aus der Id-Liste entfernen
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
- sal_uInt16 nItemCount = GetItemCount();
+ USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
+ USHORT nItemCount = GetItemCount();
do
{
- if ( mpData->maIdList[ nIndex ] == pEntry )
+ if ( mpData->maIdList.GetObject( (ULONG)nIndex ) == pEntry )
break;
nIndex++;
}
while ( nIndex < nItemCount );
mpData->maKeyTable.Remove( rKeyCode.GetFullKeyCode() );
-
- ImplAccelList::iterator it = mpData->maIdList.begin();
- ::std::advance( it, nIndex );
- mpData->maIdList.erase( it );
+ mpData->maIdList.Remove( (ULONG)nIndex );
// AutoResAccel zerstoeren
if ( pEntry->mpAutoAccel )
@@ -482,24 +469,25 @@ void Accelerator::Clear()
ImplDeleteData();
mpData->maKeyTable.Clear();
+ mpData->maIdList.Clear();
}
// -----------------------------------------------------------------------
-sal_uInt16 Accelerator::GetItemCount() const
+USHORT Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
- return (sal_uInt16)mpData->maIdList.size();
+ return (USHORT)mpData->maIdList.Count();
}
// -----------------------------------------------------------------------
-sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
+USHORT Accelerator::GetItemId( USHORT nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
+ ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (ULONG)nPos );
if ( pEntry )
return pEntry->mnId;
else
@@ -508,11 +496,11 @@ sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
+KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
+ ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (ULONG)nPos );
if ( pEntry )
return pEntry->maKeyCode;
else
@@ -521,7 +509,7 @@ KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
+USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -534,30 +522,30 @@ sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
+KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList[ nIndex ]->maKeyCode;
+ return mpData->maIdList.GetObject( (ULONG)nIndex )->maKeyCode;
else
return KeyCode();
}
// -----------------------------------------------------------------------
-sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const
+BOOL Accelerator::IsIdValid( USHORT nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
return (nIndex != ACCELENTRY_NOTFOUND);
}
// -----------------------------------------------------------------------
-sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
+BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -567,7 +555,7 @@ sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
// -----------------------------------------------------------------------
-sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
+BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -576,39 +564,39 @@ sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
if ( pEntry->mbEnabled )
{
- sal_Bool bDel = sal_False;
- mnCurId = pEntry->mnId;
- maCurKeyCode = rKeyCode;
- mnCurRepeat = nRepeat;
- mpDel = &bDel;
+ BOOL bDel = FALSE;
+ mnCurId = pEntry->mnId;
+ maCurKeyCode = rKeyCode;
+ mnCurRepeat = nRepeat;
+ mpDel = &bDel;
Select();
if ( !bDel )
{
- mnCurId = 0;
- maCurKeyCode = KeyCode();
- mnCurRepeat = 0;
+ mnCurId = 0;
+ maCurKeyCode = KeyCode();
+ mnCurRepeat = 0;
}
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
+void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- sal_uInt16 nItemCount = GetItemCount();
+ USHORT nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
+ ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (ULONG)nIndex );
if ( pEntry->mnId != nItemId )
break;
@@ -621,13 +609,13 @@ void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
// -----------------------------------------------------------------------
-Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
+Accelerator* Accelerator::GetAccel( USHORT nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList[ nIndex ]->mpAccel;
+ return mpData->maIdList.GetObject( (ULONG)nIndex )->mpAccel;
else
return NULL;
}
@@ -653,22 +641,22 @@ Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mpAccel;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
+void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- sal_uInt16 nItemCount = GetItemCount();
+ USHORT nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
+ ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (ULONG)nIndex );
if ( pEntry->mnId != nItemId )
break;
@@ -681,20 +669,20 @@ void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
// -----------------------------------------------------------------------
-sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
+BOOL Accelerator::IsItemEnabled( USHORT nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList[ nIndex ]->mbEnabled;
+ return mpData->maIdList.GetObject( (ULONG)nIndex )->mbEnabled;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
+void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -705,7 +693,7 @@ void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
// -----------------------------------------------------------------------
-sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
+BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -713,7 +701,7 @@ sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mbEnabled;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -724,15 +712,16 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel )
DBG_CHKOBJ( &rAccel, Accelerator, NULL );
// Neue Daten zuweisen
- maHelpStr = rAccel.maHelpStr;
- maCurKeyCode = KeyCode();
- mnCurId = 0;
- mnCurRepeat = 0;
- mbIsCancel = sal_False;
+ maHelpStr = rAccel.maHelpStr;
+ maCurKeyCode = KeyCode();
+ mnCurId = 0;
+ mnCurRepeat = 0;
+ mbIsCancel = FALSE;
// Tabellen loeschen und kopieren
ImplDeleteData();
mpData->maKeyTable.Clear();
+ mpData->maIdList.Clear();
ImplCopyData( *((ImplAccelData*)(rAccel.mpData)) );
return *this;
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index c8b1e42c5ed1..09838342dacf 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,12 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
+#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <vcl/accel.h>
#include <vcl/accel.hxx>
#include <vcl/accmgr.hxx>
+
+
+// =======================================================================
+
+DECLARE_LIST( ImplAccelList, Accelerator* )
+
// =======================================================================
DBG_NAMEEX( Accelerator )
@@ -50,20 +56,21 @@ ImplAccelManager::~ImplAccelManager()
// -----------------------------------------------------------------------
-sal_Bool ImplAccelManager::InsertAccel( Accelerator* pAccel )
+BOOL ImplAccelManager::InsertAccel( Accelerator* pAccel )
{
- if ( !mpAccelList ) {
+ if ( !mpAccelList )
mpAccelList = new ImplAccelList;
- } else {
- for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) {
- if ( (*mpAccelList)[ i ] == pAccel ) {
- return sal_False;
- }
- }
+ else
+ {
+ // Gibts den schon ?
+ if ( mpAccelList->GetPos( pAccel ) != LIST_ENTRY_NOTFOUND )
+ return FALSE;
}
- mpAccelList->insert( mpAccelList->begin(), pAccel );
- return sal_True;
+ // Am Anfang der Liste einfuegen
+ mpAccelList->Insert( pAccel, (ULONG)0 );
+
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -77,53 +84,47 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
//e.g. #i90599#. Someone starts typing a sequence in a dialog, but doesn't
//end it, and then closes the dialog, deleting the accelerators. So if
//we're removing an accelerator that a sub-accelerator which is in the
- //sequence list, throw away the entire sequence
- if ( mpSequenceList ) {
- 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 ) {
- EndSequence( true );
- i = pAccel->GetItemCount();
- break;
- }
+ //sequence list, throw away the entire sequence
+ if ( mpSequenceList )
+ {
+ for (USHORT i = 0; i < pAccel->GetItemCount(); ++i)
+ {
+ Accelerator* pSubAccel = pAccel->GetAccel(pAccel->GetItemId(i));
+ if ( mpSequenceList->GetPos( pSubAccel ) != LIST_ENTRY_NOTFOUND )
+ {
+ EndSequence( true );
+ break;
}
}
}
// Raus damit
- for ( ImplAccelList::iterator it = mpAccelList->begin();
- it < mpAccelList->end();
- ++it
- ) {
- if ( *it == pAccel ) {
- mpAccelList->erase( it );
- break;
- }
- }
+ mpAccelList->Remove( pAccel );
}
// -----------------------------------------------------------------------
-void ImplAccelManager::EndSequence( sal_Bool bCancel )
+void ImplAccelManager::EndSequence( BOOL bCancel )
{
// Sind wir ueberhaupt in einer Sequenz ?
if ( !mpSequenceList )
return;
// Alle Deactivate-Handler der Acceleratoren in der Sequenz rufen
- for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i )
+ Accelerator* pTempAccel = mpSequenceList->First();
+ while( pTempAccel )
{
- Accelerator* pTempAccel = (*mpSequenceList)[ i ];
- sal_Bool bDel = sal_False;
+ BOOL bDel = FALSE;
pTempAccel->mbIsCancel = bCancel;
pTempAccel->mpDel = &bDel;
pTempAccel->Deactivate();
if ( !bDel )
{
- pTempAccel->mbIsCancel = sal_False;
+ pTempAccel->mbIsCancel = FALSE;
pTempAccel->mpDel = NULL;
}
+
+ pTempAccel = mpSequenceList->Next();
}
// Sequenz-Liste loeschen
@@ -133,20 +134,20 @@ void ImplAccelManager::EndSequence( sal_Bool bCancel )
// -----------------------------------------------------------------------
-sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
+BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
{
Accelerator* pAccel;
// Haben wir ueberhaupt Acceleratoren ??
if ( !mpAccelList )
- return sal_False;
- if ( mpAccelList->empty() )
- return sal_False;
+ return FALSE;
+ if ( !mpAccelList->Count() )
+ return FALSE;
// Sind wir in einer Sequenz ?
if ( mpSequenceList )
{
- pAccel = mpSequenceList->empty() ? NULL : (*mpSequenceList)[ 0 ];
+ pAccel = mpSequenceList->GetObject( 0 );
DBG_CHKOBJ( pAccel, Accelerator, NULL );
// Nicht Gefunden ?
@@ -154,7 +155,7 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
{
// Sequenz abbrechen
FlushAccel();
- return sal_False;
+ return FALSE;
}
// Ist der Eintrag da drin ?
@@ -168,11 +169,11 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
{
DBG_CHKOBJ( pNextAccel, Accelerator, NULL );
- mpSequenceList->insert( mpSequenceList->begin(), pNextAccel );
+ mpSequenceList->Insert( pNextAccel, (ULONG)0 );
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return sal_True;
+ return TRUE;
}
else
{
@@ -184,7 +185,7 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- sal_Bool bDel = sal_False;
+ BOOL bDel = FALSE;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -201,14 +202,14 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
pAccel->mpDel = NULL;
}
- return sal_True;
+ return TRUE;
}
else
{
// Sequenz abbrechen, weil Acceleraor disabled
// Taste wird weitergeleitet (ans System)
FlushAccel();
- return sal_False;
+ return FALSE;
}
}
}
@@ -216,14 +217,14 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
{
// Sequenz abbrechen wegen falscher Taste
FlushAccel();
- return sal_False;
+ return FALSE;
}
}
// Durch die Liste der Acceleratoren wuehlen
- for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i )
+ pAccel = mpAccelList->First();
+ while ( pAccel )
{
- pAccel = (*mpAccelList)[ i ];
DBG_CHKOBJ( pAccel, Accelerator, NULL );
// Ist der Eintrag da drin ?
@@ -239,13 +240,13 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
// Sequenz-Liste erzeugen
mpSequenceList = new ImplAccelList;
- mpSequenceList->insert( mpSequenceList->begin(), pAccel );
- mpSequenceList->insert( mpSequenceList->begin(), pNextAccel );
+ mpSequenceList->Insert( pAccel, (ULONG)0 );
+ mpSequenceList->Insert( pNextAccel, (ULONG)0 );
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return sal_True;
+ return TRUE;
}
else
{
@@ -258,7 +259,7 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- sal_Bool bDel = sal_False;
+ BOOL bDel = FALSE;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -275,15 +276,18 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
pAccel->mpDel = NULL;
}
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
}
+
+ // Nicht gefunden, vielleicht im naechsten Accelerator
+ pAccel = mpAccelList->Next();
}
- return sal_False;
+ return FALSE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index 28e0d8ae65fe..28658806bc3a 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,37 +30,15 @@
#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()
{}
@@ -76,7 +54,7 @@ void WindowArranger::setParent( WindowArranger* i_pParent )
void WindowArranger::setParentWindow( Window* i_pNewParent )
{
m_pParentWindow = i_pNewParent;
-
+
size_t nEle = countElements();
for( size_t i = 0; i < nEle; i++ )
{
@@ -179,28 +157,18 @@ 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 );
- bVisible = true;
- }
- else if( m_pChild && m_pChild->isVisible() )
- {
+ else if( m_pChild )
aResult = m_pChild->getOptimalSize( i_eType );
- 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 );
- }
- }
-
+ 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;
+ }
+
return aResult;
}
@@ -208,74 +176,16 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi
{
Point aPoint( i_rPos );
Size aSize( i_rSize );
- 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 );
+ aPoint.X() += m_nLeftBorder;
+ aPoint.Y() += m_nTopBorder;
+ aSize.Width() -= m_nLeftBorder + m_nRightBorder;
+ aSize.Height() -= m_nTopBorder + 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
//-----------------------------------------
@@ -292,7 +202,6 @@ 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 )
{
@@ -303,7 +212,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
if( m_bColumn )
{
// add the distance between elements
- aRet.Height() += nDistance;
+ aRet.Height() += m_nBorderWidth;
// check if the width needs adjustment
if( aRet.Width() < aElementSize.Width() )
aRet.Width() = aElementSize.Width();
@@ -312,7 +221,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
else
{
// add the distance between elements
- aRet.Width() += nDistance;
+ aRet.Width() += m_nBorderWidth;
// check if the height needs adjustment
if( aRet.Height() < aElementSize.Height() )
aRet.Height() = aElementSize.Height();
@@ -325,14 +234,13 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
// subtract the border for the first element
if( m_bColumn )
- aRet.Height() -= nDistance;
+ aRet.Height() -= m_nBorderWidth;
else
- aRet.Width() -= nDistance;
-
+ aRet.Width() -= m_nBorderWidth;
+
// add the outer border
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- aRet.Width() += 2*nOuterBorder;
- aRet.Height() += 2*nOuterBorder;
+ aRet.Width() += 2*m_nOuterBorder;
+ aRet.Height() += 2*m_nOuterBorder;
}
return aRet;
@@ -360,7 +268,7 @@ void RowOrColumn::distributeRowWidth( std::vector<Size>& io_rSizes, long /*i_nUs
aIndices.push_back( i );
}
}
-
+
// distribute extra space evenly among collected elements
nElements = aIndices.size();
if( nElements > 0 )
@@ -400,7 +308,7 @@ void RowOrColumn::distributeColumnHeight( std::vector<Size>& io_rSizes, long /*i
aIndices.push_back( i );
}
}
-
+
// distribute extra space evenly among collected elements
nElements = aIndices.size();
if( nElements > 0 )
@@ -437,9 +345,7 @@ void RowOrColumn::resize()
size_t nElements = m_aElements.size();
// get all element sizes for sizing
std::vector<Size> aElementSizes( nElements );
- long nDistance = getBorderValue( m_nBorderWidth );
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0);
+ long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0);
for( size_t i = 0; i < nElements; i++ )
{
if( m_aElements[i].isVisible() )
@@ -447,13 +353,13 @@ void RowOrColumn::resize()
aElementSizes[i] = m_aElements[i].getOptimalSize( eType );
if( m_bColumn )
{
- aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder;
- nUsedWidth += aElementSizes[i].Height() + nDistance;
+ aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder;
+ nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth;
}
else
{
- aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder;
- nUsedWidth += aElementSizes[i].Width() + nDistance;
+ aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder;
+ nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth;
}
}
}
@@ -470,8 +376,8 @@ void RowOrColumn::resize()
// get starting position
Point aElementPos( m_aManagedArea.TopLeft() );
// outer border
- aElementPos.X() += nOuterBorder;
- aElementPos.Y() += nOuterBorder;
+ aElementPos.X() += m_nOuterBorder;
+ aElementPos.Y() += m_nOuterBorder;
// position managed windows
for( size_t i = 0; i < nElements; i++ )
@@ -481,27 +387,27 @@ void RowOrColumn::resize()
{
m_aElements[i].setPosSize( aElementPos, aElementSizes[i] );
if( m_bColumn )
- aElementPos.Y() += nDistance + aElementSizes[i].Height();
+ aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height();
else
- aElementPos.X() += nDistance + aElementSizes[i].Width();
+ aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width();
}
}
}
-size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex )
+size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, 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, i_rMinSize ) );
+ m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
}
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, i_rMinSize ) );
+ m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
}
return nIndex;
}
@@ -574,14 +480,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const
if( m_nLabelColumnWidth != 0 )
aRet.Width() = m_nLabelColumnWidth;
else
- aRet.Width() += getBorderValue( m_nDistance );
+ aRet.Width() += 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 * getBorderValue( m_nOuterBorder );
+ aRet.Height() += 2*m_nOuterBorder;
return aRet;
}
@@ -590,26 +496,24 @@ void LabeledElement::resize()
{
Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) );
- long nDistance = getBorderValue( m_nDistance );
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
+ if( m_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*nOuterBorder - aLabelSize.Height()) / 2;
+ long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2;
Point aPos( m_aManagedArea.Left(),
- m_aManagedArea.Top() + nOuterBorder + nYOff );
+ m_aManagedArea.Top() + m_nOuterBorder + nYOff );
Size aSize( aLabelSize );
if( m_nLabelColumnWidth != 0 )
aSize.Width() = m_nLabelColumnWidth;
m_aLabel.setPosSize( aPos, aSize );
-
- aPos.X() += aSize.Width() + nDistance;
- nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2;
- aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff;
+
+ aPos.X() += aSize.Width() + m_nDistance;
+ nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2;
+ aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff;
aSize.Width() = aElementSize.Width();
- aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder;
-
+ aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder;
+
// label style
// 0: position left and right
// 1: keep the element close to label and grow it
@@ -675,24 +579,20 @@ 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 + getBorderValue( getBorderWidth() );
+ return nWidth + getBorderWidth();
}
Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
{
long nWidth = getLabelWidth();
- long nOuterBorder = getBorderValue( m_nOuterBorder );
Size aColumnSize;
-
+
// every child is a LabeledElement
size_t nEle = countElements();
for( size_t i = 0; i < nEle; i++ )
@@ -723,19 +623,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
}
if( aElementSize.Width() )
{
- aElementSize.Width() += 2*nOuterBorder;
+ aElementSize.Width() += 2*m_nOuterBorder;
if( aElementSize.Width() > aColumnSize.Width() )
aColumnSize.Width() = aElementSize.Width();
}
if( aElementSize.Height() )
{
- aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height();
+ aColumnSize.Height() += getBorderWidth() + aElementSize.Height();
}
}
if( nEle > 0 && aColumnSize.Height() )
{
- aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element
- aColumnSize.Height() += 2*nOuterBorder;
+ aColumnSize.Height() -= getBorderWidth(); // for the first element
+ aColumnSize.Height() += 2*m_nOuterBorder;
}
return aColumnSize;
}
@@ -768,13 +668,12 @@ 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, const Size& i_rElementMinSize )
+size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent )
{
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;
@@ -792,23 +691,19 @@ Indenter::~Indenter()
Size Indenter::getOptimalSize( WindowSizeType i_eType ) const
{
Size aSize( m_aElement.getOptimalSize( i_eType ) );
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- long nIndent = getBorderValue( m_nIndent );
- aSize.Width() += 2*nOuterBorder + nIndent;
- aSize.Height() += 2*nOuterBorder;
+ aSize.Width() += 2*m_nOuterBorder + m_nIndent;
+ aSize.Height() += 2*m_nOuterBorder;
return aSize;
}
void Indenter::resize()
{
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- long nIndent = getBorderValue( m_nIndent );
Point aPt( m_aManagedArea.TopLeft() );
- aPt.X() += nOuterBorder + nIndent;
- aPt.Y() += nOuterBorder;
+ aPt.X() += m_nOuterBorder + m_nIndent;
+ aPt.Y() += m_nOuterBorder;
Size aSz( m_aManagedArea.GetSize() );
- aSz.Width() -= 2*nOuterBorder + nIndent;
- aSz.Height() -= 2*nOuterBorder;
+ aSz.Width() -= 2*m_nOuterBorder + m_nIndent;
+ aSz.Height() -= 2*m_nOuterBorder;
m_aElement.setPosSize( aPt, aSz );
}
@@ -834,14 +729,10 @@ MatrixArranger::~MatrixArranger()
{
}
-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 MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const
{
- long nOuterBorder = getBorderValue( m_nOuterBorder );
- Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder );
-
+ Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
+
// first find out the current number of rows and columns
sal_uInt32 nRows = 0, nColumns = 0;
for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin();
@@ -852,13 +743,11 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
if( it->m_nY >= nRows )
nRows = it->m_nY+1;
}
-
+
// 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();
it != m_aElements.end(); ++it )
@@ -868,120 +757,61 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
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] + nDistanceX;
+ aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX;
if( nColumns > 0 )
- aMatrixSize.Width() -= nDistanceX;
-
+ aMatrixSize.Width() -= m_nBorderX;
+
for( sal_uInt32 i = 0; i < nRows; i++ )
- aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY;
+ aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY;
if( nRows > 0 )
- aMatrixSize.Height() -= nDistanceY;
-
+ aMatrixSize.Height() -= m_nBorderY;
+
return aMatrixSize;
}
Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const
{
std::vector<long> 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;
- }
- }
+ return getOptimalSize( i_eType, aColumnWidths, aRowHeights );
}
-
void MatrixArranger::resize()
{
// assure that we have at least one row and column
if( m_aElements.empty() )
return;
-
+
// check if we can get optimal size, else fallback to minimal size
std::vector<long> aColumnWidths, aRowHeights;
- std::vector<sal_Int32> aColumnPrio, aRowPrio;
- Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) );
+ Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) );
if( aOptSize.Height() > m_aManagedArea.GetHeight() ||
aOptSize.Width() > m_aManagedArea.GetWidth() )
{
std::vector<long> aMinColumnWidths, aMinRowHeights;
- getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio );
+ getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights );
if( aOptSize.Height() > m_aManagedArea.GetHeight() )
aRowHeights = aMinRowHeights;
if( aOptSize.Width() > m_aManagedArea.GetWidth() )
aColumnWidths = aMinColumnWidths;
}
-
- // 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 );
-
+
+ // FIXME: distribute extra space available
+
// 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() + nOuterBorder;
+ aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder;
for( size_t i = 1; i < aColumnX.size(); i++ )
- aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX;
-
+ aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX;
+
std::vector<long> aRowY( aRowHeights.size() );
- aRowY[0] = m_aManagedArea.Top() + nOuterBorder;
+ aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder;
for( size_t i = 1; i < aRowY.size(); i++ )
- aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY;
-
+ aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY;
+
// now iterate over the elements and assign their positions
for( std::vector< MatrixElement >::iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
@@ -992,7 +822,7 @@ void MatrixArranger::resize()
}
}
-size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize )
+size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio )
{
sal_uInt64 nMapValue = getMap( i_nX, i_nY );
std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue );
@@ -1000,7 +830,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, i_rMinSize ) );
+ m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
}
else
{
@@ -1008,7 +838,6 @@ 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 a71aadc3cdad..1e3c99b3bce2 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
-static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool bPinIn, Image& rImage )
+static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage )
{
// ImageListe laden, wenn noch nicht vorhanden
ImplSVData* pSVData = ImplGetSVData();
@@ -71,7 +71,7 @@ static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool bPinIn, Image& rImage )
}
// Image ermitteln und zurueckgeben
- sal_uInt16 nId;
+ USHORT nId;
if ( nStyle & BUTTON_DRAW_PRESSED )
{
if ( bPinIn )
@@ -103,10 +103,10 @@ void Window::ImplCalcSymbolRect( Rectangle& rRect )
// Zwischen dem Symbol und dem Button-Rand lassen wir 5% Platz
long nExtraWidth = ((rRect.GetWidth()*50)+500)/1000;
long nExtraHeight = ((rRect.GetHeight()*50)+500)/1000;
- rRect.Left() += nExtraWidth;
- rRect.Right() -= nExtraWidth;
- rRect.Top() += nExtraHeight;
- rRect.Bottom() -= nExtraHeight;
+ rRect.Left() += nExtraWidth;
+ rRect.Right() -= nExtraWidth;
+ rRect.Top() += nExtraHeight;
+ rRect.Bottom() -= nExtraHeight;
}
// -----------------------------------------------------------------------
@@ -115,8 +115,8 @@ static void ImplDrawBrdWinSymbol( OutputDevice* pDev,
const Rectangle& rRect, SymbolType eSymbol )
{
// Zwischen dem Symbol und dem Button lassen wir 5% Platz
- DecorationView aDecoView( pDev );
- Rectangle aTempRect = rRect;
+ DecorationView aDecoView( pDev );
+ Rectangle aTempRect = rRect;
Window::ImplCalcSymbolRect( aTempRect );
aDecoView.DrawSymbol( aTempRect, eSymbol,
pDev->GetSettings().GetStyleSettings().GetButtonTextColor(), 0 );
@@ -126,9 +126,9 @@ static void ImplDrawBrdWinSymbol( OutputDevice* pDev,
static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
const Rectangle& rRect,
- SymbolType eSymbol, sal_uInt16 nState )
+ SymbolType eSymbol, USHORT nState )
{
- sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
+ 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) ? sal_True : sal_False,
- sal_True, sal_False );
+ pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? TRUE : FALSE,
+ TRUE, FALSE );
}
aTempRect = rRect;
aTempRect.nLeft+=3;
@@ -171,23 +171,23 @@ ImplBorderWindowView::~ImplBorderWindowView()
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::MouseMove( const MouseEvent& )
+BOOL ImplBorderWindowView::MouseMove( const MouseEvent& )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
+BOOL ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::Tracking( const TrackingEvent& )
+BOOL ImplBorderWindowView::Tracking( const TrackingEvent& )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -213,7 +213,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) ||
(pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
{
- pData->mnTitleType = BORDERWINDOW_TITLE_NONE;
+ pData->mnTitleType = BORDERWINDOW_TITLE_NONE;
pData->mnTitleHeight = 0;
}
else
@@ -242,7 +242,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
// -----------------------------------------------------------------------
-sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
+USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -321,15 +321,15 @@ sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
- sal_uInt16 oldCloseState = pData->mnCloseState;
- sal_uInt16 oldMenuState = pData->mnMenuState;
+ USHORT oldCloseState = pData->mnCloseState;
+ USHORT oldMenuState = pData->mnMenuState;
pData->mnCloseState &= ~BUTTON_DRAW_HIGHLIGHT;
pData->mnMenuState &= ~BUTTON_DRAW_HIGHLIGHT;
Point aMousePos = rMEvt.GetPosPixel();
- sal_uInt16 nHitTest = ImplHitTest( pData, aMousePos );
+ USHORT nHitTest = ImplHitTest( pData, aMousePos );
PointerStyle ePtrStyle = POINTER_ARROW;
if ( nHitTest & BORDERWINDOW_HITTEST_LEFT )
ePtrStyle = POINTER_WINDOW_WSIZE;
@@ -358,12 +358,12 @@ sal_Bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const
if( pData->mnMenuState != oldMenuState )
pData->mpBorderWindow->Invalidate( pData->maMenuRect );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -371,11 +371,11 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData,
{
pData->maMouseOff = rMEvt.GetPosPixel();
pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff );
- sal_uInt16 nDragFullTest = 0;
+ USHORT nDragFullTest = 0;
if ( pData->mnHitTest )
{
- sal_Bool bTracking = sal_True;
- sal_Bool bHitTest = sal_True;
+ BOOL bTracking = TRUE;
+ BOOL bHitTest = TRUE;
if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
{
@@ -425,10 +425,10 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData,
{
if ( bTracking )
{
- Point aPos = pBorderWindow->GetPosPixel();
- Size aSize = pBorderWindow->GetOutputSizePixel();
- pData->mnTrackX = aPos.X();
- pData->mnTrackY = aPos.Y();
+ Point aPos = pBorderWindow->GetPosPixel();
+ Size aSize = pBorderWindow->GetOutputSizePixel();
+ pData->mnTrackX = aPos.X();
+ pData->mnTrackY = aPos.Y();
pData->mnTrackWidth = aSize.Width();
pData->mnTrackHeight = aSize.Height();
@@ -440,18 +440,18 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData,
}
else
{
- bTracking = sal_False;
+ bTracking = FALSE;
if ( (pData->mnHitTest & BORDERWINDOW_DRAW_TITLE) &&
((rMEvt.GetClicks() % 2) == 0) )
{
pData->mnHitTest = 0;
- bHitTest = sal_False;
+ bHitTest = FALSE;
if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
{
SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow());
- if ( sal_True /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required
+ if ( 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 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData,
if ( bTracking )
{
- pData->mbDragFull = sal_False;
+ pData->mbDragFull = FALSE;
if ( nDragFullTest )
- pData->mbDragFull = sal_True; // always fulldrag for proper docking, ignore system settings
+ pData->mbDragFull = TRUE; // always fulldrag for proper docking, ignore system settings
pBorderWindow->StartTracking();
}
else if ( bHitTest )
@@ -478,18 +478,18 @@ sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData,
}
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
+BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
if ( rTEvt.IsTrackingEnded() )
{
- sal_uInt16 nHitTest = pData->mnHitTest;
+ USHORT nHitTest = pData->mnHitTest;
pData->mnHitTest = 0;
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
@@ -781,8 +781,8 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
{
/*
// adjusting mousepos not required, we allow the whole screen (no desktop anymore...)
- Point aFrameMousePos = pBorderWindow->ImplOutputToFrame( aMousePos );
- Size aFrameSize = pBorderWindow->ImplGetFrameWindow()->GetOutputSizePixel();
+ Point aFrameMousePos = pBorderWindow->ImplOutputToFrame( aMousePos );
+ Size aFrameSize = pBorderWindow->ImplGetFrameWindow()->GetOutputSizePixel();
if ( aFrameMousePos.X() < 0 )
aFrameMousePos.X() = 0;
if ( aFrameMousePos.Y() < 0 )
@@ -794,8 +794,8 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
aMousePos = pBorderWindow->ImplFrameToOutput( aFrameMousePos );
*/
- aMousePos.X() -= pData->maMouseOff.X();
- aMousePos.Y() -= pData->maMouseOff.Y();
+ aMousePos.X() -= pData->maMouseOff.X();
+ aMousePos.Y() -= pData->maMouseOff.Y();
if ( pData->mnHitTest & BORDERWINDOW_HITTEST_TITLE )
{
@@ -819,18 +819,18 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
}
else
{
- Point aOldPos = pBorderWindow->GetPosPixel();
- Size aSize = pBorderWindow->GetSizePixel();
- Rectangle aNewRect( aOldPos, aSize );
- long nOldWidth = aSize.Width();
- long nOldHeight = aSize.Height();
- long nBorderWidth = pData->mnLeftBorder+pData->mnRightBorder;
- long nBorderHeight = pData->mnTopBorder+pData->mnBottomBorder;
- long nMinWidth = pBorderWindow->mnMinWidth+nBorderWidth;
- long nMinHeight = pBorderWindow->mnMinHeight+nBorderHeight;
- long nMinWidth2 = nBorderWidth;
- long nMaxWidth = pBorderWindow->mnMaxWidth+nBorderWidth;
- long nMaxHeight = pBorderWindow->mnMaxHeight+nBorderHeight;
+ Point aOldPos = pBorderWindow->GetPosPixel();
+ Size aSize = pBorderWindow->GetSizePixel();
+ Rectangle aNewRect( aOldPos, aSize );
+ long nOldWidth = aSize.Width();
+ long nOldHeight = aSize.Height();
+ long nBorderWidth = pData->mnLeftBorder+pData->mnRightBorder;
+ long nBorderHeight = pData->mnTopBorder+pData->mnBottomBorder;
+ long nMinWidth = pBorderWindow->mnMinWidth+nBorderWidth;
+ long nMinHeight = pBorderWindow->mnMinHeight+nBorderHeight;
+ long nMinWidth2 = nBorderWidth;
+ long nMaxWidth = pBorderWindow->mnMaxWidth+nBorderWidth;
+ long nMaxHeight = pBorderWindow->mnMaxHeight+nBorderHeight;
if ( pData->mnTitleHeight )
{
@@ -879,11 +879,11 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
{
// adjust size for Resizing-call
aSize = aNewRect.GetSize();
- aSize.Width() -= nBorderWidth;
- aSize.Height() -= nBorderHeight;
+ aSize.Width() -= nBorderWidth;
+ aSize.Height() -= nBorderHeight;
((SystemWindow*)pBorderWindow->ImplGetClientWindow())->Resizing( aSize );
- aSize.Width() += nBorderWidth;
- aSize.Height() += nBorderHeight;
+ aSize.Width() += nBorderWidth;
+ aSize.Height() += nBorderHeight;
if ( aSize.Width() < nMinWidth )
aSize.Width() = nMinWidth;
if ( aSize.Height() < nMinHeight )
@@ -921,8 +921,8 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
}
else
{
- pData->mnTrackX = aNewRect.Left();
- pData->mnTrackY = aNewRect.Top();
+ pData->mnTrackX = aNewRect.Left();
+ pData->mnTrackY = aNewRect.Top();
pData->mnTrackWidth = aNewRect.GetWidth();
pData->mnTrackHeight = aNewRect.GetHeight();
pBorderWindow->ShowTracking( Rectangle( pBorderWindow->ScreenToOutputPixel( aNewRect.TopLeft() ), aNewRect.GetSize() ), SHOWTRACK_BIG );
@@ -931,7 +931,7 @@ sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const T
}
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -940,15 +940,15 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
const Point& rPos,
Rectangle& rHelpRect )
{
- sal_uInt16 nHelpId = 0;
+ USHORT nHelpId = 0;
String aHelpStr;
- sal_uInt16 nHitTest = ImplHitTest( pData, rPos );
+ USHORT nHitTest = ImplHitTest( pData, rPos );
if ( nHitTest )
{
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
{
- nHelpId = SV_HELPTEXT_CLOSE;
- rHelpRect = pData->maCloseRect;
+ nHelpId = SV_HELPTEXT_CLOSE;
+ rHelpRect = pData->maCloseRect;
}
else if ( nHitTest & BORDERWINDOW_HITTEST_ROLL )
{
@@ -956,33 +956,33 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
nHelpId = SV_HELPTEXT_ROLLDOWN;
else
nHelpId = SV_HELPTEXT_ROLLUP;
- rHelpRect = pData->maRollRect;
+ rHelpRect = pData->maRollRect;
}
else if ( nHitTest & BORDERWINDOW_HITTEST_DOCK )
{
- nHelpId = SV_HELPTEXT_MAXIMIZE;
- rHelpRect = pData->maDockRect;
+ nHelpId = SV_HELPTEXT_MAXIMIZE;
+ rHelpRect = pData->maDockRect;
}
/* no help string available
else if ( nHitTest & BORDERWINDOW_HITTEST_MENU )
{
- nHelpId = SV_HELPTEXT_MENU;
- rHelpRect = pData->maMenuRect;
+ nHelpId = SV_HELPTEXT_MENU;
+ rHelpRect = pData->maMenuRect;
}*/
else if ( nHitTest & BORDERWINDOW_HITTEST_HIDE )
{
- nHelpId = SV_HELPTEXT_MINIMIZE;
- rHelpRect = pData->maHideRect;
+ nHelpId = SV_HELPTEXT_MINIMIZE;
+ rHelpRect = pData->maHideRect;
}
else if ( nHitTest & BORDERWINDOW_HITTEST_HELP )
{
- nHelpId = SV_HELPTEXT_HELP;
- rHelpRect = pData->maHelpRect;
+ nHelpId = SV_HELPTEXT_HELP;
+ rHelpRect = pData->maHelpRect;
}
else if ( nHitTest & BORDERWINDOW_HITTEST_PIN )
{
- nHelpId = SV_HELPTEXT_ALWAYSVISIBLE;
- rHelpRect = pData->maPinRect;
+ nHelpId = SV_HELPTEXT_ALWAYSVISIBLE;
+ rHelpRect = pData->maPinRect;
}
else if ( nHitTest & BORDERWINDOW_HITTEST_TITLE )
{
@@ -991,7 +991,7 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
// tooltip only if title truncated
if( pData->mbTitleClipped )
{
- rHelpRect = pData->maTitleRect;
+ rHelpRect = pData->maTitleRect;
// no help id, use window title as help string
aHelpStr = pData->mpBorderWindow->GetText();
}
@@ -1047,10 +1047,10 @@ void ImplNoBorderWindowView::Init( OutputDevice*, long, long )
void ImplNoBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
{
- rLeftBorder = 0;
- rTopBorder = 0;
- rRightBorder = 0;
- rBottomBorder = 0;
+ rLeftBorder = 0;
+ rTopBorder = 0;
+ rRightBorder = 0;
+ rBottomBorder = 0;
}
// -----------------------------------------------------------------------
@@ -1062,7 +1062,7 @@ long ImplNoBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplNoBorderWindowView::DrawWindow( sal_uInt16, OutputDevice*, const Point* )
+void ImplNoBorderWindowView::DrawWindow( USHORT, OutputDevice*, const Point* )
{
}
@@ -1083,18 +1083,18 @@ ImplSmallBorderWindowView::ImplSmallBorderWindowView( ImplBorderWindow* pBorderW
void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeight )
{
- mpOutDev = pDev;
- mnWidth = nWidth;
- mnHeight = nHeight;
+ mpOutDev = pDev;
+ mnWidth = nWidth;
+ mnHeight = nHeight;
mbNWFBorder = false;
- sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
+ USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
{
- mnLeftBorder = 0;
- mnTopBorder = 0;
- mnRightBorder = 0;
- mnBottomBorder = 0;
+ mnLeftBorder = 0;
+ mnTopBorder = 0;
+ mnRightBorder = 0;
+ mnBottomBorder = 0;
}
else
{
@@ -1107,7 +1107,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
Window *pWin = NULL, *pCtrl = NULL;
if( mpOutDev->GetOutDevType() == OUTDEV_WINDOW )
pWin = (Window*) mpOutDev;
-
+
ControlType aCtrlType = 0;
if( pWin && (pCtrl = mpBorderWindow->GetWindow( WINDOW_CLIENT )) != NULL )
{
@@ -1163,18 +1163,18 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mnBottomBorder = aBounds.Bottom() - aContent.Bottom();
if( mnWidth && mnHeight )
{
-
- mpBorderWindow->SetPaintTransparent( sal_True );
+
+ mpBorderWindow->SetPaintTransparent( TRUE );
mpBorderWindow->SetBackground();
- pCtrl->SetPaintTransparent( sal_True );
-
+ pCtrl->SetPaintTransparent( TRUE );
+
Window* pCompoundParent = NULL;
if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() )
pCompoundParent = pWin->GetParent();
-
+
if( pCompoundParent )
- pCompoundParent->SetPaintTransparent( sal_True );
-
+ pCompoundParent->SetPaintTransparent( TRUE );
+
if( mnWidth < aBounds.GetWidth() || mnHeight < aBounds.GetHeight() )
{
if( ! pCompoundParent ) // compound controls have to fix themselves
@@ -1193,10 +1193,10 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mbNWFBorder = false;
}
}
-
+
if( ! mbNWFBorder )
{
- sal_uInt16 nStyle = FRAME_DRAW_NODRAW;
+ USHORT 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 )
@@ -1205,14 +1205,14 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
nStyle |= FRAME_DRAW_DOUBLEIN;
if ( nBorderStyle & WINDOW_BORDER_MONO )
nStyle |= FRAME_DRAW_MONO;
-
- DecorationView aDecoView( mpOutDev );
- Rectangle aRect( 0, 0, 10, 10 );
- Rectangle aCalcRect = aDecoView.DrawFrame( aRect, nStyle );
- mnLeftBorder = aCalcRect.Left();
- mnTopBorder = aCalcRect.Top();
- mnRightBorder = aRect.Right()-aCalcRect.Right();
- mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
+
+ DecorationView aDecoView( mpOutDev );
+ Rectangle aRect( 0, 0, 10, 10 );
+ Rectangle aCalcRect = aDecoView.DrawFrame( aRect, nStyle );
+ mnLeftBorder = aCalcRect.Left();
+ mnTopBorder = aCalcRect.Top();
+ mnRightBorder = aRect.Right()-aCalcRect.Right();
+ mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
}
}
}
@@ -1222,10 +1222,10 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
void ImplSmallBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
{
- rLeftBorder = mnLeftBorder;
- rTopBorder = mnTopBorder;
- rRightBorder = mnRightBorder;
- rBottomBorder = mnBottomBorder;
+ rLeftBorder = mnLeftBorder;
+ rTopBorder = mnTopBorder;
+ rRightBorder = mnRightBorder;
+ rBottomBorder = mnBottomBorder;
}
// -----------------------------------------------------------------------
@@ -1237,13 +1237,13 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*, const Point* )
+void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, const Point* )
{
- sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
+ USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
return;
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
// for native widget drawing we must find out what
// control this border belongs to
Window *pWin = NULL, *pCtrl = NULL;
@@ -1291,12 +1291,12 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
break;
case WINDOW_COMBOBOX:
- case WINDOW_PATTERNBOX:
- case WINDOW_NUMERICBOX:
- case WINDOW_METRICBOX:
+ case WINDOW_PATTERNBOX:
+ case WINDOW_NUMERICBOX:
+ case WINDOW_METRICBOX:
case WINDOW_CURRENCYBOX:
- case WINDOW_DATEBOX:
- case WINDOW_TIMEBOX:
+ case WINDOW_DATEBOX:
+ case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
if( pCtrl->GetStyle() & WB_DROPDOWN )
{
@@ -1314,7 +1314,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
break;
}
}
-
+
if ( aCtrlType && pCtrl->IsNativeControlSupported(aCtrlType, aCtrlPart) )
{
ImplControlValue aControlValue;
@@ -1333,18 +1333,18 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
if( pCtrl->HasFocus() || pCtrl->HasChildPathFocus() )
nState |= CTRL_STATE_FOCUSED;
}
-
- sal_Bool bMouseOver = sal_False;
+
+ BOOL bMouseOver = FALSE;
Window *pCtrlChild = pCtrl->GetWindow( WINDOW_FIRSTCHILD );
- while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == sal_False )
+ while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == FALSE )
pCtrlChild = pCtrlChild->GetWindow( WINDOW_NEXT );
-
+
if( bMouseOver )
nState |= CTRL_STATE_ROLLOVER;
Point aPoint;
Rectangle aCtrlRegion( aPoint, Size( mnWidth, mnHeight ) );
-
+
Rectangle aBoundingRgn( aPoint, Size( mnWidth, mnHeight ) );
Rectangle aContentRgn( aCtrlRegion );
if( ! ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize &&
@@ -1354,7 +1354,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
{
aCtrlRegion=aContentRgn;
}
-
+
bNativeOK = pWin->DrawNativeControl( aCtrlType, aCtrlPart, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
@@ -1385,7 +1385,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
}
else
{
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
@@ -1398,11 +1398,11 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
nStyle |= FRAME_DRAW_MENU;
// tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
if( pWin && pWin == pWin->ImplGetFrameWindow() )
- nStyle |= FRAME_DRAW_WINDOWBORDER;
+ nStyle |= FRAME_DRAW_WINDOWBORDER;
- DecorationView aDecoView( mpOutDev );
- Point aTmpPoint;
- Rectangle aInRect( aTmpPoint, Size( mnWidth, mnHeight ) );
+ DecorationView aDecoView( mpOutDev );
+ Point aTmpPoint;
+ Rectangle aInRect( aTmpPoint, Size( mnWidth, mnHeight ) );
aDecoView.DrawFrame( aInRect, nStyle );
}
}
@@ -1416,20 +1416,20 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow )
{
- maFrameData.mpBorderWindow = pBorderWindow;
- maFrameData.mbDragFull = sal_False;
- maFrameData.mnHitTest = 0;
- maFrameData.mnPinState = 0;
- maFrameData.mnCloseState = 0;
- maFrameData.mnRollState = 0;
- maFrameData.mnDockState = 0;
- maFrameData.mnMenuState = 0;
- maFrameData.mnHideState = 0;
- maFrameData.mnHelpState = 0;
- maFrameData.mbTitleClipped = 0;
+ maFrameData.mpBorderWindow = pBorderWindow;
+ maFrameData.mbDragFull = FALSE;
+ maFrameData.mnHitTest = 0;
+ maFrameData.mnPinState = 0;
+ maFrameData.mnCloseState = 0;
+ maFrameData.mnRollState = 0;
+ maFrameData.mnDockState = 0;
+ maFrameData.mnMenuState = 0;
+ maFrameData.mnHideState = 0;
+ maFrameData.mnHelpState = 0;
+ maFrameData.mbTitleClipped = 0;
- mpATitleVirDev = NULL;
- mpDTitleVirDev = NULL;
+ mpATitleVirDev = NULL;
+ mpDTitleVirDev = NULL;
}
// -----------------------------------------------------------------------
@@ -1444,21 +1444,21 @@ ImplStdBorderWindowView::~ImplStdBorderWindowView()
// -----------------------------------------------------------------------
-sal_Bool ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
+BOOL ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
{
return ImplMouseMove( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-sal_Bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
+BOOL ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
{
return ImplMouseButtonDown( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-sal_Bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
+BOOL ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
{
return ImplTracking( &maFrameData, rTEvt );
}
@@ -1481,19 +1481,19 @@ Rectangle ImplStdBorderWindowView::GetMenuRect() const
void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeight )
{
- ImplBorderFrameData* pData = &maFrameData;
- ImplBorderWindow* pBorderWindow = maFrameData.mpBorderWindow;
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
- DecorationView aDecoView( pDev );
- Rectangle aRect( 0, 0, 10, 10 );
- Rectangle aCalcRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW );
+ ImplBorderFrameData* pData = &maFrameData;
+ ImplBorderWindow* pBorderWindow = maFrameData.mpBorderWindow;
+ const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
+ DecorationView aDecoView( pDev );
+ Rectangle aRect( 0, 0, 10, 10 );
+ Rectangle aCalcRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW );
- pData->mpOutDev = pDev;
- pData->mnWidth = nWidth;
- pData->mnHeight = nHeight;
+ pData->mpOutDev = pDev;
+ pData->mnWidth = nWidth;
+ pData->mnHeight = nHeight;
- pData->mnTitleType = pBorderWindow->mnTitleType;
- pData->mbFloatWindow = pBorderWindow->mbFloatWindow;
+ pData->mnTitleType = pBorderWindow->mnTitleType;
+ pData->mbFloatWindow = pBorderWindow->mbFloatWindow;
if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
pData->mnBorderSize = 0;
@@ -1501,15 +1501,15 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
pData->mnBorderSize = 0;
else
pData->mnBorderSize = rStyleSettings.GetBorderSize();
- pData->mnLeftBorder = aCalcRect.Left();
- pData->mnTopBorder = aCalcRect.Top();
- pData->mnRightBorder = aRect.Right()-aCalcRect.Right();
- pData->mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
+ pData->mnLeftBorder = aCalcRect.Left();
+ pData->mnTopBorder = aCalcRect.Top();
+ pData->mnRightBorder = aRect.Right()-aCalcRect.Right();
+ pData->mnBottomBorder = aRect.Bottom()-aCalcRect.Bottom();
pData->mnLeftBorder += pData->mnBorderSize;
- pData->mnTopBorder += pData->mnBorderSize;
+ pData->mnTopBorder += pData->mnBorderSize;
pData->mnRightBorder += pData->mnBorderSize;
pData->mnBottomBorder += pData->mnBorderSize;
- pData->mnNoTitleTop = pData->mnTopBorder;
+ pData->mnNoTitleTop = pData->mnTopBorder;
ImplInitTitle( &maFrameData );
if ( pData->mnTitleHeight )
@@ -1522,27 +1522,27 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
// highlighted buttons in the title
pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() );
- pData->maTitleRect.Left() = pData->mnLeftBorder;
- pData->maTitleRect.Right() = nWidth-pData->mnRightBorder-1;
- pData->maTitleRect.Top() = pData->mnTopBorder;
+ pData->maTitleRect.Left() = pData->mnLeftBorder;
+ pData->maTitleRect.Right() = nWidth-pData->mnRightBorder-1;
+ pData->maTitleRect.Top() = pData->mnTopBorder;
pData->maTitleRect.Bottom() = pData->maTitleRect.Top()+pData->mnTitleHeight-1;
if ( pData->mnTitleType & (BORDERWINDOW_TITLE_NORMAL | BORDERWINDOW_TITLE_SMALL) )
{
- long nLeft = pData->maTitleRect.Left();
- long nRight = pData->maTitleRect.Right();
- long nItemTop = pData->maTitleRect.Top();
- long nItemBottom = pData->maTitleRect.Bottom();
- nLeft += 1;
- nRight -= 3;
- nItemTop += 2;
- nItemBottom -= 2;
+ long nLeft = pData->maTitleRect.Left();
+ long nRight = pData->maTitleRect.Right();
+ long nItemTop = pData->maTitleRect.Top();
+ long nItemBottom = pData->maTitleRect.Bottom();
+ nLeft += 1;
+ nRight -= 3;
+ nItemTop += 2;
+ nItemBottom -= 2;
if ( pBorderWindow->GetStyle() & WB_PINABLE )
{
Image aImage;
ImplGetPinImage( 0, 0, aImage );
- pData->maPinRect.Top() = nItemTop;
+ pData->maPinRect.Top() = nItemTop;
pData->maPinRect.Bottom() = nItemBottom;
pData->maPinRect.Left() = nLeft;
pData->maPinRect.Right() = pData->maPinRect.Left()+aImage.GetSizePixel().Width();
@@ -1551,10 +1551,10 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
if ( pBorderWindow->GetStyle() & WB_CLOSEABLE )
{
- pData->maCloseRect.Top() = nItemTop;
+ pData->maCloseRect.Top() = nItemTop;
pData->maCloseRect.Bottom() = nItemBottom;
- pData->maCloseRect.Right() = nRight;
- pData->maCloseRect.Left() = pData->maCloseRect.Right()-pData->maCloseRect.GetHeight()+1;
+ pData->maCloseRect.Right() = nRight;
+ pData->maCloseRect.Left() = pData->maCloseRect.Right()-pData->maCloseRect.GetHeight()+1;
nRight -= pData->maCloseRect.GetWidth()+3;
}
@@ -1619,7 +1619,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
pData->maHelpRect.SetEmpty();
}
- pData->mnTopBorder += pData->mnTitleHeight;
+ pData->mnTopBorder += pData->mnTitleHeight;
}
else
{
@@ -1639,10 +1639,10 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
void ImplStdBorderWindowView::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
{
- rLeftBorder = maFrameData.mnLeftBorder;
- rTopBorder = maFrameData.mnTopBorder;
- rRightBorder = maFrameData.mnRightBorder;
- rBottomBorder = maFrameData.mnBottomBorder;
+ rLeftBorder = maFrameData.mnLeftBorder;
+ rTopBorder = maFrameData.mnTopBorder;
+ rRightBorder = maFrameData.mnRightBorder;
+ rBottomBorder = maFrameData.mnBottomBorder;
}
// -----------------------------------------------------------------------
@@ -1654,19 +1654,19 @@ long ImplStdBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
+void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
{
- ImplBorderFrameData* pData = &maFrameData;
- OutputDevice* pDev = pOutDev ? pOutDev : pData->mpOutDev;
- ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
- Point aTmpPoint = pOffset ? Point(*pOffset) : Point();
- Rectangle aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) );
- const StyleSettings& rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings();
- DecorationView aDecoView( pDev );
+ ImplBorderFrameData* pData = &maFrameData;
+ OutputDevice* pDev = pOutDev ? pOutDev : pData->mpOutDev;
+ ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
+ Point aTmpPoint = pOffset ? Point(*pOffset) : Point();
+ Rectangle aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) );
+ const StyleSettings& rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings();
+ DecorationView aDecoView( pDev );
Color aFaceColor( rStyleSettings.GetFaceColor() );
Color aFrameColor( aFaceColor );
- aFrameColor.DecreaseContrast( (sal_uInt8) (0.50 * 255));
+ aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255));
// Draw Frame
if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
@@ -1740,7 +1740,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
if ( pData->mnTitleType != BORDERWINDOW_TITLE_TEAROFF )
{
- aInRect.Left() += 2;
+ aInRect.Left() += 2;
aInRect.Right() -= 2;
if ( !pData->maPinRect.IsEmpty() )
@@ -1762,7 +1762,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
if ( pOffset )
aInRect.Move( pOffset->X(), pOffset->Y() );
- sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
+ USHORT 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( sal_uInt16 nDrawFlags, OutputDevice* p
// =======================================================================
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ WinBits nStyle, USHORT nTypeStyle,
const ::com::sun::star::uno::Any& )
{
ImplInit( pParent, nStyle, nTypeStyle, NULL );
}
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ WinBits nStyle, USHORT nTypeStyle,
SystemParentData* pSystemParentData
)
{
@@ -1870,70 +1870,70 @@ void ImplBorderWindow::ImplInit( Window* pParent,
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
- mpWindowImpl->mbBorderWin = sal_True;
- mbSmallOutBorder = sal_False;
+ mpWindowImpl->mbBorderWin = TRUE;
+ mbSmallOutBorder = FALSE;
if ( nTypeStyle & BORDERWINDOW_STYLE_FRAME )
{
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
- mpWindowImpl->mbOverlapWin = sal_True;
- mpWindowImpl->mbFrame = sal_True;
- mbFrameBorder = sal_False;
+ mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = TRUE;
+ mbFrameBorder = FALSE;
}
else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
{
- mpWindowImpl->mbOverlapWin = sal_True;
- mpWindowImpl->mbFrame = sal_True;
- mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? sal_False : sal_True;
+ mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = TRUE;
+ mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? FALSE : TRUE;
}
else
{
- mpWindowImpl->mbOverlapWin = sal_True;
- mpWindowImpl->mbFrame = sal_True;
- mbFrameBorder = sal_False;
+ mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = TRUE;
+ mbFrameBorder = 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 = sal_True;
+ mbSmallOutBorder = TRUE;
}
}
else if ( nTypeStyle & BORDERWINDOW_STYLE_OVERLAP )
{
- mpWindowImpl->mbOverlapWin = sal_True;
- mbFrameBorder = sal_True;
+ mpWindowImpl->mbOverlapWin = TRUE;
+ mbFrameBorder = TRUE;
}
else
- mbFrameBorder = sal_False;
+ mbFrameBorder = FALSE;
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
- mbFloatWindow = sal_True;
+ mbFloatWindow = TRUE;
else
- mbFloatWindow = sal_False;
+ mbFloatWindow = FALSE;
Window::ImplInit( pParent, nStyle, pSystemParentData );
SetBackground();
SetTextFillColor();
mpMenuBarWindow = NULL;
- mnMinWidth = 0;
- mnMinHeight = 0;
- mnMaxWidth = SHRT_MAX;
- mnMaxHeight = SHRT_MAX;
- mnRollHeight = 0;
+ mnMinWidth = 0;
+ mnMinHeight = 0;
+ mnMaxWidth = SHRT_MAX;
+ mnMaxHeight = SHRT_MAX;
+ mnRollHeight = 0;
mnOrgMenuHeight = 0;
- mbPined = sal_False;
- mbRollUp = sal_False;
- mbMenuHide = sal_False;
- mbDockBtn = sal_False;
- mbMenuBtn = sal_False;
- mbHideBtn = sal_False;
- mbHelpBtn = sal_False;
+ mbPined = FALSE;
+ mbRollUp = FALSE;
+ mbMenuHide = FALSE;
+ mbDockBtn = FALSE;
+ mbMenuBtn = FALSE;
+ mbHideBtn = FALSE;
+ mbHelpBtn = FALSE;
mbDisplayActive = IsActive();
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
mnTitleType = BORDERWINDOW_TITLE_SMALL;
else
mnTitleType = BORDERWINDOW_TITLE_NORMAL;
- mnBorderStyle = WINDOW_BORDER_NORMAL;
+ mnBorderStyle = WINDOW_BORDER_NORMAL;
InitView();
}
@@ -1941,8 +1941,8 @@ void ImplBorderWindow::ImplInit( Window* pParent,
ImplBorderWindow::ImplBorderWindow( Window* pParent,
SystemParentData* pSystemParentData,
- WinBits nStyle, sal_uInt16 nTypeStyle
- ) : Window( WINDOW_BORDERWINDOW )
+ WinBits nStyle, USHORT nTypeStyle
+ ) : Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
}
@@ -1950,14 +1950,14 @@ ImplBorderWindow::ImplBorderWindow( Window* pParent,
// -----------------------------------------------------------------------
ImplBorderWindow::ImplBorderWindow( Window* pParent, WinBits nStyle ,
- sal_uInt16 nTypeStyle ) :
+ USHORT nTypeStyle ) :
Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, ::com::sun::star::uno::Any() );
}
ImplBorderWindow::ImplBorderWindow( Window* pParent,
- WinBits nStyle, sal_uInt16 nTypeStyle,
+ WinBits nStyle, USHORT 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( sal_True );
+ SetDisplayActive( 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( sal_False );
+ SetDisplayActive( FALSE );
Window::Deactivate();
}
@@ -2030,8 +2030,8 @@ void ImplBorderWindow::RequestHelp( const HelpEvent& rHEvt )
// no keyboard help for border win
if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) && !rHEvt.KeyboardActivated() )
{
- Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
- Rectangle aHelpRect;
+ Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
+ Rectangle aHelpRect;
String aHelpStr( mpBorderView->RequestHelp( aMousePosPixel, aHelpRect ) );
// Rechteck ermitteln
@@ -2133,7 +2133,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
- UpdateView( sal_True, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() );
}
Window::DataChanged( rDCEvt );
@@ -2162,7 +2162,7 @@ void ImplBorderWindow::InitView()
// -----------------------------------------------------------------------
-void ImplBorderWindow::UpdateView( sal_Bool bNewView, const Size& rNewOutSize )
+void ImplBorderWindow::UpdateView( BOOL bNewView, const Size& rNewOutSize )
{
sal_Int32 nLeftBorder;
sal_Int32 nTopBorder;
@@ -2194,8 +2194,8 @@ void ImplBorderWindow::UpdateView( sal_Bool bNewView, const Size& rNewOutSize )
GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
if ( aOldSize.Width() || aOldSize.Height() )
{
- aOutputSize.Width() += nLeftBorder+nRightBorder;
- aOutputSize.Height() += nTopBorder+nBottomBorder;
+ aOutputSize.Width() += nLeftBorder+nRightBorder;
+ aOutputSize.Height() += nTopBorder+nBottomBorder;
if ( aOutputSize == GetSizePixel() )
InvalidateBorder();
else
@@ -2217,10 +2217,10 @@ void ImplBorderWindow::InvalidateBorder()
mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
if ( nLeftBorder || nTopBorder || nRightBorder || nBottomBorder )
{
- Rectangle aWinRect( Point( 0, 0 ), GetOutputSizePixel() );
- Region aRegion( aWinRect );
+ Rectangle aWinRect( Point( 0, 0 ), GetOutputSizePixel() );
+ Region aRegion( aWinRect );
aWinRect.Left() += nLeftBorder;
- aWinRect.Top() += nTopBorder;
+ aWinRect.Top() += nTopBorder;
aWinRect.Right() -= nRightBorder;
aWinRect.Bottom() -= nBottomBorder;
// kein Output-Bereich mehr, dann alles invalidieren
@@ -2238,7 +2238,7 @@ void ImplBorderWindow::InvalidateBorder()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDisplayActive( sal_Bool bActive )
+void ImplBorderWindow::SetDisplayActive( BOOL bActive )
{
if ( mbDisplayActive != bActive )
{
@@ -2250,26 +2250,26 @@ void ImplBorderWindow::SetDisplayActive( sal_Bool bActive )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetTitleType( sal_uInt16 nTitleType, const Size& rSize )
+void ImplBorderWindow::SetTitleType( USHORT nTitleType, const Size& rSize )
{
mnTitleType = nTitleType;
- UpdateView( sal_False, rSize );
+ UpdateView( FALSE, rSize );
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetBorderStyle( sal_uInt16 nStyle )
+void ImplBorderWindow::SetBorderStyle( USHORT nStyle )
{
if ( !mbFrameBorder && (mnBorderStyle != nStyle) )
{
mnBorderStyle = nStyle;
- UpdateView( sal_False, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( FALSE, ImplGetWindow()->GetOutputSizePixel() );
}
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetPin( sal_Bool bPin )
+void ImplBorderWindow::SetPin( BOOL bPin )
{
mbPined = bPin;
InvalidateBorder();
@@ -2277,11 +2277,11 @@ void ImplBorderWindow::SetPin( sal_Bool bPin )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetRollUp( sal_Bool bRollUp, const Size& rSize )
+void ImplBorderWindow::SetRollUp( BOOL bRollUp, const Size& rSize )
{
mbRollUp = bRollUp;
mnRollHeight = rSize.Height();
- UpdateView( sal_False, rSize );
+ UpdateView( FALSE, rSize );
}
// -----------------------------------------------------------------------
@@ -2296,7 +2296,7 @@ void ImplBorderWindow::SetCloser()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDockButton( sal_Bool bDockButton )
+void ImplBorderWindow::SetDockButton( BOOL bDockButton )
{
mbDockBtn = bDockButton;
Size aSize = GetOutputSizePixel();
@@ -2306,7 +2306,7 @@ void ImplBorderWindow::SetDockButton( sal_Bool bDockButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHideButton( sal_Bool bHideButton )
+void ImplBorderWindow::SetHideButton( BOOL bHideButton )
{
mbHideBtn = bHideButton;
Size aSize = GetOutputSizePixel();
@@ -2316,7 +2316,7 @@ void ImplBorderWindow::SetHideButton( sal_Bool bHideButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHelpButton( sal_Bool bHelpButton )
+void ImplBorderWindow::SetHelpButton( BOOL bHelpButton )
{
mbHelpBtn = bHelpButton;
Size aSize = GetOutputSizePixel();
@@ -2326,7 +2326,7 @@ void ImplBorderWindow::SetHelpButton( sal_Bool bHelpButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuButton( sal_Bool bMenuButton )
+void ImplBorderWindow::SetMenuButton( BOOL bMenuButton )
{
mbMenuBtn = bMenuButton;
Size aSize = GetOutputSizePixel();
@@ -2353,7 +2353,7 @@ void ImplBorderWindow::SetMenuBarWindow( Window* pWindow )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuBarMode( sal_Bool bHide )
+void ImplBorderWindow::SetMenuBarMode( BOOL bHide )
{
mbMenuHide = bHide;
UpdateMenuHeight();
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index cf9697b4f602..55be841666a0 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,38 +29,50 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <tools/ref.hxx>
#include <tools/debug.hxx>
-#include <tools/rc.h>
+#include <vcl/svdata.hxx>
#include <vcl/button.hxx>
#include <vcl/btndlg.hxx>
-#include <vcl/svdata.hxx>
-typedef boost::ptr_vector<ImplBtnDlgItem>::iterator btn_iterator;
-typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator;
+#include <tools/rc.h>
+
+
+
+// =======================================================================
struct ImplBtnDlgItem
{
- sal_uInt16 mnId;
- bool mbOwnButton;
- bool mbDummyAlign;
- long mnSepSize;
- PushButton* mpPushButton;
+ USHORT mnId;
+ BOOL mbOwnButton;
+ BOOL mbDummyAlign;
+ long mnSepSize;
+ PushButton* mpPushButton;
};
+DECLARE_LIST( ImplBtnDlgItemList, ImplBtnDlgItem* )
+
+// =======================================================================
+
void ButtonDialog::ImplInitButtonDialogData()
{
- mnButtonSize = 0;
- mnCurButtonId = 0;
- mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND;
- mbFormat = sal_True;
+ mpItemList = new ImplBtnDlgItemList( 8, 8 );
+ mnButtonSize = 0;
+ mnCurButtonId = 0;
+ mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND;
+ mbFormat = TRUE;
}
+// -----------------------------------------------------------------------
+
ButtonDialog::ButtonDialog( WindowType nType ) :
Dialog( nType )
{
ImplInitButtonDialogData();
}
+// -----------------------------------------------------------------------
+
ButtonDialog::ButtonDialog( Window* pParent, WinBits nStyle ) :
Dialog( WINDOW_BUTTONDIALOG )
{
@@ -68,28 +80,39 @@ ButtonDialog::ButtonDialog( Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
+// -----------------------------------------------------------------------
+
ButtonDialog::ButtonDialog( Window* pParent, const ResId& rResId ) :
Dialog( WINDOW_BUTTONDIALOG )
{
ImplInitButtonDialogData();
- rResId.SetRT( RSC_DIALOG ); // !!!!!!!!!! RSC_BUTTONDIALOG !!!!!!!!
+ rResId.SetRT( RSC_DIALOG ); // !!!!!!!!!! RSC_BUTTONDIALOG !!!!!!!!
ImplInit( pParent, ImplInitRes( rResId ) );
ImplLoadRes( rResId );
}
+// -----------------------------------------------------------------------
+
ButtonDialog::~ButtonDialog()
{
- for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- if ( it->mpPushButton && it->mbOwnButton )
- delete it->mpPushButton;
+ if ( pItem->mpPushButton && pItem->mbOwnButton )
+ delete pItem->mpPushButton;
+ delete pItem;
+ pItem = mpItemList->Next();
}
+
+ delete mpItemList;
}
-PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
+// -----------------------------------------------------------------------
+
+PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags )
{
PushButton* pBtn;
- WinBits nStyle = 0;
+ WinBits nStyle = 0;
if ( nBtnFlags & BUTTONDIALOG_DEFBUTTON )
nStyle |= WB_DEFBUTTON;
@@ -108,52 +131,59 @@ PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
return pBtn;
}
-ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const
+// -----------------------------------------------------------------------
+
+ImplBtnDlgItem* ButtonDialog::ImplGetItem( USHORT nId ) const
{
- for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- if (it->mnId == nId)
- return const_cast<ImplBtnDlgItem*>(&(*it));
+ if ( pItem->mnId == nId )
+ return pItem;
+
+ pItem = mpItemList->Next();
}
return NULL;
}
+// -----------------------------------------------------------------------
+
long ButtonDialog::ImplGetButtonSize()
{
if ( !mbFormat )
return mnButtonSize;
// Calculate ButtonSize
- long nLastSepSize = 0;
- long nSepSize = 0;
+ long nLastSepSize = 0;
+ long nSepSize = 0;
+ long nButtonCount = 0;
maCtrlSize = Size( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
-
- for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
nSepSize += nLastSepSize;
- long nTxtWidth = it->mpPushButton->GetCtrlTextWidth(it->mpPushButton->GetText());
+ long nTxtWidth = pItem->mpPushButton->GetCtrlTextWidth( pItem->mpPushButton->GetText() );
nTxtWidth += IMPL_EXTRA_BUTTON_WIDTH;
-
if ( nTxtWidth > maCtrlSize.Width() )
maCtrlSize.Width() = nTxtWidth;
-
- long nTxtHeight = it->mpPushButton->GetTextHeight();
+ long nTxtHeight = pItem->mpPushButton->GetTextHeight();
nTxtHeight += IMPL_EXTRA_BUTTON_HEIGHT;
-
if ( nTxtHeight > maCtrlSize.Height() )
maCtrlSize.Height() = nTxtHeight;
- nSepSize += it->mnSepSize;
+ nSepSize += pItem->mnSepSize;
if ( GetStyle() & WB_HORZ )
nLastSepSize = IMPL_SEP_BUTTON_X;
else
nLastSepSize = IMPL_SEP_BUTTON_Y;
- }
- long nButtonCount = maItemList.size();
+ nButtonCount++;
+
+ pItem = mpItemList->Next();
+ }
if ( GetStyle() & WB_HORZ )
mnButtonSize = nSepSize + (nButtonCount*maCtrlSize.Width());
@@ -163,6 +193,8 @@ long ButtonDialog::ImplGetButtonSize()
return mnButtonSize;
}
+// -----------------------------------------------------------------------
+
void ButtonDialog::ImplPosControls()
{
if ( !mbFormat )
@@ -172,9 +204,10 @@ void ButtonDialog::ImplPosControls()
ImplGetButtonSize();
// determine dialog size
- Size aDlgSize = maPageSize;
- long nX;
- long nY;
+ ImplBtnDlgItem* pItem;
+ Size aDlgSize = maPageSize;
+ long nX;
+ long nY;
if ( GetStyle() & WB_HORZ )
{
if ( mnButtonSize+(IMPL_DIALOG_OFFSET*2) > aDlgSize.Width() )
@@ -205,64 +238,76 @@ void ButtonDialog::ImplPosControls()
}
// Arrange PushButtons
- for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ pItem = mpItemList->First();
+ while ( pItem )
{
if ( GetStyle() & WB_HORZ )
- nX += it->mnSepSize;
+ nX += pItem->mnSepSize;
else
- nY += it->mnSepSize;
-
- it->mpPushButton->SetPosSizePixel( Point( nX, nY ), maCtrlSize );
- it->mpPushButton->Show();
-
+ nY += pItem->mnSepSize;
+ pItem->mpPushButton->SetPosSizePixel( Point( nX, nY ), maCtrlSize );
+ pItem->mpPushButton->Show();
if ( GetStyle() & WB_HORZ )
nX += maCtrlSize.Width()+IMPL_SEP_BUTTON_X;
else
nY += maCtrlSize.Height()+IMPL_SEP_BUTTON_Y;
+
+ pItem = mpItemList->Next();
}
SetOutputSizePixel( aDlgSize );
- mbFormat = sal_False;
+ mbFormat = FALSE;
}
+// -----------------------------------------------------------------------
+
IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn )
{
- for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- if ( it->mpPushButton == pBtn )
+ if ( pItem->mpPushButton == pBtn )
{
- mnCurButtonId = it->mnId;
+ mnCurButtonId = pItem->mnId;
Click();
break;
}
+
+ pItem = mpItemList->Next();
}
return 0;
}
+// -----------------------------------------------------------------------
+
void ButtonDialog::Resize()
{
}
+// -----------------------------------------------------------------------
+
void ButtonDialog::StateChanged( StateChangedType nType )
{
if ( nType == STATE_CHANGE_INITSHOW )
{
ImplPosControls();
- // Set focus on default button.
+ // Focus evt. auf den entsprechenden Button setzen
if ( mnFocusButtonId != BUTTONDIALOG_BUTTON_NOTFOUND )
{
- for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- if (it->mnId == mnFocusButtonId )
+ if ( pItem->mnId == mnFocusButtonId )
{
- if (it->mpPushButton->IsVisible())
- it->mpPushButton->GrabFocus();
-
+ if ( pItem->mpPushButton->IsVisible() )
+ pItem->mpPushButton->GrabFocus();
break;
}
+
+ pItem = mpItemList->Next();
}
}
}
@@ -270,6 +315,8 @@ void ButtonDialog::StateChanged( StateChangedType nType )
Dialog::StateChanged( nType );
}
+// -----------------------------------------------------------------------
+
void ButtonDialog::Click()
{
if ( !maClickHdl )
@@ -281,35 +328,39 @@ void ButtonDialog::Click()
maClickHdl.Call( this );
}
-void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::AddButton( const XubString& rText, USHORT nId,
+ USHORT nBtnFlags, long nSepPixel )
{
// PageItem anlegen
- ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
- pItem->mnId = nId;
- pItem->mbOwnButton = sal_True;
- pItem->mnSepSize = nSepPixel;
- pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
-
+ ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
+ pItem->mnId = nId;
+ pItem->mbOwnButton = TRUE;
+ pItem->mnSepSize = nSepPixel;
+ pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
if ( rText.Len() )
pItem->mpPushButton->SetText( rText );
- maItemList.push_back(pItem);
+ // In die Liste eintragen
+ mpItemList->Insert( pItem, LIST_APPEND );
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
-void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId,
+ USHORT nBtnFlags, long nSepPixel )
{
// PageItem anlegen
- ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
- pItem->mnId = nId;
- pItem->mbOwnButton = sal_True;
- pItem->mnSepSize = nSepPixel;
+ ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
+ pItem->mnId = nId;
+ pItem->mbOwnButton = TRUE;
+ pItem->mnSepSize = nSepPixel;
if ( eType == BUTTON_OK )
nBtnFlags |= BUTTONDIALOG_OKBUTTON;
@@ -320,9 +371,9 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
// Standard-Buttons have the right text already
- if ( !((eType == BUTTON_OK) && (pItem->mpPushButton->GetType() == WINDOW_OKBUTTON)) ||
+ if ( !((eType == BUTTON_OK) && (pItem->mpPushButton->GetType() == WINDOW_OKBUTTON)) ||
!((eType == BUTTON_CANCEL) && (pItem->mpPushButton->GetType() == WINDOW_CANCELBUTTON)) ||
- !((eType == BUTTON_HELP) && (pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) )
+ !((eType == BUTTON_HELP) && (pItem->mpPushButton->GetType() == WINDOW_HELPBUTTON)) )
{
pItem->mpPushButton->SetText( Button::GetStandardText( eType ) );
pItem->mpPushButton->SetHelpText( Button::GetStandardHelpText( eType ) );
@@ -331,78 +382,95 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- maItemList.push_back(pItem);
+ // In die Liste eintragen
+ mpItemList->Insert( pItem, LIST_APPEND );
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
-void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId,
- sal_uInt16 nBtnFlags, long nSepPixel )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId,
+ USHORT nBtnFlags, long nSepPixel )
{
// PageItem anlegen
- ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
- pItem->mnId = nId;
- pItem->mbOwnButton = sal_False;
- pItem->mnSepSize = nSepPixel;
- pItem->mpPushButton = pBtn;
+ ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
+ pItem->mnId = nId;
+ pItem->mbOwnButton = FALSE;
+ pItem->mnSepSize = nSepPixel;
+ pItem->mpPushButton = pBtn;
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- maItemList.push_back(pItem);
+ // In die View-Liste eintragen
+ mpItemList->Insert( pItem, LIST_APPEND );
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
-void ButtonDialog::RemoveButton( sal_uInt16 nId )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::RemoveButton( USHORT nId )
{
- btn_iterator it;
- for (it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- if (it->mnId == nId)
+ if ( pItem->mnId == nId )
{
- it->mpPushButton->Hide();
-
- if (it->mbOwnButton )
- delete it->mpPushButton;
-
- maItemList.erase(it);
+ pItem->mpPushButton->Hide();
+ if ( pItem->mbOwnButton )
+ delete pItem->mpPushButton;
+ delete pItem;
+ mpItemList->Remove();
+ mbFormat = TRUE;
break;
}
+
+ pItem = mpItemList->Next();
}
- if (it == maItemList.end())
- DBG_ERRORFILE( "ButtonDialog::RemoveButton(): ButtonId invalid" );
+ DBG_ERRORFILE( "ButtonDialog::RemoveButton(): ButtonId invalid" );
}
+// -----------------------------------------------------------------------
+
void ButtonDialog::Clear()
{
- for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ ImplBtnDlgItem* pItem = mpItemList->First();
+ while ( pItem )
{
- it->mpPushButton->Hide();
-
- if (it->mbOwnButton )
- delete it->mpPushButton;
+ pItem->mpPushButton->Hide();
+ if ( pItem->mbOwnButton )
+ delete pItem->mpPushButton;
+ delete pItem;
+ pItem = mpItemList->Next();
}
- maItemList.clear();
- mbFormat = sal_True;
+ mpItemList->Clear();
+ mbFormat = TRUE;
}
-sal_uInt16 ButtonDialog::GetButtonCount() const
+// -----------------------------------------------------------------------
+
+USHORT ButtonDialog::GetButtonCount() const
{
- return (sal_uInt16)maItemList.size();
+ return (USHORT)mpItemList->Count();
}
-sal_uInt16 ButtonDialog::GetButtonId( sal_uInt16 nButton ) const
+// -----------------------------------------------------------------------
+
+USHORT ButtonDialog::GetButtonId( USHORT nButton ) const
{
- if ( nButton < maItemList.size() )
- return maItemList[nButton].mnId;
+ if ( nButton < mpItemList->Count() )
+ return (USHORT)mpItemList->GetObject( nButton )->mnId;
else
return BUTTONDIALOG_BUTTON_NOTFOUND;
}
-PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
+// -----------------------------------------------------------------------
+
+PushButton* ButtonDialog::GetPushButton( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -412,18 +480,22 @@ PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
return NULL;
}
-void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::SetButtonText( USHORT nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
{
pItem->mpPushButton->SetText( rText );
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
}
-XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
+// -----------------------------------------------------------------------
+
+XubString ButtonDialog::GetButtonText( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -433,7 +505,9 @@ XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -441,7 +515,9 @@ void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
pItem->mpPushButton->SetHelpText( rText );
}
-XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
+// -----------------------------------------------------------------------
+
+XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -451,19 +527,26 @@ XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId )
+// -----------------------------------------------------------------------
+
+void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( rHelpId );
+ pItem->mpPushButton->SetHelpId( nHelpId );
}
-rtl::OString ButtonDialog::GetButtonHelpId( sal_uInt16 nId ) const
+// -----------------------------------------------------------------------
+
+ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
+ if ( pItem )
+ return pItem->mpPushButton->GetHelpId();
+ else
+ return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx
index 1fa77a3621cd..f956e4cef9d6 100644
--- a/vcl/source/window/cmdevt.cxx
+++ b/vcl/source/window/cmdevt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,37 +37,37 @@
CommandExtTextInputData::CommandExtTextInputData()
{
- mpTextAttr = NULL;
- mnCursorPos = 0;
- mnDeltaStart = 0;
- mnOldTextLen = 0;
- mnCursorFlags = 0;
- mbOnlyCursor = sal_False;
+ mpTextAttr = NULL;
+ mnCursorPos = 0;
+ mnDeltaStart = 0;
+ mnOldTextLen = 0;
+ mnCursorFlags = 0;
+ mbOnlyCursor = FALSE;
}
// -----------------------------------------------------------------------
CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
- const sal_uInt16* pTextAttr,
+ const USHORT* pTextAttr,
xub_StrLen nCursorPos,
- sal_uInt16 nCursorFlags,
+ USHORT nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- sal_Bool bOnlyCursor ) :
+ BOOL bOnlyCursor ) :
maText( rText )
{
if ( pTextAttr && maText.Len() )
{
- mpTextAttr = new sal_uInt16[maText.Len()];
- memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) );
+ mpTextAttr = new USHORT[maText.Len()];
+ memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(USHORT) );
}
else
mpTextAttr = NULL;
- mnCursorPos = nCursorPos;
- mnDeltaStart = nDeltaStart;
- mnOldTextLen = nOldTextLen;
- mnCursorFlags = nCursorFlags;
- mbOnlyCursor = bOnlyCursor;
+ mnCursorPos = nCursorPos;
+ mnDeltaStart = nDeltaStart;
+ mnOldTextLen = nOldTextLen;
+ mnCursorFlags = nCursorFlags;
+ mbOnlyCursor = bOnlyCursor;
}
// -----------------------------------------------------------------------
@@ -77,16 +77,16 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData&
{
if ( rData.mpTextAttr && maText.Len() )
{
- mpTextAttr = new sal_uInt16[maText.Len()];
- memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) );
+ mpTextAttr = new USHORT[maText.Len()];
+ memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(USHORT) );
}
else
mpTextAttr = NULL;
- mnCursorPos = rData.mnCursorPos;
- mnDeltaStart = rData.mnDeltaStart;
- mnOldTextLen = rData.mnOldTextLen;
- mnCursorFlags = rData.mnCursorFlags;
- mbOnlyCursor = rData.mbOnlyCursor;
+ mnCursorPos = rData.mnCursorPos;
+ mnDeltaStart = rData.mnDeltaStart;
+ mnOldTextLen = rData.mnOldTextLen;
+ mnCursorFlags = rData.mnCursorFlags;
+ mbOnlyCursor = rData.mbOnlyCursor;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 659f7df31fa7..11a998b5a879 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,16 +41,16 @@
struct ImplCursorData
{
- AutoTimer maTimer; // Timer
- Point maPixPos; // Pixel-Position
- Point maPixRotOff; // Pixel-Offset-Position
- Size maPixSize; // Pixel-Size
- long mnPixSlant; // Pixel-Slant
- short mnOrientation; // Pixel-Orientation
- unsigned char mnDirection; // indicates writing direction
- sal_uInt16 mnStyle; // Cursor-Style
- sal_Bool mbCurVisible; // Ist Cursor aktuell sichtbar
- Window* mpWindow; // Zugeordnetes Windows
+ AutoTimer maTimer; // Timer
+ Point maPixPos; // Pixel-Position
+ Point maPixRotOff; // Pixel-Offset-Position
+ Size maPixSize; // Pixel-Size
+ long mnPixSlant; // Pixel-Slant
+ short mnOrientation; // Pixel-Orientation
+ unsigned char mnDirection; // indicates writing direction
+ USHORT mnStyle; // Cursor-Style
+ 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;
- sal_Bool bMapMode = pWindow->IsMapModeEnabled();
- pWindow->EnableMapMode( sal_False );
- sal_uInt16 nInvertStyle;
+ BOOL bMapMode = pWindow->IsMapModeEnabled();
+ pWindow->EnableMapMode( FALSE );
+ USHORT nInvertStyle;
if ( pData->mnStyle & CURSOR_SHADOW )
nInvertStyle = INVERT_50;
else
@@ -95,10 +95,10 @@ static void ImplCursorInvert( ImplCursorData* pData )
// left-to-right
pAry[0] = aPoly.GetPoint( 0 );
pAry[1] = aPoly.GetPoint( 1 );
- pAry[2] = pAry[1];
+ pAry[2] = pAry[1];
pAry[2].X() += delta;
pAry[3] = pAry[1];
- pAry[3].Y() += delta;
+ pAry[3].Y() += delta;
pAry[4] = aPoly.GetPoint( 2 );
pAry[5] = aPoly.GetPoint( 3 );
pAry[6] = aPoly.GetPoint( 4 );
@@ -110,8 +110,8 @@ static void ImplCursorInvert( ImplCursorData* pData )
pAry[1] = aPoly.GetPoint( 1 );
pAry[2] = aPoly.GetPoint( 2 );
pAry[3] = aPoly.GetPoint( 3 );
- pAry[4] = pAry[0];
- pAry[4].Y() += delta;
+ pAry[4] = pAry[0];
+ pAry[4].Y() += delta;
pAry[5] = pAry[0];
pAry[5].X() -= delta;
pAry[6] = aPoly.GetPoint( 4 );
@@ -135,13 +135,13 @@ void Cursor::ImplDraw()
{
if ( mpData && mpData->mpWindow && !mpData->mbCurVisible )
{
- Window* pWindow = mpData->mpWindow;
- mpData->maPixPos = pWindow->LogicToPixel( maPos );
- mpData->maPixSize = pWindow->LogicToPixel( maSize );
- mpData->mnPixSlant = pWindow->LogicToPixel( Size( mnSlant, 0 ) ).Width();
- mpData->mnOrientation = mnOrientation;
- mpData->mnDirection = mnDirection;
- long nOffsetY = pWindow->LogicToPixel( Size( 0, mnOffsetY ) ).Height();
+ Window* pWindow = mpData->mpWindow;
+ mpData->maPixPos = pWindow->LogicToPixel( maPos );
+ mpData->maPixSize = pWindow->LogicToPixel( maSize );
+ mpData->mnPixSlant = pWindow->LogicToPixel( Size( mnSlant, 0 ) ).Width();
+ mpData->mnOrientation = mnOrientation;
+ mpData->mnDirection = mnDirection;
+ long nOffsetY = pWindow->LogicToPixel( Size( 0, mnOffsetY ) ).Height();
// Position um den Offset korrigieren
mpData->maPixPos.Y() -= nOffsetY;
@@ -155,7 +155,7 @@ void Cursor::ImplDraw()
// Ausgabeflaeche berechnen und ausgeben
ImplCursorInvert( mpData );
- mpData->mbCurVisible = sal_True;
+ mpData->mbCurVisible = TRUE;
}
}
@@ -166,13 +166,13 @@ void Cursor::ImplRestore()
if ( mpData && mpData->mbCurVisible )
{
ImplCursorInvert( mpData );
- mpData->mbCurVisible = sal_False;
+ mpData->mbCurVisible = FALSE;
}
}
// -----------------------------------------------------------------------
-void Cursor::ImplShow( bool bDrawDirect, bool bRestore )
+void Cursor::ImplShow( BOOL bDrawDirect )
{
if ( mbVisible )
{
@@ -194,16 +194,16 @@ void Cursor::ImplShow( bool bDrawDirect, bool bRestore )
if ( !mpData )
{
mpData = new ImplCursorData;
- mpData->mbCurVisible = sal_False;
+ mpData->mbCurVisible = FALSE;
mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, ImplTimerHdl ) );
}
- mpData->mpWindow = pWindow;
- mpData->mnStyle = mnStyle;
- if ( bDrawDirect || bRestore )
+ mpData->mpWindow = pWindow;
+ mpData->mnStyle = mnStyle;
+ if ( bDrawDirect )
ImplDraw();
- if ( !mpWindow && ! ( ! bDrawDirect && mpData->maTimer.IsActive()) )
+ if ( !mpWindow )
{
mpData->maTimer.SetTimeout( pWindow->GetSettings().GetStyleSettings().GetCursorBlinkTime() );
if ( mpData->maTimer.GetTimeout() != STYLE_CURSOR_NOBLINKTIME )
@@ -217,16 +217,16 @@ void Cursor::ImplShow( bool bDrawDirect, bool bRestore )
// -----------------------------------------------------------------------
-bool Cursor::ImplHide()
+void Cursor::ImplHide()
{
- bool bWasCurVisible = false;
if ( mpData && mpData->mpWindow )
{
- bWasCurVisible = mpData->mbCurVisible;
if ( mpData->mbCurVisible )
ImplRestore();
+
+ mpData->maTimer.Stop();
+ mpData->mpWindow = NULL;
}
- return bWasCurVisible;
}
// -----------------------------------------------------------------------
@@ -262,14 +262,14 @@ IMPL_LINK( Cursor, ImplTimerHdl, AutoTimer*, EMPTYARG )
Cursor::Cursor()
{
- mpData = NULL;
- mpWindow = NULL;
- mnSlant = 0;
- mnOffsetY = 0;
- mnOrientation = 0;
- mnDirection = 0;
- mnStyle = 0;
- mbVisible = sal_False;
+ mpData = NULL;
+ mpWindow = NULL;
+ mnSlant = 0;
+ mnOffsetY = 0;
+ mnOrientation = 0;
+ mnDirection = 0;
+ mnStyle = 0;
+ mbVisible = FALSE;
}
// -----------------------------------------------------------------------
@@ -278,13 +278,13 @@ Cursor::Cursor( const Cursor& rCursor ) :
maSize( rCursor.maSize ),
maPos( rCursor.maPos )
{
- mpData = NULL;
- mpWindow = NULL;
- mnSlant = rCursor.mnSlant;
- mnOrientation = rCursor.mnOrientation;
- mnDirection = rCursor.mnDirection;
- mnStyle = 0;
- mbVisible = rCursor.mbVisible;
+ mpData = NULL;
+ mpWindow = NULL;
+ mnSlant = rCursor.mnSlant;
+ mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
+ mnStyle = 0;
+ mbVisible = rCursor.mbVisible;
}
// -----------------------------------------------------------------------
@@ -302,7 +302,7 @@ Cursor::~Cursor()
// -----------------------------------------------------------------------
-void Cursor::SetStyle( sal_uInt16 nStyle )
+void Cursor::SetStyle( USHORT nStyle )
{
if ( mnStyle != nStyle )
{
@@ -317,7 +317,7 @@ void Cursor::Show()
{
if ( !mbVisible )
{
- mbVisible = sal_True;
+ mbVisible = TRUE;
ImplShow();
}
}
@@ -328,14 +328,8 @@ void Cursor::Hide()
{
if ( mbVisible )
{
- mbVisible = sal_False;
+ mbVisible = FALSE;
ImplHide();
-
- if( mpData )
- {
- mpData->maTimer.Stop();
- mpData->mpWindow = NULL;
- }
}
}
@@ -442,12 +436,12 @@ void Cursor::SetDirection( unsigned char nNewDirection )
Cursor& Cursor::operator=( const Cursor& rCursor )
{
- maPos = rCursor.maPos;
- maSize = rCursor.maSize;
- mnSlant = rCursor.mnSlant;
- mnOrientation = rCursor.mnOrientation;
- mnDirection = rCursor.mnDirection;
- mbVisible = rCursor.mbVisible;
+ maPos = rCursor.maPos;
+ maSize = rCursor.maSize;
+ mnSlant = rCursor.mnSlant;
+ mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
+ mbVisible = rCursor.mbVisible;
ImplNew();
return *this;
@@ -455,17 +449,17 @@ Cursor& Cursor::operator=( const Cursor& rCursor )
// -----------------------------------------------------------------------
-sal_Bool Cursor::operator==( const Cursor& rCursor ) const
+BOOL Cursor::operator==( const Cursor& rCursor ) const
{
- if ( (maPos == rCursor.maPos) &&
- (maSize == rCursor.maSize) &&
- (mnSlant == rCursor.mnSlant) &&
- (mnOrientation == rCursor.mnOrientation) &&
- (mnDirection == rCursor.mnDirection) &&
- (mbVisible == rCursor.mbVisible) )
- return sal_True;
+ if ( (maPos == rCursor.maPos) &&
+ (maSize == rCursor.maSize) &&
+ (mnSlant == rCursor.mnSlant) &&
+ (mnOrientation == rCursor.mnOrientation) &&
+ (mnDirection == rCursor.mnDirection) &&
+ (mbVisible == rCursor.mbVisible) )
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 125c927bf673..1471b0a496d3 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,33 +38,98 @@
// =======================================================================
-#define BUTTON_DRAW_FLATTEST (BUTTON_DRAW_FLAT | \
- BUTTON_DRAW_PRESSED | \
- BUTTON_DRAW_CHECKED | \
+#define BUTTON_DRAW_FLATTEST (BUTTON_DRAW_FLAT | \
+ BUTTON_DRAW_PRESSED | \
+ BUTTON_DRAW_CHECKED | \
BUTTON_DRAW_HIGHLIGHT)
// =======================================================================
+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 )
{
// Groessen vorberechnen
- long nMin = Min( rRect.GetWidth(), rRect.GetHeight() );
- long nSize = nMin;
+ long nMin = Min( rRect.GetWidth(), rRect.GetHeight() );
+ long nSize = nMin;
if ( nMin & 0x01 )
nMin--;
- Point aCenter = rRect.Center();
- long nCenterX = aCenter.X();
- long nCenterY = aCenter.Y();
- long n2 = nMin / 2;
- long n4 = nMin / 4;
- long nLeft;
- long nTop;
- long nRight;
- long nBottom;
- long nTemp;
- long i;
+ Point aCenter = rRect.Center();
+ long nCenterX = aCenter.X();
+ long nCenterY = aCenter.Y();
+ long n2 = nMin / 2;
+ long n4 = nMin / 4;
+ long nLeft;
+ long nTop;
+ long nRight;
+ long nBottom;
+ long nTemp;
+ long i;
switch ( eType )
{
@@ -274,8 +339,8 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
{
if ( !( nSize & 0x01 ))
{
- // An even rectangle size means we have to use a smaller size for
- // our arrows as we want to use one pixel for the spearhead! Otherwise
+ // An even rectangle size means we have to use a smaller size for
+ // our arrows as we want to use one pixel for the spearhead! Otherwise
// it will be clipped!
nCenterX++;
n2 = ( nMin-1 ) / 2;
@@ -304,9 +369,9 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
case SYMBOL_RADIOCHECKMARK:
case SYMBOL_RECORD:
{
- const long nExt = ( n2 << 1 ) + 1;
- Bitmap aBmp( Size( nExt, nExt ), 1 );
- BitmapWriteAccess* pWAcc = aBmp.AcquireWriteAccess();
+ const long nExt = ( n2 << 1 ) + 1;
+ Bitmap aBmp( Size( nExt, nExt ), 1 );
+ BitmapWriteAccess* pWAcc = aBmp.AcquireWriteAccess();
if( pWAcc )
{
@@ -407,8 +472,8 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
aRectSize.Width() = 1;
else if ( nMin > 20 )
aRectSize.Width() = nMin/10;
- nLeft = nCenterX-n2+1;
- nTop = nCenterY-n2+1;
+ nLeft = nCenterX-n2+1;
+ nTop = nCenterY-n2+1;
nBottom = nCenterY-n2+nMin-aRectSize.Width()+1;
i = 0;
while ( i < nMin-aRectSize.Width()+1 )
@@ -444,7 +509,7 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
case SYMBOL_CHECKMARK:
{
// #106953# never mirror checkmarks
- sal_Bool bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ 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,
@@ -566,22 +631,57 @@ 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, sal_uInt16 nStyle )
+ const Color& rColor, USHORT nStyle )
{
- const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
- Rectangle aRect = mpOutDev->LogicToPixel( rRect );
- Color aOldLineColor = mpOutDev->GetLineColor();
- Color aOldFillColor = mpOutDev->GetFillColor();
- sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
+ const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
+ Rectangle aRect = mpOutDev->LogicToPixel( rRect );
+ Color aOldLineColor = mpOutDev->GetLineColor();
+ Color aOldFillColor = mpOutDev->GetFillColor();
+ BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
mpOutDev->SetLineColor();
mpOutDev->SetFillColor( rColor );
- mpOutDev->EnableMapMode( sal_False );
+ mpOutDev->EnableMapMode( FALSE );
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(mpOutDev->GetOutDevType() == OUTDEV_PRINTER) )
@@ -622,11 +722,11 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
const Color& rLeftTopColor,
const Color& rRightBottomColor )
{
- Rectangle aRect = mpOutDev->LogicToPixel( rRect );
- Color aOldLineColor = mpOutDev->GetLineColor();
- Color aOldFillColor = mpOutDev->GetFillColor();
- sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
- mpOutDev->EnableMapMode( sal_False );
+ Rectangle aRect = mpOutDev->LogicToPixel( rRect );
+ Color aOldLineColor = mpOutDev->GetLineColor();
+ Color aOldFillColor = mpOutDev->GetFillColor();
+ BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
+ mpOutDev->EnableMapMode( FALSE );
mpOutDev->SetLineColor();
mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor );
mpOutDev->SetLineColor( aOldLineColor );
@@ -637,7 +737,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
// =======================================================================
void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Color aLightColor = rStyleSettings.GetLightColor();
@@ -687,7 +787,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
// =======================================================================
static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
- const Color* pColor, sal_Bool bRound = sal_False )
+ const Color* pColor, BOOL bRound = FALSE )
{
long nLineWidth = pDev->ImplGetDPIX()/300;
long nLineHeight = pDev->ImplGetDPIY()/300;
@@ -727,19 +827,19 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
}
}
- rRect.Left() += nLineWidth;
- rRect.Top() += nLineHeight;
- rRect.Right() -= nLineWidth;
- rRect.Bottom() -= nLineHeight;
+ rRect.Left() += nLineWidth;
+ rRect.Top() += nLineHeight;
+ rRect.Right() -= nLineWidth;
+ rRect.Bottom() -= nLineHeight;
}
// =======================================================================
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
+ const StyleSettings& rStyleSettings, USHORT nStyle )
{
// mask menu style
- sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
+ BOOL bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? TRUE : FALSE;
nStyle &= ~FRAME_DRAW_MENU;
Window *pWin = NULL;
@@ -748,9 +848,9 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// UseFlatBorders disables 3D style for all frames except menus
// menus may use different border colors (eg on XP)
- // normal frames will be drawn using the shadow color
+ // normal frames will be drawn using the shadow color
// whereas window frame borders will use black
- sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
+ 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)
@@ -759,13 +859,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 = sal_True;
+ bFlatBorders = TRUE;
else
- bFlatBorders = sal_False;
+ bFlatBorders = FALSE;
}
// no round corners for window frame borders
- sal_Bool bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
+ BOOL bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) ||
@@ -774,7 +874,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nStyle & FRAME_DRAW_NODRAW )
{
- sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -789,14 +889,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
ImplDrawDPILineRect( pDev, rRect, NULL, bRound );
else
{
- sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
+ rRect.Left() += 2;
+ rRect.Top() += 2;
+ rRect.Right() -= 2;
+ rRect.Bottom() -= 2;
}
else if ( (nFrameStyle == FRAME_DRAW_IN) ||
(nFrameStyle == FRAME_DRAW_OUT) )
@@ -808,10 +908,10 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else // FRAME_DRAW_DOUBLEIN || FRAME_DRAW_DOUBLEOUT
{
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
+ rRect.Left() += 2;
+ rRect.Top() += 2;
+ rRect.Right() -= 2;
+ rRect.Bottom() -= 2;
}
}
}
@@ -819,14 +919,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
{
if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) )
{
- sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
Rectangle aBound, aContent;
Rectangle aNatRgn( rRect );
- if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
- aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+ if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
+ aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
if( pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, CTRL_STATE_ENABLED,
aControlValue, rtl::OUString()) )
@@ -856,7 +956,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
pDev->SetFillColor();
@@ -923,7 +1023,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rStyleSettings.GetDarkShadowColor() :
rStyleSettings.GetLightBorderColor(),
rStyleSettings.GetDarkShadowColor() );
-
+
}
rRect.Left()++;
@@ -931,7 +1031,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rRect.Right()--;
rRect.Bottom()--;
- sal_Bool bDrawn = sal_True;
+ BOOL bDrawn = TRUE;
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{
if( bFlatBorders ) // no 3d effect
@@ -951,7 +1051,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() );
else
- bDrawn = sal_False;
+ bDrawn = FALSE;
}
if( bDrawn )
{
@@ -968,14 +1068,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
+Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
{
- Rectangle aRect = rRect;
- sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
+ Rectangle aRect = rRect;
+ BOOL bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( sal_False );
+ mpOutDev->EnableMapMode( FALSE );
}
if ( !rRect.IsEmpty() )
@@ -1004,7 +1104,7 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
// =======================================================================
static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
+ const StyleSettings& rStyleSettings, USHORT nStyle )
{
Rectangle aFillRect = rRect;
@@ -1033,25 +1133,25 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
pDev->SetFillColor( aBlackColor );
Rectangle aRect1;
Rectangle aRect2;
- aRect1.Left() = aFillRect.Left();
- aRect1.Right() = aFillRect.Right(),
- aRect2.Top() = aFillRect.Top();
+ aRect1.Left() = aFillRect.Left();
+ aRect1.Right() = aFillRect.Right(),
+ aRect2.Top() = aFillRect.Top();
aRect2.Bottom() = aFillRect.Bottom();
if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
{
- aRect1.Top() = aFillRect.Top();
+ aRect1.Top() = aFillRect.Top();
aRect1.Bottom() = aBrdSize.Height()-1;
- aRect2.Left() = aFillRect.Left();
- aRect2.Right() = aFillRect.Left()+aBrdSize.Width()-1;
+ aRect2.Left() = aFillRect.Left();
+ aRect2.Right() = aFillRect.Left()+aBrdSize.Width()-1;
aFillRect.Left() += aBrdSize.Width();
aFillRect.Top() += aBrdSize.Height();
}
else
{
- aRect1.Top() = aFillRect.Bottom()-aBrdSize.Height()+1;
+ aRect1.Top() = aFillRect.Bottom()-aBrdSize.Height()+1;
aRect1.Bottom() = aFillRect.Bottom();
- aRect2.Left() = aFillRect.Right()-aBrdSize.Width()+1;
- aRect2.Right() = aFillRect.Right(),
+ aRect2.Left() = aFillRect.Right()-aBrdSize.Width()+1;
+ aRect2.Right() = aFillRect.Right(),
aFillRect.Right() -= aBrdSize.Width();
aFillRect.Bottom() -= aBrdSize.Height();
}
@@ -1186,45 +1286,45 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
{
if ( (rRect.GetHeight() > 10) && (rRect.GetWidth() > 10) )
{
- rRect.Left() += 4;
- rRect.Top() += 4;
- rRect.Right() -= 1;
- rRect.Bottom() -= 1;
+ rRect.Left() += 4;
+ rRect.Top() += 4;
+ rRect.Right() -= 1;
+ rRect.Bottom() -= 1;
}
else
{
- rRect.Left() += 3;
- rRect.Top() += 3;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
+ rRect.Left() += 3;
+ rRect.Top() += 3;
+ rRect.Right() -= 2;
+ rRect.Bottom() -= 2;
}
}
else if ( nStyle & BUTTON_DRAW_CHECKED )
{
- rRect.Left() += 3;
- rRect.Top() += 3;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
+ rRect.Left() += 3;
+ rRect.Top() += 3;
+ rRect.Right() -= 2;
+ rRect.Bottom() -= 2;
}
else
{
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 3;
- rRect.Bottom() -= 3;
+ rRect.Left() += 2;
+ rRect.Top() += 2;
+ rRect.Right() -= 3;
+ rRect.Bottom() -= 3;
}
}
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 nStyle )
+Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle )
{
- Rectangle aRect = rRect;
- sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
+ Rectangle aRect = rRect;
+ BOOL bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( sal_False );
+ mpOutDev->EnableMapMode( FALSE );
}
if ( !rRect.IsEmpty() )
@@ -1267,7 +1367,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo
mpOutDev->SetLineColor( Color( COL_BLACK ) );
else
mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
-
+
mpOutDev->DrawLine( aStart, aStop );
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 7e2725e07023..d6da6ad37237 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -73,24 +73,24 @@ static ByteString ImplGetDialogText( Dialog* pDialog )
// =======================================================================
-static sal_Bool ImplIsMnemonicCtrl( Window* pWindow )
+static BOOL ImplIsMnemonicCtrl( Window* pWindow )
{
if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() )
- return sal_False;
+ return FALSE;
if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) ||
(pWindow->GetType() == WINDOW_CHECKBOX) ||
(pWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pWindow->GetType() == WINDOW_PUSHBUTTON) )
- return sal_True;
+ return TRUE;
if ( pWindow->GetType() == WINDOW_FIXEDTEXT )
{
if ( pWindow->GetStyle() & (WB_INFO | WB_NOLABEL) )
- return sal_False;
+ return FALSE;
Window* pNextWindow = pWindow->GetWindow( WINDOW_NEXT );
if ( !pNextWindow )
- return sal_False;
+ return FALSE;
pNextWindow = pNextWindow->GetWindow( WINDOW_CLIENT );
if ( !(pNextWindow->GetStyle() & WB_TABSTOP) ||
(pNextWindow->GetType() == WINDOW_FIXEDTEXT) ||
@@ -99,12 +99,12 @@ static sal_Bool ImplIsMnemonicCtrl( Window* pWindow )
(pNextWindow->GetType() == WINDOW_CHECKBOX) ||
(pNextWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pNextWindow->GetType() == WINDOW_PUSHBUTTON) )
- return sal_False;
+ return FALSE;
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -215,7 +215,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog )
static void ImplMouseAutoPos( Dialog* pDialog )
{
- sal_uLong nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions();
+ 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 = sal_True;
+ mpWindowImpl->mbDialog = TRUE;
mpDialogParent = NULL;
mpPrevExecuteDlg = NULL;
- mbInExecute = sal_False;
- mbOldSaveBack = sal_False;
- mbInClose = sal_False;
- mbModalMode = sal_False;
+ mbInExecute = FALSE;
+ mbOldSaveBack = FALSE;
+ mbInClose = FALSE;
+ mbModalMode = FALSE;
mnMousePositioned = 0;
mpDialogImpl = new DialogImpl;
}
@@ -265,7 +265,7 @@ void Dialog::ImplInitDialogData()
void Dialog::ImplInit( Window* pParent, WinBits nStyle )
{
- sal_uInt16 nSysWinMode = Application::GetSystemWindowMode();
+ USHORT 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, sal_True ) &&
+ if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, TRUE ) &&
pExeDlg->IsReallyVisible() &&
pExeDlg->IsEnabled() && pExeDlg->IsInputEnabled() && !pExeDlg->IsInModalMode() )
{
@@ -341,8 +341,8 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
}
else
{
- mpWindowImpl->mbFrame = sal_True;
- mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = TRUE;
+ mpWindowImpl->mbOverlapWin = 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( sal_True );
+ EnableChildTransparentMode( TRUE );
}
// fallback to settings color
else
@@ -467,7 +467,7 @@ long Dialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT 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 sal_True;
+ return 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( sal_False );
- SetModalInputMode( sal_True );
+ SetModalInputMode( FALSE );
+ SetModalInputMode( TRUE );
// #93022# def-button might have changed after show
if( !mnMousePositioned )
@@ -554,7 +554,7 @@ void Dialog::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-sal_Bool Dialog::Close()
+BOOL Dialog::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
@@ -567,21 +567,21 @@ sal_Bool Dialog::Close()
// ( Note: ) this used to work ( something changes somewhere )
if (mnCancelClose != 0)
{
- return sal_False;
+ return FALSE;
}
//liuchen 2009-7-22
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && !IsInExecute() )
- return sal_False;
+ return FALSE;
- mbInClose = sal_True;
+ mbInClose = TRUE;
if ( !(GetStyle() & WB_CLOSEABLE) )
{
- sal_Bool bRet = sal_True;
+ BOOL bRet = TRUE;
ImplAddDel( &aDelData );
PushButton* pButton = ImplGetCancelButton( this );
if ( pButton )
@@ -592,39 +592,39 @@ sal_Bool Dialog::Close()
if ( pButton )
pButton->Click();
else
- bRet = sal_False;
+ bRet = FALSE;
}
if ( aDelData.IsDelete() )
- return sal_True;
+ return TRUE;
ImplRemoveDel( &aDelData );
return bRet;
}
if ( IsInExecute() )
{
- EndDialog( sal_False );
- mbInClose = sal_False;
- return sal_True;
+ EndDialog( FALSE );
+ mbInClose = FALSE;
+ return TRUE;
}
else
{
- mbInClose = sal_False;
+ mbInClose = FALSE;
return SystemWindow::Close();
}
}
// -----------------------------------------------------------------------
-sal_Bool Dialog::ImplStartExecuteModal()
+BOOL Dialog::ImplStartExecuteModal()
{
if ( mbInExecute )
{
#ifdef DBG_UTIL
ByteString aErrorStr( "Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): " );
aErrorStr += ImplGetDialogText( this );
- OSL_FAIL( aErrorStr.GetBuffer() );
+ DBG_ERROR( aErrorStr.GetBuffer() );
#endif
- return sal_False;
+ return FALSE;
}
if ( Application::IsDialogCancelEnabled() )
@@ -632,9 +632,9 @@ sal_Bool Dialog::ImplStartExecuteModal()
#ifdef DBG_UTIL
ByteString aErrorStr( "Dialog::StartExecuteModal() is called in a none UI application: " );
aErrorStr += ImplGetDialogText( this );
- OSL_FAIL( aErrorStr.GetBuffer() );
+ DBG_ERROR( aErrorStr.GetBuffer() );
#endif
- return sal_False;
+ return FALSE;
}
#ifdef DBG_UTIL
@@ -663,15 +663,15 @@ sal_Bool Dialog::ImplStartExecuteModal()
pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_CANCEL );
if ( pSVData->maWinData.mpCaptureWin )
pSVData->maWinData.mpCaptureWin->ReleaseMouse();
- EnableInput( sal_True, sal_True );
+ EnableInput( TRUE, TRUE );
if ( GetParent() )
{
NotifyEvent aNEvt( EVENT_EXECUTEDIALOG, this );
GetParent()->Notify( aNEvt );
}
- mbInExecute = sal_True;
- SetModalInputMode( sal_True );
+ mbInExecute = TRUE;
+ SetModalInputMode( TRUE );
mbOldSaveBack = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -681,7 +681,7 @@ sal_Bool Dialog::ImplStartExecuteModal()
Show();
pSVData->maAppData.mnModalMode++;
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -722,7 +722,7 @@ short Dialog::Execute()
if( ! aParentDelData.IsDelete() )
pDialogParent->ImplRemoveDel( &aParentDelData );
else
- OSL_FAIL( "Dialog::Execute() - Parent of dialog destroyed in Execute()" );
+ DBG_ERROR( "Dialog::Execute() - Parent of dialog destroyed in Execute()" );
}
#endif
if ( !aDelData.IsDelete() )
@@ -730,7 +730,7 @@ short Dialog::Execute()
#ifdef DBG_UTIL
else
{
- OSL_FAIL( "Dialog::Execute() - Dialog destroyed in Execute()" );
+ DBG_ERROR( "Dialog::Execute() - Dialog destroyed in Execute()" );
}
#endif
@@ -753,7 +753,7 @@ void Dialog::StartExecuteModal( const Link& rEndDialogHdl )
// -----------------------------------------------------------------------
-sal_Bool Dialog::IsStartedModal() const
+BOOL Dialog::IsStartedModal() const
{
return mpDialogImpl->mbStartedModal;
}
@@ -764,7 +764,7 @@ void Dialog::EndDialog( long nResult )
{
if ( mbInExecute )
{
- SetModalInputMode( sal_False );
+ SetModalInputMode( 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 = sal_False;
+ mbInExecute = FALSE;
}
}
@@ -833,9 +833,9 @@ void Dialog::EndAllDialogs( Window* pParent )
while ( pModDialog )
{
pTempModDialog = pModDialog->mpPrevExecuteDlg;
- if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, sal_True ) ) )
+ if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, TRUE ) ) )
{
- pModDialog->EndDialog( sal_False );
+ pModDialog->EndDialog( FALSE );
pModDialog->PostUserEvent( Link() );
}
pModDialog = pTempModDialog;
@@ -844,7 +844,7 @@ void Dialog::EndAllDialogs( Window* pParent )
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( sal_Bool bModal )
+void Dialog::SetModalInputMode( BOOL bModal )
{
if ( bModal == mbModalMode )
return;
@@ -858,8 +858,8 @@ void Dialog::SetModalInputMode( sal_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, sal_True ) )
- mpPrevExecuteDlg->EnableInput( sal_False, sal_True, sal_True, this );
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
+ mpPrevExecuteDlg->EnableInput( FALSE, TRUE, TRUE, this );
// determine next overlap dialog parent
Window* pParent = GetParent();
@@ -886,20 +886,20 @@ void Dialog::SetModalInputMode( sal_Bool bModal )
}
// Enable the prev Modal Dialog
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) )
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
{
- mpPrevExecuteDlg->EnableInput( sal_True, sal_True, sal_True, this );
+ mpPrevExecuteDlg->EnableInput( TRUE, TRUE, TRUE, this );
// ensure continued modality of prev dialog
// do not change modality counter
- mpPrevExecuteDlg->SetModalInputMode( sal_False );
- mpPrevExecuteDlg->SetModalInputMode( sal_True );
+ mpPrevExecuteDlg->SetModalInputMode( FALSE );
+ mpPrevExecuteDlg->SetModalInputMode( TRUE );
}
}
}
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs )
+void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs )
{
if ( bSubModalDialogs )
{
@@ -908,7 +908,7 @@ void Dialog::SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs )
while ( pOverlap )
{
if ( pOverlap->IsDialog() )
- ((Dialog*)pOverlap)->SetModalInputMode( bModal, sal_True );
+ ((Dialog*)pOverlap)->SetModalInputMode( bModal, TRUE );
pOverlap = pOverlap->mpWindowImpl->mpNext;
}
}
@@ -943,7 +943,7 @@ void Dialog::GrabFocusToFirstControl()
!pFocusControl->IsVisible() ||
!pFocusControl->IsEnabled() || !pFocusControl->IsInputEnabled() )
{
- sal_uInt16 n = 0;
+ USHORT 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( sal_True );
+// aImplWin.SetDisplayActive( TRUE );
// aImplWin.InitView();
aImplWin.GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
}
-void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
+void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 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, sal
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( sal_True );
+ aImplWin.SetDisplayActive( 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 ce7b6dca8119..dd8dccaf0597 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -45,7 +45,7 @@ using namespace ::com::sun::star;
// =======================================================================
-static sal_Bool ImplHasIndirectTabParent( Window* pWindow )
+static 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, sal_uInt16 n, sal_uInt16& nIndex )
+static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex )
{
Window* pTabPage = NULL;
Window* pFoundWindow = NULL;
@@ -151,7 +151,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16&
// -----------------------------------------------------------------------
-static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
+static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
{
pParent = ImplGetTopParentOfTabHierarchy( pParent );
@@ -159,7 +159,7 @@ static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nI
Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex );
if ( bTestEnable )
{
- sal_uInt16 n2 = nIndex;
+ USHORT n2 = nIndex;
while ( pWindow && (!pWindow->IsEnabled() || !pWindow->IsInputEnabled()) )
{
n2 = nIndex+1;
@@ -185,7 +185,7 @@ static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nI
// -----------------------------------------------------------------------
-static Window* ImplGetNextWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
+static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
{
Window* pWindow = ImplGetChildWindow( pParent, n+1, nIndex, bTestEnable );
if ( n == nIndex )
@@ -198,17 +198,17 @@ static Window* ImplGetNextWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIn
// -----------------------------------------------------------------------
-Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
- sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
- sal_uInt16* pIndex )
+Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
+ USHORT nFormStart, USHORT nFormEnd,
+ USHORT* pIndex )
{
DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd),
"Window::ImplGetDlgWindow() - nIndex not in Form" );
Window* pWindow = NULL;
- sal_uInt16 i;
- sal_uInt16 nTemp;
- sal_uInt16 nStartIndex;
+ USHORT i;
+ USHORT nTemp;
+ USHORT nStartIndex;
if ( nType == DLGWINDOW_PREV )
{
@@ -219,7 +219,7 @@ Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
i--;
else
i = nFormEnd;
- pWindow = ImplGetChildWindow( this, i, nTemp, sal_True );
+ pWindow = ImplGetChildWindow( this, i, nTemp, TRUE );
if ( !pWindow )
break;
if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) )
@@ -239,19 +239,19 @@ Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
{
if ( i < nFormEnd )
{
- pWindow = ImplGetNextWindow( this, i, i, sal_True );
+ pWindow = ImplGetNextWindow( this, i, i, TRUE );
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
}
else
- pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
}
if ( i <= nFormEnd )
{
// 2ten Index mitfuehren, falls alle Controls disablte
- sal_uInt16 nStartIndex2 = i;
- sal_uInt16 nOldIndex = i+1;
+ USHORT nStartIndex2 = i;
+ USHORT nOldIndex = i+1;
do
{
@@ -264,9 +264,9 @@ Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
}
nOldIndex = i;
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
else
- pWindow = ImplGetNextWindow( this, i, i, sal_True );
+ pWindow = ImplGetNextWindow( this, i, i, TRUE );
}
while ( (i != nStartIndex) && (i != nStartIndex2) );
@@ -304,20 +304,20 @@ Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
// -----------------------------------------------------------------------
-static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt16& rIndex,
- sal_uInt16& rFormStart, sal_uInt16& rFormEnd )
+static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex,
+ USHORT& rFormStart, USHORT& rFormEnd )
{
Window* pSWindow;
Window* pSecondWindow = NULL;
Window* pTempWindow = NULL;
- sal_uInt16 i;
- sal_uInt16 nSecond_i = 0;
- sal_uInt16 nFormStart = 0;
- sal_uInt16 nSecondFormStart = 0;
- sal_uInt16 nFormEnd;
+ USHORT i;
+ USHORT nSecond_i = 0;
+ USHORT nFormStart = 0;
+ USHORT nSecondFormStart = 0;
+ USHORT nFormEnd;
// Focus-Fenster in der Child-Liste suchen
- Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, sal_False );
+ Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE );
if( pWindow == NULL )
pWindow = pSWindow;
@@ -340,7 +340,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt
break;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
+ pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
if ( !i )
pSWindow = NULL;
}
@@ -370,7 +370,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt
do
{
nFormEnd = i;
- pTempWindow = ImplGetNextWindow( pParent, i, i, sal_False );
+ pTempWindow = ImplGetNextWindow( pParent, i, i, FALSE );
// the DialogControlStart mark is only accepted for the direct children
if ( !i
@@ -388,7 +388,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt
if ( nIteration >= 2 )
{
// this is an unexpected scenario
- DBG_ASSERT( sal_False, "It seems to be an endless loop!" );
+ DBG_ASSERT( FALSE, "It seems to be an endless loop!" );
rFormStart = 0;
break;
}
@@ -402,16 +402,16 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt
// -----------------------------------------------------------------------
-static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Unicode cCharCode,
- sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_Bool bCheckEnable = sal_True )
+static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode,
+ USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE )
{
DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd),
"Window::ImplFindAccelWindow() - rIndex not in Form" );
xub_Unicode cCompareChar;
- sal_uInt16 nStart = rIndex;
- sal_uInt16 i = rIndex;
- int bSearch = sal_True;
+ USHORT nStart = rIndex;
+ USHORT i = rIndex;
+ int bSearch = TRUE;
Window* pWindow;
// MT: Where can we keep the CharClass?!
@@ -423,13 +423,13 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Uni
cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0];
if ( i < nFormEnd )
- pWindow = ImplGetNextWindow( pParent, i, i, sal_True );
+ pWindow = ImplGetNextWindow( pParent, i, i, TRUE );
else
- pWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_True );
+ pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE );
while( bSearch && pWindow )
{
const XubString aStr = pWindow->GetText();
- sal_uInt16 nPos = aStr.Search( '~' );
+ USHORT nPos = aStr.Search( '~' );
while ( nPos != STRING_NOTFOUND )
{
cCompareChar = aStr.GetChar( nPos+1 );
@@ -453,9 +453,9 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Uni
// children checked for accelerators
if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 )
{
- sal_uInt16 nChildIndex;
- sal_uInt16 nChildFormStart;
- sal_uInt16 nChildFormEnd;
+ USHORT nChildIndex;
+ USHORT nChildFormStart;
+ USHORT nChildFormEnd;
// get form start and end
::ImplFindDlgCtrlWindow( pWindow, NULL,
@@ -485,14 +485,14 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Uni
// -----------------------------------------------------------------------
-void Window::ImplControlFocus( sal_uInt16 nFlags )
+void Window::ImplControlFocus( USHORT nFlags )
{
if ( nFlags & GETFOCUS_MNEMONIC )
{
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
+ ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -505,8 +505,8 @@ void Window::ImplControlFocus( sal_uInt16 nFlags )
((CheckBox*)this)->ImplCheck();
else if ( mpWindowImpl->mbPushButton )
{
- ((PushButton*)this)->SetPressed( sal_True );
- ((PushButton*)this)->SetPressed( sal_False );
+ ((PushButton*)this)->SetPressed( TRUE );
+ ((PushButton*)this)->SetPressed( FALSE );
((PushButton*)this)->Click();
}
}
@@ -517,7 +517,7 @@ void Window::ImplControlFocus( sal_uInt16 nFlags )
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
+ ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -528,32 +528,32 @@ void Window::ImplControlFocus( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
+BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
Window* pSWindow;
Window* pTempWindow;
Window* pButtonWindow;
- sal_uInt16 i;
- sal_uInt16 iButton;
- sal_uInt16 iButtonStart;
- sal_uInt16 iTemp;
- sal_uInt16 nIndex;
- sal_uInt16 nFormStart;
- sal_uInt16 nFormEnd;
- sal_uInt16 nDlgCtrlFlags;
+ USHORT i;
+ USHORT iButton;
+ USHORT iButtonStart;
+ USHORT iTemp;
+ USHORT nIndex;
+ USHORT nFormStart;
+ USHORT nFormEnd;
+ USHORT nDlgCtrlFlags;
// Ohne Focus-Window koennen wir auch keine Steuerung uebernehmen
Window* pFocusWindow = Application::GetFocusWindow();
if ( !pFocusWindow || !ImplIsWindowOrChild( pFocusWindow ) )
- return sal_False;
+ return FALSE;
// Focus-Fenster in der Child-Liste suchen
pSWindow = ::ImplFindDlgCtrlWindow( this, pFocusWindow,
nIndex, nFormStart, nFormEnd );
if ( !pSWindow )
- return sal_False;
+ return FALSE;
i = nIndex;
nDlgCtrlFlags = 0;
@@ -572,7 +572,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( nKeyCode == KEY_RETURN )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
iButtonStart = iButton;
while ( pButtonWindow )
{
@@ -580,17 +580,17 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
pButtonWindow->mpWindowImpl->mbPushButton )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) )
{
- sal_uInt16 nType;
- sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
- sal_uInt16 nNewIndex;
- sal_uInt16 iStart;
+ USHORT nType;
+ USHORT nGetFocusFlags = GETFOCUS_TAB;
+ USHORT nNewIndex;
+ USHORT iStart;
if ( aKeyCode.IsShift() )
{
nType = DLGWINDOW_PREV;
@@ -619,7 +619,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pTempWindow->ImplControlFocus( nGetFocusFlags );
- return sal_True;
+ return TRUE;
}
else
{
@@ -641,21 +641,21 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return sal_True;
+ return TRUE;
}
}
}
else if ( nKeyCode == KEY_ESCAPE )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
iButtonStart = iButton;
while ( pButtonWindow )
{
if ( pButtonWindow->GetType() == WINDOW_CANCELBUTTON )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
@@ -664,9 +664,9 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- return sal_True;
+ return TRUE;
}
}
}
@@ -677,10 +677,10 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
// keine Alt-Taste abfangen, wegen Windows
if ( !aKeyCode.IsMod2() )
{
- sal_uInt16 nType;
- sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
- sal_uInt16 nNewIndex;
- sal_Bool bFormular = sal_False;
+ USHORT nType;
+ USHORT nGetFocusFlags = GETFOCUS_TAB;
+ USHORT nNewIndex;
+ BOOL bFormular = FALSE;
// Bei Ctrl-Tab erstmal testen, ob zwischen Formularen
// gesprungen werden soll
@@ -689,7 +689,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
// Gruppe suchen
Window* pFormularFirstWindow = NULL;
Window* pLastFormularFirstWindow = NULL;
- pTempWindow = ImplGetChildWindow( this, 0, iTemp, sal_False );
+ pTempWindow = ImplGetChildWindow( this, 0, iTemp, FALSE );
Window* pPrevFirstFormularFirstWindow = NULL;
Window* pFirstFormularFirstWindow = pTempWindow;
while ( pTempWindow )
@@ -697,7 +697,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() )
{
if ( iTemp != 0 )
- bFormular = sal_True;
+ bFormular = TRUE;
if ( aKeyCode.IsShift() )
{
if ( iTemp <= nIndex )
@@ -712,7 +712,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
pLastFormularFirstWindow = pTempWindow;
}
- pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, sal_False );
+ pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, FALSE );
if ( !iTemp )
pTempWindow = NULL;
}
@@ -727,9 +727,9 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
pFormularFirstWindow = pFirstFormularFirstWindow;
}
- sal_uInt16 nFoundFormStart = 0;
- sal_uInt16 nFoundFormEnd = 0;
- sal_uInt16 nTempIndex = 0;
+ USHORT nFoundFormStart = 0;
+ USHORT nFoundFormEnd = 0;
+ USHORT nTempIndex = 0;
if ( ::ImplFindDlgCtrlWindow( this, pFormularFirstWindow, nTempIndex,
nFoundFormStart, nFoundFormEnd ) )
{
@@ -738,7 +738,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( pFormularFirstWindow )
{
pFormularFirstWindow->ImplControlFocus();
- return sal_True;
+ return TRUE;
}
}
}
@@ -774,7 +774,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return sal_True;
+ return TRUE;
}
else if ( pWindow )
{
@@ -790,7 +790,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pWindow->ImplControlFocus( nGetFocusFlags );
- return sal_True;
+ return TRUE;
}
}
}
@@ -813,7 +813,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
{
if ( pWindow != pSWindow )
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return sal_True;
+ return TRUE;
}
if ( nStyle & WB_GROUP )
@@ -840,7 +840,7 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
if ( pWindow->IsVisible() && pWindow->IsEnabled() && pWindow->IsInputEnabled() )
{
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return sal_True;
+ return TRUE;
}
pWindow = pWindow->GetWindow( WINDOW_NEXT );
@@ -854,11 +854,11 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd );
if ( pSWindow )
{
- sal_uInt16 nGetFocusFlags = GETFOCUS_MNEMONIC;
+ USHORT nGetFocusFlags = GETFOCUS_MNEMONIC;
if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) )
nGetFocusFlags |= GETFOCUS_UNIQUEMNEMONIC;
pSWindow->ImplControlFocus( nGetFocusFlags );
- return sal_True;
+ return TRUE;
}
}
}
@@ -870,34 +870,36 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow) )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
- ((PushButton*)pButtonWindow)->SetPressed( sal_True );
+ ((PushButton*)pButtonWindow)->SetPressed( TRUE );
mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow;
}
else if ( mpWindowImpl->mpDlgCtrlDownWindow == pButtonWindow )
{
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- ((PushButton*)pButtonWindow)->SetPressed( sal_False );
+ ((PushButton*)pButtonWindow)->SetPressed( FALSE );
((PushButton*)pButtonWindow)->Click();
}
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
// checks if this window has dialog control
-sal_Bool Window::ImplHasDlgCtrl()
+BOOL Window::ImplHasDlgCtrl()
{
Window* pDlgCtrlParent;
+ Window* pDlgCtrl;
// lookup window for dialog control
+ pDlgCtrl = this;
pDlgCtrlParent = ImplGetParent();
while ( pDlgCtrlParent &&
!pDlgCtrlParent->ImplIsOverlapWindow() &&
@@ -905,9 +907,9 @@ sal_Bool Window::ImplHasDlgCtrl()
pDlgCtrlParent = pDlgCtrlParent->ImplGetParent();
if ( !pDlgCtrlParent || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
- return sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
void Window::ImplDlgCtrlNextWindow()
@@ -915,9 +917,9 @@ void Window::ImplDlgCtrlNextWindow()
Window* pDlgCtrlParent;
Window* pDlgCtrl;
Window* pSWindow;
- sal_uInt16 nIndex;
- sal_uInt16 nFormStart;
- sal_uInt16 nFormEnd;
+ USHORT nIndex;
+ USHORT nFormStart;
+ USHORT nFormEnd;
// lookup window for dialog control
pDlgCtrl = this;
@@ -944,14 +946,14 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G
// -----------------------------------------------------------------------
static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
- sal_Bool bGetFocus )
+ BOOL bGetFocus )
{
PushButton* pOldDefButton = NULL;
PushButton* pNewDefButton = NULL;
Window* pSWindow;
- sal_uInt16 i;
- sal_uInt16 nFormStart;
- sal_uInt16 nFormEnd;
+ USHORT i;
+ USHORT nFormStart;
+ USHORT nFormEnd;
// Formular suchen
pSWindow = ::ImplFindDlgCtrlWindow( pParent, pFocusWindow, i, nFormStart, nFormEnd );
@@ -961,7 +963,7 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
nFormEnd = 0xFFFF;
}
- pSWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_False );
+ pSWindow = ImplGetChildWindow( pParent, nFormStart, i, FALSE );
while ( pSWindow )
{
if ( pSWindow->ImplIsPushButton() )
@@ -975,14 +977,14 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
pNewDefButton = pPushButton;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
+ pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
if ( !i || (i > nFormEnd) )
pSWindow = NULL;
}
if ( !bGetFocus )
{
- sal_uInt16 nDummy;
+ USHORT nDummy;
Window* pNewFocusWindow = Application::GetFocusWindow();
if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) )
pNewDefButton = NULL;
@@ -994,19 +996,19 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
if ( pOldDefButton != pNewDefButton )
{
if ( pOldDefButton )
- pOldDefButton->ImplSetDefButton( sal_False );
+ pOldDefButton->ImplSetDefButton( FALSE );
if ( pNewDefButton )
- pNewDefButton->ImplSetDefButton( sal_True );
+ pNewDefButton->ImplSetDefButton( TRUE );
}
}
// -----------------------------------------------------------------------
-void Window::ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus )
+void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
@@ -1017,9 +1019,9 @@ void Window::ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus )
Window* Window::ImplFindDlgCtrlWindow( Window* pWindow )
{
- sal_uInt16 nIndex;
- sal_uInt16 nFormStart;
- sal_uInt16 nFormEnd;
+ USHORT nIndex;
+ USHORT nFormStart;
+ USHORT nFormEnd;
// Focus-Fenster in der Child-Liste suchen und zurueckgeben
return ::ImplFindDlgCtrlWindow( this, pWindow, nIndex, nFormStart, nFormEnd );
@@ -1045,7 +1047,7 @@ Window* Window::GetParentLabeledBy( const Window* ) const
static sal_Unicode getAccel( const String& rStr )
{
sal_Unicode nChar = 0;
- sal_uInt16 nPos = 0;
+ USHORT nPos = 0;
do
{
nPos = rStr.Search( '~', nPos );
@@ -1061,16 +1063,16 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
{
Window* pWindow = NULL;
- if( nMyType == WINDOW_FIXEDTEXT ||
- nMyType == WINDOW_FIXEDLINE ||
+ if( nMyType == WINDOW_FIXEDTEXT ||
+ nMyType == WINDOW_FIXEDLINE ||
nMyType == WINDOW_GROUPBOX )
{
// #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
// See tools/options/print for example.
- sal_Bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
+ BOOL bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
Window* pSWindow = NULL;
// get index, form start and form end
- sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0;
+ USHORT nIndex=0, nFormStart=0, nFormEnd=0;
pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabel,
nIndex,
@@ -1084,7 +1086,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
nAccel,
nFormStart,
nFormEnd,
- sal_False );
+ FALSE );
}
else
{
@@ -1096,12 +1098,12 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nIndex,
nIndex,
- sal_False );
+ FALSE );
if( pSWindow && pSWindow->IsVisible() && ! (pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
- if( nType != WINDOW_FIXEDTEXT &&
- nType != WINDOW_FIXEDLINE &&
+ if( nType != WINDOW_FIXEDTEXT &&
+ nType != WINDOW_FIXEDLINE &&
nType != WINDOW_GROUPBOX )
{
pWindow = pSWindow;
@@ -1119,15 +1121,11 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
return pWindow;
}
-Window* Window::GetAccessibleRelationLabelFor() const
+Window* Window::GetLabelFor() const
{
if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
return NULL;
- if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow )
- return mpWindowImpl->mpAccessibleInfos->pLabelForWindow;
-
-
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1165,7 +1163,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
- sal_uInt16 nIndex, nFormStart, nFormEnd;
+ USHORT nIndex, nFormStart, nFormEnd;
Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabeled,
nIndex,
@@ -1173,25 +1171,25 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
nFormEnd );
if( pSWindow && nIndex != nFormStart )
{
- if( nMyType == WINDOW_PUSHBUTTON ||
- nMyType == WINDOW_HELPBUTTON ||
- nMyType == WINDOW_OKBUTTON ||
+ if( nMyType == WINDOW_PUSHBUTTON ||
+ nMyType == WINDOW_HELPBUTTON ||
+ nMyType == WINDOW_OKBUTTON ||
nMyType == WINDOW_CANCELBUTTON )
{
nFormStart = nIndex-1;
}
- for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ for( USHORT nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
{
- sal_uInt16 nFoundIndex = 0;
+ USHORT nFoundIndex = 0;
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nSearchIndex,
nFoundIndex,
- sal_False );
+ FALSE );
if( pSWindow && pSWindow->IsVisible() && !(pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
- if ( ( nType == WINDOW_FIXEDTEXT ||
- nType == WINDOW_FIXEDLINE ||
+ if ( ( nType == WINDOW_FIXEDTEXT ||
+ nType == WINDOW_FIXEDLINE ||
nType == WINDOW_GROUPBOX ) )
{
// a fixed text can't be labeld by a fixed text.
@@ -1208,14 +1206,11 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
return pWindow;
}
-Window* Window::GetAccessibleRelationLabeledBy() const
+Window* Window::GetLabeledBy() const
{
if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
return NULL;
- if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow )
- return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
-
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1231,8 +1226,8 @@ Window* Window::GetAccessibleRelationLabeledBy() const
if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
return NULL;
-// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
-// GetType() == WINDOW_FIXEDLINE ||
+// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+// GetType() == WINDOW_FIXEDLINE ||
// GetType() == WINDOW_GROUPBOX ) )
// #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
// See tools/options/print for example.
@@ -1244,62 +1239,6 @@ Window* Window::GetAccessibleRelationLabeledBy() 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
@@ -1309,24 +1248,20 @@ KeyEvent Window::GetActivationKey() const
sal_Unicode nAccel = getAccel( GetText() );
if( ! nAccel )
{
- Window* pWindow = GetAccessibleRelationLabeledBy();
+ Window* pWindow = GetLabeledBy();
if( pWindow )
nAccel = getAccel( pWindow->GetText() );
}
if( nAccel )
{
- sal_uInt16 nCode = 0;
+ USHORT 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');
- else if( nAccel == '.' )
- nCode = KEY_POINT;
- else if( nAccel == '-' )
- nCode = KEY_SUBTRACT;
- KeyCode aKeyCode( nCode, sal_False, sal_False, sal_True, sal_False );
+ KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE );
aKeyEvent = KeyEvent( nAccel, aKeyCode );
}
return aKeyEvent;
diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx
index d9417e3bacf0..038e8d189954 100644
--- a/vcl/source/window/dndevdis.cxx
+++ b/vcl/source/window/dndevdis.cxx
@@ -195,7 +195,7 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
else
{
// fire dragOver on listeners of current window
- nListeners = fireDragOverEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
+ nListeners = fireDragOverEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
dtde.SourceActions );
}
diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx
index 4566852bc966..c27afb97f172 100644
--- a/vcl/source/window/dndlcon.cxx
+++ b/vcl/source/window/dndlcon.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,18 +37,18 @@ using namespace ::com::sun::star::datatransfer;
using namespace ::com::sun::star::datatransfer::dnd;
//==================================================================================================
-//
+//
//==================================================================================================
DNDListenerContainer::DNDListenerContainer( sal_Int8 nDefaultActions )
: WeakComponentImplHelper4< XDragGestureRecognizer, XDropTargetDragContext, XDropTargetDropContext, XDropTarget >(GetMutex())
{
m_bActive = sal_True;
- m_nDefaultActions = nDefaultActions;
+ m_nDefaultActions = nDefaultActions;
}
//==================================================================================================
-//
+//
//==================================================================================================
DNDListenerContainer::~DNDListenerContainer()
@@ -58,8 +58,8 @@ DNDListenerContainer::~DNDListenerContainer()
//==================================================================================================
// DNDListenerContainer::addDragGestureListener
//==================================================================================================
-
-void SAL_CALL DNDListenerContainer::addDragGestureListener( const Reference< XDragGestureListener >& dgl )
+
+void SAL_CALL DNDListenerContainer::addDragGestureListener( const Reference< XDragGestureListener >& dgl )
throw(RuntimeException)
{
rBHelper.addListener( getCppuType( ( const Reference< XDragGestureListener > * ) 0 ), dgl );
@@ -69,7 +69,7 @@ void SAL_CALL DNDListenerContainer::addDragGestureListener( const Reference< XDr
// DNDListenerContainer::removeDragGestureListener
//==================================================================================================
-void SAL_CALL DNDListenerContainer::removeDragGestureListener( const Reference< XDragGestureListener >& dgl )
+void SAL_CALL DNDListenerContainer::removeDragGestureListener( const Reference< XDragGestureListener >& dgl )
throw(RuntimeException)
{
rBHelper.removeListener( getCppuType( ( const Reference< XDragGestureListener > * ) 0 ), dgl );
@@ -79,16 +79,16 @@ void SAL_CALL DNDListenerContainer::removeDragGestureListener( const Reference<
// DNDListenerContainer::resetRecognizer
//==================================================================================================
-void SAL_CALL DNDListenerContainer::resetRecognizer( )
+void SAL_CALL DNDListenerContainer::resetRecognizer( )
throw(RuntimeException)
{
}
-
+
//==================================================================================================
// DNDListenerContainer::addDropTargetListener
//==================================================================================================
-void SAL_CALL DNDListenerContainer::addDropTargetListener( const Reference< XDropTargetListener >& dtl )
+void SAL_CALL DNDListenerContainer::addDropTargetListener( const Reference< XDropTargetListener >& dtl )
throw(RuntimeException)
{
rBHelper.addListener( getCppuType( ( const Reference< XDropTargetListener > * ) 0 ), dtl );
@@ -98,7 +98,7 @@ void SAL_CALL DNDListenerContainer::addDropTargetListener( const Reference< XDro
// DNDListenerContainer::removeDropTargetListener
//==================================================================================================
-void SAL_CALL DNDListenerContainer::removeDropTargetListener( const Reference< XDropTargetListener >& dtl )
+void SAL_CALL DNDListenerContainer::removeDropTargetListener( const Reference< XDropTargetListener >& dtl )
throw(RuntimeException)
{
rBHelper.removeListener( getCppuType( ( const Reference< XDropTargetListener > * ) 0 ), dtl );
@@ -108,7 +108,7 @@ void SAL_CALL DNDListenerContainer::removeDropTargetListener( const Reference< X
// DNDListenerContainer::isActive
//==================================================================================================
-sal_Bool SAL_CALL DNDListenerContainer::isActive( )
+sal_Bool SAL_CALL DNDListenerContainer::isActive( )
throw(RuntimeException)
{
return m_bActive;
@@ -118,7 +118,7 @@ sal_Bool SAL_CALL DNDListenerContainer::isActive( )
// DNDListenerContainer::setActive
//==================================================================================================
-void SAL_CALL DNDListenerContainer::setActive( sal_Bool active )
+void SAL_CALL DNDListenerContainer::setActive( sal_Bool active )
throw(RuntimeException)
{
m_bActive = active;
@@ -128,7 +128,7 @@ void SAL_CALL DNDListenerContainer::setActive( sal_Bool active )
// DNDListenerContainer::getDefaultActions
//==================================================================================================
-sal_Int8 SAL_CALL DNDListenerContainer::getDefaultActions( )
+sal_Int8 SAL_CALL DNDListenerContainer::getDefaultActions( )
throw(RuntimeException)
{
return m_nDefaultActions;
@@ -138,7 +138,7 @@ sal_Int8 SAL_CALL DNDListenerContainer::getDefaultActions( )
// DNDListenerContainer::setDefaultActions
//==================================================================================================
-void SAL_CALL DNDListenerContainer::setDefaultActions( sal_Int8 actions )
+void SAL_CALL DNDListenerContainer::setDefaultActions( sal_Int8 actions )
throw(RuntimeException)
{
m_nDefaultActions = actions;
@@ -148,7 +148,7 @@ void SAL_CALL DNDListenerContainer::setDefaultActions( sal_Int8 actions )
// DNDListenerContainer::fireDropEvent
//==================================================================================================
-sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDropContext >& context,
+sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDropContext >& context,
sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
const Reference< XTransferable >& transferable )
{
@@ -156,17 +156,17 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDropTargetListener > * ) 0) );
-
+
if( pContainer && m_bActive )
{
OInterfaceIteratorHelper aIterator( *pContainer );
-
+
// remember context to use in own context methods
m_xDropTargetDropContext = context;
// do not construct the event before you are sure at least one listener is registered
- DropTargetDropEvent aEvent( static_cast < XDropTarget * > (this), 0,
- static_cast < XDropTargetDropContext * > (this), dropAction,
+ DropTargetDropEvent aEvent( static_cast < XDropTarget * > (this), 0,
+ static_cast < XDropTargetDropContext * > (this), dropAction,
locationX, locationY, sourceActions, transferable );
while (aIterator.hasMoreElements())
@@ -226,10 +226,10 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop
sal_uInt32 DNDListenerContainer::fireDragExitEvent()
{
sal_uInt32 nRet = 0;
-
+
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDropTargetListener > * ) 0) );
-
+
if( pContainer && m_bActive )
{
OInterfaceIteratorHelper aIterator( *pContainer );
@@ -268,14 +268,14 @@ sal_uInt32 DNDListenerContainer::fireDragExitEvent()
// DNDListenerContainer::fireDragOverEvent
//==================================================================================================
-sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTargetDragContext >& context,
+sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTargetDragContext >& context,
sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions )
{
sal_uInt32 nRet = 0;
-
+
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDropTargetListener > * ) 0) );
-
+
if( pContainer && m_bActive )
{
OInterfaceIteratorHelper aIterator( *pContainer );
@@ -284,8 +284,8 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget
m_xDropTargetDragContext = context;
// do not construct the event before you are sure at least one listener is registered
- DropTargetDragEvent aEvent( static_cast < XDropTarget * > (this), 0,
- static_cast < XDropTargetDragContext * > (this),
+ DropTargetDragEvent aEvent( static_cast < XDropTarget * > (this), 0,
+ static_cast < XDropTargetDragContext * > (this),
dropAction, locationX, locationY, sourceActions );
while (aIterator.hasMoreElements())
@@ -336,14 +336,14 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget
//==================================================================================================
sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTargetDragContext >& context,
- sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
+ sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions,
const Sequence< DataFlavor >& dataFlavors )
{
sal_uInt32 nRet = 0;
-
+
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDropTargetListener > * ) 0) );
-
+
if( pContainer && m_bActive )
{
OInterfaceIteratorHelper aIterator( *pContainer );
@@ -352,7 +352,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge
m_xDropTargetDragContext = context;
// do not construct the event before you are sure at least one listener is registered
- DropTargetDragEnterEvent aEvent( static_cast < XDropTarget * > (this), 0,
+ DropTargetDragEnterEvent aEvent( static_cast < XDropTarget * > (this), 0,
static_cast < XDropTargetDragContext * > (this),
dropAction, locationX, locationY, sourceActions, dataFlavors );
@@ -407,10 +407,10 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD
sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions )
{
sal_uInt32 nRet = 0;
-
+
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDropTargetListener > * ) 0) );
-
+
if( pContainer && m_bActive )
{
OInterfaceIteratorHelper aIterator( *pContainer );
@@ -419,7 +419,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD
m_xDropTargetDragContext = context;
// do not construct the event before you are sure at least one listener is registered
- DropTargetDragEvent aEvent( static_cast < XDropTarget * > (this), 0,
+ DropTargetDragEvent aEvent( static_cast < XDropTarget * > (this), 0,
static_cast < XDropTargetDragContext * > (this),
dropAction, locationX, locationY, sourceActions );
@@ -474,16 +474,16 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_
sal_Int32 dragOriginY, const Reference< XDragSource >& dragSource, const Any& triggerEvent )
{
sal_uInt32 nRet = 0;
-
+
// fire DropTargetDropEvent on all XDropTargetListeners
OInterfaceContainerHelper *pContainer = rBHelper.getContainer( getCppuType( ( Reference < XDragGestureListener > * ) 0) );
-
+
if( pContainer )
{
OInterfaceIteratorHelper aIterator( *pContainer );
// do not construct the event before you are sure at least one listener is registered
- DragGestureEvent aEvent( static_cast < XDragGestureRecognizer * > (this), dragAction,
+ DragGestureEvent aEvent( static_cast < XDragGestureRecognizer * > (this), dragAction,
dragOriginX, dragOriginY, dragSource, triggerEvent );
while( aIterator.hasMoreElements() )
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index ded887c59933..646fa3156ebe 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -73,7 +73,7 @@ static void ImplInitBackground( DockingAreaWindow* pThis )
DockingAreaWindow::DockingAreaWindow( Window* pParent ) :
Window( WINDOW_DOCKINGAREA )
{
- ImplInit( pParent, WB_CLIPCHILDREN|WB_3DLOOK, NULL );
+ ImplInit( pParent, WB_CLIPCHILDREN|WB_3DLOOK, NULL );
mpImplData = new ImplData;
ImplInitBackground( this );
@@ -103,7 +103,7 @@ static void ImplInvalidateMenubar( DockingAreaWindow* pThis )
// due to a possible comon gradient covering menubar and top dockingarea
// the menubar must be repainted if the top dockingarea changes size or visibility
if( ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG &&
- (pThis->GetAlign() == WINDOWALIGN_TOP)
+ (pThis->GetAlign() == WINDOWALIGN_TOP)
&& pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL )
&& pThis->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
@@ -127,7 +127,7 @@ void DockingAreaWindow::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-sal_Bool DockingAreaWindow::IsHorizontal() const
+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( sal_True ); // only required because the toolkit curently switches this flag off
+ EnableNativeWidget( 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 = sal_True;
+ aControlValue.mbIsTopDockingArea = TRUE;
}
ControlState nState = CTRL_STATE_ENABLED;
@@ -168,13 +168,13 @@ void DockingAreaWindow::Paint( const Rectangle& )
// draw a single toolbar background covering the whole docking area
Point tmp;
Rectangle aCtrlRegion( tmp, GetOutputSizePixel() );
-
- DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
+
+ DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
// each toolbar gets a thin border to better recognize its borders on the homogeneous docking area
- sal_uInt16 nChildren = GetChildCount();
- for( sal_uInt16 n = 0; n < nChildren; n++ )
+ USHORT nChildren = GetChildCount();
+ for( USHORT n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
if ( pChild->IsVisible() )
@@ -195,11 +195,11 @@ void DockingAreaWindow::Paint( const Rectangle& )
}
else
{
- // create map to find toolbar lines
+ // create map to find toolbar lines
Size aOutSz = GetOutputSizePixel();
std::map< int, int > ranges;
- sal_uInt16 nChildren = GetChildCount();
- for( sal_uInt16 n = 0; n < nChildren; n++ )
+ USHORT nChildren = GetChildCount();
+ for( USHORT n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
Point aPos = pChild->GetPosPixel();
@@ -229,7 +229,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
aTBRect.Top() = 0;
aTBRect.Bottom() = aOutSz.Height() - 1;
}
- DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
+ DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
aTBRect, nState, aControlValue, rtl::OUString() );
}
}
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 017fdc5390db..b472b8ccc0a1 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,13 +59,13 @@ class ImplDockFloatWin2 : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockWin;
- sal_uLong mnLastTicks;
- Timer maDockTimer;
- Timer maEndDockTimer;
- Point maDockPos;
- Rectangle maDockRect;
- sal_Bool mbInMove;
- sal_uLong mnLastUserEvent;
+ ULONG mnLastTicks;
+ Timer maDockTimer;
+ Timer maEndDockTimer;
+ Point maDockPos;
+ Rectangle maDockRect;
+ BOOL mbInMove;
+ ULONG mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin2* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin2* );
@@ -75,20 +75,20 @@ public:
ImplDockingWindowWrapper* pDockingWin );
~ImplDockFloatWin2();
- virtual void Move();
- virtual void Resize();
- virtual void TitleButtonClick( sal_uInt16 nButton );
- virtual void Pin();
- virtual void Roll();
- virtual void PopupModeEnd();
- virtual void Resizing( Size& rSize );
- virtual sal_Bool Close();
+ virtual void Move();
+ virtual void Resize();
+ virtual void TitleButtonClick( USHORT nButton );
+ virtual void Pin();
+ virtual void Roll();
+ virtual void PopupModeEnd();
+ virtual void Resizing( Size& rSize );
+ virtual BOOL Close();
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
+ USHORT nFlags = WINDOW_POSSIZE_ALL );
- sal_uLong GetLastTicks() const { return mnLastTicks; }
+ ULONG GetLastTicks() const { return mnLastTicks; }
};
// =======================================================================
@@ -98,16 +98,16 @@ ImplDockFloatWin2::ImplDockFloatWin2( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( sal_False ),
+ mbInMove( FALSE ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetWindow()->GetSettings() );
- Enable( pDockingWin->GetWindow()->IsEnabled(), sal_False );
- EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), sal_False );
- AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), sal_False );
+ Enable( pDockingWin->GetWindow()->IsEnabled(), FALSE );
+ EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), FALSE );
+ AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), 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, sal_False );
+ mpDockWin->EndDocking( maDockRect, 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, sal_True );
+ mpDockWin->EndDocking( maDockRect, TRUE );
}
else
{
@@ -186,7 +186,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
Window *pDockingArea = mpDockWin->GetWindow()->GetParent();
PointerState aState = pDockingArea->GetPointerState();
- sal_Bool bRealMove = sal_True;
+ BOOL bRealMove = TRUE;
if( GetStyle() & WB_OWNERDRAWDECORATION )
{
// for windows with ownerdraw decoration
@@ -207,14 +207,14 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
PointerState aBorderState = pBorder->GetPointerState();
if( aBorderRect.IsInside( aBorderState.maPos ) )
- bRealMove = sal_True;
+ bRealMove = TRUE;
else
- bRealMove = sal_False;
+ bRealMove = FALSE;
}
}
- if( mpDockWin->IsDockable() &&
- mpDockWin->GetWindow()->IsVisible() &&
+ if( mpDockWin->IsDockable() &&
+ mpDockWin->GetWindow()->IsVisible() &&
(Time::GetSystemTicks() - mnLastTicks > 500) &&
( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) &&
!(aState.mnState & KEY_MOD1) && // i43499 CTRL disables docking now
@@ -229,7 +229,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
if( ! mpDockWin->IsDocking() )
mpDockWin->StartDocking( aMousePos, maDockRect );
- sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
if( ! bFloatMode )
{
@@ -247,7 +247,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
EndDockTimerHdl( this );
}
}
- mbInMove = sal_False;
+ mbInMove = FALSE;
return 0;
}
// -----------------------------------------------------------------------
@@ -257,7 +257,7 @@ void ImplDockFloatWin2::Move()
if( mbInMove )
return;
- mbInMove = sal_True;
+ mbInMove = TRUE;
FloatingWindow::Move();
mpDockWin->GetWindow()->Move();
@@ -289,7 +289,7 @@ void ImplDockFloatWin2::Resize()
void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
}
@@ -297,7 +297,7 @@ void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
// -----------------------------------------------------------------------
-void ImplDockFloatWin2::TitleButtonClick( sal_uInt16 nButton )
+void ImplDockFloatWin2::TitleButtonClick( USHORT nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -337,7 +337,7 @@ void ImplDockFloatWin2::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-sal_Bool ImplDockFloatWin2::Close()
+BOOL ImplDockFloatWin2::Close()
{
return mpDockWin->Close();
}
@@ -373,33 +373,33 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const Window
return NULL;
}
-sal_Bool DockingManager::IsDockable( const Window *pWindow )
+BOOL DockingManager::IsDockable( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
/*
if( pWindow->HasDockingHandler() )
- return sal_True;
+ return TRUE;
*/
return (pWrapper != NULL);
}
-sal_Bool DockingManager::IsFloating( const Window *pWindow )
+BOOL DockingManager::IsFloating( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
return pWrapper->IsFloatingMode();
else
- return sal_False;
+ return FALSE;
}
-sal_Bool DockingManager::IsLocked( const Window *pWindow )
+BOOL DockingManager::IsLocked( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsLocked() )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return 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, sal_Bool bFloating )
+void DockingManager::SetFloatingMode( const Window *pWindow, BOOL bFloating )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
pWrapper->SetFloatingMode( bFloating );
}
-void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, sal_uLong nFlags )
+void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, ULONG nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -433,18 +433,18 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWin
void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow )
{
StartPopupMode( pParentToolBox, pWindow, FLOATWIN_POPUPMODE_ALLOWTEAROFF |
- FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
+ FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
}
-sal_Bool DockingManager::IsInPopupMode( const Window *pWindow )
+BOOL DockingManager::IsInPopupMode( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsInPopupMode() )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -488,7 +488,7 @@ void DockingManager::RemoveWindow( const Window *pWindow )
void DockingManager::SetPosSizePixel( Window *pWindow, long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -512,14 +512,14 @@ Rectangle DockingManager::GetPosSizePixel( const Window *pWindow )
// if TEAROFF_DASHED defined a single dashed line is used
// otherwise multiple smaller lines will be painted
-//#define TEAROFF_DASHED
+//#define TEAROFF_DASHED
// size of the drag area
#ifdef TEAROFF_DASHED
-#define POPUP_DRAGBORDER 2
-#define POPUP_DRAGGRIP 5
+#define POPUP_DRAGBORDER 2
+#define POPUP_DRAGGRIP 5
#else
-#define POPUP_DRAGBORDER 3
+#define POPUP_DRAGBORDER 3
#define POPUP_DRAGGRIP 5
#endif
#define POPUP_DRAGHEIGHT (POPUP_DRAGGRIP+POPUP_DRAGBORDER+POPUP_DRAGBORDER)
@@ -529,13 +529,13 @@ class ImplPopupFloatWin : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockingWin;
- sal_Bool mbHighlight;
- sal_Bool mbMoving;
- bool mbTrackingEnabled;
+ BOOL mbHighlight;
+ BOOL mbMoving;
+ bool mbTrackingEnabled;
Point maDelta;
Point maTearOffPosition;
- bool mbGripAtBottom;
- bool mbHasGrip;
+ bool mbGripAtBottom;
+ bool mbHasGrip;
void ImplSetBorder();
public:
@@ -557,19 +557,19 @@ public:
void DrawGrip();
void DrawBorder();
- bool hasGrip() const { return mbHasGrip; }
+ bool hasGrip() const { return mbHasGrip; }
};
-ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) :
+ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) :
FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW)
{
- mpWindowImpl->mbToolbarFloatingWindow = sal_True; // indicate window type, required for accessibility
+ mpWindowImpl->mbToolbarFloatingWindow = TRUE; // indicate window type, required for accessibility
// which should not see this window as a toplevel window
mpDockingWin = pDockingWin;
- mbHighlight = sal_False;
- mbMoving = sal_False;
- mbTrackingEnabled = sal_False;
- mbGripAtBottom = sal_True;
+ mbHighlight = FALSE;
+ mbMoving = FALSE;
+ mbTrackingEnabled = FALSE;
+ mbGripAtBottom = TRUE;
mbHasGrip = bHasGrip;
ImplSetBorder();
@@ -586,7 +586,7 @@ ImplPopupFloatWin::~ImplPopupFloatWin()
// this is to avoid appearance of this window as standalone window in the accessibility hierarchy
// as this window is only used as a helper for subtoolbars that are not teared-off, the parent toolbar
- // has to provide accessibility support (as implemented in the toolkit)
+ // has to provide accessibility support (as implemented in the toolkit)
// so the contained toolbar should appear as child of the correponsing toolbar item of the parent toolbar
return ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >();
}
@@ -617,7 +617,7 @@ void ImplPopupFloatWin::ImplSetBorder()
void ImplPopupFloatWin::Resize()
{
// the borderview overwrites the border during resize so restore it
- ImplSetBorder();
+ ImplSetBorder();
}
Rectangle ImplPopupFloatWin::GetDragRect() const
@@ -679,9 +679,9 @@ void ImplPopupFloatWin::DrawBorder()
void ImplPopupFloatWin::DrawGrip()
{
- sal_Bool bLinecolor = IsLineColor();
+ BOOL bLinecolor = IsLineColor();
Color aLinecolor = GetLineColor();
- sal_Bool bFillcolor = IsFillColor();
+ BOOL bFillcolor = IsFillColor();
Color aFillcolor = GetFillColor();
// draw background
@@ -694,7 +694,7 @@ void ImplPopupFloatWin::DrawGrip()
if( mbHighlight )
{
Erase( aRect );
- DrawSelectionBackground( aRect, 2, sal_False, sal_True, sal_False );
+ DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE );
}
else
{
@@ -740,8 +740,8 @@ void ImplPopupFloatWin::DrawGrip()
//aRect.nLeft = aRect.nLeft + (aRect.getWidth() - width) / 2;
aRect.nLeft = (aRect.nLeft + aRect.nRight - width) / 2;
aRect.nRight = aRect.nLeft + width;
-
- int i=0;
+
+ int i=0;
while( i< POPUP_DRAGGRIP )
{
DrawRect( aRect );
@@ -781,18 +781,18 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) )
{
// start window move
- mbMoving = sal_True;
+ mbMoving = TRUE;
StartTracking( STARTTRACK_NOKEYCANCEL );
return;
}
if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
{
- mbHighlight = sal_True;
+ mbHighlight = TRUE;
DrawGrip();
}
if( mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) )
{
- mbHighlight = sal_False;
+ mbHighlight = FALSE;
DrawGrip();
}
}
@@ -829,14 +829,14 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbMoving = sal_False;
+ mbMoving = FALSE;
EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
}
else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
{
// move the window according to mouse pos
PointerState aState = GetParent()->GetPointerState();
- if (ImplHasMirroredGraphics() && IsRTLEnabled())
+ if (ImplHasMirroredGraphics() && IsRTLEnabled())
ImplMirrorFramePos(aState.maPos);
maTearOffPosition = aState.maPos - maDelta;
GetWindow( WINDOW_BORDER )->SetPosPixel( maTearOffPosition );
@@ -853,39 +853,39 @@ ImplDockingWindowWrapper::ImplDockingWindowWrapper( const Window *pWindow )
mpDockingWindow = (Window*) pWindow;
mpParent = pWindow->GetParent();
- mbDockable = sal_True;
- mbLocked = sal_False;
+ mbDockable = TRUE;
+ mbLocked = 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 = sal_False;
+ mbStartDockingEnabled = FALSE;
}
ImplDockingWindowWrapper::~ImplDockingWindowWrapper()
{
if ( IsFloatingMode() )
{
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( sal_False );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( FALSE );
}
}
// -----------------------------------------------------------------------
-sal_Bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
+BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return sal_False;
+ return FALSE;
if( !mbStartDockingEnabled )
- return sal_False;
+ return FALSE;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = sal_True;
+ mbDocking = TRUE;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -929,7 +929,7 @@ sal_Bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
GetWindow()->ImplGetFrameWindow()->ImplUpdateAll();
GetWindow()->StartTracking( STARTTRACK_KEYMOD );
- return sal_True;
+ return TRUE;
}
// =======================================================================
@@ -938,15 +938,15 @@ void ImplDockingWindowWrapper::ImplInitData()
{
mpDockingWindow = NULL;
- //GetWindow()->mpWindowImpl->mbDockWin = sal_True; // TODO: must be eliminated
+ //GetWindow()->mpWindowImpl->mbDockWin = TRUE; // TODO: must be eliminated
mpFloatWin = NULL;
- mbDockCanceled = sal_False;
- mbFloatPrevented = sal_False;
- mbDocking = sal_False;
- mbPined = sal_False;
- mbRollUp = sal_False;
- mbDockBtn = sal_False;
- mbHideBtn = sal_False;
+ mbDockCanceled = FALSE;
+ mbFloatPrevented = FALSE;
+ mbDocking = FALSE;
+ mbPined = FALSE;
+ mbRollUp = FALSE;
+ mbDockBtn = FALSE;
+ mbHideBtn = FALSE;
maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
}
@@ -959,13 +959,13 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = sal_False;
+ mbDocking = FALSE;
GetWindow()->HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = sal_True;
+ mbDockCanceled = TRUE;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = sal_False;
+ mbDockCanceled = 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();
- sal_Bool bFloatMode = Docking( aPos, aTrackRect );
+ BOOL bFloatMode = Docking( aPos, aTrackRect );
- mbFloatPrevented = sal_False;
+ mbFloatPrevented = FALSE;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -1018,7 +1018,7 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
mbLastFloatMode = bFloatMode;
}
- sal_uInt16 nTrackStyle;
+ USHORT 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 = sal_True;
+ mbDocking = TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
+BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
{
DockingData data( rPoint, rRect, IsFloatingMode() );
@@ -1071,18 +1071,18 @@ sal_Bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRec
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
+void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
{
Rectangle aRect( rRect );
if ( !IsDockingCanceled() )
{
- sal_Bool bShow = sal_False;
+ BOOL bShow = FALSE;
if ( bFloatMode != IsFloatingMode() )
{
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = sal_True;
+ bShow = TRUE;
if ( bFloatMode )
{
// #i44800# always use outputsize - as in all other places
@@ -1098,30 +1098,30 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFlo
}
if ( bShow )
- GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
}
EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_ENDDOCKING, &data );
- mbDocking = sal_False;
+ mbDocking = FALSE;
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = sal_False;
+ mbStartDockingEnabled = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ImplDockingWindowWrapper::PrepareToggleFloatingMode()
+BOOL ImplDockingWindowWrapper::PrepareToggleFloatingMode()
{
- sal_Bool bFloating = sal_True;
+ BOOL bFloating = TRUE;
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_PREPARETOGGLEFLOATING, &bFloating );
return bFloating;
}
// -----------------------------------------------------------------------
-sal_Bool ImplDockingWindowWrapper::Close()
+BOOL ImplDockingWindowWrapper::Close()
{
// TODO: send event
/*
@@ -1129,15 +1129,15 @@ sal_Bool ImplDockingWindowWrapper::Close()
ImplAddDel( &aDelData );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return sal_False;
+ return FALSE;
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
*/
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -1145,7 +1145,7 @@ sal_Bool ImplDockingWindowWrapper::Close()
void ImplDockingWindowWrapper::ToggleFloatingMode()
{
// notify dockingwindow/toolbox
- // note: this must be done *before* notifying the
+ // note: this must be done *before* notifying the
// listeners to have the toolbox in the proper state
if( GetWindow()->ImplIsDockingWindow() )
((DockingWindow*) GetWindow())->ToggleFloatingMode();
@@ -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 = sal_False;
+ mbStartDockingEnabled = FALSE;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::TitleButtonClick( sal_uInt16 nType )
+void ImplDockingWindowWrapper::TitleButtonClick( USHORT nType )
{
if( nType == TITLE_BUTTON_MENU )
{
@@ -1208,7 +1208,7 @@ void ImplDockingWindowWrapper::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
+void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -1223,7 +1223,7 @@ void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVi
// -----------------------------------------------------------------------
-sal_Bool ImplDockingWindowWrapper::IsTitleButtonVisible( sal_uInt16 nButton ) const
+BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -1231,20 +1231,20 @@ sal_Bool ImplDockingWindowWrapper::IsTitleButtonVisible( sal_uInt16 nButton ) co
{
if ( nButton == TITLE_BUTTON_DOCKING )
return mbDockBtn;
- else // if ( nButton == TITLE_BUTTON_HIDE )
+ else // if ( nButton == TITLE_BUTTON_HIDE )
return mbHideBtn;
}
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLong nFlags )
+void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nFlags )
{
// do nothing if window is floating
if( IsFloatingMode() )
return;
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
// prepare reparenting
Window* pRealParent = GetWindow()->GetWindow( WINDOW_PARENT );
@@ -1301,7 +1301,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLon
IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
{
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
// set parameter for handler before destroying floating window
ImplPopupFloatWin *pPopupFloatWin = (ImplPopupFloatWin*) mpFloatWin;
@@ -1313,7 +1313,7 @@ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
if ( mpOldBorderWin )
{
GetWindow()->SetParent( mpOldBorderWin );
- ((ImplBorderWindow*)mpOldBorderWin)->GetBorder(
+ ((ImplBorderWindow*)mpOldBorderWin)->GetBorder(
GetWindow()->mpWindowImpl->mnLeftBorder, GetWindow()->mpWindowImpl->mnTopBorder,
GetWindow()->mpWindowImpl->mnRightBorder, GetWindow()->mpWindowImpl->mnBottomBorder );
mpOldBorderWin->Resize();
@@ -1332,17 +1332,17 @@ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
}
-sal_Bool ImplDockingWindowWrapper::IsInPopupMode() const
+BOOL ImplDockingWindowWrapper::IsInPopupMode() const
{
if( GetFloatingWindow() )
return GetFloatingWindow()->IsInPopupMode();
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
+void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
{
// do nothing if window is docked and locked
if( !IsFloatingMode() && IsLocked() )
@@ -1352,11 +1352,11 @@ void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
{
if ( PrepareToggleFloatingMode() )
{
- sal_Bool bVisible = GetWindow()->IsVisible();
+ BOOL bVisible = GetWindow()->IsVisible();
if ( bFloatMode )
{
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
maDockPos = GetWindow()->GetPosPixel();
@@ -1371,7 +1371,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ?
mnFloatBits | WB_SYSTEMWINDOW
//#ifdef __USE_OWNERDRAWDECORATION__
- | WB_OWNERDRAWDECORATION
+ | WB_OWNERDRAWDECORATION
//#endif
: mnFloatBits,
this );
@@ -1422,13 +1422,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
mpFloatWin = pWin;
if ( bVisible )
- GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
ToggleFloatingMode();
}
else
{
- GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
// FloatingDaten wird im FloatingWindow speichern
maFloatPos = mpFloatWin->GetPosPixel();
@@ -1445,7 +1445,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
if ( mpOldBorderWin )
{
GetWindow()->SetParent( mpOldBorderWin );
- ((ImplBorderWindow*)mpOldBorderWin)->GetBorder(
+ ((ImplBorderWindow*)mpOldBorderWin)->GetBorder(
GetWindow()->mpWindowImpl->mnLeftBorder, GetWindow()->mpWindowImpl->mnTopBorder,
GetWindow()->mpWindowImpl->mnRightBorder, GetWindow()->mpWindowImpl->mnBottomBorder );
mpOldBorderWin->Resize();
@@ -1493,7 +1493,7 @@ void ImplDockingWindowWrapper::SetTabStop()
void ImplDockingWindowWrapper::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- sal_uInt16 nFlags )
+ USHORT 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( sal_Bool bPin )
+void ImplDockingWindowWrapper::SetPin( BOOL bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-sal_Bool ImplDockingWindowWrapper::IsPined() const
+BOOL ImplDockingWindowWrapper::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -1579,17 +1579,17 @@ void ImplDockingWindowWrapper::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = sal_True;
+ mbRollUp = TRUE;
}
void ImplDockingWindowWrapper::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = sal_False;
+ mbRollUp = FALSE;
}
-sal_Bool ImplDockingWindowWrapper::IsRollUp() const
+BOOL ImplDockingWindowWrapper::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
@@ -1646,7 +1646,7 @@ void ImplDockingWindowWrapper::SetFloatingPos( const Point& rNewPos )
maFloatPos = rNewPos;
}
-sal_Bool ImplDockingWindowWrapper::IsFloatingMode() const
+BOOL ImplDockingWindowWrapper::IsFloatingMode() const
{
return (mpFloatWin != NULL);
}
@@ -1664,7 +1664,7 @@ Rectangle ImplDockingWindowWrapper::GetDragArea() const
void ImplDockingWindowWrapper::Lock()
{
- mbLocked = sal_True;
+ mbLocked = TRUE;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
@@ -1673,14 +1673,14 @@ void ImplDockingWindowWrapper::Lock()
void ImplDockingWindowWrapper::Unlock()
{
- mbLocked = sal_False;
+ mbLocked = FALSE;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
pToolBox->Lock( mbLocked );
}
-sal_Bool ImplDockingWindowWrapper::IsLocked() const
+BOOL ImplDockingWindowWrapper::IsLocked() const
{
return mbLocked;
}
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index c9b71b01f78e..7e575b66205e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,8 +59,8 @@ public:
ImplData();
~ImplData();
- Window* mpParent;
- Size maMaxOutSize;
+ Window* mpParent;
+ Size maMaxOutSize;
};
DockingWindow::ImplData::ImplData()
@@ -79,12 +79,12 @@ class ImplDockFloatWin : public FloatingWindow
{
private:
DockingWindow* mpDockWin;
- sal_uLong mnLastTicks;
- Timer maDockTimer;
- Point maDockPos;
- Rectangle maDockRect;
- sal_Bool mbInMove;
- sal_uLong mnLastUserEvent;
+ ULONG mnLastTicks;
+ Timer maDockTimer;
+ Point maDockPos;
+ Rectangle maDockRect;
+ BOOL mbInMove;
+ ULONG mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin* );
@@ -93,16 +93,16 @@ public:
DockingWindow* pDockingWin );
~ImplDockFloatWin();
- virtual void Move();
- virtual void Resize();
- virtual void TitleButtonClick( sal_uInt16 nButton );
- virtual void Pin();
- virtual void Roll();
- virtual void PopupModeEnd();
- virtual void Resizing( Size& rSize );
- virtual sal_Bool Close();
+ virtual void Move();
+ virtual void Resize();
+ virtual void TitleButtonClick( USHORT nButton );
+ virtual void Pin();
+ virtual void Roll();
+ virtual void PopupModeEnd();
+ virtual void Resizing( Size& rSize );
+ virtual BOOL Close();
- sal_uLong GetLastTicks() const { return mnLastTicks; }
+ ULONG GetLastTicks() const { return mnLastTicks; }
};
@@ -111,16 +111,16 @@ ImplDockFloatWin::ImplDockFloatWin( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( sal_False ),
+ mbInMove( FALSE ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetSettings() );
- Enable( pDockingWin->IsEnabled(), sal_False );
- EnableInput( pDockingWin->IsInputEnabled(), sal_False );
- AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), sal_False );
+ Enable( pDockingWin->IsEnabled(), FALSE );
+ EnableInput( pDockingWin->IsInputEnabled(), FALSE );
+ AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), 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, sal_True );
+ mpDockWin->EndDocking( maDockRect, 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, sal_False );
+ mpDockWin->EndDocking( maDockRect, FALSE );
}
else
{
@@ -175,8 +175,8 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
PointerState aState = mpDockWin->GetParent()->GetPointerState();
mnLastUserEvent = 0;
- if( mpDockWin->IsDockable() &&
- (Time::GetSystemTicks() - mnLastTicks > 500) &&
+ if( mpDockWin->IsDockable() &&
+ (Time::GetSystemTicks() - mnLastTicks > 500) &&
( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) &&
!(aState.mnState & KEY_MOD1) ) // i43499 CTRL disables docking now
{
@@ -190,7 +190,7 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
// mouse pos also in screen pixels
Point aMousePos = mpDockWin->GetParent()->OutputToScreenPixel( aState.maPos );
- sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ 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, sal_True );
+ mpDockWin->EndDocking( maDockRect, TRUE );
}
}
- mbInMove = sal_False;
+ mbInMove = FALSE;
return 0;
}
// -----------------------------------------------------------------------
@@ -213,7 +213,7 @@ void ImplDockFloatWin::Move()
if( mbInMove )
return;
- mbInMove = sal_True;
+ mbInMove = TRUE;
FloatingWindow::Move();
mpDockWin->Move();
@@ -241,7 +241,7 @@ void ImplDockFloatWin::Resize()
// -----------------------------------------------------------------------
-void ImplDockFloatWin::TitleButtonClick( sal_uInt16 nButton )
+void ImplDockFloatWin::TitleButtonClick( USHORT nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -281,21 +281,21 @@ void ImplDockFloatWin::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-sal_Bool ImplDockFloatWin::Close()
+BOOL ImplDockFloatWin::Close()
{
return mpDockWin->Close();
}
// =======================================================================
-sal_Bool DockingWindow::ImplStartDocking( const Point& rPos )
+BOOL DockingWindow::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return sal_False;
+ return FALSE;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = sal_True;
+ mbDocking = TRUE;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -328,17 +328,17 @@ sal_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 = sal_True;
+ mbDragFull = TRUE;
else
{
StartDocking();
- mbDragFull = sal_False;
+ mbDragFull = FALSE;
ImplUpdateAll();
ImplGetFrameWindow()->ImplUpdateAll();
}
StartTracking( STARTTRACK_KEYMOD );
- return sal_True;
+ return TRUE;
}
// =======================================================================
@@ -346,17 +346,17 @@ sal_Bool DockingWindow::ImplStartDocking( const Point& rPos )
void DockingWindow::ImplInitDockingWindowData()
{
mpImplData = new ImplData;
- mpWindowImpl->mbDockWin = sal_True;
+ mpWindowImpl->mbDockWin = TRUE;
mpFloatWin = NULL;
- mbDockCanceled = sal_False;
- mbDockPrevented = sal_False;
- mbFloatPrevented = sal_False;
- mbDocking = sal_False;
- mbPined = sal_False;
- mbRollUp = sal_False;
- mbDockBtn = sal_False;
- mbHideBtn = sal_False;
+ mbDockCanceled = FALSE;
+ mbDockPrevented = FALSE;
+ mbFloatPrevented = FALSE;
+ mbDocking = FALSE;
+ mbPined = FALSE;
+ mbRollUp = FALSE;
+ mbDockBtn = FALSE;
+ mbHideBtn = FALSE;
}
// -----------------------------------------------------------------------
@@ -405,7 +405,7 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
{
Window::ImplLoadRes( rResId );
- sal_uLong nMask = ReadLongRes();
+ 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 ( (sal_Bool)ReadShortRes() )
- SetFloatingMode( sal_True );
+ if ( (BOOL)ReadShortRes() )
+ SetFloatingMode( TRUE );
}
}
@@ -477,8 +477,8 @@ DockingWindow::~DockingWindow()
{
if ( IsFloatingMode() )
{
- Show( sal_False, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( sal_False );
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( FALSE );
}
delete mpImplData;
}
@@ -494,7 +494,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = sal_False;
+ mbDocking = FALSE;
if ( mbDragFull )
{
// Bei Abbruch alten Zustand wieder herstellen
@@ -510,9 +510,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = sal_True;
+ mbDockCanceled = TRUE;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = sal_False;
+ mbDockCanceled = 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();
- sal_Bool bFloatMode = Docking( aFramePos, aTrackRect );
- mbDockPrevented = sal_False;
- mbFloatPrevented = sal_False;
+ BOOL bFloatMode = Docking( aFramePos, aTrackRect );
+ mbDockPrevented = FALSE;
+ mbFloatPrevented = FALSE;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -582,7 +582,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
}
else
{
- sal_uInt16 nTrackStyle;
+ USHORT 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 sal_True;
+ return TRUE;
}
else if ( pMEvt->GetClicks() == 1 )
{
@@ -640,7 +640,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
}
ImplStartDocking( aPos );
}
- return sal_True;
+ return TRUE;
}
}
}
@@ -651,7 +651,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
rKey.IsShift() && rKey.IsMod1() )
{
SetFloatingMode( !IsFloatingMode() );
- return sal_True;
+ return TRUE;
}
}
}
@@ -663,28 +663,28 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
void DockingWindow::StartDocking()
{
- mbDocking = sal_True;
+ mbDocking = TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool DockingWindow::Docking( const Point&, Rectangle& )
+BOOL DockingWindow::Docking( const Point&, Rectangle& )
{
return IsFloatingMode();
}
// -----------------------------------------------------------------------
-void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
+void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
{
if ( !IsDockingCanceled() )
{
- sal_Bool bShow = sal_False;
+ BOOL bShow = FALSE;
if ( bFloatMode != IsFloatingMode() )
{
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = sal_True;
+ bShow = TRUE;
if ( bFloatMode && mpFloatWin )
mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
}
@@ -698,32 +698,32 @@ void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
if ( bShow )
Show();
}
- mbDocking = sal_False;
+ mbDocking = FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool DockingWindow::PrepareToggleFloatingMode()
+BOOL DockingWindow::PrepareToggleFloatingMode()
{
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-sal_Bool DockingWindow::Close()
+BOOL DockingWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return sal_False;
+ return FALSE;
- Show( sal_False, SHOW_NOFOCUSCHANGE );
- return sal_True;
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -734,7 +734,7 @@ void DockingWindow::ToggleFloatingMode()
// -----------------------------------------------------------------------
-void DockingWindow::TitleButtonClick( sal_uInt16 )
+void DockingWindow::TitleButtonClick( USHORT )
{
}
@@ -791,7 +791,7 @@ void DockingWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void DockingWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
+void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -806,7 +806,7 @@ void DockingWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
// -----------------------------------------------------------------------
-sal_Bool DockingWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
+BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -821,7 +821,7 @@ sal_Bool DockingWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
// -----------------------------------------------------------------------
-void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
+void DockingWindow::SetFloatingMode( BOOL bFloatMode )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -833,11 +833,11 @@ void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
{
if ( PrepareToggleFloatingMode() ) // changes to floating mode can be vetoed
{
- sal_Bool bVisible = IsVisible();
+ BOOL bVisible = IsVisible();
if ( bFloatMode )
{
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
maDockPos = Window::GetPosPixel();
@@ -886,7 +886,7 @@ void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
}
else
{
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( 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,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -1093,7 +1093,7 @@ Point DockingWindow::GetFloatingPos() const
return maFloatPos;
}
-sal_Bool DockingWindow::IsFloatingMode() const
+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 2c21ec7a83d1..816bd63d215c 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,8 +51,8 @@ public:
ImplData();
~ImplData();
- ToolBox* mpBox;
- Rectangle maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window
+ ToolBox* mpBox;
+ Rectangle maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window
};
FloatingWindow::ImplData::ImplData()
@@ -75,9 +75,9 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
{
mpImplData = new ImplData;
- mpWindowImpl->mbFloatWin = sal_True;
- mbInCleanUp = sal_False;
- mbGrabFocus = sal_False;
+ mpWindowImpl->mbFloatWin = TRUE;
+ mbInCleanUp = FALSE;
+ mbGrabFocus = 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 = sal_True;
+ mpWindowImpl->mbOverlapWin = 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 = sal_True;
- mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = TRUE;
+ mpWindowImpl->mbOverlapWin = TRUE;
SystemWindow::ImplInit( pParent, nFloatWinStyle & ~WB_BORDER, NULL );
}
else
{
ImplBorderWindow* pBorderWin;
- sal_uInt16 nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT;
+ USHORT 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( sal_True );
+ pBorderWin->SetDisplayActive( 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 = sal_False;
- mbPopupMode = sal_False;
- mbPopupModeCanceled = sal_False;
- mbPopupModeTearOff = sal_False;
- mbMouseDown = sal_False;
+ mbInPopupMode = FALSE;
+ mbPopupMode = FALSE;
+ mbPopupModeCanceled = FALSE;
+ mbPopupModeTearOff = FALSE;
+ mbMouseDown = FALSE;
ImplInitSettings();
}
@@ -191,7 +191,7 @@ void FloatingWindow::ImplLoadRes( const ResId& rResId )
{
SystemWindow::ImplLoadRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ 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, sal_uLong nFlags, sal_uInt16& rArrangeIndex )
+Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& 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, sal_uLong nFlags,
- sal_uInt16& rArrangeIndex )
+ const Rectangle& rRect, ULONG nFlags,
+ USHORT& rArrangeIndex )
{
// Fenster-Position ermitteln
Point aPos;
@@ -262,9 +262,9 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Rectangle normRect( rRect ); // rRect is already relative to top-level window
normRect.SetPos( pW->ScreenToOutputPixel( normRect.TopLeft() ) );
- sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
+ BOOL bRTL = Application::GetSettings().GetLayoutRTL();
- Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ),
+ Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ),
pW->OutputToAbsoluteScreenPixel( normRect.BottomRight() ) );
Rectangle devRectRTL( devRect );
@@ -276,9 +276,9 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Application::GetBestScreen( bRTL ? devRectRTL : devRect ) );
- sal_uInt16 nArrangeAry[5];
- sal_uInt16 nArrangeIndex;
- sal_Bool bBreak;
+ USHORT nArrangeAry[5];
+ USHORT nArrangeIndex;
+ 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 = sal_True;
+ bBreak = TRUE;
switch ( nArrangeAry[nArrangeIndex] )
{
@@ -331,21 +331,21 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() )
- bBreak = sal_False;
+ bBreak = FALSE;
}
else
{
if ( aPos.X() < aScreenRect.Left() )
- bBreak = sal_False;
+ bBreak = FALSE;
}
if( bBreak )
- {
+ {
e1 = devRect.TopLeft();
e2 = devRect.BottomLeft();
// set non-zero width
e2.X()++;
// don't clip corners
- e1.Y()++;
+ e1.Y()++;
e2.Y()--;
}
break;
@@ -355,21 +355,21 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() )
- bBreak = sal_False;
+ bBreak = FALSE;
}
else
{
if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
- bBreak = sal_False;
+ bBreak = FALSE;
}
if( bBreak )
- {
+ {
e1 = devRect.TopRight();
e2 = devRect.BottomRight();
// set non-zero width
e2.X()++;
// don't clip corners
- e1.Y()++;
+ e1.Y()++;
e2.Y()--;
}
break;
@@ -377,30 +377,30 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
aPos.X() = devRect.Left();
aPos.Y() = devRect.Top()-aSize.Height()+1;
if ( aPos.Y() < aScreenRect.Top() )
- bBreak = sal_False;
+ bBreak = FALSE;
if( bBreak )
- {
+ {
e1 = devRect.TopLeft();
e2 = devRect.TopRight();
// set non-zero height
e2.Y()++;
// don't clip corners
- e1.X()++;
+ e1.X()++;
e2.X()--;
}
break;
case FLOATWIN_POPUPMODE_DOWN:
aPos = devRect.BottomLeft();
if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
- bBreak = sal_False;
+ bBreak = FALSE;
if( bBreak )
- {
+ {
e1 = devRect.BottomLeft();
e2 = devRect.BottomRight();
// set non-zero height
e2.Y()++;
// don't clip corners
- e1.X()++;
+ e1.X()++;
e2.X()--;
}
break;
@@ -463,7 +463,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
// -----------------------------------------------------------------------
-FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest )
+FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest )
{
FloatingWindow* pWin = this;
@@ -483,7 +483,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
else
aAbsolute = Point( pReference->OutputToAbsoluteScreenPixel(
pReference->ScreenToOutputPixel(rPos) ) );
-
+
do
{
// compute the floating window's size in absolute screen coordinates
@@ -499,8 +499,8 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
return pWin;
}
- // test, if mouse is in rectangle, (this is typically the rect of the active
- // toolbox item or similar)
+ // test, if mouse is in rectangle, (this is typically the rect of the active
+ // toolbox item or similar)
// note: maFloatRect is set in FloatingWindow::StartPopupMode() and
// is already in absolute device coordinates
if ( pWin->maFloatRect.IsInside( aAbsolute ) )
@@ -538,20 +538,20 @@ FloatingWindow* FloatingWindow::ImplFindLastLevelFloat()
// -----------------------------------------------------------------------
-sal_Bool FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
+BOOL FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
{
FloatingWindow* pWin = this;
do
{
if ( pWin->mpFirstPopupModeWin == pWindow )
- return sal_True;
+ return TRUE;
pWin = pWin->mpNextFloat;
}
while ( pWin );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -560,7 +560,7 @@ IMPL_LINK( FloatingWindow, ImplEndPopupModeHdl, void*, EMPTYARG )
{
mnPostId = 0;
mnPopupModeFlags = 0;
- mbPopupMode = sal_False;
+ mbPopupMode = FALSE;
PopupModeEnd();
return 0;
}
@@ -577,12 +577,12 @@ long FloatingWindow::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_ESCAPE) && (GetStyle() & WB_CLOSEABLE) )
{
Close();
- return sal_True;
+ return TRUE;
}
}
}
@@ -622,7 +622,7 @@ void FloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
void FloatingWindow::ImplCallPopupModeEnd()
{
// PopupMode wurde beendet
- mbInPopupMode = sal_False;
+ mbInPopupMode = FALSE;
// Handler asyncron rufen
if ( !mnPostId )
@@ -638,13 +638,13 @@ void FloatingWindow::PopupModeEnd()
// -----------------------------------------------------------------------
-void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
+void FloatingWindow::SetTitleType( USHORT nTitle )
{
if ( (mnTitle != nTitle) && mpWindowImpl->mpBorderWindow )
{
mnTitle = nTitle;
Size aOutSize = GetOutputSizePixel();
- sal_uInt16 nTitleStyle;
+ USHORT nTitleStyle;
if ( nTitle == FLOATWIN_TITLE_NORMAL )
nTitleStyle = BORDERWINDOW_TITLE_SMALL;
else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
@@ -660,16 +660,16 @@ void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
+void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
{
// avoid flickering
if ( IsVisible() )
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
if ( IsRollUp() )
RollDown();
- // remove title
+ // remove title
mnOldTitle = mnTitle;
if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && GetText().Len() )
SetTitleType( FLOATWIN_TITLE_POPUP );
@@ -688,7 +688,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
// compute window position according to flags and arrangement
- sal_uInt16 nArrangeIndex;
+ USHORT nArrangeIndex;
SetPosPixel( ImplCalcPos( this, rRect, nFlags, nArrangeIndex ) );
// set data and display window
@@ -709,11 +709,11 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
maFloatRect.Right() += 2;
maFloatRect.Bottom() += 2;
mnPopupModeFlags = nFlags;
- mbInPopupMode = sal_True;
- mbPopupMode = sal_True;
- mbPopupModeCanceled = sal_False;
- mbPopupModeTearOff = sal_False;
- mbMouseDown = sal_False;
+ mbInPopupMode = TRUE;
+ mbPopupMode = TRUE;
+ mbPopupModeCanceled = FALSE;
+ mbPopupModeTearOff = FALSE;
+ mbMouseDown = FALSE;
mbOldSaveBackMode = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -725,22 +725,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS )
{
// force key input even without focus (useful for menues)
- mbGrabFocus = sal_True;
+ mbGrabFocus = TRUE;
}
- Show( sal_True, SHOW_NOACTIVATE );
+ Show( TRUE, SHOW_NOACTIVATE );
}
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
+void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
{
// get selected button
- sal_uInt16 nItemId = pBox->GetDownItemId();
+ USHORT nItemId = pBox->GetDownItemId();
if ( !nItemId )
return;
mpImplData->mpBox = pBox;
- pBox->ImplFloatControl( sal_True, this );
+ pBox->ImplFloatControl( TRUE, this );
// retrieve some data from the ToolBox
Rectangle aRect = pBox->GetItemRect( nItemId );
@@ -750,15 +750,15 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
aRect.SetPos( aPos );
nFlags |=
- FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
-// FLOATWIN_POPUPMODE_NOMOUSECLOSE |
+ FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
+// FLOATWIN_POPUPMODE_NOMOUSECLOSE |
FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
-// FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE | // #105968# floating toolboxes should close when clicked in (parent's) float rect
+// FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE | // #105968# floating toolboxes should close when clicked in (parent's) float rect
FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE;
-// | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+// | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
/*
- * FLOATWIN_POPUPMODE_NOKEYCLOSE |
+ * FLOATWIN_POPUPMODE_NOKEYCLOSE |
* don't set since it disables closing floaters with escape
*/
@@ -779,31 +779,31 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
// -----------------------------------------------------------------------
-void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
+void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
{
if ( !mbInPopupMode )
return;
ImplSVData* pSVData = ImplGetSVData();
- mbInCleanUp = sal_True; // prevent killing this window due to focus change while working with it
+ mbInCleanUp = 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 )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
-
+
// Fenster aus der Liste austragen
pSVData->maWinData.mpFirstFloat = mpNextFloat;
mpNextFloat = NULL;
- sal_uLong nPopupModeFlags = mnPopupModeFlags;
+ ULONG nPopupModeFlags = mnPopupModeFlags;
// Wenn nicht abgerissen wurde, dann Fenster wieder Hiden
if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) ||
!(nPopupModeFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) )
{
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
// Focus evt. auf ein entsprechendes FloatingWindow weiterschalten
if ( nFocusId )
@@ -811,13 +811,13 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
else if ( pSVData->maWinData.mpFocusWin && pSVData->maWinData.mpFirstFloat &&
ImplIsWindowOrChild( pSVData->maWinData.mpFocusWin ) )
pSVData->maWinData.mpFirstFloat->GrabFocus();
- mbPopupModeTearOff = sal_False;
+ mbPopupModeTearOff = FALSE;
}
else
{
- mbPopupModeTearOff = sal_True;
+ mbPopupModeTearOff = TRUE;
if ( nFocusId )
- Window::EndSaveFocus( nFocusId, sal_False );
+ Window::EndSaveFocus( nFocusId, FALSE );
}
EnableSaveBackground( mbOldSaveBackMode );
@@ -829,7 +829,7 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
// ToolBox wieder auf normal schalten
if ( mpImplData->mpBox )
{
- mpImplData->mpBox->ImplFloatControl( sal_False, this );
+ mpImplData->mpBox->ImplFloatControl( FALSE, this );
mpImplData->mpBox = NULL;
}
@@ -850,12 +850,12 @@ void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
}
}
- mbInCleanUp = sal_False;
+ mbInCleanUp = FALSE;
}
// -----------------------------------------------------------------------
-void FloatingWindow::EndPopupMode( sal_uInt16 nFlags )
+void FloatingWindow::EndPopupMode( USHORT nFlags )
{
ImplEndPopupMode( nFlags );
}
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
index a0926ec789ad..b662b054a761 100644
--- a/vcl/source/window/introwin.cxx
+++ b/vcl/source/window/introwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index 1f15019999e5..250b82010855 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -2,14 +2,11 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* 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
@@ -32,7 +29,30 @@
// 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 -
@@ -58,9 +78,131 @@ 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()
{
- return SystemChildWindow::GetParentWindowHandle( sal_True );
+ 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;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 05370f3a029f..19ff6c93178e 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,7 @@
// =======================================================================
-static sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
+static USHORT 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 sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
// -----------------------------------------------------------------------
-void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 )
+void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 )
{
- sal_uInt16 nIndex = (sal_uInt16)eFunc;
+ USHORT nIndex = (USHORT)eFunc;
nIndex *= 4;
rCode1 = aImplKeyFuncTab[nIndex];
rCode2 = aImplKeyFuncTab[nIndex+1];
@@ -80,7 +80,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2,
KeyCode::KeyCode( KeyFuncType eFunction )
{
- sal_uInt16 nDummy;
+ USHORT nDummy;
ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy );
eFunc = eFunction;
}
@@ -96,18 +96,18 @@ KeyCode::KeyCode( const ResId& rResId )
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- sal_uLong nKeyCode = pResMgr->ReadLong();
- sal_uLong nModifier = pResMgr->ReadLong();
- sal_uLong nKeyFunc = pResMgr->ReadLong();
+ ULONG nKeyCode = pResMgr->ReadLong();
+ ULONG nModifier = pResMgr->ReadLong();
+ ULONG nKeyFunc = pResMgr->ReadLong();
eFunc = (KeyFuncType)nKeyFunc;
if ( eFunc != KEYFUNC_DONTKNOW )
{
- sal_uInt16 nDummy;
+ USHORT nDummy;
ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy );
}
else
- nCode = sal::static_int_cast<sal_uInt16>(nKeyCode | nModifier);
+ nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier);
}
}
@@ -136,15 +136,15 @@ KeyFuncType KeyCode::GetFunction() const
if ( eFunc != KEYFUNC_DONTKNOW )
return eFunc;
- sal_uInt16 nCompCode = GetModifier() | GetCode();
+ USHORT nCompCode = GetModifier() | GetCode();
if ( nCompCode )
{
- for ( sal_uInt16 i = (sal_uInt16)KEYFUNC_NEW; i < (sal_uInt16)KEYFUNC_FRONT; i++ )
+ for ( USHORT i = (USHORT)KEYFUNC_NEW; i < (USHORT)KEYFUNC_FRONT; i++ )
{
- sal_uInt16 nKeyCode1;
- sal_uInt16 nKeyCode2;
- sal_uInt16 nKeyCode3;
- sal_uInt16 nKeyCode4;
+ USHORT nKeyCode1;
+ USHORT nKeyCode2;
+ USHORT nKeyCode3;
+ USHORT 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 db8144c3d648..9a2b4dc1db7c 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -72,11 +72,11 @@ void KeyEvent::InitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent ) const
}
KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
-{
+{
KeyEvent aClone(*this);
- sal_uInt16 nCode = maKeyCode.GetCode();
- sal_uInt16 nMod = maKeyCode.GetAllModifier();
+ USHORT nCode = maKeyCode.GetCode();
+ USHORT nMod = maKeyCode.GetAllModifier();
switch (eMode)
{
@@ -92,11 +92,11 @@ KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
switch (nCode)
{
case KEY_DOWN: aClone.maKeyCode = KeyCode(KEY_RIGHT, nMod); break;
- case KEY_UP: aClone.maKeyCode = KeyCode(KEY_LEFT, nMod); break;
- case KEY_LEFT: aClone.maKeyCode = KeyCode(KEY_DOWN, nMod); break;
+ case KEY_UP: aClone.maKeyCode = KeyCode(KEY_LEFT, nMod); break;
+ case KEY_LEFT: aClone.maKeyCode = KeyCode(KEY_DOWN, nMod); break;
case KEY_RIGHT: aClone.maKeyCode = KeyCode(KEY_UP, nMod); break;
}
- break;
+ break;
case TextDirectionality_LeftToRight_TopToBottom:
/* do nothing */
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 1c63376dfda5..82ce26f8e78e 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -85,8 +85,6 @@ 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 6ab9dda55fc2..e269766321b6 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,9 +1,8 @@
-
/* -*- 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
@@ -32,6 +31,7 @@
#include "svsys.h"
#include "vcl/salinst.hxx"
+#include "tools/list.hxx"
#include "tools/debug.hxx"
#include "tools/diagnose_ex.h"
#include "vcl/svdata.hxx"
@@ -81,9 +81,9 @@ namespace vcl
struct MenuLayoutData : public ControlLayoutData
{
- std::vector< sal_uInt16 > m_aLineItemIds;
- std::vector< sal_uInt16 > m_aLineItemPositions;
- std::map< sal_uInt16, Rectangle > m_aVisibleItemBoundRects;
+ std::vector< USHORT > m_aLineItemIds;
+ std::vector< USHORT > m_aLineItemPositions;
+ std::map< USHORT, Rectangle > m_aVisibleItemBoundRects;
};
}
@@ -97,7 +97,6 @@ DBG_NAME( Menu )
#define EXTRASPACEY 2
#define EXTRAITEMHEIGHT 4
-#define GUTTERBORDER 8
// document closer
#define IID_DOCUMENTCLOSE 1
@@ -106,32 +105,32 @@ DBG_NAME( Menu )
#include <xwphook.h>
-// return sal_True if hilite should be executed: left mouse button down
+// return TRUE if hilite should be executed: left mouse button down
// or xwp mouse hook enabled
-static sal_Bool ImplHilite( const MouseEvent& rMEvt )
+static BOOL ImplHilite( const MouseEvent& rMEvt )
{
- static sal_Bool init = sal_False;
+ static BOOL init = FALSE;
static HOOKCONFIG hc;
// read XWP settings at program startup
- if (init == sal_False) {
- sal_Bool rc;
- sal_uLong cb = sizeof(HOOKCONFIG);
+ if (init == FALSE) {
+ BOOL rc;
+ ULONG cb = sizeof(HOOKCONFIG);
memset(&hc, 0, sizeof(HOOKCONFIG));
rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG,
&hc, &cb);
- init = sal_True;
+ init = TRUE;
}
// check mouse left button
if (rMEvt.GetButtons() == MOUSE_LEFT)
- return sal_True;
+ return TRUE;
// return xwp flag
return hc.fSlidingMenus;
}
#endif
-static sal_Bool ImplAccelDisabled()
+static BOOL ImplAccelDisabled()
{
// display of accelerator strings may be suppressed via configuration
static int nAccelDisabled = -1;
@@ -144,34 +143,34 @@ static sal_Bool ImplAccelDisabled()
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuppressAccelerators" ) ) );
nAccelDisabled = aStr.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (nAccelDisabled == 1) ? sal_True : sal_False;
+ return (nAccelDisabled == 1) ? TRUE : FALSE;
}
struct MenuItemData
{
- sal_uInt16 nId; // SV Id
- MenuItemType eType; // MenuItem-Type
- MenuItemBits nBits; // MenuItem-Bits
- Menu* pSubMenu; // Pointer auf das SubMenu
- Menu* pAutoSubMenu; // Pointer auf SubMenu aus Resource
- XubString aText; // Menu-Text
- XubString aHelpText; // Help-String
- XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
- XubString aCommandStr; // CommandString
+ USHORT nId; // SV Id
+ MenuItemType eType; // MenuItem-Type
+ MenuItemBits nBits; // MenuItem-Bits
+ Menu* pSubMenu; // Pointer auf das SubMenu
+ Menu* pAutoSubMenu; // Pointer auf SubMenu aus Resource
+ XubString aText; // Menu-Text
+ XubString aHelpText; // Help-String
+ XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
+ XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- rtl::OString aHelpId; // Help-Id
- sal_uLong nUserValue; // User value
- Image aImage; // Image
- KeyCode aAccelKey; // Accelerator-Key
- 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
- XubString aAccessibleDescription; // accessible description
+ ULONG nHelpId; // Help-Id
+ 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;
+ long nItemImageAngle;
+ Size aSz; // nur temporaer gueltig
+ XubString aAccessibleName; // accessible name
+ XubString aAccessibleDescription; // accessible description
SalMenuItem* pSalMenuItem; // access to native menu
@@ -189,7 +188,7 @@ struct MenuItemData
return bChecked || ( nBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) );
}
};
-
+
MenuItemData::~MenuItemData()
{
if( pAutoSubMenu )
@@ -212,22 +211,22 @@ public:
MenuItemList() : List( 16, 4 ) {}
~MenuItemList();
- MenuItemData* Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits,
+ MenuItemData* Insert( USHORT nId, MenuItemType eType, MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, sal_uInt16 nPos );
- void InsertSeparator( sal_uInt16 nPos );
- void Remove( sal_uInt16 nPos );
+ Menu* pMenu, USHORT nPos );
+ void InsertSeparator( USHORT nPos );
+ void Remove( USHORT nPos );
- 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
+ MenuItemData* GetData( USHORT nSVId, USHORT& rPos ) const;
+ MenuItemData* GetData( USHORT nSVId ) const
+ { USHORT nTemp; return GetData( nSVId, nTemp ); }
+ MenuItemData* GetDataFromPos( ULONG nPos ) const
{ return (MenuItemData*)List::GetObject( nPos ); }
- 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;
+ 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;
uno::Reference< i18n::XCharacterClassification > GetCharClass() const;
};
@@ -236,31 +235,32 @@ public:
MenuItemList::~MenuItemList()
{
- for ( sal_uLong n = Count(); n; )
+ for ( ULONG n = Count(); n; )
{
MenuItemData* pData = GetDataFromPos( --n );
delete pData;
}
}
-MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType,
+MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, sal_uInt16 nPos )
-{
- MenuItemData* pData = new MenuItemData( rStr, rImage );
- pData->nId = nId;
- pData->eType = eType;
- pData->nBits = nBits;
- pData->pSubMenu = NULL;
- pData->pAutoSubMenu = NULL;
- pData->nUserValue = 0;
- pData->bChecked = sal_False;
- pData->bEnabled = sal_True;
- pData->bVisible = sal_True;
- pData->bIsTemporary = sal_False;
- pData->bMirrorMode = sal_False;
- pData->nItemImageAngle = 0;
+ Menu* pMenu, USHORT nPos )
+{
+ MenuItemData* pData = new MenuItemData( rStr, rImage );
+ pData->nId = nId;
+ pData->eType = 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->nItemImageAngle = 0;
SalItemParams aSalMIData;
aSalMIData.nId = nId;
@@ -277,21 +277,22 @@ MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType,
return pData;
}
-void MenuItemList::InsertSeparator( sal_uInt16 nPos )
+void MenuItemList::InsertSeparator( USHORT nPos )
{
- MenuItemData* pData = new MenuItemData;
- pData->nId = 0;
- pData->eType = MENUITEM_SEPARATOR;
- pData->nBits = 0;
- pData->pSubMenu = NULL;
- pData->pAutoSubMenu = NULL;
- pData->nUserValue = 0;
- pData->bChecked = sal_False;
- pData->bEnabled = sal_True;
- pData->bVisible = sal_True;
- pData->bIsTemporary = sal_False;
- pData->bMirrorMode = sal_False;
- pData->nItemImageAngle = 0;
+ MenuItemData* pData = new MenuItemData;
+ pData->nId = 0;
+ pData->eType = MENUITEM_SEPARATOR;
+ 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->nItemImageAngle = 0;
SalItemParams aSalMIData;
aSalMIData.nId = 0;
@@ -307,14 +308,14 @@ void MenuItemList::InsertSeparator( sal_uInt16 nPos )
List::Insert( (void*)pData, nPos );
}
-void MenuItemList::Remove( sal_uInt16 nPos )
+void MenuItemList::Remove( USHORT nPos )
{
- MenuItemData* pData = (MenuItemData*)List::Remove( (sal_uLong)nPos );
+ MenuItemData* pData = (MenuItemData*)List::Remove( (ULONG)nPos );
if ( pData )
delete pData;
}
-MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const
+MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const
{
rPos = 0;
MenuItemData* pData = (MenuItemData*)GetObject( rPos );
@@ -330,14 +331,14 @@ MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const
return NULL;
}
-MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const
+MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const
{
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- sal_uInt16 nListCount = (sal_uInt16)Count();
+ USHORT nListCount = (USHORT)Count();
// try character code first
- nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates
+ nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates
if( nDuplicates )
{
for ( rPos = 0; rPos < nListCount; rPos++)
@@ -346,7 +347,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) )
{
if( nDuplicates > 1 && rPos == nCurrentPos )
- continue; // select next entry with the same mnemonic
+ continue; // select next entry with the same mnemonic
else
return pData;
}
@@ -354,7 +355,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
}
// nothing found, try keycode instead
- nDuplicates = GetItemCount( aKeyCode ); // return number of duplicates
+ nDuplicates = GetItemCount( aKeyCode ); // return number of duplicates
if( nDuplicates )
{
@@ -367,19 +368,19 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
MenuItemData* pData = GetDataFromPos( rPos );
if ( pData->bEnabled )
{
- sal_uInt16 n = pData->aText.Search( '~' );
+ USHORT n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
xub_Unicode mnUnicode = pData->aText.GetChar(n+1);
Window* pDefWindow = ImplGetDefaultWindow();
- if( (pDefWindow && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( mnUnicode, Application::GetSettings().GetUILanguage(), mnKeyCode )
+ if( (pDefWindow && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( mnUnicode, Application::GetSettings().GetUILanguage(), mnKeyCode )
&& aKeyCode.GetCode() == mnKeyCode.GetCode())
|| (ascii && rI18nHelper.MatchMnemonic( pData->aText, ascii ) ) )
{
if( nDuplicates > 1 && rPos == nCurrentPos )
- continue; // select next entry with the same mnemonic
+ continue; // select next entry with the same mnemonic
else
return pData;
}
@@ -391,13 +392,13 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
return NULL;
}
-sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
+USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
{
// returns number of entries with same mnemonic
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- sal_uInt16 nItems = 0, nPos;
- for ( nPos = (sal_uInt16)Count(); nPos; )
+ USHORT nItems = 0, nPos;
+ for ( nPos = (USHORT)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) )
@@ -407,7 +408,7 @@ sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
return nItems;
}
-sal_uInt16 MenuItemList::GetItemCount( KeyCode aKeyCode ) const
+USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const
{
// returns number of entries with same mnemonic
// uses key codes instead of character codes
@@ -416,20 +417,20 @@ sal_uInt16 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));
- sal_uInt16 nItems = 0, nPos;
- for ( nPos = (sal_uInt16)Count(); nPos; )
+ USHORT nItems = 0, nPos;
+ for ( nPos = (USHORT)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled )
{
- sal_uInt16 n = pData->aText.Search( '~' );
+ USHORT n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
// if MapUnicodeToKeyCode fails or is unsupported we try the pure ascii mapping of the keycodes
// so we have working shortcuts when ascii mnemonics are used
Window* pDefWindow = ImplGetDefaultWindow();
- if( (pDefWindow && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( pData->aText.GetChar(n+1), Application::GetSettings().GetUILanguage(), mnKeyCode )
+ if( (pDefWindow && pDefWindow->ImplGetFrame()->MapUnicodeToKeyCode( pData->aText.GetChar(n+1), Application::GetSettings().GetUILanguage(), mnKeyCode )
&& aKeyCode.GetCode() == mnKeyCode.GetCode())
|| ( ascii && rI18nHelper.MatchMnemonic( pData->aText, ascii ) ) )
nItems++;
@@ -464,21 +465,21 @@ private:
Timer aHighlightChangedTimer;
Timer aSubmenuCloseTimer;
Timer aScrollTimer;
- sal_uLong nSaveFocusId;
+ ULONG nSaveFocusId;
// long nStartY;
- 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;
+ 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;
DECL_LINK( PopupEnd, FloatingWindow* );
DECL_LINK( HighlightChanged, Timer* );
@@ -487,18 +488,18 @@ private:
DECL_LINK( ShowHideListener, VclWindowEvent* );
void StateChanged( StateChangedType nType );
- void DataChanged( const DataChangedEvent& rDCEvt );
+ void DataChanged( const DataChangedEvent& rDCEvt );
protected:
- Region ImplCalcClipRegion( sal_Bool bIncludeLogo = sal_True ) const;
+ Region ImplCalcClipRegion( BOOL bIncludeLogo = TRUE ) const;
void ImplInitClipRegion();
- void ImplDrawScroller( sal_Bool bUp );
+ void ImplDrawScroller( BOOL bUp );
using Window::ImplScroll;
void ImplScroll( const Point& rMousePos );
- void ImplScroll( sal_Bool bUp );
- void ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd = sal_False );
- void ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown );
+ void ImplScroll( BOOL bUp );
+ void ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd = FALSE );
+ void ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown );
long ImplGetStartY() const;
- Rectangle ImplGetItemRect( sal_uInt16 nPos );
+ Rectangle ImplGetItemRect( USHORT nPos );
public:
MenuFloatingWindow( Menu* pMenu, Window* pParent, WinBits nStyle );
@@ -515,27 +516,27 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Resize();
- void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
- sal_uLong GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
+ ULONG GetFocusId() const { return nSaveFocusId; }
- void EnableScrollMenu( sal_Bool b );
- sal_Bool IsScrollMenu() const { return bScrollMenu; }
- sal_uInt16 GetScrollerHeight() const { return nScrollerHeight; }
+ void EnableScrollMenu( BOOL b );
+ BOOL IsScrollMenu() const { return bScrollMenu; }
+ USHORT GetScrollerHeight() const { return nScrollerHeight; }
void Execute();
- void StopExecute( sal_uLong nFocusId = 0 );
+ void StopExecute( ULONG nFocusId = 0 );
void EndExecute();
- void EndExecute( sal_uInt16 nSelectId );
+ void EndExecute( USHORT nSelectId );
PopupMenu* GetActivePopup() const { return pActivePopup; }
void KillActivePopup( PopupMenu* pThisOnly = NULL );
- void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight );
- void ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer );
- sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
+ void HighlightItem( USHORT nPos, BOOL bHighlight );
+ void ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer );
+ USHORT GetHighlightedItem() const { return nHighlightedItem; }
- void SetPosInParent( sal_uInt16 nPos ) { nPosInParent = nPos; }
- sal_uInt16 GetPosInParent() const { return nPosInParent; }
+ void SetPosInParent( USHORT nPos ) { nPosInParent = nPos; }
+ USHORT GetPosInParent() const { return nPosInParent; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
};
@@ -561,6 +562,7 @@ public:
Size getMinSize();
Image maImage;
+ Image maImageHC;
};
DecoToolBox::DecoToolBox( Window* pParent, WinBits nStyle ) :
@@ -598,7 +600,7 @@ void DecoToolBox::calcMinSize()
if( GetItemCount() == 0 )
{
ResMgr* pResMgr = ImplGetResMgr();
-
+
Bitmap aBitmap;
if( pResMgr )
aBitmap = Bitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) );
@@ -606,15 +608,15 @@ void DecoToolBox::calcMinSize()
}
else
{
- sal_uInt16 nItems = GetItemCount();
- for( sal_uInt16 i = 0; i < nItems; i++ )
+ USHORT nItems = GetItemCount();
+ for( USHORT i = 0; i < nItems; i++ )
{
- sal_uInt16 nId = GetItemId( i );
+ USHORT nId = GetItemId( i );
aTbx.InsertItem( nId, GetItemImage( nId ) );
}
}
aTbx.SetOutStyle( TOOLBOX_STYLE_FLAT );
- maMinSize = aTbx.CalcWindowSizePixel();
+ maMinSize = aTbx.CalcWindowSizePixel();
}
Size DecoToolBox::getMinSize()
@@ -636,20 +638,21 @@ void DecoToolBox::SetImages( long nMaxHeight, bool bForce )
{
lastSize = nMaxHeight - border;
- Color aEraseColor( 255, 255, 255, 255 );
- BitmapEx aBmpExDst( maImage.GetBitmapEx() );
- BitmapEx aBmpExSrc( aBmpExDst );
-
+ Color aEraseColor( 255, 255, 255, 255 );
+ BitmapEx aBmpExDst( maImage.GetBitmapEx() );
+ BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ maImageHC.GetBitmapEx() : aBmpExDst );
+
aEraseColor.SetTransparency( 255 );
aBmpExDst.Erase( aEraseColor );
aBmpExDst.SetSizePixel( Size( lastSize, lastSize ) );
-
+
Rectangle aSrcRect( Point(0,0), maImage.GetSizePixel() );
- Rectangle aDestRect( Point((lastSize - maImage.GetSizePixel().Width())/2,
- (lastSize - maImage.GetSizePixel().Height())/2 ),
+ Rectangle aDestRect( Point((lastSize - maImage.GetSizePixel().Width())/2,
+ (lastSize - maImage.GetSizePixel().Height())/2 ),
maImage.GetSizePixel() );
-
+
aBmpExDst.CopyPixel( aDestRect, aSrcRect, &aBmpExSrc );
SetItemImage( IID_DOCUMENTCLOSE, Image( aBmpExDst ) );
}
@@ -670,35 +673,35 @@ class MenuBarWindow : public Window
private:
struct AddButtonEntry
{
- sal_uInt16 m_nId;
+ USHORT m_nId;
Link m_aSelectLink;
Link m_aHighlightLink;
-
+
AddButtonEntry() : m_nId( 0 ) {}
};
Menu* pMenu;
PopupMenu* pActivePopup;
- sal_uInt16 nHighlightedItem;
- sal_uLong nSaveFocusId;
- sal_Bool mbAutoPopup;
- sal_Bool bIgnoreFirstMove;
- sal_Bool bStayActive;
+ USHORT nHighlightedItem;
+ ULONG nSaveFocusId;
+ BOOL mbAutoPopup;
+ BOOL bIgnoreFirstMove;
+ BOOL bStayActive;
DecoToolBox aCloser;
PushButton aFloatBtn;
PushButton aHideBtn;
+
+ std::map< USHORT, AddButtonEntry > m_aAddButtons;
- std::map< sal_uInt16, AddButtonEntry > m_aAddButtons;
-
- 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 );
-
- 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 HighlightItem( USHORT nPos, BOOL bHighlight );
+ void ChangeHighlightItem( USHORT n, BOOL bSelectPopupEntry, BOOL bAllowRestoreFocus = TRUE, BOOL bDefaultToDocument = TRUE );
+ USHORT ImplFindEntry( const Point& rMousePos ) const;
+ void ImplCreatePopup( BOOL bPreSelectFirst );
+ BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE );
+ Rectangle ImplGetItemRect( USHORT nPos );
+
void ImplInitStyleSettings();
DECL_LINK( CloserHdl, PushButton* );
@@ -716,7 +719,7 @@ public:
MenuBarWindow( Window* pParent );
~MenuBarWindow();
- void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
+ void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -726,26 +729,26 @@ public:
virtual void Resize();
virtual void RequestHelp( const HelpEvent& rHEvt );
- void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
- sal_uLong GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
+ ULONG GetFocusId() const { return nSaveFocusId; }
void SetMenu( MenuBar* pMenu );
void KillActivePopup();
PopupMenu* GetActivePopup() const { return pActivePopup; }
void PopupClosed( Menu* pMenu );
- sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
+ USHORT GetHighlightedItem() const { return nHighlightedItem; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- void SetAutoPopup( sal_Bool bAuto ) { mbAutoPopup = bAuto; }
+ void SetAutoPopup( BOOL bAuto ) { mbAutoPopup = bAuto; }
void ImplLayoutChanged();
Size MinCloseButtonSize();
-
+
// add an arbitrary button to the menubar (will appear next to closer)
- 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 );
+ 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 );
};
static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValue )
@@ -775,24 +778,24 @@ static void ImplSetMenuItemData( MenuItemData* pData )
pData->eType = MENUITEM_STRINGIMAGE;
}
-static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, Window *pWindow )
+static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow )
{
AllSettings aAllSettings( pWindow->GetSettings() );
HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() );
- sal_uLong nRet = aHelpSettings.GetTipTimeout();
+ ULONG nRet = aHelpSettings.GetTipTimeout();
aHelpSettings.SetTipTimeout( nTimeout );
aAllSettings.SetHelpSettings( aHelpSettings );
pWindow->SetSettings( aAllSettings );
return nRet;
}
-static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
+static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
{
if( ! pMenu )
- return sal_False;
-
- sal_Bool bDone = sal_False;
- sal_uInt16 nId = 0;
+ return FALSE;
+
+ BOOL bDone = FALSE;
+ USHORT nId = 0;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -815,23 +818,23 @@ static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt1
else
{
// give user a chance to read the full filename
- sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ 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 = sal_True;
+ bDone = 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
- sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ 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 = sal_True;
+ bDone = TRUE;
}
else if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
{
@@ -842,16 +845,16 @@ static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt1
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
- if( ! aHelpId.getLength() )
- aHelpId = OOO_HELP_INDEX;
-
+ ULONG nHelpId = pMenu->GetHelpId( nId );
+
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
+ else if ( nHelpId )
+ pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
+ pHelp->Start( OOO_HELP_INDEX, NULL );
}
- bDone = sal_True;
+ bDone = TRUE;
}
return bDone;
}
@@ -861,7 +864,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;
- sal_Bool bDone = sal_False;
+ BOOL bDone = FALSE;
if( pWindow->ImplGetFrameWindow() )
{
Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild;
@@ -875,7 +878,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin );
if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP )
{
- bDone = sal_True;
+ bDone = TRUE;
if( pDockingArea->IsVisible() )
height = pDockingArea->GetOutputSizePixel().Height();
}
@@ -894,13 +897,13 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
Menu::Menu()
{
DBG_CTOR( Menu, NULL );
- bIsMenuBar = sal_False;
+ bIsMenuBar = FALSE;
ImplInit();
}
// this constructor makes sure we're creating the native menu
// with the correct type (ie, MenuBar vs. PopupMenu)
-Menu::Menu( sal_Bool bMenubar )
+Menu::Menu( BOOL bMenubar )
{
DBG_CTOR( Menu, NULL );
bIsMenuBar = bMenubar;
@@ -910,7 +913,7 @@ Menu::Menu( sal_Bool bMenubar )
Menu::~Menu()
{
DBG_DTOR( Menu, NULL );
-
+
vcl::LazyDeletor<Menu>::Undelete( this );
ImplCallEventListeners( VCLEVENT_OBJECT_DYING, ITEMPOS_INVALID );
@@ -944,7 +947,7 @@ Menu::~Menu()
pDelData = pDelData->mpNext;
}
- bKilled = sal_True;
+ bKilled = TRUE;
delete pItemList;
delete pLogo;
@@ -965,20 +968,20 @@ void Menu::ImplInit()
mpSalMenu = NULL;
nMenuFlags = 0;
nDefaultItem = 0;
- //bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!!
+ //bIsMenuBar = 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 = sal_False;
- bInCallback = sal_False;
- bKilled = sal_False;
- mpLayoutData = NULL;
+ bCanceled = FALSE;
+ bInCallback = FALSE;
+ bKilled = FALSE;
+ mpLayoutData = NULL;
mpFirstDel = NULL; // Dtor notification list
// Native-support: returns NULL if not supported
- mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
+ mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar );
}
Menu* Menu::ImplGetStartedFrom() const
@@ -991,17 +994,17 @@ void Menu::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( ! pMgr )
return;
-
+
rResId.SetRT( RSC_MENU );
GetRes( rResId );
- sal_uLong nObjMask = ReadLongRes();
+ ULONG nObjMask = ReadLongRes();
if( nObjMask & RSC_MENU_ITEMS )
{
- sal_uLong nObjFollows = ReadLongRes();
+ ULONG nObjFollows = ReadLongRes();
// MenuItems einfuegen
- for( sal_uLong i = 0; i < nObjFollows; i++ )
+ for( ULONG i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
@@ -1016,13 +1019,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
aTitleText = ReadStringRes();
}
if( nObjMask & RSC_MENU_DEFAULTITEMID )
- SetDefaultItem( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
+ SetDefaultItem( sal::static_int_cast<USHORT>(ReadLongRes()) );
}
void Menu::CreateAutoMnemonics()
{
MnemonicGenerator aMnemonicGenerator;
- sal_uLong n;
+ ULONG n;
for ( n = 0; n < pItemList->Count(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos(n);
@@ -1039,7 +1042,7 @@ void Menu::CreateAutoMnemonics()
void Menu::Activate()
{
- bInCallback = sal_True;
+ bInCallback = TRUE;
ImplMenuDelData aDelData( this );
@@ -1054,27 +1057,27 @@ void Menu::Activate()
Menu* pStartMenu = ImplGetStartMenu();
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = sal_True;
+ pStartMenu->bInCallback = TRUE;
// MT 11/01: Call EventListener here? I don't know...
pStartMenu->aActivateHdl.Call( this );
- pStartMenu->bInCallback = sal_False;
+ pStartMenu->bInCallback = FALSE;
}
}
}
- bInCallback = sal_False;
+ bInCallback = FALSE;
}
}
void Menu::Deactivate()
{
- for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
+ for ( USHORT n = (USHORT)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
if ( pData->bIsTemporary )
pItemList->Remove( n );
}
- bInCallback = sal_True;
+ bInCallback = TRUE;
ImplMenuDelData aDelData( this );
@@ -1089,9 +1092,9 @@ void Menu::Deactivate()
{
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = sal_True;
+ pStartMenu->bInCallback = TRUE;
pStartMenu->aDeactivateHdl.Call( this );
- pStartMenu->bInCallback = sal_False;
+ pStartMenu->bInCallback = FALSE;
}
}
}
@@ -1099,7 +1102,10 @@ void Menu::Deactivate()
if( !aDelData.isDeleted() )
{
- bInCallback = sal_False;
+ bInCallback = FALSE;
+
+ if ( this == pStartMenu )
+ GetpApp()->HideHelpStatusText();
}
}
@@ -1120,11 +1126,11 @@ void Menu::ImplSelect()
MenuItemData* pData = GetItemList()->GetData( nSelectedId );
if ( pData && (pData->nBits & MIB_AUTOCHECK) )
{
- sal_Bool bChecked = IsItemChecked( nSelectedId );
+ BOOL bChecked = IsItemChecked( nSelectedId );
if ( pData->nBits & MIB_RADIOCHECK )
{
if ( !bChecked )
- CheckItem( nSelectedId, sal_True );
+ CheckItem( nSelectedId, TRUE );
}
else
CheckItem( nSelectedId, !bChecked );
@@ -1170,7 +1176,7 @@ void Menu::RequestHelp( const HelpEvent& )
{
}
-void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
+void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos )
{
ImplMenuDelData aDelData( this );
@@ -1182,7 +1188,7 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
ImplGetSVData()->mpApp->ImplCallEventListeners( &aEvent );
}
- if ( !aDelData.isDeleted() )
+ if ( !aDelData.isDeleted() && !maEventListeners.empty() )
maEventListeners.Call( &aEvent );
if( !aDelData.isDeleted() )
@@ -1190,7 +1196,8 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
Menu* pMenu = this;
while ( pMenu )
{
- maChildEventListeners.Call( &aEvent );
+ if ( !maChildEventListeners.empty() )
+ maChildEventListeners.Call( &aEvent );
if( aDelData.isDeleted() )
break;
@@ -1202,12 +1209,12 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
void Menu::AddEventListener( const Link& rEventListener )
{
- maEventListeners.addListener( rEventListener );
+ maEventListeners.push_back( rEventListener );
}
void Menu::RemoveEventListener( const Link& rEventListener )
{
- maEventListeners.removeListener( rEventListener );
+ maEventListeners.remove( rEventListener );
}
// -----------------------------------------------------------------------
@@ -1224,14 +1231,14 @@ void Menu::RemoveEventListener( const Link& rEventListener )
// mpDummy4_WindowChildEventListeners->remove( rEventListener );
//}
-void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits, sal_uInt16 nPos )
+void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItemBits, USHORT 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 >= (sal_uInt16)pItemList->Count() )
+ if ( nPos >= (USHORT)pItemList->Count() )
nPos = MENU_APPEND;
// put Item in MenuItemList
@@ -1253,39 +1260,39 @@ void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits n
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::InsertItem( sal_uInt16 nItemId, const Image& rImage,
- MenuItemBits nItemBits, sal_uInt16 nPos )
+void Menu::InsertItem( USHORT nItemId, const Image& rImage,
+ MenuItemBits nItemBits, USHORT nPos )
{
InsertItem( nItemId, ImplGetSVEmptyStr(), nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( sal_uInt16 nItemId,
+void Menu::InsertItem( USHORT nItemId,
const XubString& rStr, const Image& rImage,
- MenuItemBits nItemBits, sal_uInt16 nPos )
+ MenuItemBits nItemBits, USHORT nPos )
{
InsertItem( nItemId, rStr, nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
+void Menu::InsertItem( const ResId& rResId, USHORT nPos )
{
ResMgr* pMgr = rResId.GetResMgr();
if( ! pMgr )
return;
-
- sal_uLong nObjMask;
+
+ ULONG nObjMask;
GetRes( rResId.SetRT( RSC_MENUITEM ) );
nObjMask = ReadLongRes();
- sal_Bool bSep = sal_False;
+ BOOL bSep = FALSE;
if ( nObjMask & RSC_MENUITEM_SEPARATOR )
- bSep = (sal_Bool)ReadShortRes();
+ bSep = (BOOL)ReadShortRes();
- sal_uInt16 nItemId = 1;
+ USHORT nItemId = 1;
if ( nObjMask & RSC_MENUITEM_ID )
- nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
+ nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
MenuItemBits nStatus = 0;
if ( nObjMask & RSC_MENUITEM_STATUS )
@@ -1321,14 +1328,15 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
SetHelpText( nItemId, aHelpText );
}
+ ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- rtl::OString aHelpId( ReadByteStringRes() );
+ nHelpId = ReadLongRes();
if ( !bSep )
- SetHelpId( nItemId, aHelpId );
+ SetHelpId( nItemId, nHelpId );
}
- if( !bSep )
+ if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1340,12 +1348,12 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
if( nObjMask & RSC_MENUITEM_CHECKED )
{
if ( !bSep )
- CheckItem( nItemId, (sal_Bool)ReadShortRes() );
+ CheckItem( nItemId, (BOOL)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_DISABLE )
{
if ( !bSep )
- EnableItem( nItemId, !(sal_Bool)ReadShortRes() );
+ EnableItem( nItemId, !(BOOL)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_COMMAND )
{
@@ -1372,21 +1380,21 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
delete mpLayoutData, mpLayoutData = NULL;
}
-void Menu::InsertSeparator( sal_uInt16 nPos )
+void Menu::InsertSeparator( USHORT nPos )
{
// do nothing if its a menu bar
if ( bIsMenuBar )
return;
// if position > ItemCount, append
- if ( nPos >= (sal_uInt16)pItemList->Count() )
+ if ( nPos >= (USHORT)pItemList->Count() )
nPos = MENU_APPEND;
// put separator in item list
pItemList->InsertSeparator( nPos );
// update native menu
- sal_uInt16 itemPos = nPos != MENU_APPEND ? nPos : (sal_uInt16)pItemList->Count() - 1;
+ USHORT itemPos = nPos != MENU_APPEND ? nPos : (USHORT)pItemList->Count() - 1;
MenuItemData *pData = pItemList->GetDataFromPos( itemPos );
if( ImplGetSalMenu() && pData && pData->pSalMenuItem )
ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos );
@@ -1396,9 +1404,9 @@ void Menu::InsertSeparator( sal_uInt16 nPos )
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::RemoveItem( sal_uInt16 nPos )
+void Menu::RemoveItem( USHORT nPos )
{
- sal_Bool bRemove = sal_False;
+ BOOL bRemove = FALSE;
if ( nPos < GetItemCount() )
{
@@ -1407,7 +1415,7 @@ void Menu::RemoveItem( sal_uInt16 nPos )
ImplGetSalMenu()->RemoveItem( nPos );
pItemList->Remove( nPos );
- bRemove = sal_True;
+ bRemove = TRUE;
}
Window* pWin = ImplGetWindow();
@@ -1423,8 +1431,8 @@ void Menu::RemoveItem( sal_uInt16 nPos )
ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos );
}
-void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos,
- sal_uInt16 nMode = 0 )
+void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
+ USHORT nMode = 0 )
{
MenuItemType eType = rMenu.GetItemType( nPos );
@@ -1435,7 +1443,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n
pThis->InsertSeparator( nNewPos );
else
{
- sal_uInt16 nId = rMenu.GetItemId( nPos );
+ USHORT nId = rMenu.GetItemId( nPos );
DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND,
"Menu::CopyItem(): ItemId already exists" );
@@ -1450,10 +1458,10 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n
pThis->InsertItem( nId, pData->aImage, pData->nBits, nNewPos );
if ( rMenu.IsItemChecked( nId ) )
- pThis->CheckItem( nId, sal_True );
+ pThis->CheckItem( nId, TRUE );
if ( !rMenu.IsItemEnabled( nId ) )
- pThis->EnableItem( nId, sal_False );
- pThis->SetHelpId( nId, pData->aHelpId );
+ pThis->EnableItem( nId, FALSE );
+ pThis->SetHelpId( nId, pData->nHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -1475,26 +1483,26 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n
}
}
-void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos )
+void Menu::CopyItem( const Menu& rMenu, USHORT nPos, USHORT nNewPos )
{
ImplCopyItem( this, rMenu, nPos, nNewPos );
}
void Menu::Clear()
{
- for ( sal_uInt16 i = GetItemCount(); i; i-- )
+ for ( USHORT i = GetItemCount(); i; i-- )
RemoveItem( 0 );
}
-sal_uInt16 Menu::GetItemCount() const
+USHORT Menu::GetItemCount() const
{
- return (sal_uInt16)pItemList->Count();
+ return (USHORT)pItemList->Count();
}
-sal_uInt16 Menu::ImplGetVisibleItemCount() const
+USHORT Menu::ImplGetVisibleItemCount() const
{
- sal_uInt16 nItems = 0;
- for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
+ USHORT nItems = 0;
+ for ( USHORT n = (USHORT)pItemList->Count(); n; )
{
if ( ImplIsVisible( --n ) )
nItems++;
@@ -1502,9 +1510,9 @@ sal_uInt16 Menu::ImplGetVisibleItemCount() const
return nItems;
}
-sal_uInt16 Menu::ImplGetFirstVisible() const
+USHORT Menu::ImplGetFirstVisible() const
{
- for ( sal_uInt16 n = 0; n < pItemList->Count(); n++ )
+ for ( USHORT n = 0; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1512,9 +1520,9 @@ sal_uInt16 Menu::ImplGetFirstVisible() const
return ITEMPOS_INVALID;
}
-sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const
+USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const
{
- for ( sal_uInt16 n = nPos; n; )
+ for ( USHORT n = nPos; n; )
{
if ( n && ImplIsVisible( --n ) )
return n;
@@ -1522,9 +1530,9 @@ sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const
return ITEMPOS_INVALID;
}
-sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const
+USHORT Menu::ImplGetNextVisible( USHORT nPos ) const
{
- for ( sal_uInt16 n = nPos+1; n < pItemList->Count(); n++ )
+ for ( USHORT n = nPos+1; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1532,7 +1540,7 @@ sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const
return ITEMPOS_INVALID;
}
-sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const
+USHORT Menu::GetItemId( USHORT nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1542,9 +1550,9 @@ sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const
return 0;
}
-sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const
+USHORT Menu::GetItemPos( USHORT nItemId ) const
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1553,7 +1561,7 @@ sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const
return MENU_ITEM_NOTFOUND;
}
-MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const
+MenuItemType Menu::GetItemType( USHORT nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1563,19 +1571,19 @@ MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const
return MENUITEM_DONTKNOW;
}
-sal_uInt16 Menu::GetCurItemId() const
+USHORT Menu::GetCurItemId() const
{
return nSelectedId;
}
-void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits )
+void Menu::SetItemBits( USHORT nItemId, MenuItemBits nBits )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nBits = nBits;
}
-MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const
+MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
{
MenuItemBits nBits = 0;
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1584,22 +1592,22 @@ MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const
return nBits;
}
-void Menu::SetUserValue( sal_uInt16 nItemId, sal_uLong nValue )
+void Menu::SetUserValue( USHORT nItemId, ULONG nValue )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nUserValue = nValue;
}
-sal_uLong Menu::GetUserValue( sal_uInt16 nItemId ) const
+ULONG Menu::GetUserValue( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
return pData ? pData->nUserValue : 0;
}
-void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu )
+void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
// Item does not exist -> return NULL
@@ -1612,7 +1620,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu )
// data exchange
pData->pSubMenu = pMenu;
-
+
// #112023# Make sure pStartedFrom does not point to invalid (old) data
if ( pData->pSubMenu )
pData->pSubMenu->pStartedFrom = 0;
@@ -1629,7 +1637,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu )
ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos );
}
-PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const
+PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1639,9 +1647,9 @@ PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const
return NULL;
}
-void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode )
+void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1657,7 +1665,7 @@ void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode )
ImplGetSalMenu()->SetAccelerator( nPos, pData->pSalMenuItem, rKeyCode, rKeyCode.GetName() );
}
-KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const
+KeyCode Menu::GetAccelKey( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1667,16 +1675,16 @@ KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const
return KeyCode();
}
-KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
+KeyEvent Menu::GetActivationKey( USHORT nItemId ) const
{
KeyEvent aRet;
MenuItemData* pData = pItemList->GetData( nItemId );
if( pData )
{
- sal_uInt16 nPos = pData->aText.Search( '~' );
+ USHORT nPos = pData->aText.Search( '~' );
if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 )
{
- sal_uInt16 nCode = 0;
+ USHORT nCode = 0;
sal_Unicode cAccel = pData->aText.GetChar( nPos+1 );
if( cAccel >= 'a' && cAccel <= 'z' )
nCode = KEY_A + (cAccel-'a');
@@ -1692,9 +1700,9 @@ KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
return aRet;
}
-void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
+void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData || pData->bChecked == bCheck )
@@ -1705,9 +1713,9 @@ void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
(pData->nBits & MIB_RADIOCHECK) )
{
MenuItemData* pGroupData;
- sal_uInt16 nGroupPos;
- sal_uInt16 nItemCount = GetItemCount();
- sal_Bool bFound = sal_False;
+ USHORT nGroupPos;
+ USHORT nItemCount = GetItemCount();
+ BOOL bFound = FALSE;
nGroupPos = nPos;
while ( nGroupPos )
@@ -1717,8 +1725,8 @@ void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, sal_False );
- bFound = sal_True;
+ CheckItem( pGroupData->nId, FALSE );
+ bFound = TRUE;
break;
}
}
@@ -1737,7 +1745,7 @@ void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, sal_False );
+ CheckItem( pGroupData->nId, FALSE );
break;
}
}
@@ -1757,20 +1765,20 @@ void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos );
}
-sal_Bool Menu::IsItemChecked( sal_uInt16 nItemId ) const
+BOOL Menu::IsItemChecked( USHORT nItemId ) const
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return sal_False;
+ return FALSE;
return pData->bChecked;
}
-void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
+void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pItemData = pItemList->GetData( nItemId, nPos );
if ( pItemData && ( pItemData->bEnabled != bEnable ) )
@@ -1782,8 +1790,8 @@ void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
DBG_ASSERT( bIsMenuBar, "Menu::EnableItem - Popup visible!" );
long nX = 0;
- sal_uLong nCount = pItemList->Count();
- for ( sal_uLong n = 0; n < nCount; n++ )
+ ULONG nCount = pItemList->Count();
+ for ( ULONG n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -1802,20 +1810,20 @@ void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
}
}
-sal_Bool Menu::IsItemEnabled( sal_uInt16 nItemId ) const
+BOOL Menu::IsItemEnabled( USHORT nItemId ) const
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return sal_False;
+ return FALSE;
return pData->bEnabled;
}
-void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
+void Menu::ShowItem( USHORT nItemId, BOOL bVisible )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
DBG_ASSERT( !bIsMenuBar, "Menu::ShowItem - ignored for menu bar entries!" );
@@ -1837,9 +1845,9 @@ void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
}
}
-void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetItemText( USHORT nItemId, const XubString& rStr )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1866,9 +1874,9 @@ void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
}
}
-XubString Menu::GetItemText( sal_uInt16 nItemId ) const
+XubString Menu::GetItemText( USHORT nItemId ) const
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1877,9 +1885,9 @@ XubString Menu::GetItemText( sal_uInt16 nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
+void Menu::SetItemImage( USHORT nItemId, const Image& rImage )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1895,17 +1903,17 @@ void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
static inline Image ImplRotImage( const Image& rImage, long nAngle10 )
{
- Image aRet;
- BitmapEx aBmpEx( rImage.GetBitmapEx() );
-
+ Image aRet;
+ BitmapEx aBmpEx( rImage.GetBitmapEx() );
+
aBmpEx.Rotate( nAngle10, COL_WHITE );
return Image( aBmpEx );
}
-void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
+void Menu::SetItemImageAngle( USHORT nItemId, long nAngle10 )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1922,17 +1930,17 @@ void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
static inline Image ImplMirrorImage( const Image& rImage )
{
- Image aRet;
- BitmapEx aBmpEx( rImage.GetBitmapEx() );
-
+ Image aRet;
+ BitmapEx aBmpEx( rImage.GetBitmapEx() );
+
aBmpEx.Mirror( BMP_MIRROR_HORZ );
return Image( aBmpEx );
}
-void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
+void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1948,7 +1956,7 @@ void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
}
}
-Image Menu::GetItemImage( sal_uInt16 nItemId ) const
+Image Menu::GetItemImage( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1958,7 +1966,7 @@ Image Menu::GetItemImage( sal_uInt16 nItemId ) const
return Image();
}
-long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const
+long Menu::GetItemImageAngle( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1968,17 +1976,17 @@ long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const
return 0;
}
-sal_Bool Menu::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
+BOOL Menu::GetItemImageMirrorMode( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->bMirrorMode;
else
- return sal_False;
+ return FALSE;
}
-void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand )
+void Menu::SetItemCommand( USHORT nItemId, const String& rCommand )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1986,7 +1994,7 @@ void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand )
pData->aCommandStr = rCommand;
}
-const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const
+const XubString& Menu::GetItemCommand( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1996,7 +2004,7 @@ const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2004,7 +2012,7 @@ void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
pData->aHelpCommandStr = rStr;
}
-const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const
+const XubString& Menu::GetHelpCommand( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2013,8 +2021,8 @@ const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const
else
return ImplGetSVEmptyStr();
}
-
-void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
+
+void Menu::SetHelpText( USHORT nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2022,14 +2030,14 @@ void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
pData->aHelpText = rStr;
}
-const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
+const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
{
- if ( !pData->aHelpText.Len() &&
- (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
+ if ( !pData->aHelpText.Len() &&
+ (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2037,8 +2045,8 @@ const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
- pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
+ if( !pData->aHelpText.Len() && pData->nHelpId )
+ pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
}
}
@@ -2048,12 +2056,12 @@ const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
return ImplGetSVEmptyStr();
}
-const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const
+const XubString& Menu::GetHelpText( USHORT nItemId ) const
{
return ImplGetHelpText( nItemId );
}
-void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2061,7 +2069,7 @@ void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
pData->aTipHelpText = rStr;
}
-const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const
+const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2071,29 +2079,22 @@ const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
+void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->aHelpId = rHelpId;
+ pData->nHelpId = nHelpId;
}
-rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const
+ULONG Menu::GetHelpId( USHORT nItemId ) const
{
- rtl::OString aRet;
-
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- {
- if ( pData->aHelpId.getLength() )
- aRet = pData->aHelpId;
- else
- aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
- }
-
- return aRet;
+ return pData->nHelpId;
+ else
+ return 0;
}
Menu& Menu::operator=( const Menu& rMenu )
@@ -2102,8 +2103,8 @@ Menu& Menu::operator=( const Menu& rMenu )
Clear();
// Items kopieren
- sal_uInt16 nCount = rMenu.GetItemCount();
- for ( sal_uInt16 i = 0; i < nCount; i++ )
+ USHORT nCount = rMenu.GetItemCount();
+ for ( USHORT i = 0; i < nCount; i++ )
ImplCopyItem( this, rMenu, i, MENU_APPEND, 1 );
nDefaultItem = rMenu.nDefaultItem;
@@ -2117,24 +2118,24 @@ Menu& Menu::operator=( const Menu& rMenu )
return *this;
}
-sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
+BOOL Menu::ImplIsVisible( USHORT nPos ) const
{
- sal_Bool bVisible = sal_True;
+ BOOL bVisible = TRUE;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if( pData && !pData->bVisible )
- bVisible = sal_False;
+ bVisible = FALSE;
if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR )
{
if( nPos == 0 ) // no separator should be shown at the very beginning
- bVisible = sal_False;
+ bVisible = FALSE;
else
{
// always avoid adjacent separators
- sal_uInt16 nCount = (sal_uInt16) pItemList->Count();
- sal_uInt16 n;
+ USHORT nCount = (USHORT) pItemList->Count();
+ USHORT n;
MenuItemData* pNextData = NULL;
// search next visible item
for( n = nPos + 1; n < nCount; n++ )
@@ -2147,11 +2148,11 @@ sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
}
}
if( n == nCount ) // no next visible item
- bVisible = sal_False;
+ bVisible = FALSE;
// check for separator
if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR )
- bVisible = sal_False;
-
+ bVisible = FALSE;
+
if( bVisible )
{
for( n = nPos; n > 0; n-- )
@@ -2164,21 +2165,21 @@ sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
}
}
if( n == 0 ) // no previous visible item
- bVisible = sal_False;
+ bVisible = FALSE;
}
}
}
// Fuer den Menubar nicht erlaubt, weil ich nicht mitbekomme
// ob dadurch ein Eintrag verschwindet oder wieder da ist.
- if ( bVisible && !bIsMenuBar && ( nMenuFlags & MENU_FLAG_HIDEDISABLEDENTRIES ) &&
+ if ( bVisible && !bIsMenuBar && ( nMenuFlags & MENU_FLAG_HIDEDISABLEDENTRIES ) &&
!( nMenuFlags & MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ) )
{
if( !pData ) // e.g. nPos == ITEMPOS_INVALID
- bVisible = sal_False;
+ bVisible = FALSE;
else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above
{
- // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( sal_True ) );
+ // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( TRUE ) );
bVisible = pData->bEnabled; // SubMenus nicht pruefen, weil sie ggf. erst im Activate() gefuellt werden.
}
}
@@ -2186,34 +2187,34 @@ sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
return bVisible;
}
-sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const
+BOOL Menu::IsItemVisible( USHORT nItemId ) const
{
return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) );
}
-sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const
+BOOL Menu::IsItemPosVisible( USHORT nItemPos ) const
{
return IsMenuVisible() && ImplIsVisible( nItemPos );
}
-sal_Bool Menu::IsMenuVisible() const
+BOOL Menu::IsMenuVisible() const
{
return pWindow && pWindow->IsReallyVisible();
}
-sal_Bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const
+BOOL Menu::ImplIsSelectable( USHORT nPos ) const
{
- sal_Bool bSelectable = sal_True;
+ BOOL bSelectable = TRUE;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if ( pData && ( pData->nBits & MIB_NOSELECT ) )
- bSelectable = sal_False;
-
+ bSelectable = FALSE;
+
return bSelectable;
}
-void Menu::SelectItem( sal_uInt16 nItemId )
+void Menu::SelectItem( USHORT nItemId )
{
if( bIsMenuBar )
static_cast<MenuBar*>(this)->SelectEntry( nItemId );
@@ -2254,14 +2255,14 @@ void Menu::SelectItem( sal_uInt16 nItemId )
}
void Menu::SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible )
-{
+{
mxAccessible = rxAccessible;
}
long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth ) const
{
rMaxWidth = rCheckHeight = rRadioHeight = 0;
-
+
if( ! bIsMenuBar )
{
ImplControlValue aVal;
@@ -2368,7 +2369,7 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( rSettings.GetUseImagesInMenus() )
{
nMinMenuItemHeight = 16;
- for ( sal_uInt16 i = (sal_uInt16)pItemList->Count(); i; )
+ for ( USHORT i = (USHORT)pItemList->Count(); i; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --i );
if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )))
@@ -2386,7 +2387,7 @@ Size Menu::ImplCalcSize( Window* pWin )
}
}
- for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
+ for ( USHORT n = (USHORT)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
@@ -2484,18 +2485,8 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
- // 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;
+ USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
+ nCheckPos = (USHORT)nExtra;
if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
{
long nImgOrChkWidth = 0;
@@ -2505,12 +2496,12 @@ Size Menu::ImplCalcSize( Window* pWin )
else // non NWF case
nImgOrChkWidth = nFontHeight/2 + gfxExtra;
nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
- nTextPos = (sal_uInt16)(nImagePos + nImgOrChkWidth);
+ nTextPos = (USHORT)(nImagePos + nImgOrChkWidth);
}
else
{
nImagePos = nCheckPos;
- nTextPos = (sal_uInt16)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
+ nTextPos = (USHORT)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
}
nTextPos = nTextPos + gfxExtra;
@@ -2523,9 +2514,9 @@ Size Menu::ImplCalcSize( Window* pWin )
}
else
{
- nTextPos = (sal_uInt16)(2*nExtra);
+ nTextPos = (USHORT)(2*nExtra);
aSz.Height() = nFontHeight+6;
-
+
// get menubar height from native methods if supported
if( pWindow->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
@@ -2565,16 +2556,16 @@ Size Menu::ImplCalcSize( Window* pWin )
static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
- sal_Bool bNativeOk = sal_False;
+ BOOL bNativeOk = FALSE;
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion( i_rRect );
ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
-
+
aControlValue.setTristateVal( BUTTONVALUE_ON );
-
- bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
+
+ bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
aCtrlRegion, nState, aControlValue,
rtl::OUString() );
}
@@ -2583,31 +2574,11 @@ 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, sal_True, sal_False, 2, NULL, &aColor );
+ i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, 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, sal_uInt16 nBorder, long nStartY, MenuItemData* pThisItemOnly, sal_Bool bHighlighted, bool bLayout ) const
+void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
{
// Fuer Symbole: nFontHeight x nFontHeight
long nFontHeight = pWin->GetTextHeight();
@@ -2623,7 +2594,7 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
if ( pLogo )
aTopLeft.X() = pLogo->aBitmap.GetSizePixel().Width();
-
+
int nOuterSpace = 0;
if( !bIsMenuBar )
{
@@ -2633,10 +2604,10 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
}
Size aOutSz = pWin->GetOutputSizePixel();
- sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
+ USHORT nCount = (USHORT)pItemList->Count();
if( bLayout )
mpLayoutData->m_aVisibleItemBoundRects.clear();
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+ for ( USHORT n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( ImplIsVisible( n ) && ( !pThisItemOnly || ( pData == pThisItemOnly ) ) )
@@ -2653,9 +2624,9 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2);
if( bIsMenuBar )
nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
- sal_uInt16 nTextStyle = 0;
- sal_uInt16 nSymbolStyle = 0;
- sal_uInt16 nImageStyle = 0;
+ USHORT nTextStyle = 0;
+ USHORT nSymbolStyle = 0;
+ USHORT 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
@@ -2670,36 +2641,14 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
// Separator
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
- 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();
- }
+ 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() ) );
@@ -2727,34 +2676,33 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
ControlPart nPart = ((pData->nBits & MIB_RADIOCHECK)
? PART_MENU_ITEM_RADIO_MARK
: PART_MENU_ITEM_CHECK_MARK);
-
+
ControlState nState = 0;
-
+
if ( pData->bChecked )
nState |= CTRL_STATE_PRESSED;
-
+
if ( pData->bEnabled )
nState |= CTRL_STATE_ENABLED;
-
+
if ( bHighlighted )
nState |= CTRL_STATE_SELECTED;
-
+
long nCtrlHeight = (pData->nBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2;
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
-
- Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
- MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
+
+ Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
- aVal,
+ ImplControlValue(),
OUString() );
}
else if ( pData->bChecked ) // by default do nothing for unchecked items
{
ImplPaintCheckBackground( pWin, aOuterCheckRect, pThisItemOnly && bHighlighted );
-
+
SymbolType eSymbol;
Size aSymbolSize;
if ( pData->nBits & MIB_RADIOCHECK )
@@ -2796,7 +2744,7 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
aTmpPos.X() = aPos.X() + nTextPos;
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
if ( pData->bIsTemporary )
nStyle |= TEXT_DRAW_DISABLE;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
@@ -2820,19 +2768,7 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
pWin->GetSettings().GetStyleSettings().GetMenuColor();
pWin->SetBackground( Wallpaper( aBg ) );
}
- // 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 );
+ pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText );
if( bSetTmpBackground )
pWin->SetBackground();
}
@@ -2868,6 +2804,16 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
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 )
@@ -2930,7 +2876,7 @@ Menu* Menu::ImplGetStartMenu()
return pStart;
}
-void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem )
+void Menu::ImplCallHighlight( USHORT nHighlightedItem )
{
ImplMenuDelData aDelData( this );
@@ -2958,7 +2904,7 @@ Menu* Menu::ImplFindSelectMenu()
{
Menu* pSelMenu = nEventId ? this : NULL;
- for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2969,11 +2915,11 @@ Menu* Menu::ImplFindSelectMenu()
return pSelMenu;
}
-Menu* Menu::ImplFindMenu( sal_uInt16 nItemId )
+Menu* Menu::ImplFindMenu( USHORT nItemId )
{
Menu* pSelMenu = NULL;
- for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2986,25 +2932,25 @@ Menu* Menu::ImplFindMenu( sal_uInt16 nItemId )
return pSelMenu;
}
-void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPopups )
+void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
{
- for ( sal_uInt16 n = 0; n < GetItemCount(); n++ )
+ for ( USHORT n = 0; n < GetItemCount(); n++ )
{
- sal_Bool bRemove = sal_False;
+ BOOL bRemove = FALSE;
MenuItemData* pItem = pItemList->GetDataFromPos( n );
if ( pItem->eType == MENUITEM_SEPARATOR )
{
if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) )
- bRemove = sal_True;
+ bRemove = TRUE;
}
else
bRemove = !pItem->bEnabled;
if ( bCheckPopups && pItem->pSubMenu )
{
- pItem->pSubMenu->RemoveDisabledEntries( sal_True );
+ pItem->pSubMenu->RemoveDisabledEntries( TRUE );
if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() )
- bRemove = sal_True;
+ bRemove = TRUE;
}
if ( bRemove )
@@ -3013,7 +2959,7 @@ void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPo
if ( GetItemCount() )
{
- sal_uInt16 nLast = GetItemCount() - 1;
+ USHORT nLast = GetItemCount() - 1;
MenuItemData* pItem = pItemList->GetDataFromPos( nLast );
if ( pItem->eType == MENUITEM_SEPARATOR )
RemoveItem( nLast );
@@ -3021,19 +2967,19 @@ void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPo
delete mpLayoutData, mpLayoutData = NULL;
}
-sal_Bool Menu::HasValidEntries( sal_Bool bCheckPopups )
+BOOL Menu::HasValidEntries( BOOL bCheckPopups )
{
- sal_Bool bValidEntries = sal_False;
- sal_uInt16 nCount = GetItemCount();
- for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ )
+ BOOL bValidEntries = FALSE;
+ USHORT nCount = GetItemCount();
+ for ( USHORT 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( sal_True );
+ bValidEntries = pItem->pSubMenu->HasValidEntries( TRUE );
else
- bValidEntries = sal_True;
+ bValidEntries = TRUE;
}
}
return bValidEntries;
@@ -3071,12 +3017,12 @@ void Menu::ImplFillLayoutData() const
mpLayoutData = new MenuLayoutData();
if( bIsMenuBar )
{
- ImplPaint( pWindow, 0, 0, 0, sal_False, true );
+ ImplPaint( pWindow, 0, 0, 0, FALSE, true );
}
else
{
MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow;
- ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, sal_False, true );
+ ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, FALSE, true );
}
}
}
@@ -3088,7 +3034,7 @@ String Menu::GetDisplayText() const
return mpLayoutData ? mpLayoutData->m_aDisplayText : String();
}
-Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
+Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpLayoutData )
@@ -3108,7 +3054,7 @@ Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
}
-long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
+long Menu::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -3146,7 +3092,7 @@ Pair Menu::GetLineStartEnd( long nLine ) const
return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
}
-Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const
+Pair Menu::GetItemStartEnd( USHORT nItem ) const
{
if( ! mpLayoutData )
ImplFillLayoutData();
@@ -3158,9 +3104,9 @@ Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const
return Pair( -1, -1 );
}
-sal_uInt16 Menu::GetDisplayItemId( long nLine ) const
+USHORT Menu::GetDisplayItemId( long nLine ) const
{
- sal_uInt16 nItemId = 0;
+ USHORT nItemId = 0;
if( ! mpLayoutData )
ImplFillLayoutData();
if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) )
@@ -3168,19 +3114,19 @@ sal_uInt16 Menu::GetDisplayItemId( long nLine ) const
return nItemId;
}
-sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
+BOOL Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( pWindow && pReferenceWindow )
{
rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint );
rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint );
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
}
-Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
+Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const
{
Rectangle aRet;
@@ -3188,16 +3134,16 @@ Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
ImplFillLayoutData();
if( mpLayoutData )
{
- std::map< sal_uInt16, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
+ std::map< USHORT, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
if( it != mpLayoutData->m_aVisibleItemBoundRects.end() )
aRet = it->second;
}
return aRet;
}
-void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData && !rStr.Equals( pData->aAccessibleName ) )
@@ -3207,7 +3153,7 @@ void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr )
}
}
-XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
+XubString Menu::GetAccessibleName( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3217,7 +3163,7 @@ XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr )
+void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3225,7 +3171,7 @@ void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr )
pData->aAccessibleDescription = rStr;
}
-XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const
+XubString Menu::GetAccessibleDescription( USHORT nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3242,22 +3188,22 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
mpSalMenu = pSalMenu;
}
-sal_Bool Menu::GetSystemMenuData( SystemMenuData* pData ) const
+BOOL Menu::GetSystemMenuData( SystemMenuData* pData ) const
{
Menu* pMenu = (Menu*)this;
if( pData && pMenu->ImplGetSalMenu() )
{
pMenu->ImplGetSalMenu()->GetSystemMenuData( pData );
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
-bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const
+bool Menu::IsHighlighted( USHORT nItemPos ) const
{
bool bRet = false;
-
+
if( pWindow )
{
if( bIsMenuBar )
@@ -3265,23 +3211,23 @@ bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const
else
bRet = ( nItemPos == static_cast< MenuFloatingWindow * > (pWindow)->GetHighlightedItem() );
}
-
+
return bRet;
}
-void Menu::HighlightItem( sal_uInt16 nItemPos )
+void Menu::HighlightItem( USHORT nItemPos )
{
if ( pWindow )
{
if ( bIsMenuBar )
{
MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow );
- pMenuWin->SetAutoPopup( sal_False );
- pMenuWin->ChangeHighlightItem( nItemPos, sal_False );
+ pMenuWin->SetAutoPopup( FALSE );
+ pMenuWin->ChangeHighlightItem( nItemPos, FALSE );
}
else
{
- static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, sal_False );
+ static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, FALSE );
}
}
}
@@ -3290,54 +3236,54 @@ void Menu::HighlightItem( sal_uInt16 nItemPos )
// - MenuBar -
// -----------
-MenuBar::MenuBar() : Menu( sal_True )
+MenuBar::MenuBar() : Menu( TRUE )
{
- mbDisplayable = sal_True;
- mbCloserVisible = sal_False;
- mbFloatBtnVisible = sal_False;
- mbHideBtnVisible = sal_False;
+ mbDisplayable = TRUE;
+ mbCloserVisible = FALSE;
+ mbFloatBtnVisible = FALSE;
+ mbHideBtnVisible = FALSE;
}
-MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( sal_True )
+MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( TRUE )
{
- mbDisplayable = sal_True;
- mbCloserVisible = sal_False;
- mbFloatBtnVisible = sal_False;
- mbHideBtnVisible = sal_False;
+ mbDisplayable = TRUE;
+ mbCloserVisible = FALSE;
+ mbFloatBtnVisible = FALSE;
+ mbHideBtnVisible = FALSE;
*this = rMenu;
- bIsMenuBar = sal_True;
+ bIsMenuBar = TRUE;
}
-MenuBar::MenuBar( const ResId& rResId ) : Menu ( sal_True )
+MenuBar::MenuBar( const ResId& rResId ) : Menu ( TRUE )
{
- mbDisplayable = sal_True;
- mbCloserVisible = sal_False;
- mbFloatBtnVisible = sal_False;
- mbHideBtnVisible = sal_False;
+ mbDisplayable = TRUE;
+ mbCloserVisible = FALSE;
+ mbFloatBtnVisible = FALSE;
+ mbHideBtnVisible = FALSE;
ImplLoadRes( rResId );
}
MenuBar::~MenuBar()
{
- ImplDestroy( this, sal_True );
+ ImplDestroy( this, TRUE );
}
-void MenuBar::ShowCloser( sal_Bool bShow )
+void MenuBar::ShowCloser( BOOL bShow )
{
ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible );
}
-void MenuBar::ShowFloatButton( sal_Bool bShow )
+void MenuBar::ShowFloatButton( BOOL bShow )
{
ShowButtons( mbCloserVisible, bShow, mbHideBtnVisible );
}
-void MenuBar::ShowHideButton( sal_Bool bShow )
+void MenuBar::ShowHideButton( BOOL bShow )
{
ShowButtons( mbCloserVisible, mbFloatBtnVisible, bShow );
}
-void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
+void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
{
if ( (bClose != mbCloserVisible) ||
(bFloat != mbFloatBtnVisible) ||
@@ -3351,7 +3297,7 @@ void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
}
}
-void MenuBar::SetDisplayable( sal_Bool bDisplayable )
+void MenuBar::SetDisplayable( BOOL bDisplayable )
{
if( bDisplayable != mbDisplayable )
{
@@ -3374,7 +3320,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
// depending on the native implementation or the displayable flag
// the menubar windows is supressed (ie, height=0)
- if( !((MenuBar*) pMenu)->IsDisplayable() ||
+ if( !((MenuBar*) pMenu)->IsDisplayable() ||
( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() ) )
nHeight = 0;
@@ -3382,7 +3328,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
return pWindow;
}
-void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete )
+void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete )
{
MenuBarWindow* pWindow = (MenuBarWindow*) pMenu->ImplGetWindow();
if ( pWindow && bDelete )
@@ -3393,12 +3339,12 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete )
pMenu->pWindow = NULL;
}
-sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
+BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
{
- sal_Bool bDone = sal_False;
+ BOOL bDone = FALSE;
// No keyboard processing when system handles the menu or our menubar is invisible
- if( !IsDisplayable() ||
+ if( !IsDisplayable() ||
( ImplGetSalMenu() && ImplGetSalMenu()->VisibleMenuBar() ) )
return bDone;
@@ -3411,7 +3357,7 @@ sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMen
// -----------------------------------------------------------------------
-void MenuBar::SelectEntry( sal_uInt16 nId )
+void MenuBar::SelectEntry( USHORT nId )
{
MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow();
@@ -3421,14 +3367,14 @@ void MenuBar::SelectEntry( sal_uInt16 nId )
nId = GetItemPos( nId );
// #99705# popup the selected menu
- pMenuWin->SetAutoPopup( sal_True );
+ pMenuWin->SetAutoPopup( TRUE );
if( ITEMPOS_INVALID != pMenuWin->nHighlightedItem )
{
pMenuWin->KillActivePopup();
- pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
}
if( nId != ITEMPOS_INVALID )
- pMenuWin->ChangeHighlightItem( nId, sal_False );
+ pMenuWin->ChangeHighlightItem( nId, FALSE );
}
}
@@ -3436,38 +3382,38 @@ void MenuBar::SelectEntry( sal_uInt16 nId )
// handler for native menu selection and command events
-sal_Bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
+BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = sal_True;
+ pMenu->bInCallback = TRUE;
pMenu->Activate();
-
+
if( !aDelData.isDeleted() )
- pMenu->bInCallback = sal_False;
+ pMenu->bInCallback = FALSE;
}
- return sal_True;
+ return TRUE;
}
-sal_Bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
+BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = sal_True;
+ pMenu->bInCallback = TRUE;
pMenu->Deactivate();
if( !aDelData.isDeleted() )
- pMenu->bInCallback = sal_False;
+ pMenu->bInCallback = FALSE;
}
- return sal_True;
+ return TRUE;
}
-sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventId ) const
+BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId );
@@ -3485,13 +3431,13 @@ sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEv
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos );
}
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
-sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const
+BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nCommandEventId );
@@ -3500,47 +3446,47 @@ sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventI
pMenu->nSelectedId = nCommandEventId;
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplSelect();
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
-sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, sal_uInt16 i_nPos )
+USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, USHORT i_nPos )
{
return AddMenuBarButton( i_rImage, i_rLink, String(), i_nPos );
}
-sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
+USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->AddMenuBarButton( i_rImage, i_rLink, i_rToolTip, i_nPos ) : 0;
}
-void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
+void MenuBar::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->SetMenuBarButtonHighlightHdl( nId, rLink );
}
-Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId )
+Rectangle MenuBar::GetMenuBarButtonRectPixel( USHORT nId )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->GetMenuBarButtonRectPixel( nId ) : Rectangle();
}
-void MenuBar::RemoveMenuBarButton( sal_uInt16 nId )
+void MenuBar::RemoveMenuBarButton( USHORT nId )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->RemoveMenuBarButton( nId );
}
-sal_Bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) const
+BOOL MenuBar::HandleMenuButtonEvent( Menu *, USHORT i_nButtonId ) const
{
- return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId );
+ return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId );
}
// -----------------------------------------------------------------------
-// sal_Bool PopupMenu::bAnyPopupInExecute = sal_False;
+// BOOL PopupMenu::bAnyPopupInExecute = FALSE;
PopupMenu::PopupMenu()
{
@@ -3565,9 +3511,9 @@ PopupMenu::~PopupMenu()
*pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData
}
-sal_Bool PopupMenu::IsInExecute()
+BOOL PopupMenu::IsInExecute()
{
- return GetActivePopupMenu() ? sal_True : sal_False;
+ return GetActivePopupMenu() ? TRUE : FALSE;
}
PopupMenu* PopupMenu::GetActivePopupMenu()
@@ -3576,22 +3522,22 @@ PopupMenu* PopupMenu::GetActivePopupMenu()
return pSVData->maAppData.mpActivePopupMenu;
}
-void PopupMenu::EndExecute( sal_uInt16 nSelectId )
+void PopupMenu::EndExecute( USHORT nSelectId )
{
if ( ImplGetWindow() )
ImplGetFloatingWindow()->EndExecute( nSelectId );
}
-void PopupMenu::SelectEntry( sal_uInt16 nId )
+void PopupMenu::SelectEntry( USHORT nId )
{
if ( ImplGetWindow() )
{
if( nId != ITEMPOS_INVALID )
{
- sal_uInt16 nPos;
+ USHORT nPos;
MenuItemData* pData = GetItemList()->GetData( nId, nPos );
if ( pData->pSubMenu )
- ImplGetFloatingWindow()->ChangeHighlightItem( nPos, sal_True );
+ ImplGetFloatingWindow()->ChangeHighlightItem( nPos, TRUE );
else
ImplGetFloatingWindow()->EndExecute( nId );
}
@@ -3599,7 +3545,7 @@ void PopupMenu::SelectEntry( sal_uInt16 nId )
{
MenuFloatingWindow* pFloat = ImplGetFloatingWindow();
pFloat->GrabFocus();
- sal_uInt16 nPos;
+ USHORT nPos;
for( nPos = 0; nPos < GetItemList()->Count(); nPos++ )
{
MenuItemData* pData = (MenuItemData*)GetItemList()->GetObject( nPos );
@@ -3608,27 +3554,27 @@ void PopupMenu::SelectEntry( sal_uInt16 nId )
pFloat->KillActivePopup();
}
}
- pFloat->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ pFloat->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
}
}
}
-void PopupMenu::SetSelectedEntry( sal_uInt16 nId )
+void PopupMenu::SetSelectedEntry( USHORT nId )
{
nSelectedId = nId;
}
-sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
+USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
{
return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN );
}
-sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags )
+USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT nFlags )
{
ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 );
- sal_uLong nPopupModeFlags = 0;
+ ULONG nPopupModeFlags = 0;
if ( nFlags & POPUPMENU_EXECUTE_DOWN )
nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
else if ( nFlags & POPUPMENU_EXECUTE_UP )
@@ -3643,10 +3589,10 @@ sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_
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, sal_False );
+ return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, FALSE );
}
-sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst )
+USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst )
{
if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
return 0;
@@ -3657,15 +3603,15 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
pStartedFrom = pSFrom;
nSelectedId = 0;
- bCanceled = sal_False;
+ bCanceled = FALSE;
- sal_uLong nFocusId = 0;
- sal_Bool bRealExecute = sal_False;
+ ULONG nFocusId = 0;
+ BOOL bRealExecute = FALSE;
if ( !pStartedFrom )
{
- pSVData->maWinData.mbNoDeactivate = sal_True;
+ pSVData->maWinData.mbNoDeactivate = TRUE;
nFocusId = Window::SaveFocus();
- bRealExecute = sal_True;
+ bRealExecute = TRUE;
}
else
{
@@ -3692,9 +3638,9 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
ImplDelData aDelData;
pW->ImplAddDel( &aDelData );
- bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
+ bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
Activate();
- bInCallback = sal_False;
+ bInCallback = FALSE;
if ( aDelData.IsDelete() )
return 0; // Error
@@ -3720,7 +3666,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
nMenuFlags |= MENU_FLAG_HIDEDISABLEDENTRIES;
- sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount();
+ USHORT nVisibleEntries = ImplGetVisibleItemCount();
if ( !nVisibleEntries )
{
ResMgr* pResMgr = ImplGetResMgr();
@@ -3729,7 +3675,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) );
MenuItemData* pData = pItemList->Insert(
0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF );
- pData->bIsTemporary = sal_True;
+ pData->bIsTemporary = TRUE;
}
}
else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) )
@@ -3764,9 +3710,9 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
nMaxHeight -= nTop+nBottom;
if ( aSz.Height() > nMaxHeight )
{
- pWin->EnableScrollMenu( sal_True );
- sal_uInt16 nStart = ImplGetFirstVisible();
- sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
+ pWin->EnableScrollMenu( TRUE );
+ USHORT nStart = ImplGetFirstVisible();
+ USHORT nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
aSz.Height() = ImplCalcHeight( nEntries );
}
@@ -3781,7 +3727,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
if ( GetItemCount() )
{
SalMenu* pMenu = ImplGetSalMenu();
- if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+ if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
{
pWin->StopExecute(0);
pWin->doShutdown();
@@ -3795,7 +3741,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
}
if( pSFrom )
{
- sal_uInt16 aPos;
+ USHORT aPos;
if( pSFrom->bIsMenuBar )
aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem();
else
@@ -3807,14 +3753,14 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
}
if ( bPreSelectFirst )
{
- sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+ USHORT nCount = (USHORT)pItemList->Count();
+ for ( USHORT 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, sal_False );
+ pWin->ChangeHighlightItem( n, FALSE );
break;
}
}
@@ -3822,7 +3768,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
if ( bRealExecute )
{
pWin->ImplAddDel( &aDelData );
-
+
ImplDelData aModalWinDel;
pW->ImplAddDel( &aModalWinDel );
pW->ImplIncModalCount();
@@ -3844,7 +3790,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
if ( nFocusId )
{
pWin->SetFocusId( 0 );
- pSVData->maWinData.mbNoDeactivate = sal_False;
+ pSVData->maWinData.mbNoDeactivate = FALSE;
}
pWin->ImplEndPopupMode( 0, nFocusId );
@@ -3875,18 +3821,18 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
return bRealExecute ? nSelectedId : 0;
}
-sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const
+USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHORT* pLastVisible ) const
{
nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight();
long nHeight = 0;
- sal_uInt16 nEntries = (sal_uInt16) pItemList->Count();
- sal_uInt16 nVisEntries = 0;
+ USHORT nEntries = (USHORT) pItemList->Count();
+ USHORT nVisEntries = 0;
if ( pLastVisible )
*pLastVisible = 0;
- for ( sal_uInt16 n = nStartEntry; n < nEntries; n++ )
+ for ( USHORT n = nStartEntry; n < nEntries; n++ )
{
if ( ImplIsVisible( n ) )
{
@@ -3903,14 +3849,14 @@ sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntr
return nVisEntries;
}
-long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const
+long PopupMenu::ImplCalcHeight( USHORT nEntries ) const
{
long nHeight = 0;
- sal_uInt16 nFound = 0;
- for ( sal_uInt16 n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
+ USHORT nFound = 0;
+ for ( USHORT n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
{
- if ( ImplIsVisible( (sal_uInt16) n ) )
+ if ( ImplIsVisible( (USHORT) n ) )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
nHeight += pData->aSz.Height();
@@ -3924,7 +3870,7 @@ long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const
}
-static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar )
+static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -3941,7 +3887,7 @@ static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar
Wallpaper aWallpaper;
aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT );
pWin->SetBackground( aWallpaper );
- pWin->SetPaintTransparent( sal_False );
+ pWin->SetPaintTransparent( FALSE );
pWin->SetParentClipMode( 0 );
}
}
@@ -3966,12 +3912,12 @@ static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar
MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) :
FloatingWindow( pParent, nStyle )
{
- mpWindowImpl->mbMenuFloatingWindow= sal_True;
+ mpWindowImpl->mbMenuFloatingWindow= TRUE;
pMenu = pMen;
pActivePopup = 0;
nSaveFocusId = 0;
- bInExecute = sal_False;
- bScrollMenu = sal_False;
+ bInExecute = FALSE;
+ bScrollMenu = FALSE;
nHighlightedItem = ITEMPOS_INVALID;
nMBDownPos = ITEMPOS_INVALID;
nPosInParent = ITEMPOS_INVALID;
@@ -3979,13 +3925,13 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt
// nStartY = 0;
nBorder = EXTRASPACEY;
nFirstEntry = 0;
- bScrollUp = sal_False;
- bScrollDown = sal_False;
- bIgnoreFirstMove = sal_True;
- bKeyInput = sal_False;
+ bScrollUp = FALSE;
+ bScrollDown = FALSE;
+ bIgnoreFirstMove = TRUE;
+ bKeyInput = FALSE;
EnableSaveBackground();
- ImplInitMenuWindow( this, sal_True, sal_False );
+ ImplInitMenuWindow( this, TRUE, FALSE );
SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
@@ -3994,7 +3940,7 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt
aSubmenuCloseTimer.SetTimeout( GetSettings().GetMouseSettings().GetMenuDelay() );
aSubmenuCloseTimer.SetTimeoutHdl( LINK( this, MenuFloatingWindow, SubmenuClose ) );
aScrollTimer.SetTimeoutHdl( LINK( this, MenuFloatingWindow, AutoScroll ) );
-
+
AddEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) );
}
@@ -4006,12 +3952,12 @@ void MenuFloatingWindow::doShutdown()
// otherwise the entry will not be read when the menu is opened again
if( nHighlightedItem != ITEMPOS_INVALID )
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
-
+
if( !bKeyInput && pMenu && pMenu->pStartedFrom && !pMenu->pStartedFrom->bIsMenuBar )
{
// #102461# remove highlight in parent
MenuItemData* pData;
- sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
+ USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -4022,15 +3968,15 @@ void MenuFloatingWindow::doShutdown()
{
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin )
- pPWin->HighlightItem( i, sal_False );
+ pPWin->HighlightItem( i, FALSE );
}
}
-
+
// free the reference to the accessible component
SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >() );
-
+
aHighlightChangedTimer.Stop();
-
+
// #95056# invalidate screen area covered by system window
// so this can be taken into account if the commandhandler performs a scroll operation
if( GetParent() )
@@ -4058,13 +4004,13 @@ long MenuFloatingWindow::ImplGetStartY() const
long nY = 0;
if( pMenu )
{
- for ( sal_uInt16 n = 0; n < nFirstEntry; n++ )
+ for ( USHORT n = 0; n < nFirstEntry; n++ )
nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height();
}
return -nY;
}
-Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const
+Region MenuFloatingWindow::ImplCalcClipRegion( BOOL bIncludeLogo ) const
{
Size aOutSz = GetOutputSizePixel();
Point aPos;
@@ -4094,20 +4040,20 @@ void MenuFloatingWindow::ImplInitClipRegion()
}
}
-void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown )
+void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown )
{
if( ! pMenu )
return;
-
+
long nY = nScrollerHeight;
long nMouseY = rMEvt.GetPosPixel().Y();
Size aOutSz = GetOutputSizePixel();
if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) )
{
- sal_Bool bHighlighted = sal_False;
- sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ BOOL bHighlighted = FALSE;
+ USHORT nCount = (USHORT)pMenu->pItemList->Count();
nY += ImplGetStartY(); // ggf. gescrollt.
- for ( sal_uInt16 n = 0; !bHighlighted && ( n < nCount ); n++ )
+ for ( USHORT n = 0; !bHighlighted && ( n < nCount ); n++ )
{
if ( pMenu->ImplIsVisible( n ) )
{
@@ -4116,7 +4062,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bM
nY += pItemData->aSz.Height();
if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) )
{
- sal_Bool bPopupArea = sal_True;
+ BOOL bPopupArea = TRUE;
if ( pItemData->nBits & MIB_POPUPSELECT )
{
// Nur wenn ueber dem Pfeil geklickt wurde...
@@ -4129,10 +4075,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bM
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (sal_uInt16)n, sal_False );
+ ChangeHighlightItem( (USHORT)n, FALSE );
}
- sal_Bool bAllowNewPopup = sal_True;
+ BOOL bAllowNewPopup = TRUE;
if ( pActivePopup )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
@@ -4150,7 +4096,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bM
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (sal_uInt16)n, sal_True );
+ ChangeHighlightItem( (USHORT)n, TRUE );
}
else if ( pItemData->nBits & MIB_POPUPSELECT )
{
@@ -4158,17 +4104,17 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bM
HighlightChanged( NULL );
}
}
- bHighlighted = sal_True;
+ bHighlighted = TRUE;
}
}
}
if ( !bHighlighted )
- ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
+ ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
}
else
{
ImplScroll( rMEvt.GetPosPixel() );
- ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
+ ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
}
}
@@ -4182,12 +4128,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 = sal_True;
+ //pActivePopup->bCanceled = TRUE;
}
- bInExecute = sal_False;
- pMenu->bInCallback = sal_True;
+ bInExecute = FALSE;
+ pMenu->bInCallback = TRUE;
pMenu->Deactivate();
- pMenu->bInCallback = sal_False;
+ pMenu->bInCallback = FALSE;
}
else
{
@@ -4231,13 +4177,13 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
{
if( ! pMenu )
return 0;
-
+
MenuItemData* pItemData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
if ( pItemData )
{
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
- sal_uLong nOldFlags = GetPopupModeFlags();
+ ULONG nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
KillActivePopup();
SetPopupModeFlags( nOldFlags );
@@ -4247,7 +4193,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nY = nScrollerHeight+ImplGetStartY();
MenuItemData* pData = 0;
- for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
+ for ( ULONG n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->pItemList->GetDataFromPos( n );
nY += pData->aSz.Height();
@@ -4278,9 +4224,9 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
// die lange im Activate Rescheduled haben und jetzt schon nicht mehr
// angezeigt werden sollen.
Menu* pTest = pActivePopup;
- sal_uLong nOldFlags = GetPopupModeFlags();
+ ULONG nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
- sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? sal_False : sal_True );
+ USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE );
SetPopupModeFlags( nOldFlags );
// nRet != 0, wenn es waerend Activate() abgeschossen wurde...
@@ -4307,7 +4253,7 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent )
{
if( ! pMenu )
return 0;
-
+
if( pEvent->GetId() == VCLEVENT_WINDOW_SHOW )
pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID );
else if( pEvent->GetId() == VCLEVENT_WINDOW_HIDE )
@@ -4315,11 +4261,11 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent )
return 0;
}
-void MenuFloatingWindow::EnableScrollMenu( sal_Bool b )
+void MenuFloatingWindow::EnableScrollMenu( BOOL b )
{
bScrollMenu = b;
- nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
- bScrollDown = sal_True;
+ nScrollerHeight = b ? (USHORT) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
+ bScrollDown = TRUE;
ImplInitClipRegion();
}
@@ -4329,8 +4275,8 @@ void MenuFloatingWindow::Execute()
pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu;
- bInExecute = sal_True;
-// bCallingSelect = sal_False;
+ bInExecute = TRUE;
+// bCallingSelect = FALSE;
while ( bInExecute )
Application::Yield();
@@ -4341,24 +4287,24 @@ void MenuFloatingWindow::Execute()
// Application::Yield();
}
-void MenuFloatingWindow::StopExecute( sal_uLong nFocusId )
+void MenuFloatingWindow::StopExecute( ULONG nFocusId )
{
// Focus wieder herstellen
// (kann schon im Select wieder hergestellt wurden sein)
if ( nSaveFocusId )
{
- Window::EndSaveFocus( nFocusId, sal_False );
+ Window::EndSaveFocus( nFocusId, FALSE );
nFocusId = nSaveFocusId;
if ( nFocusId )
{
nSaveFocusId = 0;
- ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
+ ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
}
}
ImplEndPopupMode( 0, nFocusId );
aHighlightChangedTimer.Stop();
- bInExecute = sal_False;
+ bInExecute = FALSE;
if ( pActivePopup )
{
KillActivePopup();
@@ -4376,15 +4322,15 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() )
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = sal_True;
+ pActivePopup->bCanceled = 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 = sal_True;
+ pPopup->bInCallback = TRUE;
pPopup->Deactivate();
- pPopup->bInCallback = sal_False;
+ pPopup->bInCallback = FALSE;
if ( pPopup->ImplGetWindow() )
{
pPopup->ImplGetFloatingWindow()->StopExecute();
@@ -4400,17 +4346,17 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
void MenuFloatingWindow::EndExecute()
{
Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL;
- sal_uLong nFocusId = 0;
+ ULONG nFocusId = 0;
if ( pStart && pStart->bIsMenuBar )
{
nFocusId = ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->GetFocusId();
if ( nFocusId )
{
((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->SetFocusId( 0 );
- ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
+ ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
}
}
-
+
// Wenn von woanders gestartet, dann ab dort aufraumen:
MenuFloatingWindow* pCleanUpFrom = this;
MenuFloatingWindow* pWin = this;
@@ -4424,7 +4370,7 @@ void MenuFloatingWindow::EndExecute()
// Dies Fenster wird gleich zerstoert => Daten lokal merken...
Menu* pM = pMenu;
- sal_uInt16 nItem = nHighlightedItem;
+ USHORT nItem = nHighlightedItem;
pCleanUpFrom->StopExecute( nFocusId );
@@ -4442,9 +4388,9 @@ void MenuFloatingWindow::EndExecute()
}
}
-void MenuFloatingWindow::EndExecute( sal_uInt16 nId )
+void MenuFloatingWindow::EndExecute( USHORT nId )
{
- sal_uInt16 nPos;
+ USHORT nPos;
if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) )
nHighlightedItem = nPos;
else
@@ -4461,7 +4407,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt )
//if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup )
// pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS );
- ImplHighlightItem( rMEvt, sal_True );
+ ImplHighlightItem( rMEvt, TRUE );
nMBDownPos = nHighlightedItem;
}
@@ -4471,7 +4417,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
- sal_uInt16 _nMBDownPos = nMBDownPos;
+ USHORT _nMBDownPos = nMBDownPos;
nMBDownPos = ITEMPOS_INVALID;
if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) )
{
@@ -4509,7 +4455,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start();
if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) )
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
#ifdef OS2
}
#endif
@@ -4524,21 +4470,21 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
{
aSubmenuCloseTimer.Stop();
if( bIgnoreFirstMove )
- bIgnoreFirstMove = sal_False;
+ bIgnoreFirstMove = FALSE;
else
- ImplHighlightItem( rMEvt, sal_False );
+ ImplHighlightItem( rMEvt, FALSE );
}
}
-void MenuFloatingWindow::ImplScroll( sal_Bool bUp )
+void MenuFloatingWindow::ImplScroll( BOOL bUp )
{
KillActivePopup();
Update();
-
+
if( ! pMenu )
return;
- HighlightItem( nHighlightedItem, sal_False );
+ HighlightItem( nHighlightedItem, FALSE );
pMenu->ImplKillLayoutData();
@@ -4553,17 +4499,17 @@ void MenuFloatingWindow::ImplScroll( sal_Bool bUp )
if ( !bScrollDown )
{
- bScrollDown = sal_True;
- ImplDrawScroller( sal_False );
+ bScrollDown = TRUE;
+ ImplDrawScroller( FALSE );
}
if ( pMenu->ImplGetPrevVisible( nFirstEntry ) == ITEMPOS_INVALID )
{
- bScrollUp = sal_False;
- ImplDrawScroller( sal_True );
+ bScrollUp = FALSE;
+ ImplDrawScroller( TRUE );
}
- Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
}
else if ( bScrollDown && !bUp )
{
@@ -4575,24 +4521,24 @@ void MenuFloatingWindow::ImplScroll( sal_Bool bUp )
if ( !bScrollUp )
{
- bScrollUp = sal_True;
- ImplDrawScroller( sal_True );
+ bScrollUp = TRUE;
+ ImplDrawScroller( TRUE );
}
long nHeight = GetOutputSizePixel().Height();
- sal_uInt16 nLastVisible;
+ USHORT nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible );
if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID )
{
- bScrollDown = sal_False;
- ImplDrawScroller( sal_False );
+ bScrollDown = FALSE;
+ ImplDrawScroller( FALSE );
}
// nStartY -= nEntryHeight;
- Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
}
- HighlightItem( nHighlightedItem, sal_True );
+ HighlightItem( nHighlightedItem, TRUE );
}
void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
@@ -4605,12 +4551,12 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
if ( bScrollUp && ( nMouseY < nY ) )
{
- ImplScroll( sal_True );
+ ImplScroll( TRUE );
nDelta = nY - nMouseY;
}
else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) )
{
- ImplScroll( sal_False );
+ ImplScroll( FALSE );
nDelta = nMouseY - ( aOutSz.Height() - nY );
}
@@ -4632,7 +4578,7 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
aScrollTimer.Start();
}
}
-void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer )
+void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
{
// #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert.
// #65750# Dann verzichten wir lieber auf den schmalen Streifen Hintergrundsicherung.
@@ -4647,11 +4593,11 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopup
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, sal_False );
+ HighlightItem( nHighlightedItem, FALSE );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (sal_uInt16)n;
+ nHighlightedItem = (USHORT)n;
DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" );
if( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -4659,7 +4605,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopup
{
// #102461# make sure parent entry is highlighted as well
MenuItemData* pData;
- sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
+ USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -4671,12 +4617,12 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopup
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin && pPWin->nHighlightedItem != i )
{
- pPWin->HighlightItem( i, sal_True );
+ pPWin->HighlightItem( i, TRUE );
pPWin->nHighlightedItem = i;
}
}
}
- HighlightItem( nHighlightedItem, sal_True );
+ HighlightItem( nHighlightedItem, TRUE );
pMenu->ImplCallHighlight( nHighlightedItem );
}
else
@@ -4695,11 +4641,11 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopup
}
}
-void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
+void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
{
if( ! pMenu )
return;
-
+
Size aSz = GetOutputSizePixel();
long nStartY = ImplGetStartY();
long nY = nScrollerHeight+nStartY;
@@ -4710,9 +4656,9 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder;
nY += nOuterSpace;
-
- sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+
+ USHORT nCount = (USHORT)pMenu->pItemList->Count();
+ for ( USHORT n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4720,7 +4666,7 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" );
if ( pData->eType != MENUITEM_SEPARATOR )
{
- sal_Bool bRestoreLineColor = sal_False;
+ BOOL bRestoreLineColor = FALSE;
Color oldLineColor;
bool bDrawItemRect = true;
@@ -4730,27 +4676,26 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
long nFontHeight = GetTextHeight();
aItemRect.Right() -= nFontHeight + nFontHeight/4;
}
-
+
if( IsNativeControlSupported( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL ) )
{
Size aPxSize( GetOutputSizePixel() );
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,
- aVal,
+ ImplControlValue(),
OUString() );
if( bHighlight &&
IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
{
bDrawItemRect = false;
- if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
+ if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
- aVal,
+ ImplControlValue(),
OUString() ) )
{
bDrawItemRect = bHighlight;
@@ -4771,12 +4716,12 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
SetFillColor();
oldLineColor = GetLineColor();
SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- bRestoreLineColor = sal_True;
+ bRestoreLineColor = TRUE;
}
}
else
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
-
+
DrawRect( aItemRect );
}
pMenu->ImplPaint( this, nScrollerHeight, nStartY, pData, bHighlight );
@@ -4790,11 +4735,11 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
}
}
-Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
+Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
{
if( ! pMenu )
return Rectangle();
-
+
Rectangle aRect;
Size aSz = GetOutputSizePixel();
long nStartY = ImplGetStartY();
@@ -4804,8 +4749,8 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
if ( pMenu->pLogo )
nX = pMenu->pLogo->aBitmap.GetSizePixel().Width();
- sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+ USHORT nCount = (USHORT)pMenu->pItemList->Count();
+ for ( USHORT n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4828,14 +4773,14 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
}
-void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
+void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
{
if( ! pMenu )
return;
-
+
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- sal_uInt16 n = nHighlightedItem;
+ USHORT n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( bUp )
@@ -4844,7 +4789,7 @@ void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
n = pMenu->GetItemCount()-1;
}
- sal_uInt16 nLoop = n;
+ USHORT nLoop = n;
if( bHomeEnd )
{
@@ -4856,7 +4801,7 @@ void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
}
else
{
- n = (sal_uInt16)-1;
+ n = (USHORT)-1;
nLoop = n+1;
}
}
@@ -4892,21 +4837,21 @@ void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
// Selektion noch im sichtbaren Bereich?
if ( IsScrollMenu() )
{
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
while ( n < nFirstEntry )
- ImplScroll( sal_True );
+ ImplScroll( TRUE );
Size aOutSz = GetOutputSizePixel();
- sal_uInt16 nLastVisible;
+ USHORT nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
while ( n > nLastVisible )
{
- ImplScroll( sal_False );
+ ImplScroll( FALSE );
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
}
}
- ChangeHighlightItem( n, sal_False );
+ ChangeHighlightItem( n, FALSE );
break;
}
} while ( n != nLoop );
@@ -4917,8 +4862,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
ImplDelData aDelData;
ImplAddDel( &aDelData );
- sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
- bKeyInput = sal_True;
+ USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ bKeyInput = TRUE;
switch ( nCode )
{
case KEY_UP:
@@ -4930,7 +4875,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
case KEY_END:
case KEY_HOME:
{
- ImplCursorUpDown( nCode == KEY_END, sal_True );
+ ImplCursorUpDown( nCode == KEY_END, TRUE );
}
break;
case KEY_F6:
@@ -4986,14 +4931,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
{
if( pMenu )
{
- sal_Bool bDone = sal_False;
+ BOOL bDone = FALSE;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem );
if ( pData && pData->pSubMenu )
{
HighlightChanged( 0 );
- bDone = sal_True;
+ bDone = TRUE;
}
}
if ( !bDone )
@@ -5041,14 +4986,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
default:
{
xub_Unicode nCharCode = rKEvent.GetCharCode();
- sal_uInt16 nPos = 0;
- sal_uInt16 nDuplicates = 0;
+ USHORT nPos = 0;
+ USHORT 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, sal_False );
+ ChangeHighlightItem( nPos, FALSE );
HighlightChanged( 0 );
}
else
@@ -5070,7 +5015,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
if ( !aDelData.IsDelete() )
{
ImplRemoveDel( &aDelData );
- bKeyInput = sal_False;
+ bKeyInput = FALSE;
}
}
@@ -5078,37 +5023,36 @@ void MenuFloatingWindow::Paint( const Rectangle& )
{
if( ! pMenu )
return;
-
+
if( IsNativeControlSupported( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL ) )
{
SetClipRegion();
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,
- aVal,
+ ImplControlValue(),
OUString() );
ImplInitClipRegion();
}
if ( IsScrollMenu() )
{
- ImplDrawScroller( sal_True );
- ImplDrawScroller( sal_False );
+ ImplDrawScroller( TRUE );
+ ImplDrawScroller( FALSE );
}
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, sal_True );
+ HighlightItem( nHighlightedItem, TRUE );
}
-void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp )
+void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
{
if( ! pMenu )
return;
-
+
SetClipRegion();
Size aOutSz = GetOutputSizePixel();
@@ -5119,7 +5063,7 @@ void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp )
DecorationView aDecoView( this );
SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN;
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) )
nStyle |= SYMBOL_DRAW_DISABLE;
@@ -5130,7 +5074,7 @@ void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp )
void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt )
{
- sal_uInt16 nId = nHighlightedItem;
+ USHORT nId = nHighlightedItem;
Menu* pM = pMenu;
Window* pW = this;
@@ -5154,7 +5098,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, sal_False, sal_False );
+ ImplInitMenuWindow( this, FALSE, FALSE );
Invalidate();
}
}
@@ -5168,7 +5112,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitMenuWindow( this, sal_False, sal_False );
+ ImplInitMenuWindow( this, FALSE, FALSE );
Invalidate();
}
}
@@ -5208,37 +5152,41 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
pActivePopup = NULL;
nSaveFocusId = 0;
nHighlightedItem = ITEMPOS_INVALID;
- mbAutoPopup = sal_True;
+ mbAutoPopup = TRUE;
nSaveFocusId = 0;
- bIgnoreFirstMove = sal_True;
- bStayActive = sal_False;
+ bIgnoreFirstMove = TRUE;
+ bStayActive = FALSE;
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
{
BitmapEx aBitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) );
+ BitmapEx aBitmapHC( ResId( SV_RESID_BITMAP_CLOSEDOCHC, *pResMgr ) );
+
aCloser.maImage = Image( aBitmap );
-
+ aCloser.maImageHC = Image( aBitmapHC );
+
aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT );
aCloser.SetBackground();
- aCloser.SetPaintTransparent( sal_True );
+ aCloser.SetPaintTransparent( TRUE );
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
-
- aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 );
+
+ aCloser.InsertItem( IID_DOCUMENTCLOSE,
+ GetSettings().GetStyleSettings().GetHighContrastMode() ? aCloser.maImageHC : aCloser.maImage, 0 );
aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) );
aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) );
aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, XubString( ResId( SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr ) ) );
-
+
aFloatBtn.SetClickHdl( LINK( this, MenuBarWindow, FloatHdl ) );
aFloatBtn.SetSymbol( SYMBOL_FLOAT );
aFloatBtn.SetQuickHelpText( XubString( ResId( SV_HELPTEXT_RESTORE, *pResMgr ) ) );
-
+
aHideBtn.SetClickHdl( LINK( this, MenuBarWindow, HideHdl ) );
aHideBtn.SetSymbol( SYMBOL_HIDE );
aHideBtn.SetQuickHelpText( XubString( ResId( SV_HELPTEXT_MINIMIZE, *pResMgr ) ) );
}
-
+
ImplInitStyleSettings();
AddEventListener( LINK( this, MenuBarWindow, ShowHideListener ) );
@@ -5255,7 +5203,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
pMenu = pMen;
KillActivePopup();
nHighlightedItem = ITEMPOS_INVALID;
- ImplInitMenuWindow( this, sal_True, sal_True );
+ ImplInitMenuWindow( this, TRUE, TRUE );
if ( pMen )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() );
@@ -5275,7 +5223,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
}
}
-void MenuBarWindow::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
+void MenuBarWindow::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose );
aCloser.Show( bClose || ! m_aAddButtons.empty() );
@@ -5293,7 +5241,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG )
{
if( ! pMenu )
return 0;
-
+
if( aCloser.GetCurItemId() == IID_DOCUMENTCLOSE )
{
// #i106052# call close hdl asynchronously to ease handler implementation
@@ -5303,7 +5251,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG )
}
else
{
- std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
+ std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -5320,7 +5268,7 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent )
{
if( ! pMenu )
return 0;
-
+
MenuBar::MenuBarButtonCallbackArg aArg;
aArg.nId = 0xffff;
aArg.bHighlight = (pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHT);
@@ -5329,10 +5277,10 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent )
aArg.nId = aCloser.GetHighlightItemId();
else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF )
{
- sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
+ USHORT nPos = static_cast< USHORT >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
aArg.nId = aCloser.GetItemId( nPos );
}
- std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
+ std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
if( it != m_aAddButtons.end() )
{
it->second.m_aHighlightLink.Call( &aArg );
@@ -5344,7 +5292,7 @@ IMPL_LINK( MenuBarWindow, ShowHideListener, VclWindowEvent*, pEvent )
{
if( ! pMenu )
return 0;
-
+
if( pEvent->GetId() == VCLEVENT_WINDOW_SHOW )
pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID );
else if( pEvent->GetId() == VCLEVENT_WINDOW_HIDE )
@@ -5362,12 +5310,12 @@ IMPL_LINK( MenuBarWindow, HideHdl, PushButton*, EMPTYARG )
return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0;
}
-void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst )
+void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
{
MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL;
if ( pItemData )
{
- bIgnoreFirstMove = sal_True;
+ bIgnoreFirstMove = TRUE;
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
KillActivePopup();
@@ -5377,7 +5325,7 @@ void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nX = 0;
MenuItemData* pData = 0;
- for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
+ for ( ULONG n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->GetItemList()->GetDataFromPos( n );
nX += pData->aSz.Width();
@@ -5424,11 +5372,11 @@ void MenuBarWindow::KillActivePopup()
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = sal_True;
+ pActivePopup->bCanceled = TRUE;
- pActivePopup->bInCallback = sal_True;
+ pActivePopup->bInCallback = TRUE;
pActivePopup->Deactivate();
- pActivePopup->bInCallback = sal_False;
+ pActivePopup->bInCallback = FALSE;
// Abfrage auf pActivePopup, falls im Deactivate abgeschossen...
if ( pActivePopup && pActivePopup->ImplGetWindow() )
{
@@ -5446,22 +5394,22 @@ void MenuBarWindow::PopupClosed( Menu* pPopup )
if ( pPopup == pActivePopup )
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, FALSE );
}
}
void MenuBarWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbAutoPopup = sal_True;
- sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ mbAutoPopup = TRUE;
+ USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
if ( ( nEntry != ITEMPOS_INVALID ) && ( nEntry != nHighlightedItem ) )
{
- ChangeHighlightItem( nEntry, sal_False );
+ ChangeHighlightItem( nEntry, FALSE );
}
else
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
}
}
@@ -5477,48 +5425,48 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt )
if( bIgnoreFirstMove )
{
- bIgnoreFirstMove = sal_False;
+ bIgnoreFirstMove = FALSE;
return;
}
- sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
- if ( ( nEntry != ITEMPOS_INVALID )
+ USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ if ( ( nEntry != ITEMPOS_INVALID )
#ifdef OS2
&& ( ImplHilite(rMEvt) )
#endif
&& ( nEntry != nHighlightedItem ) )
- ChangeHighlightItem( nEntry, sal_False );
+ ChangeHighlightItem( nEntry, FALSE );
}
-void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sal_Bool bAllowRestoreFocus, sal_Bool bDefaultToDocument)
+void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllowRestoreFocus, BOOL bDefaultToDocument)
{
if( ! pMenu )
return;
-
+
// #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert.
MenuItemData* pNextData = pMenu->pItemList->GetDataFromPos( n );
if ( pActivePopup && pActivePopup->ImplGetWindow() && ( !pNextData || ( pActivePopup != pNextData->pSubMenu ) ) )
KillActivePopup(); // pActivePopup ggf. ohne pWin, wenn in Activate() Rescheduled wurde
// Activate am MenuBar immer nur einmal pro Vorgang...
- sal_Bool bJustActivated = sal_False;
+ BOOL bJustActivated = FALSE;
if ( ( nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) )
{
- ImplGetSVData()->maWinData.mbNoDeactivate = sal_True;
+ ImplGetSVData()->maWinData.mbNoDeactivate = TRUE;
if( !bStayActive )
{
// #105406# avoid saving the focus when we already have the focus
- sal_Bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
+ BOOL bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
if( nSaveFocusId )
{
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
// we didn't clean up last time
- Window::EndSaveFocus( nSaveFocusId, sal_False ); // clean up
+ Window::EndSaveFocus( nSaveFocusId, FALSE ); // clean up
nSaveFocusId = 0;
if( !bNoSaveFocus )
- nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
+ nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
}
else {
; // do nothing: we 're activated again from taskpanelist, focus was already saved
@@ -5527,25 +5475,25 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sa
else
{
if( !bNoSaveFocus )
- nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
+ nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
}
}
else
- bStayActive = sal_False;
- pMenu->bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
+ bStayActive = FALSE;
+ pMenu->bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
pMenu->Activate();
- pMenu->bInCallback = sal_False;
- bJustActivated = sal_True;
+ pMenu->bInCallback = FALSE;
+ bJustActivated = TRUE;
}
else if ( ( nHighlightedItem != ITEMPOS_INVALID ) && ( n == ITEMPOS_INVALID ) )
{
- pMenu->bInCallback = sal_True;
+ pMenu->bInCallback = TRUE;
pMenu->Deactivate();
- pMenu->bInCallback = sal_False;
- ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
+ pMenu->bInCallback = FALSE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
- sal_uLong nTempFocusId = nSaveFocusId;
+ ULONG nTempFocusId = nSaveFocusId;
nSaveFocusId = 0;
Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus );
// #105406# restore focus to document if we could not save focus before
@@ -5556,13 +5504,13 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sa
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, sal_False );
+ HighlightItem( nHighlightedItem, FALSE );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (sal_uInt16)n;
+ nHighlightedItem = (USHORT)n;
DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" );
- HighlightItem( nHighlightedItem, sal_True );
+ HighlightItem( nHighlightedItem, TRUE );
pMenu->ImplCallHighlight( nHighlightedItem );
if( mbAutoPopup )
@@ -5573,14 +5521,14 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sa
GrabFocus();
}
-void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
+void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
{
if( ! pMenu )
return;
-
+
long nX = 0;
- sal_uLong nCount = pMenu->pItemList->Count();
- for ( sal_uLong n = 0; n < nCount; n++ )
+ ULONG nCount = pMenu->pItemList->Count();
+ for ( ULONG n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5608,7 +5556,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
aControlValue,
OUString() );
ImplAddNWFSeparator( this, aControlValue );
-
+
// draw selected item
DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
aRect,
@@ -5651,14 +5599,14 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
}
}
-Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos )
+Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos )
{
Rectangle aRect;
if( pMenu )
{
long nX = 0;
- sal_uLong nCount = pMenu->pItemList->Count();
- for ( sal_uLong n = 0; n < nCount; n++ )
+ ULONG nCount = pMenu->pItemList->Count();
+ for ( ULONG n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5668,7 +5616,7 @@ Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos )
aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) );
break;
}
-
+
nX += pData->aSz.Width();
}
}
@@ -5681,16 +5629,16 @@ void MenuBarWindow::KeyInput( const KeyEvent& rKEvent )
Window::KeyInput( rKEvent );
}
-sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
+BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
{
if( ! pMenu )
- return sal_False;
-
+ return FALSE;
+
if ( pMenu->bInCallback )
- return sal_True; // schlucken
+ return TRUE; // schlucken
- sal_Bool bDone = sal_False;
- sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
+ BOOL bDone = FALSE;
+ USHORT nCode = rKEvent.GetKeyCode().GetCode();
if( GetParent() )
{
@@ -5699,7 +5647,7 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT );
if( pSysWin->GetTaskPaneList() )
if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) )
- return sal_True;
+ return TRUE;
}
}
@@ -5708,22 +5656,22 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
mbAutoPopup = ImplGetSVData()->maNWFData.mbOpenMenuOnF10;
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- ChangeHighlightItem( 0, sal_False );
+ ChangeHighlightItem( 0, FALSE );
GrabFocus();
}
else
{
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
nSaveFocusId = 0;
}
- bDone = sal_True;
+ bDone = TRUE;
}
else if ( bFromMenu )
{
if ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) ||
( nCode == KEY_HOME ) || ( nCode == KEY_END ) )
{
- sal_uInt16 n = nHighlightedItem;
+ USHORT n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( nCode == KEY_LEFT)
@@ -5731,7 +5679,7 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
else
n = pMenu->GetItemCount()-1;
}
-
+
// handling gtk like (aka mbOpenMenuOnF10)
// do not highlight an item when opening a sub menu
// unless there already was a higlighted sub menu item
@@ -5743,10 +5691,10 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID);
}
- sal_uInt16 nLoop = n;
+ USHORT nLoop = n;
if( nCode == KEY_HOME )
- { n = (sal_uInt16)-1; nLoop = n+1; }
+ { n = (USHORT)-1; nLoop = n+1; }
if( nCode == KEY_END )
{ n = pMenu->GetItemCount(); nLoop = n-1; }
@@ -5769,14 +5717,14 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n );
if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) )
{
- sal_Bool bDoSelect = sal_True;
+ BOOL bDoSelect = TRUE;
if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 )
bDoSelect = bWasHighlight;
ChangeHighlightItem( n, bDoSelect );
break;
}
} while ( n != nLoop );
- bDone = sal_True;
+ bDone = TRUE;
}
else if ( nCode == KEY_RETURN )
{
@@ -5784,36 +5732,36 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
else
if ( !mbAutoPopup )
{
- ImplCreatePopup( sal_True );
- mbAutoPopup = sal_True;
+ ImplCreatePopup( TRUE );
+ mbAutoPopup = TRUE;
}
- bDone = sal_True;
+ bDone = TRUE;
}
else if ( ( nCode == KEY_UP ) || ( nCode == KEY_DOWN ) )
{
if ( !mbAutoPopup )
{
- ImplCreatePopup( sal_True );
- mbAutoPopup = sal_True;
+ ImplCreatePopup( TRUE );
+ mbAutoPopup = TRUE;
}
- bDone = sal_True;
+ bDone = TRUE;
}
else if ( nCode == KEY_ESCAPE || ( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) )
{
if( pActivePopup )
{
// bring focus to menu bar without any open popup
- mbAutoPopup = sal_False;
- sal_uInt16 n = nHighlightedItem;
+ mbAutoPopup = FALSE;
+ USHORT n = nHighlightedItem;
nHighlightedItem = ITEMPOS_INVALID;
- bStayActive = sal_True;
- ChangeHighlightItem( n, sal_False );
- bStayActive = sal_False;
+ bStayActive = TRUE;
+ ChangeHighlightItem( n, FALSE );
+ bStayActive = FALSE;
KillActivePopup();
GrabFocus();
}
else
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
if( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() )
{
@@ -5821,7 +5769,7 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
GrabFocusToDocument();
}
- bDone = sal_True;
+ bDone = TRUE;
}
}
@@ -5830,19 +5778,19 @@ sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bF
xub_Unicode nCharCode = rKEvent.GetCharCode();
if ( nCharCode )
{
- sal_uInt16 nEntry, nDuplicates;
+ USHORT nEntry, nDuplicates;
MenuItemData* pData = pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nEntry, nDuplicates, nHighlightedItem );
if ( pData && (nEntry != ITEMPOS_INVALID) )
{
- mbAutoPopup = sal_True;
- ChangeHighlightItem( nEntry, sal_True );
- bDone = sal_True;
+ mbAutoPopup = TRUE;
+ ChangeHighlightItem( nEntry, TRUE );
+ bDone = TRUE;
}
else
{
// Wegen Systemmenu und anderen System-HotKeys, nur
// eigenstaendige Character-Kombinationen auswerten
- sal_uInt16 nKeyCode = rKEvent.GetKeyCode().GetCode();
+ USHORT nKeyCode = rKEvent.GetKeyCode().GetCode();
if ( ((nKeyCode >= KEY_A) && (nKeyCode <= KEY_Z)) )
Sound::Beep();
}
@@ -5855,7 +5803,7 @@ void MenuBarWindow::Paint( const Rectangle& )
{
if( ! pMenu )
return;
-
+
// no VCL paint if native menus
if( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() )
{
@@ -5877,7 +5825,7 @@ void MenuBarWindow::Paint( const Rectangle& )
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, 0 );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, sal_True );
+ HighlightItem( nHighlightedItem, TRUE );
// in high contrast mode draw a separating line on the lower edge
if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) &&
@@ -5929,20 +5877,20 @@ void MenuBarWindow::Resize()
Invalidate();
}
-sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
+USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
{
if( pMenu )
{
long nX = 0;
- sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+ USHORT nCount = (USHORT)pMenu->pItemList->Count();
+ for ( USHORT n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( pMenu->ImplIsVisible( n ) )
{
nX += pData->aSz.Width();
if ( nX > rMousePos.X() )
- return (sal_uInt16)n;
+ return (USHORT)n;
}
}
}
@@ -5951,9 +5899,9 @@ sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
void MenuBarWindow::RequestHelp( const HelpEvent& rHEvt )
{
- sal_uInt16 nId = nHighlightedItem;
+ USHORT nId = nHighlightedItem;
if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
- ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
+ ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
Rectangle aHighlightRect( ImplGetItemRect( nHighlightedItem ) );
if( !ImplHandleHelpEvent( this, pMenu, nId, rHEvt, aHighlightRect ) )
@@ -5967,7 +5915,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) ||
( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, sal_False, sal_True );
+ ImplInitMenuWindow( this, FALSE, TRUE );
Invalidate();
}
else if( pMenu )
@@ -5979,13 +5927,13 @@ void MenuBarWindow::ImplLayoutChanged()
{
if( pMenu )
{
- ImplInitMenuWindow( this, sal_True, sal_True );
+ ImplInitMenuWindow( this, TRUE, TRUE );
// Falls sich der Font geaendert hat.
long nHeight = pMenu->ImplCalcSize( this ).Height();
// depending on the native implementation or the displayable flag
// the menubar windows is supressed (ie, height=0)
- if( !((MenuBar*) pMenu)->IsDisplayable() ||
+ if( !((MenuBar*) pMenu)->IsDisplayable() ||
( pMenu->ImplGetSalMenu() && pMenu->ImplGetSalMenu()->VisibleMenuBar() ) )
nHeight = 0;
@@ -6031,16 +5979,16 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
void MenuBarWindow::LoseFocus()
{
- if ( !HasChildPathFocus( sal_True ) )
- ChangeHighlightItem( ITEMPOS_INVALID, sal_False, sal_False );
+ if ( !HasChildPathFocus( TRUE ) )
+ ChangeHighlightItem( ITEMPOS_INVALID, FALSE, FALSE );
}
void MenuBarWindow::GetFocus()
{
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- mbAutoPopup = sal_False; // do not open menu when activated by focus handling like taskpane cycling
- ChangeHighlightItem( 0, sal_False );
+ mbAutoPopup = FALSE; // do not open menu when activated by focus handling like taskpane cycling
+ ChangeHighlightItem( 0, FALSE );
}
}
@@ -6054,14 +6002,14 @@ void MenuBarWindow::GetFocus()
return xAcc;
}
-sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
+USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
{
// find first free button id
- sal_uInt16 nId = IID_DOCUMENTCLOSE;
- std::map< sal_uInt16, AddButtonEntry >::const_iterator it;
+ USHORT nId = IID_DOCUMENTCLOSE;
+ std::map< USHORT, AddButtonEntry >::const_iterator it;
if( i_nPos > m_aAddButtons.size() )
- i_nPos = static_cast<sal_uInt16>(m_aAddButtons.size());
- do
+ i_nPos = static_cast<USHORT>(m_aAddButtons.size());
+ do
{
nId++;
it = m_aAddButtons.find( nId );
@@ -6076,21 +6024,21 @@ sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i
aFloatBtn.IsVisible(),
aHideBtn.IsVisible() );
ImplLayoutChanged();
-
+
if( pMenu->mpSalMenu )
pMenu->mpSalMenu->AddMenuBarButton( SalMenuButtonItem( nId, i_rImage, i_rToolTip ) );
-
+
return nId;
}
-void MenuBarWindow::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
+void MenuBarWindow::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
{
- std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
+ std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
if( it != m_aAddButtons.end() )
it->second.m_aHighlightLink = rLink;
}
-Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId )
+Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId )
{
Rectangle aRect;
if( m_aAddButtons.find( nId ) != m_aAddButtons.end() )
@@ -6104,7 +6052,7 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId )
return Rectangle();
}
}
-
+
if( aRect.IsEmpty() )
{
aRect = aCloser.GetItemRect( nId );
@@ -6115,9 +6063,9 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId )
return aRect;
}
-void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId )
+void MenuBarWindow::RemoveMenuBarButton( USHORT nId )
{
- sal_uInt16 nPos = aCloser.GetItemPos( nId );
+ USHORT nPos = aCloser.GetItemPos( nId );
aCloser.RemoveItem( nPos );
m_aAddButtons.erase( nId );
aCloser.calcMinSize();
@@ -6127,9 +6075,9 @@ void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId )
pMenu->mpSalMenu->RemoveMenuBarButton( nId );
}
-bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId )
+bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
{
- std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
+ std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -6138,7 +6086,7 @@ bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId )
aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
return it->second.m_aSelectLink.Call( &aArg );
}
- return sal_False;
+ return FALSE;
}
ImplMenuDelData::ImplMenuDelData( const Menu* pMenu )
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index ca8bcf3c2917..b73726c71e79 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,9 +49,9 @@ MnemonicGenerator::MnemonicGenerator()
// -----------------------------------------------------------------------
-sal_uInt16 MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
+USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
{
- static sal_uInt16 const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] =
+ static USHORT 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 @@ sal_uInt16 MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
MNEMONIC_RANGE_4_START, MNEMONIC_RANGE_4_END
};
- sal_uInt16 nMnemonicIndex = 0;
- for ( sal_uInt16 i = 0; i < MNEMONIC_RANGES; i++ )
+ USHORT nMnemonicIndex = 0;
+ for ( USHORT 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 )
{
- sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic );
+ USHORT 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 );
- sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( c );
+ USHORT nMnemonicIndex = ImplGetMnemonicIndex( c );
if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
{
if ( maMnemonics[nMnemonicIndex] && (maMnemonics[nMnemonicIndex] < 0xFF) )
@@ -133,24 +133,24 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
// -----------------------------------------------------------------------
-sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
+BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
if ( !rKey.Len() || ImplFindMnemonic( rKey ) )
- return sal_False;
+ return 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 sal_False;
+ return FALSE;
XubString aKey = xCharClass->toUpper( rKey, 0, rKey.Len(), rLocale );
- sal_Bool bChanged = sal_False;
+ BOOL bChanged = FALSE;
xub_StrLen nLen = aKey.Len();
- sal_Bool bCJK = sal_False;
+ BOOL bCJK = FALSE;
switch( Application::GetSettings().GetUILanguage() )
{
case LANGUAGE_JAPANESE:
@@ -161,7 +161,7 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
case LANGUAGE_CHINESE_MACAU:
case LANGUAGE_KOREAN:
case LANGUAGE_KOREAN_JOHAB:
- bCJK = sal_True;
+ bCJK = TRUE;
break;
default:
break;
@@ -173,8 +173,8 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
// #110720#, avoid CJK-style mnemonics for latin-only strings that do not contain useful mnemonic chars
if( bCJK )
{
- sal_Bool bLatinOnly = sal_True;
- sal_Bool bMnemonicIndexFound = sal_False;
+ BOOL bLatinOnly = TRUE;
+ BOOL bMnemonicIndexFound = FALSE;
sal_Unicode c;
xub_StrLen nIndex;
@@ -184,19 +184,19 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
if ( ((c >= 0x3000) && (c <= 0xD7FF)) || // cjk
((c >= 0xFF61) && (c <= 0xFFDC)) ) // halfwidth forms
{
- bLatinOnly = sal_False;
+ bLatinOnly = FALSE;
break;
}
if( ImplGetMnemonicIndex( c ) != MNEMONIC_INDEX_NOTFOUND )
- bMnemonicIndexFound = sal_True;
+ bMnemonicIndexFound = TRUE;
}
if( bLatinOnly && !bMnemonicIndexFound )
- return sal_False;
+ return FALSE;
}
int nCJK = 0;
- sal_uInt16 nMnemonicIndex;
+ USHORT nMnemonicIndex;
sal_Unicode c;
xub_StrLen nIndex = 0;
if( !bCJK )
@@ -226,7 +226,7 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nIndex );
- bChanged = sal_True;
+ bChanged = TRUE;
break;
}
}
@@ -247,8 +247,8 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
// 2) search for a unique/uncommon character
if ( !bChanged )
{
- sal_uInt16 nBestCount = 0xFFFF;
- sal_uInt16 nBestMnemonicIndex = 0;
+ USHORT nBestCount = 0xFFFF;
+ USHORT nBestMnemonicIndex = 0;
xub_StrLen nBestIndex = 0;
nIndex = 0;
do
@@ -278,7 +278,7 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nBestMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nBestIndex );
- bChanged = sal_True;
+ bChanged = TRUE;
}
}
}
@@ -326,7 +326,7 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
nIndex--;
}
rKey.Insert( aStr, nIndex );
- bChanged = sal_True;
+ bChanged = TRUE;
break;
}
}
@@ -345,16 +345,16 @@ sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
// do
// {
// c = aKey.GetChar( nIndex );
-//
+//
// nMnemonicIndex = ImplGetMnemonicIndex( c );
// if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
// {
// maMnemonics[nMnemonicIndex] = 0;
// rKey.Insert( MNEMONIC_CHAR, nIndex );
-// bChanged = sal_True;
+// bChanged = TRUE;
// break;
// }
-//
+//
// // Search for next word
// do
// {
@@ -388,7 +388,7 @@ String MnemonicGenerator::EraseAllMnemonicChars( const String& rStr )
String aStr = rStr;
xub_StrLen nLen = aStr.Len();
xub_StrLen i = 0;
-
+
while ( i < nLen )
{
if ( aStr.GetChar( i ) == '~' )
@@ -397,8 +397,8 @@ String MnemonicGenerator::EraseAllMnemonicChars( const String& rStr )
if( i > 0 && (i+2) < nLen )
{
sal_Unicode c = aStr.GetChar(i+1);
- if( aStr.GetChar( i-1 ) == '(' &&
- aStr.GetChar( i+2 ) == ')' &&
+ if( aStr.GetChar( i-1 ) == '(' &&
+ aStr.GetChar( i+2 ) == ')' &&
c >= MNEMONIC_RANGE_2_START && c <= MNEMONIC_RANGE_2_END )
{
aStr.Erase( i-1, 4 );
diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx
index 1ca9f2c22d57..297804765452 100644
--- a/vcl/source/window/mnemonicengine.cxx
+++ b/vcl/source/window/mnemonicengine.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -103,7 +103,7 @@ namespace vcl
//--------------------------------------------------------------------
bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt )
{
- sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2();
+ BOOL bAccelKey = _rKEvt.GetKeyCode().IsMod2();
if ( !bAccelKey )
return false;
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index 2e76750e1cf5..e43a0f67896e 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,7 +39,7 @@
MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
: maPos( rEvent.X, rEvent.Y )
, mnMode( 0 )
-, mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) )
+, mnClicks( static_cast< USHORT >( rEvent.ClickCount ) )
, mnCode( 0 )
{
if( rEvent.Modifiers )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index ae4c148d5807..bad0c0c94bda 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,11 +54,14 @@ static void ImplInitMsgBoxImageList()
{
ResMgr* pResMgr = ImplGetResMgr();
pSVData->maWinData.mpMsgBoxImgList = new ImageList(4);
+ pSVData->maWinData.mpMsgBoxHCImgList = new ImageList(4);
if( pResMgr )
{
Color aNonAlphaMask( 0xC0, 0xC0, 0xC0 );
pSVData->maWinData.mpMsgBoxImgList->InsertFromHorizontalBitmap
( ResId( SV_RESID_BITMAP_MSGBOX, *pResMgr ), 4, &aNonAlphaMask );
+ pSVData->maWinData.mpMsgBoxHCImgList->InsertFromHorizontalBitmap
+ ( ResId( SV_RESID_BITMAP_MSGBOX_HC, *pResMgr ), 4, &aNonAlphaMask );
}
}
}
@@ -67,13 +70,13 @@ static void ImplInitMsgBoxImageList()
void MessBox::ImplInitMessBoxData()
{
- mpFixedText = NULL;
- mpFixedImage = NULL;
- mnSoundType = 0;
- mbHelpBtn = sal_False;
- mbSound = sal_True;
+ mpFixedText = NULL;
+ mpFixedImage = NULL;
+ mnSoundType = 0;
+ mbHelpBtn = FALSE;
+ mbSound = TRUE;
mpCheckBox = NULL;
- mbCheck = sal_False;
+ mbCheck = FALSE;
}
// -----------------------------------------------------------------------
@@ -81,11 +84,11 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
- sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- sal_uInt16 nRetryFlags = 0;
- sal_uInt16 nYesFlags = 0;
- sal_uInt16 nNoFlags = 0;
+ USHORT nOKFlags = BUTTONDIALOG_OKBUTTON;
+ USHORT nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
+ USHORT nRetryFlags = 0;
+ USHORT nYesFlags = 0;
+ USHORT nNoFlags = 0;
if ( nStyle & WB_OK_CANCEL )
{
@@ -133,8 +136,8 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- sal_uInt16 nAbortFlags = 0;
- sal_uInt16 nIgnoreFlags = 0;
+ USHORT nAbortFlags = 0;
+ USHORT nIgnoreFlags = 0;
if ( nStyle & WB_DEF_CANCEL )
nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
@@ -186,15 +189,16 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
ImplInitMessBoxData();
GetRes( rResId.SetRT( RSC_MESSBOX ) );
- 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);
+ 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);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
ImplLoadRes( rResId );
@@ -205,7 +209,7 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
void MessBox::ImplLoadRes( const ResId& )
{
- SetText( ReadStringRes() );
+ SetText( ReadStringRes() );
SetMessText( ReadStringRes() );
SetHelpText( ReadStringRes() );
}
@@ -226,12 +230,12 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId().getLength() )
+ if ( GetHelpId() )
{
if ( !mbHelpBtn )
{
AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
- mbHelpBtn = sal_True;
+ mbHelpBtn = TRUE;
}
}
else
@@ -239,25 +243,25 @@ void MessBox::ImplPosControls()
if ( mbHelpBtn )
{
RemoveButton( BUTTONID_HELP );
- mbHelpBtn = sal_False;
+ mbHelpBtn = FALSE;
}
}
- XubString aMessText( maMessText );
- TextRectInfo aTextInfo;
- Rectangle aRect( 0, 0, 30000, 30000 );
- Rectangle aFormatRect;
- Point aTextPos( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+IMPL_MSGBOX_OFFSET_EXTRA_Y );
- Size aImageSize;
- Size aPageSize;
- Size aFixedSize;
- long nTitleWidth;
- long nButtonSize = ImplGetButtonSize();
- long nMaxWidth = GetDesktopRectPixel().GetWidth()-8;
- long nMaxLineWidth;
- long nWidth;
- WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO;
- sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
+ XubString aMessText( maMessText );
+ TextRectInfo aTextInfo;
+ Rectangle aRect( 0, 0, 30000, 30000 );
+ Rectangle aFormatRect;
+ Point aTextPos( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+IMPL_MSGBOX_OFFSET_EXTRA_Y );
+ Size aImageSize;
+ Size aPageSize;
+ Size aFixedSize;
+ long nTitleWidth;
+ long nButtonSize = ImplGetButtonSize();
+ long nMaxWidth = GetDesktopRectPixel().GetWidth()-8;
+ 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;
if ( mpFixedText )
delete mpFixedText;
@@ -275,8 +279,8 @@ void MessBox::ImplPosControls()
// Message-Text um Tabs bereinigen
- XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- sal_uInt16 nIndex = 0;
+ XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) );
+ USHORT nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex );
@@ -300,7 +304,7 @@ void MessBox::ImplPosControls()
aImageSize = maImage.GetSizePixel();
if ( aImageSize.Width() )
{
- aImageSize.Width() += 4;
+ aImageSize.Width() += 4;
aImageSize.Height() += 4;
aTextPos.X() += aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE;
mpFixedImage = new FixedImage( this );
@@ -308,6 +312,9 @@ void MessBox::ImplPosControls()
IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_Y ),
aImageSize );
mpFixedImage->SetImage( maImage );
+ // forward the HC image
+ if( !!maImageHC )
+ mpFixedImage->SetModeImage( maImageHC, BMP_COLOR_HIGHCONTRAST );
mpFixedImage->Show();
nMaxWidth -= aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE;
}
@@ -341,19 +348,19 @@ void MessBox::ImplPosControls()
}
// Style fuer FixedText ermitteln
- aPageSize.Width() = aImageSize.Width();
- aFixedSize.Width() = aTextInfo.GetMaxLineWidth()+1;
+ aPageSize.Width() = aImageSize.Width();
+ aFixedSize.Width() = aTextInfo.GetMaxLineWidth()+1;
aFixedSize.Height() = aFormatRect.GetHeight();
if ( aFixedSize.Height() < aImageSize.Height() )
{
nWinStyle |= WB_VCENTER;
- aPageSize.Height() = aImageSize.Height();
+ aPageSize.Height() = aImageSize.Height();
aFixedSize.Height() = aImageSize.Height();
}
else
{
nWinStyle |= WB_TOP;
- aPageSize.Height() = aFixedSize.Height();
+ aPageSize.Height() = aFixedSize.Height();
}
if ( aImageSize.Width() )
aPageSize.Width() += IMPL_SEP_MSGBOX_IMAGE;
@@ -413,8 +420,6 @@ 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();
@@ -436,14 +441,14 @@ void MessBox::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-sal_Bool MessBox::GetCheckBoxState() const
+BOOL MessBox::GetCheckBoxState() const
{
return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck;
}
// -----------------------------------------------------------------------
-void MessBox::SetCheckBoxState( sal_Bool bCheck )
+void MessBox::SetCheckBoxState( BOOL bCheck )
{
if( mpCheckBox ) mpCheckBox->Check( bCheck );
mbCheck = bCheck;
@@ -460,42 +465,38 @@ void MessBox::SetDefaultCheckBoxText()
// -----------------------------------------------------------------------
-sal_Bool MessBox::SetModeImage( const Image& rImage )
+BOOL MessBox::SetModeImage( const Image& rImage, BmpColorMode eMode )
{
- SetImage( rImage );
- return sal_True;
+ if( eMode == BMP_COLOR_NORMAL )
+ SetImage( rImage );
+ else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ maImageHC = rImage;
+ else
+ return FALSE;
+ return TRUE;
}
// -----------------------------------------------------------------------
-const Image& MessBox::GetModeImage( ) const
+const Image& MessBox::GetModeImage( BmpColorMode eMode ) const
{
- return maImage;
+ if( eMode == BMP_COLOR_HIGHCONTRAST )
+ return maImageHC;
+ else
+ return maImage;
}
// -----------------------------------------------------------------------
-Size MessBox::GetOptimalSize(WindowSizeType eType) const
-{
- switch( eType ) {
- case WINDOWSIZE_MINIMUM:
- // FIXME: base me on the font size ?
- return Size( 250, 100 );
- default:
- return Window::GetOptimalSize( eType );
- }
-}
-
-// ============================================================================
-
void InfoBox::ImplInitInfoBoxData()
{
// Default Text is the display title from the application
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( InfoBox::GetStandardImage() );
- mnSoundType = ((sal_uInt16)SOUND_INFO)+1;
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ InfoBox::GetStandardImageHC() : InfoBox::GetStandardImage() );
+ mnSoundType = ((USHORT)SOUND_INFO)+1;
}
// -----------------------------------------------------------------------
@@ -522,7 +523,15 @@ Image InfoBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 );
}
-// ============================================================================
+// -----------------------------------------------------------------------
+
+Image InfoBox::GetStandardImageHC()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 4 );
+}
+
+// -----------------------------------------------------------------------
void WarningBox::ImplInitWarningBoxData()
{
@@ -531,7 +540,7 @@ void WarningBox::ImplInitWarningBoxData()
SetText( Application::GetDisplayName() );
SetImage( WarningBox::GetStandardImage() );
- mnSoundType = ((sal_uInt16)SOUND_WARNING)+1;
+ mnSoundType = ((USHORT)SOUND_WARNING)+1;
}
// -----------------------------------------------------------------------
@@ -568,7 +577,7 @@ Image WarningBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 );
}
-// ============================================================================
+// -----------------------------------------------------------------------
void ErrorBox::ImplInitErrorBoxData()
{
@@ -576,8 +585,9 @@ void ErrorBox::ImplInitErrorBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( ErrorBox::GetStandardImage() );
- mnSoundType = ((sal_uInt16)SOUND_ERROR)+1;
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ ErrorBox::GetStandardImageHC() : ErrorBox::GetStandardImage() );
+ mnSoundType = ((USHORT)SOUND_ERROR)+1;
}
// -----------------------------------------------------------------------
@@ -605,7 +615,15 @@ Image ErrorBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 );
}
-// ============================================================================
+// -----------------------------------------------------------------------
+
+Image ErrorBox::GetStandardImageHC()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 1 );
+}
+
+// -----------------------------------------------------------------------
void QueryBox::ImplInitQueryBoxData()
{
@@ -613,8 +631,9 @@ void QueryBox::ImplInitQueryBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( QueryBox::GetStandardImage() );
- mnSoundType = ((sal_uInt16)SOUND_QUERY)+1;
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
+ mnSoundType = ((USHORT)SOUND_QUERY)+1;
}
// -----------------------------------------------------------------------
@@ -650,4 +669,25 @@ Image QueryBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 2 );
}
+// -----------------------------------------------------------------------
+
+Image QueryBox::GetStandardImageHC()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 2 );
+}
+
+// -----------------------------------------------------------------------
+
+Size MessBox::GetOptimalSize(WindowSizeType eType) const
+{
+ switch( eType ) {
+ case WINDOWSIZE_MINIMUM:
+ // FIXME: base me on the font size ?
+ return Size( 250, 100 );
+ default:
+ return Window::GetOptimalSize( eType );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx
index 46fc51d8176d..d96279e86b09 100644
--- a/vcl/source/window/popupmenuwindow.cxx
+++ b/vcl/source/window/popupmenuwindow.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index a433a57faefb..8ce5ed61d13d 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,7 +47,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/strbuf.hxx"
+#include "rtl/ustrbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,35 +61,101 @@ 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( sal_True );
+ SetPaintTransparent( 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" ) ) );
+ if( useHCColorReplacement() )
+ maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
+ else
+ maPageVDev.SetBackground( Color( COL_WHITE ) );
}
PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
{
}
+bool PrintDialog::PrintPreviewWindow::useHCColorReplacement() const
+{
+ bool bRet = false;
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ try
+ {
+ // get service provider
+ Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ // create configuration hierachical access name
+ if( xSMgr.is() )
+ {
+ try
+ {
+ Reference< XMultiServiceFactory > 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" ) );
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Accessibility" ) );
+ aArgs.getArray()[0] <<= aVal;
+ Reference< XNameAccess > xConfigAccess(
+ Reference< XNameAccess >(
+ xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess" )),
+ aArgs ),
+ UNO_QUERY )
+ );
+ if( xConfigAccess.is() )
+ {
+ try
+ {
+ sal_Bool bValue = sal_False;
+ Any aAny = xConfigAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsForPagePreviews" ) ) );
+ if( aAny >>= bValue )
+ bRet = bool(bValue);
+ }
+ catch( NoSuchElementException& )
+ {
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+ }
+ return bRet;
+}
+
void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDCEvt )
{
// react on settings changed
if( i_rDCEvt.GetType() == DATACHANGED_SETTINGS )
{
- maPageVDev.SetBackground( Color( COL_WHITE ) );
+ if( useHCColorReplacement() )
+ maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
+ else
+ maPageVDev.SetBackground( Color( COL_WHITE ) );
}
Window::DataChanged( i_rDCEvt );
}
@@ -97,13 +163,12 @@ 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() -= nTextHeight + 2;
- aNewSize.Height() -= nTextHeight + 2;
+ aNewSize.Width() -= 2;
+ aNewSize.Height() -= 2;
Size aScaledSize;
double fScale = 1.0;
-
+
// #i106435# catch corner case of Size(0,0)
Size aOrigSize( maOrigSize );
if( aOrigSize.Width() < 1 )
@@ -124,9 +189,9 @@ void PrintDialog::PrintPreviewWindow::Resize()
}
aScaledSize.Width() = long(aScaledSize.Width()*fScale);
aScaledSize.Height() = long(aScaledSize.Height()*fScale);
-
+
maPreviewSize = aScaledSize;
-
+
// #i104784# if we render the page too small then rounding issues result in
// layout artifacts looking really bad. So scale the page unto a device that is not
// full page size but not too small either. This also results in much better visual
@@ -140,30 +205,18 @@ void PrintDialog::PrintPreviewWindow::Resize()
aScaledSize.Height() *= 2;
fZoom /= 2.0;
}
-
- 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() ) );
-
+
+ maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
}
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( nTextHeight, nTextHeight ), aSize );
+ Rectangle aTextRect( Point( 0, 0 ), aSize );
DecorationView aVw( this );
aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
aTextRect.Left() += 2;
@@ -180,10 +233,10 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
else
{
GDIMetaFile aMtf( maMtf );
-
- Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight,
- (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight );
-
+
+ Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
+ (aSize.Height() - maPreviewSize.Height()) / 2 );
+
Size aVDevSize( maPageVDev.GetOutputSizePixel() );
const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
Size aOrigSize( maOrigSize );
@@ -192,27 +245,21 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
if( aOrigSize.Height() < 1 )
aOrigSize.Height() = aLogicSize.Height();
double fScale = double(aLogicSize.Width())/double(aOrigSize.Width());
-
-
+
+
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();
aMtf.Play( &maPageVDev, Point( 0, 0 ), aLogicSize );
maPageVDev.Pop();
-
+
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 ) );
aVw.DrawFrame( aFrame, FRAME_DRAW_GROUP );
@@ -241,50 +288,31 @@ 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,
- bool i_bGreyscale
+ sal_Int32 i_nDPIY
)
{
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;
+ if( useHCColorReplacement() )
+ {
+ maMtf.ReplaceColors( Color( COL_BLACK ), Color( COL_WHITE ), 30 );
+ }
maOrigSize = i_rOrigSize;
maReplacementString = i_rReplacement;
- mbGreyscale = i_bGreyscale;
maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
- 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() );
-
+ maPageVDev.EnableOutput( TRUE );
Resize();
Invalidate();
}
@@ -312,7 +340,7 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
Window::Paint( i_rRect );
SetMapMode( MAP_PIXEL );
SetTextColor( GetSettings().GetStyleSettings().GetFieldTextColor() );
-
+
int nPages = mnRows * mnColumns;
Font aFont( GetSettings().GetStyleSettings().GetFieldFont() );
aFont.SetSize( Size( 0, 24 ) );
@@ -328,7 +356,7 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
long nFontHeight = long(24.0*fScale) - 3;
if( nFontHeight < 5 )
nFontHeight = 5;
- aFont.SetSize( Size( 0, nFontHeight ) );
+ aFont.SetSize( Size( 0, nFontHeight ) );
SetFont( aFont );
long nTextHeight = GetTextHeight();
for( int i = 0; i < nPages; i++ )
@@ -337,18 +365,12 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
int nX = 0, nY = 0;
switch( mnOrderMode )
{
- case SV_PRINT_PRT_NUP_ORDER_LRTB:
+ case SV_PRINT_PRT_NUP_ORDER_LRTD:
nX = (i % mnColumns); nY = (i / mnColumns);
break;
- case SV_PRINT_PRT_NUP_ORDER_TBLR:
+ case SV_PRINT_PRT_NUP_ORDER_TDLR:
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;
@@ -386,15 +408,15 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
, maBorderCB( this, VclResId( SV_PRINT_PRT_NUP_BORDER_CB ) )
{
FreeResource();
-
+
maNupOrderWin.Show();
- maPagesBtn.Check( sal_True );
- maBrochureBtn.Show( sal_False );
-
+ maPagesBtn.Check( TRUE );
+ maBrochureBtn.Show( FALSE );
+
// setup field units for metric fields
const LocaleDataWrapper& rLocWrap( maPageMarginEdt.GetLocaleDataWrapper() );
FieldUnit eUnit = FUNIT_MM;
- sal_uInt16 nDigits = 0;
+ USHORT nDigits = 0;
if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
{
eUnit = FUNIT_INCH;
@@ -407,6 +429,28 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
// set precision
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();
}
@@ -417,7 +461,7 @@ PrintDialog::NUpTabPage::~NUpTabPage()
void PrintDialog::NUpTabPage::enableNupControls( bool bEnable )
{
- maNupPagesBox.Enable( sal_True );
+ maNupPagesBox.Enable( TRUE );
maNupNumPagesTxt.Enable( bEnable );
maNupColEdt.Enable( bEnable );
maNupTimesTxt.Enable( bEnable );
@@ -450,21 +494,22 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow )
maSheetMarginTxt2.Show( i_bShow );
maNupOrientationTxt.Show( i_bShow );
maNupOrientationBox.Show( i_bShow );
- getLayout()->resize();
+ maLayout.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();
- xLayout->addWindow( &maNupLine );
- boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) );
- xLayout->addChild( xRow );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
+
+ maLayout.addWindow( &maNupLine );
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) );
+ maLayout.addChild( xRow );
boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) );
xRow->addChild( xIndent );
@@ -474,12 +519,12 @@ void PrintDialog::NUpTabPage::setupLayout()
boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xShowNupCol.get() ) );
xShowNupCol->addChild( xSpacer );
- boost::shared_ptr< vcl::LabelColumn > xMainCol( new vcl::LabelColumn( xIndent.get() ) );
+ boost::shared_ptr< vcl::LabelColumn > xMainCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xMainCol );
-
+
size_t nPagesIndex = xMainCol->addRow( &maPagesBtn, &maNupPagesBox );
mxPagesBtnLabel = boost::dynamic_pointer_cast<vcl::LabeledElement>( xMainCol->getChild( nPagesIndex ) );
-
+
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
xMainCol->addRow( &maNupNumPagesTxt, xRow, nIndent );
xRow->addWindow( &maNupColEdt );
@@ -490,28 +535,33 @@ void PrintDialog::NUpTabPage::setupLayout()
xLab->setLabel( &maPageMarginEdt );
xLab->setElement( &maPageMarginTxt2 );
xMainCol->addRow( &maPageMarginTxt1, xLab, nIndent );
-
+
xLab.reset( new vcl::LabeledElement( xMainCol.get(), 2 ) );
xLab->setLabel( &maSheetMarginEdt );
xLab->setElement( &maSheetMarginTxt2 );
xMainCol->addRow( &maSheetMarginTxt1, xLab, nIndent );
xMainCol->addRow( &maNupOrientationTxt, &maNupOrientationBox, nIndent );
- xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
+ xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 );
-
- xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) );
+
+ xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) );
xMainCol->addChild( xSpacer );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
xMainCol->addRow( &maBrochureBtn, xRow );
// remember brochure row for dependencies
mxBrochureDep = xRow;
-
+
// initially advanced controls are not shown, rows=columns=1
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 );
@@ -547,19 +597,38 @@ 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 ) )
+ , maCollateHCImg( VclResId( SV_PRINT_COLLATE_HC_IMG ) )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
+ , maNoCollateHCImg( VclResId( SV_PRINT_NOCOLLATE_HC_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();
maCommentTxt.Show();
maLocationTxt.Show();
-
+
setupLayout();
}
@@ -572,39 +641,41 @@ void PrintDialog::JobTabPage::setupLayout()
// HACK: this is not a dropdown box, but the dropdown line count
// sets the results of GetOptimalSize in a normal ListBox
maPrinters.SetDropDownLineCount( 4 );
+
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
- boost::shared_ptr<vcl::RowOrColumn> xLayout =
- boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
// add printer fixed line
- xLayout->addWindow( &maPrinterFL );
+ maLayout.addWindow( &maPrinterFL );
// add print LB
- xLayout->addWindow( &maPrinters, 3 );
+ maLayout.addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
- boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) );
- xLayout->addChild( xDetRow );
+ boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
+ maLayout.addChild( xDetRow );
xDetRow->addWindow( &maDetailsBtn );
- xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) );
+ 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( xLayout.get() ) );
- xLayout->addChild( xIndent );
+ boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) );
+ maLayout.addChild( xIndent );
// remember details controls
mxDetails = xIndent;
// create a column for the details
- boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) );
+ boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) );
xIndent->setChild( xLabelCol );
xLabelCol->addRow( &maStatusLabel, &maStatusTxt );
xLabelCol->addRow( &maLocationLabel, &maLocationTxt );
xLabelCol->addRow( &maCommentLabel, &maCommentTxt );
// add print range and copies columns
- xLayout->addWindow( &maCopies );
- boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) );
- xLayout->addChild( xRangeRow );
-
+ maLayout.addWindow( &maCopies );
+ boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) );
+ maLayout.addChild( xRangeRow );
+
// create print range and add to range row
mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) );
xRangeRow->addChild( mxPrintRange );
@@ -612,7 +683,7 @@ void PrintDialog::JobTabPage::setupLayout()
boost::shared_ptr< vcl::RowOrColumn > xCopyCollateCol( new vcl::RowOrColumn( xRangeRow.get() ) );
xRangeRow->addChild( xCopyCollateCol );
-
+
// add copies row to copy/collate column
boost::shared_ptr< vcl::LabeledElement > xCopiesRow( new vcl::LabeledElement( xCopyCollateCol.get(), 2 ) );
xCopyCollateCol->addChild( xCopiesRow );
@@ -631,14 +702,14 @@ void PrintDialog::JobTabPage::readFromSettings()
{
SettingsConfigItem* pItem = SettingsConfigItem::get();
rtl::OUString aValue;
-
+
aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CollateBox" ) ) );
if( aValue.equalsIgnoreAsciiCaseAscii( "alwaysoff" ) )
{
mnCollateUIMode = 1;
- maCollateBox.Check( sal_False );
- maCollateBox.Enable( sal_False );
+ maCollateBox.Check( FALSE );
+ maCollateBox.Enable( FALSE );
}
else
{
@@ -658,8 +729,12 @@ void PrintDialog::JobTabPage::storeToSettings()
maCopyCountField.GetText() );
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ),
- maCollateBox.IsChecked() ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) :
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
+ rtl::OUString::createFromAscii( maCollateBox.IsChecked() ? "true" : "false" ) );
+}
+
+void PrintDialog::JobTabPage::Resize()
+{
+ maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
}
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
@@ -667,9 +742,15 @@ PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rRe
, 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();
}
@@ -679,17 +760,20 @@ PrintDialog::OutputOptPage::~OutputOptPage()
void PrintDialog::OutputOptPage::setupLayout()
{
- boost::shared_ptr<vcl::RowOrColumn> xLayout =
- boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
- 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() ) );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
+
+ 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() ) );
xIndent->setChild( xCol );
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
xCol->addWindow( &maCollateSingleJobsBox );
+ xCol->addWindow( &maReverseOrderBox );
}
void PrintDialog::OutputOptPage::readFromSettings()
@@ -701,10 +785,15 @@ void PrintDialog::OutputOptPage::storeToSettings()
SettingsConfigItem* pItem = SettingsConfigItem::get();
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToFile" ) ),
- maToFileBox.IsChecked() ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"))
- : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
+ rtl::OUString::createFromAscii( maToFileBox.IsChecked() ? "true" : "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 ) )
@@ -729,30 +818,32 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
, mbShowLayoutPage( sal_True )
{
FreeResource();
-
+
// save printbutton text, gets exchanged occasionally with print to file
maPrintText = maOKButton.GetText();
-
+
// setup preview controls
maForwardBtn.SetStyle( maForwardBtn.GetStyle() | WB_BEVELBUTTON );
maBackwardBtn.SetStyle( maBackwardBtn.GetStyle() | WB_BEVELBUTTON );
-
+
// insert the job (general) tab page first
maTabCtrl.InsertPage( SV_PRINT_TAB_JOB, maJobPage.GetText() );
maTabCtrl.SetTabPage( SV_PRINT_TAB_JOB, &maJobPage );
-
+
// set symbols on forward and backward button
maBackwardBtn.SetSymbol( SYMBOL_PREV );
maForwardBtn.SetSymbol( SYMBOL_NEXT );
- maBackwardBtn.ImplSetSmallSymbol( sal_True );
- maForwardBtn.ImplSetSmallSymbol( sal_True );
-
+ maBackwardBtn.ImplSetSmallSymbol( TRUE );
+ maForwardBtn.ImplSetSmallSymbol( TRUE );
+
maPageStr = maNumPagesText.GetText();
-
+
// init reverse print
- maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() );
-
+ maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() );
+ // get the first page
+ preparePreview( true, true );
+
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
for( std::vector< rtl::OUString >::const_iterator it = rQueues.begin();
@@ -783,18 +874,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();
-
+
// set a select handler
maJobPage.maPrinters.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) );
-
+
// setup sizes for N-Up
Size aNupSize( maPController->getPrinter()->PixelToLogic(
maPController->getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
@@ -810,7 +895,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
}
maNUpPage.initFromMultiPageSetup( maPController->getMultipage() );
-
+
// setup click handler on the various buttons
maOKButton.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
#if OSL_DEBUG_LEVEL > 1
@@ -824,10 +909,10 @@ 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 ) );
- maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
+ maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
-
+
// setup modify hdl
maPageEdit.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
maJobPage.maCopyCountField.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
@@ -836,20 +921,20 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maNUpPage.maPageMarginEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
maNUpPage.maSheetMarginEdt.SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
- // setup select hdl
+ // setup select hdl
maNUpPage.maNupPagesBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) );
maNUpPage.maNupOrientationBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) );
maNUpPage.maNupOrderBox.SetSelectHdl( LINK( this, PrintDialog, SelectHdl ) );
// setup the layout
setupLayout();
-
+
// setup optional UI options set by application
setupOptionalUI();
-
+
// set change handler for UI options
maPController->setOptionChangeHdl( LINK( this, PrintDialog, UIOptionsChanged ) );
-
+
// set min size pixel to current size
Size aOutSize( GetOutputSizePixel() );
SetMinOutputSizePixel( aOutSize );
@@ -875,6 +960,18 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
SetOutputSizePixel( aOutSize );
}
}
+
+ // 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 )
@@ -887,10 +984,10 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// restore settings from last run
readFromSettings();
-
+
// setup dependencies
checkControlDependencies();
-
+
}
PrintDialog::~PrintDialog()
@@ -904,15 +1001,14 @@ PrintDialog::~PrintDialog()
void PrintDialog::setupLayout()
{
- boost::shared_ptr<vcl::RowOrColumn> xLayout =
- boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- xLayout->setOuterBorder( 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 );
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ 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 );
+
// setup column for preview and sub controls
boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) );
xPreviewAndTab->addChild( xPreview, 5 );
@@ -930,18 +1026,18 @@ void PrintDialog::setupLayout()
mxPreviewCtrls->addWindow( &maForwardBtn );
xSpacer.reset( new vcl::Spacer( mxPreviewCtrls.get(), 2 ) );
mxPreviewCtrls->addChild( xSpacer );
-
+
// continue with the tab ctrl
xPreviewAndTab->addWindow( &maTabCtrl );
-
+
// add the button line
- xLayout->addWindow( &maButtonLine );
-
+ maLayout.addWindow( &maButtonLine );
+
// add the row for the buttons
- boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
- nIndex = xLayout->addChild( xButtons );
- xLayout->setBorders( nIndex, -1, 0, -1, -1 );
-
+ 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() );
+
Size aMinSize( maCancelButton.GetSizePixel() );
// insert help button
xButtons->setMinimumSize( xButtons->addWindow( &maHelpButton ), aMinSize );
@@ -957,15 +1053,15 @@ void PrintDialog::readFromSettings()
maJobPage.readFromSettings();
maNUpPage.readFromSettings();
maOptionsPage.readFromSettings();
-
+
// read last selected tab page; if it exists, actiavte it
SettingsConfigItem* pItem = SettingsConfigItem::get();
rtl::OUString aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ) );
- sal_uInt16 nCount = maTabCtrl.GetPageCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ USHORT nCount = maTabCtrl.GetPageCount();
+ for( USHORT i = 0; i < nCount; i++ )
{
- sal_uInt16 nPageId = maTabCtrl.GetPageId( i );
+ USHORT nPageId = maTabCtrl.GetPageId( i );
if( aValue.equals( maTabCtrl.GetPageText( nPageId ) ) )
{
maTabCtrl.SelectTabPage( nPageId );
@@ -973,18 +1069,6 @@ void PrintDialog::readFromSettings()
}
}
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
-
- // persistent window state
- rtl::OUString aWinState( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ) ) );
- if( aWinState.getLength() )
- SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) );
-
- if( maOptionsPage.maToFileBox.IsChecked() )
- {
- maPController->resetPrinterOptions( true );
- preparePreview( true, true );
- }
}
void PrintDialog::storeToSettings()
@@ -992,7 +1076,7 @@ void PrintDialog::storeToSettings()
maJobPage.storeToSettings();
maNUpPage.storeToSettings();
maOptionsPage.storeToSettings();
-
+
// store last selected printer
SettingsConfigItem* pItem = SettingsConfigItem::get();
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
@@ -1002,10 +1086,6 @@ void PrintDialog::storeToSettings()
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ),
maTabCtrl.GetPageText( maTabCtrl.GetCurPageId() ) );
- pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ),
- rtl::OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 )
- );
pItem->Commit();
}
@@ -1021,7 +1101,7 @@ int PrintDialog::getCopyCount()
bool PrintDialog::isCollate()
{
- return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : sal_False;
+ return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : FALSE;
}
bool PrintDialog::isSingleJobs()
@@ -1029,18 +1109,35 @@ bool PrintDialog::isSingleJobs()
return maOptionsPage.maCollateSingleJobsBox.IsChecked();
}
-void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex )
+static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
{
- if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() )
- i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) );
+ 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 ) );
}
-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
- if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
- i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
+
+ // passed help texts for optional UI is used only for native dialogs which currently
+ // cannot access the same (rather implicit) mechanism
}
void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1053,16 +1150,18 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
void PrintDialog::setupOptionalUI()
{
- std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns;
- boost::shared_ptr< vcl::RowOrColumn > pCurColumn;
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+
+ std::vector<vcl::RowOrColumn*> aDynamicColumns;
+ vcl::RowOrColumn* pCurColumn = 0;
Window* pCurParent = 0, *pDynamicPageParent = 0;
- sal_uInt16 nOptPageId = 9;
+ USHORT nOptPageId = 9, nCurSubGroup = 0;
bool bOnStaticPage = false;
bool bSubgroupOnStaticPage = false;
-
- std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap;
-
+
+ std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap;
+
const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() );
for( int i = 0; i < rOptions.getLength(); i++ )
{
@@ -1070,13 +1169,12 @@ void PrintDialog::setupOptionalUI()
rOptions[i].Value >>= aOptProp;
// extract ui element
+ bool bEnabled = true;
rtl::OUString aCtrlType;
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;
@@ -1087,58 +1185,55 @@ void PrintDialog::setupOptionalUI()
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;
}
- 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( "ChoicesDisabled" ) ) )
- {
- rEntry.Value >>= aChoicesDisabled;
- }
- 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( "GroupingHint" ) ) )
+ else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
{
rEntry.Value >>= aGroupingHint;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnName" ) ) )
+ else if( rEntry.Name.equalsAscii( "DependsOnName" ) )
{
rEntry.Value >>= aDependsOnName;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnEntry" ) ) )
+ else if( rEntry.Name.equalsAscii( "DependsOnEntry" ) )
{
rEntry.Value >>= nDependsOnValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AttachToDependency" ) ) )
+ else if( rEntry.Name.equalsAscii( "AttachToDependency" ) )
{
rEntry.Value >>= bUseDependencyRow;
}
- 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( "HelpText" ) ) )
+ else if( rEntry.Name.equalsAscii( "HelpText" ) )
{
if( ! (rEntry.Value >>= aHelpTexts) )
{
@@ -1150,79 +1245,64 @@ 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" ) ) )
+ else if( rEntry.Name.equalsAscii( "HintNoLayoutPage" ) )
{
sal_Bool bNoLayoutPage = sal_False;
rEntry.Value >>= bNoLayoutPage;
mbShowLayoutPage = ! bNoLayoutPage;
}
}
-
+
// bUseDependencyRow should only be true if a dependency exists
bUseDependencyRow = bUseDependencyRow && (aDependsOnName.getLength() != 0);
-
+
// is it necessary to switch between static and dynamic pages ?
bool bSwitchPage = false;
if( aGroupingHint.getLength() )
bSwitchPage = true;
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) || (bOnStaticPage && ! bSubgroupOnStaticPage ) )
+ else if( aCtrlType.equalsAscii( "Subgroup" ) || (bOnStaticPage && ! bSubgroupOnStaticPage ) )
bSwitchPage = true;
if( bSwitchPage )
{
// restore to dynamic
pCurParent = pDynamicPageParent;
- if( ! aDynamicColumns.empty() )
- pCurColumn = aDynamicColumns.back();
- else
- pCurColumn.reset();
+ pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back();
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
- if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
+ if( aGroupingHint.equalsAscii( "PrintRange" ) )
{
- pCurColumn = maJobPage.mxPrintRange;
+ pCurColumn = maJobPage.mxPrintRange.get();
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPage" ) ) )
+ else if( aGroupingHint.equalsAscii( "OptionsPage" ) )
{
- pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
+ pCurColumn = &maOptionsPage.maLayout;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPageOptGroup" ) ) )
+ else if( aGroupingHint.equalsAscii( "OptionsPageOptGroup" ) )
{
- pCurColumn = maOptionsPage.mxOptGroup;
+ pCurColumn = maOptionsPage.mxOptGroup.get();
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) )
+ else if( aGroupingHint.equalsAscii( "LayoutPage" ) )
{
- pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
+ pCurColumn = &maNUpPage.maLayout;
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.getLength() )
{
- pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
+ pCurColumn = &maJobPage.maLayout;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) ) ||
+ if( aCtrlType.equalsAscii( "Group" ) ||
( ! pCurParent && ! (bOnStaticPage || aGroupingHint.getLength() ) ) )
{
// add new tab page
@@ -1232,37 +1312,41 @@ void PrintDialog::setupOptionalUI()
pNewGroup->SetText( aText );
maTabCtrl.InsertPage( ++nOptPageId, aText );
maTabCtrl.SetTabPage( nOptPageId, pNewGroup );
-
+
// set help id
- setHelpId( pNewGroup, aHelpIds, 0 );
+ setSmartId( pNewGroup, "TabPage", nOptPageId );
// set help text
setHelpText( pNewGroup, aHelpTexts, 0 );
+
+ // reset subgroup counter
+ nCurSubGroup = 0;
- aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) );
+ aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) );
pCurColumn = aDynamicColumns.back();
pCurColumn->setParentWindow( pNewGroup );
+ pCurColumn->setOuterBorder( aBorder.Width() );
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && (pCurParent || aGroupingHint.getLength() ) )
+ else if( aCtrlType.equalsAscii( "Subgroup" ) && (pCurParent || aGroupingHint.getLength() ) )
{
bSubgroupOnStaticPage = (aGroupingHint.getLength() != 0);
// create group FixedLine
- if( ! aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) ||
+ if( ! aGroupingHint.equalsAscii( "PrintRange" ) ||
! pCurColumn->countElements() == 0
)
{
Window* pNewSub = NULL;
- if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
+ if( aGroupingHint.equalsAscii( "PrintRange" ) )
pNewSub = new FixedText( pCurParent, WB_VCENTER );
else
pNewSub = new FixedLine( pCurParent );
maControls.push_front( pNewSub );
pNewSub->SetText( aText );
pNewSub->Show();
-
+
// set help id
- setHelpId( pNewSub, aHelpIds, 0 );
+ setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) );
// set help text
setHelpText( pNewSub, aHelpTexts, 0 );
// add group to current column
@@ -1270,16 +1354,16 @@ void PrintDialog::setupOptionalUI()
}
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pCurColumn.reset( new vcl::RowOrColumn( pIndent ) );
+ pCurColumn = new vcl::RowOrColumn( pIndent );
pIndent->setChild( pCurColumn );
}
// EVIL
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) &&
- aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) &&
- aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintProspect" ) )
+ else if( aCtrlType.equalsAscii( "Bool" ) &&
+ aGroupingHint.equalsAscii( "LayoutPage" ) &&
+ aPropertyName.equalsAscii( "PrintProspect" )
)
{
maNUpPage.maBrochureBtn.SetText( aText );
@@ -1293,21 +1377,21 @@ void PrintDialog::setupOptionalUI()
maNUpPage.maBrochureBtn.Check( bVal );
maNUpPage.maBrochureBtn.Enable( maPController->isUIOptionEnabled( aPropertyName ) && pVal != NULL );
maNUpPage.maBrochureBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
-
+
maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn );
maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName;
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) );
- }
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) );
+ }
else
{
- boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn );
-
+ vcl::RowOrColumn* pSaveCurColumn = pCurColumn;
+
if( bUseDependencyRow )
{
// find the correct dependency row (if any)
- std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator,
- std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange;
+ std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator,
+ std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange;
aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName );
if( aDepRange.first != aDepRange.second )
{
@@ -1323,39 +1407,39 @@ void PrintDialog::setupOptionalUI()
}
}
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) && pCurParent )
+ if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
{
// add a check box
CheckBox* pNewBox = new CheckBox( pCurParent );
maControls.push_front( pNewBox );
pNewBox->SetText( aText );
pNewBox->Show();
-
+
sal_Bool bVal = sal_False;
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal )
pVal->Value >>= bVal;
pNewBox->Check( bVal );
pNewBox->SetToggleHdl( LINK( this, PrintDialog, UIOption_CheckHdl ) );
-
+
maPropertyToWindowMap[ aPropertyName ].push_back( pNewBox );
maControlToPropertyMap[pNewBox] = aPropertyName;
-
+
// set help id
- setHelpId( pNewBox, aHelpIds, 0 );
+ setSmartId( pNewBox, "CheckBox", -1, aPropertyName );
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
-
- boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) );
+
+ vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false );
pCurColumn->addChild( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
-
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) );
+
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
+ else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
+ vcl::RowOrColumn* pRadioColumn = pCurColumn;
if( aText.getLength() )
{
// add a FixedText:
@@ -1363,19 +1447,18 @@ void PrintDialog::setupOptionalUI()
maControls.push_front( pHeading );
pHeading->SetText( aText );
pHeading->Show();
-
+
// set help id
- setHelpId( pHeading, aHelpIds, nCurHelpText );
+ setSmartId( pHeading, "FixedText", -1, aPropertyName );
// set help text
- setHelpText( pHeading, aHelpTexts, nCurHelpText );
- nCurHelpText++;
+ setHelpText( pHeading, aHelpTexts, nCurHelpText++ );
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) );
+ pRadioColumn = new vcl::RowOrColumn( pIndent );
pIndent->setChild( pRadioColumn );
}
// iterate options
@@ -1385,43 +1468,40 @@ 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.get(), 1 ) );
+ boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 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, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
-
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) );
+
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
- setHelpId( pBtn, aHelpIds, nCurHelpText );
+ setSmartId( pBtn, "RadioButton", m, aPropertyName );
// set help text
- setHelpText( pBtn, aHelpTexts, nCurHelpText );
- nCurHelpText++;
+ setHelpText( pBtn, aHelpTexts, nCurHelpText++ );
// add the radio button to the column
pLabel->setLabel( pBtn );
}
}
- else if( ( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) )
+ else if( ( aCtrlType.equalsAscii( "List" ) ||
+ aCtrlType.equalsAscii( "Range" ) ||
+ aCtrlType.equalsAscii( "Edit" )
) && pCurParent )
{
// create a row in the current column
- boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) );
+ vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false );
pCurColumn->addChild( pFieldColumn );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
-
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) );
+
vcl::LabeledElement* pLabel = NULL;
if( aText.getLength() )
{
@@ -1430,19 +1510,21 @@ void PrintDialog::setupOptionalUI()
maControls.push_front( pHeading );
pHeading->SetText( aText );
pHeading->Show();
-
-
+
+ // set help id
+ setSmartId( pHeading, "FixedText", -1, aPropertyName );
+
// add to row
- pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
+ pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
-
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) )
+
+ if( aCtrlType.equalsAscii( "List" ) )
{
ListBox* pList = new ListBox( pCurParent, WB_DROPDOWN | WB_BORDER );
maControls.push_front( pList );
-
+
// iterate options
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
@@ -1452,30 +1534,30 @@ void PrintDialog::setupOptionalUI()
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) );
+ pList->SelectEntryPos( static_cast<USHORT>(nSelectVal) );
pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) );
- pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) );
+ pList->SetDropDownLineCount( static_cast<USHORT>(aChoices.getLength()) );
pList->Show();
-
+
// set help id
- setHelpId( pList, aHelpIds, 0 );
+ setSmartId( pList, "ListBox", -1, aPropertyName );
// set help text
setHelpText( pList, aHelpTexts, 0 );
-
+
maPropertyToWindowMap[ aPropertyName ].push_back( pList );
maControlToPropertyMap[pList] = aPropertyName;
-
+
// finish the pair
if( pLabel )
pLabel->setElement( pList );
else
pFieldColumn->addWindow( pList );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
+ else if( aCtrlType.equalsAscii( "Range" ) )
{
NumericField* pField = new NumericField( pCurParent, WB_BORDER | WB_SPIN );
maControls.push_front( pField );
-
+
// set min/max and current value
if( nMinValue != nMaxValue )
{
@@ -1489,26 +1571,26 @@ void PrintDialog::setupOptionalUI()
pField->SetValue( nCurVal );
pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) );
pField->Show();
-
+
// set help id
- setHelpId( pField, aHelpIds, 0 );
+ setSmartId( pField, "NumericField", -1, aPropertyName );
// set help text
setHelpText( pField, aHelpTexts, 0 );
-
+
maPropertyToWindowMap[ aPropertyName ].push_back( pField );
maControlToPropertyMap[pField] = aPropertyName;
-
+
// add to row
if( pLabel )
pLabel->setElement( pField );
else
pFieldColumn->addWindow( pField );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) )
+ else if( aCtrlType.equalsAscii( "Edit" ) )
{
Edit* pField = new Edit( pCurParent, WB_BORDER );
maControls.push_front( pField );
-
+
rtl::OUString aCurVal;
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
@@ -1516,15 +1598,15 @@ void PrintDialog::setupOptionalUI()
pField->SetText( aCurVal );
pField->SetModifyHdl( LINK( this, PrintDialog, UIOption_ModifyHdl ) );
pField->Show();
-
+
// set help id
- setHelpId( pField, aHelpIds, 0 );
+ setSmartId( pField, "Edit", -1, aPropertyName );
// set help text
setHelpText( pField, aHelpTexts, 0 );
-
+
maPropertyToWindowMap[ aPropertyName ].push_back( pField );
maControlToPropertyMap[pField] = aPropertyName;
-
+
// add to row
if( pLabel )
pLabel->setElement( pField );
@@ -1534,13 +1616,13 @@ void PrintDialog::setupOptionalUI()
}
else
{
- OSL_FAIL( "Unsupported UI option" );
+ DBG_ERROR( "Unsupported UI option" );
}
-
+
pCurColumn = pSaveCurColumn;
}
}
-
+
// #i106506# if no brochure button, then the singular Pages radio button
// makes no sense, so replace it by a FixedText label
if( ! maNUpPage.maBrochureBtn.IsVisible() )
@@ -1548,41 +1630,31 @@ void PrintDialog::setupOptionalUI()
if( maNUpPage.mxPagesBtnLabel.get() )
{
maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() );
- maNUpPage.maPagesBoxTitleTxt.Show( sal_True );
+ maNUpPage.maPagesBoxTitleTxt.Show( TRUE );
maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt );
- maNUpPage.maPagesBtn.Show( sal_False );
+ maNUpPage.maPagesBtn.Show( FALSE );
}
}
-
+
// update enable states
checkOptionalControlDependencies();
-
+
// print range empty (currently math only) -> hide print range and spacer line
if( maJobPage.mxPrintRange->countElements() == 0 )
{
maJobPage.mxPrintRange->show( false, 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 );
+ maJobPage.maCopySpacer.Show( FALSE );
}
-
+
#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
- // account, making the right fix less simple. Fix this the right way
+ // acoount, 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.getLayout()->countElements();
+ size_t nIndex = maJobPage.maLayout.countElements();
if( nIndex > 0 ) // sanity check
- maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 );
+ maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
#endif
// create auto mnemomnics now so they can be calculated in layout
@@ -1592,13 +1664,13 @@ void PrintDialog::setupOptionalUI()
ImplWindowAutoMnemonic( this );
// calculate job page
- Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
- updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
// and options page
- updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
- for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin();
+ for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
it != aDynamicColumns.end(); ++it )
{
Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -1626,8 +1698,19 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() );
}
- Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
-
+ // 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 = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
SetOutputSizePixel( aSz );
}
@@ -1644,16 +1727,25 @@ void PrintDialog::checkControlDependencies()
if( maJobPage.maCopyCountField.GetValue() > 1 )
maJobPage.maCollateBox.Enable( maJobPage.mnCollateUIMode == 0 );
else
- maJobPage.maCollateBox.Enable( sal_False );
-
+ maJobPage.maCollateBox.Enable( FALSE );
+
Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg );
-
+ Image aHCImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateHCImg : maJobPage.maNoCollateHCImg );
+ bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
+
Size aImgSize( aImg.GetSizePixel() );
+ Size aHCImgSize( aHCImg.GetSizePixel() );
+
+ if( aHCImgSize.Width() > aImgSize.Width() )
+ aImgSize.Width() = aHCImgSize.Width();
+ if( aHCImgSize.Height() > aImgSize.Height() )
+ aImgSize.Height() = aHCImgSize.Height();
// adjust size of image
maJobPage.maCollateImage.SetSizePixel( aImgSize );
- maJobPage.maCollateImage.SetImage( aImg );
- maJobPage.getLayout()->resize();
+ maJobPage.maCollateImage.SetImage( bHC ? aHCImg : aImg );
+ maJobPage.maCollateImage.SetModeImage( aHCImg, BMP_COLOR_HIGHCONTRAST );
+ maJobPage.maLayout.resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -1668,7 +1760,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();
- getLayout()->resize();
+ maLayout.resize();
}
}
else
@@ -1682,7 +1774,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Hide();
- getLayout()->resize();
+ maLayout.resize();
}
}
}
@@ -1710,17 +1802,7 @@ void PrintDialog::checkOptionalControlDependencies()
bShouldbeEnabled = true;
}
}
-
- 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 )
@@ -1769,7 +1851,7 @@ void PrintDialog::setPreviewText( sal_Int32 )
{
rtl::OUString aNewText( searchAndReplace( maPageStr, "%n", 2, rtl::OUString::valueOf( mnCachedPages ) ) );
maNumPagesText.SetText( aNewText );
-
+
// if layout is already established the refresh layout of
// preview controls since text length may have changes
if( mxPreviewCtrls.get() )
@@ -1781,17 +1863,17 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
// page range may have changed depending on options
sal_Int32 nPages = maPController->getFilteredPageCount();
mnCachedPages = nPages;
-
+
if( mnCurPage >= nPages )
mnCurPage = nPages-1;
if( mnCurPage < 0 )
mnCurPage = 0;
-
+
setPreviewText( mnCurPage );
maPageEdit.SetMin( 1 );
maPageEdit.SetMax( nPages );
-
+
if( i_bNewPage )
{
const MapMode aMapMode( MAP_100TH_MM );
@@ -1807,15 +1889,12 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
aMtf.Move( aOff.X(), aOff.Y() );
}
}
-
+
Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
- maPreviewWindow.setPreview( aMtf, aCurPageSize,
- aPrt->GetPaperName( false ),
- nPages > 0 ? rtl::OUString() : maNoPageStr,
- aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(),
- aPrt->GetPrinterOptions().IsConvertToGreyscales()
+ maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr,
+ aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY()
);
-
+
maForwardBtn.Enable( mnCurPage < nPages-1 );
maBackwardBtn.Enable( mnCurPage != 0 );
maPageEdit.Enable( nPages > 1 );
@@ -1845,7 +1924,7 @@ void PrintDialog::updateNupFromPages()
long nPageMargin = long(maNUpPage.maPageMarginEdt.Denormalize(maNUpPage.maPageMarginEdt.GetValue( FUNIT_100TH_MM )));
long nSheetMargin = long(maNUpPage.maSheetMarginEdt.Denormalize(maNUpPage.maSheetMarginEdt.GetValue( FUNIT_100TH_MM )));
bool bCustom = false;
-
+
if( nPages == 1 )
{
nRows = nCols = 1;
@@ -1881,12 +1960,12 @@ void PrintDialog::updateNupFromPages()
}
else
bCustom = true;
-
+
if( nPages > 1 )
{
// set upper limits for margins based on job page size and rows/columns
Size aSize( getJobPageSize() );
-
+
// maximum sheet distance: 1/2 sheet
long nHorzMax = aSize.Width()/2;
long nVertMax = aSize.Height()/2;
@@ -1894,11 +1973,11 @@ void PrintDialog::updateNupFromPages()
nSheetMargin = nHorzMax;
if( nSheetMargin > nVertMax )
nSheetMargin = nVertMax;
-
- maNUpPage.maSheetMarginEdt.SetMax(
- maNUpPage.maSheetMarginEdt.Normalize(
+
+ maNUpPage.maSheetMarginEdt.SetMax(
+ maNUpPage.maSheetMarginEdt.Normalize(
nHorzMax > nVertMax ? nVertMax : nHorzMax ), FUNIT_100TH_MM );
-
+
// maximum page distance
nHorzMax = (aSize.Width() - 2*nSheetMargin);
if( nCols > 1 )
@@ -1906,12 +1985,12 @@ void PrintDialog::updateNupFromPages()
nVertMax = (aSize.Height() - 2*nSheetMargin);
if( nRows > 1 )
nHorzMax /= (nRows-1);
-
+
if( nPageMargin > nHorzMax )
nPageMargin = nHorzMax;
if( nPageMargin > nVertMax )
nPageMargin = nVertMax;
-
+
maNUpPage.maPageMarginEdt.SetMax(
maNUpPage.maSheetMarginEdt.Normalize(
nHorzMax > nVertMax ? nVertMax : nHorzMax ), FUNIT_100TH_MM );
@@ -1921,12 +2000,12 @@ void PrintDialog::updateNupFromPages()
maNUpPage.maNupColEdt.SetValue( nCols );
maNUpPage.maPageMarginEdt.SetValue( maNUpPage.maPageMarginEdt.Normalize( nPageMargin ), FUNIT_100TH_MM );
maNUpPage.maSheetMarginEdt.SetValue( maNUpPage.maSheetMarginEdt.Normalize( nSheetMargin ), FUNIT_100TH_MM );
-
+
maNUpPage.showAdvancedControls( bCustom );
if( bCustom )
{
// see if we have to enlarge the dialog to make the tab page fit
- Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) );
Size aTabSize( maTabCtrl.GetTabPageSizePixel() );
if( aTabSize.Height() < aCurSize.Height() )
{
@@ -1945,33 +2024,29 @@ void PrintDialog::updateNup()
int nCols = int(maNUpPage.maNupColEdt.GetValue());
long nPageMargin = long(maNUpPage.maPageMarginEdt.Denormalize(maNUpPage.maPageMarginEdt.GetValue( FUNIT_100TH_MM )));
long nSheetMargin = long(maNUpPage.maSheetMarginEdt.Denormalize(maNUpPage.maSheetMarginEdt.GetValue( FUNIT_100TH_MM )));
-
+
PrinterController::MultiPageSetup aMPS;
aMPS.nRows = nRows;
aMPS.nColumns = nCols;
aMPS.nRepeat = 1;
- aMPS.nLeftMargin =
- aMPS.nTopMargin =
- aMPS.nRightMargin =
+ aMPS.nLeftMargin =
+ aMPS.nTopMargin =
+ aMPS.nRightMargin =
aMPS.nBottomMargin = nSheetMargin;
-
+
aMPS.nHorizontalSpacing =
aMPS.nVerticalSpacing = nPageMargin;
aMPS.bDrawBorder = maNUpPage.maBorderCB.IsChecked();
-
- int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData(
+
+ int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData(
maNUpPage.maNupOrderBox.GetSelectEntryPos() )));
- if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
+ if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD )
aMPS.nOrder = PrinterController::LRTB;
- else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR )
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(
+
+ int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData(
maNUpPage.maNupOrientationBox.GetSelectEntryPos() )));
if( nOrientationMode == SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE )
aMPS.aPaperSize = maNupLandscapeSize;
@@ -1982,18 +2057,18 @@ void PrintDialog::updateNup()
// get size of first real page to see if it is portrait or landscape
// we assume same page sizes for all the pages for this
Size aPageSize = getJobPageSize();
-
+
Size aMultiSize( aPageSize.Width() * nCols, aPageSize.Height() * nRows );
if( aMultiSize.Width() > aMultiSize.Height() ) // fits better on landscape
aMPS.aPaperSize = maNupLandscapeSize;
else
- aMPS.aPaperSize = maNupPortraitSize;
+ aMPS.aPaperSize = maNupPortraitSize;
}
-
+
maPController->setMultipage( aMPS );
-
+
maNUpPage.maNupOrderWin.setValues( nOrderMode, nCols, nRows );
-
+
preparePreview( true, true );
}
@@ -2004,10 +2079,8 @@ 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();
- preparePreview( true, false );
}
else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox )
{
@@ -2019,7 +2092,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox )
maNUpPage.maPagesBtn.Check();
updateNupFromPages();
}
-
+
return 0;
}
@@ -2036,7 +2109,8 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
Help* pHelp = Application::GetHelp();
if( pHelp )
{
- pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton );
+ // FIXME: find out proper help URL and use here
+ pHelp->Start( HID_PRINTDLG, GetParent() );
}
}
else if( pButton == &maForwardBtn )
@@ -2050,9 +2124,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
- maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
- getLayout()->resize();
- preparePreview( true, true );
+ maLayout.resize();
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
@@ -2061,9 +2133,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
sal_Bool bVal = maNUpPage.maBrochureBtn.IsChecked();
pVal->Value <<= bVal;
-
+
checkOptionalControlDependencies();
-
+
// update preview and page settings
preparePreview();
}
@@ -2088,7 +2160,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
maDetailsCollapsedSize = GetOutputSizePixel();
// enlarge dialog if necessary
- Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) );
+ Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aCurSize( maJobPage.GetSizePixel() );
if( aCurSize.Height() < aMinSize.Height() )
{
@@ -2117,9 +2189,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
makeAny( sal_Bool(isCollate()) ) );
checkControlDependencies();
}
- else if( pButton == &maJobPage.maReverseOrderBox )
+ else if( pButton == &maOptionsPage.maReverseOrderBox )
{
- sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked();
+ sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked();
maPController->setReversePrint( bChecked );
maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ),
makeAny( bChecked ) );
@@ -2182,7 +2254,7 @@ PropertyValue* PrintDialog::getValueForWindow( Window* i_pWindow ) const
}
else
{
- OSL_FAIL( "changed control not in property map" );
+ DBG_ERROR( "changed control not in property map" );
}
return pVal;
}
@@ -2206,7 +2278,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty )
{
pBox->Check( bVal );
}
- else if( i_rProperty.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintProspect" ) ) )
+ else if( i_rProperty.equalsAscii( "PrintProspect" ) )
{
// EVIL special case
if( bVal )
@@ -2225,7 +2297,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty )
ListBox* pList = dynamic_cast< ListBox* >( rWindows.front() );
if( pList )
{
- pList->SelectEntryPos( static_cast< sal_uInt16 >(nVal) );
+ pList->SelectEntryPos( static_cast< USHORT >(nVal) );
}
else if( nVal >= 0 && nVal < sal_Int32(rWindows.size() ) )
{
@@ -2256,12 +2328,12 @@ IMPL_LINK( PrintDialog, UIOption_CheckHdl, CheckBox*, i_pBox )
if( pVal )
{
makeEnabled( i_pBox );
-
+
sal_Bool bVal = i_pBox->IsChecked();
pVal->Value <<= bVal;
-
+
checkOptionalControlDependencies();
-
+
// update preview and page settings
preparePreview();
}
@@ -2280,12 +2352,12 @@ IMPL_LINK( PrintDialog, UIOption_RadioHdl, RadioButton*, i_pBtn )
if( pVal && it != maControlToNumValMap.end() )
{
makeEnabled( i_pBtn );
-
+
sal_Int32 nVal = it->second;
pVal->Value <<= nVal;
-
+
checkOptionalControlDependencies();
-
+
// update preview and page settings
preparePreview();
}
@@ -2299,12 +2371,12 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, ListBox*, i_pBox )
if( pVal )
{
makeEnabled( i_pBox );
-
+
sal_Int32 nVal( i_pBox->GetSelectEntryPos() );
pVal->Value <<= nVal;
-
+
checkOptionalControlDependencies();
-
+
// update preview and page settings
preparePreview();
}
@@ -2335,9 +2407,9 @@ IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit*, i_pBox )
rtl::OUString aVal( i_pBox->GetText() );
pVal->Value <<= aVal;
}
-
+
checkOptionalControlDependencies();
-
+
// update preview and page settings
preparePreview();
}
@@ -2362,7 +2434,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 );
@@ -2400,9 +2472,9 @@ PrintProgressDialog::PrintProgressDialog( Window* i_pParent, int i_nMax ) :
if( mnMax < 1 )
mnMax = 1;
-
+
maStr = maText.GetText();
-
+
maButton.SetClickHdl( LINK( this, PrintProgressDialog, ClickHdl ) );
}
@@ -2415,7 +2487,7 @@ IMPL_LINK( PrintProgressDialog, ClickHdl, Button*, pButton )
{
if( pButton == &maButton )
mbCanceled = true;
-
+
return 0;
}
@@ -2442,7 +2514,7 @@ void PrintProgressDialog::setProgress( int i_nCurrent, int i_nMax )
{
if( maProgressRect.IsEmpty() )
implCalcProgressRect();
-
+
mnCur = i_nCurrent;
if( i_nMax != -1 )
mnMax = i_nMax;
@@ -2453,7 +2525,7 @@ void PrintProgressDialog::setProgress( int i_nCurrent, int i_nMax )
rtl::OUString aNewText( searchAndReplace( maStr, "%p", 2, rtl::OUString::valueOf( mnCur ) ) );
aNewText = searchAndReplace( aNewText, "%n", 2, rtl::OUString::valueOf( mnMax ) );
maText.SetText( aNewText );
-
+
// update progress
Invalidate( maProgressRect, INVALIDATE_UPDATE );
}
@@ -2466,7 +2538,6 @@ void PrintProgressDialog::tick()
void PrintProgressDialog::reset()
{
- mbCanceled = false;
setProgress( 0 );
}
@@ -2474,7 +2545,7 @@ void PrintProgressDialog::Paint( const Rectangle& )
{
if( maProgressRect.IsEmpty() )
implCalcProgressRect();
-
+
Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Color aPrgsColor = rStyleSettings.GetHighlightColor();
@@ -2491,9 +2562,9 @@ void PrintProgressDialog::Paint( const Rectangle& )
nOffset,
nWidth,
mnProgressHeight,
- static_cast<sal_uInt16>(0),
- static_cast<sal_uInt16>(10000*mnCur/mnMax),
- static_cast<sal_uInt16>(10000/nMaxCount),
+ static_cast<USHORT>(0),
+ static_cast<USHORT>(10000*mnCur/mnMax),
+ static_cast<USHORT>(10000/nMaxCount),
maProgressRect
);
Pop();
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 588f4d4fa1fa..3ebdfc936a7f 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -69,12 +69,12 @@ ImplWheelWindow::ImplWheelWindow( Window* pParent ) :
DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
const Size aSize( pParent->GetOutputSizePixel() );
- const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
// calculate maximum speed distance
- mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
+ mnMaxWidth = (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(sal_False);
+ Show(FALSE);
}
// ------------------------------------------------------------------------
@@ -148,7 +148,7 @@ void ImplWheelWindow::ImplCreateImageList()
// ------------------------------------------------------------------------
-void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode )
+void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode )
{
if( nWheelMode != mnWheelMode )
{
@@ -173,7 +173,7 @@ void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode )
void ImplWheelWindow::ImplDrawWheel()
{
- sal_uInt16 nId;
+ USHORT nId;
switch( mnWheelMode )
{
@@ -201,13 +201,13 @@ void ImplWheelWindow::ImplRecalcScrollValues()
}
else
{
- sal_uLong nCurTime;
+ ULONG nCurTime;
// calc current time
if( mnMaxWidth )
{
const double fExp = ( (double) mnActDist / mnMaxWidth ) * log10( (double) MAX_TIME / MIN_TIME );
- nCurTime = (sal_uLong) ( MAX_TIME / pow( 10., fExp ) );
+ nCurTime = (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 sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const 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 = (sal_uLong) hypot( (double) nDistX, nDistY );
+ mnActDist = (ULONG) hypot( (double) nDistX, nDistY );
const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY );
- 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;
+ 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;
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, sal_True, &aScrollData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, TRUE, &aScrollData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
{
- const sal_uLong nTime = Time::GetSystemTicks();
+ const ULONG nTime = Time::GetSystemTicks();
ImplDelData aDel( this );
pWindow->Command( aCEvt );
if( aDel.IsDead() )
return 0;
- mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 );
+ mnRepaintTime = Max( Time::GetSystemTicks() - nTime, 1UL );
ImplRecalcScrollValues();
}
}
diff --git a/vcl/source/window/scrwnd.hxx b/vcl/source/window/scrwnd.hxx
index ccc38c778c99..d366c2a66c06 100644
--- a/vcl/source/window/scrwnd.hxx
+++ b/vcl/source/window/scrwnd.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,13 +34,13 @@
// - Defines -
// -----------
-#define WHEELMODE_NONE 0x00000000UL
-#define WHEELMODE_VH 0x00000001UL
-#define WHEELMODE_V 0x00000002UL
-#define WHEELMODE_H 0x00000004UL
-#define WHEELMODE_SCROLL_VH 0x00000008UL
-#define WHEELMODE_SCROLL_V 0x00000010UL
-#define WHEELMODE_SCROLL_H 0x00000020UL
+#define WHEELMODE_NONE 0x00000000UL
+#define WHEELMODE_VH 0x00000001UL
+#define WHEELMODE_V 0x00000002UL
+#define WHEELMODE_H 0x00000004UL
+#define WHEELMODE_SCROLL_VH 0x00000008UL
+#define WHEELMODE_SCROLL_V 0x00000010UL
+#define WHEELMODE_SCROLL_H 0x00000020UL
// -------------------
// - ImplWheelWindow -
@@ -52,44 +52,44 @@ class ImplWheelWindow : public FloatingWindow
{
private:
- ImageList maImgList;
- Bitmap maWheelBmp;
- CommandScrollData maCommandScrollData;
- Point maLastMousePos;
- Point maCenter;
- Timer* mpTimer;
- sal_uLong mnRepaintTime;
- sal_uLong mnTimeout;
- sal_uLong mnWheelMode;
- sal_uLong mnMaxWidth;
- sal_uLong mnActWidth;
- sal_uLong mnActDist;
- long mnActDeltaX;
- long mnActDeltaY;
-
- void ImplCreateImageList();
- void ImplSetRegion( const Bitmap& rRegionBmp );
+ ImageList maImgList;
+ Bitmap maWheelBmp;
+ CommandScrollData maCommandScrollData;
+ Point maLastMousePos;
+ Point maCenter;
+ Timer* mpTimer;
+ ULONG mnRepaintTime;
+ ULONG mnTimeout;
+ ULONG mnWheelMode;
+ ULONG mnMaxWidth;
+ ULONG mnActWidth;
+ ULONG mnActDist;
+ long mnActDeltaX;
+ long mnActDeltaY;
+
+ void ImplCreateImageList();
+ void ImplSetRegion( const Bitmap& rRegionBmp );
using Window::ImplGetMousePointer;
- PointerStyle ImplGetMousePointer( long nDistX, long nDistY );
- void ImplDrawWheel();
- void ImplRecalcScrollValues();
-
+ PointerStyle ImplGetMousePointer( long nDistX, long nDistY );
+ void ImplDrawWheel();
+ void ImplRecalcScrollValues();
+
DECL_LINK( ImplScrollHdl, Timer* pTimer );
-
-protected:
-
- virtual void Paint( const Rectangle& rRect );
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
-
-public:
-
+
+protected:
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+public:
+
ImplWheelWindow( Window* pParent );
~ImplWheelWindow();
void ImplStop();
- void ImplSetWheelMode( sal_uLong nWheelMode );
- sal_uLong ImplGetWheelMode() const { return mnWheelMode; }
+ void ImplSetWheelMode( ULONG nWheelMode );
+ 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 b8b6735d81ca..46f6fafeabd9 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,9 +37,9 @@
-inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const
+inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
{
-// return !( eSelMode == MULTIPLE_SELECTION && bModifierKey1 );
+// return !( eSelMode == MULTIPLE_SELECTION && bModifierKey1 );
return eSelMode != MULTIPLE_SELECTION || !bModifierKey1;
}
@@ -50,12 +50,14 @@ inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const
|*
|* SelectionEngine::SelectionEngine()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
-SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
- sal_uLong nAutoRepeatInterval ) :
- pWin( pWindow ),
- nUpdateInterval( nAutoRepeatInterval )
+SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
+ pWin( pWindow )
{
eSelMode = SINGLE_SELECTION;
pFunctionSet = pFuncSet;
@@ -63,13 +65,17 @@ SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
nLockedMods = 0;
aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) );
- aWTimer.SetTimeout( nUpdateInterval );
+ aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
}
/*************************************************************************
|*
|* SelectionEngine::~SelectionEngine()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
SelectionEngine::~SelectionEngine()
@@ -81,6 +87,10 @@ SelectionEngine::~SelectionEngine()
|*
|* SelectionEngine::ImpWatchDog()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
IMPL_LINK( SelectionEngine, ImpWatchDog, Timer*, EMPTYARG )
@@ -94,6 +104,10 @@ IMPL_LINK( SelectionEngine, ImpWatchDog, Timer*, EMPTYARG )
|*
|* SelectionEngine::SetSelectionMode()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
void SelectionEngine::SetSelectionMode( SelectionMode eMode )
@@ -105,6 +119,10 @@ void SelectionEngine::SetSelectionMode( SelectionMode eMode )
|*
|* SelectionEngine::ActivateDragMode()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
void SelectionEngine::ActivateDragMode()
@@ -116,9 +134,13 @@ void SelectionEngine::ActivateDragMode()
|*
|* SelectionEngine::CursorPosChanging()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung GT 2002-04-04
+|*
*************************************************************************/
-void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
+void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 )
{
if ( !pFunctionSet )
return;
@@ -170,21 +192,25 @@ void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
|*
|* SelectionEngine::SelMouseButtonDown()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 07.06.95
+|*
*************************************************************************/
-sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
+BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_CMDEVT);
if ( !pFunctionSet || !pWin )
- return sal_False;
- const bool bRightClickCursorPositioning =
+ return FALSE;
+ const bool bRightClickCursorPositioning =
rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection();
if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning )
- return sal_False;
+ return FALSE;
- sal_uInt16 nModifier = rMEvt.GetModifier() | nLockedMods;
+ USHORT nModifier = rMEvt.GetModifier() | nLockedMods;
if ( nModifier & KEY_MOD2 )
- return sal_False;
+ return 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 +233,14 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
case 0: // KEY_NO_KEY
{
- sal_Bool bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos );
+ 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 sal_True; //auf STARTDRAG-Command-Event warten
+ return TRUE; //auf STARTDRAG-Command-Event warten
}
if ( eSelMode != SINGLE_SELECTION )
{
@@ -222,14 +248,14 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
pFunctionSet->DeselectAll();
else
pFunctionSet->DestroyAnchor();
- nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = sal_False;
+ nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = 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 sal_True;
+ return TRUE;
}
case KEY_SHIFT:
@@ -237,7 +263,7 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return sal_False;
+ return FALSE;
}
if ( nFlags & SELENG_ADD_ALW )
nFlags |= SELENG_IN_ADD;
@@ -252,7 +278,7 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return sal_True;
+ return TRUE;
case KEY_MOD1:
// Control nur bei Mehrfachselektion erlaubt
@@ -260,7 +286,7 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_IN_SEL);
pWin->ReleaseMouse();
- return sal_True; // Mausclick verschlucken
+ return TRUE; // Mausclick verschlucken
}
if ( nFlags & SELENG_HAS_ANCH )
{
@@ -271,48 +297,52 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
if ( pFunctionSet->IsSelectionAtPoint( aPos ) )
{
pFunctionSet->DeselectAtPoint( aPos );
- pFunctionSet->SetCursorAtPoint( aPos, sal_True );
+ pFunctionSet->SetCursorAtPoint( aPos, TRUE );
}
else
{
pFunctionSet->SetCursorAtPoint( aPos );
}
- return sal_True;
+ return TRUE;
case KEY_SHIFT + KEY_MOD1:
if ( eSelMode != MULTIPLE_SELECTION )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return sal_False;
+ return FALSE;
}
- nFlags |= SELENG_IN_ADD; //bIsInAddMode = sal_True;
+ nFlags |= SELENG_IN_ADD; //bIsInAddMode = TRUE;
if ( !(nFlags & SELENG_HAS_ANCH) )
{
pFunctionSet->CreateAnchor();
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
/*************************************************************************
|*
|* SelectionEngine::SelMouseButtonUp()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
-sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
+BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
aWTimer.Stop();
//DbgOut("Up");
if( !pFunctionSet || !pWin )
{
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return sal_False;
+ return FALSE;
}
if( !rMEvt.IsRight() )
@@ -325,7 +355,7 @@ sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
// MouseButtonDown in Sel aber kein CommandEvent eingetrudelt
// ==> deselektieren
- sal_uInt16 nModifier = aLastMove.GetModifier() | nLockedMods;
+ USHORT nModifier = aLastMove.GetModifier() | nLockedMods;
if( nModifier == KEY_MOD1 || IsAlwaysAdding() )
{
if( !(nModifier & KEY_SHIFT) )
@@ -335,7 +365,7 @@ sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
nFlags &= (~SELENG_HAS_ANCH); // nix Anker
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), sal_True );
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), TRUE );
}
else
{
@@ -346,32 +376,36 @@ sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return sal_True;
+ return TRUE;
}
/*************************************************************************
|*
|* SelectionEngine::SelMouseMove()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
-sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
+BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
{
if ( !pFunctionSet || !(nFlags & SELENG_IN_SEL) ||
(nFlags & (SELENG_CMDEVT | SELENG_WAIT_UPEVT)) )
- return sal_False;
+ return FALSE;
if( !(nFlags & SELENG_EXPANDONMOVE) )
- return sal_False; // auf DragEvent warten!
+ return 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 sal_True;
+ return TRUE;
+
- aWTimer.SetTimeout( nUpdateInterval );
aWTimer.Start();
if ( eSelMode != SINGLE_SELECTION )
{
@@ -386,13 +420,17 @@ sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
//DbgOut("Move:SetCursor");
pFunctionSet->SetCursorAtPoint( rMEvt.GetPosPixel() );
- return sal_True;
+ return TRUE;
}
/*************************************************************************
|*
|* SelectionEngine::SetWindow()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 10.10.94
+|* Letzte Aenderung OV 10.10.94
+|*
*************************************************************************/
void SelectionEngine::SetWindow( Window* pNewWin )
@@ -411,6 +449,10 @@ void SelectionEngine::SetWindow( Window* pNewWin )
|*
|* SelectionEngine::Reset()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 07.07.95
+|* Letzte Aenderung OV 07.07.95
+|*
*************************************************************************/
void SelectionEngine::Reset()
@@ -426,6 +468,10 @@ void SelectionEngine::Reset()
|*
|* SelectionEngine::Command()
|*
+|* Beschreibung SELENG.SDW
+|* Ersterstellung OV 07.07.95
+|* Letzte Aenderung OV 07.07.95
+|*
*************************************************************************/
void SelectionEngine::Command( const CommandEvent& rCEvt )
@@ -456,28 +502,4 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
}
}
-void SelectionEngine::SetUpdateInterval( sal_uLong nInterval )
-{
- if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
- // Set a lower threshold. On Windows, setting this value too low
- // would cause selection to get updated indefinitely.
- nInterval = SELENG_AUTOREPEAT_INTERVAL_MIN;
-
- if (nUpdateInterval == nInterval)
- // no update needed.
- return;
-
- if (aWTimer.IsActive())
- {
- // reset the timer right away on interval change.
- aWTimer.Stop();
- aWTimer.SetTimeout(nInterval);
- aWTimer.Start();
- }
- else
- aWTimer.SetTimeout(nInterval);
-
- nUpdateInterval = nInterval;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index 1d4c8bfae815..4c1b2457083d 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,8 +41,8 @@
#include <rtl/instance.hxx>
#include <vcl/window.h>
-namespace
-{
+namespace
+{
struct ImplBlackWall
: public rtl::StaticWithInit<Wallpaper, ImplBlackWall> {
Wallpaper operator () () {
@@ -54,20 +54,20 @@ namespace
Wallpaper operator () () {
return Wallpaper(COL_LIGHTGRAY);
}
- };
+ };
}
// =======================================================================
void Splitter::ImplInitSplitterData()
{
- ImplGetWindowImpl()->mbSplitter = sal_True;
- mpRefWin = NULL;
- mnSplitPos = 0;
- mnLastSplitPos = 0;
+ ImplGetWindowImpl()->mbSplitter = TRUE;
+ mpRefWin = NULL;
+ mnSplitPos = 0;
+ mnLastSplitPos = 0;
mnStartSplitPos = 0;
- mbDragFull = sal_False;
- mbKbdSplitting = sal_False;
+ mbDragFull = FALSE;
+ mbKbdSplitting = 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 = sal_True;
+ mbHorzSplit = TRUE;
SetSizePixel( Size( nB, nA ) );
}
else
{
ePointerStyle = POINTER_VSPLIT;
- mbHorzSplit = sal_False;
+ mbHorzSplit = FALSE;
SetSizePixel( Size( nA, nB ) );
}
@@ -103,11 +103,11 @@ void Splitter::ImplInit( Window* pParent, WinBits nWinStyle )
if( GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
SetBackground( ImplWhiteWall::get() );
- else
+ else
SetBackground( ImplBlackWall::get() );
TaskPaneList *pTList = GetSystemWindow()->GetTaskPaneList();
- pTList->AddWindow( this );
+ pTList->AddWindow( this );
}
// -----------------------------------------------------------------------
@@ -138,13 +138,13 @@ void Splitter::ImplDrawSplitter()
if ( mbHorzSplit )
{
- aInvRect.Left() = maDragPos.X() - 1;
- aInvRect.Right() = maDragPos.X() + 1;
+ aInvRect.Left() = maDragPos.X() - 1;
+ aInvRect.Right() = maDragPos.X() + 1;
}
else
{
- aInvRect.Top() = maDragPos.Y() - 1;
- aInvRect.Bottom() = maDragPos.Y() + 1;
+ aInvRect.Top() = maDragPos.Y() - 1;
+ aInvRect.Bottom() = maDragPos.Y() + 1;
}
mpRefWin->InvertTracking( mpRefWin->PixelToLogic(aInvRect), SHOWTRACK_SPLIT );
@@ -179,7 +179,7 @@ Splitter::Splitter( Window* pParent, const ResId& rResId ) :
Splitter::~Splitter()
{
TaskPaneList *pTList = GetSystemWindow()->GetTaskPaneList();
- pTList->RemoveWindow( this );
+ pTList->RemoveWindow( this );
}
// -----------------------------------------------------------------------
@@ -195,7 +195,7 @@ long Splitter::GetKeyboardStepSize() const
{
return mnKeyboardStepSize;
}
-
+
// -----------------------------------------------------------------------
Splitter* Splitter::ImplFindSibling()
@@ -217,12 +217,12 @@ Splitter* Splitter::ImplFindSibling()
}
// -----------------------------------------------------------------------
-
-sal_Bool Splitter::ImplSplitterActive()
+
+BOOL Splitter::ImplSplitterActive()
{
// is splitter in document or at scrollbar handle ?
- sal_Bool bActive = sal_True;
+ BOOL bActive = TRUE;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
long nA = rSettings.GetScrollBarSize();
long nB = rSettings.GetSplitSize();
@@ -231,12 +231,12 @@ sal_Bool Splitter::ImplSplitterActive()
if ( mbHorzSplit )
{
if( aSize.Width() == nB && aSize.Height() == nA )
- bActive = sal_False;
+ bActive = FALSE;
}
else
{
if( aSize.Width() == nA && aSize.Height() == nB )
- bActive = sal_False;
+ bActive = FALSE;
}
return bActive;
}
@@ -352,13 +352,13 @@ void Splitter::Tracking( const TrackingEvent& rTEvt )
void Splitter::ImplKbdTracking( KeyCode aKeyCode )
{
- sal_uInt16 nCode = aKeyCode.GetCode();
+ USHORT nCode = aKeyCode.GetCode();
if ( nCode == KEY_ESCAPE || nCode == KEY_RETURN )
{
if( !mbKbdSplitting )
return;
else
- mbKbdSplitting = sal_False;
+ mbKbdSplitting = FALSE;
if ( nCode != KEY_ESCAPE )
{
@@ -401,7 +401,7 @@ void Splitter::ImplKbdTracking( KeyCode aKeyCode )
int maxiter = 500; // avoid endless loop
int delta=0;
int delta_step = mbHorzSplit ? aSize.Width()/10 : aSize.Height()/10;
-
+
// use the specified step size if it was set
if( mnKeyboardStepSize != SPLITTER_DEFAULTSTEPSIZE )
delta_step = mnKeyboardStepSize;
@@ -417,16 +417,16 @@ void Splitter::ImplKbdTracking( KeyCode aKeyCode )
switch( nCode )
{
- case KEY_LEFT:
+ case KEY_LEFT:
aNewPos.X()-=delta;
break;
- case KEY_RIGHT:
+ case KEY_RIGHT:
aNewPos.X()+=delta;
break;
- case KEY_UP:
+ case KEY_UP:
aNewPos.Y()-=delta;
break;
- case KEY_DOWN:
+ case KEY_DOWN:
aNewPos.Y()+=delta;
break;
default:
@@ -447,7 +447,7 @@ void Splitter::ImplKbdTracking( KeyCode aKeyCode )
if ( aNewPos.Y() == maDragPos.Y() )
continue;
}
-
+
maDragPos = aNewPos;
long nNewPos;
if ( mbHorzSplit )
@@ -553,11 +553,11 @@ void Splitter::ImplStartKbdSplitting()
if( mbKbdSplitting )
return;
- mbKbdSplitting = sal_True;
+ mbKbdSplitting = TRUE;
StartSplit();
- // determine start position
+ // determine start position
// because we have no mouse position we take either the position
// of the splitter window or the last split position
// the other coordinate is just the center of the reference window
@@ -625,7 +625,7 @@ void Splitter::LoseFocus()
{
KeyCode aReturnKey( KEY_RETURN );
ImplKbdTracking( aReturnKey );
- mbKbdSplitting = sal_False;
+ mbKbdSplitting = FALSE;
}
Invalidate();
}
@@ -641,7 +641,7 @@ void Splitter::KeyInput( const KeyEvent& rKEvt )
Splitter *pSibling = ImplFindSibling();
KeyCode aKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nCode = aKeyCode.GetCode();
+ USHORT nCode = aKeyCode.GetCode();
switch ( nCode )
{
case KEY_UP:
@@ -728,7 +728,7 @@ void Splitter::KeyInput( const KeyEvent& rKEvt )
GrabFocusToDocument();
break;
}
- mbInKeyEvent = 0;
+ mbInKeyEvent = 0;
}
// -----------------------------------------------------------------------
@@ -751,7 +751,7 @@ void Splitter::DataChanged( const DataChangedEvent& rDCEvt )
{
if( newFaceColor.IsDark() )
SetBackground( ImplWhiteWall::get() );
- else
+ else
SetBackground( ImplBlackWall::get() );
}
}
@@ -762,7 +762,7 @@ void Splitter::DataChanged( const DataChangedEvent& rDCEvt )
void Splitter::Paint( const Rectangle& rPaintRect )
{
if( HasFocus() || mbKbdSplitting )
- {
+ {
Color oldFillCol = GetFillColor();
Color oldLineCol = GetLineColor();
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index d0bf60b6412c..75c81639bc8e 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,6 +30,7 @@
#include "precompiled_vcl.hxx"
#include <string.h>
+#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/rcid.h>
#include <vcl/event.hxx>
@@ -44,123 +45,101 @@
#include <vcl/splitwin.hxx>
+
// =======================================================================
-// Attention: Must not contain non-PODs because array is enlarged/copied
-// with the use of memmove/memcpy.
+// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird
struct ImplSplitItem
{
- long mnSize;
- long mnPixSize;
- long mnLeft;
- long mnTop;
- long mnWidth;
- long mnHeight;
- long mnSplitPos;
- long mnSplitSize;
- long mnOldSplitPos;
- long mnOldSplitSize;
- long mnOldWidth;
- long mnOldHeight;
- ImplSplitSet* mpSet;
- Window* mpWindow;
- Window* mpOrgParent;
- sal_uInt16 mnId;
+ long mnSize;
+ long mnPixSize;
+ long mnLeft;
+ long mnTop;
+ long mnWidth;
+ long mnHeight;
+ long mnSplitPos;
+ long mnSplitSize;
+ long mnOldSplitPos;
+ long mnOldSplitSize;
+ long mnOldWidth;
+ long mnOldHeight;
+ ImplSplitSet* mpSet;
+ Window* mpWindow;
+ Window* mpOrgParent;
+ USHORT mnId;
SplitWindowItemBits mnBits;
- 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;
+ BOOL mbFixed;
+ BOOL mbSubSize;
};
struct ImplSplitSet
{
- ImplSplitItem* mpItems;
- Wallpaper* mpWallpaper;
- Bitmap* mpBitmap;
- long mnLastSize;
- long mnSplitSize;
- sal_uInt16 mnItems;
- sal_uInt16 mnId;
- sal_Bool mbCalcPix;
+ ImplSplitItem* mpItems;
+ Wallpaper* mpWallpaper;
+ Bitmap* mpBitmap;
+ long mnLastSize;
+ long mnSplitSize;
+ USHORT mnItems;
+ USHORT mnId;
+ BOOL mbCalcPix;
};
+#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)
-/** 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 ((sal_uInt16)0x0001)
-#define SPLIT_VERT ((sal_uInt16)0x0002)
-#define SPLIT_WINDOW ((sal_uInt16)0x0004)
-#define SPLIT_NOSPLIT ((sal_uInt16)0x8000)
+DECLARE_LIST( ImplSplitList, SplitWindow* )
// =======================================================================
-static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign,
+static void ImplCalcBorder( WindowAlign eAlign, BOOL bNoAlign,
long& rLeft, long& rTop,
long& rRight, long& rBottom )
{
if ( bNoAlign )
{
- rLeft = 2;
- rTop = 2;
- rRight = 2;
+ rLeft = 2;
+ rTop = 2;
+ rRight = 2;
rBottom = 2;
}
else
{
if ( eAlign == WINDOWALIGN_TOP )
{
- rLeft = 2;
- rTop = 2;
- rRight = 2;
+ rLeft = 2;
+ rTop = 2;
+ rRight = 2;
rBottom = 0;
}
else if ( eAlign == WINDOWALIGN_LEFT )
{
- rLeft = 2;
- rTop = 2;
- rRight = 0;
+ rLeft = 2;
+ rTop = 2;
+ rRight = 0;
rBottom = 2;
}
else if ( eAlign == WINDOWALIGN_BOTTOM )
{
- rLeft = 2;
- rTop = 0;
- rRight = 2;
+ rLeft = 2;
+ rTop = 0;
+ rRight = 2;
rBottom = 2;
}
else
{
- rLeft = 0;
- rTop = 2;
- rRight = 2;
+ rLeft = 0;
+ rTop = 2;
+ rRight = 2;
rBottom = 2;
}
}
@@ -170,19 +149,54 @@ static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign,
void SplitWindow::ImplDrawBorder( SplitWindow* pWin )
{
- const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
- long nDX = pWin->mnDX;
- long nDY = pWin->mnDY;
+ const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
+ long nDX = pWin->mnDX;
+ long nDY = pWin->mnDY;
if ( pWin->mbNoAlign )
{
- DecorationView aDecoView( pWin );
- Point aTmpPoint;
- Rectangle aRect( aTmpPoint, Size( nDX, nDY ) );
+ DecorationView aDecoView( pWin );
+ Point aTmpPoint;
+ Rectangle aRect( aTmpPoint, Size( nDX, nDY ) );
aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
}
else
- {
+ {/*
+ if ( pWin->meAlign == WINDOWALIGN_BOTTOM )
+ {
+ pWin->SetLineColor( rStyleSettings.GetShadowColor() );
+ pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
+ pWin->SetLineColor( rStyleSettings.GetLightColor() );
+ pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
+ }
+ else
+ {
+ pWin->SetLineColor( rStyleSettings.GetShadowColor() );
+ pWin->DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
+ pWin->SetLineColor( rStyleSettings.GetLightColor() );
+ pWin->DrawLine( Point( 0, 1 ), Point( nDX-1, 1 ) );
+ if ( (pWin->meAlign == WINDOWALIGN_LEFT) || (pWin->meAlign == WINDOWALIGN_RIGHT) )
+ {
+ if ( pWin->meAlign == WINDOWALIGN_LEFT )
+ {
+ pWin->SetLineColor( rStyleSettings.GetShadowColor() );
+ pWin->DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
+ pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
+ pWin->SetLineColor( rStyleSettings.GetLightColor() );
+ pWin->DrawLine( Point( 1, 1 ), Point( 1, nDY-3 ) );
+ pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
+ }
+ else
+ {
+ pWin->SetLineColor( rStyleSettings.GetShadowColor() );
+ pWin->DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-3 ) );
+ pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-2, nDY-2 ) );
+ pWin->SetLineColor( rStyleSettings.GetLightColor() );
+ pWin->DrawLine( Point( nDX-1, 0 ), Point( nDX-1, nDY-1 ) );
+ pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
+ }
+ }
+ }*/
if ( pWin->meAlign == WINDOWALIGN_BOTTOM )
{
pWin->SetLineColor( rStyleSettings.GetShadowColor() );
@@ -240,9 +254,9 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin )
{
if ( pWin->mbFadeOut || pWin->mbAutoHide )
{
- const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
- long nDX = pWin->mnDX;
- long nDY = pWin->mnDY;
+ const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
+ long nDX = pWin->mnDX;
+ long nDY = pWin->mnDY;
if ( pWin->meAlign == WINDOWALIGN_LEFT )
{
@@ -277,14 +291,14 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId )
+static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId )
{
if ( pSet->mnId == nId )
return pSet;
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
{
@@ -307,11 +321,11 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt16& rPos )
+static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
{
@@ -337,11 +351,11 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt1
// -----------------------------------------------------------------------
-static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
+static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
{
@@ -351,7 +365,7 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
if ( pItems[i].mpSet )
{
- sal_uInt16 nId = ImplFindItem( pItems[i].mpSet, pWindow );
+ USHORT nId = ImplFindItem( pItems[i].mpSet, pWindow );
if ( nId )
return nId;
}
@@ -363,21 +377,21 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
// -----------------------------------------------------------------------
-static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
- sal_Bool bRows, sal_Bool bDown = sal_True )
+static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
+ BOOL bRows, BOOL bDown = TRUE )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
{
if ( pItems[i].mnWidth && pItems[i].mnHeight )
{
// Wegen ICC auftrennen
- Point aPoint( pItems[i].mnLeft, pItems[i].mnTop );
- Size aSize( pItems[i].mnWidth, pItems[i].mnHeight );
- Rectangle aRect( aPoint, aSize );
+ Point aPoint( pItems[i].mnLeft, pItems[i].mnTop );
+ Size aSize( pItems[i].mnWidth, pItems[i].mnHeight );
+ Rectangle aRect( aPoint, aSize );
if ( bRows )
{
if ( bDown )
@@ -413,9 +427,9 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
static void ImplDeleteSet( ImplSplitSet* pSet )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
{
@@ -438,7 +452,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet )
static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
{
pSet->mnSplitSize = nNewSize;
- for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
+ for ( USHORT i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mpSet )
ImplSetSplitSize( pSet->mpItems[i].mpSet, nNewSize );
@@ -450,32 +464,32 @@ static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
static void ImplCalcSet( ImplSplitSet* pSet,
long nSetLeft, long nSetTop,
long nSetWidth, long nSetHeight,
- sal_Bool bRows, sal_Bool bDown = sal_True )
+ BOOL bRows, BOOL bDown = TRUE )
{
if ( !pSet->mpItems )
return;
- 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;
- long nSizeWinSize;
- long nNewSizeWinSize;
- long nTemp;
- long nTempErr;
- long nErrorSum;
- long nCurSizeDelta;
- long nPos;
- long nMaxPos;
- long* pSize;
- ImplSplitItem* pItems = pSet->mpItems;
- sal_Bool bEmpty;
+ USHORT i;
+ USHORT j;
+ USHORT nMins;
+ USHORT nCalcItems;
+ USHORT nItems = pSet->mnItems;
+ USHORT nVisItems;
+ USHORT nAbsItems;
+ long nCalcSize;
+ long nSizeDelta;
+ long nCurSize;
+ long nSizeWinSize;
+ long nNewSizeWinSize;
+ long nTemp;
+ long nTempErr;
+ long nErrorSum;
+ long nCurSizeDelta;
+ long nPos;
+ long nMaxPos;
+ long* pSize;
+ ImplSplitItem* pItems = pSet->mpItems;
+ BOOL bEmpty;
// Anzahl sichtbarer Items ermitteln
nVisItems = 0;
@@ -495,10 +509,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( pSet->mbCalcPix || (pSet->mnLastSize != nCalcSize) )
{
long nPercentFactor = 10;
- long nRelCount = 0;
- long nPercent = 0;
- long nRelPercent = 0;
- long nAbsSize = 0;
+ long nRelCount = 0;
+ long nPercent = 0;
+ long nRelPercent = 0;
+ long nAbsSize = 0;
for ( i = 0; i < nItems; i++ )
{
if ( !(pItems[i].mnBits & SWIB_INVISIBLE) )
@@ -555,15 +569,15 @@ static void ImplCalcSet( ImplSplitSet* pSet,
nCurSize += pItems[i].mnPixSize;
}
- pSet->mbCalcPix = sal_False;
+ pSet->mbCalcPix = FALSE;
pSet->mnLastSize = nCalcSize;
// Fenster einpassen
- nSizeDelta = nCalcSize-nCurSize;
+ nSizeDelta = nCalcSize-nCurSize;
if ( nSizeDelta )
{
- nAbsItems = 0;
- nSizeWinSize = 0;
+ nAbsItems = 0;
+ nSizeWinSize = 0;
nNewSizeWinSize = 0;
// Zuerst die absoluten Items relativ resizen
@@ -579,7 +593,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
}
// Rundungsfehler werden hier nicht ausgelichen
- if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize )
+ if ( (nAbsItems < (USHORT)(Abs( nSizeDelta ))) && nSizeWinSize )
{
for ( i = 0; i < nItems; i++ )
{
@@ -596,8 +610,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
// Jetzt die Rundunsfehler ausgleichen
- j = 0;
- nMins = 0;
+ j = 0;
+ nMins = 0;
while ( nSizeDelta && (nItems != nMins) )
{
// Feststellen, welche Items berechnet werden duerfen
@@ -606,10 +620,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbSubSize = sal_False;
+ pItems[i].mbSubSize = FALSE;
if ( j >= 2 )
- pItems[i].mbSubSize = sal_True;
+ pItems[i].mbSubSize = TRUE;
else
{
if ( !(pItems[i].mnBits & SWIB_INVISIBLE) )
@@ -617,11 +631,11 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( (nSizeDelta > 0) || pItems[i].mnPixSize )
{
if ( j >= 1 )
- pItems[i].mbSubSize = sal_True;
+ pItems[i].mbSubSize = TRUE;
else
{
if ( (j == 0) && (pItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE)) )
- pItems[i].mbSubSize = sal_True;
+ pItems[i].mbSubSize = TRUE;
}
}
}
@@ -635,9 +649,9 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
// Groessen von den einzelnen Items abziehen
- nErrorSum = nSizeDelta % nCalcItems;
- nCurSizeDelta = nSizeDelta / nCalcItems;
- nMins = 0;
+ nErrorSum = nSizeDelta % nCalcItems;
+ nCurSizeDelta = nSizeDelta / nCalcItems;
+ nMins = 0;
for ( i = 0; i < nItems; i++ )
{
if ( pItems[i].mnBits & SWIB_INVISIBLE )
@@ -714,31 +728,31 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
pItems[i].mnOldSplitPos = pItems[i].mnSplitPos;
pItems[i].mnOldSplitSize = pItems[i].mnSplitSize;
- pItems[i].mnOldWidth = pItems[i].mnWidth;
- pItems[i].mnOldHeight = pItems[i].mnHeight;
+ pItems[i].mnOldWidth = pItems[i].mnWidth;
+ pItems[i].mnOldHeight = pItems[i].mnHeight;
if ( pItems[i].mnBits & SWIB_INVISIBLE )
- bEmpty = sal_True;
+ bEmpty = TRUE;
else
{
- bEmpty = sal_False;
+ bEmpty = FALSE;
if ( bDown )
{
if ( nPos+pItems[i].mnPixSize > nMaxPos )
- bEmpty = sal_True;
+ bEmpty = TRUE;
}
else
{
nPos -= pItems[i].mnPixSize;
if ( nPos < nMaxPos )
- bEmpty = sal_True;
+ bEmpty = TRUE;
}
}
if ( bEmpty )
{
- pItems[i].mnWidth = 0;
- pItems[i].mnHeight = 0;
+ pItems[i].mnWidth = 0;
+ pItems[i].mnHeight = 0;
pItems[i].mnSplitSize = 0;
}
else
@@ -802,9 +816,9 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// Fixed setzen
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbFixed = sal_False;
+ pItems[i].mbFixed = FALSE;
if ( pItems[i].mnBits & SWIB_FIXED )
- pItems[i].mbFixed = sal_True;
+ pItems[i].mbFixed = TRUE;
else
{
// Wenn Child-Set vorhanden, ist dieses Item auch Fixed, wenn
@@ -815,7 +829,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
if ( pItems[i].mpSet->mpItems[j].mbFixed )
{
- pItems[i].mbFixed = sal_True;
+ pItems[i].mbFixed = TRUE;
break;
}
}
@@ -826,12 +840,12 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
- sal_Bool bRows, sal_Bool /*bDown*/ )
+void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
+ BOOL bRows, BOOL /*bDown*/ )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
if ( pWindow->IsReallyVisible() && pWindow->IsUpdateMode() && pWindow->mbInvalidate )
{
@@ -842,7 +856,7 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bo
// Evt. alles invalidieren oder nur einen kleinen Teil
if ( (pItems[i].mnOldSplitPos != pItems[i].mnSplitPos) ||
(pItems[i].mnOldSplitSize != pItems[i].mnSplitSize) ||
- (pItems[i].mnOldWidth != pItems[i].mnWidth) ||
+ (pItems[i].mnOldWidth != pItems[i].mnWidth) ||
(pItems[i].mnOldHeight != pItems[i].mnHeight) )
{
Rectangle aRect;
@@ -850,33 +864,33 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bo
// Old Rect invalidieren
if ( bRows )
{
- aRect.Left() = pItems[i].mnLeft;
- aRect.Right() = pItems[i].mnLeft+pItems[i].mnOldWidth-1;
- aRect.Top() = pItems[i].mnOldSplitPos;
- aRect.Bottom() = aRect.Top() + pItems[i].mnOldSplitSize;
+ aRect.Left() = pItems[i].mnLeft;
+ aRect.Right() = pItems[i].mnLeft+pItems[i].mnOldWidth-1;
+ aRect.Top() = pItems[i].mnOldSplitPos;
+ aRect.Bottom() = aRect.Top() + pItems[i].mnOldSplitSize;
}
else
{
- aRect.Top() = pItems[i].mnTop;
- aRect.Bottom() = pItems[i].mnTop+pItems[i].mnOldHeight-1;
- aRect.Left() = pItems[i].mnOldSplitPos;
- aRect.Right() = aRect.Left() + pItems[i].mnOldSplitSize;
+ aRect.Top() = pItems[i].mnTop;
+ aRect.Bottom() = pItems[i].mnTop+pItems[i].mnOldHeight-1;
+ aRect.Left() = pItems[i].mnOldSplitPos;
+ aRect.Right() = aRect.Left() + pItems[i].mnOldSplitSize;
}
pWindow->Invalidate( aRect );
// New Rect invalidieren
if ( bRows )
{
- aRect.Left() = pItems[i].mnLeft;
- aRect.Right() = pItems[i].mnLeft+pItems[i].mnWidth-1;
- aRect.Top() = pItems[i].mnSplitPos;
- aRect.Bottom() = aRect.Top() + pItems[i].mnSplitSize;
+ aRect.Left() = pItems[i].mnLeft;
+ aRect.Right() = pItems[i].mnLeft+pItems[i].mnWidth-1;
+ aRect.Top() = pItems[i].mnSplitPos;
+ aRect.Bottom() = aRect.Top() + pItems[i].mnSplitSize;
}
else
{
- aRect.Top() = pItems[i].mnTop;
- aRect.Bottom() = pItems[i].mnTop+pItems[i].mnHeight-1;
- aRect.Left() = pItems[i].mnSplitPos;
- aRect.Right() = aRect.Left() + pItems[i].mnSplitSize;
+ aRect.Top() = pItems[i].mnTop;
+ aRect.Bottom() = pItems[i].mnTop+pItems[i].mnHeight-1;
+ aRect.Left() = pItems[i].mnSplitPos;
+ aRect.Right() = aRect.Left() + pItems[i].mnSplitSize;
}
pWindow->Invalidate( aRect );
@@ -884,10 +898,10 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bo
// nicht von Fenstern ueberladen werden
if ( pItems[i].mpSet && !pItems[i].mpSet->mpItems )
{
- aRect.Left() = pItems[i].mnLeft;
- aRect.Top() = pItems[i].mnTop;
- aRect.Right() = pItems[i].mnLeft+pItems[i].mnWidth-1;
- aRect.Bottom() = pItems[i].mnTop+pItems[i].mnHeight-1;
+ aRect.Left() = pItems[i].mnLeft;
+ aRect.Top() = pItems[i].mnTop;
+ aRect.Right() = pItems[i].mnLeft+pItems[i].mnWidth-1;
+ aRect.Bottom() = pItems[i].mnTop+pItems[i].mnHeight-1;
pWindow->Invalidate( aRect );
}
}
@@ -900,9 +914,9 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bo
{
if ( pItems[i].mpSet )
{
- sal_Bool bTempHide = bHide;
+ BOOL bTempHide = bHide;
if ( !pItems[i].mnWidth || !pItems[i].mnHeight )
- bTempHide = sal_True;
+ bTempHide = TRUE;
ImplCalcSet2( pWindow, pItems[i].mpSet, bTempHide,
((pItems[i].mnBits & SWIB_COLSET) == 0) );
}
@@ -929,12 +943,12 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bo
// -----------------------------------------------------------------------
-static void ImplCalcLogSize( ImplSplitItem* pItems, sal_uInt16 nItems )
+static void ImplCalcLogSize( ImplSplitItem* pItems, USHORT nItems )
{
// Original-Groessen updaten
- sal_uInt16 i;
- long nRelSize = 0;
- long nPerSize = 0;
+ USHORT i;
+ long nRelSize = 0;
+ long nPerSize = 0;
for ( i = 0; i < nItems; i++ )
{
if ( pItems[i].mnBits & SWIB_RELATIVESIZE )
@@ -971,8 +985,8 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
{
if ( pBitmap )
{
- Point aPos = rRect.TopLeft();
- Size aBmpSize = pBitmap->GetSizePixel();
+ Point aPos = rRect.TopLeft();
+ Size aBmpSize = pBitmap->GetSizePixel();
pWindow->Push( PUSH_CLIPREGION );
pWindow->IntersectClipRegion( rRect );
do
@@ -997,9 +1011,9 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
{
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ ImplSplitItem* pItems = pSet->mpItems;
// Beim Mainset auch den Hintergrund zeichnen
if ( pSet->mnId == 0 )
@@ -1022,9 +1036,9 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
if ( pSet->mpBitmap || pSet->mpWallpaper )
{
// Wegen ICC auftrennen
- Point aPoint( pItems[i].mnLeft, pItems[i].mnTop );
- Size aSize( pItems[i].mnWidth, pItems[i].mnHeight );
- Rectangle aRect( aPoint, aSize );
+ Point aPoint( pItems[i].mnLeft, pItems[i].mnTop );
+ Size aSize( pItems[i].mnWidth, pItems[i].mnHeight );
+ Rectangle aRect( aPoint, aSize );
ImplDrawBack( pWindow, aRect, pSet->mpWallpaper, pSet->mpBitmap );
}
}
@@ -1040,20 +1054,20 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
// -----------------------------------------------------------------------
static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
- sal_Bool bRows, sal_Bool bDown = sal_True )
+ BOOL bRows, BOOL bDown = TRUE )
{
if ( !pSet->mpItems )
return;
- sal_uInt16 i;
- sal_uInt16 nItems = pSet->mnItems;
- long nPos;
- long nTop;
- long nBottom;
- ImplSplitItem* pItems = pSet->mpItems;
- const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
+ USHORT i;
+ USHORT nItems = pSet->mnItems;
+ long nPos;
+ long nTop;
+ long nBottom;
+ ImplSplitItem* pItems = pSet->mpItems;
+ const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
- sal_Bool bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
+ BOOL bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
for ( i = 0; i < nItems-1; i++ )
{
@@ -1065,7 +1079,7 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
long nSplitSize = pSet->mnSplitSize;
if ( bRows )
{
- nTop = pItems[i].mnLeft;
+ nTop = pItems[i].mnLeft;
nBottom = pItems[i].mnLeft+pItems[i].mnWidth-1;
if ( bFlat ) nPos--;
@@ -1095,7 +1109,7 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
}
else
{
- nTop = pItems[i].mnTop;
+ nTop = pItems[i].mnTop;
nBottom = pItems[i].mnTop+pSet->mpItems[i].mnHeight-1;
if ( bFlat ) nPos--;
@@ -1134,22 +1148,22 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
- sal_Bool bRows, sal_Bool /*bDown*/ )
+USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos,
+ BOOL bRows, BOOL /*bDown*/ )
{
if ( !pSet->mpItems )
return 0;
- sal_uInt16 i;
- sal_uInt16 nSplitTest;
- sal_uInt16 nItems = pSet->mnItems;
- long nMPos1;
- long nMPos2;
- long nPos;
- long nTop;
- long nBottom;
- ImplSplitItem* pItems = pSet->mpItems;
+ USHORT i;
+ USHORT nSplitTest;
+ USHORT nItems = pSet->mnItems;
+ long nMPos1;
+ long nMPos2;
+ long nPos;
+ long nTop;
+ long nBottom;
+ ImplSplitItem* pItems = pSet->mpItems;
if ( bRows )
{
@@ -1168,12 +1182,12 @@ sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
{
if ( bRows )
{
- nTop = pItems[i].mnLeft;
+ nTop = pItems[i].mnLeft;
nBottom = pItems[i].mnLeft+pItems[i].mnWidth-1;
}
else
{
- nTop = pItems[i].mnTop;
+ nTop = pItems[i].mnTop;
nBottom = pItems[i].mnTop+pItems[i].mnHeight-1;
}
nPos = pItems[i].mnSplitPos;
@@ -1214,15 +1228,15 @@ sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos )
+USHORT SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos )
{
// Resizeable SplitWindow muss anders behandelt werden
if ( pWindow->mnWinStyle & WB_SIZEABLE )
{
- long nTPos;
- long nPos;
- long nBorder;
+ long nTPos;
+ long nPos;
+ long nBorder;
if ( pWindow->mbHorz )
{
@@ -1299,10 +1313,10 @@ void SplitWindow::ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos )
}
else
{
- aRect.Left() = pThis->maDragRect.Left();
- aRect.Right() = pThis->maDragRect.Right();
- aRect.Top() = rPos.Y();
- aRect.Bottom() = aRect.Top()+pThis->mpSplitSet->mnSplitSize-1;
+ aRect.Left() = pThis->maDragRect.Left();
+ aRect.Right() = pThis->maDragRect.Right();
+ aRect.Top() = rPos.Y();
+ aRect.Bottom() = aRect.Top()+pThis->mpSplitSet->mnSplitSize-1;
if ( !(pThis->mnWinStyle & WB_NOSPLITDRAW) )
aRect.Bottom()--;
if ( (pThis->mnSplitTest & SPLIT_WINDOW) &&
@@ -1319,58 +1333,58 @@ void SplitWindow::ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos )
void SplitWindow::ImplInit( Window* pParent, WinBits nStyle )
{
- ImplSplitSet* pNewSet = new ImplSplitSet;
- pNewSet->mpItems = NULL;
- pNewSet->mpWallpaper = NULL;
- pNewSet->mpBitmap = NULL;
- pNewSet->mnLastSize = 0;
- pNewSet->mnItems = 0;
- pNewSet->mnId = 0;
- pNewSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- pNewSet->mbCalcPix = sal_True;
-
- mpMainSet = pNewSet;
- mpBaseSet = pNewSet;
- mpSplitSet = NULL;
- mpLastSizes = NULL;
- mnDX = 0;
- mnDY = 0;
- mnLeftBorder = 0;
- mnTopBorder = 0;
- mnRightBorder = 0;
- mnBottomBorder = 0;
- mnMaxSize = 0;
- mnMouseOff = 0;
- meAlign = WINDOWALIGN_TOP;
- mnWinStyle = nStyle;
- mnSplitTest = 0;
- mnSplitPos = 0;
- mnMouseModifier = 0;
- mnMStartPos = 0;
- mnMSplitPos = 0;
- 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;
+ ImplSplitSet* pNewSet = new ImplSplitSet;
+ pNewSet->mpItems = NULL;
+ pNewSet->mpWallpaper = NULL;
+ pNewSet->mpBitmap = NULL;
+ pNewSet->mnLastSize = 0;
+ pNewSet->mnItems = 0;
+ pNewSet->mnId = 0;
+ pNewSet->mnSplitSize = SPLITWIN_SPLITSIZE;
+ pNewSet->mbCalcPix = TRUE;
+
+ mpMainSet = pNewSet;
+ mpBaseSet = pNewSet;
+ mpSplitSet = NULL;
+ mpLastSizes = NULL;
+ mnDX = 0;
+ mnDY = 0;
+ mnLeftBorder = 0;
+ mnTopBorder = 0;
+ mnRightBorder = 0;
+ mnBottomBorder = 0;
+ mnMaxSize = 0;
+ mnMouseOff = 0;
+ meAlign = WINDOWALIGN_TOP;
+ mnWinStyle = nStyle;
+ mnSplitTest = 0;
+ mnSplitPos = 0;
+ 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;
if ( nStyle & WB_NOSPLITDRAW )
{
pNewSet->mnSplitSize -= 2;
- mbInvalidate = sal_False;
+ mbInvalidate = FALSE;
}
if ( nStyle & WB_BORDER )
@@ -1492,7 +1506,7 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
{
Size aSize( aNewSize );
long nSplitSize = mpMainSet->mnSplitSize-2;
-
+
if ( mbAutoHide || mbFadeOut )
nSplitSize += SPLITWIN_SPLITSIZEEXLN;
@@ -1501,9 +1515,9 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
// ist
if ( mnWinStyle & WB_SIZEABLE )
{
- long nCurSize;
- long nCalcSize = 0;
- sal_uInt16 i;
+ long nCurSize;
+ long nCalcSize = 0;
+ USHORT i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1515,9 +1529,9 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
if ( i == mpMainSet->mnItems )
{
- long nDelta = 0;
- Point aPos = GetPosPixel();
-
+ long nDelta = 0;
+ Point aPos = GetPosPixel();
+
if ( mbHorz )
nCurSize = aNewSize.Height()-mnTopBorder-mnBottomBorder;
else
@@ -1569,9 +1583,9 @@ void SplitWindow::ImplCalcLayout()
// ist
if ( mnWinStyle & WB_SIZEABLE )
{
- long nCurSize;
- long nCalcSize = 0;
- sal_uInt16 i;
+ long nCurSize;
+ long nCalcSize = 0;
+ USHORT i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1590,9 +1604,9 @@ void SplitWindow::ImplCalcLayout()
nCurSize -= nSplitSize;
nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize;
- mbRecalc = sal_False;
+ mbRecalc = FALSE;
ImplSetWindowSize( nCalcSize-nCurSize );
- mbRecalc = sal_True;
+ mbRecalc = TRUE;
}
}
@@ -1600,10 +1614,10 @@ void SplitWindow::ImplCalcLayout()
return;
// Groessen/Position vorberechnen
- long nL;
- long nT;
- long nW;
- long nH;
+ long nL;
+ long nT;
+ long nW;
+ long nH;
if ( mbHorz )
{
@@ -1633,15 +1647,15 @@ void SplitWindow::ImplCalcLayout()
// Sets rekursiv berechnen
ImplCalcSet( mpMainSet, nL, nT, nW, nH, mbHorz, !mbBottomRight );
- ImplCalcSet2( this, mpMainSet, sal_False, mbHorz, !mbBottomRight );
- mbCalc = sal_False;
+ ImplCalcSet2( this, mpMainSet, FALSE, mbHorz, !mbBottomRight );
+ mbCalc = FALSE;
}
// -----------------------------------------------------------------------
void SplitWindow::ImplUpdate()
{
- mbCalc = sal_True;
+ mbCalc = TRUE;
if ( IsReallyShown() && IsUpdateMode() && mbRecalc )
{
@@ -1673,22 +1687,22 @@ void SplitWindow::ImplUpdateSet( ImplSplitSet* pSet )
Rectangle aRect;
if ( pSet == mpMainSet )
{
- aRect.Left() = mnLeftBorder;
- aRect.Top() = mnTopBorder;
- aRect.Right() = mnDX-mnRightBorder-1;
- aRect.Bottom() = mnDY-mnBottomBorder-1;
+ aRect.Left() = mnLeftBorder;
+ aRect.Top() = mnTopBorder;
+ aRect.Right() = mnDX-mnRightBorder-1;
+ aRect.Bottom() = mnDY-mnBottomBorder-1;
}
else
{
- ImplSplitItem* pItem;
- sal_uInt16 nPos;
+ ImplSplitItem* pItem;
+ USHORT nPos;
pSet = ImplFindItem( mpMainSet, pSet->mnId, nPos );
pItem = &(pSet->mpItems[nPos]);
- aRect.Left() = pItem->mnLeft;
- aRect.Top() = pItem->mnTop;
- aRect.Right() = aRect.Left()+pItem->mnWidth;
- aRect.Bottom() = aRect.Top()+pItem->mnHeight;
+ aRect.Left() = pItem->mnLeft;
+ aRect.Top() = pItem->mnTop;
+ aRect.Right() = aRect.Left()+pItem->mnWidth;
+ aRect.Bottom() = aRect.Top()+pItem->mnHeight;
}
Invalidate( aRect );
}
@@ -1721,7 +1735,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos )
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const
+void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const
{
long nSplitSize = mpMainSet->mnSplitSize-2;
if ( mbAutoHide || mbFadeOut || mbFadeIn )
@@ -1744,57 +1758,57 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest
if ( meAlign == WINDOWALIGN_TOP )
{
- rRect.Left() = mnLeftBorder+nEx;
- rRect.Top() = mnDY-mnBottomBorder-nSplitSize;
- rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE;
- rRect.Bottom() = mnDY-mnBottomBorder-1;
+ rRect.Left() = mnLeftBorder+nEx;
+ rRect.Top() = mnDY-mnBottomBorder-nSplitSize;
+ rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE;
+ rRect.Bottom() = mnDY-mnBottomBorder-1;
if ( bTest )
{
- rRect.Top() -= mnTopBorder;
- rRect.Bottom() += mnBottomBorder;
+ rRect.Top() -= mnTopBorder;
+ rRect.Bottom() += mnBottomBorder;
}
}
else if ( meAlign == WINDOWALIGN_BOTTOM )
{
- rRect.Left() = mnLeftBorder+nEx;
- rRect.Top() = mnTopBorder;
- rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE;
- rRect.Bottom() = mnTopBorder+nSplitSize-1;
+ rRect.Left() = mnLeftBorder+nEx;
+ rRect.Top() = mnTopBorder;
+ rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE;
+ rRect.Bottom() = mnTopBorder+nSplitSize-1;
if ( bTest )
{
- rRect.Top() -= mnTopBorder;
- rRect.Bottom() += mnBottomBorder;
+ rRect.Top() -= mnTopBorder;
+ rRect.Bottom() += mnBottomBorder;
}
}
else if ( meAlign == WINDOWALIGN_LEFT )
{
- rRect.Left() = mnDX-mnRightBorder-nSplitSize;
- rRect.Top() = mnTopBorder+nEx;
- rRect.Right() = mnDX-mnRightBorder-1;
- rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE;
+ rRect.Left() = mnDX-mnRightBorder-nSplitSize;
+ rRect.Top() = mnTopBorder+nEx;
+ rRect.Right() = mnDX-mnRightBorder-1;
+ rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE;
if ( bTest )
{
- rRect.Left() -= mnLeftBorder;
- rRect.Right() += mnRightBorder;
+ rRect.Left() -= mnLeftBorder;
+ rRect.Right() += mnRightBorder;
}
}
else if ( meAlign == WINDOWALIGN_RIGHT )
{
- rRect.Left() = mnLeftBorder;
- rRect.Top() = mnTopBorder+nEx;
- rRect.Right() = mnLeftBorder+nSplitSize-1;
- rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE;
+ rRect.Left() = mnLeftBorder;
+ rRect.Top() = mnTopBorder+nEx;
+ rRect.Right() = mnLeftBorder+nSplitSize-1;
+ rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE;
if ( bTest )
{
- rRect.Left() -= mnLeftBorder;
- rRect.Right() += mnRightBorder;
+ rRect.Left() -= mnLeftBorder;
+ rRect.Right() += mnRightBorder;
}
}
}
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest ) const
+void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const
{
Rectangle aRect;
@@ -1811,7 +1825,7 @@ void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest ) const
+void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const
{
Rectangle aRect;
@@ -1823,12 +1837,12 @@ void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, sal_Bool ) const
+void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, BOOL ) const
{
Rectangle aRect;
if ( mbFadeOut )
- ImplGetButtonRect( aRect, 0, sal_False );
+ ImplGetButtonRect( aRect, 0, FALSE );
rRect = aRect;
}
@@ -1903,7 +1917,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
+void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
{
if ( mbAutoHide )
{
@@ -1915,7 +1929,7 @@ void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
// ImageListe laden, wenn noch nicht vorhanden
ImplSVData* pSVData = ImplGetSVData();
- ImageList* pImageList;
+ ImageList* pImageList;
if ( mbHorz )
{
if ( !pSVData->maCtrlData.mpSplitHPinImgList )
@@ -1928,7 +1942,7 @@ void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
pSVData->maCtrlData.mpSplitHPinImgList->InsertFromHorizontalBitmap
( ResId( SV_RESID_BITMAP_SPLITHPIN, *pResMgr ), 4, &aNonAlphaMask );
}
- }
+ }
pImageList = pSVData->maCtrlData.mpSplitHPinImgList;
}
else
@@ -1945,10 +1959,10 @@ void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
}
}
pImageList = pSVData->maCtrlData.mpSplitVPinImgList;
- }
+ }
// Image ermitteln und zurueckgeben
- sal_uInt16 nId;
+ USHORT nId;
if ( mbAutoHidePressed )
{
if ( mbAutoHideIn )
@@ -1964,11 +1978,11 @@ void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
nId = 2;
}
- Image aImage = pImageList->GetImage( nId );
- Size aImageSize = aImage.GetSizePixel();
- Point aPos( aTempRect.Left()+((aTempRect.GetWidth()-aImageSize.Width())/2),
+ Image aImage = pImageList->GetImage( nId );
+ Size aImageSize = aImage.GetSizePixel();
+ Point aPos( aTempRect.Left()+((aTempRect.GetWidth()-aImageSize.Width())/2),
aTempRect.Top()+((aTempRect.GetHeight()-aImageSize.Height())/2) );
- long nSize;
+ long nSize;
if ( mbHorz )
nSize = aImageSize.Width();
else
@@ -1980,7 +1994,7 @@ void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft )
+void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -2036,14 +2050,14 @@ void SplitWindow::ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool
}
}
-void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft )
+void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( rRect.IsInside( GetPointerPosPixel() ) )
{
DrawWallpaper( rRect, Wallpaper( Color( COL_WHITE ) ) );
- DrawSelectionBackground( rRect, 2, sal_False, sal_False, sal_False );
+ DrawSelectionBackground( rRect, 2, FALSE, FALSE, FALSE );
}
if( bHorz )
@@ -2094,25 +2108,25 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool
}
}
-void SplitWindow::ImplDrawFadeIn( sal_Bool bInPaint )
+void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
{
if ( mbFadeIn )
{
- Rectangle aTempRect;
- Image aImage;
+ Rectangle aTempRect;
+ Image aImage;
ImplGetFadeInRect( aTempRect );
- sal_Bool bLeft;
+ BOOL bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = sal_False;
+ bLeft = FALSE;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = sal_True;
+ bLeft = TRUE;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = sal_False;
+ bLeft = FALSE;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = sal_True;
+ bLeft = TRUE;
else
- bLeft = sal_True;
+ bLeft = TRUE;
if ( !bInPaint )
Erase( aTempRect );
@@ -2123,25 +2137,25 @@ void SplitWindow::ImplDrawFadeIn( sal_Bool bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeOut( sal_Bool bInPaint )
+void SplitWindow::ImplDrawFadeOut( BOOL bInPaint )
{
if ( mbFadeOut )
{
- Rectangle aTempRect;
- Image aImage;
+ Rectangle aTempRect;
+ Image aImage;
ImplGetFadeOutRect( aTempRect );
- sal_Bool bLeft;
+ BOOL bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = sal_True;
+ bLeft = TRUE;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = sal_False;
+ bLeft = FALSE;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = sal_True;
+ bLeft = TRUE;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = sal_False;
+ bLeft = FALSE;
else
- bLeft = sal_True;
+ bLeft = TRUE;
if ( !bInPaint )
Erase( aTempRect );
@@ -2158,17 +2172,17 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
if ( mnSplitTest && !(mnSplitTest & SPLIT_NOSPLIT) )
{
- ImplSplitItem* pSplitItem;
- long nCurMaxSize;
- sal_uInt16 nTemp;
- sal_Bool bDown;
- sal_Bool bPropSmaller;
+ ImplSplitItem* pSplitItem;
+ long nCurMaxSize;
+ USHORT nTemp;
+ BOOL bDown;
+ BOOL bPropSmaller;
mnMouseModifier = rMEvt.GetModifier();
if ( !(mnMouseModifier & KEY_SHIFT) || (mnSplitPos+1 >= mpSplitSet->mnItems) )
- bPropSmaller = sal_False;
+ bPropSmaller = FALSE;
else
- bPropSmaller = sal_True;
+ bPropSmaller = TRUE;
// Hier kann noch die maximale Groesse gesetzt werden
StartSplit();
@@ -2186,14 +2200,14 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
if ( mpSplitSet->mpItems )
{
- bDown = sal_True;
+ bDown = TRUE;
if ( (mpSplitSet == mpMainSet) && mbBottomRight )
- bDown = sal_False;
+ bDown = FALSE;
- pSplitItem = &(mpSplitSet->mpItems[mnSplitPos]);
- maDragRect.Left() = pSplitItem->mnLeft;
- maDragRect.Top() = pSplitItem->mnTop;
- maDragRect.Right() = pSplitItem->mnLeft+pSplitItem->mnWidth-1;
+ pSplitItem = &(mpSplitSet->mpItems[mnSplitPos]);
+ maDragRect.Left() = pSplitItem->mnLeft;
+ maDragRect.Top() = pSplitItem->mnTop;
+ maDragRect.Right() = pSplitItem->mnLeft+pSplitItem->mnWidth-1;
maDragRect.Bottom() = pSplitItem->mnTop+pSplitItem->mnHeight-1;
if ( mnSplitTest & SPLIT_HORZ )
@@ -2288,9 +2302,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
}
else
{
- maDragRect.Left() = mnLeftBorder;
- maDragRect.Top() = mnTopBorder;
- maDragRect.Right() = mnDX-mnRightBorder-1;
+ maDragRect.Left() = mnLeftBorder;
+ maDragRect.Top() = mnTopBorder;
+ maDragRect.Right() = mnDX-mnRightBorder-1;
maDragRect.Bottom() = mnDY-mnBottomBorder-1;
if ( mbHorz )
{
@@ -2318,10 +2332,10 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
ImplDrawSplitTracking( this, aMousePosPixel );
else
{
- ImplSplitItem* pItems = mpSplitSet->mpItems;
- sal_uInt16 nItems = mpSplitSet->mnItems;
+ ImplSplitItem* pItems = mpSplitSet->mpItems;
+ USHORT nItems = mpSplitSet->mnItems;
mpLastSizes = new long[nItems*2];
- for ( sal_uInt16 i = 0; i < nItems; i++ )
+ for ( USHORT i = 0; i < nItems; i++ )
{
mpLastSizes[i*2] = pItems[i].mnSize;
mpLastSizes[i*2+1] = pItems[i].mnPixSize;
@@ -2393,38 +2407,38 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt )
return;
}
- Point aMousePosPixel = rMEvt.GetPosPixel();
- Rectangle aTestRect;
+ Point aMousePosPixel = rMEvt.GetPosPixel();
+ Rectangle aTestRect;
- mbFadeNoButtonMode = sal_False;
- ImplGetAutoHideRect( aTestRect, sal_True );
+ mbFadeNoButtonMode = FALSE;
+ ImplGetAutoHideRect( aTestRect, TRUE );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbAutoHideDown = sal_True;
- mbAutoHidePressed = sal_True;
- ImplDrawAutoHide( sal_False );
+ mbAutoHideDown = TRUE;
+ mbAutoHidePressed = TRUE;
+ ImplDrawAutoHide( FALSE );
}
else
{
- ImplGetFadeOutRect( aTestRect, sal_True );
+ ImplGetFadeOutRect( aTestRect, TRUE );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeOutDown = sal_True;
- mbFadeOutPressed = sal_True;
- ImplDrawFadeOut( sal_False );
+ mbFadeOutDown = TRUE;
+ mbFadeOutPressed = TRUE;
+ ImplDrawFadeOut( FALSE );
}
else
{
- ImplGetFadeInRect( aTestRect, sal_True );
+ ImplGetFadeInRect( aTestRect, TRUE );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeInDown = sal_True;
- mbFadeInPressed = sal_True;
- ImplDrawFadeIn( sal_False );
+ mbFadeInDown = TRUE;
+ mbFadeInPressed = TRUE;
+ ImplDrawFadeIn( FALSE );
}
else if ( !aTestRect.IsEmpty() && !(mnWinStyle & WB_SIZEABLE) )
{
- mbFadeNoButtonMode = sal_True;
+ mbFadeNoButtonMode = TRUE;
FadeIn();
return;
}
@@ -2443,15 +2457,15 @@ void SplitWindow::MouseMove( const MouseEvent& rMEvt )
{
if ( !IsTracking() )
{
- Point aPos = rMEvt.GetPosPixel();
- long nTemp;
- ImplSplitSet* pTempSplitSet;
- sal_uInt16 nTempSplitPos;
- sal_uInt16 nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
- PointerStyle eStyle = POINTER_ARROW;
- Rectangle aAutoHideRect;
- Rectangle aFadeInRect;
- Rectangle aFadeOutRect;
+ Point aPos = rMEvt.GetPosPixel();
+ long nTemp;
+ ImplSplitSet* pTempSplitSet;
+ USHORT nTempSplitPos;
+ USHORT nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
+ PointerStyle eStyle = POINTER_ARROW;
+ Rectangle aAutoHideRect;
+ Rectangle aFadeInRect;
+ Rectangle aFadeOutRect;
ImplGetAutoHideRect( aAutoHideRect );
ImplGetFadeInRect( aFadeInRect );
@@ -2484,30 +2498,30 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbAutoHideDown = sal_False;
+ mbAutoHideDown = FALSE;
if ( mbAutoHidePressed )
{
- mbAutoHidePressed = sal_False;
+ mbAutoHidePressed = FALSE;
if ( !rTEvt.IsTrackingCanceled() )
{
mbAutoHideIn = !mbAutoHideIn;
- ImplDrawAutoHide( sal_False );
+ ImplDrawAutoHide( FALSE );
AutoHide();
}
else
- ImplDrawAutoHide( sal_False );
+ ImplDrawAutoHide( FALSE );
}
}
else
{
Rectangle aTestRect;
- ImplGetAutoHideRect( aTestRect, sal_True );
- sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetAutoHideRect( aTestRect, TRUE );
+ BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbAutoHidePressed )
{
mbAutoHidePressed = bNewPressed;
- ImplDrawAutoHide( sal_False );
+ ImplDrawAutoHide( FALSE );
}
}
}
@@ -2515,11 +2529,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeInDown = sal_False;
+ mbFadeInDown = FALSE;
if ( mbFadeInPressed )
{
- mbFadeInPressed = sal_False;
- ImplDrawFadeIn( sal_False );
+ mbFadeInPressed = FALSE;
+ ImplDrawFadeIn( FALSE );
if ( !rTEvt.IsTrackingCanceled() )
FadeIn();
@@ -2528,12 +2542,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeInRect( aTestRect, sal_True );
- sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetFadeInRect( aTestRect, TRUE );
+ BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbFadeInPressed )
{
mbFadeInPressed = bNewPressed;
- ImplDrawFadeIn( sal_False );
+ ImplDrawFadeIn( FALSE );
}
}
}
@@ -2541,11 +2555,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeOutDown = sal_False;
+ mbFadeOutDown = FALSE;
if ( mbFadeOutPressed )
{
- mbFadeOutPressed = sal_False;
- ImplDrawFadeOut( sal_False );
+ mbFadeOutPressed = FALSE;
+ ImplDrawFadeOut( FALSE );
if ( !rTEvt.IsTrackingCanceled() )
FadeOut();
@@ -2554,12 +2568,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeOutRect( aTestRect, sal_True );
- sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
- if ( bNewPressed == sal_False )
+ ImplGetFadeOutRect( aTestRect, TRUE );
+ BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ if ( bNewPressed == FALSE )
{
mbFadeOutPressed = bNewPressed;
- ImplDrawFadeOut( sal_False );
+ ImplDrawFadeOut( FALSE );
// We need a mouseevent with a position inside the button for the
// ImplStartSplit function!
@@ -2569,31 +2583,31 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
aOrgMEvt.GetModifier() );
ImplStartSplit( aNewMEvt );
- mbFadeOutDown = sal_False;
+ mbFadeOutDown = FALSE;
}
}
}
else
{
ImplSplitMousePos( aMousePosPixel );
- sal_Bool bSplit = sal_True;
+ BOOL bSplit = TRUE;
if ( mbDragFull )
{
if ( rTEvt.IsTrackingEnded() )
{
if ( rTEvt.IsTrackingCanceled() )
{
- ImplSplitItem* pItems = mpSplitSet->mpItems;
- sal_uInt16 nItems = mpSplitSet->mnItems;
- for ( sal_uInt16 i = 0; i < nItems; i++ )
+ ImplSplitItem* pItems = mpSplitSet->mpItems;
+ USHORT nItems = mpSplitSet->mnItems;
+ for ( USHORT i = 0; i < nItems; i++ )
{
- pItems[i].mnSize = mpLastSizes[i*2];
+ pItems[i].mnSize = mpLastSizes[i*2];
pItems[i].mnPixSize = mpLastSizes[i*2+1];
}
ImplUpdate();
Split();
}
- bSplit = sal_False;
+ bSplit = FALSE;
}
}
else
@@ -2606,15 +2620,15 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
ImplDrawSplitTracking( this, aMousePosPixel );
- bSplit = sal_False;
+ bSplit = FALSE;
}
}
if ( bSplit )
{
- sal_Bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? sal_True : sal_False;
- sal_Bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? sal_True : sal_False;
- long nDelta = mnMSplitPos-mnMStartPos;
+ BOOL bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? TRUE : FALSE;
+ BOOL bPropGreater = (mnMouseModifier & KEY_MOD1) ? TRUE : FALSE;
+ long nDelta = mnMSplitPos-mnMStartPos;
if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems )
{
@@ -2646,14 +2660,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( mpLastSizes )
delete mpLastSizes;
- mpLastSizes = NULL;
- mpSplitSet = NULL;
- mnMouseOff = 0;
- mnMStartPos = 0;
- mnMSplitPos = 0;
+ mpLastSizes = NULL;
+ mpSplitSet = NULL;
+ mnMouseOff = 0;
+ mnMStartPos = 0;
+ mnMSplitPos = 0;
mnMouseModifier = 0;
- mnSplitTest = 0;
- mnSplitPos = 0;
+ mnSplitTest = 0;
+ mnSplitPos = 0;
}
}
}
@@ -2673,7 +2687,7 @@ long SplitWindow::PreNotify( NotifyEvent& rNEvt )
Rectangle aFadeOutRect;
ImplGetFadeInRect( aFadeInRect );
ImplGetFadeOutRect( aFadeOutRect );
-
+
if ( aFadeInRect.IsInside( GetPointerPosPixel() ) != aFadeInRect.IsInside( GetLastPointerPosPixel() ) )
Invalidate( aFadeInRect );
if ( aFadeOutRect.IsInside( GetPointerPosPixel() ) != aFadeOutRect.IsInside( GetLastPointerPosPixel() ) )
@@ -2697,9 +2711,9 @@ void SplitWindow::Paint( const Rectangle& )
ImplDrawBorder( this );
ImplDrawBorderLine( this );
- ImplDrawFadeOut( sal_True );
- ImplDrawFadeIn( sal_True );
- ImplDrawAutoHide( sal_True );
+ ImplDrawFadeOut( TRUE );
+ ImplDrawFadeIn( TRUE );
+ ImplDrawAutoHide( TRUE );
// FrameSet-Hintergruende zeichnen
ImplDrawBack( this, mpMainSet );
@@ -2735,11 +2749,11 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
// no keyboard help for splitwin
if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) && !rHEvt.KeyboardActivated() )
{
- Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
- Rectangle aHelpRect;
- sal_uInt16 nHelpResId = 0;
+ Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
+ Rectangle aHelpRect;
+ USHORT nHelpResId = 0;
- ImplGetAutoHideRect( aHelpRect, sal_True );
+ ImplGetAutoHideRect( aHelpRect, TRUE );
if ( aHelpRect.IsInside( aMousePosPixel ) )
{
if ( mbAutoHideIn )
@@ -2749,12 +2763,12 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- ImplGetFadeInRect( aHelpRect, sal_True );
+ ImplGetFadeInRect( aHelpRect, TRUE );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEIN;
else
{
- ImplGetFadeOutRect( aHelpRect, sal_True );
+ ImplGetFadeOutRect( aHelpRect, TRUE );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEOUT;
}
@@ -2825,25 +2839,25 @@ void SplitWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
- sal_uInt16 nPos, sal_uInt16 nSetId,
+void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
+ USHORT nPos, USHORT nSetId,
SplitWindowItemBits nBits )
{
#ifdef DBG_UTIL
- sal_uInt16 nDbgDummy;
+ USHORT nDbgDummy;
DBG_ASSERT( ImplFindSet( mpMainSet, nSetId ), "SplitWindow::InsertItem() - Set not exists" );
DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" );
#endif
- // Size has to be at least 1.
+ // Size muss min. 1 sein
if ( nSize < 1 )
nSize = 1;
- ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
+ ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
ImplSplitSet* pNewSet;
ImplSplitItem* pItem;
- // Make room for the new item.
+ // Platz fuer neues Item schaffen
if ( nPos > pSet->mnItems )
nPos = pSet->mnItems;
ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1];
@@ -2854,39 +2868,37 @@ void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
delete[] pSet->mpItems;
pSet->mpItems = pNewItems;
pSet->mnItems++;
- pSet->mbCalcPix = sal_True;
+ pSet->mbCalcPix = TRUE;
- // Create and initialize item.
- pItem = &(pSet->mpItems[nPos]);
+ // Item anlegen und erweitern
+ pItem = &(pSet->mpItems[nPos]);
memset( pItem, 0, sizeof( ImplSplitItem ) );
- pItem->mnSize = nSize;
- pItem->mnId = nId;
- pItem->mnBits = nBits;
- pItem->mnMinSize=-1;
- pItem->mnMaxSize=-1;
+ pItem->mnSize = nSize;
+ pItem->mnId = nId;
+ pItem->mnBits = nBits;
if ( pWindow )
{
- pItem->mpWindow = pWindow;
- pItem->mpOrgParent = pWindow->GetParent();
+ pItem->mpWindow = pWindow;
+ pItem->mpOrgParent = pWindow->GetParent();
- // Attach window to SplitWindow.
+ // Window mit SplitWindow verbinden
pWindow->Hide();
pWindow->SetParent( this );
}
else
{
- pNewSet = new ImplSplitSet;
- pNewSet->mpItems = NULL;
- pNewSet->mpWallpaper = NULL;
- pNewSet->mpBitmap = NULL;
- pNewSet->mnLastSize = 0;
- pNewSet->mnItems = 0;
- pNewSet->mnId = nId;
- pNewSet->mnSplitSize = pSet->mnSplitSize;
- pNewSet->mbCalcPix = sal_True;
+ pNewSet = new ImplSplitSet;
+ pNewSet->mpItems = NULL;
+ pNewSet->mpWallpaper = NULL;
+ pNewSet->mpBitmap = NULL;
+ pNewSet->mnLastSize = 0;
+ pNewSet->mnItems = 0;
+ pNewSet->mnId = nId;
+ pNewSet->mnSplitSize = pSet->mnSplitSize;
+ pNewSet->mbCalcPix = TRUE;
- pItem->mpSet = pNewSet;
+ pItem->mpSet = pNewSet;
}
ImplUpdate();
@@ -2894,8 +2906,8 @@ void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( sal_uInt16 nId, long nSize,
- sal_uInt16 nPos, sal_uInt16 nSetId,
+void SplitWindow::InsertItem( USHORT nId, long nSize,
+ USHORT nPos, USHORT nSetId,
SplitWindowItemBits nBits )
{
InsertItem( nId, NULL, nSize, nPos, nSetId, nBits );
@@ -2903,18 +2915,18 @@ void SplitWindow::InsertItem( sal_uInt16 nId, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId )
+void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
{
#ifdef DBG_UTIL
- sal_uInt16 nDbgDummy;
+ USHORT nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::MoveItem() - Id not found" );
DBG_ASSERT( ImplFindSet( mpMainSet, nNewSetId ), "SplitWindow::MoveItem() - Set not exists" );
#endif
- sal_uInt16 nPos;
- ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId );
- ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
- ImplSplitItem aTempItem;
+ USHORT nPos;
+ ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId );
+ ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
+ ImplSplitItem aTempItem;
if ( pNewSet == pSet )
{
@@ -2944,7 +2956,7 @@ void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewS
nNewPos = pNewSet->mnItems;
memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) );
pSet->mnItems--;
- pSet->mbCalcPix = sal_True;
+ pSet->mbCalcPix = TRUE;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -2966,7 +2978,7 @@ void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewS
delete[] pNewSet->mpItems;
pNewSet->mpItems = pNewItems;
pNewSet->mnItems++;
- pNewSet->mbCalcPix = sal_True;
+ pNewSet->mbCalcPix = TRUE;
memcpy( &(pNewSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) );
ImplUpdate();
}
@@ -2974,19 +2986,19 @@ void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewS
// -----------------------------------------------------------------------
-void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide )
+void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
{
#ifdef DBG_UTIL
- sal_uInt16 nDbgDummy;
+ USHORT nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::RemoveItem() - Id not found" );
#endif
// Set suchen
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
- ImplSplitItem* pItem = &(pSet->mpItems[nPos]);
- Window* pWindow = pItem->mpWindow;
- Window* pOrgParent = pItem->mpOrgParent;
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
+ ImplSplitItem* pItem = &(pSet->mpItems[nPos]);
+ Window* pWindow = pItem->mpWindow;
+ Window* pOrgParent = pItem->mpOrgParent;
// Evt. Set loeschen
if ( !pWindow )
@@ -2994,7 +3006,7 @@ void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide )
// Item entfernen
pSet->mnItems--;
- pSet->mbCalcPix = sal_True;
+ pSet->mbCalcPix = TRUE;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -3028,18 +3040,18 @@ void SplitWindow::Clear()
ImplDeleteSet( mpMainSet );
// Main-Set wieder anlegen
- mpMainSet = new ImplSplitSet;
- mpMainSet->mpItems = NULL;
- mpMainSet->mpWallpaper = NULL;
- mpMainSet->mpBitmap = NULL;
- mpMainSet->mnLastSize = 0;
- mpMainSet->mnItems = 0;
- mpMainSet->mnId = 0;
- mpMainSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- mpMainSet->mbCalcPix = sal_True;
+ mpMainSet = new ImplSplitSet;
+ mpMainSet->mpItems = NULL;
+ mpMainSet->mpWallpaper = NULL;
+ mpMainSet->mpBitmap = NULL;
+ mpMainSet->mnLastSize = 0;
+ mpMainSet->mnItems = 0;
+ mpMainSet->mnId = 0;
+ mpMainSet->mnSplitSize = SPLITWIN_SPLITSIZE;
+ mpMainSet->mbCalcPix = TRUE;
if ( mnWinStyle & WB_NOSPLITDRAW )
mpMainSet->mnSplitSize -= 2;
- mpBaseSet = mpMainSet;
+ mpBaseSet = mpMainSet;
// Und neu invalidieren
ImplUpdate();
@@ -3047,22 +3059,22 @@ void SplitWindow::Clear()
// -----------------------------------------------------------------------
-void SplitWindow::SetBaseSet( sal_uInt16 nSetId )
+void SplitWindow::SetBaseSet( USHORT nSetId )
{
mpBaseSet = ImplFindSet( mpMainSet, nSetId );
}
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetBaseSet() const
+USHORT SplitWindow::GetBaseSet() const
{
return mpBaseSet->mnId;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
- sal_Bool bWithChilds )
+void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize,
+ BOOL bWithChilds )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3077,7 +3089,7 @@ void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
// -----------------------------------------------------------------------
-long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const
+long SplitWindow::GetSplitSize( USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3088,7 +3100,7 @@ long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( sal_uInt16 nSetId )
+void SplitWindow::SetItemBackground( USHORT nSetId )
{
Wallpaper aWall;
SetItemBackground( nSetId, aWall );
@@ -3096,13 +3108,13 @@ void SplitWindow::SetItemBackground( sal_uInt16 nSetId )
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper )
+void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- sal_Bool bUpdate = sal_True;
+ BOOL bUpdate = TRUE;
if ( rWallpaper.GetStyle() == WALLPAPER_NULL )
{
@@ -3112,12 +3124,12 @@ void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpa
pSet->mpWallpaper = NULL;
}
else
- bUpdate = sal_False;
+ bUpdate = FALSE;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = sal_True;
+ mbInvalidate = TRUE;
if ( !pSet->mpWallpaper )
pSet->mpWallpaper = new Wallpaper( rWallpaper );
@@ -3136,7 +3148,7 @@ void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpa
// -----------------------------------------------------------------------
-Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const
+Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3151,25 +3163,25 @@ Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const
// -----------------------------------------------------------------------
-sal_Bool SplitWindow::IsItemBackground( sal_uInt16 nSetId ) const
+BOOL SplitWindow::IsItemBackground( USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet && pSet->mpWallpaper )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap )
+void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- sal_Bool bUpdate = sal_True;
+ BOOL bUpdate = TRUE;
if ( !rBitmap )
{
@@ -3179,12 +3191,12 @@ void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap )
pSet->mpBitmap = NULL;
}
else
- bUpdate = sal_False;
+ bUpdate = FALSE;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = sal_True;
+ mbInvalidate = TRUE;
if ( !pSet->mpBitmap )
pSet->mpBitmap = new Bitmap( rBitmap );
@@ -3203,7 +3215,7 @@ void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const
+Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3218,19 +3230,19 @@ Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
- sal_Bool bPropSmall, sal_Bool bPropGreat )
+void SplitWindow::SplitItem( USHORT nId, long nNewSize,
+ BOOL bPropSmall, BOOL bPropGreat )
{
- 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 );
- ImplSplitItem* pItems;
+ USHORT nItems;
+ USHORT nPos;
+ USHORT nMin;
+ USHORT nMax;
+ USHORT i;
+ USHORT n;
+ long nDelta;
+ long nTempDelta;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ ImplSplitItem* pItems;
if ( !pSet )
return;
@@ -3238,10 +3250,6 @@ void SplitWindow::SplitItem( sal_uInt16 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;
@@ -3267,8 +3275,8 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
}
// Wenn das Fenster sizeable ist, wird das TopSet anders behandelt
- sal_Bool bSmall = sal_True;
- sal_Bool bGreat = sal_True;
+ BOOL bSmall = TRUE;
+ BOOL bGreat = TRUE;
if ( (pSet == mpMainSet) && (mnWinStyle & WB_SIZEABLE) )
{
if ( nPos < pSet->mnItems-1 )
@@ -3278,29 +3286,29 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
((nDelta < 0) && bPropGreat)) )
{
if ( nDelta < 0 )
- bGreat = sal_False;
+ bGreat = FALSE;
else
- bSmall = sal_False;
+ bSmall = FALSE;
}
}
else
{
if ( nDelta < 0 )
- bGreat = sal_False;
+ bGreat = FALSE;
else
- bSmall = sal_False;
+ bSmall = FALSE;
}
}
else if ( nPos >= nMax )
{
- bSmall = sal_False;
- bGreat = sal_False;
+ bSmall = FALSE;
+ bGreat = FALSE;
}
else if ( nPos && (nPos >= pSet->mnItems-1) )
{
nPos--;
nDelta *= -1;
- sal_Bool bTemp = bPropSmall;
+ BOOL bTemp = bPropSmall;
bPropSmall = bPropGreat;
bPropGreat = bTemp;
}
@@ -3453,11 +3461,11 @@ void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
// -----------------------------------------------------------------------
-void SplitWindow::SetItemSize( sal_uInt16 nId, long nNewSize )
+void SplitWindow::SetItemSize( USHORT nId, long nNewSize )
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
- ImplSplitItem* pItem;
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ ImplSplitItem* pItem;
if ( !pSet )
return;
@@ -3468,17 +3476,17 @@ void SplitWindow::SetItemSize( sal_uInt16 nId, long nNewSize )
{
// Neue Groesse setzen und neu durchrechnen
pItem->mnSize = nNewSize;
- pSet->mbCalcPix = sal_True;
+ pSet->mbCalcPix = TRUE;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( sal_uInt16 nId ) const
+long SplitWindow::GetItemSize( USHORT nId ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
return pSet->mpItems[nPos].mnSize;
@@ -3488,10 +3496,10 @@ long SplitWindow::GetItemSize( sal_uInt16 nId ) const
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const
+long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
{
@@ -3501,12 +3509,12 @@ long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const
{
((SplitWindow*)this)->ImplCalcLayout();
- long nRelSize = 0;
- long nPerSize = 0;
- ImplSplitItem* pItems;
- sal_uInt16 nItems;
+ long nRelSize = 0;
+ long nPerSize = 0;
+ ImplSplitItem* pItems;
+ USHORT nItems;
SplitWindowItemBits nTempBits;
- sal_uInt16 i;
+ USHORT i;
nItems = pSet->mnItems;
pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -3543,43 +3551,13 @@ long SplitWindow::GetItemSize( sal_uInt16 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( sal_uInt16 nId, SplitWindowItemBits nNewBits )
+void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
- ImplSplitItem* pItem;
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ ImplSplitItem* pItem;
if ( !pSet )
return;
@@ -3592,17 +3570,17 @@ void SplitWindow::SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits )
{
// Neue Bits setzen und neu durchrechnen
pItem->mnBits = nNewBits;
- pSet->mbCalcPix = sal_True;
+ pSet->mbCalcPix = TRUE;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const
+SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
return pSet->mpItems[nPos].mnBits;
@@ -3612,10 +3590,10 @@ SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const
// -----------------------------------------------------------------------
-Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const
+Window* SplitWindow::GetItemWindow( USHORT nId ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
return pSet->mpItems[nPos].mpWindow;
@@ -3625,10 +3603,10 @@ Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const
+USHORT SplitWindow::GetSet( USHORT nId ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
return pSet->mnId;
@@ -3638,55 +3616,55 @@ sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const
// -----------------------------------------------------------------------
-sal_Bool SplitWindow::GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const
+BOOL SplitWindow::GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) const
{
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, rPos );
if ( pSet )
{
rSetId = pSet->mnId;
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool SplitWindow::IsItemValid( sal_uInt16 nId ) const
+BOOL SplitWindow::IsItemValid( USHORT nId ) const
{
- sal_uInt16 nPos;
- ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
+ USHORT nPos;
+ ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetItemId( Window* pWindow ) const
+USHORT SplitWindow::GetItemId( Window* pWindow ) const
{
return ImplFindItem( mpBaseSet, pWindow );
}
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetItemId( const Point& rPos ) const
+USHORT SplitWindow::GetItemId( const Point& rPos ) const
{
return ImplFindItem( mpBaseSet, rPos, mbHorz, !mbBottomRight );
}
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const
+USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const
{
- ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
- sal_uInt16 nPos = SPLITWINDOW_ITEM_NOTFOUND;
+ ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
+ USHORT nPos = SPLITWINDOW_ITEM_NOTFOUND;
if ( pSet )
{
- for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
+ for ( USHORT i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mnId == nId )
{
@@ -3701,7 +3679,7 @@ sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const
+USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet && (nPos < pSet->mnItems) )
@@ -3712,7 +3690,7 @@ sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const
// -----------------------------------------------------------------------
-sal_uInt16 SplitWindow::GetItemCount( sal_uInt16 nSetId ) const
+USHORT SplitWindow::GetItemCount( USHORT nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet )
@@ -3727,28 +3705,28 @@ void SplitWindow::ImplNewAlign()
{
if ( mbNoAlign )
{
- mbHorz = sal_False;
- mbBottomRight = sal_False;
+ mbHorz = FALSE;
+ mbBottomRight = FALSE;
}
else if ( meAlign == WINDOWALIGN_TOP )
{
- mbHorz = sal_True;
- mbBottomRight = sal_False;
+ mbHorz = TRUE;
+ mbBottomRight = FALSE;
}
else if ( meAlign == WINDOWALIGN_BOTTOM )
{
- mbHorz = sal_True;
- mbBottomRight = sal_True;
+ mbHorz = TRUE;
+ mbBottomRight = TRUE;
}
else if ( meAlign == WINDOWALIGN_LEFT )
{
- mbHorz = sal_False;
- mbBottomRight = sal_False;
+ mbHorz = FALSE;
+ mbBottomRight = FALSE;
}
else if ( meAlign == WINDOWALIGN_RIGHT )
{
- mbHorz = sal_False;
- mbBottomRight = sal_True;
+ mbHorz = FALSE;
+ mbBottomRight = TRUE;
}
if ( mnWinStyle & WB_BORDER )
@@ -3764,7 +3742,7 @@ void SplitWindow::ImplNewAlign()
// -----------------------------------------------------------------------
-void SplitWindow::SetNoAlign( sal_Bool bNoAlign )
+void SplitWindow::SetNoAlign( BOOL bNoAlign )
{
bNoAlign = bNoAlign != 0;
if ( mbNoAlign != bNoAlign )
@@ -3788,17 +3766,17 @@ void SplitWindow::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
- WinBits nWinStyle, sal_Bool bExtra )
+ WinBits nWinStyle, BOOL bExtra )
{
- long nLeft;
- long nTop;
- long nRight;
- long nBottom;
- Size aSize = rSize;
+ long nLeft;
+ long nTop;
+ long nRight;
+ long nBottom;
+ Size aSize = rSize;
- ImplCalcBorder( eAlign, sal_False, nLeft, nTop, nRight, nBottom );
- aSize.Width() += nLeft+nRight;
- aSize.Height() += nTop+nBottom;
+ ImplCalcBorder( eAlign, FALSE, nLeft, nTop, nRight, nBottom );
+ aSize.Width() += nLeft+nRight;
+ aSize.Height() += nTop+nBottom;
if ( nWinStyle & WB_SIZEABLE )
{
@@ -3821,7 +3799,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
// -----------------------------------------------------------------------
-void SplitWindow::ShowAutoHideButton( sal_Bool bShow )
+void SplitWindow::ShowAutoHideButton( BOOL bShow )
{
mbAutoHide = bShow;
ImplUpdate();
@@ -3829,7 +3807,7 @@ void SplitWindow::ShowAutoHideButton( sal_Bool bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeInHideButton( sal_Bool bShow )
+void SplitWindow::ShowFadeInHideButton( BOOL bShow )
{
mbFadeIn = bShow;
ImplUpdate();
@@ -3837,7 +3815,7 @@ void SplitWindow::ShowFadeInHideButton( sal_Bool bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeOutButton( sal_Bool bShow )
+void SplitWindow::ShowFadeOutButton( BOOL bShow )
{
mbFadeOut = bShow;
ImplUpdate();
@@ -3845,7 +3823,7 @@ void SplitWindow::ShowFadeOutButton( sal_Bool bShow )
// -----------------------------------------------------------------------
-void SplitWindow::SetAutoHideState( sal_Bool bAutoHide )
+void SplitWindow::SetAutoHideState( BOOL bAutoHide )
{
mbAutoHideIn = bAutoHide;
if ( IsReallyVisible() )
@@ -3875,7 +3853,7 @@ long SplitWindow::GetFadeInSize() const
Rectangle SplitWindow::GetAutoHideRect() const
{
Rectangle aRect;
- ImplGetAutoHideRect( aRect, sal_True );
+ ImplGetAutoHideRect( aRect, TRUE );
return aRect;
}
@@ -3884,7 +3862,7 @@ Rectangle SplitWindow::GetAutoHideRect() const
Rectangle SplitWindow::GetFadeInRect() const
{
Rectangle aRect;
- ImplGetFadeInRect( aRect, sal_True );
+ ImplGetFadeInRect( aRect, TRUE );
return aRect;
}
@@ -3893,7 +3871,7 @@ Rectangle SplitWindow::GetFadeInRect() const
Rectangle SplitWindow::GetFadeOutRect() const
{
Rectangle aRect;
- ImplGetFadeOutRect( aRect, sal_True );
+ ImplGetFadeOutRect( aRect, TRUE );
return aRect;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 9280bb25b80c..9cfea5de3e34 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
@@ -42,13 +43,13 @@
// =======================================================================
-#define STATUSBAR_OFFSET_X STATUSBAR_OFFSET
-#define STATUSBAR_OFFSET_Y 2
-#define STATUSBAR_OFFSET_TEXTY 3
+#define STATUSBAR_OFFSET_X STATUSBAR_OFFSET
+#define STATUSBAR_OFFSET_Y 2
+#define STATUSBAR_OFFSET_TEXTY 3
-#define STATUSBAR_PRGS_OFFSET 3
-#define STATUSBAR_PRGS_COUNT 100
-#define STATUSBAR_PRGS_MIN 5
+#define STATUSBAR_PRGS_OFFSET 3
+#define STATUSBAR_PRGS_COUNT 100
+#define STATUSBAR_PRGS_MIN 5
// -----------------------------------------------------------------------
@@ -58,7 +59,7 @@ public:
ImplData();
~ImplData();
- VirtualDevice* mpVirDev;
+ VirtualDevice* mpVirDev;
long mnItemBorderWidth;
bool mbTopBorder:1;
bool mbDrawItemFrames:1;
@@ -78,25 +79,27 @@ StatusBar::ImplData::~ImplData()
struct ImplStatusItem
{
- sal_uInt16 mnId;
- StatusBarItemBits mnBits;
- long mnWidth;
- long mnOffset;
- long mnExtraWidth;
- long mnX;
- XubString maText;
- XubString maHelpText;
- XubString maQuickHelpText;
- rtl::OString maHelpId;
- void* mpUserData;
- sal_Bool mbVisible;
- XubString maAccessibleName;
+ USHORT mnId;
+ StatusBarItemBits mnBits;
+ long mnWidth;
+ long mnOffset;
+ long mnExtraWidth;
+ long mnX;
+ XubString maText;
+ XubString maHelpText;
+ XubString maQuickHelpText;
+ ULONG mnHelpId;
+ void* mpUserData;
+ BOOL mbVisible;
+ XubString maAccessibleName;
XubString maCommand;
};
+DECLARE_LIST( ImplStatusItemList, ImplStatusItem* )
+
// =======================================================================
-inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize )
+inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
{
return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2));
}
@@ -104,7 +107,7 @@ inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize )
// -----------------------------------------------------------------------
static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
long nX;
long nY;
@@ -124,12 +127,12 @@ static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
// -----------------------------------------------------------------------
-sal_Bool StatusBar::ImplIsItemUpdate()
+BOOL StatusBar::ImplIsItemUpdate()
{
if ( !mbProgressMode && mbVisibleItems && IsReallyVisible() && IsUpdateMode() )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -145,22 +148,22 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle )
Window::ImplInit( pParent, nStyle & ~WB_BORDER, NULL );
// WinBits merken
- mpItemList = new ImplStatusItemList;
- mpImplData->mpVirDev = new VirtualDevice( *this );
- mnCurItemId = 0;
- mbFormat = sal_True;
- mbVisibleItems = sal_True;
- mbProgressMode = sal_False;
- mbInUserDraw = sal_False;
- mbBottomBorder = sal_False;
+ mpItemList = new ImplStatusItemList;
+ mpImplData->mpVirDev = new VirtualDevice( *this );
+ mnCurItemId = 0;
+ mbFormat = TRUE;
+ mbVisibleItems = TRUE;
+ mbProgressMode = FALSE;
+ mbInUserDraw = FALSE;
+ mbBottomBorder = FALSE;
mnItemsWidth = STATUSBAR_OFFSET_X;
- mnDX = 0;
- mnDY = 0;
- mnCalcHeight = 0;
- mnItemY = STATUSBAR_OFFSET_Y;
- mnTextY = STATUSBAR_OFFSET_TEXTY;
+ mnDX = 0;
+ mnDY = 0;
+ mnCalcHeight = 0;
+ mnItemY = STATUSBAR_OFFSET_Y;
+ mnTextY = STATUSBAR_OFFSET_TEXTY;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
SetLineColor();
SetOutputSizePixel( CalcWindowSizePixel() );
@@ -193,20 +196,25 @@ StatusBar::StatusBar( Window* pParent, const ResId& rResId ) :
StatusBar::~StatusBar()
{
// Alle Items loeschen
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
+ ImplStatusItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
}
+
delete mpItemList;
// VirtualDevice loeschen
delete mpImplData->mpVirDev;
+
delete mpImplData;
}
// -----------------------------------------------------------------------
-void StatusBar::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void StatusBar::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -247,13 +255,13 @@ void StatusBar::ImplInitSettings( sal_Bool bFont,
aColor = rStyleSettings.GetWindowColor();
SetBackground( aColor );
mpImplData->mpVirDev->SetBackground( GetBackground() );
-
+
// NWF background
if( ! IsControlBackground() &&
IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) )
{
ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW;
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
}
}
}
@@ -263,34 +271,36 @@ void StatusBar::ImplInitSettings( sal_Bool bFont,
void StatusBar::ImplFormat()
{
ImplStatusItem* pItem;
- long nExtraWidth;
- long nExtraWidth2;
- long nX;
- sal_uInt16 nAutoSizeItems = 0;
+ long nExtraWidth;
+ long nExtraWidth2;
+ long nX;
+ USHORT nAutoSizeItems = 0;
// Breiten zusammenrechnen
mnItemsWidth = STATUSBAR_OFFSET_X;
long nOffset = 0;
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- pItem = (*mpItemList)[ i ];
+ pItem = mpItemList->First();
+ while ( pItem )
+ {
if ( pItem->mbVisible )
{
- if ( pItem->mnBits & SIB_AUTOSIZE ) {
+ if ( pItem->mnBits & SIB_AUTOSIZE )
nAutoSizeItems++;
- }
mnItemsWidth += pItem->mnWidth + nOffset;
nOffset = pItem->mnOffset;
}
+
+ pItem = mpItemList->Next();
}
if ( GetStyle() & WB_RIGHT )
{
// Bei rechtsbuendiger Ausrichtung wird kein AutoSize ausgewertet,
// da wir links den Text anzeigen, der mit SetText gesetzt wird
- nX = mnDX - mnItemsWidth;
- nExtraWidth = 0;
- nExtraWidth2 = 0;
+ nX = mnDX - mnItemsWidth;
+ nExtraWidth = 0;
+ nExtraWidth2 = 0;
}
else
{
@@ -309,38 +319,42 @@ 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 ) {
- pItem = (*mpItemList)[ i ];
- if ( pItem->mbVisible ) {
- if ( pItem->mnBits & SIB_AUTOSIZE ) {
+ pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mbVisible )
+ {
+ if ( pItem->mnBits & SIB_AUTOSIZE )
+ {
pItem->mnExtraWidth = nExtraWidth;
- if ( nExtraWidth2 ) {
+ if ( nExtraWidth2 )
+ {
pItem->mnExtraWidth++;
nExtraWidth2--;
}
- } else {
- pItem->mnExtraWidth = 0;
}
+ else
+ pItem->mnExtraWidth = 0;
pItem->mnX = nX;
nX += pItem->mnWidth + pItem->mnExtraWidth + pItem->mnOffset;
}
+
+ pItem = mpItemList->Next();
}
- mbFormat = sal_False;
+ mbFormat = FALSE;
}
// -----------------------------------------------------------------------
-Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
+Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
{
- Rectangle aRect;
+ Rectangle aRect;
ImplStatusItem* pItem;
- pItem = ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL;
+ pItem = mpItemList->GetObject( nPos );
if ( pItem )
{
if ( pItem->mbVisible )
@@ -359,26 +373,26 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
+USHORT StatusBar::ImplGetFirstVisiblePos() const
{
ImplStatusItem* pItem;
-
- for( size_t nPos = 0; nPos < mpItemList->size(); nPos++ )
+
+ for( USHORT nPos = 0; nPos < mpItemList->Count(); nPos++ )
{
- pItem = (*mpItemList)[ nPos ];
+ pItem = mpItemList->GetObject( nPos );
if ( pItem )
{
if ( pItem->mbVisible )
- return sal_uInt16(nPos);
+ return nPos;
}
}
-
+
return ~0;
}
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
+void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
{
// Das ueberschreiben der Item-Box verhindern
Rectangle aTextRect;
@@ -392,7 +406,7 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
{
// Position ermitteln
XubString aStr = GetText();
- sal_uInt16 nPos = aStr.Search( _LF );
+ USHORT nPos = aStr.Search( _LF );
if ( nPos != STRING_NOTFOUND )
aStr.Erase( nPos );
@@ -415,7 +429,7 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame )
+void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame )
{
Rectangle aRect = ImplGetItemRectPos( nPos );
@@ -423,11 +437,11 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
return;
// Ausgabebereich berechnen
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
long nW = mpImplData->mnItemBorderWidth + 1;
- Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
+ Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
aRect.Right()-nW, aRect.Bottom()-nW );
- Size aTextRectSize( aTextRect.GetSize() );
+ Size aTextRectSize( aTextRect.GetSize() );
if ( bOffScreen )
mpImplData->mpVirDev->SetOutputSizePixel( aTextRectSize );
@@ -440,8 +454,8 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
// Text ausgeben
if ( bDrawText )
{
- Size aTextSize( GetTextWidth( pItem->maText ), GetTextHeight() );
- Point aTextPos = ImplGetItemTextPos( aTextRectSize, aTextSize, pItem->mnBits );
+ Size aTextSize( GetTextWidth( pItem->maText ), GetTextHeight() );
+ Point aTextPos = ImplGetItemTextPos( aTextRectSize, aTextSize, pItem->mnBits );
if ( bOffScreen )
mpImplData->mpVirDev->DrawText( aTextPos, pItem->maText );
else
@@ -457,12 +471,12 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
{
if ( bOffScreen )
{
- mbInUserDraw = sal_True;
+ mbInUserDraw = TRUE;
mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() );
UserDrawEvent aODEvt( mpImplData->mpVirDev, Rectangle( Point(), aTextRectSize ), pItem->mnId );
UserDraw( aODEvt );
- mpImplData->mpVirDev->EnableRTL( sal_False );
- mbInUserDraw = sal_False;
+ mpImplData->mpVirDev->EnableRTL( FALSE );
+ mbInUserDraw = FALSE;
}
else
{
@@ -483,13 +497,13 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
{
if( !(pItem->mnBits & SIB_FLAT) )
{
- sal_uInt16 nStyle;
-
+ USHORT nStyle;
+
if ( pItem->mnBits & SIB_IN )
nStyle = FRAME_DRAW_IN;
else
nStyle = FRAME_DRAW_OUT;
-
+
DecorationView aDecoView( this );
aDecoView.DrawFrame( aRect, nStyle );
}
@@ -517,14 +531,14 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
void DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
+ USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
const Rectangle& rFramePosSize
)
{
if( pWindow->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
bool bNeedErase = ImplGetSVData()->maNWFData.mbProgressNeedsErase;
-
+
long nFullWidth = (nPrgsWidth + nOffset) * (10000 / nPercentCount);
long nPerc = (nPercent2 > 10000) ? 10000 : nPercent2;
ImplControlValue aValue( nFullWidth * (long)nPerc / 10000 );
@@ -555,7 +569,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
pWindow->Push( PUSH_CLIPREGION );
pWindow->IntersectClipRegion( rFramePosSize );
}
- sal_Bool bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ BOOL bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString() );
if( bNeedErase )
pWindow->Pop();
@@ -565,19 +579,19 @@ void DrawProgress( Window* pWindow, const Point& rPos,
return;
}
}
-
+
// Werte vorberechnen
- sal_uInt16 nPerc1 = nPercent1 / nPercentCount;
- sal_uInt16 nPerc2 = nPercent2 / nPercentCount;
+ USHORT nPerc1 = nPercent1 / nPercentCount;
+ USHORT nPerc2 = nPercent2 / nPercentCount;
if ( nPerc1 > nPerc2 )
{
// Support progress that can also decrease
-
+
// Rechteck berechnen
- long nDX = nPrgsWidth + nOffset;
- long nLeft = rPos.X()+((nPerc1-1)*nDX);
- Rectangle aRect( nLeft, rPos.Y(), nLeft+nPrgsWidth, rPos.Y()+nPrgsHeight );
+ long nDX = nPrgsWidth + nOffset;
+ long nLeft = rPos.X()+((nPerc1-1)*nDX);
+ Rectangle aRect( nLeft, rPos.Y(), nLeft+nPrgsWidth, rPos.Y()+nPrgsHeight );
do
{
@@ -589,7 +603,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
while ( nPerc1 > nPerc2 );
pWindow->Flush();
- }
+ }
else if ( nPerc1 < nPerc2 )
{
// Percent-Rechtecke malen
@@ -602,9 +616,9 @@ void DrawProgress( Window* pWindow, const Point& rPos,
}
// Rechteck berechnen
- long nDX = nPrgsWidth + nOffset;
- long nLeft = rPos.X()+(nPerc1*nDX);
- Rectangle aRect( nLeft, rPos.Y(), nLeft+nPrgsWidth, rPos.Y()+nPrgsHeight );
+ long nDX = nPrgsWidth + nOffset;
+ long nLeft = rPos.X()+(nPerc1*nDX);
+ Rectangle aRect( nLeft, rPos.Y(), nLeft+nPrgsWidth, rPos.Y()+nPrgsHeight );
do
{
@@ -633,8 +647,8 @@ void DrawProgress( Window* pWindow, const Point& rPos,
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawProgress( sal_Bool bPaint,
- sal_uInt16 nPercent1, sal_uInt16 nPercent2 )
+void StatusBar::ImplDrawProgress( BOOL bPaint,
+ USHORT nPercent1, USHORT nPercent2 )
{
bool bNative = IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL );
// bPaint: draw text also, else only update progress
@@ -666,18 +680,18 @@ void StatusBar::ImplCalcProgressRect()
{
// calculate text size
Size aPrgsTxtSize( GetTextWidth( maPrgsTxt ), GetTextHeight() );
- maPrgsTxtPos.X() = STATUSBAR_OFFSET_X+1;
-
+ maPrgsTxtPos.X() = STATUSBAR_OFFSET_X+1;
+
// calculate progress frame
- maPrgsFrameRect.Left() = maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET;
- maPrgsFrameRect.Top() = mnItemY;
- maPrgsFrameRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y;
+ maPrgsFrameRect.Left() = maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET;
+ maPrgsFrameRect.Top() = mnItemY;
+ maPrgsFrameRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y;
if( IsTopBorder() )
maPrgsFrameRect.Bottom()+=2;
// calculate size of progress rects
mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2);
- sal_uInt16 nMaxPercent = STATUSBAR_PRGS_COUNT;
+ USHORT nMaxPercent = STATUSBAR_PRGS_COUNT;
long nMaxWidth = mnDX-STATUSBAR_OFFSET-1;
@@ -692,7 +706,7 @@ void StatusBar::ImplCalcProgressRect()
// save the divisor for later
mnPercentCount = 10000 / nMaxPercent;
- sal_Bool bNativeOK = sal_False;
+ BOOL bNativeOK = FALSE;
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
@@ -700,7 +714,7 @@ void StatusBar::ImplCalcProgressRect()
Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != sal_False )
+ aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
{
long nProgressHeight = aNativeControlRegion.GetHeight();
if( nProgressHeight > maPrgsFrameRect.GetHeight() )
@@ -713,7 +727,7 @@ void StatusBar::ImplCalcProgressRect()
}
}
if( ! bNativeOK )
- maPrgsTxtPos.Y() = mnTextY;
+ maPrgsTxtPos.Y() = mnTextY;
}
// -----------------------------------------------------------------------
@@ -726,13 +740,14 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbVisibleItems )
{
Point aMousePos = rMEvt.GetPosPixel();
+ USHORT i = 0;
// Item suchen, das geklickt wurde
- for ( size_t i = 0; i < mpItemList->size(); ++i )
+ ImplStatusItem* pItem = mpItemList->First();
+ while ( pItem )
{
- ImplStatusItem* pItem = (*mpItemList)[ i ];
// Ist es dieses Item
- if ( ImplGetItemRectPos( sal_uInt16(i) ).IsInside( aMousePos ) )
+ if ( ImplGetItemRectPos( i ).IsInside( aMousePos ) )
{
mnCurItemId = pItem->mnId;
if ( rMEvt.GetClicks() == 2 )
@@ -744,6 +759,9 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
// Item wurde gefunden
return;
}
+
+ i++;
+ pItem = mpItemList->Next();
}
}
@@ -762,22 +780,22 @@ void StatusBar::Paint( const Rectangle& )
if ( mbFormat )
ImplFormat();
- sal_uInt16 nItemCount = sal_uInt16( mpItemList->size() );
+ USHORT nItemCount = (USHORT)mpItemList->Count();
if ( mbProgressMode )
- ImplDrawProgress( sal_True, 0, mnPercent );
+ ImplDrawProgress( TRUE, 0, mnPercent );
else
{
// Text zeichen
if ( !mbVisibleItems || (GetStyle() & WB_RIGHT) )
- ImplDrawText( sal_False, 0 );
+ ImplDrawText( FALSE, 0 );
// Items zeichnen
if ( mbVisibleItems )
{
// Items zeichnen
- for ( sal_uInt16 i = 0; i < nItemCount; i++ )
- ImplDrawItem( sal_False, i, sal_True, sal_True );
+ for ( USHORT i = 0; i < nItemCount; i++ )
+ ImplDrawItem( FALSE, i, TRUE, TRUE );
}
}
@@ -814,7 +832,7 @@ void StatusBar::Resize()
{
// Breite und Hoehe abfragen und merken
Size aSize = GetOutputSizePixel();
- mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
+ mnDX = aSize.Width();
mnDY = aSize.Height();
mnCalcHeight = mnDY;
// subtract border
@@ -831,7 +849,7 @@ void StatusBar::Resize()
mnTextY += 2;
// Formatierung neu ausloesen
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( mbProgressMode )
ImplCalcProgressRect();
@@ -847,7 +865,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
if( rHEvt.KeyboardActivated() )
return;
- sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -867,7 +885,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
- XubString aStr = GetQuickHelpText( nItemId );
+ XubString aStr = GetQuickHelpText( nItemId );
// Show quickhelp if available
if( aStr.Len() )
{
@@ -885,9 +903,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- rtl::OString aHelpId( GetHelpId( nItemId ) );
+ ULONG nHelpId = GetHelpId( nItemId );
- if ( aCommand.Len() || aHelpId.getLength() )
+ if ( aCommand.Len() || nHelpId )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -895,8 +913,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( aHelpId.getLength() )
- pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
+ else if ( nHelpId )
+ pHelp->Start( nHelpId, this );
}
return;
}
@@ -919,18 +937,18 @@ void StatusBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbFormat = sal_True;
- ImplInitSettings( sal_True, sal_False, sal_False );
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( FALSE, FALSE, TRUE );
Invalidate();
}
}
@@ -941,23 +959,22 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY )
- || (rDCEvt.GetType() == DATACHANGED_FONTS )
- || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION)
- || ( (rDCEvt.GetType() == DATACHANGED_SETTINGS)
- && (rDCEvt.GetFlags() & SETTINGS_STYLE )
- )
- )
+ if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = sal_True;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplStatusItem* pItem = mpItemList->First();
long nFudge = GetTextHeight() / 4;
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
+ while ( pItem )
{
- ImplStatusItem* pItem = (*mpItemList)[ i ];
long nWidth = GetTextWidth( pItem->maText ) + nFudge;
if( nWidth > pItem->mnWidth + STATUSBAR_OFFSET )
pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
+ pItem = mpItemList->Next();
}
Size aSize = GetSizePixel();
// do not disturb current width, since
@@ -992,9 +1009,9 @@ void StatusBar::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
+void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
StatusBarItemBits nBits,
- long nOffset, sal_uInt16 nPos )
+ long nOffset, USHORT nPos )
{
DBG_ASSERT( nItemId, "StatusBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == STATUSBAR_ITEM_NOTFOUND,
@@ -1008,22 +1025,19 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
// Item anlegen
long nFudge = GetTextHeight()/4;
- ImplStatusItem* pItem = new ImplStatusItem;
- pItem->mnId = nItemId;
- pItem->mnBits = nBits;
- pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
- pItem->mnOffset = nOffset;
- pItem->mpUserData = 0;
- pItem->mbVisible = sal_True;
+ ImplStatusItem* pItem = new ImplStatusItem;
+ pItem->mnId = nItemId;
+ pItem->mnBits = nBits;
+ pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
+ pItem->mnOffset = nOffset;
+ pItem->mnHelpId = 0;
+ pItem->mpUserData = 0;
+ pItem->mbVisible = TRUE;
// Item in die Liste einfuegen
- if ( nPos < mpItemList->size() ) {
- mpItemList->insert( mpItemList->begin() + nPos, pItem );
- } else {
- mpItemList->push_back( pItem );
- }
+ mpItemList->Insert( pItem, nPos );
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1032,15 +1046,15 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
// -----------------------------------------------------------------------
-void StatusBar::RemoveItem( sal_uInt16 nItemId )
+void StatusBar::RemoveItem( USHORT nItemId )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- delete (*mpItemList)[ nPos ];
- mpItemList->erase( mpItemList->begin() + nPos );
+ ImplStatusItem* pItem = mpItemList->Remove( nPos );
+ delete pItem;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1050,18 +1064,18 @@ void StatusBar::RemoveItem( sal_uInt16 nItemId )
// -----------------------------------------------------------------------
-void StatusBar::ShowItem( sal_uInt16 nItemId )
+void StatusBar::ShowItem( USHORT nItemId )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
if ( !pItem->mbVisible )
{
- pItem->mbVisible = sal_True;
+ pItem->mbVisible = TRUE;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1072,18 +1086,18 @@ void StatusBar::ShowItem( sal_uInt16 nItemId )
// -----------------------------------------------------------------------
-void StatusBar::HideItem( sal_uInt16 nItemId )
+void StatusBar::HideItem( USHORT nItemId )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
if ( pItem->mbVisible )
{
- pItem->mbVisible = sal_False;
+ pItem->mbVisible = FALSE;
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1094,14 +1108,14 @@ void StatusBar::HideItem( sal_uInt16 nItemId )
// -----------------------------------------------------------------------
-sal_Bool StatusBar::IsItemVisible( sal_uInt16 nItemId ) const
+BOOL StatusBar::IsItemVisible( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mbVisible;
+ return mpItemList->GetObject( nPos )->mbVisible;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1110,7 +1124,7 @@ void StatusBar::ShowItems()
{
if ( !mbVisibleItems )
{
- mbVisibleItems = sal_True;
+ mbVisibleItems = TRUE;
if ( !mbProgressMode )
Invalidate();
@@ -1124,7 +1138,7 @@ void StatusBar::HideItems()
{
if ( mbVisibleItems )
{
- mbVisibleItems = sal_False;
+ mbVisibleItems = FALSE;
if ( !mbProgressMode )
Invalidate();
@@ -1137,17 +1151,27 @@ void StatusBar::HideItems()
void StatusBar::CopyItems( const StatusBar& rStatusBar )
{
// Alle Items entfernen
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
+ ImplStatusItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
}
- mpItemList->clear();
+
+ // Items aus der Liste loeschen
+ mpItemList->Clear();
// Items kopieren
- for ( size_t i = 0, n = rStatusBar.mpItemList->size(); i < n; ++i ) {
- mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) );
+ ULONG i = 0;
+ pItem = rStatusBar.mpItemList->GetObject( i );
+ while ( pItem )
+ {
+ mpItemList->Insert( new ImplStatusItem( *pItem ), LIST_APPEND );
+ i++;
+ pItem = rStatusBar.mpItemList->GetObject( i );
}
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
}
@@ -1157,12 +1181,17 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar )
void StatusBar::Clear()
{
// Alle Item loeschen
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- delete (*mpItemList)[ i ];
+ ImplStatusItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
}
- mpItemList->clear();
- mbFormat = sal_True;
+ // Items aus der Liste loeschen
+ mpItemList->Clear();
+
+ mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1171,28 +1200,33 @@ void StatusBar::Clear()
// -----------------------------------------------------------------------
-sal_uInt16 StatusBar::GetItemCount() const
+USHORT StatusBar::GetItemCount() const
{
- return (sal_uInt16)mpItemList->size();
+ return (USHORT)mpItemList->Count();
}
// -----------------------------------------------------------------------
-sal_uInt16 StatusBar::GetItemId( sal_uInt16 nPos ) const
+USHORT StatusBar::GetItemId( USHORT nPos ) const
{
- if ( nPos < mpItemList->size() )
- return (*mpItemList)[ nPos ]->mnId;
- return 0;
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem )
+ return pItem->mnId;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
-sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const
+USHORT StatusBar::GetItemPos( USHORT nItemId ) const
{
- for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
- if ( (*mpItemList)[ i ]->mnId == nItemId ) {
- return sal_uInt16( i );
- }
+ ImplStatusItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mnId == nItemId )
+ return (USHORT)mpItemList->GetCurPos();
+
+ pItem = mpItemList->Next();
}
return STATUSBAR_ITEM_NOTFOUND;
@@ -1200,18 +1234,18 @@ sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const
+USHORT StatusBar::GetItemId( const Point& rPos ) const
{
if ( AreItemsVisible() && !mbFormat )
{
- sal_uInt16 nItemCount = GetItemCount();
- sal_uInt16 nPos;
+ USHORT nItemCount = GetItemCount();
+ USHORT nPos;
for ( nPos = 0; nPos < nItemCount; nPos++ )
{
// Rechteck holen
Rectangle aRect = ImplGetItemRectPos( nPos );
if ( aRect.IsInside( rPos ) )
- return (*mpItemList)[ nPos ]->mnId;
+ return mpItemList->GetObject( nPos )->mnId;
}
}
@@ -1220,13 +1254,13 @@ sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const
+Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
{
Rectangle aRect;
if ( AreItemsVisible() && !mbFormat )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen und Rahmen abziehen
@@ -1245,18 +1279,18 @@ Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const
+Point StatusBar::GetItemTextPos( USHORT nItemId ) const
{
if ( !mbFormat )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
Rectangle aRect = ImplGetItemRectPos( nPos );
long nW = mpImplData->mnItemBorderWidth + 1;
- Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
+ Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
aRect.Right()-nW, aRect.Bottom()-nW );
Point aPos = ImplGetItemTextPos( aTextRect.GetSize(),
Size( GetTextWidth( pItem->maText ), GetTextHeight() ),
@@ -1275,49 +1309,49 @@ Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-sal_uLong StatusBar::GetItemWidth( sal_uInt16 nItemId ) const
+ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnWidth;
-
- return 0;
+ return mpItemList->GetObject( nPos )->mnWidth;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
-StatusBarItemBits StatusBar::GetItemBits( sal_uInt16 nItemId ) const
+StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnBits;
-
- return 0;
+ return mpItemList->GetObject( nPos )->mnBits;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
-long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const
+long StatusBar::GetItemOffset( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnOffset;
-
- return 0;
+ return mpItemList->GetObject( nPos )->mnOffset;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
-void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
+void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
if ( pItem->maText != rText )
{
@@ -1326,7 +1360,7 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
// adjust item width - see also DataChanged()
long nFudge = GetTextHeight()/4;
long nWidth = GetTextWidth( pItem->maText ) + nFudge;
- if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
+ if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth ))
{
pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
@@ -1339,7 +1373,7 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
if ( pItem->mbVisible && !mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( sal_True, nPos, sal_True, sal_False );
+ ImplDrawItem( TRUE, nPos, TRUE, FALSE );
Flush();
}
}
@@ -1348,25 +1382,25 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const
+const XubString& StatusBar::GetItemText( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->maText;
-
- return ImplGetSVEmptyStr();
+ return mpItemList->GetObject( nPos )->maText;
+ else
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
-void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
+void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
if ( pItem->maCommand != rCommand )
pItem->maCommand = rCommand;
@@ -1375,25 +1409,25 @@ void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemCommand( sal_uInt16 nItemId )
+const XubString& StatusBar::GetItemCommand( USHORT nItemId )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->maCommand;
-
- return ImplGetSVEmptyStr();
+ return mpItemList->GetObject( nPos )->maCommand;
+ else
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
-void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
+void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
pItem->mpUserData = pNewData;
// Wenn es ein User-Item ist, DrawItem-Aufrufen
@@ -1401,7 +1435,7 @@ void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
!mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( sal_True, nPos, sal_False, sal_False );
+ ImplDrawItem( TRUE, nPos, FALSE, FALSE );
Flush();
}
}
@@ -1409,44 +1443,44 @@ void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* StatusBar::GetItemData( sal_uInt16 nItemId ) const
+void* StatusBar::GetItemData( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mpUserData;
-
- return NULL;
+ return mpItemList->GetObject( nPos )->mpUserData;
+ else
+ return NULL;
}
// -----------------------------------------------------------------------
-void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
+void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->maHelpText = rText;
+ mpItemList->GetObject( nPos )->maHelpText = rText;
}
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
+const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || 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->maHelpId.getLength() )
- pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
+ if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
}
}
@@ -1458,56 +1492,49 @@ const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
+void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->maQuickHelpText = rText;
+ mpItemList->GetObject( nPos )->maQuickHelpText = rText;
}
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const
+const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
return pItem->maQuickHelpText;
}
-
- return ImplGetSVEmptyStr();
+ else
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
+void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->maHelpId = rHelpId;
+ mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
}
// -----------------------------------------------------------------------
-rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
+ULONG StatusBar::GetHelpId( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
- rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- {
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( pItem->maHelpId.getLength() )
- aRet = pItem->maHelpId;
- else
- aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
- }
-
- return aRet;
+ return mpItemList->GetObject( nPos )->mnHelpId;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1524,11 +1551,11 @@ void StatusBar::ImplCalcBorder( )
}
if ( IsBottomBorder() )
mnCalcHeight -= 2;
- mbFormat = sal_True;
+ mbFormat = TRUE;
Invalidate();
}
-void StatusBar::SetBottomBorder( sal_Bool bBottomBorder )
+void StatusBar::SetBottomBorder( BOOL bBottomBorder )
{
if ( mbBottomBorder != bBottomBorder )
{
@@ -1537,7 +1564,7 @@ void StatusBar::SetBottomBorder( sal_Bool bBottomBorder )
}
}
-void StatusBar::SetTopBorder( sal_Bool bTopBorder )
+void StatusBar::SetTopBorder( BOOL bTopBorder )
{
if ( mpImplData->mbTopBorder != static_cast<bool>(bTopBorder) )
{
@@ -1546,7 +1573,7 @@ void StatusBar::SetTopBorder( sal_Bool bTopBorder )
}
}
-sal_Bool StatusBar::IsTopBorder() const
+BOOL StatusBar::IsTopBorder() const
{
return mpImplData->mbTopBorder;
}
@@ -1557,9 +1584,9 @@ void StatusBar::StartProgressMode( const XubString& rText )
{
DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" );
- mbProgressMode = sal_True;
- mnPercent = 0;
- maPrgsTxt = rText;
+ mbProgressMode = TRUE;
+ mnPercent = 0;
+ maPrgsTxt = rText;
// Groessen berechnen
ImplCalcProgressRect();
@@ -1581,7 +1608,7 @@ void StatusBar::StartProgressMode( const XubString& rText )
// -----------------------------------------------------------------------
-void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
+void StatusBar::SetProgressValue( USHORT nNewPercent )
{
DBG_ASSERT( mbProgressMode, "StatusBar::SetProgressValue(): no progrss mode" );
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
@@ -1592,7 +1619,7 @@ void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
{
Update();
SetLineColor();
- ImplDrawProgress( sal_False, mnPercent, nNewPercent );
+ ImplDrawProgress( FALSE, mnPercent, nNewPercent );
Flush();
}
mnPercent = nNewPercent;
@@ -1604,7 +1631,7 @@ void StatusBar::EndProgressMode()
{
DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" );
- mbProgressMode = sal_False;
+ mbProgressMode = FALSE;
maPrgsTxt.Erase();
// Paint neu ausloesen um StatusBar wieder herzustellen
@@ -1623,7 +1650,7 @@ void StatusBar::ResetProgressMode()
{
if ( mbProgressMode )
{
- mnPercent = 0;
+ mnPercent = 0;
maPrgsTxt.Erase();
if ( IsReallyVisible() )
{
@@ -1651,7 +1678,7 @@ void StatusBar::SetText( const XubString& rText )
Update();
long nOldTextWidth = GetTextWidth( GetText() );
Window::SetText( rText );
- ImplDrawText( sal_True, nOldTextWidth );
+ ImplDrawText( TRUE, nOldTextWidth );
Flush();
}
}
@@ -1673,20 +1700,20 @@ void StatusBar::SetText( const XubString& rText )
Size StatusBar::CalcWindowSizePixel() const
{
- size_t i = 0;
- size_t nCount = mpItemList->size();
- long nOffset = 0;
- long nCalcWidth = (STATUSBAR_OFFSET_X*2);
- long nCalcHeight;
+ ULONG i = 0;
+ ULONG nCount = mpItemList->Count();
+ long nOffset = 0;
+ long nCalcWidth = (STATUSBAR_OFFSET_X*2);
+ long nCalcHeight;
while ( i < nCount )
{
- ImplStatusItem* pItem = (*mpItemList)[ i ];
+ ImplStatusItem* pItem = mpItemList->GetObject( i );
nCalcWidth += pItem->mnWidth + nOffset;
nOffset = pItem->mnOffset;
i++;
}
-
+
long nMinHeight = GetTextHeight();
const long nBarTextOffset = STATUSBAR_OFFSET_TEXTY*2;
long nProgressHeight = nMinHeight + nBarTextOffset;
@@ -1704,14 +1731,14 @@ Size StatusBar::CalcWindowSizePixel() const
nProgressHeight = aNativeControlRegion.GetHeight();
}
}
-
+
if( mpImplData->mbDrawItemFrames &&
pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) )
{
ImplControlValue aControlValue( FRAME_DRAW_NODRAW );
Rectangle aBound, aContent;
Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) );
- if( pThis->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
+ if( pThis->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
mpImplData->mnItemBorderWidth =
@@ -1722,7 +1749,7 @@ Size StatusBar::CalcWindowSizePixel() const
nCalcHeight = nMinHeight+nBarTextOffset + 2*mpImplData->mnItemBorderWidth;
if( nCalcHeight < nProgressHeight+2 )
nCalcHeight = nProgressHeight+2;
-
+
// add border
if( IsTopBorder() )
nCalcHeight += 2;
@@ -1735,13 +1762,13 @@ Size StatusBar::CalcWindowSizePixel() const
// -----------------------------------------------------------------------
-void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
+void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
if ( pItem->maAccessibleName != rName )
{
@@ -1753,14 +1780,14 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const
+const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->maAccessibleName;
-
- return ImplGetSVEmptyStr();
+ return mpItemList->GetObject( nPos )->maAccessibleName;
+ else
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 3ff21826ff0c..0826ce0f2c48 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,38 +30,23 @@
#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/sysdata.hxx>
+#include <vcl/window.h>
#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 */,
- sal_uInt16 nEvent, const void* /* pEvent */ )
+ USHORT nEvent, const void* /* pEvent */ )
{
SystemChildWindow* pWindow = (SystemChildWindow*)pInst;
long nRet = 0;
@@ -73,33 +58,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 = sal_True;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = TRUE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
pWindow->ToTop( TOTOP_NOGRABFOCUS );
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_True;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = TRUE;
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_False;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = FALSE;
break;
case SALOBJ_EVENT_LOSEFOCUS:
// Hintenrum einen LoseFocus ausloesen, das der Status
// der Fenster dem entsprechenden Activate-Status
// entspricht
- pWindow->ImplGetFrameData()->mbSysObjFocus = sal_False;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = FALSE;
if ( !pWindow->ImplGetFrameData()->mnFocusId )
{
- pWindow->ImplGetFrameData()->mbStartFocusState = sal_True;
+ pWindow->ImplGetFrameData()->mbStartFocusState = TRUE;
Application::PostUserEvent( pWindow->ImplGetFrameData()->mnFocusId, LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) );
}
break;
case SALOBJ_EVENT_TOTOP:
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
if ( !Application::GetFocusWindow() || pWindow->HasChildPathFocus() )
pWindow->ToTop( TOTOP_NOGRABFOCUS );
else
@@ -109,7 +94,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
break;
}
@@ -118,7 +103,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// =======================================================================
-void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow )
+void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow )
{
mpWindowImpl->mpSysObj = ImplGetSVData()->mpDefInst->CreateObject( pParent->ImplGetFrame(), pData, bShow );
@@ -143,7 +128,7 @@ SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle ) :
// -----------------------------------------------------------------------
-SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow ) :
+SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow ) :
Window( WINDOW_SYSTEMCHILDWINDOW )
{
ImplInitSysChild( pParent, nStyle, pData, bShow );
@@ -187,163 +172,24 @@ const SystemEnvData* SystemChildWindow::GetSystemData() const
// -----------------------------------------------------------------------
-void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable )
+void SystemChildWindow::EnableEraseBackground( BOOL bEnable )
{
if ( mpWindowImpl->mpSysObj )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
-// -----------------------------------------------------------------------
-
-sal_Bool SystemChildWindow::IsEraseBackgroundEnabled()
+BOOL SystemChildWindow::IsEraseBackgroundEnabled()
{
if ( mpWindowImpl->mpSysObj )
return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled();
else
- return sal_False;
+ return 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>());
- }
-#else
- (void)pEnv;
-#endif // SOLAR_JAVA
-}
-
-void SystemChildWindow::SetForwardKey( sal_Bool bEnable )
-{
- if ( mpWindowImpl->mpSysObj )
- mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
-}
-
-// -----------------------------------------------------------------------
-
-sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
+void SystemChildWindow::SetForwardKey( BOOL 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;
+ if ( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 3343779f632b..dbd52d1a66e7 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -79,16 +79,16 @@ SystemWindow::SystemWindow( WindowType nType ) :
Window( nType )
{
mpImplData = new ImplData;
- mpWindowImpl->mbSysWin = sal_True;
+ mpWindowImpl->mbSysWin = TRUE;
mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
mpMenuBar = NULL;
- mbPined = sal_False;
- mbRollUp = sal_False;
- mbRollFunc = sal_False;
- mbDockBtn = sal_False;
- mbHideBtn = sal_False;
- mbSysChild = sal_False;
+ mbPined = FALSE;
+ mbRollUp = FALSE;
+ mbRollFunc = FALSE;
+ mbDockBtn = FALSE;
+ mbHideBtn = FALSE;
+ mbSysChild = 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(), sal_False ) )
- return sal_True;
+ if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), FALSE ) )
+ return TRUE;
}
return Window::Notify( rNEvt );
@@ -133,7 +133,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
{
// Ctrl-F6 goes directly to the document
GrabFocusToDocument();
- return sal_True;
+ return TRUE;
}
else
{
@@ -158,7 +158,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
pTList = pSysWin->mpImplData->mpTaskPaneList;
}
if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
- return sal_True;
+ return TRUE;
}
}
return Window::PreNotify( rNEvt );
@@ -188,17 +188,17 @@ TaskPaneList* SystemWindow::GetTaskPaneList()
// -----------------------------------------------------------------------
-sal_Bool SystemWindow::Close()
+BOOL SystemWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return sal_False;
+ return FALSE;
// Is Window not closeable, ignore close
Window* pBorderWin = ImplGetBorderWindow();
@@ -210,17 +210,17 @@ sal_Bool SystemWindow::Close()
if ( !(nStyle & WB_CLOSEABLE) )
{
Sound::Beep( SOUND_DISABLE, this );
- return sal_False;
+ return FALSE;
}
Hide();
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
-void SystemWindow::TitleButtonClick( sal_uInt16 )
+void SystemWindow::TitleButtonClick( USHORT )
{
}
@@ -244,14 +244,14 @@ void SystemWindow::Resizing( Size& )
// -----------------------------------------------------------------------
-void SystemWindow::SetZLevel( sal_uInt8 nLevel )
+void SystemWindow::SetZLevel( BYTE nLevel )
{
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame )
{
- sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
+ BYTE 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( sal_uInt16 nIcon )
+void SystemWindow::SetIcon( USHORT nIcon )
{
if ( mnIcon == nIcon )
return;
@@ -317,7 +317,7 @@ void SystemWindow::SetIcon( sal_uInt16 nIcon )
// -----------------------------------------------------------------------
-sal_uInt8 SystemWindow::GetZLevel() const
+BYTE SystemWindow::GetZLevel() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -325,16 +325,16 @@ sal_uInt8 SystemWindow::GetZLevel() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void SystemWindow::EnableSaveBackground( sal_Bool bSave )
+void SystemWindow::EnableSaveBackground( BOOL bSave )
{
if( ImplGetSVData()->maWinData.mbNoSaveBackground )
bSave = false;
-
+
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
@@ -348,7 +348,7 @@ void SystemWindow::EnableSaveBackground( sal_Bool bSave )
// -----------------------------------------------------------------------
-sal_Bool SystemWindow::IsSaveBackgroundEnabled() const
+BOOL SystemWindow::IsSaveBackgroundEnabled() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -356,12 +356,12 @@ sal_Bool SystemWindow::IsSaveBackgroundEnabled() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mbSaveBack;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void SystemWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
+void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
{
if ( nButton == TITLE_BUTTON_DOCKING )
{
@@ -392,7 +392,7 @@ void SystemWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
// -----------------------------------------------------------------------
-sal_Bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
+BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const
{
if ( nButton == TITLE_BUTTON_DOCKING )
return mbDockBtn;
@@ -402,7 +402,7 @@ sal_Bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
// -----------------------------------------------------------------------
-void SystemWindow::SetPin( sal_Bool bPin )
+void SystemWindow::SetPin( BOOL bPin )
{
if ( bPin != mbPined )
{
@@ -419,16 +419,16 @@ void SystemWindow::RollUp()
if ( !mbRollUp )
{
maOrgSize = GetOutputSizePixel();
- mbRollFunc = sal_True;
+ mbRollFunc = TRUE;
Size aSize = maRollUpOutSize;
if ( !aSize.Width() )
aSize.Width() = GetOutputSizePixel().Width();
- mbRollUp = sal_True;
+ mbRollUp = TRUE;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_True, aSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( TRUE, aSize );
else
SetOutputSizePixel( aSize );
- mbRollFunc = sal_False;
+ mbRollFunc = FALSE;
}
}
@@ -438,9 +438,9 @@ void SystemWindow::RollDown()
{
if ( mbRollUp )
{
- mbRollUp = sal_False;
+ mbRollUp = FALSE;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_False, maOrgSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( FALSE, maOrgSize );
else
SetOutputSizePixel( maOrgSize );
}
@@ -502,7 +502,7 @@ Size SystemWindow::GetResizeOutputSizePixel() const
static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr )
{
- sal_uLong nValidMask = 0;
+ ULONG nValidMask = 0;
xub_StrLen nIndex = 0;
ByteString aTokenStr;
@@ -555,14 +555,14 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- sal_uLong nState = (sal_uLong)aTokenStr.ToInt32();
+ ULONG nState = (ULONG)aTokenStr.ToInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
nValidMask |= WINDOWSTATE_MASK_STATE;
}
else
rData.SetState( 0 );
-
+
// read maximized pos/size
aTokenStr = rStr.GetToken( 0, ',', nIndex );
if ( aTokenStr.Len() )
@@ -617,7 +617,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr )
{
- sal_uLong nValidMask = rData.GetMask();
+ 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
- sal_uLong nState = rData.GetState();
+ ULONG nState = rData.GetState();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rStr.Append( ByteString::CreateFromInt32( (long)nState ) );
}
@@ -676,7 +676,7 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo
i_nWidth = 50;
if( i_nHeight < 1 )
i_nHeight = 50;
-
+
// check left border
bool bMove = false;
if( io_rX + i_nWidth < aScreenRect.Left() )
@@ -717,7 +717,7 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo
void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
- sal_uLong nValidMask = rData.GetMask();
+ ULONG nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -730,7 +730,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if ( pWindow->mpWindowImpl->mbFrame )
{
- sal_uLong nState = rData.GetState();
+ ULONG nState = rData.GetState();
SalFrameState aState;
aState.mnMask = rData.GetMask();
aState.mnX = rData.GetX();
@@ -756,7 +756,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// 91625 - ignore Minimize
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
aState.mnState = nState & SAL_FRAMESTATE_SYSTEMMASK;
-
+
// normalize window positions onto screen
ImplMoveToScreen( aState.mnX, aState.mnY, aState.mnWidth, aState.mnHeight, pWindow );
ImplMoveToScreen( aState.mnMaximizedX, aState.mnMaximizedY, aState.mnMaximizedWidth, aState.mnMaximizedHeight, pWindow );
@@ -769,7 +769,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
Window *pWin = pSVData->maWinData.mpFirstFrame;
- sal_Bool bWrapped = sal_False;
+ BOOL bWrapped = FALSE;
while( pWin )
{
if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
@@ -782,7 +782,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.nRight ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom )
{
- // displacing would leave screen
+ // displacing would leave screen
aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0)
aState.mnY = displacement;
if( bWrapped ||
@@ -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 = sal_True;
+ bWrapped = TRUE;
}
else
{
@@ -827,7 +827,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
}
else
{
- sal_uInt16 nPosSize = 0;
+ USHORT nPosSize = 0;
if ( nValidMask & WINDOWSTATE_MASK_X )
nPosSize |= WINDOW_POSSIZE_X;
if ( nValidMask & WINDOWSTATE_MASK_Y )
@@ -840,10 +840,10 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if( IsRollUp() )
RollDown();
- long nX = rData.GetX();
- long nY = rData.GetY();
- long nWidth = rData.GetWidth();
- long nHeight = rData.GetHeight();
+ long nX = rData.GetX();
+ long nY = rData.GetY();
+ long nWidth = rData.GetWidth();
+ long nHeight = rData.GetHeight();
const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
if( nX < 0 )
nX = 0;
@@ -859,7 +859,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// 91625 - ignore Minimize
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
- sal_uLong nState = rData.GetState();
+ 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
{
- sal_uLong nValidMask = rData.GetMask();
+ ULONG nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -934,7 +934,7 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
Point aPos = GetPosPixel();
Size aSize = GetSizePixel();
- sal_uLong nState = 0;
+ ULONG nState = 0;
if ( IsRollUp() )
{
@@ -969,7 +969,7 @@ void SystemWindow::SetWindowState( const ByteString& rStr )
// -----------------------------------------------------------------------
-ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const
+ByteString SystemWindow::GetWindowState( ULONG nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
@@ -1013,7 +1013,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
ImplToBottomChild();
if ( pOldMenuBar )
{
- sal_Bool bDelete = (pMenuBar == 0) ? sal_True : sal_False;
+ BOOL bDelete = (pMenuBar == 0) ? TRUE : FALSE;
if( bDelete && pOldWindow )
{
if( mpImplData->mpTaskPaneList )
@@ -1021,7 +1021,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
}
MenuBar::ImplDestroy( pOldMenuBar, bDelete );
if( bDelete )
- pOldWindow = NULL; // will be deleted in MenuBar::ImplDestroy,
+ pOldWindow = NULL; // will be deleted in MenuBar::ImplDestroy,
}
}
@@ -1046,7 +1046,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
// -----------------------------------------------------------------------
-void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
+void SystemWindow::SetMenuBarMode( USHORT nMode )
{
if ( mnMenuBarMode != nMode )
{
@@ -1054,20 +1054,20 @@ void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
{
if ( nMode == MENUBAR_MODE_HIDE )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_True );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( TRUE );
else
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_False );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( FALSE );
}
}
}
// -----------------------------------------------------------------------
-sal_Bool SystemWindow::ImplIsInTaskPaneList( Window* pWin )
+BOOL SystemWindow::ImplIsInTaskPaneList( Window* pWin )
{
if( mpImplData && mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList->IsInList( pWin );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 32e8a0dcec92..9054ca8ca7f8 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,19 +39,19 @@
void TabDialog::ImplInitTabDialogData()
{
- mpFixedLine = NULL;
- mpViewWindow = NULL;
- meViewAlign = WINDOWALIGN_LEFT;
- mbPosControls = sal_True;
+ mpFixedLine = NULL;
+ mpViewWindow = NULL;
+ meViewAlign = WINDOWALIGN_LEFT;
+ mbPosControls = TRUE;
}
// -----------------------------------------------------------------------
void TabDialog::ImplPosControls()
{
- Size aCtrlSize( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
- long nDownCtrl = 0;
- long nOffY = 0;
+ Size aCtrlSize( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
+ long nDownCtrl = 0;
+ long nOffY = 0;
TabControl* pTabControl = NULL;
Window* pChild = GetWindow( WINDOW_FIRSTCHILD );
@@ -91,56 +91,56 @@ void TabDialog::ImplPosControls()
if ( nOffY )
nOffY += IMPL_DIALOG_BAR_OFFSET*2 + 2;
- Point aTabOffset( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+nOffY );
- Size aTabSize = pTabControl->GetSizePixel();
- Size aDlgSize( aTabSize.Width() + IMPL_DIALOG_OFFSET*2,
+ Point aTabOffset( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+nOffY );
+ Size aTabSize = pTabControl->GetSizePixel();
+ Size aDlgSize( aTabSize.Width() + IMPL_DIALOG_OFFSET*2,
aTabSize.Height() + IMPL_DIALOG_OFFSET*2 + nOffY );
- long nBtnEx = 0;
+ long nBtnEx = 0;
// Preview-Fenster beruecksichtigen und die Groessen/Offsets anpassen
if ( mpViewWindow && mpViewWindow->IsVisible() )
{
- long nViewOffX = 0;
- long nViewOffY = 0;
- long nViewWidth = 0;
- long nViewHeight = 0;
- sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS;
- Size aViewSize = mpViewWindow->GetSizePixel();
+ long nViewOffX = 0;
+ long nViewOffY = 0;
+ long nViewWidth = 0;
+ long nViewHeight = 0;
+ USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ Size aViewSize = mpViewWindow->GetSizePixel();
if ( meViewAlign == WINDOWALIGN_TOP )
{
- nViewOffX = aTabOffset.X();
- nViewOffY = nOffY+IMPL_DIALOG_OFFSET;
- nViewWidth = aTabSize.Width();
+ nViewOffX = aTabOffset.X();
+ nViewOffY = nOffY+IMPL_DIALOG_OFFSET;
+ nViewWidth = aTabSize.Width();
nViewPosFlags |= WINDOW_POSSIZE_WIDTH;
aTabOffset.Y() += aViewSize.Height()+IMPL_DIALOG_OFFSET;
aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET;
}
else if ( meViewAlign == WINDOWALIGN_BOTTOM )
{
- nViewOffX = aTabOffset.X();
- nViewOffY = aTabOffset.Y()+aTabSize.Height()+IMPL_DIALOG_OFFSET;
- nViewWidth = aTabSize.Width();
+ nViewOffX = aTabOffset.X();
+ nViewOffY = aTabOffset.Y()+aTabSize.Height()+IMPL_DIALOG_OFFSET;
+ nViewWidth = aTabSize.Width();
nViewPosFlags |= WINDOW_POSSIZE_WIDTH;
aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET;
}
else if ( meViewAlign == WINDOWALIGN_RIGHT )
{
- nViewOffX = aTabOffset.X()+aTabSize.Width()+IMPL_DIALOG_OFFSET;
- nViewOffY = aTabOffset.Y();
- nViewHeight = aTabSize.Height();
+ nViewOffX = aTabOffset.X()+aTabSize.Width()+IMPL_DIALOG_OFFSET;
+ nViewOffY = aTabOffset.Y();
+ nViewHeight = aTabSize.Height();
nViewPosFlags |= WINDOW_POSSIZE_HEIGHT;
aDlgSize.Width() += aViewSize.Width()+IMPL_DIALOG_OFFSET;
- nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET;
+ nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET;
}
else // meViewAlign == WINDOWALIGN_LEFT
{
- nViewOffX = IMPL_DIALOG_OFFSET;
- nViewOffY = aTabOffset.Y();
- nViewHeight = aTabSize.Height();
+ nViewOffX = IMPL_DIALOG_OFFSET;
+ nViewOffY = aTabOffset.Y();
+ nViewHeight = aTabSize.Height();
nViewPosFlags |= WINDOW_POSSIZE_HEIGHT;
aTabOffset.X() += aViewSize.Width()+IMPL_DIALOG_OFFSET;
aDlgSize.Width() += aViewSize.Width()+IMPL_DIALOG_OFFSET;
- nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET;
+ nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET;
}
mpViewWindow->SetPosSizePixel( nViewOffX, nViewOffY,
@@ -152,11 +152,11 @@ void TabDialog::ImplPosControls()
pTabControl->SetPosPixel( aTabOffset );
// Alle anderen Childs positionieren
- sal_Bool bTabCtrl = sal_False;
- int nLines = 0;
+ BOOL bTabCtrl = FALSE;
+ int nLines = 0;
long nX;
- long nY = aDlgSize.Height();
- long nTopX = IMPL_DIALOG_OFFSET;
+ long nY = aDlgSize.Height();
+ long nTopX = IMPL_DIALOG_OFFSET;
// Unter Windows 95 werden die Buttons rechtsbuendig angeordnet
nX = IMPL_DIALOG_OFFSET;
@@ -170,7 +170,7 @@ void TabDialog::ImplPosControls()
if ( pChild2->IsVisible() && (pChild2 != mpViewWindow) )
{
if ( pChild2 == pTabControl )
- bTabCtrl = sal_True;
+ bTabCtrl = TRUE;
else if ( bTabCtrl )
{
if ( !nLines )
@@ -179,7 +179,7 @@ void TabDialog::ImplPosControls()
if ( nX+aCtrlSize.Width()-IMPL_DIALOG_OFFSET > (aTabSize.Width()+nBtnEx) )
{
nY += aCtrlSize.Height()+IMPL_DIALOG_OFFSET;
- nX = IMPL_DIALOG_OFFSET;
+ nX = IMPL_DIALOG_OFFSET;
nLines++;
}
@@ -212,7 +212,7 @@ void TabDialog::ImplPosControls()
mpFixedLine->Show();
}
- mbPosControls = sal_False;
+ mbPosControls = FALSE;
}
// -----------------------------------------------------------------------
@@ -250,7 +250,7 @@ void TabDialog::Resize()
// !!! In the future the controls should be automaticly rearrange
// !!! if the window is resized
// !!! if ( !IsRollUp() )
-// !!! ImplPosControls();
+// !!! ImplPosControls();
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index f109f2079a4c..9319f1bc0d54 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -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( sal_True );
+ EnableChildTransparentMode( TRUE );
}
// -----------------------------------------------------------------------
@@ -67,16 +67,16 @@ void TabPage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( sal_True );
+ EnableChildTransparentMode( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetBackground();
}
else
{
- EnableChildTransparentMode( sal_False );
+ EnableChildTransparentMode( FALSE );
SetParentClipMode( 0 );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( 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, sal_uLong )
+void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -174,7 +174,7 @@ void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
Wallpaper aWallpaper = GetBackground();
if ( !aWallpaper.IsBitmap() )
ImplInitSettings();
-
+
pDev->Push();
pDev->SetMapMode();
pDev->SetLineColor();
@@ -205,4 +205,13 @@ void TabPage::DeactivatePage()
{
}
+// -----------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > TabPage::CreateAccessible()
+{
+ // TODO: remove this method (incompatible)
+
+ return Window::CreateAccessible();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 56bd9d799cce..274551579715 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,7 +49,7 @@ Point ImplTaskPaneListGetPos( const Window *w )
else
pos = w->OutputToAbsoluteScreenPixel( pos );
}
- else
+ else
pos = w->OutputToAbsoluteScreenPixel( w->GetPosPixel() );
return pos;
@@ -108,8 +108,26 @@ TaskPaneList::~TaskPaneList()
void TaskPaneList::AddWindow( Window *pWindow )
{
+#if OSL_DEBUG_LEVEL > 0
+ bool bDockingWindow=false;
+ bool bToolbox=false;
+ bool bDialog=false;
+ bool bUnknown=false;
+#endif
+
if( pWindow )
{
+#if OSL_DEBUG_LEVEL > 0
+ if( pWindow->GetType() == RSC_DOCKINGWINDOW )
+ bDockingWindow = true;
+ else if( pWindow->GetType() == RSC_TOOLBOX )
+ bToolbox = true;
+ else if( pWindow->IsDialog() )
+ bDialog = true;
+ else
+ bUnknown = true;
+#endif
+
::std::vector< Window* >::iterator insertionPos = mTaskPanes.end();
for ( ::std::vector< Window* >::iterator p = mTaskPanes.begin();
p != mTaskPanes.end();
@@ -127,6 +145,8 @@ void TaskPaneList::AddWindow( Window *pWindow )
// beginning, until the first window is found which has the ChildPathFocus. Now
// if this would be the ancestor window of another pane window, this would fudge
// the result
+ // 2004-09-27 - fs@openoffice.org, while fixing #i33573#, which included replacing
+ // the original fix for #98916# with this one here.
if ( pWindow->IsWindowOrChild( *p ) )
{
insertionPos = p + 1;
@@ -140,7 +160,7 @@ void TaskPaneList::AddWindow( Window *pWindow )
}
mTaskPanes.insert( insertionPos, pWindow );
- pWindow->ImplIsInTaskPaneList( sal_True );
+ pWindow->ImplIsInTaskPaneList( TRUE );
}
}
@@ -153,25 +173,25 @@ void TaskPaneList::RemoveWindow( Window *pWindow )
if( p != mTaskPanes.end() )
{
mTaskPanes.erase( p );
- pWindow->ImplIsInTaskPaneList( sal_False );
+ pWindow->ImplIsInTaskPaneList( FALSE );
}
}
// --------------------------------------------------
-sal_Bool TaskPaneList::IsInList( Window *pWindow )
+BOOL TaskPaneList::IsInList( Window *pWindow )
{
::std::vector< Window* >::iterator p;
p = ::std::find( mTaskPanes.begin(), mTaskPanes.end(), pWindow );
if( p != mTaskPanes.end() )
- return sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
// --------------------------------------------------
-sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
+BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
// F6 cycles through everything and works always
@@ -183,11 +203,11 @@ sal_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
- sal_Bool bSplitterOnly = sal_False;
- sal_Bool bFocusInList = sal_False;
+ BOOL bSplitterOnly = FALSE;
+ BOOL bFocusInList = FALSE;
KeyCode aKeyCode = aKeyEvent.GetKeyCode();
- sal_Bool bForward = !aKeyCode.IsShift();
- if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
+ BOOL bForward = !aKeyCode.IsShift();
+ if( aKeyCode.GetCode() == KEY_F6 ) // F6
{
bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
@@ -196,43 +216,43 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
while( p != mTaskPanes.end() )
{
Window *pWin = *p;
- if( pWin->HasChildPathFocus( sal_True ) )
+ if( pWin->HasChildPathFocus( TRUE ) )
{
- bFocusInList = sal_True;
+ bFocusInList = TRUE;
// Ctrl-F6 goes directly to the document
if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() )
{
pWin->GrabFocusToDocument();
- return sal_True;
+ return TRUE;
}
// activate next task pane
Window *pNextWin = NULL;
if( bSplitterOnly )
- pNextWin = FindNextSplitter( *p, sal_True );
+ pNextWin = FindNextSplitter( *p, TRUE );
else
pNextWin = FindNextFloat( *p, bForward );
if( pNextWin != pWin )
{
- ImplGetSVData()->maWinData.mbNoSaveFocus = sal_True;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = TRUE;
ImplTaskPaneListGrabFocus( pNextWin );
- ImplGetSVData()->maWinData.mbNoSaveFocus = sal_False;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = FALSE;
}
else
{
// forward key if no splitter found
if( bSplitterOnly )
- return sal_False;
+ return FALSE;
// we did not find another taskpane, so
// put focus back into document
pWin->GrabFocusToDocument();
}
- return sal_True;
+ return TRUE;
}
else
p++;
@@ -243,24 +263,24 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
Window *pWin;
if( bSplitterOnly )
- pWin = FindNextSplitter( NULL, sal_True );
+ pWin = FindNextSplitter( NULL, TRUE );
else
pWin = FindNextFloat( NULL, bForward );
if( pWin )
{
ImplTaskPaneListGrabFocus( pWin );
- return sal_True;
+ return TRUE;
}
}
}
- return sal_False;
+ return FALSE;
}
// --------------------------------------------------
// returns next valid pane
-Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward )
+Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -295,7 +315,7 @@ Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward )
// --------------------------------------------------
// returns next splitter
-Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward )
+Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -334,7 +354,7 @@ Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward )
// --------------------------------------------------
// returns first valid item (regardless of type) if pWindow==0, otherwise returns next valid float
-Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward )
+Window* TaskPaneList::FindNextFloat( Window *pWindow, BOOL bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -372,7 +392,7 @@ Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward )
++p;
}
- return pWindow;
+ return pWindow;
}
// --------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 0eae498111ab..256e8478b942 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,6 +31,7 @@
#include <svsys.h>
#include <rtl/logfile.hxx>
+#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
@@ -108,24 +109,24 @@ DBG_NAMEEX( Window )
#define TB_MAX_GROUPS 100
-#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_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_LINEOFFSET 3
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow );
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow );
// -----------------------------------------------------------------------
struct ImplToolSize
{
long mnWidth;
long mnHeight;
- sal_uInt16 mnLines;
+ USHORT mnLines;
};
struct ImplToolSizeArray
@@ -140,7 +141,7 @@ struct ImplToolSizeArray
// -----------------------------------------------------------------------
-typedef ::std::vector< ToolBox* > ImplTBList;
+DECLARE_LIST( ImplTBList, ToolBox* )
class ImplTBDragMgr
{
@@ -153,47 +154,40 @@ private:
Accelerator maAccel;
long mnMinWidth;
long mnMaxWidth;
- sal_uInt16 mnLineMode;
- sal_uInt16 mnStartLines;
+ USHORT mnLineMode;
+ USHORT mnStartLines;
void* mpCustomizeData;
- sal_Bool mbCustomizeMode;
- sal_Bool mbResizeMode;
- sal_Bool mbShowDragRect;
+ BOOL mbCustomizeMode;
+ BOOL mbResizeMode;
+ BOOL mbShowDragRect;
public:
ImplTBDragMgr();
~ImplTBDragMgr();
- void push_back( ToolBox* pBox )
- { mpBoxList->push_back( pBox ); }
- void erase( ToolBox* pBox )
- {
- for ( ImplTBList::iterator it = mpBoxList->begin(); it < mpBoxList->end(); ++it ) {
- if ( *it == pBox ) {
- mpBoxList->erase( it );
- break;
- }
- }
- }
- size_t size() const
- { return mpBoxList->size(); }
+ void Insert( ToolBox* pBox )
+ { mpBoxList->Insert( pBox ); }
+ void Remove( ToolBox* pBox )
+ { mpBoxList->Remove( pBox ); }
+ ULONG Count() const
+ { return mpBoxList->Count(); }
ToolBox* FindToolBox( const Rectangle& rRect );
void StartDragging( ToolBox* pDragBox,
const Point& rPos, const Rectangle& rRect,
- sal_uInt16 nLineMode, sal_Bool bResizeItem,
+ USHORT nLineMode, BOOL bResizeItem,
void* pData = NULL );
void Dragging( const Point& rPos );
- void EndDragging( sal_Bool bOK = sal_True );
+ void EndDragging( BOOL bOK = TRUE );
void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); }
void UpdateDragRect();
DECL_LINK( SelectHdl, Accelerator* );
void StartCustomizeMode();
void EndCustomizeMode();
- sal_Bool IsCustomizeMode() { return mbCustomizeMode; }
- sal_Bool IsResizeMode() { return mbResizeMode; }
+ BOOL IsCustomizeMode() { return mbCustomizeMode; }
+ BOOL IsResizeMode() { return mbResizeMode; }
};
// -----------------------------------------------------------------------
@@ -236,11 +230,11 @@ ButtonType determineButtonType( ImplToolItem* pItem, ButtonType defaultType )
ToolBoxItemBits nBits( pItem->mnBits & 0x300 );
if ( nBits & TIB_TEXTICON ) // item has custom setting
{
- tmpButtonType = BUTTON_SYMBOLTEXT;
+ tmpButtonType = BUTTON_SYMBOLTEXT;
if ( nBits == TIB_TEXT_ONLY )
- tmpButtonType = BUTTON_TEXT;
+ tmpButtonType = BUTTON_TEXT;
else if ( nBits == TIB_ICON_ONLY )
- tmpButtonType = BUTTON_SYMBOL;
+ tmpButtonType = BUTTON_SYMBOL;
}
return tmpButtonType;
}
@@ -323,7 +317,7 @@ static void ImplCheckUpdate( ToolBox *pThis )
// which would result in erasing the background only and not painting any items
// this must not be done when we're already in Paint()
- // this is only required for transparent toolbars (see ImplDrawTransparentBackground() )
+ // this is only required for transparent toolbars (see ImplDrawTransparentBackground() )
if( !pThis->IsBackground() && pThis->HasPaintEvent() && !pThis->IsInPaint() )
pThis->Update();
}
@@ -338,7 +332,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis )
// execute pending paint requests
ImplCheckUpdate( pThis );
- sal_Bool bNativeOk = sal_False;
+ BOOL bNativeOk = FALSE;
if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT ) )
{
ToolbarValue aToolbarValue;
@@ -347,7 +341,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis )
Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() );
ControlState nState = CTRL_STATE_ENABLED;
- bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
+ bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
aCtrlRegion, nState, aToolbarValue, rtl::OUString() );
}
@@ -422,7 +416,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
g.SetStartColor( startCol );
g.SetEndColor( endCol );
- sal_Bool bLineColor = pThis->IsLineColor();
+ BOOL bLineColor = pThis->IsLineColor();
Color aOldCol = pThis->GetLineColor();
pThis->SetLineColor( pThis->GetSettings().GetStyleSettings().GetShadowColor() );
@@ -512,7 +506,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
if( pThis->mbHorz )
{
long y = 0;
- sal_Bool bDrawSep = sal_False; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
+ BOOL bDrawSep = FALSE; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
pThis->DrawGradient( Rectangle( 0, y, aTopLineSz.Width(), y+aTopLineSz.Height()), g );
y += aTopLineSz.Height();
@@ -554,14 +548,14 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
}
-sal_Bool ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
+BOOL ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
{
// use NWF
Point aPt;
Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() );
ControlState nState = CTRL_STATE_ENABLED;
- return pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
+ return pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
aCtrlRegion, nState, ImplControlValue(), rtl::OUString() );
}
@@ -569,16 +563,16 @@ void ToolBox::ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegi
{
// just invalidate to trigger paint of the parent
- const bool bOldPaintLock = pThis->mpData->mbIsPaintLocked;
+ const bool bOldPaintLock = pThis->mpData->mbIsPaintLocked;
pThis->mpData->mbIsPaintLocked = true;
// send an invalidate to the first opaque parent and invalidate the whole hierarchy from there (noclipchildren)
- pThis->Invalidate( rRegion, INVALIDATE_UPDATE|INVALIDATE_NOCLIPCHILDREN );
+ pThis->Invalidate( rRegion, INVALIDATE_UPDATE|INVALIDATE_NOCLIPCHILDREN );
pThis->mpData->mbIsPaintLocked = bOldPaintLock;
}
-void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode )
+void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode )
{
// draw a constant color
if( !bIsInPopupMode )
@@ -587,7 +581,7 @@ void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion,
else
{
// use different color in popupmode
- pThis->DrawWallpaper( rRegion.GetBoundRect(),
+ pThis->DrawWallpaper( rRegion.GetBoundRect(),
Wallpaper( pThis->GetSettings().GetStyleSettings().GetFaceGradientColor() ) );
}
}
@@ -599,7 +593,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
ImplCheckUpdate( pThis );
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pThis );
- sal_Bool bIsInPopupMode = pThis->ImplIsInPopupMode();
+ BOOL bIsInPopupMode = pThis->ImplIsInPopupMode();
Region aPaintRegion( rRect );
@@ -624,7 +618,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
- sal_Bool bNativeOk = sal_False;
+ BOOL bNativeOk = FALSE;
if( pThis->ImplIsFloatingMode() && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) )
bNativeOk = ImplDrawNativeBackground( pThis, aPaintRegion );
@@ -644,12 +638,12 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
pThis->Pop();
}
-void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight, sal_Bool bHasOpenPopup )
+void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight, BOOL bHasOpenPopup )
{
// the background of non NWF buttons is painted in a constant color
// to have the same highlight color (transparency in DrawSelectionBackground())
// items with open popups will also painted using a constant color
- if( !pThis->mpData->mbNativeButtons &&
+ if( !pThis->mpData->mbNativeButtons &&
(bHighlight || ! (((Window*) pThis)->GetStyle() & WB_3DLOOK ) ) )
{
if( (((Window*) pThis)->GetStyle() & WB_3DLOOK ) )
@@ -763,7 +757,7 @@ const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode )
+Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode )
{
long nMax;
long nLeft = 0;
@@ -772,45 +766,45 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
long nBottom = 0;
Size aSize;
WindowAlign eOldAlign = pThis->meAlign;
- sal_Bool bOldHorz = pThis->mbHorz;
- sal_Bool bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
- sal_Bool bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
+ BOOL bOldHorz = pThis->mbHorz;
+ BOOL bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
+ BOOL bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
if ( nCalcMode )
{
- sal_Bool bOldFloatingMode = pThis->ImplIsFloatingMode();
+ BOOL bOldFloatingMode = pThis->ImplIsFloatingMode();
- pThis->mpData->mbAssumeDocked = sal_False;
- pThis->mpData->mbAssumeFloating = sal_False;
+ pThis->mpData->mbAssumeDocked = FALSE;
+ pThis->mpData->mbAssumeFloating = FALSE;
if ( nCalcMode == TB_CALCMODE_HORZ )
{
- pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = sal_True;
+ ((ToolBox*)pThis)->mbHorz = TRUE;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
else if ( nCalcMode == TB_CALCMODE_VERT )
{
- pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = sal_False;
+ ((ToolBox*)pThis)->mbHorz = FALSE;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_LEFT;
}
else if ( nCalcMode == TB_CALCMODE_FLOAT )
{
- pThis->mpData->mbAssumeFloating = sal_True; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeFloating = TRUE; // force non-floating mode during calculation
nLeft = nTop = nRight = nBottom = 0;
- ((ToolBox*)pThis)->mbHorz = sal_True;
+ ((ToolBox*)pThis)->mbHorz = TRUE;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) ||
(pThis->ImplIsFloatingMode() != bOldFloatingMode ) )
- ((ToolBox*)pThis)->mbCalc = sal_True;
+ ((ToolBox*)pThis)->mbCalc = TRUE;
}
else
ImplCalcBorder( pThis->meAlign, nLeft, nTop, nRight, nBottom, pThis );
@@ -872,7 +866,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
{
((ToolBox*)pThis)->meAlign = eOldAlign;
((ToolBox*)pThis)->mbHorz = bOldHorz;
- ((ToolBox*)pThis)->mbCalc = sal_True;
+ ((ToolBox*)pThis)->mbCalc = TRUE;
}
}
@@ -918,13 +912,13 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// calc an upper bound for ImplCalcBreaks below
long upperBoundWidth = nCalcSize * pThis->mpData->m_aItems.size();
- sal_uInt16 i;
- sal_uInt16 nLines;
- sal_uInt16 nCalcLines;
- sal_uInt16 nTempLines;
+ USHORT i;
+ USHORT nLines;
+ USHORT nCalcLines;
+ USHORT nTempLines;
long nHeight;
long nMaxLineWidth;
- nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
+ nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
pThis->mpFloatSizeAry = new ImplToolSizeArray;
pThis->mpFloatSizeAry->mpSize = new ImplToolSize[nCalcLines];
@@ -946,7 +940,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
do
{
nCalcSize += pThis->mnMaxItemWidth;
- nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
+ nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
}
while ( (nCalcSize < upperBoundWidth) && (nLines < nTempLines) && (nTempLines != 1) );
if ( nTempLines < nLines )
@@ -958,7 +952,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines )
+Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines )
{
ImplCalcFloatSizes( pThis );
@@ -969,7 +963,7 @@ Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines )
rLines = pThis->mnLines;
}
- sal_uInt16 i = 0;
+ USHORT i = 0;
while ( i < pThis->mpFloatSizeAry->mnLastEntry &&
rLines < pThis->mpFloatSizeAry->mpSize[i].mnLines )
i++;
@@ -988,7 +982,7 @@ void ToolBox::ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMa
{
ImplCalcFloatSizes( pThis );
- sal_uInt16 i = 0;
+ USHORT 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 +1008,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
{
pWrapper->SetMinOutputSizePixel( aMinSize );
pWrapper->SetMaxOutputSizePixel( aMaxSize );
- pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
}
else
{
@@ -1027,7 +1021,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
+USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
{
long nLineHeight;
@@ -1049,18 +1043,18 @@ sal_uInt16 ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
nLineHeight += TB_LINESPACING;
nToolSize += TB_LINESPACING;
}
-
+
// #i91917# always report at least one line
long nLines = nToolSize/nLineHeight;
if( nLines < 1 )
nLines = 1;
-
- return static_cast<sal_uInt16>(nLines);
+
+ return static_cast<USHORT>(nLines);
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
+USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
{
if ( !pThis->ImplIsFloatingMode() &&
(!pThis->mbScroll || (pThis->mnLines > 1) || (pThis->mnCurLines > pThis->mnVisLines)) )
@@ -1095,9 +1089,9 @@ sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
// -----------------------------------------------------------------------
void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect,
- sal_uInt16 nLineMode )
+ USHORT nLineMode )
{
- sal_Bool mbHorz;
+ BOOL mbHorz;
long nOneLineSize;
long nCurSize;
long nMaxSize;
@@ -1107,31 +1101,31 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
if ( nLineMode & DOCK_LINERIGHT )
{
nCurSize = rPos.X() - rRect.Left();
- mbHorz = sal_False;
+ mbHorz = FALSE;
}
else if ( nLineMode & DOCK_LINEBOTTOM )
{
nCurSize = rPos.Y() - rRect.Top();
- mbHorz = sal_True;
+ mbHorz = TRUE;
}
else if ( nLineMode & DOCK_LINELEFT )
{
nCurSize = rRect.Right() - rPos.X();
- mbHorz = sal_False;
+ mbHorz = FALSE;
}
else if ( nLineMode & DOCK_LINETOP )
{
nCurSize = rRect.Bottom() - rPos.Y();
- mbHorz = sal_True;
+ mbHorz = TRUE;
}
else {
- OSL_FAIL( "ImplLineSizing: Trailing else" );
+ DBG_ERROR( "ImplLineSizing: Trailing else" );
nCurSize = 0;
- mbHorz = sal_False;
+ mbHorz = FALSE;
}
Size aWinSize = pThis->GetSizePixel();
- sal_uInt16 nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
+ USHORT nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
if ( nMaxLines > TB_MAXLINES )
nMaxLines = TB_MAXLINES;
if ( mbHorz )
@@ -1149,7 +1143,7 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
nMaxSize = aWinSize.Width();
}
- sal_uInt16 i = 1;
+ USHORT i = 1;
if ( nCurSize <= nOneLineSize )
nSize = nOneLineSize;
else
@@ -1190,9 +1184,9 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
+USHORT ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
{
- sal_uInt16 nPos = 0;
+ USHORT nPos = 0;
long nLast = 0;
Point aPos = rPos;
Size aSize( pBox->mnDX, pBox->mnDY );
@@ -1256,12 +1250,12 @@ sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
ImplTBDragMgr::ImplTBDragMgr()
{
- mpBoxList = new ImplTBList();
+ mpBoxList = new ImplTBList( 4, 4 );
mnLineMode = 0;
mnStartLines = 0;
- mbCustomizeMode = sal_False;
- mbResizeMode = sal_False;
- mbShowDragRect = sal_False;
+ mbCustomizeMode = FALSE;
+ mbResizeMode = FALSE;
+ mbShowDragRect = FALSE;
mpDragBox = NULL;
maAccel.InsertItem( KEY_RETURN, KeyCode( KEY_RETURN ) );
@@ -1280,9 +1274,9 @@ ImplTBDragMgr::~ImplTBDragMgr()
ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
{
- for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i )
+ ToolBox* pBox = mpBoxList->First();
+ while ( pBox )
{
- ToolBox* pBox = (*mpBoxList)[ i ];
/*
* FIXME: since we can have multiple frames now we cannot
* find the drag target by its position alone.
@@ -1290,9 +1284,8 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
* this works in one frame only anyway. If the dialogue
* changes to a system window, we need a new implementation here
*/
- if ( pBox->IsReallyVisible()
- && pBox->ImplGetWindowImpl()->mpFrame == mpDragBox->ImplGetWindowImpl()->mpFrame
- ) {
+ if ( pBox->IsReallyVisible() && pBox->ImplGetWindowImpl()->mpFrame == mpDragBox->ImplGetWindowImpl()->mpFrame )
+ {
if ( !pBox->ImplIsFloatingMode() )
{
Point aPos = pBox->GetPosPixel();
@@ -1302,21 +1295,23 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
return pBox;
}
}
+
+ pBox = mpBoxList->Next();
}
- return NULL;
+ return pBox;
}
// -----------------------------------------------------------------------
void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
const Point& rPos, const Rectangle& rRect,
- sal_uInt16 nDragLineMode, sal_Bool bResizeItem,
+ USHORT nDragLineMode, BOOL bResizeItem,
void* pData )
{
mpDragBox = pToolBox;
pToolBox->CaptureMouse();
- pToolBox->mbDragging = sal_True;
+ pToolBox->mbDragging = TRUE;
Application::InsertAccel( &maAccel );
if ( nDragLineMode )
@@ -1348,7 +1343,7 @@ void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
maMouseOff.Y() = rRect.Top() - rPos.Y();
maRect = rRect;
maStartRect = rRect;
- mbShowDragRect = sal_True;
+ mbShowDragRect = TRUE;
pToolBox->ShowTracking( maRect );
}
@@ -1388,12 +1383,12 @@ void ImplTBDragMgr::Dragging( const Point& rPos )
// -----------------------------------------------------------------------
-void ImplTBDragMgr::EndDragging( sal_Bool bOK )
+void ImplTBDragMgr::EndDragging( BOOL bOK )
{
mpDragBox->HideTracking();
mpDragBox->ReleaseMouse();
- mpDragBox->mbDragging = sal_False;
- mbShowDragRect = sal_False;
+ mpDragBox->mbDragging = FALSE;
+ mbShowDragRect = FALSE;
Application::RemoveAccel( &maAccel );
if ( mnLineMode )
@@ -1401,16 +1396,16 @@ void ImplTBDragMgr::EndDragging( sal_Bool bOK )
if ( !bOK )
{
mpDragBox->mnDockLines = mnStartLines;
- mpDragBox->EndDocking( maStartRect, sal_False );
+ mpDragBox->EndDocking( maStartRect, FALSE );
}
else
- mpDragBox->EndDocking( maRect, sal_False );
+ mpDragBox->EndDocking( maRect, FALSE );
mnLineMode = 0;
mnStartLines = 0;
}
else
{
- sal_uInt16 nTempItem = mpDragBox->mnConfigItem;
+ USHORT nTempItem = mpDragBox->mnConfigItem;
if ( nTempItem )
{
mpDragBox->mnConfigItem = 0;
@@ -1428,7 +1423,7 @@ void ImplTBDragMgr::EndDragging( sal_Bool bOK )
pItem->mpWindow->SetSizePixel( aSize );
// ToolBox neu brechnen und neu ausgeben
- mpDragBox->ImplInvalidate( sal_True );
+ mpDragBox->ImplInvalidate( TRUE );
mpDragBox->Customize( ToolBoxCustomizeEvent( mpDragBox, nTempItem,
TOOLBOX_CUSTOMIZE_RESIZE,
mpCustomizeData ) );
@@ -1455,7 +1450,7 @@ void ImplTBDragMgr::EndDragging( sal_Bool bOK )
}
aPos = pDropBox->ScreenToOutputPixel( aPos );
- sal_uInt16 nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
+ USHORT nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
mpDragBox->Customize( ToolBoxCustomizeEvent( pDropBox, nTempItem,
nPos, mpCustomizeData ) );
}
@@ -1467,7 +1462,7 @@ void ImplTBDragMgr::EndDragging( sal_Bool bOK )
}
}
mpCustomizeData = NULL;
- mbResizeMode = sal_False;
+ mbResizeMode = FALSE;
mpDragBox->Deactivate();
}
@@ -1490,21 +1485,24 @@ void ImplTBDragMgr::UpdateDragRect()
IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
{
if ( pAccel->GetCurItemId() == KEY_ESCAPE )
- EndDragging( sal_False );
+ EndDragging( FALSE );
else
- EndDragging( sal_True );
+ EndDragging( TRUE );
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
void ImplTBDragMgr::StartCustomizeMode()
{
- mbCustomizeMode = sal_True;
+ mbCustomizeMode = TRUE;
- for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
- (*mpBoxList)[ i ]->ImplStartCustomizeMode();
+ ToolBox* pBox = mpBoxList->First();
+ while ( pBox )
+ {
+ pBox->ImplStartCustomizeMode();
+ pBox = mpBoxList->Next();
}
}
@@ -1512,10 +1510,13 @@ void ImplTBDragMgr::StartCustomizeMode()
void ImplTBDragMgr::EndCustomizeMode()
{
- mbCustomizeMode = sal_False;
+ mbCustomizeMode = FALSE;
- for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
- (*mpBoxList)[ i ]->ImplEndCustomizeMode();
+ ToolBox* pBox = mpBoxList->First();
+ while ( pBox )
+ {
+ pBox->ImplEndCustomizeMode();
+ pBox = mpBoxList->Next();
}
}
@@ -1523,7 +1524,7 @@ void ImplTBDragMgr::EndCustomizeMode()
static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect,
- sal_uInt16 nStyle )
+ USHORT nStyle )
{
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
Color aShadowColor = rStyleSettings.GetShadowColor();
@@ -1571,10 +1572,10 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
{
// Variablen initialisieren
- ImplGetWindowImpl()->mbToolBox = sal_True;
+ ImplGetWindowImpl()->mbToolBox = TRUE;
mpBtnDev = NULL;
mpFloatSizeAry = NULL;
- mpData = new ImplToolBoxPrivateData;
+ mpData = new ImplToolBoxPrivateData;
mpFloatWin = NULL;
mnDX = 0;
mnDY = 0;
@@ -1593,7 +1594,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mnCurItemId = 0;
mnDownItemId = 0;
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
- mnFocusPos = TOOLBOX_ITEM_NOTFOUND; // current position during keyboard access
+ mnFocusPos = TOOLBOX_ITEM_NOTFOUND; // current position during keyboard access
mnLines = 1;
mnCurLine = 1;
mnCurLines = 1;
@@ -1602,31 +1603,32 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mnConfigItem = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- 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;
+ mbDrag = FALSE;
+ mbSelection = FALSE;
+ mbCommandDrag = FALSE;
+ mbUpper = FALSE;
+ mbLower = FALSE;
+ mbNextTool = FALSE;
+ mbIn = FALSE;
+ mbCalc = TRUE;
+ mbFormat = FALSE;
+ mbFullPaint = FALSE;
+ mbHorz = TRUE;
mbScroll = (nStyle & WB_SCROLL) != 0;
- mbCustomize = sal_False;
- mbCustomizeMode = sal_False;
- mbDragging = sal_False;
- mbMenuStrings = sal_False;
- mbIsShift = sal_False;
- mbIsKeyEvent = sal_False;
- mbChangingHighlight = sal_False;
+ mbCustomize = FALSE;
+ mbCustomizeMode = FALSE;
+ mbDragging = FALSE;
+ mbHideStatusText = FALSE;
+ mbMenuStrings = FALSE;
+ mbIsShift = FALSE;
+ mbIsKeyEvent = FALSE;
+ mbChangingHighlight = FALSE;
meButtonType = BUTTON_SYMBOL;
meAlign = WINDOWALIGN_TOP;
meLastStyle = POINTER_ARROW;
mnWinStyle = nStyle;
mnLastFocusItemId = 0;
- mnKeyModifier = 0;
+ mnKeyModifier = 0;
mnActivateCount = 0;
maTimer.SetTimeout( 50 );
@@ -1647,13 +1649,13 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
ImplGetWindowImpl()->mnStyle &= ~WB_DIALOGCONTROL;
}
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
// -----------------------------------------------------------------------
-void ToolBox::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void ToolBox::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
{
mpData->mbNativeButtons = IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
@@ -1687,7 +1689,7 @@ void ToolBox::ImplInitSettings( sal_Bool bFont,
{
aColor = GetControlBackground();
SetBackground( aColor );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
SetParentClipMode( 0 );
}
else
@@ -1695,7 +1697,7 @@ void ToolBox::ImplInitSettings( sal_Bool bFont,
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
SetBackground();
- SetPaintTransparent( sal_True );
+ SetPaintTransparent( TRUE );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() );
}
@@ -1707,7 +1709,7 @@ void ToolBox::ImplInitSettings( sal_Bool bFont,
aColor = rStyleSettings.GetWindowColor();
SetBackground( aColor );
- SetPaintTransparent( sal_False );
+ SetPaintTransparent( FALSE );
SetParentClipMode( 0 );
ImplUpdateImageList();
@@ -1723,10 +1725,10 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( ! pMgr )
return;
-
+
DockingWindow::ImplLoadRes( rResId );
- sal_uLong nObjMask;
+ ULONG nObjMask;
nObjMask = ReadLongRes();
@@ -1737,17 +1739,17 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
SetAlign( (WindowAlign)ReadLongRes() );
if ( nObjMask & RSC_TOOLBOX_LINECOUNT )
- SetLineCount( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
+ SetLineCount( sal::static_int_cast<USHORT>(ReadLongRes()) );
if ( nObjMask & RSC_TOOLBOX_CUSTOMIZE )
{
- sal_Bool bCust = (sal_Bool)ReadShortRes();
+ BOOL bCust = (BOOL)ReadShortRes();
EnableCustomize( bCust );
}
if ( nObjMask & RSC_TOOLBOX_MENUSTRINGS )
{
- sal_Bool bCust = (sal_Bool)ReadShortRes();
+ BOOL bCust = (BOOL)ReadShortRes();
EnableMenuStrings( bCust );
}
@@ -1762,10 +1764,10 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_TOOLBOX_ITEMLIST )
{
- sal_uLong nEle = ReadLongRes();
+ ULONG nEle = ReadLongRes();
// Item hinzufuegen
- for ( sal_uLong i = 0; i < nEle; i++ )
+ for ( ULONG i = 0; i < nEle; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -1796,7 +1798,7 @@ ToolBox::ToolBox( Window* pParent, const ResId& rResId ) :
// Groesse des FloatingWindows berechnen und umschalten, wenn die
// ToolBox initial im FloatingModus ist
if ( ImplIsFloatingMode() )
- mbHorz = sal_True;
+ mbHorz = TRUE;
else
Resize();
@@ -1835,9 +1837,9 @@ ToolBox::~ToolBox()
{
// Wenn im TBDrag-Manager, dann wieder rausnehmen
if ( mbCustomize )
- pSVData->maCtrlData.mpTBDragMgr->erase( this );
+ pSVData->maCtrlData.mpTBDragMgr->Remove( this );
- if ( !pSVData->maCtrlData.mpTBDragMgr->size() )
+ if ( !pSVData->maCtrlData.mpTBDragMgr->Count() )
{
delete pSVData->maCtrlData.mpTBDragMgr;
pSVData->maCtrlData.mpTBDragMgr = NULL;
@@ -1847,7 +1849,7 @@ ToolBox::~ToolBox()
// -----------------------------------------------------------------------
-ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
+ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const
{
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
@@ -1861,7 +1863,7 @@ ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
}
// -----------------------------------------------------------------------
-static void ImplAddButtonBorder( long &rWidth, long& rHeight, sal_uInt16 aOutStyle, sal_Bool bNativeButtons )
+static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle, BOOL bNativeButtons )
{
if ( aOutStyle & TOOLBOX_STYLE_OUTBUTTON )
{
@@ -1884,13 +1886,13 @@ static void ImplAddButtonBorder( long &rWidth, long& rHeight, sal_uInt16 aOutSty
// -----------------------------------------------------------------------
-sal_Bool ToolBox::ImplCalcItem()
+BOOL ToolBox::ImplCalcItem()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
// recalc required ?
if ( !mbCalc )
- return sal_False;
+ return FALSE;
ImplDisableFlatButtons();
@@ -1935,7 +1937,7 @@ sal_Bool ToolBox::ImplCalcItem()
mpData->mnMenuButtonWidth = TB_MENUBUTTON_SIZE;
}
}
-
+
// also calculate the area for comboboxes, drop down list boxes and spinfields
// as these are often inserted into toolboxes; set mnWinHeight to the
// greater of those values to prevent toolbar flickering (#i103385#)
@@ -1975,34 +1977,34 @@ sal_Bool ToolBox::ImplCalcItem()
if( aRect.GetHeight() > mnWinHeight )
mnWinHeight = aRect.GetHeight();
}
- }
-
+ }
+
if ( ! mpData->m_aItems.empty() )
- {
+ {
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
{
- sal_Bool bImage;
- sal_Bool bText;
+ BOOL bImage;
+ BOOL bText;
- it->mbVisibleText = sal_False; // indicates if text will definitely be drawn, influences dropdown pos
+ it->mbVisibleText = 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 = sal_False;
+ bImage = FALSE;
else
- bImage = sal_True;
+ bImage = TRUE;
if ( !it->maText.Len() )
- bText = sal_False;
+ bText = FALSE;
else
- bText = sal_True;
- ButtonType tmpButtonType = determineButtonType( &(*it), meButtonType ); // default to toolbox setting
+ bText = TRUE;
+ ButtonType tmpButtonType = determineButtonType( &(*it), meButtonType ); // default to toolbox setting
if ( bImage || bText )
{
- it->mbEmptyBtn = sal_False;
+ it->mbEmptyBtn = FALSE;
if ( tmpButtonType == BUTTON_SYMBOL )
{
@@ -2015,7 +2017,7 @@ sal_Bool ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = sal_True;
+ it->mbVisibleText = TRUE;
}
}
else if ( tmpButtonType == BUTTON_TEXT )
@@ -2025,7 +2027,7 @@ sal_Bool ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = sal_True;
+ it->mbVisibleText = TRUE;
}
else
{
@@ -2053,7 +2055,7 @@ sal_Bool ToolBox::ImplCalcItem()
else
{ // no image and no text
it->maItemSize = Size( nDefWidth, nDefHeight );
- it->mbEmptyBtn = sal_True;
+ it->mbEmptyBtn = TRUE;
}
// Gegebenenfalls die Fensterhoehe mit beruecksichtigen
@@ -2089,7 +2091,7 @@ sal_Bool ToolBox::ImplCalcItem()
{
// add borders
ImplAddButtonBorder( it->maItemSize.Width(), it->maItemSize.Height(), mnOutStyle, mpData->mbNativeButtons );
-
+
if( it->meType == TOOLBOXITEM_BUTTON )
{
if( it->maItemSize.Width() < nMinWidth )
@@ -2133,8 +2135,8 @@ sal_Bool ToolBox::ImplCalcItem()
nMaxWidth = nFixedWidth;
}
- mbCalc = sal_False;
- mbFormat = sal_True;
+ mbCalc = FALSE;
+ mbFormat = TRUE;
// do we have to recalc the sizes ?
if ( (nMaxWidth != mnMaxItemWidth) || (nMaxHeight != mnMaxItemHeight) )
@@ -2142,25 +2144,25 @@ sal_Bool ToolBox::ImplCalcItem()
mnMaxItemWidth = nMaxWidth;
mnMaxItemHeight = nMaxHeight;
- return sal_True;
+ return TRUE;
}
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz )
+USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz )
{
- sal_uLong nLineStart = 0;
- sal_uLong nGroupStart = 0;
+ ULONG nLineStart = 0;
+ ULONG nGroupStart = 0;
long nLineWidth = 0;
long nCurWidth;
long nLastGroupLineWidth = 0;
long nMaxLineWidth = 0;
- sal_uInt16 nLines = 1;
- sal_Bool bWindow;
- sal_Bool bBreak = sal_False;
+ USHORT nLines = 1;
+ BOOL bWindow;
+ BOOL bBreak = FALSE;
long nWidthTotal = nWidth;
// when docked the menubutton will be in the first line
@@ -2172,12 +2174,12 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
while ( it != mpData->m_aItems.end() )
{
it->mbBreak = bBreak;
- bBreak = sal_False;
+ bBreak = FALSE;
if ( it->mbVisible )
{
- bWindow = sal_False;
- bBreak = sal_False;
+ bWindow = FALSE;
+ bBreak = FALSE;
nCurWidth = 0;
if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE )
@@ -2193,7 +2195,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
if ( !mbScroll || (nWinItemWidth <= nWidthTotal) )
{
nCurWidth = nWinItemWidth;
- bWindow = sal_True;
+ bWindow = TRUE;
}
else
{
@@ -2206,13 +2208,13 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
// check for line break
if ( (nLineWidth+nCurWidth > nWidthTotal) && mbScroll )
- bBreak = sal_True;
+ bBreak = 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 = sal_True;
+ bBreak = TRUE;
if ( bBreak )
{
@@ -2228,8 +2230,8 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
nLineWidth = 0;
nLineStart = it - mpData->m_aItems.begin();
nGroupStart = nLineStart;
- it->mbBreak = sal_True;
- bBreak = sal_False;
+ it->mbBreak = TRUE;
+ bBreak = FALSE;
}
else
{
@@ -2293,7 +2295,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool b
// -----------------------------------------------------------------------
namespace
{
- sal_Bool ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
+ BOOL ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
{
std::vector< ImplToolItem >::iterator aLookup = _aSeparator;
while ( ++aLookup != _aEnd )
@@ -2302,9 +2304,9 @@ namespace
return ImplFollowedByVisibleButton( aLookup, _aEnd );
if ( ( aLookup->meType == TOOLBOXITEM_BUTTON ) && aLookup->mbVisible )
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
}
@@ -2324,7 +2326,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
if( eMode == FSMODE_AUTO || eMode == FSMODE_FAVOURHEIGHT )
{
// calc number of floating lines for current window height
- sal_uInt16 nFloatLinesHeight = ImplCalcLines( this, mnDY );
+ USHORT nFloatLinesHeight = ImplCalcLines( this, mnDY );
// calc window size according to this number
aSize1 = ImplCalcFloatSize( this, nFloatLinesHeight );
@@ -2340,9 +2342,9 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder + 2*mnBorderY;
Size aSz( aCurrentSize );
long maxX;
- sal_uInt16 nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
+ USHORT nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
- sal_uInt16 manyLines = 1000;
+ USHORT manyLines = 1000;
Size aMinimalFloatSize = ImplCalcFloatSize( this, manyLines );
aSz.Height() = nBorderY + nLineHeight * nLines;
@@ -2379,7 +2381,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
}
-void ToolBox::ImplFormat( sal_Bool bResize )
+void ToolBox::ImplFormat( BOOL bResize )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -2399,15 +2401,15 @@ void ToolBox::ImplFormat( sal_Bool bResize )
long nMax; // width of layoutarea in pixels
long nX;
long nY;
- sal_uInt16 nFormatLine;
- sal_Bool bMustFullPaint;
- sal_Bool bLastSep;
+ USHORT nFormatLine;
+ BOOL bMustFullPaint;
+ BOOL bLastSep;
std::vector< ImplToolItem >::iterator it;
std::vector< ImplToolItem >::iterator temp_it;
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
- sal_Bool bIsInPopupMode = ImplIsInPopupMode();
+ BOOL bIsInPopupMode = ImplIsInPopupMode();
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
@@ -2426,9 +2428,9 @@ void ToolBox::ImplFormat( sal_Bool bResize )
ImplUpdateDragArea( this );
if ( ImplCalcItem() )
- bMustFullPaint = sal_True;
+ bMustFullPaint = TRUE;
else
- bMustFullPaint = sal_False;
+ bMustFullPaint = FALSE;
// calculate new size during interactive resize or
@@ -2571,7 +2573,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
nX = nLeft; // top-left offset
nY = nTop;
nFormatLine = 1;
- bLastSep = sal_True;
+ bLastSep = TRUE;
// save old scroll rectangles and reset them
Rectangle aOldLowerRect = maLowerRect;
@@ -2705,7 +2707,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
// hide double separators
if ( it->meType == TOOLBOXITEM_SEPARATOR )
{
- it->mbVisible = sal_False;
+ it->mbVisible = FALSE;
if ( !bLastSep )
{
// check if any visible items have to appear behind it
@@ -2716,18 +2718,18 @@ void ToolBox::ImplFormat( sal_Bool bResize )
((temp_it->meType == TOOLBOXITEM_BUTTON) &&
temp_it->mbVisible) )
{
- it->mbVisible = sal_True;
+ it->mbVisible = TRUE;
break;
}
++temp_it;
}
}
- bLastSep = sal_True;
+ bLastSep = TRUE;
}
else if ( it->mbVisible )
- bLastSep = sal_False;
+ bLastSep = FALSE;
- it->mbShowWindow = sal_False;
+ it->mbShowWindow = FALSE;
// check for line break and advance nX/nY accordingly
if ( it->mbBreak )
@@ -2908,7 +2910,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
}
// indicate formatting is done
- mbFormat = sal_False;
+ mbFormat = FALSE;
}
// -----------------------------------------------------------------------
@@ -2919,7 +2921,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
(mpData->m_aItems[ mnCurPos ].mnBits & TIB_DROPDOWN)
)
{
- mpData->mbDropDownByKeyboard = sal_False;
+ mpData->mbDropDownByKeyboard = FALSE;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -2928,7 +2930,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, sal_False );
+ ImplDrawItem( mnCurPos, FALSE );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -2956,7 +2958,7 @@ IMPL_LINK( ToolBox, ImplUpdateHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, sal_Bool bSetColor, sal_Bool bRotate )
+static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL bSetColor, BOOL bRotate )
{
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
@@ -3011,10 +3013,10 @@ static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, sal_Bo
pBox->SetLineColor( aOldLineColor );
}
-static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, sal_Bool bSetColor, sal_Bool bRotate )
+static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, BOOL bSetColor, BOOL bRotate )
{
- sal_Bool bLineColor = pBox->IsLineColor();
- sal_Bool bFillColor = pBox->IsFillColor();
+ BOOL bLineColor = pBox->IsLineColor();
+ BOOL bFillColor = pBox->IsFillColor();
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
pBox->SetLineColor();
@@ -3064,8 +3066,8 @@ static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect
pBox->SetLineColor( );
}
-void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
- sal_Bool bLeft, sal_Bool bTop, long nSize )
+void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform,
+ BOOL bLeft, BOOL bTop, long nSize )
{
Color aOldFillColor = pBox->GetFillColor();
WindowAlign eAlign = pBox->meAlign;
@@ -3160,7 +3162,7 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlac
}
void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- sal_Bool bLeft, sal_Bool bTop, long nSize )
+ BOOL bLeft, BOOL bTop, long nSize )
{
WindowAlign eAlign = pBox->meAlign;
long nHalfSize;
@@ -3215,7 +3217,7 @@ void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
+void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
{
if( !pThis->mpData->maMenubuttonItem.maRect.IsEmpty() )
{
@@ -3226,11 +3228,11 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
// execute pending paint requests
ImplCheckUpdate( pThis );
- sal_Bool bFillColor = pThis->IsFillColor();
- sal_Bool bLineColor = pThis->IsLineColor();
+ BOOL bFillColor = pThis->IsFillColor();
+ BOOL bLineColor = pThis->IsLineColor();
Color aOldFillCol = pThis->GetFillColor();
Color aOldLineCol = pThis->GetLineColor();
- sal_Bool bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
+ BOOL bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
Rectangle aInnerRect( pThis->mpData->maMenubuttonItem.maRect );
if( pThis->mpData->mnMenuButtonWidth > TB_MENUBUTTON_SIZE )
@@ -3270,9 +3272,9 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
if( bHighlight )
{
if( bNativeButtons )
- ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, sal_False, sal_True, sal_False );
+ ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, FALSE, TRUE, FALSE );
else
- pThis->DrawSelectionBackground( aInnerRect, 2, sal_False, sal_False, sal_False );
+ pThis->DrawSelectionBackground( aInnerRect, 2, FALSE, FALSE, FALSE );
}
else
{
@@ -3294,7 +3296,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
aRect.Left() = aRect.Right() - aRect.getWidth()/3;
if( pThis->mpData->maMenuType & TOOLBOX_MENUTYPE_CUSTOMIZE )
- ImplDrawDropdownArrow( pThis, aRect, sal_True, !pThis->mbHorz );
+ ImplDrawDropdownArrow( pThis, aRect, TRUE, !pThis->mbHorz );
if( pThis->ImplHasClippedItems() )
{
@@ -3304,7 +3306,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
else
aRect.Right() = aRect.Left() + aRect.getWidth()/3;
- ImplDrawMoreIndicator( pThis, aRect, sal_True, !pThis->mbHorz );
+ ImplDrawMoreIndicator( pThis, aRect, TRUE, !pThis->mbHorz );
}
// store highlight state
@@ -3324,30 +3326,30 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn )
+void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_Bool bTmpUpper;
- sal_Bool bTmpLower;
+ BOOL bTmpUpper;
+ BOOL bTmpLower;
if ( maUpperRect.IsEmpty() || maLowerRect.IsEmpty() )
return;
if ( mnCurLine > 1 )
- bTmpUpper = sal_True;
+ bTmpUpper = TRUE;
else
- bTmpUpper = sal_False;
+ bTmpUpper = FALSE;
if ( mnCurLine+mnVisLines-1 < mnCurLines )
- bTmpLower = sal_True;
+ bTmpLower = TRUE;
else
- bTmpLower = sal_False;
+ bTmpLower = FALSE;
if ( !IsEnabled() )
{
- bTmpUpper = sal_False;
- bTmpLower = sal_False;
+ bTmpUpper = FALSE;
+ bTmpLower = FALSE;
}
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
@@ -3356,7 +3358,7 @@ void ToolBox::ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawNext( sal_Bool bIn )
+void ToolBox::ImplDrawNext( BOOL bIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3368,7 +3370,7 @@ void ToolBox::ImplDrawNext( sal_Bool bIn )
// Button malen
long nX = SMALLBUTTON_OFF_NORMAL_X;
long nY = SMALLBUTTON_OFF_NORMAL_Y;
- sal_uInt16 nStyle = 0;
+ USHORT nStyle = 0;
if ( bIn == 1 )
{
nStyle |= BUTTON_DRAW_PRESSED;
@@ -3378,17 +3380,17 @@ void ToolBox::ImplDrawNext( sal_Bool bIn )
aDecoView.DrawButton( maNextToolRect, nStyle );
// Inhalt ausgeben
- sal_Bool bLeft = sal_False;
- sal_Bool bTop = sal_False;
+ BOOL bLeft = FALSE;
+ BOOL bTop = FALSE;
if ( mbHorz )
{
- bLeft = sal_True;
+ bLeft = TRUE;
nX += (maNextToolRect.GetWidth()-6)/2-4;
nY += (maNextToolRect.GetHeight()-6)/2-6;
}
else
{
- bTop = sal_True;
+ bTop = TRUE;
nY += (maNextToolRect.GetHeight()-6)/2-4;
nX += (maNextToolRect.GetWidth()-6)/2-6;
}
@@ -3397,86 +3399,38 @@ void ToolBox::ImplDrawNext( sal_Bool bIn )
nY += maNextToolRect.Top();
SetLineColor();
SetFillColor( COL_LIGHTBLUE );
- ImplDrawToolArrow( this, nX, nY, sal_True, sal_False, bLeft, bTop, 10 );
-}
-
-// -----------------------------------------------------------------------
-
-void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect )
-{
- bool bNativeOk = false;
- ImplToolItem* pItem = &mpData->m_aItems[nPos];
-
- if( IsNativeControlSupported( CTRL_TOOLBAR, PART_SEPARATOR ) )
- {
- ImplControlValue aControlValue;
- ControlState nState = 0;
- bNativeOk = DrawNativeControl( CTRL_TOOLBAR, PART_SEPARATOR,
- rRect, nState, aControlValue, rtl::OUString() );
- }
-
- /* Draw the widget only if it can't be drawn natively. */
- if( !bNativeOk )
- {
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
-
- // no separator before or after windows or at breaks
- if ( pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size()-1 )
- {
- pTempItem = &mpData->m_aItems[nPos+1];
- if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
- {
- long nCenterPos, nSlim;
- SetLineColor( rStyleSettings.GetSeparatorColor() );
- if ( IsHorizontal() )
- {
- nSlim = (pItem->maRect.Bottom() - pItem->maRect.Top ()) / 4;
- nCenterPos = pItem->maRect.Center().X();
- DrawLine( Point( nCenterPos, pItem->maRect.Top() + nSlim ),
- Point( nCenterPos, pItem->maRect.Bottom() - nSlim ) );
- }
- else
- {
- nSlim = (pItem->maRect.Right() - pItem->maRect.Left ()) / 4;
- nCenterPos = pItem->maRect.Center().Y();
- DrawLine( Point( pItem->maRect.Left() + nSlim, nCenterPos ),
- Point( pItem->maRect.Right() - nSlim, nCenterPos ) );
- }
- }
- }
- }
+ ImplDrawToolArrow( this, nX, nY, TRUE, FALSE, bLeft, bTop, 10 );
}
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow )
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow )
{
// draws toolbar button background either native or using a coloured selection
- // if bIsWindow is sal_True, the corresponding item is a control and only a selection border will be drawn
+ // if bIsWindow is TRUE, the corresponding item is a control and only a selection border will be drawn
- sal_Bool bNativeOk = sal_False;
+ BOOL bNativeOk = FALSE;
if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
ControlState nState = 0;
if ( highlight == 1 ) nState |= CTRL_STATE_PRESSED;
- if ( highlight == 2 ) nState |= CTRL_STATE_ROLLOVER;
+ if ( highlight == 2 ) nState |= CTRL_STATE_ROLLOVER;
if ( bEnabled ) nState |= CTRL_STATE_ENABLED;
aControlValue.setTristateVal( bChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
- bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
+ bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
rRect, nState, aControlValue, rtl::OUString() );
}
if( !bNativeOk )
- pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, sal_True, bIsWindow, 2, NULL, NULL );
+ pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL );
}
-void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPaint, sal_Bool bLayout )
+void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3494,8 +3448,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
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;
@@ -3503,40 +3455,13 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// no gradient background for items that have a popup open
- sal_Bool bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
+ BOOL bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
- sal_Bool bHighContrastWhite = sal_False;
+ BOOL bHighContrastWhite = FALSE;
// check the face color as highcontrast indicator
// because the toolbox itself might have a gradient
if( rStyleSettings.GetFaceColor() == Color( COL_WHITE ) )
- bHighContrastWhite = sal_True;
-
- // Compute buttons area.
- Size aBtnSize = pItem->maRect.GetSize();
- if( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
- {
- // separate button not for dropdown only where the whole button is painted
- if ( pItem->mnBits & TIB_DROPDOWN &&
- ((pItem->mnBits & TIB_DROPDOWNONLY) != TIB_DROPDOWNONLY) )
- {
- Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz );
- if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side
- aBtnSize.Width() -= aArrowRect.GetWidth();
- else // dropdown arrow on bottom side
- aBtnSize.Height() -= aArrowRect.GetHeight();
- }
- }
-
- /* Compute the button/separator rectangle here, we'll need it for
- * both the buttons and the separators. */
- Rectangle aButtonRect( pItem->maRect.TopLeft(), aBtnSize );
- long nOffX = SMALLBUTTON_OFF_NORMAL_X;
- long nOffY = SMALLBUTTON_OFF_NORMAL_Y;
- long nImageOffX = 0;
- long nImageOffY = 0;
- long nTextOffX = 0;
- long nTextOffY = 0;
- sal_uInt16 nStyle = 0;
+ bHighContrastWhite = TRUE;
// draw separators in flat style only
if ( !bLayout &&
@@ -3545,7 +3470,31 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
nPos > 0
)
{
- ImplDrawSeparator( nPos, aButtonRect );
+ // no separator before or after windows or at breaks
+ ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
+ if ( pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size()-1 )
+ {
+ pTempItem = &mpData->m_aItems[nPos+1];
+ if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
+ {
+ long nCenterPos, nSlim;
+ SetLineColor( rStyleSettings.GetSeparatorColor() );
+ if ( IsHorizontal() )
+ {
+ nSlim = (pItem->maRect.Bottom() - pItem->maRect.Top ()) / 4;
+ nCenterPos = pItem->maRect.Center().X();
+ DrawLine( Point( nCenterPos, pItem->maRect.Top() + nSlim ),
+ Point( nCenterPos, pItem->maRect.Bottom() - nSlim ) );
+ }
+ else
+ {
+ nSlim = (pItem->maRect.Right() - pItem->maRect.Left ()) / 4;
+ nCenterPos = pItem->maRect.Center().Y();
+ DrawLine( Point( pItem->maRect.Left() + nSlim, nCenterPos ),
+ Point( pItem->maRect.Right() - nSlim, nCenterPos ) );
+ }
+ }
+ }
}
// do nothing if item is no button or will be displayed as window
@@ -3579,18 +3528,18 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
Size aSize( GetCtrlTextWidth( pItem->maText ), GetTextHeight() );
Point aPos( pItem->maRect.Left()+2, pItem->maRect.Top() );
aPos.Y() += (pItem->maRect.GetHeight()-aSize.Height())/2;
- sal_Bool bClip;
+ BOOL bClip;
if ( (aSize.Width() > pItem->maRect.GetWidth()-2) ||
(aSize.Height() > pItem->maRect.GetHeight()-2) )
{
- bClip = sal_True;
+ bClip = 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 = sal_False;
+ bClip = FALSE;
if( bLayout )
{
mpData->m_pLayoutData->m_aLineIndices.push_back( mpData->m_pLayoutData->m_aDisplayText.Len() );
@@ -3609,6 +3558,30 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
return;
}
+ // draw button
+ Size aBtnSize = pItem->maRect.GetSize();
+ if( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
+ {
+ // separate button not for dropdown only where the whole button is painted
+ if ( pItem->mnBits & TIB_DROPDOWN &&
+ ((pItem->mnBits & TIB_DROPDOWNONLY) != TIB_DROPDOWNONLY) )
+ {
+ Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz );
+ if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side
+ aBtnSize.Width() -= aArrowRect.GetWidth();
+ else // dropdown arrow on bottom side
+ aBtnSize.Height() -= aArrowRect.GetHeight();
+ }
+ }
+ Rectangle aButtonRect( pItem->maRect.TopLeft(), aBtnSize );
+ long nOffX = SMALLBUTTON_OFF_NORMAL_X;
+ long nOffY = SMALLBUTTON_OFF_NORMAL_Y;
+ long nImageOffX=0;
+ long nImageOffY=0;
+ long nTextOffX=0;
+ long nTextOffY=0;
+ USHORT nStyle = 0;
+
if ( pItem->meState == STATE_CHECK )
{
nStyle |= BUTTON_DRAW_CHECKED;
@@ -3658,9 +3631,9 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
nOffY += pItem->maRect.Top();
// determine what has to be drawn on the button: image, text or both
- sal_Bool bImage;
- sal_Bool bText;
- ButtonType tmpButtonType = determineButtonType( pItem, meButtonType ); // default to toolbox setting
+ BOOL bImage;
+ BOOL bText;
+ ButtonType tmpButtonType = determineButtonType( pItem, meButtonType ); // default to toolbox setting
pItem->DetermineButtonDrawStyle( tmpButtonType, bImage, bText );
// compute output values
@@ -3678,7 +3651,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if ( bImage && ! bLayout )
{
const Image* pImage;
- if ( bHighlight && (!(pItem->maHighImage)) == sal_False )
+ if ( bHighlight && (!(pItem->maHighImage)) == FALSE )
pImage = &(pItem->maHighImage);
else
pImage = &(pItem->maImage);
@@ -3686,7 +3659,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
aImageSize = pImage->GetSizePixel();
// determine drawing flags
- sal_uInt16 nImageStyle = 0;
+ USHORT nImageStyle = 0;
if ( !pItem->mbEnabled || !IsEnabled() )
nImageStyle |= IMAGE_DRAW_DISABLE;
@@ -3712,12 +3685,12 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
nImageOffX += (nBtnWidth-aImageSize.Width())/2;
nImageOffY += (nBtnHeight-aImageSize.Height())/2;
}
- if ( bHighlight || (pItem->meState == STATE_CHECK) )
+ if ( bHighlight || (pItem->meState == STATE_CHECK) )
{
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
+ ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
if( bHighlight )
{
@@ -3729,7 +3702,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
}
// draw the text
- sal_Bool bRotate = sal_False;
+ BOOL bRotate = FALSE;
if ( bText )
{
nTextOffX = nOffX;
@@ -3740,7 +3713,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if( pItem->mbVisibleText && !ImplIsFloatingMode() &&
((meAlign == WINDOWALIGN_LEFT) || (meAlign == WINDOWALIGN_RIGHT)) )
{
- bRotate = sal_True;
+ bRotate = TRUE;
Font aRotateFont = aOldFont;
/*
@@ -3783,10 +3756,10 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
+ ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
}
- sal_uInt16 nTextStyle = 0;
+ USHORT nTextStyle = 0;
if ( !pItem->mbEnabled )
nTextStyle |= TEXT_DRAW_DISABLE;
if( bLayout )
@@ -3808,10 +3781,10 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if ( pItem->mnBits & TIB_DROPDOWN )
{
Rectangle aDropDownRect( pItem->GetDropDownRect( mbHorz ) );
- sal_Bool bSetColor = sal_True;
+ BOOL bSetColor = TRUE;
if ( !pItem->mbEnabled || !IsEnabled() )
{
- bSetColor = sal_False;
+ bSetColor = FALSE;
SetFillColor( rStyleSettings.GetShadowColor() );
}
@@ -3825,7 +3798,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False );
+ ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), FALSE );
}
}
ImplDrawDropdownArrow( this, aDropDownRect, bSetColor, bRotate );
@@ -3840,7 +3813,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
void ToolBox::ImplStartCustomizeMode()
{
- mbCustomizeMode = sal_True;
+ mbCustomizeMode = TRUE;
mpData->ImplClearLayoutData();
@@ -3859,7 +3832,7 @@ void ToolBox::ImplStartCustomizeMode()
}
}
-void ToolBox::SetCustomizeMode( sal_Bool bSet )
+void ToolBox::SetCustomizeMode( BOOL bSet )
{
if ( bSet )
ImplStartCustomizeMode();
@@ -3871,7 +3844,7 @@ void ToolBox::SetCustomizeMode( sal_Bool bSet )
void ToolBox::ImplEndCustomizeMode()
{
- mbCustomizeMode = sal_False;
+ mbCustomizeMode = FALSE;
mpData->ImplClearLayoutData();
@@ -3927,7 +3900,7 @@ void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem )
}
}
-void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow )
+void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3936,9 +3909,9 @@ void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow )
mpFloatWin = pFloatWindow;
// redraw item, to trigger drawing of a special border
- ImplDrawItem( mnCurPos, sal_True );
+ ImplDrawItem( mnCurPos, TRUE );
- mbDrag = sal_False;
+ mbDrag = FALSE;
EndTracking();
ReleaseMouse();
}
@@ -3948,9 +3921,9 @@ void ToolBox::ImplFloatControl( sal_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
- sal_Bool bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
-
+ BOOL bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
+
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
ImplDrawItem( mnCurPos, bWasKeyboardActivate ? 2 : 0 );
Deactivate();
@@ -3968,15 +3941,15 @@ void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow )
// -----------------------------------------------------------------------
-void ToolBox::ShowLine( sal_Bool bNext )
+void ToolBox::ShowLine( BOOL bNext )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- mbFormat = sal_True;
+ mbFormat = TRUE;
if ( mpData->mbPageScroll )
{
- sal_uInt16 delta = mnVisLines;
+ USHORT delta = mnVisLines;
if ( bNext )
{
mnCurLine = mnCurLine + delta;
@@ -3989,7 +3962,7 @@ void ToolBox::ShowLine( sal_Bool bNext )
mnCurLine = mnCurLine - delta;
else
mnCurLine = 1;
- }
+ }
}
else
{
@@ -4004,7 +3977,7 @@ void ToolBox::ShowLine( sal_Bool bNext )
// -----------------------------------------------------------------------
-sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat )
+BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
{
Point aMousePos = rMEvt.GetPosPixel();
@@ -4017,7 +3990,7 @@ sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat
{
if ( !mnCurItemId )
{
- ImplDrawItem( mnCurPos, sal_True );
+ ImplDrawItem( mnCurPos, TRUE );
mnCurItemId = pItem->mnId;
Highlight();
}
@@ -4036,48 +4009,48 @@ sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat
}
}
- return sal_True;
+ return TRUE;
}
if ( mbUpper )
{
- sal_Bool bNewIn = maUpperRect.IsInside( aMousePos );
+ BOOL bNewIn = maUpperRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( mbIn, sal_False );
+ ImplDrawSpin( mbIn, FALSE );
}
- return sal_True;
+ return TRUE;
}
if ( mbLower )
{
- sal_Bool bNewIn = maLowerRect.IsInside( aMousePos );
+ BOOL bNewIn = maLowerRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( sal_False, mbIn );
+ ImplDrawSpin( FALSE, mbIn );
}
- return sal_True;
+ return TRUE;
}
if ( mbNextTool )
{
- sal_Bool bNewIn = maNextToolRect.IsInside( aMousePos );
+ BOOL bNewIn = maNextToolRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
ImplDrawNext( mbIn );
}
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel )
+BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
{
ImplDisableFlatButtons();
@@ -4087,7 +4060,7 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa
{
mpData->maDropdownTimer.Stop();
}
-
+
if ( mbDrag || mbSelection )
{
// Hier die MouseDaten setzen, wenn Selection-Modus, da dann kein
@@ -4101,12 +4074,12 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa
Deactivate();
if ( mbDrag )
- mbDrag = sal_False;
+ mbDrag = FALSE;
else
{
- mbSelection = sal_False;
+ mbSelection = FALSE;
if ( mnCurPos == TOOLBOX_ITEM_NOTFOUND )
- return sal_True;
+ return TRUE;
}
// Wurde Maus ueber dem Item losgelassen
@@ -4144,7 +4117,7 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa
ImplAddDel( &aDelData );
Select();
if ( aDelData.IsDelete() )
- return sal_True;
+ return TRUE;
ImplRemoveDel( &aDelData );
}
}
@@ -4156,11 +4129,11 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa
// Items nicht geloescht, im Select-Handler
if ( mnCurItemId )
{
- sal_Bool bHighlight;
+ BOOL bHighlight;
if ( (mnCurItemId == mnHighItemId) && (mnOutStyle & TOOLBOX_STYLE_FLAT) )
bHighlight = 2;
else
- bHighlight = sal_False;
+ bHighlight = FALSE;
// Get current pos for the case that items are inserted/removed
// in the toolBox
mnCurPos = GetItemPos( mnCurItemId );
@@ -4178,28 +4151,28 @@ sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCa
mnDownItemId = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- return sal_True;
+ return TRUE;
}
else if ( mbUpper || mbLower )
{
if ( mbIn )
ShowLine( !mbUpper );
- mbUpper = sal_False;
- mbLower = sal_False;
- mbIn = sal_False;
- ImplDrawSpin( sal_False, sal_False );
- return sal_True;
+ mbUpper = FALSE;
+ mbLower = FALSE;
+ mbIn = FALSE;
+ ImplDrawSpin( FALSE, FALSE );
+ return TRUE;
}
else if ( mbNextTool )
{
- mbNextTool = sal_False;
- mbIn = sal_False;
- ImplDrawNext( sal_False );
+ mbNextTool = FALSE;
+ mbIn = FALSE;
+ ImplDrawNext( FALSE );
NextToolBox();
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -4221,10 +4194,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
- sal_Bool bDrawHotSpot = sal_True;
+ BOOL bDrawHotSpot = TRUE;
Window *pWin = Application::GetFocusWindow();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox && pWin != this )
- bDrawHotSpot = sal_False;
+ bDrawHotSpot = FALSE;
/*
else
if( pWin && !pWin->ImplGetWindowImpl()->mbToolBox )
@@ -4233,7 +4206,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
pWin = pWin->GetParent();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox )
{
- bDrawHotSpot = sal_False;
+ bDrawHotSpot = FALSE;
break;
}
}
@@ -4241,8 +4214,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mbSelection && bDrawHotSpot )
{
- sal_uInt16 i = 0;
- sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ USHORT i = 0;
+ USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4285,7 +4258,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
{
mnCurItemId = mnHighItemId = it->mnId;
- ImplDrawItem( mnCurPos, 2 /*sal_True*/ ); // always use shadow effect (2)
+ ImplDrawItem( mnCurPos, 2 /*TRUE*/ ); // always use shadow effect (2)
}
else
mnCurItemId = mnHighItemId = 0;
@@ -4313,7 +4286,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE )
{
- sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
+ USHORT nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
if ( nLinePtr & DOCK_LINEHSIZE )
{
if ( meAlign == WINDOWALIGN_LEFT )
@@ -4356,7 +4329,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( bDrawHotSpot && ( ((eStyle == POINTER_ARROW) && (mnOutStyle & TOOLBOX_STYLE_HANDPOINTER)) ||
(mnOutStyle & TOOLBOX_STYLE_FLAT) || !mnOutStyle ) )
{
- sal_Bool bClearHigh = sal_True;
+ BOOL bClearHigh = TRUE;
if ( !rMEvt.IsLeaveWindow() && (mnCurPos == TOOLBOX_ITEM_NOTFOUND) )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4368,21 +4341,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) )
{
- bClearHigh = sal_False;
+ bClearHigh = FALSE;
if ( mnHighItemId != it->mnId )
{
- sal_uInt16 nTempPos = sal::static_int_cast<sal_uInt16>(it - mpData->m_aItems.begin());
+ USHORT nTempPos = sal::static_int_cast<USHORT>(it - mpData->m_aItems.begin());
if ( mnHighItemId )
{
ImplHideFocus();
- sal_uInt16 nPos = GetItemPos( mnHighItemId );
+ USHORT nPos = GetItemPos( mnHighItemId );
ImplDrawItem( nPos );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, sal_False );
+ ImplDrawMenubutton( this, FALSE );
}
mnHighItemId = it->mnId;
ImplDrawItem( nTempPos, 2 );
@@ -4401,21 +4374,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
// only clear highlight when focus is not in toolbar
- sal_Bool bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
+ BOOL bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
if ( bClearHigh || bMenuButtonHit )
{
if ( !bMenuButtonHit && mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, sal_False );
+ ImplDrawMenubutton( this, FALSE );
}
if( mnHighItemId )
{
- sal_uInt16 nClearPos = GetItemPos( mnHighItemId );
+ USHORT nClearPos = GetItemPos( mnHighItemId );
if ( nClearPos != TOOLBOX_ITEM_NOTFOUND )
{
- ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? sal_True : sal_False );
+ ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? TRUE : FALSE );
if( nClearPos != mnCurPos )
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) );
}
@@ -4425,7 +4398,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if( bMenuButtonHit )
{
- ImplDrawMenubutton( this, sal_True );
+ ImplDrawMenubutton( this, TRUE );
}
}
}
@@ -4460,8 +4433,8 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
}
Point aMousePos = rMEvt.GetPosPixel();
- sal_uInt16 i = 0;
- sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ USHORT i = 0;
+ USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4496,12 +4469,12 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
Rectangle aItemRect = GetItemRect( it->mnId );
mnConfigItem = it->mnId;
- sal_Bool bResizeItem;
+ BOOL bResizeItem;
if ( mbCustomizeMode && it->mbShowWindow &&
(it->maRect.Right()-TB_RESIZE_OFFSET <= aMousePos.X()) )
- bResizeItem = sal_True;
+ bResizeItem = TRUE;
else
- bResizeItem = sal_False;
+ bResizeItem = FALSE;
pMgr->StartDragging( this, aMousePos, aItemRect, 0, bResizeItem );
return;
}
@@ -4515,7 +4488,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Aktuelle Daten setzen
- sal_uInt16 nTrackFlags = 0;
+ USHORT nTrackFlags = 0;
mnCurPos = i;
mnCurItemId = it->mnId;
mnDownItemId = mnCurItemId;
@@ -4527,13 +4500,13 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbSelection )
{
- ImplDrawItem( mnCurPos, sal_True );
+ ImplDrawItem( mnCurPos, TRUE );
Highlight();
}
else
{
// Hier schon bDrag setzen, da in EndSelection ausgewertet wird
- mbDrag = sal_True;
+ mbDrag = TRUE;
// Bei Doppelklick nur den Handler rufen, aber bevor der
// Button gehiltet wird, da evt. in diesem Handler der
@@ -4544,7 +4517,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbDrag )
{
- ImplDrawItem( mnCurPos, sal_True );
+ ImplDrawItem( mnCurPos, TRUE );
Highlight();
}
@@ -4556,7 +4529,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 = sal_False;
+ mpData->mbDropDownByKeyboard = FALSE;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -4565,7 +4538,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, sal_False );
+ ImplDrawItem( mnCurPos, FALSE );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -4615,9 +4588,9 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine > 1 )
{
StartTracking();
- mbUpper = sal_True;
- mbIn = sal_True;
- ImplDrawSpin( sal_True, sal_False );
+ mbUpper = TRUE;
+ mbIn = TRUE;
+ ImplDrawSpin( TRUE, FALSE );
}
return;
}
@@ -4626,25 +4599,25 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine+mnVisLines-1 < mnCurLines )
{
StartTracking();
- mbLower = sal_True;
- mbIn = sal_True;
- ImplDrawSpin( sal_False, sal_True );
+ mbLower = TRUE;
+ mbIn = TRUE;
+ ImplDrawSpin( FALSE, TRUE );
}
return;
}
if ( maNextToolRect.IsInside( aMousePos ) )
{
StartTracking();
- mbNextTool = sal_True;
- mbIn = sal_True;
- ImplDrawNext( sal_True );
+ mbNextTool = TRUE;
+ mbIn = TRUE;
+ ImplDrawNext( TRUE );
return;
}
// Linesizing testen
if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING )
{
- sal_uInt16 nLineMode = ImplTestLineSize( this, aMousePos );
+ USHORT nLineMode = ImplTestLineSize( this, aMousePos );
if ( nLineMode )
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
@@ -4659,7 +4632,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Dragging starten
pMgr->StartDragging( this, aMousePos, Rectangle( aPos, aSize ),
- nLineMode, sal_False );
+ nLineMode, FALSE );
return;
}
}
@@ -4688,7 +4661,7 @@ void ToolBox::MouseButtonUp( const MouseEvent& rMEvt )
pMgr->EndDragging();
return;
}
- mbCommandDrag = sal_False;
+ mbCommandDrag = FALSE;
DockingWindow::MouseButtonUp( rMEvt );
}
@@ -4719,9 +4692,9 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if( mpData->mbIsPaintLocked )
return;
if ( rPaintRect == Rectangle( 0, 0, mnDX-1, mnDY-1 ) )
- mbFullPaint = sal_True;
+ mbFullPaint = TRUE;
ImplFormat();
- mbFullPaint = sal_False;
+ mbFullPaint = FALSE;
ImplDrawBackground( this, rPaintRect );
@@ -4738,28 +4711,28 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if ( mnWinStyle & WB_SCROLL )
{
if ( mnCurLines > mnLines )
- ImplDrawSpin( sal_False, sal_False );
+ ImplDrawSpin( FALSE, FALSE );
}
// NextButton zeichnen
- ImplDrawNext( sal_False );
+ ImplDrawNext( FALSE );
// Buttons zeichnen
- sal_uInt16 nHighPos;
+ USHORT nHighPos;
if ( mnHighItemId )
nHighPos = GetItemPos( mnHighItemId );
else
nHighPos = TOOLBOX_ITEM_NOTFOUND;
- sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ USHORT nCount = (USHORT)mpData->m_aItems.size();
+ for( USHORT 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 ) )
{
- sal_Bool bHighlight = sal_False;
+ BOOL bHighlight = FALSE;
if ( i == mnCurPos )
bHighlight = 1;
else if ( i == nHighPos )
@@ -4780,7 +4753,7 @@ void ToolBox::Move()
// -----------------------------------------------------------------------
void ToolBox::Resize()
-{
+{
Size aSize = GetOutputSizePixel();
// #i31422# some WindowManagers send (0,0) sizes when
// switching virtual desktops - ignore this and avoid reformatting
@@ -4802,9 +4775,9 @@ void ToolBox::Resize()
{
if ( !mbFormat )
{
- mbFormat = sal_True;
+ mbFormat = TRUE;
if( IsReallyVisible() )
- ImplFormat( sal_True );
+ ImplFormat( TRUE );
}
}
@@ -4836,21 +4809,21 @@ void ToolBox::Resize()
}
// -----------------------------------------------------------------------
-const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
+const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || 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->maHelpId.getLength() )
- pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
+ if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
}
}
@@ -4864,7 +4837,7 @@ const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
- sal_uInt16 nItemId;
+ USHORT nItemId;
Point aHelpPos;
if( !rHEvt.KeyboardActivated() )
@@ -4916,9 +4889,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- rtl::OString aHelpId( GetHelpId( nItemId ) );
-
- if ( aCommand.Len() || aHelpId.getLength() )
+ ULONG nHelpId = GetHelpId( nItemId );
+
+ if ( aCommand.Len() || nHelpId )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4926,8 +4899,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( aHelpId.getLength() )
- pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
+ else if ( nHelpId )
+ pHelp->Start( nHelpId, this );
}
return;
}
@@ -4965,20 +4938,20 @@ long ToolBox::Notify( NotifyEvent& rNEvt )
{
KeyEvent aKEvt = *rNEvt.GetKeyEvent();
KeyCode aKeyCode = aKEvt.GetKeyCode();
- sal_uInt16 nKeyCode = aKeyCode.GetCode();
+ USHORT 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
- sal_Bool bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL &&
+ 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() ? sal_True : sal_False , bNoTabCycling ) )
- return sal_False;
+ else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? TRUE : FALSE , bNoTabCycling ) )
+ return FALSE;
else
return DockingWindow::Notify( rNEvt );
}
@@ -4999,9 +4972,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( sal_False );
+ ImplChangeHighlightUpDn( FALSE );
else
- ImplChangeHighlightUpDn( sal_True );
+ ImplChangeHighlightUpDn( TRUE );
mnLastFocusItemId = 0;
@@ -5066,7 +5039,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
// dann mache nichts
if ( (it->meType == TOOLBOXITEM_BUTTON) &&
!it->mbShowWindow )
- mbCommandDrag = sal_True;
+ mbCommandDrag = TRUE;
break;
}
@@ -5090,10 +5063,10 @@ void ToolBox::Command( const CommandEvent& rCEvt )
if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
{
if ( (mnCurLine > 1) && (pData->GetDelta() > 0) )
- ShowLine( sal_False );
+ ShowLine( FALSE );
else if ( (mnCurLine+mnVisLines-1 < mnCurLines) && (pData->GetDelta() < 0) )
- ShowLine( sal_True );
- ImplDrawSpin( sal_False, sal_False );
+ ShowLine( TRUE );
+ ImplDrawSpin( FALSE, FALSE );
return;
}
}
@@ -5120,19 +5093,19 @@ void ToolBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbCalc = sal_True;
- mbFormat = sal_True;
- ImplInitSettings( sal_True, sal_False, sal_False );
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, FALSE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( FALSE, TRUE, FALSE );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background
+ ImplInitSettings( FALSE, FALSE, TRUE ); // font, foreground, background
Invalidate();
}
}
@@ -5149,16 +5122,16 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbCalc = sal_True;
- mbFormat = sal_True;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, TRUE, TRUE );
Invalidate();
}
}
// -----------------------------------------------------------------------
-sal_Bool ToolBox::PrepareToggleFloatingMode()
+BOOL ToolBox::PrepareToggleFloatingMode()
{
return DockingWindow::PrepareToggleFloatingMode();
}
@@ -5169,27 +5142,27 @@ void ToolBox::ToggleFloatingMode()
{
DockingWindow::ToggleFloatingMode();
- sal_Bool mbOldHorz = mbHorz;
+ BOOL mbOldHorz = mbHorz;
if ( ImplIsFloatingMode() )
{
- mbHorz = sal_True;
+ mbHorz = TRUE;
meAlign = WINDOWALIGN_TOP;
- mbScroll = sal_True;
+ mbScroll = TRUE;
if( mbOldHorz != mbHorz )
- mbCalc = sal_True; // orientation was changed !
+ mbCalc = TRUE; // orientation was changed !
ImplSetMinMaxFloatSize( this );
SetOutputSizePixel( ImplCalcFloatSize( this, mnFloatLines ) );
}
else
{
- mbScroll = (mnWinStyle & WB_SCROLL) ? sal_True : sal_False;
+ mbScroll = (mnWinStyle & WB_SCROLL) ? TRUE : FALSE;
if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) )
- mbHorz = sal_True;
+ mbHorz = TRUE;
else
- mbHorz = sal_False;
+ mbHorz = FALSE;
// set focus back to document
ImplGetFrameWindow()->GetWindow( WINDOW_CLIENT )->GrabFocus();
@@ -5199,11 +5172,11 @@ void ToolBox::ToggleFloatingMode()
{
// if orientation changes, the toolbox has to be initialized again
// to update the direction of the gradient
- mbCalc = sal_True;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ mbCalc = TRUE;
+ ImplInitSettings( TRUE, TRUE, TRUE );
}
- mbFormat = sal_True;
+ mbFormat = TRUE;
ImplFormat();
}
@@ -5219,13 +5192,13 @@ void ToolBox::StartDocking()
// -----------------------------------------------------------------------
-sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
+BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
{
// Wenn Dragging, dann nicht machen, da vorher schon berechnet
if ( mbDragging )
- return sal_False;
+ return FALSE;
- sal_Bool bFloatMode = sal_False;
+ BOOL bFloatMode = FALSE;
DockingWindow::Docking( rPos, rRect );
@@ -5238,7 +5211,7 @@ sal_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
- sal_uInt16 nTemp = 0;
+ USHORT 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
@@ -5273,7 +5246,7 @@ sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// FloatWindow werden
Rectangle aIntersect = aInRect.GetIntersection( aDockingRect );
if ( aIntersect == aDockingRect )
- bFloatMode = sal_True;
+ bFloatMode = TRUE;
else
{
// docking rectangle is in the "sensible area"
@@ -5327,14 +5300,14 @@ sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
}
}
else
- bFloatMode = sal_True;
+ bFloatMode = TRUE;
if ( bFloatMode )
{
meDockAlign = meAlign;
if ( !mbLastFloatMode )
{
- sal_uInt16 nTemp = 0;
+ USHORT nTemp = 0;
aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) );
}
}
@@ -5347,7 +5320,7 @@ sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// -----------------------------------------------------------------------
-void ToolBox::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
+void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
{
if ( !IsDockingCanceled() )
{
@@ -5364,8 +5337,8 @@ void ToolBox::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
void ToolBox::Resizing( Size& rSize )
{
- sal_uInt16 nCalcLines;
- sal_uInt16 nTemp;
+ USHORT nCalcLines;
+ USHORT nTemp;
// Alle Floatinggroessen berechnen
ImplCalcFloatSizes( this );
@@ -5401,27 +5374,27 @@ void ToolBox::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const
+Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines ) const
{
return ImplCalcSize( this, nCalcLines );
}
-Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const
+Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const
{
return ImplCalcSize( this, nCalcLines,
(eAlign == WINDOWALIGN_TOP || eAlign == WINDOWALIGN_BOTTOM) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT );
}
-sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
+USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
{
- sal_uInt16 nLines = 0;
-
+ USHORT nLines = 0;
+
std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
{
if( it->meType == TOOLBOXITEM_BREAK )
- ++nLines;
- ++it;
+ nLines++;
+ it++;
}
return nLines;
}
@@ -5429,19 +5402,19 @@ sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
Size ToolBox::CalcPopupWindowSizePixel() const
{
// count number of breaks and calc corresponding floating window size
- sal_uInt16 nLines = ImplCountLineBreaks( this );
-
+ USHORT nLines = ImplCountLineBreaks( this );
+
if( nLines )
- ++nLines; // add the first line
+ nLines++; // add the first line
else
{
// no breaks found: use quadratic layout
- nLines = (sal_uInt16) ceil( sqrt( (double) GetItemCount() ) );
+ nLines = (USHORT) ceil( sqrt( (double) GetItemCount() ) );
}
- sal_Bool bPopup = mpData->mbAssumePopupMode;
+ BOOL bPopup = mpData->mbAssumePopupMode;
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumePopupMode = sal_True;
+ pThis->mpData->mbAssumePopupMode = TRUE;
Size aSize = CalcFloatingWindowSizePixel( nLines );
@@ -5451,24 +5424,24 @@ Size ToolBox::CalcPopupWindowSizePixel() const
Size ToolBox::CalcFloatingWindowSizePixel() const
{
- sal_uInt16 nLines = ImplCountLineBreaks( this );
- ++nLines; // add the first line
+ USHORT nLines = ImplCountLineBreaks( this );
+ nLines++; // add the first line
return CalcFloatingWindowSizePixel( nLines );
}
-Size ToolBox::CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const
+Size ToolBox::CalcFloatingWindowSizePixel( USHORT nCalcLines ) const
{
- sal_Bool bFloat = mpData->mbAssumeFloating;
- sal_Bool bDocking = mpData->mbAssumeDocked;
+ BOOL bFloat = mpData->mbAssumeFloating;
+ BOOL bDocking = mpData->mbAssumeDocked;
// simulate floating mode and force reformat before calculating
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumeFloating = sal_True;
- pThis->mpData->mbAssumeDocked = sal_False;
+ pThis->mpData->mbAssumeFloating = TRUE;
+ pThis->mpData->mbAssumeDocked = FALSE;
Size aSize = ImplCalcFloatSize( (ToolBox*) this, nCalcLines );
- pThis->mbFormat = sal_True;
+ pThis->mbFormat = TRUE;
pThis->mpData->mbAssumeFloating = bFloat;
pThis->mpData->mbAssumeDocked = bDocking;
@@ -5493,7 +5466,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
pToolBox->CopyItem( *this, it->mnId );
if( (it->meType != TOOLBOXITEM_BUTTON) ||
!it->mbVisible || ImplIsFixedControl( &(*it) ) )
- ++it;
+ it++;
else
break;
}
@@ -5520,7 +5493,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
// -----------------------------------------------------------------------
-void ToolBox::EnableCustomize( sal_Bool bEnable )
+void ToolBox::EnableCustomize( BOOL bEnable )
{
if ( bEnable != mbCustomize )
{
@@ -5528,9 +5501,9 @@ void ToolBox::EnableCustomize( sal_Bool bEnable )
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
if ( bEnable )
- pMgr->push_back( this );
+ pMgr->Insert( this );
else
- pMgr->erase( this );
+ pMgr->Remove( this );
}
}
@@ -5550,7 +5523,7 @@ void ToolBox::StartCustomize( const Rectangle& rRect, void* pData )
aMousePos = ScreenToOutputPixel( aPos );
Pointer aPtr;
SetPointer( aPtr );
- pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData );
+ pMgr->StartDragging( this, aMousePos, aRect, 0, FALSE, pData );
}
// -----------------------------------------------------------------------
@@ -5571,7 +5544,7 @@ void ToolBox::EndCustomizeMode()
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsCustomizeMode()
+BOOL ToolBox::IsCustomizeMode()
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
return pMgr->IsCustomizeMode();
@@ -5588,7 +5561,7 @@ void ToolBox::GetFocus()
void ToolBox::LoseFocus()
{
- ImplChangeHighlight( NULL, sal_True );
+ ImplChangeHighlight( NULL, TRUE );
DockingWindow::LoseFocus();
}
@@ -5596,10 +5569,10 @@ void ToolBox::LoseFocus()
// -----------------------------------------------------------------------
// performs the action associated with an item, ie simulates clicking the item
-void ToolBox::TriggerItem( sal_uInt16 nItemId, sal_Bool bShift, sal_Bool bCtrl )
+void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl )
{
mnHighItemId = nItemId;
- sal_uInt16 nModifier = 0;
+ USHORT nModifier = 0;
if( bShift )
nModifier |= KEY_SHIFT;
if( bCtrl )
@@ -5611,24 +5584,24 @@ void ToolBox::TriggerItem( sal_uInt16 nItemId, sal_Bool bShift, sal_Bool bCtrl )
// -----------------------------------------------------------------------
// calls the button's action handler
-// returns sal_True if action was called
-sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode )
+// returns TRUE if action was called
+BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
{
- sal_Bool bRet = sal_True;
+ BOOL bRet = TRUE;
if( mnHighItemId )
{
ImplToolItem *pToolItem = ImplGetItem( mnHighItemId );
// #107712#, activate can also be called for disabled entries
if( pToolItem && !pToolItem->mbEnabled )
- return sal_True;
+ return TRUE;
if( pToolItem && pToolItem->mpWindow && HasFocus() )
{
ImplHideFocus();
- mbChangingHighlight = sal_True; // avoid focus change due to loose focus
+ mbChangingHighlight = TRUE; // avoid focus change due to loose focus
pToolItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = sal_False;
+ mbChangingHighlight = FALSE;
}
else
{
@@ -5650,7 +5623,7 @@ sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode )
}
}
mnMouseModifier = aKeyCode.GetModifier();
- mbIsKeyEvent = sal_True;
+ mbIsKeyEvent = TRUE;
Activate();
Click();
@@ -5663,18 +5636,18 @@ sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode )
ImplRemoveDel( &aDelData );
Deactivate();
- mbIsKeyEvent = sal_False;
+ mbIsKeyEvent = FALSE;
mnMouseModifier = 0;
}
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
// -----------------------------------------------------------------------
-sal_Bool ImplCloseLastPopup( Window *pParent )
+BOOL ImplCloseLastPopup( Window *pParent )
{
// close last popup toolbox (see also:
// ImplHandleMouseFloatMode(...) in winproc.cxx )
@@ -5686,23 +5659,23 @@ sal_Bool ImplCloseLastPopup( Window *pParent )
if( pLastLevelFloat && pLastLevelFloat != pParent )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
// opens a drop down toolbox item
-// returns sal_True if item was opened
-sal_Bool ToolBox::ImplOpenItem( KeyCode aKeyCode )
+// returns TRUE if item was opened
+BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode )
{
- sal_uInt16 nCode = aKeyCode.GetCode();
- sal_Bool bRet = sal_True;
+ USHORT nCode = aKeyCode.GetCode();
+ BOOL bRet = 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 sal_False;
+ return FALSE;
if( IsMenuEnabled() && mpData->mbMenubuttonSelected )
{
@@ -5722,19 +5695,19 @@ sal_Bool ToolBox::ImplOpenItem( KeyCode aKeyCode )
mnCurPos = GetItemPos( mnCurItemId );
mnLastFocusItemId = mnCurItemId; // save item id for possible later focus restore
mnMouseModifier = aKeyCode.GetModifier();
- mbIsShift = sal_True;
- mbIsKeyEvent = sal_True;
+ mbIsShift = TRUE;
+ mbIsKeyEvent = TRUE;
Activate();
- mpData->mbDropDownByKeyboard = sal_True;
+ mpData->mbDropDownByKeyboard = TRUE;
GetDropdownClickHdl().Call( this );
- mbIsKeyEvent = sal_False;
- mbIsShift = sal_False;
+ mbIsKeyEvent = FALSE;
+ mbIsShift = FALSE;
mnMouseModifier = 0;
}
else
- bRet = sal_False;
+ bRet = FALSE;
return bRet;
}
@@ -5745,10 +5718,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
mnKeyModifier = aKeyCode.GetModifier();
- 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;
+ USHORT nCode = aKeyCode.GetCode();
+ BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
+ BOOL bForwardKey = FALSE;
+ BOOL bGrabFocusToDocument = FALSE;
// #107776# we might be destroyed in the keyhandler
ImplDelData aDelData;
@@ -5759,40 +5732,40 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
case KEY_UP:
{
// Ctrl-Cursor activates next toolbox, indicated by a blue arrow pointing to the left/up
- if( aKeyCode.GetModifier() ) // allow only pure cursor keys
+ if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( sal_True );
+ ImplChangeHighlightUpDn( TRUE );
else
ImplOpenItem( aKeyCode );
}
break;
case KEY_LEFT:
{
- if( aKeyCode.GetModifier() ) // allow only pure cursor keys
+ if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( sal_True );
+ ImplChangeHighlightUpDn( TRUE );
else
ImplOpenItem( aKeyCode );
}
break;
case KEY_DOWN:
{
- if( aKeyCode.GetModifier() ) // allow only pure cursor keys
+ if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( sal_False );
+ ImplChangeHighlightUpDn( FALSE );
else
ImplOpenItem( aKeyCode );
}
break;
case KEY_RIGHT:
{
- if( aKeyCode.GetModifier() ) // allow only pure cursor keys
+ if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( sal_False );
+ ImplChangeHighlightUpDn( FALSE );
else
ImplOpenItem( aKeyCode );
}
@@ -5804,9 +5777,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine - mnVisLines;
else
mnCurLine = 1;
- mbFormat = sal_True;
+ mbFormat = TRUE;
ImplFormat();
- ImplDrawSpin( sal_False, sal_False );
+ ImplDrawSpin( FALSE, FALSE );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
@@ -5817,22 +5790,22 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine + mnVisLines;
else
mnCurLine = mnCurLines;
- mbFormat = sal_True;
+ mbFormat = TRUE;
ImplFormat();
- ImplDrawSpin( sal_False, sal_False );
+ ImplDrawSpin( FALSE, FALSE );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
case KEY_END:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( sal_False );
+ ImplChangeHighlightUpDn( FALSE );
}
break;
case KEY_HOME:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( sal_True );
+ ImplChangeHighlightUpDn( TRUE );
}
break;
case KEY_ESCAPE:
@@ -5865,7 +5838,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( !pItem->mbEnabled )
{
Sound::Beep( SOUND_DISABLE, this );
- bGrabFocusToDocument = sal_True;
+ bGrabFocusToDocument = TRUE;
}
}
if( !bGrabFocusToDocument )
@@ -5874,7 +5847,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
break;
default:
{
- sal_uInt16 aKeyGroup = aKeyCode.GetGroup();
+ USHORT aKeyGroup = aKeyCode.GetGroup();
ImplToolItem *pItem = NULL;
if( mnHighItemId )
pItem = ImplGetItem( mnHighItemId );
@@ -5883,9 +5856,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
Window *pFocusWindow = Application::GetFocusWindow();
ImplHideFocus();
- mbChangingHighlight = sal_True; // avoid focus change due to loose focus
+ mbChangingHighlight = TRUE; // avoid focus change due to loose focus
pItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = sal_False;
+ mbChangingHighlight = FALSE;
if( pFocusWindow != Application::GetFocusWindow() )
Application::GetFocusWindow()->KeyInput( rKEvt );
}
@@ -5895,7 +5868,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 = sal_True;
+ bForwardKey = TRUE;
}
}
}
@@ -5907,7 +5880,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)
{
- sal_uInt16 n = 0;
+ USHORT n = 0;
Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFocusControl && pFocusControl != this )
pFocusControl->ImplControlFocus( GETFOCUS_INIT );
@@ -5929,14 +5902,14 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// -----------------------------------------------------------------------
// returns the current toolbox line of the item
-sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
+USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
- sal_uInt16 nLine = 1;
+ USHORT nLine = 1;
while( it != mpData->m_aItems.end() )
{
if ( it->mbBreak )
- ++nLine;
+ nLine++;
if( &(*it) == pCurrentItem)
break;
++it;
@@ -5945,7 +5918,7 @@ sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
}
// returns the first displayable item in the given line
-ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
+ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -5977,7 +5950,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
}
// returns the last displayable item in the given line
-ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine )
+ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -6011,46 +5984,46 @@ ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine )
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
+USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
{
if( pItem )
{
- sal_uInt16 nPos;
- for( nPos = 0; nPos < rList.size(); ++nPos )
+ USHORT nPos;
+ for( nPos = 0; nPos < rList.size(); nPos++ )
if( &rList[ nPos ] == pItem )
return nPos;
}
return TOOLBOX_ITEM_NOTFOUND;
}
-void ToolBox::ChangeHighlight( sal_uInt16 nPos )
+void ToolBox::ChangeHighlight( USHORT nPos )
{
if ( nPos < GetItemCount() ) {
ImplGrabFocus( 0 );
- ImplChangeHighlight ( ImplGetItem ( GetItemId ( (sal_uInt16) nPos ) ), sal_False );
+ ImplChangeHighlight ( ImplGetItem ( GetItemId ( (USHORT) nPos ) ), FALSE );
}
}
-void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus )
+void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
{
// avoid recursion due to focus change
if( mbChangingHighlight )
return;
- mbChangingHighlight = sal_True;
+ mbChangingHighlight = TRUE;
ImplToolItem* pOldItem = NULL;
if ( mnHighItemId )
{
ImplHideFocus();
- sal_uInt16 nPos = GetItemPos( mnHighItemId );
+ USHORT 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, sal_False );
+ ImplDrawItem( nPos, FALSE );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
@@ -6062,21 +6035,21 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus )
if( pItem )
{
- sal_uInt16 aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
+ USHORT aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
if( aPos != TOOLBOX_ITEM_NOTFOUND)
{
// check for line breaks
- sal_uInt16 nLine = ImplGetItemLine( pItem );
+ USHORT nLine = ImplGetItemLine( pItem );
if( nLine >= mnCurLine + mnVisLines )
{
mnCurLine = nLine - mnVisLines + 1;
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
else if ( nLine < mnCurLine )
{
mnCurLine = nLine;
- mbFormat = sal_True;
+ mbFormat = TRUE;
}
if( mbFormat )
@@ -6101,23 +6074,23 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus )
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
- mbChangingHighlight = sal_False;
+ mbChangingHighlight = FALSE;
}
// -----------------------------------------------------------------------
// check for keyboard accessible items
-static sal_Bool ImplIsValidItem( const ImplToolItem* pItem, sal_Bool bNotClipped )
+static BOOL ImplIsValidItem( const ImplToolItem* pItem, BOOL bNotClipped )
{
- sal_Bool bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
+ BOOL bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
if( bValid && bNotClipped && pItem->IsClipped() )
- bValid = sal_False;
+ bValid = FALSE;
return bValid;
}
// -----------------------------------------------------------------------
-sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
+BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
{
ImplToolItem* pToolItem = ImplGetItem( mnHighItemId );
@@ -6134,13 +6107,13 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), sal_True ) )
+ if ( ImplIsValidItem( &(*it), TRUE ) )
{
pItem = &(*it);
break;
}
}
- ImplDrawMenubutton( this, sal_False );
+ ImplDrawMenubutton( this, FALSE );
ImplChangeHighlight( pItem );
}
else
@@ -6149,17 +6122,17 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), sal_True ) )
+ if ( ImplIsValidItem( &(*it), TRUE ) )
break;
++it;
}
if( it != mpData->m_aItems.end() )
{
- ImplDrawMenubutton( this, sal_False );
+ ImplDrawMenubutton( this, FALSE );
ImplChangeHighlight( &(*it) );
}
}
- return sal_True;
+ return TRUE;
}
if( bUp )
@@ -6168,7 +6141,7 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), sal_False ) )
+ if ( ImplIsValidItem( &(*it), FALSE ) )
break;
++it;
}
@@ -6177,11 +6150,11 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
if( (it != mpData->m_aItems.end() && &(*it) == ImplGetFirstClippedItem( this )) && IsMenuEnabled() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, sal_True );
+ ImplDrawMenubutton( this, TRUE );
}
else
ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : NULL );
- return sal_True;
+ return TRUE;
}
else
{
@@ -6191,7 +6164,7 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, sal_True );
+ ImplDrawMenubutton( this, TRUE );
}
else
{
@@ -6200,7 +6173,7 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), sal_False ) )
+ if ( ImplIsValidItem( &(*it), FALSE ) )
{
pItem = &(*it);
break;
@@ -6208,16 +6181,16 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
}
ImplChangeHighlight( pItem );
}
- return sal_True;
+ return TRUE;
}
}
if( pToolItem )
{
- sal_uLong pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
- sal_uLong nCount = mpData->m_aItems.size();
+ ULONG pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
+ ULONG nCount = mpData->m_aItems.size();
- sal_uLong i=0;
+ ULONG i=0;
do
{
if( bUp )
@@ -6225,14 +6198,14 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
if( !pos-- )
{
if( bNoCycle )
- return sal_False;
+ return FALSE;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, sal_True );
- return sal_True;
+ ImplDrawMenubutton( this, TRUE );
+ return TRUE;
}
else
pos = nCount-1;
@@ -6243,14 +6216,14 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
if( ++pos >= nCount )
{
if( bNoCycle )
- return sal_False;
+ return FALSE;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, sal_True );
- return sal_True;
+ ImplDrawMenubutton( this, TRUE );
+ return TRUE;
}
else
pos = 0;
@@ -6259,7 +6232,7 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
pToolItem = &mpData->m_aItems[pos];
- if ( ImplIsValidItem( pToolItem, sal_False ) )
+ if ( ImplIsValidItem( pToolItem, FALSE ) )
break;
} while( ++i < nCount);
@@ -6268,14 +6241,14 @@ sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
{
// select the menu button if a clipped item would be selected
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, sal_True );
+ ImplDrawMenubutton( this, TRUE );
}
else if( i != nCount )
ImplChangeHighlight( pToolItem );
else
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -6288,7 +6261,7 @@ void ToolBox::ImplShowFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_True;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = TRUE;
pWin->Invalidate( 0 );
}
}
@@ -6304,7 +6277,7 @@ void ToolBox::ImplHideFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_False;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = FALSE;
pWin->Invalidate( 0 );
}
}
@@ -6312,7 +6285,7 @@ void ToolBox::ImplHideFocus()
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, sal_False );
+ ImplDrawMenubutton( this, FALSE );
}
}
@@ -6332,7 +6305,7 @@ void ToolBox::ImplDisableFlatButtons()
&hkey) )
{
DWORD dwType = 0;
- sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ WIN_BYTE 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 37650232fd7f..29ef64cb14ff 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
@@ -48,12 +49,11 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
using namespace vcl;
-
-using ::rtl::OUString;
+using namespace rtl;
// =======================================================================
-#define TB_SEP_SIZE 8
+#define TB_SEP_SIZE 8
// -----------------------------------------------------------------------
@@ -72,17 +72,17 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() :
mnMenuButtonWidth = TB_MENUBUTTON_SIZE;
- 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;
+ mbIsLocked = FALSE;
+ mbNativeButtons = FALSE;
+ mbIsPaintLocked = FALSE;
+ mbAssumeDocked = FALSE;
+ mbAssumePopupMode = FALSE;
+ mbAssumeFloating = FALSE;
+ mbKeyInputDisabled = FALSE;
+ mbMenubuttonSelected = FALSE;
+ mbPageScroll = FALSE;
+ mbWillUsePopupMode = FALSE;
+ mbDropDownByKeyboard = FALSE;
}
ImplToolBoxPrivateData::~ImplToolBoxPrivateData()
@@ -95,126 +95,130 @@ ImplToolBoxPrivateData::~ImplToolBoxPrivateData()
// -----------------------------------------------------------------------
ImplToolItem::ImplToolItem()
{
- mnId = 0;
- mpWindow = NULL;
- mpUserData = NULL;
- meType = TOOLBOXITEM_BUTTON;
- mnBits = 0;
- meState = STATE_NOCHECK;
- mbEnabled = sal_True;
- mbVisible = sal_True;
- mbEmptyBtn = sal_True;
- mbShowWindow = sal_False;
- mbBreak = sal_False;
- mnSepSize = TB_SEP_SIZE;
+ 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;
+ mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
- mnImageAngle = 0;
- mbMirrorMode = sal_False;
- mbVisibleText = sal_False;
+ mnImageAngle = 0;
+ mbMirrorMode = FALSE;
+ mbVisibleText = FALSE;
}
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
ToolBoxItemBits nItemBits ) :
maImage( rImage )
{
- mnId = nItemId;
- mpWindow = NULL;
- mpUserData = NULL;
- meType = TOOLBOXITEM_BUTTON;
- mnBits = nItemBits;
- meState = STATE_NOCHECK;
- mbEnabled = sal_True;
- mbVisible = sal_True;
- mbEmptyBtn = sal_False;
- mbShowWindow = sal_False;
- mbBreak = sal_False;
- mnSepSize = TB_SEP_SIZE;
+ 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;
+ mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
- mnImageAngle = 0;
- mbMirrorMode = false;
+ mnImageAngle = 0;
+ mbMirrorMode = false;
mbVisibleText = false;
}
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const XubString& rText,
+ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
ToolBoxItemBits nItemBits ) :
maText( rText )
{
- mnId = nItemId;
- mpWindow = NULL;
- mpUserData = NULL;
- meType = TOOLBOXITEM_BUTTON;
- mnBits = nItemBits;
- meState = STATE_NOCHECK;
- mbEnabled = sal_True;
- mbVisible = sal_True;
- mbEmptyBtn = sal_False;
- mbShowWindow = sal_False;
- mbBreak = sal_False;
- mnSepSize = TB_SEP_SIZE;
+ 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;
+ mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
- mnImageAngle = 0;
- mbMirrorMode = false;
+ mnImageAngle = 0;
+ mbMirrorMode = false;
mbVisibleText = false;
}
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
const XubString& rText, ToolBoxItemBits nItemBits ) :
maImage( rImage ),
maText( rText )
{
- mnId = nItemId;
- mpWindow = NULL;
- mpUserData = NULL;
- meType = TOOLBOXITEM_BUTTON;
- mnBits = nItemBits;
- meState = STATE_NOCHECK;
- mbEnabled = sal_True;
- mbVisible = sal_True;
- mbEmptyBtn = sal_False;
- mbShowWindow = sal_False;
- mbBreak = sal_False;
- mnSepSize = TB_SEP_SIZE;
+ 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;
+ mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
- mnImageAngle = 0;
- mbMirrorMode = false;
+ mnImageAngle = 0;
+ mbMirrorMode = false;
mbVisibleText = false;
}
// -----------------------------------------------------------------------
ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
- mpWindow ( rItem.mpWindow ),
- mpUserData ( rItem.mpUserData ),
- maImage ( rItem.maImage ),
- maHighImage ( rItem.maHighImage ),
- mnImageAngle ( rItem.mnImageAngle ),
- mbMirrorMode ( rItem.mbMirrorMode ),
- maText ( rItem.maText ),
- maQuickHelpText ( rItem.maQuickHelpText ),
- maHelpText ( rItem.maHelpText ),
- maCommandStr ( rItem.maCommandStr ),
- maHelpId ( rItem.maHelpId ),
- maRect ( rItem.maRect ),
- maCalcRect ( rItem.maCalcRect ),
- maItemSize ( rItem.maItemSize ),
- mnSepSize ( rItem.mnSepSize ),
+ mpWindow ( rItem.mpWindow ),
+ mpUserData ( rItem.mpUserData ),
+ maImage ( rItem.maImage ),
+ maHighImage ( rItem.maHighImage ),
+ mnImageAngle ( rItem.mnImageAngle ),
+ mbMirrorMode ( rItem.mbMirrorMode ),
+ maText ( rItem.maText ),
+ maQuickHelpText ( rItem.maQuickHelpText ),
+ maHelpText ( rItem.maHelpText ),
+ maCommandStr ( rItem.maCommandStr ),
+ mnHelpId ( rItem.mnHelpId ),
+ maRect ( rItem.maRect ),
+ maCalcRect ( rItem.maCalcRect ),
+ maItemSize ( rItem.maItemSize ),
+ mnSepSize ( rItem.mnSepSize ),
mnDropDownArrowWidth ( rItem.mnDropDownArrowWidth ),
- meType ( rItem.meType ),
- mnBits ( rItem.mnBits ),
- meState ( rItem.meState ),
- mnId ( rItem.mnId ),
- mbEnabled ( rItem.mbEnabled ),
- mbVisible ( rItem.mbVisible ),
- mbEmptyBtn ( rItem.mbEmptyBtn ),
- mbShowWindow ( rItem.mbShowWindow ),
- mbBreak ( rItem.mbBreak ),
- mbVisibleText ( rItem.mbVisibleText )
+ meType ( rItem.meType ),
+ mnBits ( rItem.mnBits ),
+ meState ( rItem.meState ),
+ mnId ( rItem.mnId ),
+ mbEnabled ( rItem.mbEnabled ),
+ mbVisible ( rItem.mbVisible ),
+ mbEmptyBtn ( rItem.mbEmptyBtn ),
+ mbShowWindow ( rItem.mbShowWindow ),
+ mbBreak ( rItem.mbBreak ),
+ mbVisibleText ( rItem.mbVisibleText )
{
}
@@ -228,38 +232,38 @@ ImplToolItem::~ImplToolItem()
ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
{
- mpWindow = rItem.mpWindow;
- mpUserData = rItem.mpUserData;
- maImage = rItem.maImage;
- maHighImage = rItem.maHighImage;
- mnImageAngle = rItem.mnImageAngle;
- mbMirrorMode = rItem.mbMirrorMode;
- maText = rItem.maText;
- maQuickHelpText = rItem.maQuickHelpText;
- maHelpText = rItem.maHelpText;
- maCommandStr = rItem.maCommandStr;
- maHelpId = rItem.maHelpId;
- maRect = rItem.maRect;
- maCalcRect = rItem.maCalcRect;
- mnSepSize = rItem.mnSepSize;
+ mpWindow = rItem.mpWindow;
+ mpUserData = rItem.mpUserData;
+ maImage = rItem.maImage;
+ maHighImage = rItem.maHighImage;
+ mnImageAngle = rItem.mnImageAngle;
+ mbMirrorMode = rItem.mbMirrorMode;
+ maText = rItem.maText;
+ maQuickHelpText = rItem.maQuickHelpText;
+ maHelpText = rItem.maHelpText;
+ maCommandStr = rItem.maCommandStr;
+ mnHelpId = rItem.mnHelpId;
+ maRect = rItem.maRect;
+ maCalcRect = rItem.maCalcRect;
+ mnSepSize = rItem.mnSepSize;
mnDropDownArrowWidth = rItem.mnDropDownArrowWidth;
- maItemSize = rItem.maItemSize;
- mbVisibleText = rItem.mbVisibleText;
- meType = rItem.meType;
- mnBits = rItem.mnBits;
- meState = rItem.meState;
- mnId = rItem.mnId;
- mbEnabled = rItem.mbEnabled;
- mbVisible = rItem.mbVisible;
- mbEmptyBtn = rItem.mbEmptyBtn;
- mbShowWindow = rItem.mbShowWindow;
- mbBreak = rItem.mbBreak;
+ maItemSize = rItem.maItemSize;
+ mbVisibleText = rItem.mbVisibleText;
+ meType = rItem.meType;
+ mnBits = rItem.mnBits;
+ meState = rItem.meState;
+ mnId = rItem.mnId;
+ mbEnabled = rItem.mbEnabled;
+ mbVisible = rItem.mbVisible;
+ mbEmptyBtn = rItem.mbEmptyBtn;
+ mbShowWindow = rItem.mbShowWindow;
+ mbBreak = rItem.mbBreak;
return *this;
}
// -----------------------------------------------------------------------
-Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize )
+Size ImplToolItem::GetSize( BOOL bHorz, 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
@@ -271,13 +275,13 @@ Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWid
if ( mpWindow && bHorz )
{
// get size of item window and check if it fits
- // no windows in vertical toolbars (the default is mbShowWindow=sal_False)
+ // no windows in vertical toolbars (the default is mbShowWindow=FALSE)
Size aWinSize = mpWindow->GetSizePixel();
if ( !bCheckMaxWidth || (aWinSize.Width() <= maxWidth) )
{
aSize.Width() = aWinSize.Width();
aSize.Height() = aWinSize.Height();
- mbShowWindow = sal_True;
+ mbShowWindow = TRUE;
}
else
{
@@ -313,27 +317,27 @@ Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWid
// -----------------------------------------------------------------------
-void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const
+void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const
{
if ( meType != TOOLBOXITEM_BUTTON )
{
// no button -> draw nothing
- rbImage = rbText = sal_False;
+ rbImage = rbText = FALSE;
return;
}
- sal_Bool bHasImage;
- sal_Bool bHasText;
+ BOOL bHasImage;
+ BOOL bHasText;
// check for image and/or text
if ( !(maImage) )
- bHasImage = sal_False;
+ bHasImage = FALSE;
else
- bHasImage = sal_True;
+ bHasImage = TRUE;
if ( !maText.Len() )
- bHasText = sal_False;
+ bHasText = FALSE;
else
- bHasText = sal_True;
+ bHasText = TRUE;
// prefer images if symbolonly buttons are drawn
// prefer texts if textonly buttons are dreawn
@@ -342,38 +346,38 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& r
{
if( bHasImage || !bHasText )
{
- rbImage = sal_True;
- rbText = sal_False;
+ rbImage = TRUE;
+ rbText = FALSE;
}
else
{
- rbImage = sal_False;
- rbText = sal_True;
+ rbImage = FALSE;
+ rbText = TRUE;
}
}
else if ( eButtonType == BUTTON_TEXT ) // drawing text only
{
if( bHasText || !bHasImage )
{
- rbImage = sal_False;
- rbText = sal_True;
+ rbImage = FALSE;
+ rbText = TRUE;
}
else
{
- rbImage = sal_True;
- rbText = sal_False;
+ rbImage = TRUE;
+ rbText = FALSE;
}
}
else // drawing icons and text both
{
- rbImage = sal_True;
- rbText = sal_True;
+ rbImage = TRUE;
+ rbText = TRUE;
}
}
// -----------------------------------------------------------------------
-Rectangle ImplToolItem::GetDropDownRect( sal_Bool bHorz ) const
+Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const
{
Rectangle aRect;
if( (mnBits & TIB_DROPDOWN) && !maRect.IsEmpty() )
@@ -391,7 +395,7 @@ Rectangle ImplToolItem::GetDropDownRect( sal_Bool bHorz ) const
// -----------------------------------------------------------------------
-sal_Bool ImplToolItem::IsClipped() const
+BOOL ImplToolItem::IsClipped() const
{
return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() );
}
@@ -410,16 +414,16 @@ const XubString& ToolBox::ImplConvertMenuString( const XubString& rStr )
// -----------------------------------------------------------------------
-void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint )
+void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
{
ImplUpdateInputEnable();
if ( bNewCalc )
- mbCalc = sal_True;
+ mbCalc = TRUE;
if ( bFullPaint )
{
- mbFormat = sal_True;
+ mbFormat = TRUE;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -433,7 +437,7 @@ void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint )
{
if ( !mbFormat )
{
- mbFormat = sal_True;
+ mbFormat = TRUE;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -447,7 +451,7 @@ void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint )
// -----------------------------------------------------------------------
-void ToolBox::ImplUpdateItem( sal_uInt16 nIndex )
+void ToolBox::ImplUpdateItem( USHORT nIndex )
{
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -503,6 +507,12 @@ void ToolBox::Deactivate()
mnActivateCount--;
ImplCallEventListeners( VCLEVENT_TOOLBOX_DEACTIVATE );
maDeactivateHdl.Call( this );
+
+ if ( mbHideStatusText )
+ {
+ GetpApp()->HideHelpStatusText();
+ mbHideStatusText = FALSE;
+ }
}
// -----------------------------------------------------------------------
@@ -554,19 +564,19 @@ void ToolBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
+void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
{
- sal_uLong nObjMask;
- sal_Bool bImage = sal_False; // Wurde Image gesetzt
+ ULONG nObjMask;
+ BOOL bImage = FALSE; // Wurde Image gesetzt
// Item anlegen
ImplToolItem aItem;
GetRes( rResId.SetRT( RSC_TOOLBOXITEM ) );
- nObjMask = ReadLongRes();
+ nObjMask = ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_ID )
- aItem.mnId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
+ aItem.mnId = sal::static_int_cast<USHORT>(ReadLongRes());
else
aItem.mnId = 1;
@@ -577,7 +587,7 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.maHelpId = ReadByteStringRes();
+ aItem.mnHelpId = ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -592,22 +602,22 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
Bitmap aBmp = Bitmap( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
aItem.maImage = Image( aBmp, IMAGE_STDBTN_COLOR );
- bImage = sal_True;
+ bImage = TRUE;
}
if ( nObjMask & RSC_TOOLBOXITEM_IMAGE )
{
aItem.maImage = Image( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
- bImage = sal_True;
+ bImage = TRUE;
}
if ( nObjMask & RSC_TOOLBOXITEM_DISABLE )
- aItem.mbEnabled = !(sal_Bool)ReadShortRes();
+ aItem.mbEnabled = !(BOOL)ReadShortRes();
if ( nObjMask & RSC_TOOLBOXITEM_STATE )
- aItem.meState = (TriState)ReadLongRes();
+ aItem.meState = (TriState)ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_HIDE )
- aItem.mbVisible = !((sal_Bool)ReadShortRes());
+ aItem.mbVisible = !((BOOL)ReadShortRes());
if ( nObjMask & RSC_TOOLBOXITEM_COMMAND )
aItem.maCommandStr = ReadStringRes();
@@ -618,15 +628,15 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
aItem.maImage = maImageList.GetImage( aItem.mnId );
// Wenn es sich um ein ButtonItem handelt, die ID ueberpruefen
- sal_Bool bNewCalc;
+ BOOL bNewCalc;
if ( aItem.meType != TOOLBOXITEM_BUTTON )
{
- bNewCalc = sal_False;
+ bNewCalc = FALSE;
aItem.mnId = 0;
}
else
{
- bNewCalc = sal_True;
+ bNewCalc = TRUE;
DBG_ASSERT( aItem.mnId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( aItem.mnId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -641,14 +651,14 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
ImplInvalidate( bNewCalc );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
- ToolBoxItemBits nBits, sal_uInt16 nPos )
+void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
+ ToolBoxItemBits nBits, USHORT nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -658,18 +668,18 @@ void ToolBox::InsertItem( sal_uInt16 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( sal_True );
+ ImplInvalidate( TRUE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >(nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
const XubString& rText,
- ToolBoxItemBits nBits, sal_uInt16 nPos )
+ ToolBoxItemBits nBits, USHORT nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -679,17 +689,17 @@ void ToolBox::InsertItem( sal_uInt16 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( sal_True );
+ ImplInvalidate( TRUE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( sal_uInt16 nItemId, const XubString& rText,
- ToolBoxItemBits nBits, sal_uInt16 nPos )
+void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
+ ToolBoxItemBits nBits, USHORT nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -699,17 +709,17 @@ void ToolBox::InsertItem( sal_uInt16 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( sal_True );
+ ImplInvalidate( TRUE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertWindow( sal_uInt16 nItemId, Window* pWindow,
- ToolBoxItemBits nBits, sal_uInt16 nPos )
+void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
+ ToolBoxItemBits nBits, USHORT nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertWindow(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -717,90 +727,90 @@ void ToolBox::InsertWindow( sal_uInt16 nItemId, Window* pWindow,
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
- aItem.mnId = nItemId;
- aItem.meType = TOOLBOXITEM_BUTTON;
- aItem.mnBits = nBits;
- aItem.mpWindow = pWindow;
+ aItem.mnId = nItemId;
+ aItem.meType = TOOLBOXITEM_BUTTON;
+ aItem.mnBits = nBits;
+ aItem.mpWindow = pWindow;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
if ( pWindow )
pWindow->Hide();
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSpace( sal_uInt16 nPos )
+void ToolBox::InsertSpace( USHORT nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_SPACE;
- aItem.mbEnabled = sal_False;
+ aItem.meType = TOOLBOXITEM_SPACE;
+ aItem.mbEnabled = FALSE;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( sal_False );
+ ImplInvalidate( FALSE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize )
+void ToolBox::InsertSeparator( USHORT nPos, USHORT nPixSize )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_SEPARATOR;
- aItem.mbEnabled = sal_False;
+ aItem.meType = TOOLBOXITEM_SEPARATOR;
+ aItem.mbEnabled = 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( sal_False );
+ ImplInvalidate( FALSE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertBreak( sal_uInt16 nPos )
+void ToolBox::InsertBreak( USHORT nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_BREAK;
- aItem.mbEnabled = sal_False;
+ aItem.meType = TOOLBOXITEM_BREAK;
+ aItem.mbEnabled = FALSE;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( sal_False );
+ ImplInvalidate( FALSE );
// Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::RemoveItem( sal_uInt16 nPos )
+void ToolBox::RemoveItem( USHORT nPos )
{
if( nPos < mpData->m_aItems.size() )
{
- sal_Bool bMustCalc;
+ BOOL bMustCalc;
if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON )
- bMustCalc = sal_True;
+ bMustCalc = TRUE;
else
- bMustCalc = sal_False;
+ bMustCalc = FALSE;
if ( mpData->m_aItems[nPos].mpWindow )
mpData->m_aItems[nPos].mpWindow->Hide();
@@ -826,9 +836,9 @@ void ToolBox::RemoveItem( sal_uInt16 nPos )
// -----------------------------------------------------------------------
-void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
+void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos == nNewPos )
return;
@@ -846,14 +856,14 @@ void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
mpData->ImplClearLayoutData();
// ToolBox neu ausgeben
- ImplInvalidate( sal_False );
+ ImplInvalidate( 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
{
- sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -861,13 +871,13 @@ void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
// -----------------------------------------------------------------------
-void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
- sal_uInt16 nNewPos )
+void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
+ USHORT nNewPos )
{
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
"ToolBox::CopyItem(): ItemId already exists" );
- sal_uInt16 nPos = rToolBox.GetItemPos( nItemId );
+ USHORT nPos = rToolBox.GetItemPos( nItemId );
// Existiert Item
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -875,16 +885,16 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
// ToolBox-Item in der Liste verschieben
ImplToolItem aNewItem = rToolBox.mpData->m_aItems[nPos];
// Bestimme Daten zuruecksetzen
- aNewItem.mpWindow = NULL;
- aNewItem.mbShowWindow = sal_False;
+ aNewItem.mpWindow = NULL;
+ aNewItem.mbShowWindow = 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( sal_False );
+ ImplInvalidate( FALSE );
// Notify
- sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -902,11 +912,11 @@ void ToolBox::CopyItems( const ToolBox& rToolBox )
for( std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
it != mpData->m_aItems.end(); ++it )
{
- it->mpWindow = NULL;
- it->mbShowWindow = sal_False;
+ it->mpWindow = NULL;
+ it->mbShowWindow = FALSE;
}
- ImplInvalidate( sal_True, sal_True );
+ ImplInvalidate( TRUE, TRUE );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -923,7 +933,7 @@ void ToolBox::Clear()
mnCurItemId = 0;
mnHighItemId = 0;
- ImplInvalidate( sal_True, sal_True );
+ ImplInvalidate( TRUE, TRUE );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -939,7 +949,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( sal_True );
+ ImplInvalidate( TRUE );
}
}
@@ -950,8 +960,8 @@ void ToolBox::SetToolboxButtonSize( ToolBoxButtonSize eSize )
if( mpData->meButtonSize != eSize )
{
mpData->meButtonSize = eSize;
- mbCalc = sal_True;
- mbFormat = sal_True;
+ mbCalc = TRUE;
+ mbFormat = TRUE;
}
}
@@ -966,10 +976,10 @@ const Size& ToolBox::GetDefaultImageSize() const
{
static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE );
- static sal_uLong s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
+ static ULONG s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
static Size aLargeButtonSize( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE );
- sal_uLong nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
+ ULONG nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
if ( s_nSymbolsStyle != nSymbolsStyle )
{
s_nSymbolsStyle = nSymbolsStyle;
@@ -1004,13 +1014,13 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
{
// Setzen, ob Items horizontal oder vertikal angeordnet werden sollen
if ( (eNewAlign == WINDOWALIGN_LEFT) || (eNewAlign == WINDOWALIGN_RIGHT) )
- mbHorz = sal_False;
+ mbHorz = FALSE;
else
- mbHorz = sal_True;
+ mbHorz = TRUE;
// Hier alles neu ausgeben, da sich Border auch aendert
- mbCalc = sal_True;
- mbFormat = sal_True;
+ mbCalc = TRUE;
+ mbFormat = TRUE;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1019,7 +1029,7 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
-void ToolBox::SetLineCount( sal_uInt16 nNewLines )
+void ToolBox::SetLineCount( USHORT nNewLines )
{
if ( !nNewLines )
nNewLines = 1;
@@ -1030,18 +1040,18 @@ void ToolBox::SetLineCount( sal_uInt16 nNewLines )
// Hier besser alles neu ausgeben, da es ansonsten zu Problemen
// mit den per CopyBits kopierten Bereichen geben kann
- ImplInvalidate( sal_False );
+ ImplInvalidate( FALSE );
}
}
// -----------------------------------------------------------------------
-void ToolBox::SetPageScroll( sal_Bool b )
+void ToolBox::SetPageScroll( BOOL b )
{
mpData->mbPageScroll = b;
}
-sal_Bool ToolBox::GetPageScroll()
+BOOL ToolBox::GetPageScroll()
{
return mpData->mbPageScroll;
}
@@ -1050,45 +1060,45 @@ sal_Bool ToolBox::GetPageScroll()
void ToolBox::SetNextToolBox( const XubString& rStr )
{
- sal_Bool bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
+ BOOL bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
maNextToolBoxStr = rStr;
if ( bCalcNew )
- ImplInvalidate( sal_True, sal_False );
+ ImplInvalidate( TRUE, FALSE );
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetItemCount() const
+USHORT ToolBox::GetItemCount() const
{
- return (sal_uInt16)mpData->m_aItems.size();
+ return (USHORT)mpData->m_aItems.size();
}
// -----------------------------------------------------------------------
-ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const
+ToolBoxItemType ToolBox::GetItemType( USHORT nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : TOOLBOXITEM_DONTKNOW;
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const
+USHORT ToolBox::GetItemPos( USHORT nItemId ) const
{
int nCount = mpData->m_aItems.size();
for( int nPos = 0; nPos < nCount; nPos++ )
if( mpData->m_aItems[nPos].mnId == nItemId )
- return (sal_uInt16)nPos;
+ return (USHORT)nPos;
return TOOLBOX_ITEM_NOTFOUND;
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetItemPos( const Point& rPos ) const
+USHORT ToolBox::GetItemPos( const Point& rPos ) const
{
// search the item position on the given point
- sal_uInt16 nRet = TOOLBOX_ITEM_NOTFOUND;
- sal_uInt16 nPos = 0;
+ USHORT nRet = TOOLBOX_ITEM_NOTFOUND;
+ USHORT nPos = 0;
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
@@ -1108,14 +1118,14 @@ sal_uInt16 ToolBox::GetItemPos( const Point& rPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetItemId( sal_uInt16 nPos ) const
+USHORT ToolBox::GetItemId( USHORT nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].mnId : 0;
}
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
+USHORT ToolBox::GetItemId( const Point& rPos ) const
{
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -1193,25 +1203,25 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize )
}
-Point ToolBox::GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const
+Point ToolBox::GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const
{
return ImplGetPopupPosition( GetItemRect( nItemId ), rSize );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const
+Rectangle ToolBox::GetItemRect( USHORT nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
return GetItemPosRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
+Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1223,18 +1233,18 @@ Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const
+Rectangle ToolBox::GetItemDropDownRect( USHORT nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
return GetItemPosDropDownRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const
+Rectangle ToolBox::GetItemPosDropDownRect( USHORT nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1252,24 +1262,24 @@ Rectangle ToolBox::GetMenubuttonRect() const
return mpData->maMenubuttonItem.maRect;
}
-sal_Bool ToolBox::ImplHasExternalMenubutton()
+BOOL ToolBox::ImplHasExternalMenubutton()
{
// check if the borderwindow (i.e. the decoration) provides the menu button
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( ImplIsFloatingMode() )
{
// custom menu is placed in the decoration
ImplBorderWindow *pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( WINDOW_BORDER ) );
if( pBorderWin && !pBorderWin->GetMenuRect().IsEmpty() )
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits )
+void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1278,15 +1288,15 @@ void ToolBox::SetItemBits( sal_uInt16 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)
- sal_Bool bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
+ BOOL bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
if ( nBits != nOldBits )
- ImplInvalidate( sal_True, bFormat );
+ ImplInvalidate( TRUE, bFormat );
}
}
// -----------------------------------------------------------------------
-ToolBoxItemBits ToolBox::GetItemBits( sal_uInt16 nItemId ) const
+ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1298,9 +1308,9 @@ ToolBoxItemBits ToolBox::GetItemBits( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemData( sal_uInt16 nItemId, void* pNewData )
+void ToolBox::SetItemData( USHORT nItemId, void* pNewData )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1311,7 +1321,7 @@ void ToolBox::SetItemData( sal_uInt16 nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* ToolBox::GetItemData( sal_uInt16 nItemId ) const
+void* ToolBox::GetItemData( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1323,9 +1333,9 @@ void* ToolBox::GetItemData( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
+void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1336,7 +1346,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
Size aOldSize = pItem->maImage.GetSizePixel();
pItem->maImage = rImage;
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
else
ImplUpdateItem( nPos );
}
@@ -1351,8 +1361,8 @@ void ToolBox::SetImageList( const ImageList& rImageList )
{
maImageList = rImageList;
- sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ USHORT nCount = (USHORT)mpData->m_aItems.size();
+ for( USHORT i = 0; i < nCount; i++ )
{
Image aImage;
if ( mpData->m_aItems[i].mnId )
@@ -1366,17 +1376,17 @@ void ToolBox::SetImageList( const ImageList& rImageList )
static Image ImplRotImage( const Image& rImage, long nAngle10 )
{
- Image aRet;
- BitmapEx aRotBitmapEx( rImage.GetBitmapEx() );
+ Image aRet;
+ BitmapEx aRotBitmapEx( rImage.GetBitmapEx() );
aRotBitmapEx.Rotate( nAngle10, Color( COL_WHITE ) );
return Image( aRotBitmapEx );
}
-void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
+void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1398,7 +1408,7 @@ void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
if ( !mbCalc )
{
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
else
ImplUpdateItem( nPos );
}
@@ -1409,17 +1419,17 @@ void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
static Image ImplMirrorImage( const Image& rImage )
{
- Image aRet;
- BitmapEx aMirrBitmapEx( rImage.GetBitmapEx() );
+ Image aRet;
+ BitmapEx aMirrBitmapEx( rImage.GetBitmapEx() );
aMirrBitmapEx.Mirror( BMP_MIRROR_HORZ );
return Image( aMirrBitmapEx );
}
-void ToolBox::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
+void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1445,7 +1455,7 @@ void ToolBox::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
// -----------------------------------------------------------------------
-Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const
+Image ToolBox::GetItemImage( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1457,7 +1467,7 @@ Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const
+long ToolBox::GetItemImageAngle( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1469,32 +1479,32 @@ long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
+BOOL ToolBox::GetItemImageMirrorMode( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbMirrorMode;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage )
+void ToolBox::SetItemHighImage( USHORT nItemId, const Image& rImage )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) ||
- ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
+ ((!rImage) == TRUE), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
pItem->maHighImage = rImage;
}
}
// -----------------------------------------------------------------------
-Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const
+Image ToolBox::GetItemHighImage( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1506,9 +1516,9 @@ Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
+void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1521,7 +1531,7 @@ void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
pItem->maText = ImplConvertMenuString( rText );
mpData->ImplClearLayoutData();
if ( nOldWidth != GetCtrlTextWidth( pItem->maText ) )
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
else
ImplUpdateItem( nPos );
}
@@ -1538,7 +1548,7 @@ void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemText( sal_uInt16 nItemId ) const
+const XubString& ToolBox::GetItemText( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1550,9 +1560,9 @@ const XubString& ToolBox::GetItemText( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow )
+void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1560,14 +1570,14 @@ void ToolBox::SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow )
pItem->mpWindow = pNewWindow;
if ( pNewWindow )
pNewWindow->Hide();
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED, reinterpret_cast< void* >( nPos ) );
}
}
// -----------------------------------------------------------------------
-Window* ToolBox::GetItemWindow( sal_uInt16 nItemId ) const
+Window* ToolBox::GetItemWindow( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1586,8 +1596,8 @@ void ToolBox::StartSelection()
if ( !mbSelection )
{
- mbSelection = sal_True;
- mnCurPos = TOOLBOX_ITEM_NOTFOUND;
+ mbSelection = TRUE;
+ mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
Activate();
}
@@ -1597,13 +1607,13 @@ void ToolBox::StartSelection()
void ToolBox::EndSelection()
{
- mbCommandDrag = sal_False;
+ mbCommandDrag = FALSE;
if ( mbDrag || mbSelection )
{
// Daten zuruecksetzen
- mbDrag = sal_False;
- mbSelection = sal_False;
+ mbDrag = FALSE;
+ mbSelection = FALSE;
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
ImplDrawItem( mnCurPos );
EndTracking();
@@ -1611,18 +1621,18 @@ void ToolBox::EndSelection()
Deactivate();
}
- mnCurPos = TOOLBOX_ITEM_NOTFOUND;
- mnCurItemId = 0;
- mnDownItemId = 0;
- mnMouseClicks = 0;
+ mnCurPos = TOOLBOX_ITEM_NOTFOUND;
+ mnCurItemId = 0;
+ mnDownItemId = 0;
+ mnMouseClicks = 0;
mnMouseModifier = 0;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease )
+void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1631,7 +1641,7 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease
if ( nPos != mnCurPos )
{
mnCurPos = nPos;
- ImplDrawItem( mnCurPos, sal_True );
+ ImplDrawItem( mnCurPos, TRUE );
Flush();
}
}
@@ -1639,7 +1649,7 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease
{
if ( nPos == mnCurPos )
{
- ImplDrawItem( mnCurPos, sal_False );
+ ImplDrawItem( mnCurPos, FALSE );
Flush();
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
@@ -1649,16 +1659,16 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease
{
if ( mbDrag || mbSelection )
{
- mbDrag = sal_False;
- mbSelection = sal_False;
+ mbDrag = FALSE;
+ mbSelection = FALSE;
EndTracking();
ReleaseMouse();
Deactivate();
}
- mnCurItemId = 0;
- mnDownItemId = 0;
- mnMouseClicks = 0;
+ mnCurItemId = 0;
+ mnDownItemId = 0;
+ mnMouseClicks = 0;
mnMouseModifier = 0;
}
}
@@ -1666,21 +1676,21 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const
+BOOL ToolBox::IsItemDown( USHORT nItemId ) const
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
return (nPos == mnCurPos);
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
+void ToolBox::SetItemState( USHORT nItemId, TriState eState )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1693,9 +1703,9 @@ void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
if ( (eState == STATE_CHECK) && (pItem->mnBits & TIB_AUTOCHECK) &&
(pItem->mnBits & TIB_RADIOCHECK) )
{
- ImplToolItem* pGroupItem;
- sal_uInt16 nGroupPos;
- sal_uInt16 nItemCount = GetItemCount();
+ ImplToolItem* pGroupItem;
+ USHORT nGroupPos;
+ USHORT nItemCount = GetItemCount();
nGroupPos = nPos;
while ( nGroupPos )
@@ -1740,7 +1750,7 @@ void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
// -----------------------------------------------------------------------
-TriState ToolBox::GetItemState( sal_uInt16 nItemId ) const
+TriState ToolBox::GetItemState( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1752,15 +1762,15 @@ TriState ToolBox::GetItemState( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
+void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
ImplToolItem* pItem = &mpData->m_aItems[nPos];
if ( bEnable )
- bEnable = sal_True;
+ bEnable = TRUE;
if ( pItem->mbEnabled != bEnable )
{
pItem->mbEnabled = bEnable;
@@ -1784,21 +1794,21 @@ void ToolBox::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsItemEnabled( sal_uInt16 nItemId ) const
+BOOL ToolBox::IsItemEnabled( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbEnabled;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-void ToolBox::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
+void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible )
{
- sal_uInt16 nPos = GetItemPos( nItemId );
+ USHORT nPos = GetItemPos( nItemId );
mpData->ImplClearLayoutData();
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -1807,36 +1817,36 @@ void ToolBox::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
if ( pItem->mbVisible != bVisible )
{
pItem->mbVisible = bVisible;
- ImplInvalidate( sal_False );
+ ImplInvalidate( FALSE );
}
}
}
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsItemVisible( sal_uInt16 nItemId ) const
+BOOL ToolBox::IsItemVisible( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbVisible;
else
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool ToolBox::IsItemReallyVisible( sal_uInt16 nItemId ) const
+BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const
{
// is the item on the visible area of the toolbox?
- sal_Bool bRet = sal_False;
+ BOOL bRet = 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 = sal_True;
+ bRet = TRUE;
}
return bRet;
@@ -1844,7 +1854,7 @@ sal_Bool ToolBox::IsItemReallyVisible( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
+void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1854,7 +1864,7 @@ void ToolBox::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemCommand( sal_uInt16 nItemId ) const
+const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1866,7 +1876,7 @@ const XubString& ToolBox::GetItemCommand( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
+void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1876,7 +1886,7 @@ void ToolBox::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetQuickHelpText( sal_uInt16 nItemId ) const
+const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1888,7 +1898,7 @@ const XubString& ToolBox::GetQuickHelpText( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
+void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1898,38 +1908,31 @@ void ToolBox::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetHelpText( sal_uInt16 nItemId ) const
+const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
{
return ImplGetHelpText( nItemId );
}
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
+void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->maHelpId = rHelpId;
+ pItem->mnHelpId = nHelpId;
}
// -----------------------------------------------------------------------
-rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const
+ULONG ToolBox::GetHelpId( USHORT nItemId ) const
{
- rtl::OString aRet;
-
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- {
- if ( pItem->maHelpId.getLength() )
- aRet = pItem->maHelpId;
- else
- aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
- }
-
- return aRet;
+ return pItem->mnHelpId;
+ else
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1939,12 +1942,12 @@ void ToolBox::SetBorder( long nX, long nY )
mnBorderX = nX;
mnBorderY = nY;
- ImplInvalidate( sal_True, sal_True );
+ ImplInvalidate( TRUE, TRUE );
}
// -----------------------------------------------------------------------
-void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
+void ToolBox::SetOutStyle( USHORT nNewStyle )
{
// always force flat looking toolbars since NWF
nNewStyle |= TOOLBOX_STYLE_FLAT;
@@ -1961,7 +1964,7 @@ void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
mnMaxItemHeight = 1;
}
- ImplInvalidate( sal_True, sal_True );
+ ImplInvalidate( TRUE, TRUE );
}
}
@@ -1969,7 +1972,7 @@ void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
void ToolBox::RecalcItems()
{
- ImplInvalidate( sal_True );
+ ImplInvalidate( TRUE );
}
// -----------------------------------------------------------------------
@@ -1984,11 +1987,11 @@ void ToolBox::ImplUpdateInputEnable()
if( it->mbEnabled )
{
// at least one useful entry
- mpData->mbKeyInputDisabled = sal_False;
+ mpData->mbKeyInputDisabled = FALSE;
return;
}
}
- mpData->mbKeyInputDisabled = sal_True;
+ mpData->mbKeyInputDisabled = TRUE;
}
// -----------------------------------------------------------------------
@@ -1997,14 +2000,14 @@ void ToolBox::ImplFillLayoutData() const
{
mpData->m_pLayoutData = new ToolBoxLayoutData();
- sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ USHORT nCount = (USHORT)mpData->m_aItems.size();
+ for( USHORT 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, sal_False, sal_False, sal_True );
+ const_cast<ToolBox*>(this)->ImplDrawItem( i, FALSE, FALSE, TRUE );
}
}
@@ -2019,14 +2022,14 @@ String ToolBox::GetDisplayText() const
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
+Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
if( mpData->m_pLayoutData )
{
- for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
+ for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
{
if( mpData->m_pLayoutData->m_aLineItemIds[i] == nItemID )
{
@@ -2040,7 +2043,7 @@ Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
// -----------------------------------------------------------------------
-long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
+long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -2049,7 +2052,7 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
if( mpData->m_pLayoutData )
{
nIndex = mpData->m_pLayoutData->GetIndexForPoint( rPoint );
- for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ )
+ for( 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) )
@@ -2082,12 +2085,12 @@ Pair ToolBox::GetTextStartEnd( long nText ) const
// -----------------------------------------------------------------------
-sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const
+USHORT ToolBox::GetDisplayItemId( long nText ) const
{
- sal_uInt16 nItemId = 0;
+ USHORT nItemId = 0;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
- if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
+ if( mpData->m_pLayoutData && nText >= 0 && (ULONG)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText];
return nItemId;
}
@@ -2107,7 +2110,7 @@ const Link& ToolBox::GetDropdownClickHdl() const
// -----------------------------------------------------------------------
-void ToolBox::SetMenuType( sal_uInt16 aType )
+void ToolBox::SetMenuType( USHORT aType )
{
if( aType != mpData->maMenuType )
{
@@ -2117,9 +2120,9 @@ void ToolBox::SetMenuType( sal_uInt16 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) ? sal_True : sal_False );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
- mbFormat = sal_True;
+ mbFormat = TRUE;
ImplFormat();
ImplSetMinMaxFloatSize( this );
}
@@ -2132,12 +2135,12 @@ void ToolBox::SetMenuType( sal_uInt16 aType )
}
}
-sal_uInt16 ToolBox::GetMenuType() const
+USHORT ToolBox::GetMenuType() const
{
return mpData->maMenuType;
}
-sal_Bool ToolBox::IsMenuEnabled() const
+BOOL ToolBox::IsMenuEnabled() const
{
return mpData->maMenuType != TOOLBOX_MENUTYPE_NONE;
}
@@ -2159,7 +2162,7 @@ const Link& ToolBox::GetMenuButtonHdl() const
// -----------------------------------------------------------------------
-sal_Bool ToolBox::ImplHasClippedItems()
+BOOL ToolBox::ImplHasClippedItems()
{
// are any items currently clipped ?
ImplFormat();
@@ -2167,10 +2170,10 @@ sal_Bool ToolBox::ImplHasClippedItems()
while ( it != mpData->m_aItems.end() )
{
if( it->IsClipped() )
- return sal_True;
- ++it;
+ return TRUE;
+ it++;
}
- return sal_False;
+ return FALSE;
}
void ToolBox::ImplUpdateCustomMenu()
@@ -2181,7 +2184,7 @@ void ToolBox::ImplUpdateCustomMenu()
PopupMenu *pMenu = GetMenu();
- sal_uInt16 i = 0;
+ USHORT i = 0;
// remove old entries
while( i < pMenu->GetItemCount() )
{
@@ -2202,7 +2205,7 @@ void ToolBox::ImplUpdateCustomMenu()
{
if( it->IsClipped() )
{
- sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
+ USHORT 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 );
@@ -2215,9 +2218,9 @@ IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent*, pEvent )
{
if( pEvent->GetMenu() == GetMenu() && pEvent->GetId() == VCLEVENT_MENU_SELECT )
{
- sal_uInt16 id = GetMenu()->GetItemId( pEvent->GetItemPos() );
+ USHORT id = GetMenu()->GetItemId( pEvent->GetItemPos() );
if( id >= TOOLBOX_MENUITEM_START )
- TriggerItem( id - TOOLBOX_MENUITEM_START, sal_False, sal_False );
+ TriggerItem( id - TOOLBOX_MENUITEM_START, FALSE, FALSE );
}
return 0;
}
@@ -2265,7 +2268,7 @@ void ToolBox::ImplExecuteCustomMenu()
}
}
- sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
+ USHORT uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE );
if ( aDelData.IsDelete() )
@@ -2302,24 +2305,24 @@ void ToolBox::ExecuteCustomMenu()
// -----------------------------------------------------------------------
// checks override first, useful during calculation of sizes
-sal_Bool ToolBox::ImplIsFloatingMode() const
+BOOL ToolBox::ImplIsFloatingMode() const
{
DBG_ASSERT( !(mpData->mbAssumeDocked && mpData->mbAssumeFloating),
"ToolBox::ImplIsFloatingMode(): cannot assume docked and floating" );
if( mpData->mbAssumeDocked )
- return sal_False;
+ return FALSE;
else if( mpData->mbAssumeFloating )
- return sal_True;
+ return TRUE;
else
return IsFloatingMode();
}
// checks override first, useful during calculation of sizes
-sal_Bool ToolBox::ImplIsInPopupMode() const
+BOOL ToolBox::ImplIsInPopupMode() const
{
if( mpData->mbAssumePopupMode )
- return sal_True;
+ return TRUE;
else
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
@@ -2329,7 +2332,7 @@ sal_Bool ToolBox::ImplIsInPopupMode() const
// -----------------------------------------------------------------------
-void ToolBox::Lock( sal_Bool bLock )
+void ToolBox::Lock( BOOL bLock )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( !pWrapper )
@@ -2339,8 +2342,8 @@ void ToolBox::Lock( sal_Bool bLock )
mpData->mbIsLocked = bLock;
if( !ImplIsFloatingMode() )
{
- mbCalc = sal_True;
- mbFormat = sal_True;
+ mbCalc = TRUE;
+ mbFormat = TRUE;
SetSizePixel( CalcWindowSizePixel(1) );
Invalidate();
}
@@ -2349,7 +2352,7 @@ void ToolBox::Lock( sal_Bool bLock )
// -----------------------------------------------------------------------
-sal_Bool ToolBox::AlwaysLocked()
+BOOL ToolBox::AlwaysLocked()
{
// read config item to determine toolbox behaviour, used for subtoolbars
@@ -2361,39 +2364,39 @@ sal_Bool ToolBox::AlwaysLocked()
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars")) ); // note: case sensisitive !
+ OUString::createFromAscii( "/org.openoffice.Office.UI.GlobalSettings/Toolbars" ) ); // note: case sensisitive !
if ( aNode.isValid() )
{
// feature enabled ?
- sal_Bool bStatesEnabled = sal_Bool();
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("StatesEnabled")) );
+ BOOL bStatesEnabled = BOOL();
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "StatesEnabled" ) );
if( aValue >>= bStatesEnabled )
{
- if( bStatesEnabled == sal_True )
+ if( bStatesEnabled == 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 !
+ OUString::createFromAscii( "/org.openoffice.Office.UI.GlobalSettings/Toolbars/States" ) ); // note: case sensisitive !
- sal_Bool bLocked = sal_Bool();
- ::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Locked")) );
+ BOOL bLocked = BOOL();
+ ::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString::createFromAscii( "Locked" ) );
if( aValue2 >>= bLocked )
- nAlwaysLocked = (bLocked == sal_True) ? 1 : 0;
+ nAlwaysLocked = (bLocked == TRUE) ? 1 : 0;
}
}
}
}
- return nAlwaysLocked == 1 ? sal_True : sal_False;
+ return nAlwaysLocked == 1 ? TRUE : FALSE;
}
-sal_Bool ToolBox::WillUsePopupMode() const
+BOOL ToolBox::WillUsePopupMode() const
{
return mpData->mbWillUsePopupMode;
}
-void ToolBox::WillUsePopupMode( sal_Bool b )
+void ToolBox::WillUsePopupMode( BOOL b )
{
mpData->mbWillUsePopupMode = b;
}
@@ -2402,15 +2405,17 @@ void ToolBox::ImplUpdateImageList()
{
if (mpData->mpImageListProvider != NULL)
{
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
try
{
- ImageListType eType = vcl::HIGHCONTRAST_NO;
+ ImageListType eType = bHC ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
+
if (eType != mpData->meImageListType)
{
vcl::IImageListProvider* pImageListProvider = mpData->mpImageListProvider;
SetImageList( pImageListProvider->getImageList(eType) );
mpData->meImageListType = eType;
- }
+ }
}
catch (com::sun::star::lang::IllegalArgumentException &) {}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fdb86cb07303..c130c8cf8306 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,12 +34,14 @@
#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"
@@ -63,7 +65,6 @@
#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"
@@ -86,6 +87,7 @@
#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>
@@ -95,6 +97,7 @@
#include <set>
#include <typeinfo>
+using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
@@ -102,8 +105,6 @@ using namespace ::com::sun::star::datatransfer::dnd;
using namespace ::com::sun::star;
using namespace com::sun;
-using ::rtl::OUString;
-
using ::com::sun::star::awt::XTopWindow;
// =======================================================================
@@ -112,12 +113,12 @@ DBG_NAME( Window )
// =======================================================================
-#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)
+#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)
// -----------------------------------------------------------------------
@@ -132,21 +133,25 @@ struct ImplCalcToTopData
Region* mpInvalidateRegion;
};
-ImplAccessibleInfos::ImplAccessibleInfos()
+struct ImplAccessibleInfos
{
- nAccessibleRole = 0xFFFF;
- pAccessibleName = NULL;
- pAccessibleDescription = NULL;
- pLabeledByWindow = NULL;
- pLabelForWindow = NULL;
- pMemberOfWindow = NULL;
-}
+ USHORT nAccessibleRole;
+ String* pAccessibleName;
+ String* pAccessibleDescription;
-ImplAccessibleInfos::~ImplAccessibleInfos()
-{
- delete pAccessibleName;
- delete pAccessibleDescription;
-}
+ ImplAccessibleInfos()
+ {
+ nAccessibleRole = 0xFFFF;
+ pAccessibleName = NULL;
+ pAccessibleDescription = NULL;
+ }
+
+ ~ImplAccessibleInfos()
+ {
+ delete pAccessibleName;
+ delete pAccessibleDescription;
+ }
+};
// -----------------------------------------------------------------------
@@ -262,53 +267,31 @@ 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;
- 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 );
- }
+ 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 ) );
- const int nFirstChar = HasGlyphs( rFont, aTestText );
- const bool bUIFontOk = (nFirstChar >= aTestText.Len());
- return bUIFontOk;
+ return HasGlyphs( rFont, aTestText ) >= aTestText.Len();
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl )
+void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
{
+ // reset high contrast to false, so the system can either update it
+ // or AutoDetectSystemHC can kick in (see below)
StyleSettings aTmpSt( rSettings.GetStyleSettings() );
- aTmpSt.SetHighContrastMode( sal_False );
+ aTmpSt.SetHighContrastMode( 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;
@@ -488,6 +471,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
rSettings.SetStyleSettings( aStyleSettings );
+
// auto detect HC mode; if the system already set it to "yes"
// (see above) then accept that
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
@@ -495,10 +479,10 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Accessibility")) ); // note: case sensisitive !
+ OUString::createFromAscii( "org.openoffice.Office.Common/Accessibility" ) ); // note: case sensisitive !
if ( aNode.isValid() )
{
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("AutoDetectSystemHC")) );
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "AutoDetectSystemHC" ) );
if( aValue >>= bTmp )
bAutoHCMode = bTmp;
}
@@ -508,18 +492,16 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
|| rSettings.GetStyleSettings().GetWindowColor().IsDark() )
{
aStyleSettings = rSettings.GetStyleSettings();
- aStyleSettings.SetHighContrastMode( sal_True );
- aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
+ aStyleSettings.SetHighContrastMode( TRUE );
rSettings.SetStyleSettings( aStyleSettings );
}
}
}
-
+
static const char* pEnvHC = getenv( "SAL_FORCE_HC" );
if( pEnvHC && *pEnvHC )
{
- aStyleSettings.SetHighContrastMode( sal_True );
- aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
+ aStyleSettings.SetHighContrastMode( TRUE );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -613,7 +595,6 @@ 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;
@@ -627,6 +608,8 @@ 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)
@@ -642,83 +625,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 = 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->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->mnNativeBackground = 0; // initialize later, depends on type
- 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.
+ 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.
- mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
+ mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
}
// -----------------------------------------------------------------------
@@ -736,7 +719,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
ImplSVData* pSVData = ImplGetSVData();
Window* pRealParent = pParent;
-
+
// 3D-Look vererben
if ( !mpWindowImpl->mbOverlapWin && pParent && (pParent->GetStyle() & WB_3DLOOK) )
nStyle |= WB_3DLOOK;
@@ -745,7 +728,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow
&& (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
{
- sal_uInt16 nBorderTypeStyle = 0;
+ USHORT nBorderTypeStyle = 0;
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
// handle WB_SYSTEMCHILDWINDOW
@@ -763,8 +746,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
else if( !mpWindowImpl->mbFrame && ! pParent )
{
- mpWindowImpl->mbOverlapWin = sal_True;
- mpWindowImpl->mbFrame = sal_True;
+ mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = TRUE;
}
// insert window in list
@@ -779,7 +762,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 = sal_False;
+ mpWindowImpl->mpOverlapData->mbSaveBack = FALSE;
mpWindowImpl->mpOverlapData->mnTopLevel = 1;
}
@@ -790,7 +773,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( mpWindowImpl->mbFrame )
{
// create frame
- sal_uLong nFrameStyle = 0;
+ ULONG nFrameStyle = 0;
if ( nStyle & WB_MOVEABLE )
nFrameStyle |= SAL_FRAME_STYLE_MOVEABLE;
@@ -896,21 +879,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 = 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->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->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 = sal_False;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = FALSE;
if ( pRealParent && IsTopWindow() )
{
@@ -955,7 +938,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 = sal_True;
+ pSVData->maAppData.mbSettingsInit = TRUE;
}
// If we create a Window with default size, query this
@@ -981,7 +964,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
+ USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
maFont = rStyleSettings.GetAppFont();
@@ -1042,7 +1025,7 @@ void Window::ImplInsertWindow( Window* pParent )
mpWindowImpl->mpFrameData = pFrameParent->mpWindowImpl->mpFrameData;
mpWindowImpl->mpFrame = pFrameParent->mpWindowImpl->mpFrame;
mpWindowImpl->mpFrameWindow = pFrameParent;
- mpWindowImpl->mbFrame = sal_False;
+ mpWindowImpl->mbFrame = FALSE;
// search overlap window and insert window in list
if ( ImplIsOverlapWindow() )
@@ -1081,7 +1064,7 @@ void Window::ImplInsertWindow( Window* pParent )
// -----------------------------------------------------------------------
-void Window::ImplRemoveWindow( sal_Bool bRemoveFrameData )
+void Window::ImplRemoveWindow( BOOL bRemoveFrameData )
{
// Fenster aus den Listen austragen
if ( !mpWindowImpl->mbFrame )
@@ -1134,7 +1117,7 @@ void Window::ImplRemoveWindow( sal_Bool bRemoveFrameData )
void Window::ImplCallResize()
{
- mpWindowImpl->mbCallResize = sal_False;
+ mpWindowImpl->mbCallResize = FALSE;
if( GetBackground().IsGradient() )
Invalidate();
@@ -1144,15 +1127,13 @@ 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 = sal_False;
+ mpWindowImpl->mbCallMove = FALSE;
if( mpWindowImpl->mbFrame )
{
@@ -1194,14 +1175,20 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
+static ULONG ImplAutoHelpID( ResMgr* pResMgr )
{
- rtl::OString aRet;
+ if ( !Application::IsAutoHelpIdEnabled() )
+ return 0;
- if( pResMgr && Application::IsAutoHelpIdEnabled() )
- aRet = pResMgr->GetAutoHelpId();
+ ULONG nHID = 0;
- return aRet;
+ DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
+ if( ! pResMgr )
+ return 0;
+
+ nHID = pResMgr->GetAutoHelpId();
+
+ return nHID;
}
// -----------------------------------------------------------------------
@@ -1221,26 +1208,25 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- sal_uLong nObjMask = ReadLongRes();
+ // 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 );
- // 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() );
+ ULONG nObjMask = ReadLongRes();
// ResourceStyle
- sal_uLong nRSStyle = ReadLongRes();
+ ULONG nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
+ // HelpId
+ ReadLongRes();
- if( nObjMask & WINDOW_HELPID )
- aHelpId = ReadByteStringRes();
-
- SetHelpId( aHelpId );
-
- sal_Bool bPos = sal_False;
- sal_Bool bSize = sal_False;
+ BOOL bPos = FALSE;
+ BOOL bSize = FALSE;
Point aPos;
Size aSize;
@@ -1249,7 +1235,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit ePosMap = MAP_PIXEL;
- bPos = sal_True;
+ bPos = TRUE;
if ( nObjMask & WINDOW_XYMAPMODE )
ePosMap = (MapUnit)ReadLongRes();
@@ -1264,7 +1250,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit eSizeMap = MAP_PIXEL;
- bSize = sal_True;
+ bSize = TRUE;
if ( nObjMask & WINDOW_WHMAPMODE )
eSizeMap = (MapUnit)ReadLongRes();
@@ -1290,28 +1276,25 @@ void Window::ImplLoadRes( const ResId& rResId )
SetSizePixel( aSize );
if ( nRSStyle & RSWND_DISABLED )
- Enable( sal_False );
+ Enable( FALSE );
if ( nObjMask & WINDOW_TEXT )
SetText( ReadStringRes() );
if ( nObjMask & WINDOW_HELPTEXT )
{
SetHelpText( ReadStringRes() );
- mpWindowImpl->mbHelpTextDynamic = sal_True;
+ mpWindowImpl->mbHelpTextDynamic = TRUE;
}
if ( nObjMask & WINDOW_QUICKTEXT )
SetQuickHelpText( ReadStringRes() );
if ( nObjMask & WINDOW_EXTRALONG )
- {
- sal_uIntPtr nRes = ReadLongRes();
- SetData( (void*)nRes );
- }
+ SetData( (void*)ReadLongRes() );
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( ReadByteStringRes() );
+ SetUniqueId( (ULONG)ReadLongRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
- sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes();
+ USHORT nBorderStyle = (USHORT)ReadLongRes();
SetBorderStyle( nBorderStyle );
}
}
@@ -1332,9 +1315,11 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mpFocusRect = NULL;
mpWindowImpl->mpWinData->mpTrackRect = NULL;
mpWindowImpl->mpWinData->mnTrackFlags = 0;
- 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
+ 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;
}
return mpWindowImpl->mpWinData;
@@ -1345,7 +1330,7 @@ ImplWinData* Window::ImplGetWinData() const
SalGraphics* Window::ImplGetFrameGraphics() const
{
if ( mpWindowImpl->mpFrameWindow->mpGraphics )
- mpWindowImpl->mpFrameWindow->mbInitClipRegion = sal_True;
+ mpWindowImpl->mpFrameWindow->mbInitClipRegion = TRUE;
else
mpWindowImpl->mpFrameWindow->ImplGetGraphics();
mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion();
@@ -1375,7 +1360,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
if ( !mpWindowImpl->mbVisible )
return NULL;
- sal_uInt16 nHitTest = ImplHitTest( rFramePos );
+ USHORT nHitTest = ImplHitTest( rFramePos );
if ( nHitTest & WINDOW_HITTEST_INSIDE )
{
// und danach gehen wir noch alle Child-Fenster durch
@@ -1399,7 +1384,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
// -----------------------------------------------------------------------
-sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
+USHORT Window::ImplHitTest( const Point& rFramePos )
{
Point aFramePos( rFramePos );
if( ImplIsAntiparallel() )
@@ -1419,7 +1404,7 @@ sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
return 0;
}
- sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE;
+ USHORT nHitTest = WINDOW_HITTEST_INSIDE;
if ( mpWindowImpl->mbMouseTransparent )
nHitTest |= WINDOW_HITTEST_TRANSPARENT;
return nHitTest;
@@ -1427,22 +1412,22 @@ sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
// -----------------------------------------------------------------------
-sal_Bool Window::ImplIsRealParentPath( const Window* pWindow ) const
+BOOL Window::ImplIsRealParentPath( const Window* pWindow ) const
{
pWindow = pWindow->GetParent();
while ( pWindow )
{
if ( pWindow == this )
- return sal_True;
+ return TRUE;
pWindow = pWindow->GetParent();
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Window::ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
+BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const
{
do
{
@@ -1452,19 +1437,19 @@ sal_Bool Window::ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow ) co
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return sal_True;
+ return TRUE;
}
while ( pWindow );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Window::ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
+BOOL Window::ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
{
if ( this == pWindow )
- return sal_True;
+ return TRUE;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -1494,15 +1479,15 @@ int Window::ImplTestMousePointerSet()
{
// Wenn Mouse gecaptured ist, dann soll MousePointer umgeschaltet werden
if ( IsMouseCaptured() )
- return sal_True;
+ return TRUE;
// Wenn sich Mouse ueber dem Fenster befindet, dann soll MousePointer
// umgeschaltet werden
Rectangle aClientRect( Point( 0, 0 ), GetOutputSizePixel() );
if ( aClientRect.IsInside( GetPointerPosPixel() ) )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1510,7 +1495,7 @@ int Window::ImplTestMousePointerSet()
PointerStyle Window::ImplGetMousePointer() const
{
PointerStyle ePointerStyle;
- sal_Bool bWait = sal_False;
+ BOOL bWait = FALSE;
if ( IsEnabled() && IsInputEnabled() && ! IsInModalMode() )
ePointerStyle = GetPointer().GetStyle();
@@ -1530,7 +1515,7 @@ PointerStyle Window::ImplGetMousePointer() const
if ( pWindow->mpWindowImpl->mnWaitCount )
{
ePointerStyle = POINTER_WAIT;
- bWait = sal_True;
+ bWait = TRUE;
}
else
{
@@ -1553,15 +1538,16 @@ PointerStyle Window::ImplGetMousePointer() const
void Window::ImplResetReallyVisible()
{
- sal_Bool bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
+ BOOL bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
- mbDevOutput = sal_False;
- mpWindowImpl->mbReallyVisible = sal_False;
- mpWindowImpl->mbReallyShown = sal_False;
+ mbDevOutput = FALSE;
+ mpWindowImpl->mbReallyVisible = FALSE;
+ mpWindowImpl->mbReallyShown = 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.
// Previously, we did this in Window::Show, but there some events got lost in certain situations.
+ // #104887# - 2004-08-10 - fs@openoffice.org
if( bBecameReallyInvisible && ImplIsAccessibleCandidate() )
ImplCallEventListeners( VCLEVENT_WINDOW_HIDE, this );
// TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_HIDE. Normally, we should
@@ -1594,16 +1580,17 @@ void Window::ImplSetReallyVisible()
if( !mpWindowImpl->mbReallyShown )
ImplCallInitShow();
- sal_Bool bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
+ BOOL bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
- mbDevOutput = sal_True;
- mpWindowImpl->mbReallyVisible = sal_True;
- mpWindowImpl->mbReallyShown = sal_True;
+ mbDevOutput = TRUE;
+ mpWindowImpl->mbReallyVisible = TRUE;
+ mpWindowImpl->mbReallyShown = 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.
// Previously, we did this in Window::Show, but there some events got lost in certain situations. Now
// we're doing it when the visibility really changes
+ // #104887# - 2004-08-10 - fs@openoffice.org
if( bBecameReallyVisible && ImplIsAccessibleCandidate() )
ImplCallEventListeners( VCLEVENT_WINDOW_SHOW, this );
// TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_SHOW. Normally, we should
@@ -1630,10 +1617,10 @@ void Window::ImplSetReallyVisible()
void Window::ImplCallInitShow()
{
- mpWindowImpl->mbReallyShown = sal_True;
- mpWindowImpl->mbInInitShow = sal_True;
+ mpWindowImpl->mbReallyShown = TRUE;
+ mpWindowImpl->mbInInitShow = TRUE;
StateChanged( STATE_CHANGE_INITSHOW );
- mpWindowImpl->mbInInitShow = sal_False;
+ mpWindowImpl->mbInInitShow = FALSE;
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
@@ -1689,7 +1676,7 @@ void Window::ImplInitResolutionSettings()
if ( mpWindowImpl->mbFrame )
{
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
+ USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
SetPointFont( rStyleSettings.GetAppFont() );
@@ -1715,7 +1702,7 @@ void Window::ImplInitResolutionSettings()
void Window::ImplPointToLogic( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( aSize.Width() )
{
@@ -1742,7 +1729,7 @@ void Window::ImplPointToLogic( Font& rFont ) const
void Window::ImplLogicToPoint( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( IsMapModeEnabled() )
aSize = LogicToPixel( aSize );
@@ -1766,9 +1753,9 @@ void Window::ImplLogicToPoint( Font& rFont ) const
// -----------------------------------------------------------------------
-sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
+BOOL Window::ImplSysObjClip( const Region* pOldRegion )
{
- sal_Bool bUpdate = sal_True;
+ BOOL bUpdate = TRUE;
if ( mpWindowImpl->mpSysObj )
{
@@ -1793,7 +1780,7 @@ sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
Region aRegion = *pWinChildClipRegion;
Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
Region aWinRectRegion( aWinRect );
- sal_uInt16 nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
+ USHORT nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
if ( aRegion == aWinRectRegion )
mpWindowImpl->mpSysObj->ResetClipRegion();
@@ -1812,9 +1799,9 @@ sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
long nY;
long nWidth;
long nHeight;
- sal_uLong nRectCount;
+ ULONG nRectCount;
ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ BOOL bRegionRect;
nRectCount = aRegion.GetRectCount();
mpWindowImpl->mpSysObj->BeginSetClipRegion( nRectCount );
@@ -1828,7 +1815,7 @@ sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
}
}
else
- bVisibleState = sal_False;
+ bVisibleState = FALSE;
}
// Visible-Status updaten
@@ -1892,31 +1879,31 @@ void Window::ImplUpdateSysObjClip()
// -----------------------------------------------------------------------
-sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
+BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
{
- sal_Bool bUpdate = sal_True;
+ BOOL bUpdate = TRUE;
if ( mpWindowImpl->mpSysObj )
{
Region* pOldRegion = NULL;
if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
pOldRegion = new Region( mpWindowImpl->maWinClipRegion );
- mbInitClipRegion = sal_True;
- mpWindowImpl->mbInitWinClipRegion = sal_True;
+ mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInitWinClipRegion = TRUE;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = sal_False;
+ bUpdate = FALSE;
pWindow = pWindow->mpWindowImpl->mpNext;
}
if ( !ImplSysObjClip( pOldRegion ) )
{
- mbInitClipRegion = sal_True;
- mpWindowImpl->mbInitWinClipRegion = sal_True;
- bUpdate = sal_False;
+ mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInitWinClipRegion = TRUE;
+ bUpdate = FALSE;
}
if ( pOldRegion )
@@ -1924,14 +1911,14 @@ sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
}
else
{
- mbInitClipRegion = sal_True;
- mpWindowImpl->mbInitWinClipRegion = sal_True;
+ mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInitWinClipRegion = TRUE;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = sal_False;
+ bUpdate = FALSE;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -1940,15 +1927,15 @@ sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-sal_Bool Window::ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller )
+BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller )
{
- sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
- bUpdate = sal_False;
+ bUpdate = FALSE;
pWindow = pWindow->mpWindowImpl->mpNext;
}
@@ -1957,18 +1944,18 @@ sal_Bool Window::ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-sal_Bool Window::ImplSetClipFlag( sal_Bool bSysObjOnlySmaller )
+BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller )
{
if ( !ImplIsOverlapWindow() )
{
- sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pParent = ImplGetParent();
if ( pParent &&
((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP)) )
{
- pParent->mbInitClipRegion = sal_True;
- pParent->mpWindowImpl->mbInitChildRegion = sal_True;
+ pParent->mbInitClipRegion = TRUE;
+ pParent->mpWindowImpl->mbInitChildRegion = TRUE;
}
// Schwestern muessen ihre ClipRegion auch neu berechnen
@@ -1978,7 +1965,7 @@ sal_Bool Window::ImplSetClipFlag( sal_Bool bSysObjOnlySmaller )
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = sal_False;
+ bUpdate = FALSE;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2058,7 +2045,7 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps )
+void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps )
{
if ( bThis )
ImplIntersectWindowClipRegion( rRegion );
@@ -2093,21 +2080,21 @@ void Window::ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOver
// -----------------------------------------------------------------------
-sal_Bool Window::ImplClipChilds( Region& rRegion )
+BOOL Window::ImplClipChilds( Region& rRegion )
{
- sal_Bool bOtherClip = sal_False;
+ BOOL bOtherClip = FALSE;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
{
// ParentClipMode-Flags auswerten
- sal_uInt16 nClipMode = pWindow->GetParentClipMode();
+ USHORT nClipMode = pWindow->GetParentClipMode();
if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) &&
((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) )
pWindow->ImplExcludeWindowRegion( rRegion );
else
- bOtherClip = sal_True;
+ bOtherClip = TRUE;
}
pWindow = pWindow->mpWindowImpl->mpNext;
@@ -2161,13 +2148,13 @@ void Window::ImplInitWinClipRegion()
ImplClipSiblings( mpWindowImpl->maWinClipRegion );
// Clip Parent Boundaries
- ImplClipBoundaries( mpWindowImpl->maWinClipRegion, sal_False, sal_True );
+ ImplClipBoundaries( mpWindowImpl->maWinClipRegion, FALSE, TRUE );
// Clip Children
if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
- mpWindowImpl->mbInitChildRegion = sal_True;
+ mpWindowImpl->mbInitChildRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = sal_False;
+ mpWindowImpl->mbInitWinClipRegion = FALSE;
}
// -----------------------------------------------------------------------
@@ -2192,7 +2179,7 @@ void Window::ImplInitWinChildClipRegion()
ImplClipChilds( *mpWindowImpl->mpChildClipRegion );
}
- mpWindowImpl->mbInitChildRegion = sal_False;
+ mpWindowImpl->mbInitChildRegion = FALSE;
}
// -----------------------------------------------------------------------
@@ -2273,7 +2260,7 @@ void Window::ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region&
// -----------------------------------------------------------------------
void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
- sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings )
+ BOOL bChilds, BOOL bParent, BOOL bSiblings )
{
Region aRegion( rSourceRect );
if ( mpWindowImpl->mbWinRegion )
@@ -2345,13 +2332,13 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
// -----------------------------------------------------------------------
-void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
+void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
{
// call PrePaint. PrePaint may add to the invalidate region as well as
// other parameters used below.
PrePaint();
-
- mpWindowImpl->mbPaintFrame = sal_False;
+
+ mpWindowImpl->mbPaintFrame = FALSE;
if ( nPaintFlags & IMPL_PAINT_PAINTALLCHILDS )
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALLCHILDS | (nPaintFlags & IMPL_PAINT_PAINTALL);
@@ -2402,12 +2389,11 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
mpWindowImpl->mnPaintFlags = 0;
if ( !mpWindowImpl->maInvalidateRegion.IsEmpty() )
{
- bool bRestoreCursor = false;
if ( mpWindowImpl->mpCursor )
- bRestoreCursor = mpWindowImpl->mpCursor->ImplHide();
+ mpWindowImpl->mpCursor->ImplHide();
- mbInitClipRegion = sal_True;
- mpWindowImpl->mbInPaint = sal_True;
+ mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInPaint = TRUE;
// Paint-Region zuruecksetzen
Region aPaintRegion( mpWindowImpl->maInvalidateRegion );
@@ -2447,11 +2433,11 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
if ( mpWindowImpl->mbFocusVisible )
ImplInvertFocus( *(mpWindowImpl->mpWinData->mpFocusRect) );
}
- mpWindowImpl->mbInPaint = sal_False;
- mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInPaint = FALSE;
+ mbInitClipRegion = TRUE;
mpWindowImpl->mpPaintRegion = NULL;
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( false, bRestoreCursor );
+ mpWindowImpl->mpCursor->ImplShow( FALSE );
}
}
else
@@ -2477,7 +2463,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
// #98943# draw toolbox selection
if( !aSelectionRect.IsEmpty() )
- DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False );
+ DrawSelectionBackground( aSelectionRect, 3, FALSE, TRUE, FALSE );
if ( pChildRegion )
delete pChildRegion;
@@ -2544,14 +2530,14 @@ IMPL_LINK( Window, ImplHandleResizeTimerHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-void Window::ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags )
{
// PAINTCHILDS bei allen Parent-Fenster bis zum ersten OverlapWindow
// setzen
if ( !ImplIsOverlapWindow() )
{
Window* pTempWindow = this;
- sal_uInt16 nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
+ USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
do
{
pTempWindow = pTempWindow->ImplGetParent();
@@ -2609,7 +2595,7 @@ void Window::ImplInvalidateOverlapFrameRegion( const Region& rRegion )
{
Region aRegion = rRegion;
- ImplClipBoundaries( aRegion, sal_True, sal_True );
+ ImplClipBoundaries( aRegion, TRUE, TRUE );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
@@ -2639,7 +2625,7 @@ void Window::ImplInvalidateParentFrameRegion( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
{
// Hintergrund-Sicherung zuruecksetzen
@@ -2647,7 +2633,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
ImplInvalidateAllOverlapBackgrounds();
// Feststellen, was neu ausgegeben werden muss
- sal_Bool bInvalidateAll = !pRegion;
+ BOOL bInvalidateAll = !pRegion;
// Transparent-Invalidate beruecksichtigen
Window* pOpaqueWindow = this;
@@ -2660,7 +2646,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
{
pOpaqueWindow = pTempWindow;
nFlags |= INVALIDATE_CHILDREN;
- bInvalidateAll = sal_False;
+ bInvalidateAll = FALSE;
break;
}
@@ -2672,7 +2658,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
}
// Region zusammenbauen
- sal_uInt16 nOrgFlags = nFlags;
+ USHORT nOrgFlags = nFlags;
if ( !(nFlags & (INVALIDATE_CHILDREN | INVALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2681,7 +2667,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
nFlags |= INVALIDATE_CHILDREN;
}
if ( (nFlags & INVALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bInvalidateAll = sal_False;
+ bInvalidateAll = FALSE;
if ( bInvalidateAll )
ImplInvalidateFrameRegion( NULL, nFlags );
else
@@ -2700,7 +2686,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
else
aRegion.Intersect( *pRegion );
}
- ImplClipBoundaries( aRegion, sal_True, sal_True );
+ ImplClipBoundaries( aRegion, TRUE, TRUE );
if ( nFlags & INVALIDATE_NOCHILDREN )
{
nFlags &= ~INVALIDATE_CHILDREN;
@@ -2727,7 +2713,7 @@ void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- sal_Bool bChilds )
+ BOOL bChilds )
{
if ( (mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALL)) == IMPL_PAINT_PAINT )
{
@@ -2742,7 +2728,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
- pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, sal_True );
+ pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, TRUE );
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2752,7 +2738,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- sal_Bool bChilds )
+ BOOL bChilds )
{
// Paint-Region auch verschieben, wenn noch Paints anstehen
ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, bChilds );
@@ -2780,7 +2766,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
if ( !aPaintAllRegion.IsEmpty() )
{
aPaintAllRegion.Move( nHorzScroll, nVertScroll );
- sal_uInt16 nPaintFlags = 0;
+ USHORT nPaintFlags = 0;
if ( bChilds )
mpWindowImpl->mnPaintFlags |= INVALIDATE_CHILDREN;
ImplInvalidateFrameRegion( &aPaintAllRegion, nPaintFlags );
@@ -2790,7 +2776,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void Window::ImplValidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags )
{
if ( !pRegion )
mpWindowImpl->maInvalidateRegion.SetEmpty();
@@ -2835,11 +2821,11 @@ void Window::ImplValidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
{
// Region zusammenbauen
- sal_Bool bValidateAll = !pRegion;
- sal_uInt16 nOrgFlags = nFlags;
+ BOOL bValidateAll = !pRegion;
+ USHORT nOrgFlags = nFlags;
if ( !(nFlags & (VALIDATE_CHILDREN | VALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2848,7 +2834,7 @@ void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
nFlags |= VALIDATE_CHILDREN;
}
if ( (nFlags & VALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bValidateAll = sal_False;
+ bValidateAll = FALSE;
if ( bValidateAll )
ImplValidateFrameRegion( NULL, nFlags );
else
@@ -2857,7 +2843,7 @@ void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
Region aRegion( aRect );
if ( pRegion )
aRegion.Intersect( *pRegion );
- ImplClipBoundaries( aRegion, sal_True, sal_True );
+ ImplClipBoundaries( aRegion, TRUE, TRUE );
if ( nFlags & VALIDATE_NOCHILDREN )
{
nFlags &= ~VALIDATE_CHILDREN;
@@ -2877,7 +2863,7 @@ void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
void Window::ImplScroll( const Rectangle& rRect,
- long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
+ long nHorzScroll, long nVertScroll, USHORT nFlags )
{
if ( !IsDeviceOutputNecessary() )
return;
@@ -2895,7 +2881,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplHide();
- sal_uInt16 nOrgFlags = nFlags;
+ USHORT nOrgFlags = nFlags;
if ( !(nFlags & (SCROLL_CHILDREN | SCROLL_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2905,14 +2891,14 @@ void Window::ImplScroll( const Rectangle& rRect,
}
Region aInvalidateRegion;
- sal_Bool bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
- sal_Bool bErase = (nFlags & SCROLL_NOERASE) == 0;
+ BOOL bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
+ BOOL bErase = (nFlags & SCROLL_NOERASE) == 0;
if ( !mpWindowImpl->mpFirstChild )
- bScrollChilds = sal_False;
+ bScrollChilds = FALSE;
// --- RTL --- check if this window requires special action
- sal_Bool bReMirror = ( ImplIsAntiparallel() );
+ BOOL bReMirror = ( ImplIsAntiparallel() );
Rectangle aRectMirror( rRect );
if( bReMirror )
@@ -2927,7 +2913,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !(nFlags & SCROLL_NOINVALIDATE) )
{
- ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, sal_True, sal_False );
+ ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, TRUE, FALSE );
// --- RTL ---
// if the scrolling on the device is performed in the opposite direction
@@ -2937,7 +2923,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !aInvalidateRegion.IsEmpty() )
{
aInvalidateRegion.Move( bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll );
- bErase = sal_True;
+ bErase = TRUE;
}
if ( !(nFlags & SCROLL_NOWINDOWINVALIDATE) )
{
@@ -2959,7 +2945,7 @@ void Window::ImplScroll( const Rectangle& rRect,
aRegion.Exclude( aInvalidateRegion );
- ImplClipBoundaries( aRegion, sal_False, sal_True );
+ ImplClipBoundaries( aRegion, FALSE, TRUE );
if ( !bScrollChilds )
{
if ( nOrgFlags & SCROLL_NOCHILDREN )
@@ -3010,7 +2996,7 @@ void Window::ImplScroll( const Rectangle& rRect,
// so it has to be re-mirrored before calling the Paint-handler
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_CHECKRTL;
- sal_uInt16 nPaintFlags = INVALIDATE_CHILDREN;
+ USHORT nPaintFlags = INVALIDATE_CHILDREN;
if ( !bErase )
nPaintFlags |= INVALIDATE_NOERASE;
if ( !bScrollChilds )
@@ -3040,24 +3026,24 @@ void Window::ImplScroll( const Rectangle& rRect,
Update();
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( false );
+ mpWindowImpl->mpCursor->ImplShow( FALSE );
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateAll( sal_Bool bOverlapWindows )
+void Window::ImplUpdateAll( BOOL bOverlapWindows )
{
if ( !mpWindowImpl->mbReallyVisible )
return;
- sal_Bool bFlush = sal_False;
+ BOOL bFlush = 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 = sal_True;
+ bFlush = TRUE;
}
// Ein Update wirkt immer auf das OverlapWindow, damit bei spaeteren
@@ -3116,9 +3102,9 @@ void Window::ImplUpdateWindowPtr()
// -----------------------------------------------------------------------
-void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
+void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
{
- sal_Bool bVisible = IsVisible();
+ BOOL bVisible = IsVisible();
Show( false );
ImplRemoveWindow( bNewFrame );
Window* pRealParent = mpWindowImpl->mpRealParent;
@@ -3145,9 +3131,9 @@ void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
// -----------------------------------------------------------------------
-sal_Bool Window::ImplUpdatePos()
+BOOL Window::ImplUpdatePos()
{
- sal_Bool bSysChild = sal_False;
+ BOOL bSysChild = FALSE;
if ( ImplIsOverlapWindow() )
{
@@ -3166,12 +3152,12 @@ sal_Bool Window::ImplUpdatePos()
while ( pChild )
{
if ( pChild->ImplUpdatePos() )
- bSysChild = sal_True;
+ bSysChild = TRUE;
pChild = pChild->mpWindowImpl->mpNext;
}
if ( mpWindowImpl->mpSysObj )
- bSysChild = sal_True;
+ bSysChild = TRUE;
return bSysChild;
}
@@ -3193,11 +3179,12 @@ void Window::ImplUpdateSysObjPos()
// -----------------------------------------------------------------------
void Window::ImplPosSizeWindow( long nX, long nY,
- long nWidth, long nHeight, sal_uInt16 nFlags )
+ long nWidth, long nHeight, USHORT nFlags )
{
- sal_Bool bNewPos = sal_False;
- sal_Bool bNewSize = sal_False;
- sal_Bool bCopyBits = sal_False;
+ BOOL bNewPos = FALSE;
+ BOOL bNewSize = FALSE;
+ BOOL bNewWidth = FALSE;
+ BOOL bCopyBits = FALSE;
long nOldOutOffX = mnOutOffX;
long nOldOutOffY = mnOutOffY;
long nOldOutWidth = mnOutWidth;
@@ -3219,17 +3206,17 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mnOutWidth && mnOutHeight && !mpWindowImpl->mbPaintTransparent &&
!mpWindowImpl->mbInitWinClipRegion && !mpWindowImpl->maWinClipRegion.IsEmpty() &&
!HasPaintEvent() )
- bCopyBits = sal_True;
+ bCopyBits = TRUE;
}
- sal_Bool bnXRecycled = sal_False; // avoid duplicate mirroring in RTL case
+ BOOL bnXRecycled = 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 = sal_True; // we're using a mnX which was already mirrored in RTL case
+ bnXRecycled = TRUE; // we're using a mnX which was already mirrored in RTL case
}
if ( nWidth < 0 )
@@ -3237,8 +3224,9 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nWidth != mnOutWidth )
{
mnOutWidth = nWidth;
- bNewSize = sal_True;
- bCopyBits = sal_False;
+ bNewSize = TRUE;
+ bCopyBits = FALSE;
+ bNewWidth = TRUE;
}
}
if ( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -3248,8 +3236,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nHeight != mnOutHeight )
{
mnOutHeight = nHeight;
- bNewSize = sal_True;
- bCopyBits = sal_False;
+ bNewSize = TRUE;
+ bCopyBits = FALSE;
}
}
@@ -3290,7 +3278,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
}
}
-
+
// check maPos as well, as it could have been changed for client windows (ImplCallMove())
if ( mpWindowImpl->mnAbsScreenX != aPtDev.X() || nX != mpWindowImpl->mnX || nOrgX != mpWindowImpl->maPos.X() )
{
@@ -3299,12 +3287,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, sal_False, sal_True, sal_True );
+ *pOverlapRegion, FALSE, TRUE, TRUE );
}
mpWindowImpl->mnX = nX;
mpWindowImpl->maPos.X() = nOrgX;
mpWindowImpl->mnAbsScreenX = aPtDev.X(); // --- RTL --- (store real screen pos)
- bNewPos = sal_True;
+ bNewPos = TRUE;
}
}
if ( nFlags & WINDOW_POSSIZE_Y )
@@ -3317,11 +3305,11 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, sal_False, sal_True, sal_True );
+ *pOverlapRegion, FALSE, TRUE, TRUE );
}
mpWindowImpl->mnY = nY;
mpWindowImpl->maPos.Y() = nY;
- bNewPos = sal_True;
+ bNewPos = TRUE;
}
}
@@ -3337,7 +3325,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
*/
if ( bNewPos || bNewSize )
{
- sal_Bool bUpdateSysObjPos = sal_False;
+ BOOL bUpdateSysObjPos = FALSE;
if ( bNewPos )
bUpdateSysObjPos = ImplUpdatePos();
@@ -3364,7 +3352,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
else
{
- mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = sal_True;
+ mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = TRUE;
}
}
}
@@ -3390,12 +3378,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
else
{
if ( bNewPos )
- mpWindowImpl->mbCallMove = sal_True;
+ mpWindowImpl->mbCallMove = TRUE;
if ( bNewSize )
- mpWindowImpl->mbCallResize = sal_True;
+ mpWindowImpl->mbCallResize = TRUE;
}
- sal_Bool bUpdateSysObjClip = sal_False;
+ BOOL bUpdateSysObjClip = FALSE;
if ( IsReallyVisible() )
{
if ( bNewPos || bNewSize )
@@ -3406,7 +3394,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mpWindowImpl->mpFrameData->mpFirstBackWin )
ImplInvalidateAllOverlapBackgrounds();
// Clip-Flag neu setzen
- bUpdateSysObjClip = !ImplSetClipFlag( sal_True );
+ bUpdateSysObjClip = !ImplSetClipFlag( TRUE );
}
// Fensterinhalt invalidieren ?
@@ -3414,8 +3402,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
{
if ( bNewPos )
{
- sal_Bool bInvalidate = sal_False;
- sal_Bool bParentPaint = sal_True;
+ BOOL bInvalidate = FALSE;
+ BOOL bParentPaint = TRUE;
if ( !ImplIsOverlapWindow() )
bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled();
if ( bCopyBits && bParentPaint && !HasPaintEvent() )
@@ -3425,7 +3413,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Size( mnOutWidth, mnOutHeight ) ) );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, sal_False, sal_True );
+ ImplClipBoundaries( aRegion, FALSE, TRUE );
if ( !pOverlapRegion->IsEmpty() )
{
pOverlapRegion->Move( mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY );
@@ -3437,7 +3425,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
ImplMoveAllInvalidateRegions( Rectangle( Point( nOldOutOffX, nOldOutOffY ),
Size( nOldOutWidth, nOldOutHeight ) ),
mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY,
- sal_True );
+ TRUE );
SalGraphics* pGraphics = ImplGetFrameGraphics();
if ( pGraphics )
{
@@ -3450,10 +3438,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
SAL_COPYAREA_WINDOWINVALIDATE, this );
}
else
- bInvalidate = sal_True;
+ bInvalidate = TRUE;
}
else
- bInvalidate = sal_True;
+ bInvalidate = TRUE;
if ( !bInvalidate )
{
if ( !pOverlapRegion->IsEmpty() )
@@ -3461,10 +3449,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
}
else
- bInvalidate = sal_True;
+ bInvalidate = TRUE;
}
else
- bInvalidate = sal_True;
+ bInvalidate = TRUE;
if ( bInvalidate )
ImplInvalidateFrameRegion( NULL, INVALIDATE_CHILDREN );
}
@@ -3476,7 +3464,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
aRegion.Exclude( *pOldRegion );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, sal_False, sal_True );
+ ImplClipBoundaries( aRegion, FALSE, TRUE );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
}
@@ -3489,7 +3477,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Region aRegion( *pOldRegion );
if ( !mpWindowImpl->mbPaintTransparent )
ImplExcludeWindowRegion( aRegion );
- ImplClipBoundaries( aRegion, sal_False, sal_True );
+ ImplClipBoundaries( aRegion, FALSE, TRUE );
if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow )
ImplInvalidateParentFrameRegion( aRegion );
}
@@ -3580,7 +3568,7 @@ void Window::ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData )
// -----------------------------------------------------------------------
-void Window::ImplToTop( sal_uInt16 nFlags )
+void Window::ImplToTop( USHORT nFlags )
{
DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" );
@@ -3597,7 +3585,7 @@ void Window::ImplToTop( sal_uInt16 nFlags )
// do not bring floating windows on the client to top
if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) )
{
- sal_uInt16 nSysFlags = 0;
+ USHORT nSysFlags = 0;
if ( nFlags & TOTOP_RESTOREWHENMIN )
nSysFlags |= SAL_FRAME_TOTOP_RESTOREWHENMIN;
if ( nFlags & TOTOP_FOREGROUNDTASK )
@@ -3620,7 +3608,7 @@ void Window::ImplToTop( sal_uInt16 nFlags )
mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
// AlwaysOnTop beruecksichtigen
- sal_Bool bOnTop = IsAlwaysOnTopEnabled();
+ BOOL bOnTop = IsAlwaysOnTopEnabled();
Window* pNextWin = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
if ( !bOnTop )
{
@@ -3633,7 +3621,7 @@ void Window::ImplToTop( sal_uInt16 nFlags )
}
// TopLevel abpruefen
- sal_uInt8 nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
+ BYTE nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
while ( pNextWin )
{
if ( (bOnTop != pNextWin->IsAlwaysOnTopEnabled()) ||
@@ -3674,7 +3662,7 @@ void Window::ImplToTop( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::ImplStartToTop( sal_uInt16 nFlags )
+void Window::ImplStartToTop( USHORT nFlags )
{
ImplCalcToTopData aStartData;
ImplCalcToTopData* pCurData;
@@ -3729,7 +3717,7 @@ void Window::ImplStartToTop( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible )
+void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible )
{
// Soll Focus auch geholt werden?
if ( !(nFlags & TOTOP_NOGRABFOCUS) )
@@ -3748,7 +3736,7 @@ void Window::ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible )
pFocusWindow = pFocusWindow->ImplGetParent();
}
if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) &&
- !pFocusWindow->HasChildPathFocus( sal_True ) )
+ !pFocusWindow->HasChildPathFocus( TRUE ) )
pFocusWindow->GrabFocus();
}
@@ -3766,7 +3754,7 @@ void Window::ImplShowAllOverlaps()
if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
{
pOverlapWindow->Show( true, SHOW_NOACTIVATE );
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_False;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = FALSE;
}
pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -3782,7 +3770,7 @@ void Window::ImplHideAllOverlaps()
{
if ( pOverlapWindow->IsVisible() )
{
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_True;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = TRUE;
pOverlapWindow->Show( false );
}
@@ -3792,24 +3780,24 @@ void Window::ImplHideAllOverlaps()
// -----------------------------------------------------------------------
-void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged )
+void Window::ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged )
{
if ( mpWindowImpl->mpFrameData->mbMouseIn && mpWindowImpl->mpFrameWindow->mpWindowImpl->mbReallyVisible )
{
- sal_uLong nTime = Time::GetSystemTicks();
+ ULONG nTime = Time::GetSystemTicks();
long nX = mpWindowImpl->mpFrameData->mnLastMouseX;
long nY = mpWindowImpl->mpFrameData->mnLastMouseY;
- sal_uInt16 nCode = nMouseCode;
- sal_uInt16 nMode = mpWindowImpl->mpFrameData->mnMouseMode;
- sal_Bool bLeave;
+ USHORT nCode = nMouseCode;
+ USHORT nMode = mpWindowImpl->mpFrameData->mnMouseMode;
+ BOOL bLeave;
// Auf MouseLeave testen
if ( ((nX < 0) || (nY < 0) ||
(nX >= mpWindowImpl->mpFrameWindow->mnOutWidth) ||
(nY >= mpWindowImpl->mpFrameWindow->mnOutHeight)) &&
!ImplGetSVData()->maWinData.mpCaptureWin )
- bLeave = sal_True;
+ bLeave = TRUE;
else
- bLeave = sal_False;
+ bLeave = FALSE;
nMode |= MOUSE_SYNTHETIC;
if ( bModChanged )
nMode |= MOUSE_MODIFIERCHANGED;
@@ -3856,8 +3844,8 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
Window* pNewRealWindow;
Window* pOldRealWindow;
Window* pLastRealWindow;
- sal_Bool bCallActivate = sal_True;
- sal_Bool bCallDeactivate = sal_True;
+ BOOL bCallActivate = TRUE;
+ BOOL bCallDeactivate = TRUE;
pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
@@ -3868,7 +3856,7 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
!pNewRealWindow->GetActivateMode() )
{
pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
- bCallDeactivate = sal_False;
+ bCallDeactivate = FALSE;
}
}
else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
@@ -3877,15 +3865,15 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
if ( pSVData->maWinData.mpLastDeacWin )
{
if ( pSVData->maWinData.mpLastDeacWin == pNewOverlapWindow )
- bCallActivate = sal_False;
+ bCallActivate = FALSE;
else
{
pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow();
- pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = sal_False;
+ pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = FALSE;
pSVData->maWinData.mpLastDeacWin->Deactivate();
if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin )
{
- pLastRealWindow->mpWindowImpl->mbActive = sal_True;
+ pLastRealWindow->mpWindowImpl->mbActive = TRUE;
pLastRealWindow->Activate();
}
}
@@ -3897,14 +3885,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( pOldOverlapWindow->mpWindowImpl->mbActive )
{
- pOldOverlapWindow->mpWindowImpl->mbActive = sal_False;
+ pOldOverlapWindow->mpWindowImpl->mbActive = FALSE;
pOldOverlapWindow->Deactivate();
}
if ( pOldRealWindow != pOldOverlapWindow )
{
if( pOldRealWindow->mpWindowImpl->mbActive )
{
- pOldRealWindow->mpWindowImpl->mbActive = sal_False;
+ pOldRealWindow->mpWindowImpl->mbActive = FALSE;
pOldRealWindow->Deactivate();
}
}
@@ -3913,14 +3901,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( ! pNewOverlapWindow->mpWindowImpl->mbActive )
{
- pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
+ pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
pNewOverlapWindow->Activate();
}
if ( pNewRealWindow != pNewOverlapWindow )
{
if( ! pNewRealWindow->mpWindowImpl->mbActive )
{
- pNewRealWindow->mpWindowImpl->mbActive = sal_True;
+ pNewRealWindow->mpWindowImpl->mbActive = TRUE;
pNewRealWindow->Activate();
}
}
@@ -3942,7 +3930,7 @@ static bool IsWindowFocused(const WindowImpl& rWinImpl)
}
// -----------------------------------------------------------------------
-void Window::ImplGrabFocus( sal_uInt16 nFlags )
+void Window::ImplGrabFocus( USHORT nFlags )
{
// #143570# no focus for destructing windows
if( mpWindowImpl->mbInDtor )
@@ -4000,13 +3988,13 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// which is done using ToTop
ImplSVData* pSVData = ImplGetSVData();
- sal_Bool bAsyncFocusWaiting = sal_False;
+ BOOL bAsyncFocusWaiting = FALSE;
Window *pFrame = pSVData->maWinData.mpFirstFrame;
while( pFrame )
{
if( pFrame != mpWindowImpl->mpFrameWindow && pFrame->mpWindowImpl->mpFrameData->mnFocusId )
{
- bAsyncFocusWaiting = sal_True;
+ bAsyncFocusWaiting = TRUE;
break;
}
pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4014,7 +4002,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
bool bHasFocus = IsWindowFocused(*mpWindowImpl);
- sal_Bool bMustNotGrabFocus = sal_False;
+ BOOL bMustNotGrabFocus = FALSE;
// #100242#, check parent hierarchy if some floater prohibits grab focus
Window *pParent = this;
@@ -4024,7 +4012,7 @@ void Window::ImplGrabFocus( sal_uInt16 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 = sal_True;
+ bMustNotGrabFocus = TRUE;
break;
}
pParent = pParent->mpWindowImpl->mpParent;
@@ -4085,15 +4073,118 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
{
Window* pNewOverlapWindow = ImplGetFirstOverlapWindow();
Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
- pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
+ pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
pNewOverlapWindow->Activate();
if ( pNewRealWindow != pNewOverlapWindow )
{
- pNewRealWindow->mpWindowImpl->mbActive = sal_True;
+ pNewRealWindow->mpWindowImpl->mbActive = TRUE;
pNewRealWindow->Activate();
}
}
+/*
+ // call Deactivate and Activate
+ Window* pDeactivateParent;
+ Window* pActivateParent;
+ Window* pParent;
+ Window* pLastParent;
+ pDeactivateParent = pOldFocusWindow;
+ while ( pDeactivateParent )
+ {
+ pParent = pDeactivateParent;
+ if ( pParent->ImplIsChild( this ) )
+ break;
+
+ if ( pDeactivateParent->ImplIsOverlapWindow() )
+ {
+ if ( !pDeactivateParent->mpWindowImpl->mbParentActive )
+ break;
+ }
+
+ pDeactivateParent = pDeactivateParent->ImplGetParent();
+ }
+ if ( pOldFocusWindow )
+ {
+ pActivateParent = this;
+ while ( pActivateParent )
+ {
+ pParent = pActivateParent;
+ if ( pParent->ImplIsChild( pOldFocusWindow ) )
+ break;
+
+ if ( pActivateParent->ImplIsOverlapWindow() )
+ {
+ if ( !pActivateParent->mpWindowImpl->mbParentActive )
+ break;
+ }
+
+ pActivateParent = pActivateParent->ImplGetParent();
+ }
+ }
+ else
+ {
+ if ( ImplIsOverlapWindow() )
+ pActivateParent = this;
+ else
+ pActivateParent = mpWindowImpl->mpOverlapWindow;
+ while ( pActivateParent )
+ {
+ if ( pActivateParent->ImplIsOverlapWindow() )
+ {
+ if ( !pActivateParent->mpWindowImpl->mbParentActive )
+ break;
+ }
+
+ pActivateParent = pActivateParent->ImplGetParent();
+ }
+ }
+ if ( pDeactivateParent )
+ {
+ do
+ {
+ pLastParent = pOldFocusWindow;
+ if ( pLastParent != pDeactivateParent )
+ {
+ pParent = pLastParent->ImplGetParent();
+ while ( pParent )
+ {
+ if ( pParent == pDeactivateParent )
+ break;
+ pLastParent = pParent;
+ pParent = pParent->ImplGetParent();
+ }
+ }
+ else
+ pParent = pLastParent;
+
+ pParent->mpWindowImpl->mbActive = FALSE;
+ pParent->Deactivate();
+ pDeactivateParent = pLastParent;
+ }
+ while ( pDeactivateParent != pOldFocusWindow );
+ }
+ do
+ {
+ pLastParent = this;
+ if ( pLastParent != pActivateParent )
+ {
+ pParent = pLastParent->ImplGetParent();
+ while ( pParent )
+ {
+ if ( pParent == pActivateParent )
+ break;
+ pLastParent = pParent;
+ pParent = pParent->ImplGetParent();
+ }
+ }
+ else
+ pParent = pLastParent;
+ pParent->mpWindowImpl->mbActive = TRUE;
+ pParent->Activate();
+ pActivateParent = pLastParent;
+ }
+ while ( pActivateParent != this );
+*/
// call Get- and LoseFocus
if ( pOldFocusWindow && ! aOldFocusDel.IsDelete() )
{
@@ -4119,7 +4210,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
{
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplShow();
- mpWindowImpl->mbInFocusHdl = sal_True;
+ mpWindowImpl->mbInFocusHdl = 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
@@ -4136,7 +4227,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
if( !aDogTag.IsDelete() )
{
mpWindowImpl->mnGetFocusFlags = 0;
- mpWindowImpl->mbInFocusHdl = sal_False;
+ mpWindowImpl->mbInFocusHdl = FALSE;
}
}
}
@@ -4256,8 +4347,6 @@ namespace
Window::~Window()
{
- ImplFreeExtWindowImpl();
-
vcl::LazyDeletor<Window>::Undelete( this );
DBG_DTOR( Window, ImplDbgCheckWindow );
@@ -4269,7 +4358,7 @@ Window::~Window()
// Dispose of the canvas implementation (which, currently, has an
// own wrapper window as a child to this one.
- uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
if( xCanvas.is() )
{
uno::Reference < lang::XComponent > xCanvasComponent( xCanvas,
@@ -4278,7 +4367,7 @@ Window::~Window()
xCanvasComponent->dispose();
}
- mpWindowImpl->mbInDtor = sal_True;
+ mpWindowImpl->mbInDtor = TRUE;
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
@@ -4314,12 +4403,12 @@ Window::~Window()
// deregister drop target listener
if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
{
- uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->removeDragGestureListener(
- uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
@@ -4327,7 +4416,7 @@ Window::~Window()
}
// shutdown drag and drop for this frame window
- uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
+ 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
@@ -4341,7 +4430,7 @@ Window::~Window()
}
}
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
if ( pWrapper )
pWrapper->WindowDestroyed( this );
@@ -4377,16 +4466,16 @@ Window::~Window()
pSVData->maWinData.mpDefDialogParent = NULL;
#ifdef DBG_UTIL
- if ( sal_True ) // always perform these tests in non-pro versions
+ if ( TRUE ) // always perform these tests in non-pro versions
{
ByteString aErrorStr;
- sal_Bool bError = sal_False;
+ BOOL bError = FALSE;
Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = sal_True;
+ bError = TRUE;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
@@ -4397,17 +4486,17 @@ Window::~Window()
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
aTempStr += ") with living SystemWindow(s) destroyed: ";
aTempStr += aErrorStr;
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
- bError = sal_False;
+ bError = FALSE;
pTempWin = pSVData->maWinData.mpFirstFrame;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = sal_True;
+ bError = TRUE;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4418,7 +4507,7 @@ Window::~Window()
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
aTempStr += ") with living SystemWindow(s) destroyed: ";
aTempStr += aErrorStr;
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
@@ -4433,7 +4522,7 @@ Window::~Window()
lcl_appendWindowInfo( aTempStr, *pTempWin );
pTempWin = pTempWin->mpWindowImpl->mpNext;
}
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
@@ -4448,7 +4537,7 @@ Window::~Window()
lcl_appendWindowInfo( aTempStr, *pTempWin );
pTempWin = pTempWin->mpWindowImpl->mpNext;
}
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
@@ -4466,7 +4555,7 @@ Window::~Window()
ByteString aTempStr( "Window (" );
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
aTempStr += ") still in TaskPanelList!";
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
}
@@ -4492,7 +4581,7 @@ Window::~Window()
ByteString aTempStr( "Window (" );
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
aTempStr += ") not found in TaskPanelList!";
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
}
}
@@ -4514,16 +4603,16 @@ Window::~Window()
}
// check if the focus window is our child
- sal_Bool bHasFocussedChild = sal_False;
+ BOOL bHasFocussedChild = 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 = sal_True;
+ bHasFocussedChild = TRUE;
#ifdef DBG_UTIL
ByteString aTempStr( "Window (" );
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
aTempStr += ") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !";
- OSL_FAIL( aTempStr.GetBuffer() );
+ DBG_ERROR( aTempStr.GetBuffer() );
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
#endif
}
@@ -4604,18 +4693,18 @@ Window::~Window()
ImplDelData* pDelData = mpWindowImpl->mpFirstDel;
while ( pDelData )
{
- pDelData->mbDel = sal_True;
+ pDelData->mbDel = TRUE;
pDelData->mpWindow = NULL; // #112873# pDel is not associated with a Window anymore
pDelData = pDelData->mpNext;
}
// Fenster aus den Listen austragen
- ImplRemoveWindow( sal_True );
+ ImplRemoveWindow( TRUE );
// de-register as "top window child" at our parent, if necessary
if ( mpWindowImpl->mbFrame )
{
- sal_Bool bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
+ BOOL bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
if ( mpWindowImpl->mpRealParent && bIsTopWindow )
{
ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData();
@@ -4641,6 +4730,10 @@ 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;
}
@@ -4694,24 +4787,17 @@ void Window::doLazyDelete()
vcl::LazyDeletor<Window>::Delete( this );
}
-sal_uInt16 Window::GetIndicatorState() const
+USHORT Window::GetIndicatorState() const
{
return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
}
-void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const
+void Window::SimulateKeyPress( USHORT 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 )
{
@@ -4721,7 +4807,7 @@ void Window::MouseMove( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEMOVE, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseMove = sal_True;
+ mpWindowImpl->mbMouseMove = TRUE;
}
// -----------------------------------------------------------------------
@@ -4734,7 +4820,7 @@ void Window::MouseButtonDown( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONDOWN, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonDown = sal_True;
+ mpWindowImpl->mbMouseButtonDown = TRUE;
}
// -----------------------------------------------------------------------
@@ -4747,7 +4833,7 @@ void Window::MouseButtonUp( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONUP, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonUp = sal_True;
+ mpWindowImpl->mbMouseButtonUp = TRUE;
}
// -----------------------------------------------------------------------
@@ -4760,7 +4846,7 @@ void Window::KeyInput( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYINPUT, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyInput = sal_True;
+ mpWindowImpl->mbKeyInput = TRUE;
}
// -----------------------------------------------------------------------
@@ -4773,7 +4859,7 @@ void Window::KeyUp( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYUP, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyUp = sal_True;
+ mpWindowImpl->mbKeyUp = TRUE;
}
// -----------------------------------------------------------------------
@@ -4795,13 +4881,7 @@ void Window::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void Window::PostPaint()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void Window::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
+void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -4905,18 +4985,29 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
- if ( aStrHelpId.Len() == 0 && ImplGetParent() )
+ 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() )
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( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
+ pHelp->Start( nNumHelpId, this );
}
}
}
@@ -4934,7 +5025,7 @@ void Window::Command( const CommandEvent& rCEvt )
NotifyEvent aNEvt( EVENT_COMMAND, this, &rCEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbCommand = sal_True;
+ mpWindowImpl->mbCommand = TRUE;
}
// -----------------------------------------------------------------------
@@ -4950,7 +5041,7 @@ void Window::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-void Window::UserEvent( sal_uLong, void* )
+void Window::UserEvent( ULONG, void* )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -5078,7 +5169,7 @@ long Window::PreNotify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long bDone = sal_False;
+ long bDone = FALSE;
if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
bDone = mpWindowImpl->mpParent->PreNotify( rNEvt );
@@ -5086,11 +5177,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- sal_Bool bCompoundFocusChanged = sal_False;
+ BOOL bCompoundFocusChanged = FALSE;
if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = sal_True;
- bCompoundFocusChanged = sal_True;
+ mpWindowImpl->mbCompoundControlHasFocus = TRUE;
+ bCompoundFocusChanged = TRUE;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5098,11 +5189,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- sal_Bool bCompoundFocusChanged = sal_False;
+ BOOL bCompoundFocusChanged = FALSE;
if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = sal_False ;
- bCompoundFocusChanged = sal_True;
+ mpWindowImpl->mbCompoundControlHasFocus = FALSE ;
+ bCompoundFocusChanged = TRUE;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5112,6 +5203,48 @@ long Window::PreNotify( NotifyEvent& rNEvt )
// #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
// see also ImplHandleMouseEvent(), ImplHandleKey()
+ /*
+ else if( rNEvt.GetType() == EVENT_MOUSEMOVE )
+ {
+ if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
+ {
+ if ( rNEvt.GetWindow() == this )
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, (void*)rNEvt.GetMouseEvent() );
+ else
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
+ }
+ }
+ else if( rNEvt.GetType() == EVENT_MOUSEBUTTONUP )
+ {
+ if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
+ {
+ if ( rNEvt.GetWindow() == this )
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, (void*)rNEvt.GetMouseEvent() );
+ else
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
+ }
+ }
+ else if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ {
+ if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
+ {
+ if ( rNEvt.GetWindow() == this )
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, (void*)rNEvt.GetMouseEvent() );
+ else
+ ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
+ }
+ }
+ else if( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
+ ImplCallEventListeners( VCLEVENT_WINDOW_KEYINPUT, (void*)rNEvt.GetKeyEvent() );
+ }
+ else if( rNEvt.GetType() == EVENT_KEYUP )
+ {
+ if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
+ ImplCallEventListeners( VCLEVENT_WINDOW_KEYUP, (void*)rNEvt.GetKeyEvent() );
+ }
+ */
}
return bDone;
@@ -5125,7 +5258,7 @@ long Window::Notify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long nRet = sal_False;
+ long nRet = FALSE;
// check for docking window
// but do nothing if window is docked and locked
@@ -5135,27 +5268,27 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ 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 sal_True;
+ return TRUE;
}
else if ( pMEvt->GetClicks() == 1 && bHit)
{
// allow start docking during mouse move
pWrapper->ImplEnableStartDocking();
- return sal_True;
+ return TRUE;
}
}
}
else if ( rNEvt.GetType() == EVENT_MOUSEMOVE )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
if ( pMEvt->IsLeft() )
{
// check if a single click initiated this sequence ( ImplStartDockingEnabled() )
@@ -5172,7 +5305,7 @@ long Window::Notify( NotifyEvent& rNEvt )
}
pWrapper->ImplStartDocking( aPos );
}
- return sal_True;
+ return TRUE;
}
}
else if( rNEvt.GetType() == EVENT_KEYINPUT )
@@ -5190,7 +5323,7 @@ long Window::Notify( NotifyEvent& rNEvt )
*/
if( pWrapper->IsFloatingMode() )
ToTop( TOTOP_GRABFOCUSONLY );
- return sal_True;
+ return TRUE;
}
}
}
@@ -5213,7 +5346,7 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == EVENT_GETFOCUS) &&
!(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
{
- sal_uInt16 n = 0;
+ USHORT n = 0;
Window* pFirstChild = ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus();
@@ -5232,7 +5365,7 @@ long Window::Notify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void Window::ImplCallEventListeners( sal_uLong nEvent, void* pData )
+void Window::ImplCallEventListeners( ULONG nEvent, void* pData )
{
// The implementation was moved to CallEventListeners(),
// because derived classes in svtools must be able to
@@ -5245,7 +5378,7 @@ void Window::ImplCallEventListeners( sal_uLong nEvent, void* pData )
// -----------------------------------------------------------------------
-void Window::CallEventListeners( sal_uLong nEvent, void* pData )
+void Window::CallEventListeners( ULONG nEvent, void* pData )
{
VclWindowEvent aEvent( this, nEvent, pData );
@@ -5257,7 +5390,8 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
if ( aDelData.IsDelete() )
return;
- mpWindowImpl->maEventListeners.Call( &aEvent );
+ if ( !mpWindowImpl->maEventListeners.empty() )
+ mpWindowImpl->maEventListeners.Call( &aEvent );
if ( aDelData.IsDelete() )
return;
@@ -5269,7 +5403,8 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
{
pWindow->ImplAddDel( &aDelData );
- pWindow->mpWindowImpl->maChildEventListeners.Call( &aEvent );
+ if ( !pWindow->mpWindowImpl->maChildEventListeners.empty() )
+ pWindow->mpWindowImpl->maChildEventListeners.Call( &aEvent );
if ( aDelData.IsDelete() )
return;
@@ -5289,51 +5424,51 @@ void Window::FireVclEvent( VclSimpleEvent* pEvent )
void Window::AddEventListener( const Link& rEventListener )
{
- mpWindowImpl->maEventListeners.addListener( rEventListener );
+ mpWindowImpl->maEventListeners.push_back( rEventListener );
}
// -----------------------------------------------------------------------
void Window::RemoveEventListener( const Link& rEventListener )
{
- mpWindowImpl->maEventListeners.removeListener( rEventListener );
+ mpWindowImpl->maEventListeners.remove( rEventListener );
}
// -----------------------------------------------------------------------
void Window::AddChildEventListener( const Link& rEventListener )
{
- mpWindowImpl->maChildEventListeners.addListener( rEventListener );
+ mpWindowImpl->maChildEventListeners.push_back( rEventListener );
}
// -----------------------------------------------------------------------
void Window::RemoveChildEventListener( const Link& rEventListener )
{
- mpWindowImpl->maChildEventListeners.removeListener( rEventListener );
+ mpWindowImpl->maChildEventListeners.remove( rEventListener );
}
// -----------------------------------------------------------------------
-sal_uLong Window::PostUserEvent( sal_uLong nEvent, void* pEventData )
+ULONG Window::PostUserEvent( ULONG nEvent, void* pEventData )
{
- sal_uLong nEventId;
+ ULONG nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-sal_uLong Window::PostUserEvent( const Link& rLink, void* pCaller )
+ULONG Window::PostUserEvent( const Link& rLink, void* pCaller )
{
- sal_uLong nEventId;
+ ULONG nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-sal_Bool Window::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
+BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5342,23 +5477,23 @@ sal_Bool Window::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEv
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = sal_True;
+ pSVEvent->mbCall = TRUE;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (sal_uLong)pSVEvent;
+ rEventId = (ULONG)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return sal_True;
+ return TRUE;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return sal_False;
+ return FALSE;
}
}
// -----------------------------------------------------------------------
-sal_Bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
+BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5367,23 +5502,23 @@ sal_Bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pC
pSVEvent->mpData = pCaller;
pSVEvent->mpLink = new Link( rLink );
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = sal_True;
+ pSVEvent->mbCall = TRUE;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (sal_uLong)pSVEvent;
+ rEventId = (ULONG)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return sal_True;
+ return TRUE;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return sal_False;
+ return FALSE;
}
}
// -----------------------------------------------------------------------
-void Window::RemoveUserEvent( sal_uLong nUserEvent )
+void Window::RemoveUserEvent( ULONG nUserEvent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5400,14 +5535,14 @@ void Window::RemoveUserEvent( sal_uLong nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = sal_False;
+ pSVEvent->mbCall = FALSE;
}
// -----------------------------------------------------------------------
IMPL_LINK( Window, ImplAsyncStateChangedHdl, void*, pState )
{
- StateChanged( (StateChangedType)(sal_uLong)pState );
+ StateChanged( (StateChangedType)(ULONG)pState );
return 0;
}
@@ -5417,28 +5552,28 @@ void Window::PostStateChanged( StateChangedType nState )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(sal_uLong)nState );
+ PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(ULONG)nState );
}
// -----------------------------------------------------------------------
-sal_Bool Window::IsLocked( sal_Bool bChilds ) const
+BOOL Window::IsLocked( BOOL bChilds ) const
{
if ( mpWindowImpl->mnLockCount != 0 )
- return sal_True;
+ return TRUE;
if ( bChilds || mpWindowImpl->mbChildNotify )
{
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
- if ( pChild->IsLocked( sal_True ) )
- return sal_True;
+ if ( pChild->IsLocked( TRUE ) )
+ return TRUE;
pChild = pChild->mpWindowImpl->mpNext;
}
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -5496,7 +5631,7 @@ SystemWindow* Window::GetSystemWindow() const
// -----------------------------------------------------------------------
-void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
+void Window::SetBorderStyle( USHORT nBorderStyle )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5539,7 +5674,7 @@ void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
// -----------------------------------------------------------------------
-sal_uInt16 Window::GetBorderStyle() const
+USHORT Window::GetBorderStyle() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5587,7 +5722,7 @@ long Window::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void Window::EnableClipSiblings( sal_Bool bClipSiblings )
+void Window::EnableClipSiblings( BOOL bClipSiblings )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5599,7 +5734,7 @@ void Window::EnableClipSiblings( sal_Bool bClipSiblings )
// -----------------------------------------------------------------------
-void Window::SetMouseTransparent( sal_Bool bTransparent )
+void Window::SetMouseTransparent( BOOL bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5614,7 +5749,7 @@ void Window::SetMouseTransparent( sal_Bool bTransparent )
// -----------------------------------------------------------------------
-void Window::SetPaintTransparent( sal_Bool bTransparent )
+void Window::SetPaintTransparent( BOOL bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5641,7 +5776,7 @@ void Window::SetInputContext( const InputContext& rInputContext )
// -----------------------------------------------------------------------
-void Window::EndExtTextInput( sal_uInt16 nFlags )
+void Window::EndExtTextInput( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5699,24 +5834,24 @@ long Window::GetCursorExtTextInputWidth() const
// -----------------------------------------------------------------------
void Window::SetSettings( const AllSettings& rSettings )
{
- SetSettings( rSettings, sal_False );
+ SetSettings( rSettings, FALSE );
}
-void Window::SetSettings( const AllSettings& rSettings, sal_Bool bChild )
+void Window::SetSettings( const AllSettings& rSettings, BOOL bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->SetSettings( rSettings, sal_False );
+ mpWindowImpl->mpBorderWindow->SetSettings( rSettings, FALSE );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, sal_True );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, TRUE );
}
AllSettings aOldSettings = maSettings;
OutputDevice::SetSettings( rSettings );
- sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
+ ULONG nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
// AppFont-Aufloesung und DPI-Aufloesung neu berechnen
ImplInitResolutionSettings();
@@ -5740,20 +5875,20 @@ void Window::SetSettings( const AllSettings& rSettings, sal_Bool bChild )
// -----------------------------------------------------------------------
-void Window::UpdateSettings( const AllSettings& rSettings, sal_Bool bChild )
+void Window::UpdateSettings( const AllSettings& rSettings, BOOL bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, sal_False );
+ mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, FALSE );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, sal_True );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, TRUE );
}
AllSettings aOldSettings = maSettings;
- sal_uLong nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings );
+ 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 )
@@ -5843,7 +5978,18 @@ Font Window::GetPointFont() const
// -----------------------------------------------------------------------
-void Window::SetParentClipMode( sal_uInt16 nMode )
+// TODO: remove in next incompatible build
+void Window::GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const
+{
+ DBG_CHKTHIS( Window, ImplDbgCheckWindow );
+
+ nDPIX = mpWindowImpl->mpFrameData->mnDPIX;
+ nDPIY = mpWindowImpl->mpFrameData->mnDPIY;
+}
+
+// -----------------------------------------------------------------------
+
+void Window::SetParentClipMode( USHORT nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5855,14 +6001,14 @@ void Window::SetParentClipMode( sal_uInt16 nMode )
{
mpWindowImpl->mnParentClipMode = nMode;
if ( nMode & PARENTCLIPMODE_CLIP )
- mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = sal_True;
+ mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = TRUE;
}
}
}
// -----------------------------------------------------------------------
-sal_uInt16 Window::GetParentClipMode() const
+USHORT Window::GetParentClipMode() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5883,7 +6029,7 @@ void Window::SetWindowRegionPixel()
else if( mpWindowImpl->mbFrame )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL);
- mpWindowImpl->mbWinRegion = sal_False;
+ mpWindowImpl->mbWinRegion = FALSE;
mpWindowImpl->mpFrame->ResetClipRegion();
}
else
@@ -5891,7 +6037,7 @@ void Window::SetWindowRegionPixel()
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = sal_False;
+ mpWindowImpl->mbWinRegion = FALSE;
ImplSetClipFlag();
if ( IsReallyVisible() )
@@ -5930,9 +6076,9 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
long nY;
long nWidth;
long nHeight;
- sal_uLong nRectCount;
+ ULONG nRectCount;
ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
+ BOOL bRegionRect;
nRectCount = mpWindowImpl->maWinRegion.GetRectCount();
mpWindowImpl->mpFrame->BeginSetClipRegion( nRectCount );
@@ -5952,20 +6098,24 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
}
else
{
+ BOOL bInvalidate = FALSE;
+
if ( rRegion.GetType() == REGION_NULL )
{
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = sal_False;
+ mpWindowImpl->mbWinRegion = FALSE;
ImplSetClipFlag();
+ bInvalidate = TRUE;
}
}
else
{
mpWindowImpl->maWinRegion = rRegion;
- mpWindowImpl->mbWinRegion = sal_True;
+ mpWindowImpl->mbWinRegion = TRUE;
ImplSetClipFlag();
+ bInvalidate = TRUE;
}
if ( IsReallyVisible() )
@@ -5996,7 +6146,7 @@ const Region& Window::GetWindowRegionPixel() const
// -----------------------------------------------------------------------
-sal_Bool Window::IsWindowRegionPixel() const
+BOOL Window::IsWindowRegionPixel() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6008,7 +6158,7 @@ sal_Bool Window::IsWindowRegionPixel() const
// -----------------------------------------------------------------------
-Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const
+Region Window::GetWindowClipRegionPixel( USHORT nFlags ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6079,7 +6229,7 @@ void Window::ExpandPaintClipRegion( const Region& rRegion )
if( ! aDevPixRegion.IsEmpty() )
{
mpWindowImpl->mpPaintRegion->Union( aDevPixRegion );
- mbInitClipRegion = sal_True;
+ mbInitClipRegion = TRUE;
}
}
}
@@ -6114,13 +6264,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;
- sal_Bool bChangeTaskPaneList = sal_False;
+ BOOL bChangeTaskPaneList = FALSE;
if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) )
{
pNewSysWin = ImplGetLastSystemWindow( pNewParent );
if( pNewSysWin && pNewSysWin != pSysWin )
{
- bChangeTaskPaneList = sal_True;
+ bChangeTaskPaneList = TRUE;
pSysWin->GetTaskPaneList()->RemoveWindow( this );
}
}
@@ -6149,7 +6299,7 @@ void Window::SetParent( Window* pNewParent )
if ( mpWindowImpl->mbFrame )
mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
- sal_Bool bVisible = IsVisible();
+ BOOL bVisible = IsVisible();
Show( false, SHOW_NOFOCUSCHANGE );
// Testen, ob sich das Overlap-Window aendert
@@ -6167,9 +6317,9 @@ void Window::SetParent( Window* pNewParent )
}
// Fenster in der Hirachie umsetzen
- sal_Bool bFocusOverlapWin = HasChildPathFocus( sal_True );
- sal_Bool bFocusWin = HasChildPathFocus();
- sal_Bool bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
+ BOOL bFocusOverlapWin = HasChildPathFocus( TRUE );
+ BOOL bFocusWin = HasChildPathFocus();
+ BOOL bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
if ( bNewFrame )
{
if ( mpWindowImpl->mpFrameData->mpFocusWin )
@@ -6191,7 +6341,7 @@ void Window::SetParent( Window* pNewParent )
ImplRemoveWindow( bNewFrame );
ImplInsertWindow( pNewParent );
if ( mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP )
- pNewParent->mpWindowImpl->mbClipChildren = sal_True;
+ pNewParent->mpWindowImpl->mbClipChildren = TRUE;
ImplUpdateWindowPtr();
if ( ImplUpdatePos() )
ImplUpdateSysObjPos();
@@ -6230,7 +6380,7 @@ void Window::SetParent( Window* pNewParent )
}
// Activate-Status beim naechsten Overlap-Window updaten
- if ( HasChildPathFocus( sal_True ) )
+ if ( HasChildPathFocus( TRUE ) )
ImplCallFocusChangeActivate( pNewOverlapWindow, pOldOverlapWindow );
}
@@ -6271,7 +6421,7 @@ void Window::SetParent( Window* pNewParent )
// -----------------------------------------------------------------------
-void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
+void Window::Show( BOOL bVisible, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6280,7 +6430,7 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
ImplDelData aDogTag( this );
- sal_Bool bRealVisibilityChanged = sal_False;
+ BOOL bRealVisibilityChanged = FALSE;
mpWindowImpl->mbVisible = (bVisible != 0);
if ( !bVisible )
@@ -6293,14 +6443,14 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
{
bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
if ( mpWindowImpl->mbNoParentUpdate )
- mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = sal_True;
+ mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = TRUE;
mpWindowImpl->mpBorderWindow->Show( false, nFlags );
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
}
else if ( mpWindowImpl->mbFrame )
{
- mpWindowImpl->mbSuppressAccessibilityEvents = sal_True;
- mpWindowImpl->mpFrame->Show( sal_False, sal_False );
+ mpWindowImpl->mbSuppressAccessibilityEvents = TRUE;
+ mpWindowImpl->mpFrame->Show( FALSE, FALSE );
}
StateChanged( STATE_CHANGE_VISIBLE );
@@ -6308,12 +6458,12 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
if ( mpWindowImpl->mbReallyVisible )
{
Region aInvRegion( REGION_EMPTY );
- sal_Bool bSaveBack = sal_False;
+ BOOL bSaveBack = FALSE;
if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame )
{
if ( ImplRestoreOverlapBackground( aInvRegion ) )
- bSaveBack = sal_True;
+ bSaveBack = TRUE;
}
if ( !bSaveBack )
@@ -6408,7 +6558,7 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) )
{
ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 );
- ImplFocusToTop( 0, sal_False );
+ ImplFocusToTop( 0, FALSE );
}
// Hintergrund sichern
@@ -6423,7 +6573,7 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
if ( !mpWindowImpl->mbFrame )
{
- sal_uInt16 nInvalidateFlags = INVALIDATE_CHILDREN;
+ USHORT nInvalidateFlags = INVALIDATE_CHILDREN;
if( ! IsPaintTransparent() )
nInvalidateFlags |= INVALIDATE_NOTRANSPARENT;
ImplInvalidate( NULL, nInvalidateFlags );
@@ -6450,11 +6600,11 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
}
//DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
- mpWindowImpl->mbSuppressAccessibilityEvents = sal_False;
+ mpWindowImpl->mbSuppressAccessibilityEvents = FALSE;
- mpWindowImpl->mbPaintFrame = sal_True;
- sal_Bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? sal_True : sal_False;
- mpWindowImpl->mpFrame->Show( sal_True, bNoActivate );
+ mpWindowImpl->mbPaintFrame = TRUE;
+ BOOL bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? TRUE : FALSE;
+ mpWindowImpl->mpFrame->Show( TRUE, bNoActivate );
if( aDogTag.IsDelete() )
return;
@@ -6575,10 +6725,10 @@ void Window::Enable( bool bEnable, bool bChild )
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->Enable( bEnable, sal_False );
+ mpWindowImpl->mpBorderWindow->Enable( bEnable, FALSE );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, sal_True );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, TRUE );
}
// #i56102# restore app focus win in case the
@@ -6620,7 +6770,7 @@ void Window::Enable( bool bEnable, bool bChild )
void Window::SetCallHandlersOnInputDisabled( bool bCall )
{
- mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? sal_True : sal_False;
+ mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? TRUE : FALSE;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
@@ -6639,17 +6789,17 @@ bool Window::IsCallHandlersOnInputDisabled() const
// -----------------------------------------------------------------------
-void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild )
+void Window::EnableInput( BOOL bEnable, BOOL bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_Bool bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
+ BOOL bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->EnableInput( bEnable, sal_False );
+ mpWindowImpl->mpBorderWindow->EnableInput( bEnable, FALSE );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, sal_True );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, TRUE );
}
if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) ||
@@ -6707,7 +6857,7 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild )
// -----------------------------------------------------------------------
-void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
+void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
const Window* pExcludeWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6723,11 +6873,11 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
while ( pSysWin )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, sal_True ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, TRUE ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, sal_True ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, TRUE ) )
pSysWin->EnableInput( bEnable, bChild );
}
pSysWin = pSysWin->mpWindowImpl->mpNextOverlap;
@@ -6740,11 +6890,11 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
if( pFrameWin->ImplIsFloatingWindow() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, sal_True ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, TRUE ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, sal_True ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, TRUE ) )
pFrameWin->EnableInput( bEnable, bChild );
}
}
@@ -6759,11 +6909,11 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
while( p != rList.end() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), sal_True ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), TRUE ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), sal_True ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), TRUE ) )
(*p)->EnableInput( bEnable, bChild );
}
p++;
@@ -6774,19 +6924,19 @@ void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
// -----------------------------------------------------------------------
-void Window::AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild )
+void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, sal_False );
+ mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, FALSE );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled;
if ( bAlways )
- EnableInput( sal_True, sal_False );
+ EnableInput( TRUE, FALSE );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled )
{
@@ -6806,19 +6956,19 @@ void Window::AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild )
// -----------------------------------------------------------------------
-void Window::AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild )
+void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, sal_False );
+ mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, FALSE );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled;
if ( bAlways )
- EnableInput( sal_False, sal_False );
+ EnableInput( FALSE, FALSE );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled )
{
@@ -6838,7 +6988,7 @@ void Window::AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild )
// -----------------------------------------------------------------------
-void Window::SetActivateMode( sal_uInt16 nMode )
+void Window::SetActivateMode( USHORT nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6853,9 +7003,9 @@ void Window::SetActivateMode( sal_uInt16 nMode )
if ( mpWindowImpl->mnActivateMode )
{
if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) &&
- !HasChildPathFocus( sal_True ) )
+ !HasChildPathFocus( TRUE ) )
{
- mpWindowImpl->mbActive = sal_False;
+ mpWindowImpl->mbActive = FALSE;
Deactivate();
}
}
@@ -6863,7 +7013,7 @@ void Window::SetActivateMode( sal_uInt16 nMode )
{
if ( !mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW) )
{
- mpWindowImpl->mbActive = sal_True;
+ mpWindowImpl->mbActive = TRUE;
Activate();
}
}
@@ -6872,7 +7022,7 @@ void Window::SetActivateMode( sal_uInt16 nMode )
// -----------------------------------------------------------------------
-void Window::ToTop( sal_uInt16 nFlags )
+void Window::ToTop( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6882,7 +7032,7 @@ void Window::ToTop( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags )
+void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7000,7 +7150,7 @@ void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags )
if ( mpWindowImpl->mbInitWinClipRegion || !mpWindowImpl->maWinClipRegion.IsEmpty() )
{
- sal_Bool bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
+ BOOL bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
ImplSetClipFlag();
// Wenn ClipRegion noch nicht initalisiert wurde, dann
@@ -7059,7 +7209,7 @@ void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::EnableAlwaysOnTop( sal_Bool bEnable )
+void Window::EnableAlwaysOnTop( BOOL bEnable )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7077,16 +7227,16 @@ void Window::EnableAlwaysOnTop( sal_Bool bEnable )
// -----------------------------------------------------------------------
void Window::SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, sal_uInt16 nFlags )
+ long nWidth, long nHeight, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_Bool bHasValidSize = !mpWindowImpl->mbDefSize;
+ BOOL bHasValidSize = !mpWindowImpl->mbDefSize;
if ( nFlags & WINDOW_POSSIZE_POS )
- mpWindowImpl->mbDefPos = sal_False;
+ mpWindowImpl->mbDefPos = FALSE;
if ( nFlags & WINDOW_POSSIZE_SIZE )
- mpWindowImpl->mbDefSize = sal_False;
+ mpWindowImpl->mbDefSize = FALSE;
// Oberstes BorderWindow ist das Window, welches positioniert werden soll
Window* pWindow = this;
@@ -7106,7 +7256,7 @@ void Window::SetPosSizePixel( long nX, long nY,
nHeight = pWindow->mnOutHeight;
- sal_uInt16 nSysFlags=0;
+ USHORT nSysFlags=0;
if( nFlags & WINDOW_POSSIZE_WIDTH )
nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
if( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -7320,18 +7470,18 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR
Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) const
{
// with decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, sal_False );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE );
}
Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) const
{
// without decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, sal_True );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE );
}
// -----------------------------------------------------------------------
-Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const
+Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const
{
SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
// make sure we use the extent of our border window,
@@ -7361,7 +7511,7 @@ Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Boo
// -----------------------------------------------------------------------
-void Window::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
+void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7373,7 +7523,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
void Window::Scroll( long nHorzScroll, long nVertScroll,
- const Rectangle& rRect, sal_uInt16 nFlags )
+ const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7385,7 +7535,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll,
// -----------------------------------------------------------------------
-void Window::Invalidate( sal_uInt16 nFlags )
+void Window::Invalidate( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7397,7 +7547,7 @@ void Window::Invalidate( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::Invalidate( const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7414,7 +7564,7 @@ void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Region& rRegion, sal_uInt16 nFlags )
+void Window::Invalidate( const Region& rRegion, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7433,7 +7583,7 @@ void Window::Invalidate( const Region& rRegion, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( sal_uInt16 nFlags )
+void Window::Validate( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7445,7 +7595,7 @@ void Window::Validate( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::Validate( const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7462,7 +7612,7 @@ void Window::Validate( const Rectangle& rRect, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Region& rRegion, sal_uInt16 nFlags )
+void Window::Validate( const Region& rRegion, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7481,18 +7631,18 @@ void Window::Validate( const Region& rRegion, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-sal_Bool Window::HasPaintEvent() const
+BOOL Window::HasPaintEvent() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !mpWindowImpl->mbReallyVisible )
- return sal_False;
+ return FALSE;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
- return sal_True;
+ return TRUE;
if ( mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINT )
- return sal_True;
+ return TRUE;
if ( !ImplIsOverlapWindow() )
{
@@ -7501,12 +7651,12 @@ sal_Bool Window::HasPaintEvent() const
{
pTempWindow = pTempWindow->ImplGetParent();
if ( pTempWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINTCHILDS | IMPL_PAINT_PAINTALLCHILDS) )
- return sal_True;
+ return TRUE;
}
while ( !pTempWindow->ImplIsOverlapWindow() );
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -7524,14 +7674,14 @@ void Window::Update()
if ( !mpWindowImpl->mbReallyVisible )
return;
- sal_Bool bFlush = sal_False;
+ BOOL bFlush = 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 = sal_True;
+ bFlush = TRUE;
}
// Zuerst muessen wir alle Fenster ueberspringen, die Paint-Transparent
@@ -7600,7 +7750,7 @@ void Window::Sync()
// -----------------------------------------------------------------------
-void Window::SetUpdateMode( sal_Bool bUpdate )
+void Window::SetUpdateMode( BOOL bUpdate )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7619,7 +7769,7 @@ void Window::GrabFocus()
// -----------------------------------------------------------------------
-sal_Bool Window::HasFocus() const
+BOOL Window::HasFocus() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7661,7 +7811,7 @@ void Window::SetFakeFocus( bool bFocus )
// -----------------------------------------------------------------------
-sal_Bool Window::HasChildPathFocus( sal_Bool bSystemWindow ) const
+BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7677,7 +7827,7 @@ sal_Bool Window::HasChildPathFocus( sal_Bool bSystemWindow ) const
Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin;
if ( pFocusWin )
return ImplIsWindowOrChild( pFocusWin, bSystemWindow );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -7698,7 +7848,7 @@ void Window::CaptureMouse()
if ( pSVData->maWinData.mpCaptureWin != this )
{
pSVData->maWinData.mpCaptureWin = this;
- mpWindowImpl->mpFrame->CaptureMouse( sal_True );
+ mpWindowImpl->mpFrame->CaptureMouse( TRUE );
}
}
@@ -7716,14 +7866,14 @@ void Window::ReleaseMouse()
if ( pSVData->maWinData.mpCaptureWin == this )
{
pSVData->maWinData.mpCaptureWin = NULL;
- mpWindowImpl->mpFrame->CaptureMouse( sal_False );
+ mpWindowImpl->mpFrame->CaptureMouse( FALSE );
ImplGenerateMouseMove();
}
}
// -----------------------------------------------------------------------
-sal_Bool Window::IsMouseCaptured() const
+BOOL Window::IsMouseCaptured() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7748,7 +7898,7 @@ void Window::SetPointer( const Pointer& rPointer )
// -----------------------------------------------------------------------
-void Window::EnableChildPointerOverwrite( sal_Bool bOverwrite )
+void Window::EnableChildPointerOverwrite( BOOL bOverwrite )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7818,7 +7968,7 @@ Point Window::GetLastPointerPosPixel()
// -----------------------------------------------------------------------
-void Window::ShowPointer( sal_Bool bVisible )
+void Window::ShowPointer( BOOL bVisible )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7857,7 +8007,7 @@ Window::PointerState Window::GetPointerState()
// -----------------------------------------------------------------------
-sal_Bool Window::IsMouseOver()
+BOOL Window::IsMouseOver()
{
return ImplGetWinData()->mbMouseOver;
}
@@ -7935,7 +8085,7 @@ void Window::SetText( const XubString& rStr )
// name change.
if ( IsReallyVisible() )
{
- Window* pWindow = GetAccessibleRelationLabelFor();
+ Window* pWindow = GetLabelFor();
if ( pWindow && pWindow != this )
pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
}
@@ -7995,22 +8145,32 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ SmartId aSmartId = GetSmartHelpId();
+
+ ULONG nNumHelpId = 0;
+ String aStrHelpId;
+ if( aSmartId.HasString() )
+ aStrHelpId = aSmartId.GetStr();
+ if( aSmartId.HasNumeric() )
+ nNumHelpId = aSmartId.GetNum();
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
+ if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- mpWindowImpl->mbHelpTextDynamic = sal_False;
+ if( bStrHelpId )
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
+ else
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
+ mpWindowImpl->mbHelpTextDynamic = FALSE;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
+ else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8018,10 +8178,13 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- aTxt.append( rtl::OUString( aStrHelpId ) );
+ if( bStrHelpId )
+ aTxt.append( rtl::OUString( aStrHelpId ) );
+ else
+ aTxt.append( sal_Int32( nNumHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
- mpWindowImpl->mbHelpTextDynamic = sal_False;
+ mpWindowImpl->mbHelpTextDynamic = FALSE;
}
return mpWindowImpl->maHelpText;
@@ -8039,11 +8202,11 @@ Window* Window::FindWindow( const Point& rPos ) const
// -----------------------------------------------------------------------
-sal_uInt16 Window::GetChildCount() const
+USHORT Window::GetChildCount() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_uInt16 nChildCount = 0;
+ USHORT nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8056,11 +8219,11 @@ sal_uInt16 Window::GetChildCount() const
// -----------------------------------------------------------------------
-Window* Window::GetChild( sal_uInt16 nChild ) const
+Window* Window::GetChild( USHORT nChild ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_uInt16 nChildCount = 0;
+ USHORT nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8075,7 +8238,7 @@ Window* Window::GetChild( sal_uInt16 nChild ) const
// -----------------------------------------------------------------------
-Window* Window::GetWindow( sal_uInt16 nType ) const
+Window* Window::GetWindow( USHORT nType ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8167,7 +8330,7 @@ Window* Window::GetWindow( sal_uInt16 nType ) const
// -----------------------------------------------------------------------
-sal_Bool Window::IsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
+BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
@@ -8180,22 +8343,22 @@ sal_Bool Window::IsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return sal_True;
+ return TRUE;
}
while ( pWindow );
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool Window::IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
+BOOL Window::IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
if ( this == pWindow )
- return sal_True;
+ return TRUE;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -8234,7 +8397,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( BOOL bCreate )
{
if ( !mpWindowImpl->mxWindowPeer.is() && bCreate )
{
@@ -8331,7 +8494,7 @@ void Window::ImplStartDnd()
// -----------------------------------------------------------------------
-uno::Reference< XDropTarget > Window::GetDropTarget()
+Reference< XDropTarget > Window::GetDropTarget()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8344,7 +8507,7 @@ uno::Reference< XDropTarget > Window::GetDropTarget()
if( ! mpWindowImpl->mpFrameData->mxDropTarget.is() )
{
// initialization is done in GetDragSource
- uno::Reference< XDragSource > xDragSource = GetDragSource();
+ Reference< XDragSource > xDragSource = GetDragSource();
}
if( mpWindowImpl->mpFrameData->mxDropTarget.is() )
@@ -8360,16 +8523,16 @@ uno::Reference< XDropTarget > Window::GetDropTarget()
mpWindowImpl->mpFrameData->mxDropTarget->addDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
// register also as drag gesture listener if directly supported by drag source
- uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->addDragGestureListener(
- uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
else
- mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = TRUE;
}
@@ -8388,12 +8551,12 @@ uno::Reference< XDropTarget > Window::GetDropTarget()
}
// this object is located in the same process, so there will be no runtime exception
- return uno::Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
+ return Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
}
// -----------------------------------------------------------------------
-uno::Reference< XDragSource > Window::GetDragSource()
+Reference< XDragSource > Window::GetDragSource()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8403,7 +8566,7 @@ uno::Reference< XDragSource > Window::GetDragSource()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
if ( xFactory.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
@@ -8413,22 +8576,22 @@ uno::Reference< XDragSource > Window::GetDragSource()
Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 );
OUString aDragSourceSN, aDropTargetSN;
#if defined WNT
- aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource"));
- aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
+ aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDragSource" );
+ aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDropTarget" );
aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
#elif defined QUARTZ
/* FIXME: Mac OS X specific dnd interface does not exist! *
* Using Windows based dnd as a temporary solution */
- aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource"));
- aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
+ aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDragSource" );
+ aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDropTarget" );
aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
#elif defined UNX
aDropTargetAL.realloc( 3 );
aDragSourceAL.realloc( 3 );
- aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DragSource"));
- aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DropTarget"));
+ aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DragSource" );
+ aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DropTarget" );
aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
@@ -8437,10 +8600,10 @@ uno::Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
- mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
if( aDropTargetSN.getLength() )
- mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDropTarget = Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
}
@@ -8457,12 +8620,12 @@ uno::Reference< XDragSource > Window::GetDragSource()
return mpWindowImpl->mpFrameData->mxDragSource;
}
- return uno::Reference< XDragSource > ();
+ return Reference< XDragSource > ();
}
// -----------------------------------------------------------------------
-void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource, uno::Reference< XDropTarget > &xDropTarget )
+void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Reference< XDropTarget > &xDropTarget )
// only for RVP transmission
{
if( mpWindowImpl->mpFrameData )
@@ -8480,14 +8643,14 @@ void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource,
// -----------------------------------------------------------------------
-uno::Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
+Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
{
- return uno::Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
+ return Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
}
// -----------------------------------------------------------------------
-uno::Reference< XClipboard > Window::GetClipboard()
+Reference< XClipboard > Window::GetClipboard()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8497,25 +8660,25 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
if( mpWindowImpl->mpFrameData->mxClipboard.is() )
{
- uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+ Reference< XInitialization > xInit = Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
if( xInit.is() )
{
Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
+ aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "CLIPBOARD" ) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
xInit->initialize( aArgumentList );
@@ -8541,7 +8704,7 @@ uno::Reference< XClipboard > Window::GetClipboard()
// -----------------------------------------------------------------------
-uno::Reference< XClipboard > Window::GetPrimarySelection()
+Reference< XClipboard > Window::GetPrimarySelection()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8551,26 +8714,26 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
#if defined(UNX) && !defined(QUARTZ)
Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("PRIMARY")) );
+ aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "PRIMARY" ) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")), aArgumentList ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ), aArgumentList ), UNO_QUERY );
# else
- static uno::Reference< XClipboard > s_xSelection;
+ static Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
+ s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
+ s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
@@ -8595,7 +8758,7 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
// Accessibility
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( sal_Bool bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( 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 +8778,7 @@ uno::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( sal_True ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( TRUE ), ::com::sun::star::uno::UNO_QUERY );
return xAcc;
}
@@ -8625,46 +8788,46 @@ void Window::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::
}
// skip all border windows that are no top level frames
-sal_Bool Window::ImplIsAccessibleCandidate() const
+BOOL Window::ImplIsAccessibleCandidate() const
{
if( !mpWindowImpl->mbBorderWin )
- return sal_True;
+ return 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 sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
}
-sal_Bool Window::ImplIsAccessibleNativeFrame() const
+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 sal_True;
+ return TRUE;
else
- return sal_False;
+ return FALSE;
else
- return sal_False;
+ return FALSE;
}
-sal_uInt16 Window::ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const
+USHORT Window::ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const
{
- sal_uInt16 nChildren = 0;
+ USHORT nChildren = 0;
Window* pChild = GetWindow( nFirstWindowType );
while ( pChild )
{
if( pChild->ImplIsAccessibleCandidate() )
nChildren++;
else
- nChildren = sal::static_int_cast<sal_uInt16>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
+ nChildren = sal::static_int_cast<USHORT>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
pChild = pChild->mpWindowImpl->mpNext;
}
return nChildren;
}
-Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel ) const
+Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8677,7 +8840,7 @@ Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16&
Window *pTmpChild = pChild;
if( !pChild->ImplIsAccessibleCandidate() )
- pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, sal_False );
+ pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, FALSE );
if ( nChild == rChildCount )
return pTmpChild;
@@ -8730,9 +8893,9 @@ Window* Window::GetAccessibleParentWindow() const
}
/*
-sal_uInt16 Window::GetAccessibleChildWindowCount()
+USHORT Window::GetAccessibleChildWindowCount()
{
- sal_uInt16 nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
+ USHORT nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
// Search also for SystemWindows.
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
@@ -8742,9 +8905,9 @@ sal_uInt16 Window::GetAccessibleChildWindowCount()
}
*/
-sal_uInt16 Window::GetAccessibleChildWindowCount()
+USHORT Window::GetAccessibleChildWindowCount()
{
- sal_uInt16 nChildren = 0;
+ USHORT nChildren = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8790,21 +8953,21 @@ sal_uInt16 Window::GetAccessibleChildWindowCount()
}
/*
-Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
+Window* Window::GetAccessibleChildWindow( USHORT n )
{
- sal_uInt16 nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
- Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, sal_True );
+ USHORT nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
+ Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, TRUE );
if ( !pChild && ( n >= nChildCount ) )
{
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, sal_False );
+ pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, FALSE );
}
return pChild;
}
*/
-Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
+Window* Window::GetAccessibleChildWindow( USHORT n )
{
// report the menubarwindow as a the first child of THE workwindow
if( GetType() == WINDOW_WORKWINDOW && ((WorkWindow *) this)->GetMenuBar() )
@@ -8820,7 +8983,7 @@ Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
}
// transform n to child number including invisible children
- sal_uInt16 nChildren = n;
+ USHORT nChildren = n;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8868,7 +9031,7 @@ Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
}
-void Window::SetAccessibleRole( sal_uInt16 nRole )
+void Window::SetAccessibleRole( USHORT nRole )
{
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
@@ -8877,11 +9040,11 @@ void Window::SetAccessibleRole( sal_uInt16 nRole )
mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
}
-sal_uInt16 Window::GetAccessibleRole() const
+USHORT Window::GetAccessibleRole() const
{
using namespace ::com::sun::star;
- sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
+ USHORT nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
if ( nRole == 0xFFFF )
{
switch ( GetType() )
@@ -8983,7 +9146,6 @@ sal_uInt16 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:
@@ -9010,7 +9172,7 @@ void Window::SetAccessibleName( const String& rName )
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" );
+ DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName, "AccessibleName already set!" );
delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName );
}
@@ -9051,9 +9213,9 @@ String Window::GetAccessibleName() const
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
- case WINDOW_METRICBOX:
+
{
- Window *pLabel = GetAccessibleRelationLabeledBy();
+ Window *pLabel = GetLabeledBy();
if ( pLabel && pLabel != this )
aAccessibleName = pLabel->GetText();
}
@@ -9112,28 +9274,7 @@ String Window::GetAccessibleDescription() const
return aAccessibleDescription;
}
-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 )
+BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
{
if( !bTraverseParentPath )
return mpWindowImpl->mbSuppressAccessibilityEvents;
@@ -9143,19 +9284,14 @@ sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath )
while ( pParent && pParent->mpWindowImpl)
{
if( pParent->mpWindowImpl->mbSuppressAccessibilityEvents )
- return sal_True;
+ return TRUE;
else
pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames
}
- return sal_False;
+ return FALSE;
}
}
-void Window::SetAccessibilityEventsSuppressed(sal_Bool bSuppressed)
-{
- mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed;
-}
-
void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
{
if( ! mpOutDevData )
@@ -9172,9 +9308,9 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle&
// returns background color used in this control
// false: could not determine color
-sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol )
+BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
{
- sal_Bool bRet = sal_True;
+ BOOL bRet = TRUE;
switch ( GetType() )
{
@@ -9192,7 +9328,7 @@ sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol )
if( !aWall.IsGradient() && !aWall.IsBitmap() )
rCol = aWall.GetColor();
else
- bRet = sal_False;
+ bRet = FALSE;
}
else
rCol = GetSettings().GetStyleSettings().GetFaceColor();
@@ -9201,21 +9337,21 @@ sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol )
return bRet;
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly )
+void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL );
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor )
+void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL );
}
void Window::DrawSelectionBackground( const Rectangle& rRect,
- sal_uInt16 highlight,
- sal_Bool bChecked,
- sal_Bool bDrawBorder,
- sal_Bool bDrawExtBorderOnly,
+ USHORT highlight,
+ BOOL bChecked,
+ BOOL bDrawBorder,
+ BOOL bDrawExtBorderOnly,
long nCornerRadius,
Color* pSelectionTextColor,
Color* pPaintColor
@@ -9223,7 +9359,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
{
if( rRect.IsEmpty() )
return;
-
+
bool bRoundEdges = nCornerRadius > 0;
const StyleSettings& rStyles = GetSettings().GetStyleSettings();
@@ -9233,8 +9369,8 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
- sal_Bool bDark = rStyles.GetFaceColor().IsDark();
- sal_Bool bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
+ BOOL bDark = rStyles.GetFaceColor().IsDark();
+ BOOL bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
int c1 = aSelectionBorderCol.GetLuminance();
int c2 = GetDisplayBackground().GetColor().GetLuminance();
@@ -9242,7 +9378,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) )
{
// constrast too low
- sal_uInt16 h,s,b;
+ USHORT h,s,b;
aSelectionFillCol.RGBtoHSB( h, s, b );
if( b > 50 ) b -= 40;
else b += 40;
@@ -9274,13 +9410,13 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
else
SetLineColor();
- sal_uInt16 nPercent = 0;
+ USHORT nPercent = 0;
if( !highlight )
{
if( bDark )
aSelectionFillCol = COL_BLACK;
else
- nPercent = 80; // just checked (light)
+ nPercent = bRoundEdges ? 90 : 80; // just checked (light)
}
else
{
@@ -9295,7 +9431,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 40 : 20; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark )
}
else if( bChecked || highlight == 1 )
{
@@ -9308,7 +9444,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 60 : 35; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark )
}
else
{
@@ -9324,7 +9460,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = 70; // selected ( dark )
+ nPercent = bRoundEdges ? 80 : 70; // selected ( dark )
}
}
@@ -9394,7 +9530,7 @@ Window* Window::GetPreferredKeyInputWindow()
}
-sal_Bool Window::IsScrollable() const
+BOOL Window::IsScrollable() const
{
// check for scrollbars
Window *pChild = mpWindowImpl->mpFirstChild;
@@ -9408,24 +9544,24 @@ sal_Bool Window::IsScrollable() const
return false;
}
-sal_Bool Window::IsTopWindow() const
+BOOL Window::IsTopWindow() const
{
if ( mpWindowImpl->mbInDtor )
- return sal_False;
+ return 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 sal_False;
+ return FALSE;
ImplGetWinData();
- if( mpWindowImpl->mpWinData->mnIsTopWindow == (sal_uInt16)~0) // still uninitialized
+ if( mpWindowImpl->mpWinData->mnIsTopWindow == (USHORT)~0) // still uninitialized
{
// #113722#, cache result of expensive queryInterface call
Window *pThisWin = (Window*)this;
- uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
+ Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
}
- return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? sal_True : sal_False;
+ return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? TRUE : FALSE;
}
void Window::ImplMirrorFramePos( Point &pt ) const
@@ -9434,7 +9570,7 @@ void Window::ImplMirrorFramePos( Point &pt ) const
}
// frame based modal counter (dialogs are not modal to the whole application anymore)
-sal_Bool Window::IsInModalMode() const
+BOOL Window::IsInModalMode() const
{
return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
}
@@ -9466,16 +9602,16 @@ void Window::ImplDecModalCount()
pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow : NULL;
}
}
-sal_Bool Window::ImplIsInTaskPaneList()
+BOOL Window::ImplIsInTaskPaneList()
{
return mpWindowImpl->mbIsInTaskPaneList;
}
-void Window::ImplIsInTaskPaneList( sal_Bool mbIsInTaskList )
+void Window::ImplIsInTaskPaneList( BOOL mbIsInTaskList )
{
mpWindowImpl->mbIsInTaskPaneList = mbIsInTaskList;
}
-void Window::ImplNotifyIconifiedState( sal_Bool bIconified )
+void Window::ImplNotifyIconifiedState( BOOL bIconified )
{
mpWindowImpl->mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
// #109206# notify client window as well to have toolkit topwindow listeners notified
@@ -9483,15 +9619,15 @@ void Window::ImplNotifyIconifiedState( sal_Bool bIconified )
mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
}
-sal_Bool Window::HasActiveChildFrame()
+BOOL Window::HasActiveChildFrame()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
Window *pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame;
while( pFrameWin )
{
if( pFrameWin != mpWindowImpl->mpFrameWindow )
{
- sal_Bool bDecorated = sal_False;
+ BOOL bDecorated = 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
@@ -9503,9 +9639,9 @@ sal_Bool Window::HasActiveChildFrame()
if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
{
- if( ImplIsChild( pChildFrame, sal_True ) )
+ if( ImplIsChild( pChildFrame, TRUE ) )
{
- bRet = sal_True;
+ bRet = TRUE;
break;
}
}
@@ -9520,11 +9656,11 @@ LanguageType Window::GetInputLanguage() const
return mpWindowImpl->mpFrame->GetInputLanguage();
}
-void Window::EnableNativeWidget( sal_Bool bEnable )
+void Window::EnableNativeWidget( BOOL bEnable )
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
if( pNoNWF && *pNoNWF )
- bEnable = sal_False;
+ bEnable = FALSE;
if( bEnable != ImplGetWinData()->mbEnableNativeWidget )
{
@@ -9549,7 +9685,7 @@ void Window::EnableNativeWidget( sal_Bool bEnable )
}
}
-sal_Bool Window::IsNativeWidgetEnabled() const
+BOOL Window::IsNativeWidgetEnabled() const
{
return ImplGetWinData()->mbEnableNativeWidget;
}
@@ -9558,12 +9694,12 @@ sal_Bool Window::IsNativeWidgetEnabled() const
#include <salframe.h>
#endif
-uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
+Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
bool bFullscreen,
bool bSpriteCanvas ) const
{
// try to retrieve hard reference from weak member
- uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
// canvas still valid? Then we're done.
if( xCanvas.is() )
@@ -9602,24 +9738,21 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) );
aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? sal_True : sal_False );
- aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >(
+ aArg[ 4 ] = makeAny( Reference< awt::XWindow >(
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
// Create canvas instance with window handle
// =========================================
if ( xFactory.is() )
{
- 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());
-
+ static Reference<lang::XMultiServiceFactory> xCanvasFactory(
+ xFactory->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star."
+ "rendering.CanvasFactory") ) ), UNO_QUERY );
if(xCanvasFactory.is())
{
#ifdef WNT
@@ -9665,37 +9798,37 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
return xCanvas;
}
-uno::Reference< rendering::XCanvas > Window::GetCanvas() const
+Reference< rendering::XCanvas > Window::GetCanvas() const
{
return ImplGetCanvas( Size(), false, false );
}
-uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
+Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
{
- uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
-uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
+Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
{
- uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( rFullscreenSize, true, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rPos )
{
- sal_Bool bRVisible = mpWindowImpl->mbReallyVisible;
+ BOOL bRVisible = mpWindowImpl->mbReallyVisible;
mpWindowImpl->mbReallyVisible = mpWindowImpl->mbVisible;
- sal_Bool bDevOutput = mbDevOutput;
- mbDevOutput = sal_True;
+ BOOL bDevOutput = mbDevOutput;
+ mbDevOutput = TRUE;
long nOldDPIX = ImplGetDPIX();
long nOldDPIY = ImplGetDPIY();
mnDPIX = i_pTargetOutDev->ImplGetDPIX();
mnDPIY = i_pTargetOutDev->ImplGetDPIY();
- sal_Bool bOutput = IsOutputEnabled();
+ BOOL bOutput = IsOutputEnabled();
EnableOutput();
DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" );
@@ -9705,7 +9838,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
// preserve graphicsstate
Push();
Region aClipRegion( GetClipRegion() );
- SetClipRegion();
+ SetClipRegion();
GDIMetaFile* pOldMtf = GetConnectMetaFile();
GDIMetaFile aMtf;
@@ -9767,7 +9900,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
SetConnectMetaFile( pOldMtf );
EnableOutput( bOutput );
mpWindowImpl->mbReallyVisible = bRVisible;
-
+
// paint metafile to VDev
VirtualDevice* pMaskedDevice = new VirtualDevice( *i_pTargetOutDev, 0, 0 );
pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() );
@@ -9789,7 +9922,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
nDeltaX = mnOutWidth - nDeltaX - pChild->mnOutWidth;
long nDeltaY = pChild->GetOutOffYPixel() - GetOutOffYPixel();
Point aPos( i_rPos );
- Point aDelta( nDeltaX, nDeltaY );
+ Point aDelta( nDeltaX, nDeltaY );
aPos += aDelta;
pChild->ImplPaintToDevice( i_pTargetOutDev, aPos );
}
@@ -9808,9 +9941,12 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /*rSize*/ )
{
// FIXME: scaling: currently this is for pixel copying only
-
+
DBG_ASSERT( ! pDev->ImplHasMirroredGraphics(), "PaintToDevice to mirroring graphics" );
DBG_ASSERT( ! pDev->IsRTLEnabled(), "PaintToDevice to mirroring device" );
+
+
+ Point aPos = pDev->LogicToPixel( rPos );
Window* pRealParent = NULL;
if( ! mpWindowImpl->mbVisible )
@@ -9825,9 +9961,9 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
Hide();
}
- sal_Bool bVisible = mpWindowImpl->mbVisible;
- mpWindowImpl->mbVisible = sal_True;
-
+ BOOL bVisible = mpWindowImpl->mbVisible;
+ mpWindowImpl->mbVisible = TRUE;
+
if( mpWindowImpl->mpBorderWindow )
mpWindowImpl->mpBorderWindow->ImplPaintToDevice( pDev, rPos );
else
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e98d51d252c9..7ee1a5aa82c2 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -71,7 +71,7 @@ struct ImplFocusDelData : public ImplDelData
// =======================================================================
-sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
+BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pTestWindow, Window, ImplDbgCheckWindow );
@@ -81,11 +81,11 @@ sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
const Window* pTempWindow = pTestWindow;
const Window* pThisWindow = ImplGetFirstOverlapWindow();
if ( pTempWindow == pThisWindow )
- return sal_False;
+ return FALSE;
do
{
if ( pTempWindow == pThisWindow )
- return sal_True;
+ return TRUE;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -95,7 +95,7 @@ sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pTestWindow )
- return sal_False;
+ return FALSE;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -105,8 +105,8 @@ sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
// Fenster auf gleiche Ebene bringen
if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow )
{
- sal_uInt16 nThisLevel = 0;
- sal_uInt16 nTestLevel = 0;
+ USHORT nThisLevel = 0;
+ USHORT nTestLevel = 0;
pTempWindow = pThisWindow;
do
{
@@ -153,12 +153,12 @@ sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pThisWindow )
- return sal_True;
+ return TRUE;
pTempWindow = pTempWindow->mpWindowImpl->mpNext;
}
while ( pTempWindow );
- return sal_False;
+ return FALSE;
}
// =======================================================================
@@ -169,7 +169,7 @@ void Window::ImplSaveOverlapBackground()
if ( !mpWindowImpl->mbFrame )
{
- sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight;
+ ULONG nSaveBackSize = mnOutWidth*mnOutHeight;
if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE )
{
if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE )
@@ -204,7 +204,7 @@ void Window::ImplSaveOverlapBackground()
// -----------------------------------------------------------------------
-sal_Bool Window::ImplRestoreOverlapBackground( Region& rInvRegion )
+BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion )
{
if ( mpWindowImpl->mpOverlapData->mpSaveBackDev )
{
@@ -234,10 +234,10 @@ sal_Bool Window::ImplRestoreOverlapBackground( Region& rInvRegion )
ImplDeleteOverlapBackground();
}
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -306,7 +306,7 @@ void Window::ImplInvalidateAllOverlapBackgrounds()
// =======================================================================
-Bitmap Window::SnapShot( sal_Bool bBorder ) const
+Bitmap Window::SnapShot( BOOL bBorder ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -342,16 +342,24 @@ Bitmap Window::SnapShot( sal_Bool bBorder ) const
// -----------------------------------------------------------------------
+Bitmap Window::SnapShot() const
+{
+ // Should be merged in the next top level build !!!
+ return SnapShot( TRUE );
+}
+
+// -----------------------------------------------------------------------
+
void Window::ShowFocus( const Rectangle& rRect )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
-
+
if( mpWindowImpl->mbInShowFocus )
return;
- mpWindowImpl->mbInShowFocus = sal_True;
+ mpWindowImpl->mbInShowFocus = TRUE;
ImplWinData* pWinData = ImplGetWinData();
-
+
// native themeing suggest not to use focus rects
if( ! ( mpWindowImpl->mbUseNativeFocus &&
IsNativeWidgetEnabled() ) )
@@ -362,31 +370,31 @@ void Window::ShowFocus( const Rectangle& rRect )
{
if ( *(pWinData->mpFocusRect) == rRect )
{
- mpWindowImpl->mbInShowFocus = sal_False;
+ mpWindowImpl->mbInShowFocus = FALSE;
return;
}
-
+
ImplInvertFocus( *(pWinData->mpFocusRect) );
}
-
+
ImplInvertFocus( rRect );
}
if ( !pWinData->mpFocusRect )
pWinData->mpFocusRect = new Rectangle( rRect );
else
*(pWinData->mpFocusRect) = rRect;
- mpWindowImpl->mbFocusVisible = sal_True;
+ mpWindowImpl->mbFocusVisible = TRUE;
}
else
{
if( ! mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = sal_True;
+ mpWindowImpl->mbNativeFocusVisible = TRUE;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInShowFocus = sal_False;
+ mpWindowImpl->mbInShowFocus = FALSE;
}
// -----------------------------------------------------------------------
@@ -394,10 +402,10 @@ void Window::ShowFocus( const Rectangle& rRect )
void Window::HideFocus()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
-
+
if( mpWindowImpl->mbInHideFocus )
return;
- mpWindowImpl->mbInHideFocus = sal_True;
+ mpWindowImpl->mbInHideFocus = TRUE;
// native themeing can suggest not to use focus rects
if( ! ( mpWindowImpl->mbUseNativeFocus &&
@@ -405,29 +413,29 @@ void Window::HideFocus()
{
if ( !mpWindowImpl->mbFocusVisible )
{
- mpWindowImpl->mbInHideFocus = sal_False;
+ mpWindowImpl->mbInHideFocus = FALSE;
return;
}
if ( !mpWindowImpl->mbInPaint )
ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) );
- mpWindowImpl->mbFocusVisible = sal_False;
+ mpWindowImpl->mbFocusVisible = FALSE;
}
else
{
if( mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = sal_False;
+ mpWindowImpl->mbNativeFocusVisible = FALSE;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInHideFocus = sal_False;
+ mpWindowImpl->mbInHideFocus = FALSE;
}
// -----------------------------------------------------------------------
-void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::Invert( const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -463,14 +471,14 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
+void Window::Invert( const Polygon& rPoly, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !IsDeviceOutputNecessary() )
return;
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -501,7 +509,7 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::ShowTracking( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -526,7 +534,7 @@ void Window::ShowTracking( const Rectangle& rRect, sal_uInt16 nFlags )
else
*(pWinData->mpTrackRect) = rRect;
pWinData->mnTrackFlags = nFlags;
- mpWindowImpl->mbTrackVisible = sal_True;
+ mpWindowImpl->mbTrackVisible = TRUE;
}
// -----------------------------------------------------------------------
@@ -540,13 +548,13 @@ void Window::HideTracking()
ImplWinData* pWinData = ImplGetWinData();
if ( !mpWindowImpl->mbInPaint || !(pWinData->mnTrackFlags & SHOWTRACK_WINDOW) )
InvertTracking( *(pWinData->mpTrackRect), pWinData->mnTrackFlags );
- mpWindowImpl->mbTrackVisible = sal_False;
+ mpWindowImpl->mbTrackVisible = FALSE;
}
}
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
+void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -587,12 +595,12 @@ void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, sal_False, sal_False );
+ ImplClipBoundaries( aRegion, FALSE, FALSE );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
- sal_uInt16 nStyle = nFlags & SHOWTRACK_STYLE;
+ USHORT 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 +619,11 @@ void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
+void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_uInt16 nPoints = rPoly.GetSize();
+ USHORT nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -653,7 +661,7 @@ void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, sal_False, sal_False );
+ ImplClipBoundaries( aRegion, FALSE, FALSE );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
@@ -690,7 +698,7 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer )
// -----------------------------------------------------------------------
-void Window::StartTracking( sal_uInt16 nFlags )
+void Window::StartTracking( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -721,7 +729,7 @@ void Window::StartTracking( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void Window::EndTracking( sal_uInt16 nFlags )
+void Window::EndTracking( USHORT nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -764,7 +772,7 @@ void Window::EndTracking( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-sal_Bool Window::IsTracking() const
+BOOL Window::IsTracking() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -773,7 +781,7 @@ sal_Bool Window::IsTracking() const
// -----------------------------------------------------------------------
-void Window::StartAutoScroll( sal_uInt16 nFlags )
+void Window::StartAutoScroll( USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -810,7 +818,7 @@ void Window::EndAutoScroll()
// -----------------------------------------------------------------------
-sal_Bool Window::IsAutoScroll() const
+BOOL Window::IsAutoScroll() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -836,13 +844,13 @@ void Window::SaveBackground( const Point& rPos, const Size& rSize,
{
const Region aOldClip( rSaveDevice.GetClipRegion() );
const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) );
- const sal_Bool bMap = rSaveDevice.IsMapModeEnabled();
+ const 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( sal_False );
+ rSaveDevice.EnableMapMode( FALSE );
rSaveDevice.SetClipRegion( aClip );
rSaveDevice.EnableMapMode( bMap );
rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this );
@@ -871,13 +879,13 @@ sal_uIntPtr Window::SaveFocus()
// -----------------------------------------------------------------------
-sal_Bool Window::EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore )
+BOOL Window::EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore )
{
if ( !nSaveId )
- return sal_False;
+ return FALSE;
else
{
- sal_Bool bOK = sal_True;
+ BOOL bOK = TRUE;
ImplFocusDelData* pDelData = (ImplFocusDelData*)(void*)nSaveId;
if ( !pDelData->IsDelete() )
{
@@ -940,7 +948,7 @@ void Window::SetZoomedPointFont( const Font& rFont )
long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() );
if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) )
{
- sal_uInt16 nType;
+ USHORT nType;
if ( aMetric.GetPitch() == PITCH_FIXED )
nType = DEFAULTFONT_FIXED;
else
@@ -1033,7 +1041,7 @@ void Window::SetControlForeground()
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = sal_False;
+ mpWindowImpl->mbControlForeground = FALSE;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1049,7 +1057,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = sal_False;
+ mpWindowImpl->mbControlForeground = FALSE;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1058,7 +1066,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->maControlForeground != rColor )
{
mpWindowImpl->maControlForeground = rColor;
- mpWindowImpl->mbControlForeground = sal_True;
+ mpWindowImpl->mbControlForeground = TRUE;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1073,7 +1081,7 @@ void Window::SetControlBackground()
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = sal_False;
+ mpWindowImpl->mbControlBackground = FALSE;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1089,7 +1097,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = sal_False;
+ mpWindowImpl->mbControlBackground = FALSE;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1098,7 +1106,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->maControlBackground != rColor )
{
mpWindowImpl->maControlBackground = rColor;
- mpWindowImpl->mbControlBackground = sal_True;
+ mpWindowImpl->mbControlBackground = TRUE;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1162,12 +1170,12 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const
// -----------------------------------------------------------------------
-sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
+BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl, ScrollBar* pVScrl )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if ( pHScrl || pVScrl )
{
@@ -1175,7 +1183,7 @@ sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
{
case COMMAND_STARTAUTOSCROLL:
{
- sal_uInt16 nFlags = 0;
+ USHORT nFlags = 0;
if ( pHScrl )
{
if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
@@ -1192,7 +1200,7 @@ sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( nFlags )
{
StartAutoScroll( nFlags );
- bRet = sal_True;
+ bRet = TRUE;
}
}
break;
@@ -1203,7 +1211,7 @@ sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) )
{
- sal_uLong nScrollLines = pData->GetScrollLines();
+ ULONG nScrollLines = pData->GetScrollLines();
long nLines;
if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
@@ -1216,11 +1224,11 @@ sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
nLines = pData->GetNotchDelta() * (long)nScrollLines;
if ( nLines )
{
- ImplHandleScroll( NULL,
- 0L,
- pData->IsHorz() ? pHScrl : pVScrl,
+ ImplHandleScroll( NULL,
+ 0L,
+ pData->IsHorz() ? pHScrl : pVScrl,
nLines );
- bRet = sal_True;
+ bRet = TRUE;
}
}
}
@@ -1233,7 +1241,7 @@ sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
{
ImplHandleScroll( pHScrl, pData->GetDeltaX(),
pVScrl, pData->GetDeltaY() );
- bRet = sal_True;
+ bRet = TRUE;
}
}
break;
@@ -1298,12 +1306,116 @@ void Window::ImplHandleScroll( ScrollBar* pHScrl, long nX,
}
}
+// support for docking
+// this is currently handled in ImplDockingWindowWrapper
+/*
+void Window::ImplSetFloatingMode( BOOL bFloatMode )
+{
+ // if the window is docked, put it into a flaoting window
+ // if it is floating put it back in the old frame
+
+ ImplDockingWindowWrapper *pWrapper = pDockingMgr->GetDockingWindowWrapper( this );
+ if( !pDockingData )
+ return;
+
+ if ( pWrapper->IsFloatingMode() != bFloatMode )
+ {
+ if ( pWrapper->PrepareToggleFloatingMode() )
+ {
+ BOOL bVisible = IsVisible();
+
+ if ( bFloatMode )
+ {
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
+
+ pWrapper->maDockPos = GetPosPixel();
+
+ Window* pRealParent = mpWindowImpl->mpRealParent;
+ pWrapper->mpOldBorderWin = mpWindowImpl->mpBorderWindow;
+
+ ImplDockFloatWin* pWin =
+ new ImplDockFloatWin2(
+ mpWindowImpl->mpParent,
+ mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ? mnFloatBits | WB_SYSTEMWINDOW : mnFloatBits,
+ pWrapper );
+ pWrapper->mpFloatWin = pWin;
+ mpWindowImpl->mpBorderWindow = NULL;
+ mpWindowImpl->mnLeftBorder = 0;
+ mpWindowImpl->mnTopBorder = 0;
+ mpWindowImpl->mnRightBorder = 0;
+ mpWindowImpl->mnBottomBorder = 0;
+ // Falls Parent zerstoert wird, muessen wir auch vom
+ // BorderWindow den Parent umsetzen
+ if ( pWrapper->mpOldBorderWin )
+ pWrapper->mpOldBorderWin->SetParent( pWin );
+ SetParent( pWin );
+ pWin->SetPosPixel( Point() );
+ mpWindowImpl->mpBorderWindow = pWin;
+ pWin->mpWindowImpl->mpClientWindow = this;
+ mpWindowImpl->mpRealParent = pRealParent;
+ pWin->SetText( GetText() );
+ pWin->SetOutputSizePixel( GetSizePixel() );
+ pWin->SetPosPixel( pWrapper->maFloatPos );
+ // DockingDaten ans FloatingWindow weiterreichen
+ pWin->ShowTitleButton( TITLE_BUTTON_DOCKING, pWrapper->mbDockBtn );
+ pWin->ShowTitleButton( TITLE_BUTTON_HIDE, pWrapper->mbHideBtn );
+ pWin->SetPin( pWrapper->mbPined );
+ if ( pWrapper->mbRollUp )
+ pWin->RollUp();
+ else
+ pWin->RollDown();
+ pWin->SetRollUpOutputSizePixel( pWrapper->maRollUpOutSize );
+ pWin->SetMinOutputSizePixel( pWrapper->maMinOutSize );
+
+ pWrapper->ToggleFloatingMode();
+
+ if ( bVisible )
+ Show();
+ }
+ else
+ {
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
+
+ // FloatingDaten wird im FloatingWindow speichern
+ pWrapper->maFloatPos = mpFloatWin->GetPosPixel();
+ pWrapper->mbDockBtn = mpFloatWin->IsTitleButtonVisible( TITLE_BUTTON_DOCKING );
+ pWrapper->mbHideBtn = mpFloatWin->IsTitleButtonVisible( TITLE_BUTTON_HIDE );
+ pWrapper->mbPined = mpFloatWin->IsPined();
+ pWrapper->mbRollUp = mpFloatWin->IsRollUp();
+ pWrapper->maRollUpOutSize = mpFloatWin->GetRollUpOutputSizePixel();
+ pWrapper->maMinOutSize = mpFloatWin->GetMinOutputSizePixel();
+
+ Window* pRealParent = mpWindowImpl->mpRealParent;
+ mpWindowImpl->mpBorderWindow = NULL;
+ if ( pWrapper->mpOldBorderWin )
+ {
+ SetParent( pWrapper->mpOldBorderWin );
+ ((ImplBorderWindow*)pWrapper->mpOldBorderWin)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
+ pWrapper->mpOldBorderWin->Resize();
+ }
+ mpWindowImpl->mpBorderWindow = pWrapper->mpOldBorderWin;
+ SetParent( pRealParent );
+ mpWindowImpl->mpRealParent = pRealParent;
+ delete static_cast<ImplDockFloatWin*>(mpFloatWin);
+ pWrapper->mpFloatWin = NULL;
+ SetPosPixel( maDockPos );
+
+ pWrapper->ToggleFloatingMode();
+
+ if ( bVisible )
+ Show();
+ }
+ }
+ }
+}
+*/
+
DockingManager* Window::GetDockingManager()
{
return ImplGetDockingManager();
}
-void Window::EnableDocking( sal_Bool bEnable )
+void Window::EnableDocking( BOOL bEnable )
{
// update list of dockable windows
if( bEnable )
@@ -1327,31 +1439,115 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-void Window::SetHelpId( const rtl::OString& rHelpId )
+// 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 )
+{
+ SetSmartHelpId(SmartId(nHelpId));
+}
+
+ULONG Window::GetHelpId() const
+{
+ return mpWindowImpl->mnHelpId;
+}
+
+void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
{
- mpWindowImpl->maHelpId = rHelpId;
+ // 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();
+ }
}
-const rtl::OString& Window::GetHelpId() const
+SmartId Window::GetSmartHelpId() const
{
- return mpWindowImpl->maHelpId;
+ 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();
+ }
}
-void Window::SetUniqueId( const rtl::OString& rUniqueId )
+
+// 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 )
{
- mpWindowImpl->maUniqId = rUniqueId;
+ // 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();
}
-const rtl::OString& Window::GetUniqueId() const
+SmartId Window::GetSmartUniqueId() const
{
- return mpWindowImpl->maUniqId;
+ 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();
+ }
}
-const rtl::OString& Window::GetUniqueOrHelpId() const
+SmartId Window::GetSmartUniqueOrHelpId() const
{
- return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
+ 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();
}
+
+
+
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
@@ -1408,47 +1604,47 @@ Window* Window::ImplGetFrameWindow() const
return mpWindowImpl->mpFrameWindow;
}
-sal_Bool Window::ImplIsDockingWindow() const
+BOOL Window::ImplIsDockingWindow() const
{
return mpWindowImpl->mbDockWin;
}
-sal_Bool Window::ImplIsFloatingWindow() const
+BOOL Window::ImplIsFloatingWindow() const
{
return mpWindowImpl->mbFloatWin;
}
-sal_Bool Window::ImplIsToolbox() const
+BOOL Window::ImplIsToolbox() const
{
return mpWindowImpl->mbToolBox;
}
-sal_Bool Window::ImplIsSplitter() const
+BOOL Window::ImplIsSplitter() const
{
return mpWindowImpl->mbSplitter;
}
-sal_Bool Window::ImplIsPushButton() const
+BOOL Window::ImplIsPushButton() const
{
return mpWindowImpl->mbPushButton;
}
-sal_Bool Window::ImplIsOverlapWindow() const
+BOOL Window::ImplIsOverlapWindow() const
{
return mpWindowImpl->mbOverlapWin;
}
-void Window::ImplSetActive( sal_Bool bActive )
+void Window::ImplSetActive( BOOL bActive )
{
mpWindowImpl->mbActive = bActive;
}
-sal_Bool Window::ImplIsMouseTransparent() const
+BOOL Window::ImplIsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-void Window::ImplSetMouseTransparent( sal_Bool bTransparent )
+void Window::ImplSetMouseTransparent( BOOL bTransparent )
{
mpWindowImpl->mbMouseTransparent = bTransparent;
}
@@ -1479,7 +1675,7 @@ void Window::ImplFrameToOutput( Rectangle& rRect )
rRect.Bottom()-=mnOutOffY;
}
-void Window::SetCompoundControl( sal_Bool bCompound )
+void Window::SetCompoundControl( BOOL bCompound )
{
mpWindowImpl->mbCompoundControl = bCompound;
}
@@ -1523,77 +1719,77 @@ WindowType Window::GetType() const
{
return mpWindowImpl->mnType;
}
-sal_Bool Window::IsSystemWindow() const
+BOOL Window::IsSystemWindow() const
{
return mpWindowImpl->mbSysWin;
}
-sal_Bool Window::IsDialog() const
+BOOL Window::IsDialog() const
{
return mpWindowImpl->mbDialog;
}
-sal_Bool Window::IsMenuFloatingWindow() const
+BOOL Window::IsMenuFloatingWindow() const
{
return mpWindowImpl->mbMenuFloatingWindow;
}
-sal_Bool Window::IsToolbarFloatingWindow() const
+BOOL Window::IsToolbarFloatingWindow() const
{
return mpWindowImpl->mbToolbarFloatingWindow;
}
-void Window::EnableAllResize( sal_Bool bEnable )
+void Window::EnableAllResize( BOOL bEnable )
{
mpWindowImpl->mbAllResize = bEnable;
}
-sal_Bool Window::IsAllResizeEnabled() const
+BOOL Window::IsAllResizeEnabled() const
{
return mpWindowImpl->mbAllResize;
}
-sal_Bool Window::IsClipSiblingsEnabled() const
+BOOL Window::IsClipSiblingsEnabled() const
{
return mpWindowImpl->mbClipSiblings;
}
-void Window::EnableChildTransparentMode( sal_Bool bEnable )
+void Window::EnableChildTransparentMode( BOOL bEnable )
{
mpWindowImpl->mbChildTransparent = bEnable;
}
-sal_Bool Window::IsChildTransparentModeEnabled() const
+BOOL Window::IsChildTransparentModeEnabled() const
{
return mpWindowImpl->mbChildTransparent;
}
-sal_Bool Window::IsMouseTransparent() const
+BOOL Window::IsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-sal_Bool Window::IsPaintTransparent() const
+BOOL Window::IsPaintTransparent() const
{
return mpWindowImpl->mbPaintTransparent;
}
-void Window::SetDialogControlStart( sal_Bool bStart )
+void Window::SetDialogControlStart( BOOL bStart )
{
mpWindowImpl->mbDlgCtrlStart = bStart;
}
-sal_Bool Window::IsDialogControlStart() const
+BOOL Window::IsDialogControlStart() const
{
return mpWindowImpl->mbDlgCtrlStart;
}
-void Window::SetDialogControlFlags( sal_uInt16 nFlags )
+void Window::SetDialogControlFlags( USHORT nFlags )
{
mpWindowImpl->mnDlgCtrlFlags = nFlags;
}
-sal_uInt16 Window::GetDialogControlFlags() const
+USHORT Window::GetDialogControlFlags() const
{
return mpWindowImpl->mnDlgCtrlFlags;
}
@@ -1603,231 +1799,231 @@ const InputContext& Window::GetInputContext() const
return mpWindowImpl->maInputContext;
}
-sal_Bool Window::IsExtTextInput() const
+BOOL Window::IsExtTextInput() const
{
return mpWindowImpl->mbExtTextInput;
}
-void Window::EnableChildNotify( sal_Bool bEnable )
+void Window::EnableChildNotify( BOOL bEnable )
{
mpWindowImpl->mbChildNotify = bEnable;
}
-sal_Bool Window::IsChildNotify() const
+BOOL Window::IsChildNotify() const
{
return mpWindowImpl->mbChildNotify;
}
-sal_Bool Window::IsControlFont() const
+BOOL Window::IsControlFont() const
{
return (mpWindowImpl->mpControlFont != 0);
}
Color Window::GetControlForeground() const
-{
- return mpWindowImpl->maControlForeground;
+{
+ return mpWindowImpl->maControlForeground;
}
-sal_Bool Window::IsControlForeground() const
-{
- return mpWindowImpl->mbControlForeground;
+BOOL Window::IsControlForeground() const
+{
+ return mpWindowImpl->mbControlForeground;
}
-Color Window::GetControlBackground() const
-{
- return mpWindowImpl->maControlBackground;
+Color Window::GetControlBackground() const
+{
+ return mpWindowImpl->maControlBackground;
}
-sal_Bool Window::IsControlBackground() const
-{
- return mpWindowImpl->mbControlBackground;
+BOOL Window::IsControlBackground() const
+{
+ return mpWindowImpl->mbControlBackground;
}
-sal_Bool Window::IsInPaint() const
-{
- return mpWindowImpl->mbInPaint;
+BOOL Window::IsInPaint() const
+{
+ return mpWindowImpl->mbInPaint;
}
-Window* Window::GetParent() const
-{
- return mpWindowImpl->mpRealParent;
+Window* Window::GetParent() const
+{
+ return mpWindowImpl->mpRealParent;
}
-sal_Bool Window::IsVisible() const
-{
- return mpWindowImpl->mbVisible;
+BOOL Window::IsVisible() const
+{
+ return mpWindowImpl->mbVisible;
}
-sal_Bool Window::IsReallyVisible() const
-{
- return mpWindowImpl->mbReallyVisible;
+BOOL Window::IsReallyVisible() const
+{
+ return mpWindowImpl->mbReallyVisible;
}
-sal_Bool Window::IsParentPathVisible() const
-{
- return mpWindowImpl->mbReallyVisible;
+BOOL Window::IsParentPathVisible() const
+{
+ return mpWindowImpl->mbReallyVisible;
}
-sal_Bool Window::IsReallyShown() const
-{
- return mpWindowImpl->mbReallyShown;
+BOOL Window::IsReallyShown() const
+{
+ return mpWindowImpl->mbReallyShown;
}
-sal_Bool Window::IsInInitShow() const
-{
- return mpWindowImpl->mbInInitShow;
+BOOL Window::IsInInitShow() const
+{
+ return mpWindowImpl->mbInInitShow;
}
-sal_Bool Window::IsEnabled() const
-{
- return !mpWindowImpl->mbDisabled;
+BOOL Window::IsEnabled() const
+{
+ return !mpWindowImpl->mbDisabled;
}
-sal_Bool Window::IsInputEnabled() const
-{
- return !mpWindowImpl->mbInputDisabled;
+BOOL Window::IsInputEnabled() const
+{
+ return !mpWindowImpl->mbInputDisabled;
}
-sal_Bool Window::IsAlwaysEnableInput() const
-{
- return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
+BOOL Window::IsAlwaysEnableInput() const
+{
+ return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
}
-sal_Bool Window::IsAlwaysDisableInput() const
-{
- return mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled;
+BOOL Window::IsAlwaysDisableInput() const
+{
+ return mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled;
}
-sal_uInt16 Window::GetActivateMode() const
-{
- return mpWindowImpl->mnActivateMode;
+USHORT Window::GetActivateMode() const
+{
+ return mpWindowImpl->mnActivateMode;
}
-sal_Bool Window::IsAlwaysOnTopEnabled() const
-{
- return mpWindowImpl->mbAlwaysOnTop;
+BOOL Window::IsAlwaysOnTopEnabled() const
+{
+ return mpWindowImpl->mbAlwaysOnTop;
}
-sal_Bool Window::IsDefaultPos() const
-{
- return mpWindowImpl->mbDefPos;
+BOOL Window::IsDefaultPos() const
+{
+ return mpWindowImpl->mbDefPos;
}
-sal_Bool Window::IsDefaultSize() const
-{
- return mpWindowImpl->mbDefSize;
+BOOL Window::IsDefaultSize() const
+{
+ return mpWindowImpl->mbDefSize;
}
-void Window::EnablePaint( sal_Bool bEnable )
-{
- mpWindowImpl->mbPaintDisabled = !bEnable;
+void Window::EnablePaint( BOOL bEnable )
+{
+ mpWindowImpl->mbPaintDisabled = !bEnable;
}
-sal_Bool Window::IsPaintEnabled() const
-{
- return !mpWindowImpl->mbPaintDisabled;
+BOOL Window::IsPaintEnabled() const
+{
+ return !mpWindowImpl->mbPaintDisabled;
}
-sal_Bool Window::IsUpdateMode() const
-{
- return !mpWindowImpl->mbNoUpdate;
+BOOL Window::IsUpdateMode() const
+{
+ return !mpWindowImpl->mbNoUpdate;
}
-void Window::SetParentUpdateMode( sal_Bool bUpdate )
-{
- mpWindowImpl->mbNoParentUpdate = !bUpdate;
+void Window::SetParentUpdateMode( BOOL bUpdate )
+{
+ mpWindowImpl->mbNoParentUpdate = !bUpdate;
}
-sal_Bool Window::IsParentUpdateMode() const
-{
- return !mpWindowImpl->mbNoParentUpdate;
+BOOL Window::IsParentUpdateMode() const
+{
+ return !mpWindowImpl->mbNoParentUpdate;
}
-sal_Bool Window::IsActive() const
-{
- return mpWindowImpl->mbActive;
+BOOL Window::IsActive() const
+{
+ return mpWindowImpl->mbActive;
}
-sal_uInt16 Window::GetGetFocusFlags() const
-{
- return mpWindowImpl->mnGetFocusFlags;
+USHORT Window::GetGetFocusFlags() const
+{
+ return mpWindowImpl->mnGetFocusFlags;
}
-sal_Bool Window::IsCompoundControl() const
-{
- return mpWindowImpl->mbCompoundControl;
+BOOL Window::IsCompoundControl() const
+{
+ return mpWindowImpl->mbCompoundControl;
}
-sal_Bool Window::HasCompoundControlFocus() const
-{
- return mpWindowImpl->mbCompoundControlHasFocus;
+BOOL Window::HasCompoundControlFocus() const
+{
+ return mpWindowImpl->mbCompoundControlHasFocus;
}
-sal_Bool Window::IsChildPointerOverwrite() const
+BOOL Window::IsChildPointerOverwrite() const
{
- return mpWindowImpl->mbChildPtrOverwrite;
+ return mpWindowImpl->mbChildPtrOverwrite;
}
-sal_Bool Window::IsPointerVisible() const
-{
- return !mpWindowImpl->mbNoPtrVisible;
+BOOL Window::IsPointerVisible() const
+{
+ return !mpWindowImpl->mbNoPtrVisible;
}
-sal_Bool Window::IsWait() const
-{
- return (mpWindowImpl->mnWaitCount != 0);
+BOOL Window::IsWait() const
+{
+ return (mpWindowImpl->mnWaitCount != 0);
}
-Cursor* Window::GetCursor() const
-{
- return mpWindowImpl->mpCursor;
+Cursor* Window::GetCursor() const
+{
+ return mpWindowImpl->mpCursor;
}
-const Fraction& Window::GetZoom() const
-{
- return mpWindowImpl->maZoom;
+const Fraction& Window::GetZoom() const
+{
+ return mpWindowImpl->maZoom;
}
-sal_Bool Window::IsZoom() const
-{
- return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
+BOOL Window::IsZoom() const
+{
+ return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
}
-void Window::SetHelpText( const XubString& rHelpText )
-{
+void Window::SetHelpText( const XubString& rHelpText )
+{
mpWindowImpl->maHelpText = rHelpText;
- mpWindowImpl->mbHelpTextDynamic = sal_True;
+ mpWindowImpl->mbHelpTextDynamic = TRUE;
}
-void Window::SetQuickHelpText( const XubString& rHelpText )
-{
- mpWindowImpl->maQuickHelpText = rHelpText;
+void Window::SetQuickHelpText( const XubString& rHelpText )
+{
+ mpWindowImpl->maQuickHelpText = rHelpText;
}
-const XubString& Window::GetQuickHelpText() const
-{
- return mpWindowImpl->maQuickHelpText;
+const XubString& Window::GetQuickHelpText() const
+{
+ return mpWindowImpl->maQuickHelpText;
}
-void Window::SetData( void* pNewData )
-{
- mpWindowImpl->mpUserData = pNewData;
+void Window::SetData( void* pNewData )
+{
+ mpWindowImpl->mpUserData = pNewData;
}
-void* Window::GetData() const
-{
- return mpWindowImpl->mpUserData;
+void* Window::GetData() const
+{
+ return mpWindowImpl->mpUserData;
}
-sal_Bool Window::IsCreatedWithToolkit() const
-{
- return mpWindowImpl->mbCreatedWithToolkit;
+BOOL Window::IsCreatedWithToolkit() const
+{
+ return mpWindowImpl->mbCreatedWithToolkit;
}
-void Window::SetCreatedWithToolkit( sal_Bool b )
-{
- mpWindowImpl->mbCreatedWithToolkit = b;
+void Window::SetCreatedWithToolkit( BOOL b )
+{
+ mpWindowImpl->mbCreatedWithToolkit = b;
}
const Pointer& Window::GetPointer() const
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index f35e85e89464..064ea6b70e6b 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
deleted file mode 100644
index 577a573c2015..000000000000
--- a/vcl/source/window/window4.cxx
+++ /dev/null
@@ -1,224 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "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 2892bcb00c38..ca593bd948d8 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,6 +38,7 @@
#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>
@@ -128,9 +129,9 @@ long ImplCallEvent( NotifyEvent& rEvt )
// =======================================================================
-static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
- sal_uInt16 nCode, sal_uInt16 nSVEvent,
- sal_Bool bMouseLeave )
+static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
+ USHORT nCode, USHORT nSVEvent,
+ BOOL bMouseLeave )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -141,21 +142,21 @@ static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos
* #93895# since floats are system windows, coordinates have
* to be converted to float relative for the hittest
*/
- sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest );
FloatingWindow* pLastLevelFloat;
- sal_uLong nPopupFlags;
+ ULONG nPopupFlags;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
if ( bMouseLeave )
- return sal_True;
+ return TRUE;
if ( !pFloat || (nHitTest & IMPL_FLOATWIN_HITTEST_RECT) )
{
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
ImplDestroyHelpWindow( true );
pChild->ImplGetFrame()->SetPointer( POINTER_ARROW );
- return sal_True;
+ return TRUE;
}
}
else
@@ -171,15 +172,15 @@ static sal_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 sal_False;
+// return FALSE;
// else
- return sal_True;
+ return TRUE;
}
else if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT )
{
if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) )
pFloat->ImplSetMouseDown();
- return sal_True;
+ return TRUE;
}
}
else
@@ -190,7 +191,7 @@ static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos
{
if ( pFloat->ImplIsMouseDown() )
pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
- return sal_True;
+ return TRUE;
}
}
else
@@ -200,7 +201,7 @@ static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos
if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return sal_True;
+ return TRUE;
}
}
}
@@ -215,21 +216,21 @@ static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos
{
if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) &&
(nSVEvent == EVENT_MOUSEBUTTONUP) )
- return sal_True;
+ return TRUE;
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK )
- return sal_False;
+ return FALSE;
else
- return sal_True;
+ return TRUE;
}
else
- return sal_True;
+ return TRUE;
}
}
}
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -241,7 +242,7 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
!( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
{
- sal_uInt16 nHelpMode = 0;
+ USHORT nHelpMode = 0;
if ( pSVData->maHelpData.mbQuickHelp )
nHelpMode = HELPMODE_QUICK;
if ( pSVData->maHelpData.mbBalloonHelp )
@@ -251,9 +252,9 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
if ( pChild->IsInputEnabled() && ! pChild->IsInModalMode() )
{
HelpEvent aHelpEvent( rMousePos, nHelpMode );
- pSVData->maHelpData.mbRequestingHelp = sal_True;
+ pSVData->maHelpData.mbRequestingHelp = TRUE;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbRequestingHelp = sal_False;
+ pSVData->maHelpData.mbRequestingHelp = FALSE;
}
// #104172# do not kill keyboard activated tooltips
else if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp)
@@ -277,8 +278,8 @@ static void ImplSetMousePointer( Window* pChild )
// -----------------------------------------------------------------------
-static sal_Bool ImplCallCommand( Window* pChild, sal_uInt16 nEvt, void* pData = NULL,
- sal_Bool bMouse = sal_False, Point* pPos = NULL )
+static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
+ BOOL bMouse = FALSE, Point* pPos = NULL )
{
Point aPos;
if ( pPos )
@@ -298,24 +299,24 @@ static sal_Bool ImplCallCommand( Window* pChild, sal_uInt16 nEvt, void* pData =
CommandEvent aCEvt( aPos, nEvt, bMouse, pData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pChild, &aCEvt );
ImplDelData aDelData( pChild );
- sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
if ( !bPreNotify )
{
- pChild->ImplGetWindowImpl()->mbCommand = sal_False;
+ pChild->ImplGetWindowImpl()->mbCommand = FALSE;
pChild->Command( aCEvt );
if( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
pChild->ImplNotifyKeyMouseCommandEventListeners( aNCmdEvt );
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
if ( pChild->ImplGetWindowImpl()->mbCommand )
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -338,24 +339,24 @@ static long ContextMenuEventLink( void* pCEvent, void* )
if( ! pEv->aDelData.IsDelete() )
{
pEv->pWindow->ImplRemoveDel( &pEv->aDelData );
- ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, sal_True, &pEv->aChildPos );
+ ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, TRUE, &pEv->aChildPos );
}
delete pEv;
return 0;
}
-long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
- long nX, long nY, sal_uLong nMsgTime,
- sal_uInt16 nCode, sal_uInt16 nMode )
+long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
+ long nX, long nY, ULONG nMsgTime,
+ USHORT nCode, USHORT nMode )
{
ImplSVData* pSVData = ImplGetSVData();
Point aMousePos( nX, nY );
Window* pChild;
long nRet;
- sal_uInt16 nClicks;
+ USHORT nClicks;
ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData();
- sal_uInt16 nOldCode = pWinFrameData->mnMouseCode;
+ USHORT nOldCode = pWinFrameData->mnMouseCode;
// we need a mousemove event, befor we get a mousebuttondown or a
// mousebuttonup event
@@ -378,7 +379,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( (pWinFrameData->mnLastMouseX != nX) ||
(pWinFrameData->mnLastMouseY != nY) )
{
- ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False, nX, nY, nMsgTime, nCode, nMode );
+ ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE, nX, nY, nMsgTime, nCode, nMode );
}
}
@@ -391,7 +392,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
pWinFrameData->mnMouseMode = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED);
if ( bMouseLeave )
{
- pWinFrameData->mbMouseIn = sal_False;
+ pWinFrameData->mbMouseIn = FALSE;
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
{
ImplDelData aDelData( pWindow );
@@ -403,7 +404,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
}
else
- pWinFrameData->mbMouseIn = sal_True;
+ pWinFrameData->mbMouseIn = TRUE;
DBG_ASSERT( !pSVData->maWinData.mpTrackWin ||
(pSVData->maWinData.mpTrackWin == pSVData->maWinData.mpCaptureWin),
@@ -474,9 +475,9 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
MouseEvent aMEvt( aChildPos, pWinFrameData->mnClickCount, nMode, nCode, nCode );
NotifyEvent aNEvt( nSVEvent, pChild, &aMEvt );
Application::CallEventHooks( aNEvt );
-
+
if( pChild->IsCallHandlersOnInputDisabled() )
- {
+ {
pWinFrameData->mpMouseMoveWin = pChild;
pChild->ImplNotifyKeyMouseCommandEventListeners( aNEvt );
}
@@ -556,7 +557,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
!(((nMouseY-nDragH) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) &&
((nMouseY+nDragH) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
{
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
// Check if drag source provides it's own recognizer
if( pMouseDownWin->ImplGetFrameData()->mbInternalDragGestureRecognizer )
@@ -587,7 +588,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
nClicks,
sal_False );
- sal_uLong nCount = Application::ReleaseSolarMutex();
+ 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();
@@ -605,7 +606,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
}
else
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
}
// test for mouseleave and mouseenter
@@ -619,8 +620,8 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt );
ImplDelData aDelData;
ImplDelData aDelData2;
- pWinFrameData->mbInMouseMove = sal_True;
- pMouseMoveWin->ImplGetWinData()->mbMouseOver = sal_False;
+ pWinFrameData->mbInMouseMove = TRUE;
+ pMouseMoveWin->ImplGetWinData()->mbMouseOver = FALSE;
pMouseMoveWin->ImplAddDel( &aDelData );
// Durch MouseLeave kann auch dieses Fenster zerstoert
// werden
@@ -635,7 +636,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
pWinFrameData->mpMouseMoveWin = NULL;
- pWinFrameData->mbInMouseMove = sal_False;
+ pWinFrameData->mbInMouseMove = FALSE;
if ( pChild )
{
@@ -653,7 +654,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
pWinFrameData->mpMouseMoveWin = pChild;
if( pChild )
- pChild->ImplGetWinData()->mbMouseOver = sal_True;
+ pChild->ImplGetWinData()->mbMouseOver = TRUE;
// MouseLeave
if ( !pChild )
@@ -665,7 +666,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
{
const MouseSettings& rMSettings = pChild->GetSettings().GetMouseSettings();
- sal_uLong nDblClkTime = rMSettings.GetDoubleClickTime();
+ ULONG nDblClkTime = rMSettings.GetDoubleClickTime();
long nDblClkW = rMSettings.GetDoubleClickWidth();
long nDblClkH = rMSettings.GetDoubleClickHeight();
//long nMouseX = nX;
@@ -682,7 +683,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
((nMouseY+nDblClkH) >= pChild->ImplGetFrameData()->mnFirstMouseY) )
{
pChild->ImplGetFrameData()->mnClickCount++;
- pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
+ pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
}
else
{
@@ -721,7 +722,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( !aDelData.IsDelete() )
{
pChild->ImplRemoveDel( &aDelData );
- pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
+ pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
}
return 1;
}
@@ -730,15 +731,15 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
// call handler
- sal_Bool bDrag = sal_False;
- sal_Bool bCallHelpRequest = sal_True;
+ BOOL bDrag = FALSE;
+ BOOL bCallHelpRequest = 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 = sal_True;
+ pChild->ImplGetFrameData()->mbInMouseMove = TRUE;
// bring window into foreground on mouseclick
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
@@ -768,7 +769,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
(pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) )
pSVData->maWinData.mpTrackTimer->Start();
}
- bCallHelpRequest = sal_False;
+ bCallHelpRequest = FALSE;
nRet = 1;
}
else
@@ -779,16 +780,16 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
pChild->ToTop( TOTOP_NOGRABFOCUS );
if( aDelData.IsDelete() )
- bCallHelpRequest = sal_False;
+ bCallHelpRequest = 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 = sal_False;
+ pChild->ImplGetWindowImpl()->mbMouseMove = FALSE;
pChild->MouseMove( aMEvt );
if ( pOldHelpTextWin != pSVData->maHelpData.mpHelpWin )
- bCallHelpRequest = sal_False;
+ bCallHelpRequest = FALSE;
}
}
}
@@ -799,7 +800,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
nRet = 1;
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonDown = sal_False;
+ pChild->ImplGetWindowImpl()->mbMouseButtonDown = FALSE;
pChild->MouseButtonDown( aMEvt );
}
}
@@ -812,7 +813,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
}
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonUp = sal_False;
+ pChild->ImplGetWindowImpl()->mbMouseButtonUp = FALSE;
pChild->MouseButtonUp( aMEvt );
}
}
@@ -827,7 +828,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( nSVEvent == EVENT_MOUSEMOVE )
- pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = sal_False;
+ pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = FALSE;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
@@ -865,11 +866,11 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( /*(nRet == 0) &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) &&
(nCode == MOUSE_MIDDLE) )
{
- sal_uInt16 nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
+ USHORT nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
if ( nMiddleAction == MOUSE_MIDDLE_AUTOSCROLL )
- nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, sal_True, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, TRUE, &aChildPos );
else if ( nMiddleAction == MOUSE_MIDDLE_PASTESELECTION )
- nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, sal_True, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, TRUE, &aChildPos );
}
else
{
@@ -878,7 +879,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
if ( (nCode == rMSettings.GetContextMenuCode()) &&
(nClicks == rMSettings.GetContextMenuClicks()) )
{
- sal_Bool bContextMenu;
+ BOOL bContextMenu;
if ( rMSettings.GetContextMenuDown() )
bContextMenu = (nSVEvent == EVENT_MOUSEBUTTONDOWN);
else
@@ -902,7 +903,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
Application::PostUserEvent( Link( pEv, ContextMenuEventLink ) );
}
else
- nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_True, &aChildPos );
+ nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, TRUE, &aChildPos );
}
}
}
@@ -957,20 +958,20 @@ static Window* ImplGetKeyInputWindow( Window* pWindow )
// -----------------------------------------------------------------------
-static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
- sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, sal_Bool bForward )
+static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
+ USHORT nKeyCode, USHORT nCharCode, USHORT nRepeat, BOOL bForward )
{
ImplSVData* pSVData = ImplGetSVData();
KeyCode aKeyCode( nKeyCode, nKeyCode );
- sal_uInt16 nEvCode = aKeyCode.GetCode();
+ USHORT 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 sal_False)
+ // but make sure we're not forwarding external KeyEvents, (ie where bForward is FALSE)
// becasue those are coming back from the listener itself and MUST be processed
KeyEvent aKeyEvent( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
if( bForward )
{
- sal_uInt16 nVCLEvent;
+ USHORT nVCLEvent;
switch( nSVEvent )
{
case EVENT_KEYINPUT:
@@ -993,11 +994,11 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() )
{
String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
- nCharCode = (sal_uInt16) aSep.GetChar(0);
+ nCharCode = (USHORT) aSep.GetChar(0);
}
}
- sal_Bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
+ BOOL bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
// determine last input time
pSVData->maAppData.mnLastInputTime = Time::GetSystemTicks();
@@ -1033,7 +1034,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
if ( pSVData->maWinData.mpTrackWin )
{
- sal_uInt16 nOrigCode = aKeyCode.GetCode();
+ USHORT nOrigCode = aKeyCode.GetCode();
if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) )
{
@@ -1043,7 +1044,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- sal_uInt16 nEscCode = aKeyCode.GetCode();
+ USHORT nEscCode = aKeyCode.GetCode();
if ( nEscCode == KEY_ESCAPE )
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1066,7 +1067,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- sal_uInt16 nCode = aKeyCode.GetCode();
+ USHORT nCode = aKeyCode.GetCode();
if ( (nCode == KEY_ESCAPE) || bCtrlF6)
{
@@ -1101,19 +1102,19 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
KeyEvent aKeyEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt );
- sal_Bool bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
+ BOOL bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
long nRet = 1;
if ( !bKeyPreNotify && !aDelData.IsDelete() )
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
+ pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
pChild->KeyInput( aKeyEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
+ pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
pChild->KeyUp( aKeyEvt );
}
// #82968#
@@ -1130,10 +1131,10 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyInput )
{
- sal_uInt16 nCode = aKeyCode.GetCode();
+ USHORT nCode = aKeyCode.GetCode();
// #101999# is focus in or below toolbox
- sal_Bool bToolboxFocus=sal_False;
+ BOOL bToolboxFocus=FALSE;
if( (nCode == KEY_F1) && aKeyCode.IsShift() )
{
Window *pWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
@@ -1141,7 +1142,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
if( pWin->ImplGetWindowImpl()->mbToolBox )
{
- bToolboxFocus = sal_True;
+ bToolboxFocus = TRUE;
break;
}
else
@@ -1151,7 +1152,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
// ContextMenu
if ( (nCode == KEY_CONTEXTMENU) || ((nCode == KEY_F10) && aKeyCode.IsShift() && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) )
- nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_False );
+ nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, 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 ) )
@@ -1164,10 +1165,10 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
aPos = pChild->OutputToScreenPixel( aPos );
HelpEvent aHelpEvent( aPos, HELPMODE_BALLOON );
- aHelpEvent.SetKeyboardActivated( sal_True );
- pSVData->maHelpData.mbSetKeyboardHelp = sal_True;
+ aHelpEvent.SetKeyboardActivated( TRUE );
+ pSVData->maHelpData.mbSetKeyboardHelp = TRUE;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbSetKeyboardHelp = sal_False;
+ pSVData->maHelpData.mbSetKeyboardHelp = FALSE;
}
else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) )
{
@@ -1214,7 +1215,7 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
ImplDelData aChildDelData( pChild );
KeyEvent aKEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNEvt( nSVEvent, pChild, &aKEvt );
- sal_Bool bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
+ BOOL bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
if ( aChildDelData.IsDelete() )
return 1;
@@ -1222,12 +1223,12 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
+ pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
pChild->KeyInput( aKEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
+ pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
pChild->KeyUp( aKEvt );
}
// #82968#
@@ -1248,12 +1249,12 @@ static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
static long ImplHandleExtTextInput( Window* pWindow,
const XubString& rText,
- const sal_uInt16* pTextAttr,
- sal_uLong nCursorPos, sal_uInt16 nCursorFlags )
+ const USHORT* pTextAttr,
+ ULONG nCursorPos, USHORT nCursorFlags )
{
ImplSVData* pSVData = ImplGetSVData();
Window* pChild = NULL;
-
+
int nTries = 200;
while( nTries-- )
{
@@ -1274,7 +1275,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = sal_True;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = TRUE;
if ( !pWinData->mpExtOldText )
pWinData->mpExtOldText = new UniString;
else
@@ -1293,7 +1294,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
return 0;
// Test for changes
- sal_Bool bOnlyCursor = sal_False;
+ BOOL bOnlyCursor = FALSE;
xub_StrLen nMinLen = Min( pWinData->mpExtOldText->Len(), rText.Len() );
xub_StrLen nDeltaStart = 0;
while ( nDeltaStart < nMinLen )
@@ -1322,7 +1323,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( (nDeltaStart >= nMinLen) &&
(pWinData->mpExtOldText->Len() == rText.Len()) )
- bOnlyCursor = sal_True;
+ bOnlyCursor = TRUE;
// Call Event and store the information
CommandExtTextInputData aData( rText, pTextAttr,
@@ -1337,8 +1338,8 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( pTextAttr )
{
- pWinData->mpExtOldAttrAry = new sal_uInt16[rText.Len()];
- memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( sal_uInt16 ) );
+ pWinData->mpExtOldAttrAry = new USHORT[rText.Len()];
+ memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( USHORT ) );
}
return !ImplCallCommand( pChild, COMMAND_EXTTEXTINPUT, &aData );
}
@@ -1353,7 +1354,7 @@ static long ImplHandleEndExtTextInput( Window* /* pWindow */ )
if ( pChild )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = sal_False;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = FALSE;
pSVData->maWinData.mpExtTextInputWin = NULL;
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( pWinData->mpExtOldText )
@@ -1430,26 +1431,26 @@ static long ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang
// -----------------------------------------------------------------------
-static sal_Bool ImplCallWheelCommand( Window* pWindow, const Point& rPos,
+static BOOL ImplCallWheelCommand( Window* pWindow, const Point& rPos,
const CommandWheelData* pWheelData )
{
Point aCmdMousePos = pWindow->ImplFrameToOutput( rPos );
- CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, sal_True, pWheelData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, TRUE, pWheelData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
ImplDelData aDelData( pWindow );
- sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
if ( !bPreNotify )
{
- pWindow->ImplGetWindowImpl()->mbCommand = sal_False;
+ pWindow->ImplGetWindowImpl()->mbCommand = FALSE;
pWindow->Command( aCEvt );
if ( aDelData.IsDelete() )
- return sal_False;
+ return FALSE;
if ( pWindow->ImplGetWindowImpl()->mbCommand )
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1466,8 +1467,8 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if( aDogTag.IsDelete() )
return 0;
- sal_uInt16 nMode;
- sal_uInt16 nCode = rEvt.mnCode;
+ USHORT nMode;
+ USHORT nCode = rEvt.mnCode;
bool bHorz = rEvt.mbHorz;
bool bPixel = rEvt.mbDeltaIsPixel;
if ( nCode & KEY_MOD1 )
@@ -1484,7 +1485,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 );
- sal_Bool bRet = sal_True;
+ BOOL bRet = TRUE;
// first check any floating window ( eg. drop down listboxes)
bool bIsFloat = false;
@@ -1492,7 +1493,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin &&
!pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pWindow ) )
{
- sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
pMouseWindow = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pWindow, aMousePos, nHitTest );
}
// then try the window directly beneath the mouse
@@ -1539,14 +1540,14 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
}
}
}
-
+
// close floaters
if( ! bIsFloat && pSVData->maWinData.mpFirstFloat )
{
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if( pLastLevelFloat )
{
- sal_uLong nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
+ ULONG nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
if ( nPopupFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1558,7 +1559,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
}
// -----------------------------------------------------------------------
-#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020)
+#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020)
static void ImplHandlePaint( Window* pWindow, const Rectangle& rBoundRect, bool bImmediateUpdate )
{
@@ -1597,7 +1598,7 @@ static void KillOwnPopups( Window* pWindow )
ImplSVData* pSVData = ImplGetSVData();
Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow;
Window *pChild = pSVData->maWinData.mpFirstFloat;
- if ( pChild && pParent->ImplIsWindowOrChild( pChild, sal_True ) )
+ if ( pChild && pParent->ImplIsWindowOrChild( pChild, TRUE ) )
{
if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1624,7 +1625,7 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
{
pWindow->mnOutWidth = nNewWidth;
pWindow->mnOutHeight = nNewHeight;
- pWindow->ImplGetWindowImpl()->mbWaitSystemResize = sal_False;
+ pWindow->ImplGetWindowImpl()->mbWaitSystemResize = FALSE;
if ( pWindow->IsReallyVisible() )
pWindow->ImplSetClipFlag();
if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize ||
@@ -1655,13 +1656,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->ImplCallResize(); // otherwise menues cannot be positioned
}
else
- pWindow->ImplGetWindowImpl()->mbCallResize = sal_True;
+ pWindow->ImplGetWindowImpl()->mbCallResize = TRUE;
}
}
pWindow->ImplGetWindowImpl()->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) ||
(nNewHeight < IMPL_MIN_NEEDSYSWIN);
- sal_Bool bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
if( bMinimized != pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized )
pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized = bMinimized;
@@ -1687,10 +1688,10 @@ static void ImplHandleMove( Window* pWindow )
if ( pWindow->IsVisible() )
pWindow->ImplCallMove();
else
- pWindow->ImplGetWindowImpl()->mbCallMove = sal_True; // make sure the framepos will be updated on the next Show()
+ pWindow->ImplGetWindowImpl()->mbCallMove = 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
+ pWindow->ImplGetWindowImpl()->mpClientWindow->ImplCallMove(); // notify client to update geometry
}
@@ -1704,7 +1705,7 @@ static void ImplHandleMoveResize( Window* pWindow, long nNewWidth, long nNewHeig
// -----------------------------------------------------------------------
-static void ImplActivateFloatingWindows( Window* pWindow, sal_Bool bActive )
+static void ImplActivateFloatingWindows( Window* pWindow, BOOL bActive )
{
// Zuerst alle ueberlappenden Fenster ueberpruefen
Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
@@ -1732,7 +1733,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
- sal_Bool bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
+ BOOL bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
// Dann die zeitverzoegerten Funktionen ausfuehren
if ( bHasFocus )
@@ -1743,21 +1744,21 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin )
{
- sal_Bool bHandled = sal_False;
+ BOOL bHandled = FALSE;
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInputEnabled() &&
! ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInModalMode() )
{
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsEnabled() )
{
ImplGetWindowImpl()->mpFrameData->mpFocusWin->GrabFocus();
- bHandled = sal_True;
+ bHandled = 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 = sal_True;
+ bHandled = TRUE;
}
}
if ( !bHandled )
@@ -1798,11 +1799,11 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
Window* pOldOverlapWindow = pOldFocusWindow->ImplGetFirstOverlapWindow();
Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
- pOldOverlapWindow->ImplGetWindowImpl()->mbActive = sal_False;
+ pOldOverlapWindow->ImplGetWindowImpl()->mbActive = FALSE;
pOldOverlapWindow->Deactivate();
if ( pOldRealWindow != pOldOverlapWindow )
{
- pOldRealWindow->ImplGetWindowImpl()->mbActive = sal_False;
+ pOldRealWindow->ImplGetWindowImpl()->mbActive = FALSE;
pOldRealWindow->Deactivate();
}
}
@@ -1838,7 +1839,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
static void ImplHandleGetFocus( Window* pWindow )
{
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_True;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = TRUE;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -1882,7 +1883,7 @@ static void ImplHandleLoseFocus( Window* pWindow )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
}
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_False;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = FALSE;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -2003,9 +2004,9 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent )
// =======================================================================
-static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent )
+static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent )
{
- sal_uInt16 nMode = 0;
+ USHORT nMode = 0;
if ( !pEvent->mnCode )
nMode |= MOUSE_SIMPLEMOVE;
if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) )
@@ -2017,9 +2018,9 @@ static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
+static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent )
{
- sal_uInt16 nMode = 0;
+ USHORT nMode = 0;
if ( pEvent->mnButton == MOUSE_LEFT )
nMode |= MOUSE_SIMPLECLICK;
if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) )
@@ -2037,7 +2038,7 @@ static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_True,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, TRUE,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2047,7 +2048,7 @@ inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2057,7 +2058,7 @@ inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, sal_False,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, FALSE,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2072,7 +2073,7 @@ inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent
inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, sal_False,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, FALSE,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2087,12 +2088,12 @@ inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
static long ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
-static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
+static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, USHORT nEvent )
{
// Find SystemWindow and its Menubar and let it dispatch the command
long nRet = 0;
@@ -2142,11 +2143,11 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent )
if ( pTrackWin )
pWindow = pTrackWin;
#ifdef MACOSX
- sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
+ USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
#else
- sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
+ USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
#endif
- sal_uInt16 nNewCode = pEvent->mnCode;
+ USHORT nNewCode = pEvent->mnCode;
if ( nOldCode != nNewCode )
{
#ifdef MACOSX
@@ -2154,7 +2155,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, sal_True );
+ pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, TRUE );
}
// #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
@@ -2186,7 +2187,7 @@ static void ImplHandleInputLanguageChange( Window* pWindow )
// -----------------------------------------------------------------------
-static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
+static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
{
// Application Notification werden nur fuer das erste Window ausgeloest
ImplSVData* pSVData = ImplGetSVData();
@@ -2206,7 +2207,7 @@ static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
}
else
{
- sal_uInt16 nType;
+ USHORT nType;
switch ( nEvent )
{
case SALEVENT_VOLUMECHANGED:
@@ -2220,7 +2221,7 @@ static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
nType = DATACHANGED_DISPLAY;
break;
case SALEVENT_FONTCHANGED:
- OutputDevice::ImplUpdateAllFontData( sal_True );
+ OutputDevice::ImplUpdateAllFontData( TRUE );
nType = DATACHANGED_FONTS;
break;
case SALEVENT_DATETIMECHANGED:
@@ -2270,8 +2271,8 @@ static void ImplHandleSalExtTextInputPos( Window* pWindow, SalExtTextInputPosEve
static long ImplHandleShowDialog( Window* pWindow, int nDialogId )
{
if( ! pWindow )
- return sal_False;
-
+ return FALSE;
+
if( pWindow->GetType() == WINDOW_BORDERWINDOW )
{
Window* pWrkWin = pWindow->GetWindow( WINDOW_CLIENT );
@@ -2334,8 +2335,8 @@ static void ImplHandleSalSurroundingTextRequest( Window *pWindow,
// -----------------------------------------------------------------------
static void ImplHandleSurroundingTextSelectionChange( Window *pWindow,
- sal_uLong nStart,
- sal_uLong nEnd )
+ ULONG nStart,
+ ULONG nEnd )
{
Window* pChild = ImplGetKeyInputWindow( pWindow );
if( pChild )
@@ -2357,7 +2358,7 @@ static void ImplHandleStartReconversion( Window *pWindow )
// -----------------------------------------------------------------------
long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
- sal_uInt16 nEvent, const void* pEvent )
+ USHORT nEvent, const void* pEvent )
{
DBG_TESTSOLARMUTEX();
@@ -2432,28 +2433,28 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
}
break;
case SALEVENT_EXTERNALKEYINPUT:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
}
break;
case SALEVENT_KEYUP:
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
}
break;
case SALEVENT_EXTERNALKEYUP:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
}
break;
case SALEVENT_KEYMODCHANGE:
@@ -2540,15 +2541,15 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
// Message-Schleife beenden
Application::Quit();
- return sal_False;
+ return FALSE;
}
else
{
bInQueryExit = false;
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
case SALEVENT_SETTINGSCHANGED:
@@ -2604,7 +2605,7 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
break;
#ifdef DBG_UTIL
default:
- OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (sal_uLong)nEvent );
+ DBG_ERROR1( "ImplWindowFrameProc(): unknown event (%lu)", (ULONG)nEvent );
break;
#endif
}
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
deleted file mode 100644
index fcb0c560291e..000000000000
--- a/vcl/source/window/wpropset.cxx
+++ /dev/null
@@ -1,346 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "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 38d78fbc9723..384e0bd0cb64 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,8 +45,8 @@
// =======================================================================
-#define WORKWIN_WINDOWSTATE_FULLSCREEN ((sal_uLong)0x00010000)
-#define WORKWIN_WINDOWSTATE_ALL ((sal_uLong)0x00FF0000)
+#define WORKWIN_WINDOWSTATE_FULLSCREEN ((ULONG)0x00010000)
+#define WORKWIN_WINDOWSTATE_ALL ((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 = sal_False;
- mbPresentationVisible = sal_False;
- mbPresentationFull = sal_False;
- mbFullScreenMode = sal_False;
+ mbPresentationMode = FALSE;
+ mbPresentationVisible = FALSE;
+ mbPresentationFull = FALSE;
+ mbFullScreenMode = FALSE;
}
// -----------------------------------------------------------------------
void WorkWindow::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
- sal_uInt16 nFrameStyle = BORDERWINDOW_STYLE_FRAME;
+ USHORT 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 = sal_True;
+ mbSysChild = TRUE;
ImplInit( pParent, nStyle, aSystemWorkWindowToken );
}
@@ -148,7 +148,7 @@ WorkWindow::WorkWindow( SystemParentData* pParent ) :
SystemWindow( WINDOW_WORKWINDOW )
{
ImplInitWorkWindowData();
- mbSysChild = sal_True;
+ mbSysChild = TRUE;
ImplInit( NULL, 0, pParent );
}
@@ -177,7 +177,7 @@ WorkWindow::~WorkWindow()
// -----------------------------------------------------------------------
-void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDisplay )
+void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay )
{
if ( !mbFullScreenMode == !bFullScreenMode )
return;
@@ -203,34 +203,34 @@ void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDispla
xCanvasComponent->dispose();
}
- mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = sal_True;
+ mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = TRUE;
ImplGetFrame()->ShowFullScreen( bFullScreenMode, nDisplay );
}
}
// -----------------------------------------------------------------------
-void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplay )
+void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_Int32 nDisplay )
{
if ( !bPresentation == !mbPresentationMode )
return;
if ( bPresentation )
{
- mbPresentationMode = sal_True;
+ mbPresentationMode = TRUE;
mbPresentationVisible = IsVisible();
mbPresentationFull = mbFullScreenMode;
mnPresentationFlags = nFlags;
if ( !(mnPresentationFlags & PRESENTATION_NOFULLSCREEN) )
- ShowFullScreenMode( sal_True, nDisplay );
+ ShowFullScreenMode( TRUE, nDisplay );
if ( !mbSysChild )
{
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_True );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( TRUE );
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
ToTop();
- mpWindowImpl->mpFrame->StartPresentation( sal_True );
+ mpWindowImpl->mpFrame->StartPresentation( TRUE );
}
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
@@ -241,22 +241,22 @@ void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlag
Show( mbPresentationVisible );
if ( !mbSysChild )
{
- mpWindowImpl->mpFrame->StartPresentation( sal_False );
+ mpWindowImpl->mpFrame->StartPresentation( FALSE );
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_False );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( FALSE );
}
ShowFullScreenMode( mbPresentationFull, nDisplay );
- mbPresentationMode = sal_False;
- mbPresentationVisible = sal_False;
- mbPresentationFull = sal_False;
+ mbPresentationMode = FALSE;
+ mbPresentationVisible = FALSE;
+ mbPresentationFull = FALSE;
mnPresentationFlags = 0;
}
}
// -----------------------------------------------------------------------
-sal_Bool WorkWindow::IsMinimized() const
+BOOL WorkWindow::IsMinimized() const
{
//return mpWindowImpl->mpFrameData->mbMinimized;
SalFrameState aState;
@@ -266,15 +266,15 @@ sal_Bool WorkWindow::IsMinimized() const
// -----------------------------------------------------------------------
-sal_Bool WorkWindow::SetPluginParent( SystemParentData* pParent )
+BOOL WorkWindow::SetPluginParent( SystemParentData* pParent )
{
DBG_ASSERT( ! mbPresentationMode && ! mbFullScreenMode, "SetPluginParent in fullscreen or presentation mode !" );
bool bWasDnd = Window::ImplStopDnd();
- sal_Bool bShown = IsVisible();
- Show( sal_False );
- sal_Bool bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
+ BOOL bShown = IsVisible();
+ Show( FALSE );
+ BOOL bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
Show( bShown );
if( bWasDnd )
@@ -283,7 +283,7 @@ sal_Bool WorkWindow::SetPluginParent( SystemParentData* pParent )
return bRet;
}
-void WorkWindow::ImplSetFrameState( sal_uLong aFrameState )
+void WorkWindow::ImplSetFrameState( ULONG aFrameState )
{
SalFrameState aState;
aState.mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -302,33 +302,33 @@ void WorkWindow::Restore()
ImplSetFrameState( SAL_FRAMESTATE_NORMAL );
}
-sal_Bool WorkWindow::Close()
+BOOL WorkWindow::Close()
{
- sal_Bool bCanClose = SystemWindow::Close();
+ BOOL bCanClose = SystemWindow::Close();
// Ist es das Applikationsfenster, dann beende die Applikation
if ( bCanClose && ( ImplGetSVData()->maWinData.mpAppWin == this ) )
GetpApp()->Quit();
-
+
return bCanClose;
}
-void WorkWindow::Maximize( sal_Bool bMaximize )
+void WorkWindow::Maximize( BOOL bMaximize )
{
ImplSetFrameState( bMaximize ? SAL_FRAMESTATE_MAXIMIZED : SAL_FRAMESTATE_NORMAL );
}
-sal_Bool WorkWindow::IsMaximized() const
+BOOL WorkWindow::IsMaximized() const
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
SalFrameState aState;
if( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
{
- if( aState.mnState & (SAL_FRAMESTATE_MAXIMIZED |
- SAL_FRAMESTATE_MAXIMIZED_HORZ |
+ if( aState.mnState & (SAL_FRAMESTATE_MAXIMIZED |
+ SAL_FRAMESTATE_MAXIMIZED_HORZ |
SAL_FRAMESTATE_MAXIMIZED_VERT ) )
- bRet = sal_True;
+ bRet = TRUE;
}
return bRet;
}
diff --git a/vcl/test/canvasbitmaptest.cxx b/vcl/test/canvasbitmaptest.cxx
index 3763fb5b9d02..907c55dcd5e5 100644
--- a/vcl/test/canvasbitmaptest.cxx
+++ b/vcl/test/canvasbitmaptest.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -79,8 +79,8 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
uno::Reference< lang::XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ),
+ xMS = cppu::createRegistryServiceFactory(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ),
sal_True );
InitVCL( xMS );
@@ -115,7 +115,7 @@ class TestApp : public Application
{
public:
virtual void Main();
- virtual sal_uInt16 Exception( sal_uInt16 nError );
+ virtual USHORT Exception( USHORT nError );
};
class TestWindow : public Dialog
@@ -123,7 +123,7 @@ class TestWindow : public Dialog
public:
TestWindow() : Dialog( (Window *) NULL )
{
- SetText( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CanvasBitmap test harness")) );
+ SetText( rtl::OUString::createFromAscii( "CanvasBitmap test harness" ) );
SetSizePixel( Size( 1024, 1024 ) );
EnablePaint( true );
Show();
@@ -161,7 +161,7 @@ bool rangeCheck( const rendering::RGBColor& rColor )
//----------------------------------------------------------------------------------
-void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
+void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
const char* msg,
int nOriginalDepth )
{
@@ -192,7 +192,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
rendering::IntegerBitmapLayout aLayout;
uno::Sequence<sal_Int8> aPixelData = xBmp->getData(aLayout, geometry::IntegerRectangle2D(0,0,1,1));
-
+
const sal_Int32 nExpectedBitsPerPixel(
aContainedBmpEx.IsTransparent() ? std::max(8,nDepth)+8 : nDepth);
test( aLayout.ScanLines == 1,
@@ -212,7 +212,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
"Palette existance conforms to bitmap" );
uno::Sequence<sal_Int8> aPixelData2 = xBmp->getPixel( aLayout, geometry::IntegerPoint2D(0,0) );
-
+
test( aPixelData2.getLength() == aPixelData.getLength(),
"getData and getPixel return same amount of data" );
@@ -248,15 +248,15 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
test( pARGBStart[0].Alpha == 0.0,
"First pixel is fully transparent" );
}
-
+
test( pRGBStart[1].Red == 0.0 && pRGBStart[1].Green == 0.0 && pRGBStart[1].Blue == 0.0,
"Second pixel is black" );
if( nOriginalDepth > 8 )
{
const Color aCol(COL_GREEN);
- test( pRGBStart[5].Red == vcl::unotools::toDoubleColor(aCol.GetRed()) &&
- pRGBStart[5].Green == vcl::unotools::toDoubleColor(aCol.GetGreen()) &&
+ test( pRGBStart[5].Red == vcl::unotools::toDoubleColor(aCol.GetRed()) &&
+ pRGBStart[5].Green == vcl::unotools::toDoubleColor(aCol.GetGreen()) &&
pRGBStart[5].Blue == vcl::unotools::toDoubleColor(aCol.GetBlue()),
"Sixth pixel is green" );
}
@@ -312,7 +312,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
//----------------------------------------------------------------------------------
-void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
+void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
const char* msg,
int nOriginalDepth )
{
@@ -343,7 +343,7 @@ void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
rendering::IntegerBitmapLayout aLayout;
uno::Sequence<sal_Int8> aPixelData = xBmp->getData(aLayout, geometry::IntegerRectangle2D(0,0,1,1));
-
+
const sal_Int32 nExpectedBitsPerPixel(
aContainedBmpEx.IsTransparent() ? std::max(8,nDepth)+8 : nDepth);
test( aLayout.ScanLines == 1,
@@ -363,7 +363,7 @@ void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
"Palette existance conforms to bitmap" );
uno::Sequence<sal_Int8> aPixelData2 = xBmp->getPixel( aLayout, geometry::IntegerPoint2D(0,0) );
-
+
test( aPixelData2.getLength() == aPixelData.getLength(),
"getData and getPixel return same amount of data" );
@@ -399,15 +399,15 @@ void checkBitmapImport( const rtl::Reference<VclCanvasBitmap>& xBmp,
test( pARGBStart[0].Alpha == 0.0,
"First pixel is fully transparent" );
}
-
+
test( pRGBStart[1].Red == 0.0 && pRGBStart[1].Green == 0.0 && pRGBStart[1].Blue == 0.0,
"Second pixel is black" );
if( nOriginalDepth > 8 )
{
const Color aCol(COL_GREEN);
- test( pRGBStart[5].Red == vcl::unotools::toDoubleColor(aCol.GetRed()) &&
- pRGBStart[5].Green == vcl::unotools::toDoubleColor(aCol.GetGreen()) &&
+ test( pRGBStart[5].Red == vcl::unotools::toDoubleColor(aCol.GetRed()) &&
+ pRGBStart[5].Green == vcl::unotools::toDoubleColor(aCol.GetGreen()) &&
pRGBStart[5].Blue == vcl::unotools::toDoubleColor(aCol.GetBlue()),
"Sixth pixel is green" );
}
@@ -477,12 +477,12 @@ private:
// XBitmap
virtual geometry::IntegerSize2D SAL_CALL getSize() throw (uno::RuntimeException) { return maSize; }
virtual ::sal_Bool SAL_CALL hasAlpha( ) throw (uno::RuntimeException) { return mnBitsPerPixel != 8; }
- virtual uno::Reference< rendering::XBitmap > SAL_CALL getScaledBitmap( const geometry::RealSize2D&,
+ virtual uno::Reference< rendering::XBitmap > SAL_CALL getScaledBitmap( const geometry::RealSize2D&,
sal_Bool ) throw (uno::RuntimeException) { return this; }
// XIntegerReadOnlyBitmap
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL getData( rendering::IntegerBitmapLayout& bitmapLayout,
- const geometry::IntegerRectangle2D& rect ) throw (lang::IndexOutOfBoundsException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL getData( rendering::IntegerBitmapLayout& bitmapLayout,
+ const geometry::IntegerRectangle2D& rect ) throw (lang::IndexOutOfBoundsException,
rendering::VolatileContentDestroyedException, uno::RuntimeException)
{
test( rect.X1 >= 0, "X1 within bounds" );
@@ -499,9 +499,9 @@ private:
sal_Int8* pOut = aRes.getArray();
bitmapLayout.ScanLines = nHeight;
- bitmapLayout.ScanLineBytes =
+ bitmapLayout.ScanLineBytes =
bitmapLayout.ScanLineStride= nScanlineLen;
-
+
if( mnBitsPerPixel == 8 )
{
for( sal_Int32 y=0; y<nHeight; ++y )
@@ -527,8 +527,8 @@ private:
return aRes;
}
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL getPixel( rendering::IntegerBitmapLayout&,
- const geometry::IntegerPoint2D& ) throw (lang::IndexOutOfBoundsException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL getPixel( rendering::IntegerBitmapLayout&,
+ const geometry::IntegerPoint2D& ) throw (lang::IndexOutOfBoundsException,
rendering::VolatileContentDestroyedException, uno::RuntimeException)
{
test(false, "Method not implemented");
@@ -550,7 +550,7 @@ private:
const sal_Int32 nScanlineLen = (maSize.Width * mnBitsPerPixel + 7)/8;
aLayout.ScanLines = maSize.Height;
- aLayout.ScanLineBytes =
+ aLayout.ScanLineBytes =
aLayout.ScanLineStride= nScanlineLen;
aLayout.Palette = getPalette();
aLayout.ColorSpace.set( this );
@@ -567,26 +567,26 @@ private:
return 255;
}
- virtual ::sal_Bool SAL_CALL getIndex( uno::Sequence< double >& entry,
- ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException,
+ virtual ::sal_Bool SAL_CALL getIndex( uno::Sequence< double >& entry,
+ ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
{
test( getPalette().is(),
"Got palette interface call without handing out palette?!" );
test( nIndex >= 0 && nIndex < 256,
"Index out of range" );
- entry = colorToStdColorSpaceSequence(
- Color(UINT8(nIndex),
- UINT8(nIndex),
+ entry = colorToStdColorSpaceSequence(
+ Color(UINT8(nIndex),
+ UINT8(nIndex),
UINT8(nIndex)) );
return sal_True; // no palette transparency here.
}
- virtual ::sal_Bool SAL_CALL setIndex( const uno::Sequence< double >&,
- ::sal_Bool,
- ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException,
- lang::IllegalArgumentException,
+ virtual ::sal_Bool SAL_CALL setIndex( const uno::Sequence< double >&,
+ ::sal_Bool,
+ ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException,
+ lang::IllegalArgumentException,
uno::RuntimeException)
{
test( getPalette().is(),
@@ -597,13 +597,13 @@ private:
}
struct PaletteColorSpaceHolder: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>,
- PaletteColorSpaceHolder>
+ PaletteColorSpaceHolder>
{
uno::Reference<rendering::XColorSpace> operator()()
{
return vcl::unotools::createStandardColorSpace();
}
- };
+ };
virtual uno::Reference< rendering::XColorSpace > SAL_CALL getColorSpace( ) throw (uno::RuntimeException)
{
@@ -634,49 +634,49 @@ private:
return uno::Sequence< ::beans::PropertyValue >();
}
- virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >&,
+ virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >&,
const uno::Reference< rendering::XColorSpace >& ) throw (uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< double >();
}
- virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< rendering::RGBColor >();
}
- virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< rendering::ARGBColor >();
}
- virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< rendering::ARGBColor >();
}
- virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< double >();
}
- virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "This method is not expected to be called!");
return uno::Sequence< double >();
}
- virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "This method is not expected to be called!");
@@ -698,23 +698,23 @@ private:
return util::Endianness::LITTLE;
}
- virtual uno::Sequence< double > SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& ,
- const uno::Reference< rendering::XColorSpace >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< double > SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& ,
+ const uno::Reference< rendering::XColorSpace >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< double >();
}
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& ,
- const uno::Reference< rendering::XIntegerBitmapColorSpace >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& ,
+ const uno::Reference< rendering::XIntegerBitmapColorSpace >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< sal_Int8 >();
}
- virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
const uno::Sequence< rendering::ARGBColor > aTemp( convertIntegerToARGB(deviceColor) );
@@ -731,12 +731,12 @@ private:
return aRes;
}
- virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nBytesPerPixel(mnBitsPerPixel == 8 ? 1 : 4);
- test(nLen%nBytesPerPixel==0,
+ test(nLen%nBytesPerPixel==0,
"number of channels no multiple of pixel element count");
uno::Sequence< rendering::ARGBColor > aRes( nLen / nBytesPerPixel );
@@ -768,12 +768,12 @@ private:
return aRes;
}
- virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nBytesPerPixel(mnBitsPerPixel == 8 ? 1 : 4);
- test(nLen%nBytesPerPixel==0,
+ test(nLen%nBytesPerPixel==0,
"number of channels no multiple of pixel element count");
uno::Sequence< rendering::ARGBColor > aRes( nLen / nBytesPerPixel );
@@ -806,21 +806,21 @@ private:
return aRes;
}
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< sal_Int8 >();
}
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
return uno::Sequence< sal_Int8 >();
}
- virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
+ virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
test(false, "Method not implemented");
@@ -911,7 +911,7 @@ void TestWindow::Paint( const Rectangle& )
pAcc->SetPixel(0,2,aWhite);
}
}
-
+
rtl::Reference<VclCanvasBitmap> xBmp( new VclCanvasBitmap(aBitmap) );
checkCanvasBitmap( xBmp, "single bitmap", nDepth );
@@ -930,7 +930,7 @@ void TestWindow::Paint( const Rectangle& )
pAcc->SetPixel(0,2,BitmapColor(1));
}
}
-
+
xBmp.set( new VclCanvasBitmap(BitmapEx(aBitmap,aMask)) );
checkCanvasBitmap( xBmp, "masked bitmap", nDepth );
@@ -949,7 +949,7 @@ void TestWindow::Paint( const Rectangle& )
aAlpha.ReleaseAccess(pAcc);
}
}
-
+
xBmp.set( new VclCanvasBitmap(BitmapEx(aBitmap,aAlpha)) );
checkCanvasBitmap( xBmp, "alpha bitmap", nDepth );
diff --git a/vcl/test/dndtest.cxx b/vcl/test/dndtest.cxx
index 31d7f01b3aa8..8db6ef0a9c9c 100644
--- a/vcl/test/dndtest.cxx
+++ b/vcl/test/dndtest.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -62,7 +62,7 @@ using namespace ::com::sun::star::datatransfer::dnd;
class MyApp : public Application
{
public:
- void Main();
+ void Main();
};
MyApp aMyApp;
@@ -74,13 +74,13 @@ class MyWin : public WorkWindow
public:
MyWin( Window* pParent, WinBits nWinStyle );
- void MouseMove( const MouseEvent& rMEvt );
- void MouseButtonDown( const MouseEvent& rMEvt );
- void MouseButtonUp( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
- void KeyUp( const KeyEvent& rKEvt );
- void Paint( const Rectangle& rRect );
- void Resize();
+ void MouseMove( const MouseEvent& rMEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void MouseButtonUp( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void KeyUp( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
};
// -----------------------------------------------------------------------
@@ -103,8 +103,8 @@ public:
virtual void SAL_CALL dragEnter( const DragSourceDragEvent& dsdee ) throw(RuntimeException);
virtual void SAL_CALL dragExit( const DragSourceEvent& dse ) throw(RuntimeException);
virtual void SAL_CALL dragOver( const DragSourceDragEvent& dsde ) throw(RuntimeException);
- virtual void SAL_CALL dropActionChanged( const DragSourceDragEvent& dsde ) throw(RuntimeException);
- virtual void SAL_CALL disposing( const EventObject& eo ) throw(RuntimeException);
+ virtual void SAL_CALL dropActionChanged( const DragSourceDragEvent& dsde ) throw(RuntimeException);
+ virtual void SAL_CALL disposing( const EventObject& eo ) throw(RuntimeException);
};
// -----------------------------------------------------------------------
@@ -134,17 +134,17 @@ class StringTransferable : public ::cppu::WeakImplHelper1< XTransferable >
const OUString m_aData;
Sequence< DataFlavor > m_aFlavorList;
-public:
+public:
StringTransferable( const OUString& rString ) : m_aData( rString ), m_aFlavorList( 1 )
{
DataFlavor df;
- df.MimeType = OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=utf-16"));
+ df.MimeType = OUString::createFromAscii( "text/plain;charset=utf-16" );
df.DataType = getCppuType( static_cast < OUString * > ( 0 ) );
-
+
m_aFlavorList[0] = df;
};
-
+
virtual Any SAL_CALL getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException);
virtual Sequence< DataFlavor > SAL_CALL getTransferDataFlavors( ) throw(RuntimeException);
virtual sal_Bool SAL_CALL isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException);
@@ -163,7 +163,7 @@ void MyApp::Main()
osl_getCommandArg( n, &aArg.pData );
- if( aArg.compareTo( OUString(RTL_CONSTASCII_USTRINGPARAM("-r")), 2 ) == 0 )
+ if( aArg.compareTo( OUString::createFromAscii( "-r" ), 2 ) == 0 )
{
if ( n + 1 < nmax )
osl_getCommandArg( ++n, &aRegistry.pData );
@@ -189,7 +189,7 @@ void MyApp::Main()
}
else
fprintf( stderr, "Usage: %s -r full-path-to-applicat.rdb\n", "dnddemo" );
-
+
MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Drag And Drop - Workbench" ) ) );
@@ -210,7 +210,7 @@ void MyApp::Main()
MyListBox aListBox( &aMainWin );
aListBox.SetPosSizePixel( 10, 10, 100, 100 );
- aListBox.InsertEntry( OUString(RTL_CONSTASCII_USTRINGPARAM("TestItem")));
+ aListBox.InsertEntry( OUString::createFromAscii( "TestItem" ));
aListBox.Show();
Execute();
@@ -218,7 +218,7 @@ void MyApp::Main()
Reference< XComponent > xComponent( xServiceManager, UNO_QUERY );
if( xComponent.is() )
xComponent->dispose();
-
+
}
// -----------------------------------------------------------------------
@@ -227,9 +227,9 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
WorkWindow( pParent, nWinStyle )
{
Reference< XDropTargetListener > xListener = new MyDragAndDropListener( this );
-
+
Reference< XDropTarget > xDropTarget = GetDropTarget();
- if( xDropTarget.is() )
+ if( xDropTarget.is() )
{
xDropTarget->addDropTargetListener( xListener );
xDropTarget->setActive( sal_True );
@@ -296,7 +296,7 @@ void SAL_CALL MyDragAndDropListener::dragGestureRecognized( const DragGestureEve
printf( "XDragGestureListener::dragGestureRecognized called ( Window: %p, %"SAL_PRIdINT32", %"SAL_PRIdINT32" ).\n", m_pWindow, dge.DragOriginX, dge.DragOriginY );
Reference< XDragSource > xDragSource( dge.DragSource, UNO_QUERY );
- xDragSource->startDrag( dge, -1, 0, 0, new StringTransferable( OUString(RTL_CONSTASCII_USTRINGPARAM("TestString")) ), this );
+ xDragSource->startDrag( dge, -1, 0, 0, new StringTransferable( OUString::createFromAscii( "TestString" ) ), this );
printf( "XDragSource::startDrag returned.\n" );
}
@@ -384,13 +384,13 @@ void SAL_CALL MyDragAndDropListener::disposing( const EventObject& ) throw(Runti
// -----------------------------------------------------------------------
-MyInfoBox::MyInfoBox( Window* pParent ) : InfoBox( pParent,
- OUString(RTL_CONSTASCII_USTRINGPARAM("dragging over this box should result in another window id in the drag log.")) )
+MyInfoBox::MyInfoBox( Window* pParent ) : InfoBox( pParent,
+ OUString::createFromAscii( "dragging over this box should result in another window id in the drag log." ) )
{
Reference< XDropTargetListener > xListener = new MyDragAndDropListener( this );
-
+
Reference< XDropTarget > xDropTarget = GetDropTarget();
- if( xDropTarget.is() )
+ if( xDropTarget.is() )
{
xDropTarget->addDropTargetListener( xListener );
xDropTarget->setActive( sal_True );
@@ -406,9 +406,9 @@ MyInfoBox::MyInfoBox( Window* pParent ) : InfoBox( pParent,
MyListBox::MyListBox( Window* pParent ) : ListBox( pParent )
{
Reference< XDropTargetListener > xListener = new MyDragAndDropListener( this );
-
+
Reference< XDropTarget > xDropTarget = GetDropTarget();
- if( xDropTarget.is() )
+ if( xDropTarget.is() )
{
xDropTarget->addDropTargetListener( xListener );
xDropTarget->setActive( sal_True );
@@ -421,15 +421,15 @@ MyListBox::MyListBox( Window* pParent ) : ListBox( pParent )
// -----------------------------------------------------------------------
-Any SAL_CALL StringTransferable::getTransferData( const DataFlavor& )
+Any SAL_CALL StringTransferable::getTransferData( const DataFlavor& )
throw(UnsupportedFlavorException, IOException, RuntimeException)
-{
+{
return makeAny( m_aData );
}
// -----------------------------------------------------------------------
-Sequence< DataFlavor > SAL_CALL StringTransferable::getTransferDataFlavors( )
+Sequence< DataFlavor > SAL_CALL StringTransferable::getTransferDataFlavors( )
throw(RuntimeException)
{
return m_aFlavorList;
@@ -437,7 +437,7 @@ Sequence< DataFlavor > SAL_CALL StringTransferable::getTransferDataFlavors( )
// -----------------------------------------------------------------------
-sal_Bool SAL_CALL StringTransferable::isDataFlavorSupported( const DataFlavor& )
+sal_Bool SAL_CALL StringTransferable::isDataFlavorSupported( const DataFlavor& )
throw(RuntimeException)
{
return sal_True;
diff --git a/vcl/unx/gtk/a11y/atkaction.cxx b/vcl/unx/gtk/a11y/atkaction.cxx
index 39c51cb3b274..0b4ed3ab4023 100644
--- a/vcl/unx/gtk/a11y/atkaction.cxx
+++ b/vcl/unx/gtk/a11y/atkaction.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,7 +61,7 @@ static accessibility::XAccessibleAction*
getAction( AtkAction *action ) throw (uno::RuntimeException)
{
AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( action );
-
+
if( pWrap )
{
if( !pWrap->mpAction && pWrap->mpContext )
@@ -134,7 +134,7 @@ action_wrapper_get_name (AtkAction *action,
gint i)
{
static std::map< rtl::OUString, const gchar * > aNameMap;
-
+
if( aNameMap.empty() )
{
aNameMap.insert( ACTION_NAME_PAIR( "click", "click" ) );
@@ -147,16 +147,16 @@ action_wrapper_get_name (AtkAction *action,
if( pAction )
{
std::map< rtl::OUString, const gchar * >::iterator iter;
-
+
rtl::OUString aDesc( pAction->getAccessibleActionDescription( i ) );
-
+
iter = aNameMap.find( aDesc );
if( iter != aNameMap.end() )
return iter->second;
-
- std::pair< const rtl::OUString, const gchar * > aNewVal( aDesc,
+
+ std::pair< const rtl::OUString, const gchar * > aNewVal( aDesc,
g_strdup( OUStringToConstGChar(aDesc) ) );
-
+
if( aNameMap.insert( aNewVal ).second )
return aNewVal.second;
}
@@ -168,11 +168,11 @@ action_wrapper_get_name (AtkAction *action,
return "";
}
-/*
+/*
* GNOME Expects a string in the format:
-*
+*
* <nmemonic>;<full-path>;<accelerator>
-*
+*
* The keybindings in <full-path> should be separated by ":"
*/
@@ -187,13 +187,13 @@ appendKeyStrokes(rtl::OStringBuffer& rBuffer, const uno::Sequence< awt::KeyStrok
rBuffer.append("<Control>");
if( rKeyStrokes[i].Modifiers & awt::KeyModifier::MOD2 )
rBuffer.append("<Alt>");
-
+
if( ( rKeyStrokes[i].KeyCode >= awt::Key::A ) && ( rKeyStrokes[i].KeyCode <= awt::Key::Z ) )
rBuffer.append( (sal_Char) ( 'a' + ( rKeyStrokes[i].KeyCode - awt::Key::A ) ) );
else
{
sal_Char c = '\0';
-
+
switch( rKeyStrokes[i].KeyCode )
{
case awt::Key::TAB: c = '\t'; break;
@@ -213,7 +213,7 @@ appendKeyStrokes(rtl::OStringBuffer& rBuffer, const uno::Sequence< awt::KeyStrok
g_warning( "Unmapped KeyCode: %d", rKeyStrokes[i].KeyCode );
break;
}
-
+
if( c != '\0' )
rBuffer.append( c );
}
@@ -230,20 +230,20 @@ action_wrapper_get_keybinding (AtkAction *action,
if( pAction )
{
uno::Reference< accessibility::XAccessibleKeyBinding > xBinding( pAction->getAccessibleActionKeyBinding( i ));
-
+
if( xBinding.is() )
{
rtl::OStringBuffer aRet;
-
+
sal_Int32 nmax = std::min( xBinding->getAccessibleKeyBindingCount(), (sal_Int32) 3 );
for( sal_Int32 n = 0; n < nmax; n++ )
{
appendKeyStrokes( aRet, xBinding->getAccessibleKeyBinding( n ) );
-
+
if( n < 2 )
aRet.append( (sal_Char) ';' );
}
-
+
// !! FIXME !! remember keystroke in wrapper object ?
return getAsConst( aRet.makeStringAndClear() );
}
diff --git a/vcl/unx/gtk/a11y/atkbridge.cxx b/vcl/unx/gtk/a11y/atkbridge.cxx
index bdd6d526e527..d2c81fe8d266 100644
--- a/vcl/unx/gtk/a11y/atkbridge.cxx
+++ b/vcl/unx/gtk/a11y/atkbridge.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,16 +42,16 @@ bool InitAtkBridge(void)
const char* pVersion = atk_get_toolkit_version();
if( ! pVersion )
return false;
-
+
unsigned int major, minor, micro;
-
+
/* check gail minimum version requirements */
if( sscanf( pVersion, "%u.%u.%u", &major, &minor, &micro) < 3 )
{
// g_warning( "unable to parse gail version number" );
return false;
}
-
+
if( ( (major << 16) | (minor << 8) | micro ) < ( (1 << 16) | 8 << 8 | 6 ) )
{
g_warning( "libgail >= 1.8.6 required for accessibility support" );
@@ -60,15 +60,15 @@ bool InitAtkBridge(void)
/* Initialize the AtkUtilityWrapper class */
g_type_class_unref( g_type_class_ref( OOO_TYPE_ATK_UTIL ) );
-
+
/* Initialize the GailWindow wrapper class */
g_type_class_unref( g_type_class_ref( OOO_TYPE_WINDOW_WRAPPER ) );
-
+
/* Register AtkObject wrapper factory */
AtkRegistry * registry = atk_get_default_registry();
if( registry )
atk_registry_set_factory_type( registry, OOO_TYPE_FIXED, OOO_TYPE_WRAPPER_FACTORY );
-
+
return true;
}
diff --git a/vcl/unx/gtk/a11y/atkcomponent.cxx b/vcl/unx/gtk/a11y/atkcomponent.cxx
index 37ef152db3c9..8b6cd3b85114 100644
--- a/vcl/unx/gtk/a11y/atkcomponent.cxx
+++ b/vcl/unx/gtk/a11y/atkcomponent.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,17 +51,17 @@ static accessibility::XAccessibleComponent*
pWrap->mpComponent = reinterpret_cast< accessibility::XAccessibleComponent * > (any.pReserved);
pWrap->mpComponent->acquire();
}
-
+
return pWrap->mpComponent;
}
-
+
return NULL;
}
/*****************************************************************************/
static awt::Point
-translatePoint( accessibility::XAccessibleComponent *pComponent,
+translatePoint( accessibility::XAccessibleComponent *pComponent,
gint x, gint y, AtkCoordType t)
{
awt::Point aOrigin( 0, 0 );
@@ -69,7 +69,7 @@ translatePoint( accessibility::XAccessibleComponent *pComponent,
aOrigin = pComponent->getLocationOnScreen();
#ifdef ENABLE_TRACING
- fprintf(stderr, "coordinates ( %u, %u ) translated to: ( %u, %u )\n",
+ fprintf(stderr, "coordinates ( %u, %u ) translated to: ( %u, %u )\n",
x, y, x - aOrigin.X, y - aOrigin.Y);
#endif
@@ -96,7 +96,7 @@ component_wrapper_grab_focus (AtkComponent *component)
{
g_warning( "Exception in grabFocus()" );
}
-
+
return FALSE;
}
@@ -118,7 +118,7 @@ component_wrapper_contains (AtkComponent *component,
{
g_warning( "Exception in containsPoint()" );
}
-
+
return FALSE;
}
@@ -133,20 +133,20 @@ component_wrapper_ref_accessible_at_point (AtkComponent *component,
try
{
accessibility::XAccessibleComponent* pComponent = getComponent( component );
-
+
if( pComponent )
{
uno::Reference< accessibility::XAccessible > xAccessible;
xAccessible = pComponent->getAccessibleAtPoint(
translatePoint( pComponent, x, y, coord_type ) );
-
+
#ifdef ENABLE_TRACING
fprintf(stderr, "getAccessibleAtPoint( %u, %u ) returned %p\n",
x, y, xAccessible.get());
-
+
uno::Reference< accessibility::XAccessibleComponent > xComponent(
xAccessible->getAccessibleContext(), uno::UNO_QUERY );
-
+
if( xComponent.is() )
{
awt::Rectangle rect = xComponent->getBounds();
@@ -158,11 +158,11 @@ component_wrapper_ref_accessible_at_point (AtkComponent *component,
return atk_object_wrapper_ref( xAccessible );
}
}
- catch( const uno::Exception &e )
+ catch( const uno::Exception &e )
{
g_warning( "Exception in getAccessibleAtPoint()" );
}
-
+
return NULL;
}
@@ -180,21 +180,21 @@ component_wrapper_get_position (AtkComponent *component,
if( pComponent )
{
awt::Point aPos;
-
+
if( coord_type == ATK_XY_SCREEN )
aPos = pComponent->getLocationOnScreen();
else
aPos = pComponent->getLocation();
-
+
*x = aPos.X;
*y = aPos.Y;
-
+
#ifdef ENABLE_TRACING
fprintf(stderr, "getLocation[OnScreen]() returned: ( %u, %u )\n", *x, *y );
#endif
}
}
- catch( const uno::Exception &e )
+ catch( const uno::Exception &e )
{
g_warning( "Exception in getLocation[OnScreen]()" );
}
@@ -215,13 +215,13 @@ component_wrapper_get_size (AtkComponent *component,
awt::Size aSize = pComponent->getSize();
*width = aSize.Width;
*height = aSize.Height;
-
+
#ifdef ENABLE_TRACING
fprintf(stderr, "getSize() returned: ( %u, %u )\n", *width, *height );
#endif
}
}
- catch( const uno::Exception &e )
+ catch( const uno::Exception &e )
{
g_warning( "Exception in getSize()" );
}
@@ -275,7 +275,7 @@ component_wrapper_get_layer (AtkComponent *component)
{
AtkRole role = atk_object_get_role( ATK_OBJECT( component ) );
AtkLayer layer = ATK_LAYER_WIDGET;
-
+
switch (role)
{
case ATK_ROLE_POPUP_MENU:
@@ -292,7 +292,7 @@ component_wrapper_get_layer (AtkComponent *component)
layer = ATK_LAYER_POPUP;
}
break;
-
+
case ATK_ROLE_LIST:
{
AtkObject * parent = atk_object_get_parent( ATK_OBJECT( component ) );
@@ -300,11 +300,11 @@ component_wrapper_get_layer (AtkComponent *component)
layer = ATK_LAYER_POPUP;
}
break;
-
+
default:
;
}
-
+
return layer;
}
diff --git a/vcl/unx/gtk/a11y/atkeditabletext.cxx b/vcl/unx/gtk/a11y/atkeditabletext.cxx
index a330bc66e8ce..ac5e791d7469 100644
--- a/vcl/unx/gtk/a11y/atkeditabletext.cxx
+++ b/vcl/unx/gtk/a11y/atkeditabletext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,17 +52,17 @@ static accessibility::XAccessibleEditableText*
pWrap->mpEditableText = reinterpret_cast< accessibility::XAccessibleEditableText * > (any.pReserved);
pWrap->mpEditableText->acquire();
}
-
+
return pWrap->mpEditableText;
}
-
+
return NULL;
}
/*****************************************************************************/
-extern "C" {
+extern "C" {
static gboolean
editable_text_wrapper_set_run_attributes( AtkEditableText *text,
diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx
index 87dcdc46d679..64c02741e527 100644
--- a/vcl/unx/gtk/a11y/atkfactory.cxx
+++ b/vcl/unx/gtk/a11y/atkfactory.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,11 +40,11 @@ using namespace ::com::sun::star;
extern "C" {
/*
- * Instances of this dummy object class are returned whenever we have to
+ * Instances of this dummy object class are returned whenever we have to
* create an AtkObject, but can't touch the OOo object anymore since it
* is already disposed.
*/
-
+
static AtkStateSet *
noop_wrapper_ref_state_set( AtkObject * )
{
@@ -80,12 +80,12 @@ atk_noop_object_wrapper_get_type(void)
(GInstanceInitFunc) NULL,
NULL
} ;
-
+
type = g_type_register_static (ATK_TYPE_OBJECT, "OOoAtkNoOpObj", &typeInfo, (GTypeFlags)0) ;
}
return type;
}
-
+
AtkObject*
atk_noop_object_wrapper_new()
{
@@ -114,22 +114,22 @@ static AtkObject*
wrapper_factory_create_accessible( GObject *obj )
{
GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( obj ) );
-
+
// gail_container_real_remove_gtk tries to re-instanciate an accessible
// for a widget that is about to vanish ..
if( ! parent_widget )
return atk_noop_object_wrapper_new();
-
+
GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) );
g_return_val_if_fail( pFrame != NULL, NULL );
-
+
Window* pFrameWindow = pFrame->GetWindow();
if( pFrameWindow )
{
Window* pWindow = pFrameWindow;
// skip accessible objects already exposed by the frame objects
- if( WINDOW_BORDERWINDOW == pWindow->GetType() )
+ if( WINDOW_BORDERWINDOW == pWindow->GetType() )
pWindow = pFrameWindow->GetAccessibleChildWindow(0);
if( pWindow )
@@ -148,7 +148,7 @@ wrapper_factory_create_accessible( GObject *obj )
}
}
}
-
+
return NULL;
}
@@ -175,9 +175,9 @@ wrapper_factory_get_type (void)
t = g_type_register_static (
ATK_TYPE_OBJECT_FACTORY, "OOoAtkObjectWrapperFactory",
&tinfo, (GTypeFlags) 0);
- }
-
- return t;
+ }
+
+ return t;
}
} // extern C
diff --git a/vcl/unx/gtk/a11y/atkfactory.hxx b/vcl/unx/gtk/a11y/atkfactory.hxx
index acb7b026f3a8..b48b3d9349de 100644
--- a/vcl/unx/gtk/a11y/atkfactory.hxx
+++ b/vcl/unx/gtk/a11y/atkfactory.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,7 +34,7 @@
#define OOO_TYPE_WRAPPER_FACTORY wrapper_factory_get_type()
extern "C" {
-
+
GType wrapper_factory_get_type (void);
} // extern "C"
diff --git a/vcl/unx/gtk/a11y/atkhypertext.cxx b/vcl/unx/gtk/a11y/atkhypertext.cxx
index b2c7aca857f4..7673b05c59f0 100644
--- a/vcl/unx/gtk/a11y/atkhypertext.cxx
+++ b/vcl/unx/gtk/a11y/atkhypertext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,7 +37,7 @@
using namespace ::com::sun::star;
-
+
// ---------------------- AtkHyperlink ----------------------
typedef struct {
@@ -99,7 +99,7 @@ hyper_link_get_end_index( AtkHyperlink *pLink )
{
try {
return getHyperlink( pLink )->getEndIndex();
- }
+ }
catch(const uno::Exception& e) {
}
return -1;
@@ -109,7 +109,7 @@ hyper_link_get_start_index( AtkHyperlink *pLink )
{
try {
return getHyperlink( pLink )->getStartIndex();
- }
+ }
catch(const uno::Exception& e) {
}
return -1;
@@ -216,10 +216,10 @@ static accessibility::XAccessibleHypertext*
pWrap->mpHypertext = reinterpret_cast< accessibility::XAccessibleHypertext * > (any.pReserved);
pWrap->mpHypertext->acquire();
}
-
+
return pWrap->mpHypertext;
}
-
+
return NULL;
}
@@ -244,7 +244,7 @@ hypertext_get_link( AtkHypertext *hypertext,
catch(const uno::Exception& e) {
g_warning( "Exception in getHyperLink()" );
}
-
+
return NULL;
}
@@ -259,7 +259,7 @@ hypertext_get_n_links( AtkHypertext *hypertext )
catch(const uno::Exception& e) {
g_warning( "Exception in getHyperLinkCount()" );
}
-
+
return 0;
}
@@ -275,7 +275,7 @@ hypertext_get_link_index( AtkHypertext *hypertext,
catch(const uno::Exception& e) {
g_warning( "Exception in getHyperLinkIndex()" );
}
-
+
return 0;
}
diff --git a/vcl/unx/gtk/a11y/atkimage.cxx b/vcl/unx/gtk/a11y/atkimage.cxx
index 04263fd72906..fd5baa5d196e 100644
--- a/vcl/unx/gtk/a11y/atkimage.cxx
+++ b/vcl/unx/gtk/a11y/atkimage.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,10 +61,10 @@ static accessibility::XAccessibleImage*
pWrap->mpImage = reinterpret_cast< accessibility::XAccessibleImage * > (any.pReserved);
pWrap->mpImage->acquire();
}
-
+
return pWrap->mpImage;
}
-
+
return NULL;
}
@@ -75,13 +75,13 @@ image_get_image_description( AtkImage *image )
{
try {
accessibility::XAccessibleImage* pImage = getImage( image );
- if( pImage )
+ if( pImage )
return getAsConst( pImage->getAccessibleImageDescription() );
}
catch(const uno::Exception& e) {
g_warning( "Exception in getAccessibleImageDescription()" );
}
-
+
return NULL;
}
diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx
index 3adca0f55279..513c80aac728 100644
--- a/vcl/unx/gtk/a11y/atklistener.cxx
+++ b/vcl/unx/gtk/a11y/atklistener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/gtk/a11y/atklistener.hxx b/vcl/unx/gtk/a11y/atklistener.hxx
index dbac3599cd4b..ae3dad6c9c03 100644
--- a/vcl/unx/gtk/a11y/atklistener.hxx
+++ b/vcl/unx/gtk/a11y/atklistener.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,15 +42,15 @@ class AtkListener : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibil
{
public:
AtkListener(AtkObjectWrapper * pWrapper);
-
+
// XEventListener
- virtual void disposing( const ::com::sun::star::lang::EventObject& Source )
+ virtual void disposing( const ::com::sun::star::lang::EventObject& Source )
throw (::com::sun::star::uno::RuntimeException);
// XAccessibleEventListener
- virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+ virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
throw( ::com::sun::star::uno::RuntimeException );
-
+
AtkObjectWrapper *mpWrapper;
AccessibleVector m_aChildList;
@@ -60,20 +60,20 @@ private:
// Updates the child list held to provide the old IndexInParent on children_changed::remove
void updateChildList(::com::sun::star::accessibility::XAccessibleContext* pContext);
-
+
// Process CHILD_EVENT notifications with a new child added
void handleChildAdded(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
-
+
// Process CHILD_EVENT notifications with a child removed
void handleChildRemoved(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
-
+
// Process INVALIDATE_ALL_CHILDREN notification
void handleInvalidateChildren(
- const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);
};
#endif /* _ATK_LISTENER_HXX_ */
diff --git a/vcl/unx/gtk/a11y/atkregistry.cxx b/vcl/unx/gtk/a11y/atkregistry.cxx
index 396683e5fd8c..6f43b27cea81 100644
--- a/vcl/unx/gtk/a11y/atkregistry.cxx
+++ b/vcl/unx/gtk/a11y/atkregistry.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@ static GHashTable *uno_to_gobject = NULL;
/*****************************************************************************/
-AtkObject *
+AtkObject *
ooo_wrapper_registry_get(const Reference< XAccessible >& rxAccessible)
{
if( uno_to_gobject )
@@ -52,7 +52,7 @@ ooo_wrapper_registry_get(const Reference< XAccessible >& rxAccessible)
/*****************************************************************************/
-void
+void
ooo_wrapper_registry_add(const Reference< XAccessible >& rxAccessible, AtkObject *obj)
{
if( !uno_to_gobject )
diff --git a/vcl/unx/gtk/a11y/atkregistry.hxx b/vcl/unx/gtk/a11y/atkregistry.hxx
index b3a59b6db8d0..f9cecae3fb51 100644
--- a/vcl/unx/gtk/a11y/atkregistry.hxx
+++ b/vcl/unx/gtk/a11y/atkregistry.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/gtk/a11y/atkselection.cxx b/vcl/unx/gtk/a11y/atkselection.cxx
index 127730f0a458..6300ec4f3776 100644
--- a/vcl/unx/gtk/a11y/atkselection.cxx
+++ b/vcl/unx/gtk/a11y/atkselection.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,10 +49,10 @@ static accessibility::XAccessibleSelection*
pWrap->mpSelection = reinterpret_cast< accessibility::XAccessibleSelection * > (any.pReserved);
pWrap->mpSelection->acquire();
}
-
+
return pWrap->mpSelection;
}
-
+
return NULL;
}
@@ -73,7 +73,7 @@ selection_add_selection( AtkSelection *selection,
catch(const uno::Exception& e) {
g_warning( "Exception in selectAccessibleChild()" );
}
-
+
return FALSE;
}
@@ -91,7 +91,7 @@ selection_clear_selection( AtkSelection *selection )
catch(const uno::Exception& e) {
g_warning( "Exception in selectAccessibleChild()" );
}
-
+
return FALSE;
}
@@ -107,7 +107,7 @@ selection_ref_selection( AtkSelection *selection,
catch(const uno::Exception& e) {
g_warning( "Exception in getSelectedAccessibleChild()" );
}
-
+
return NULL;
}
@@ -122,7 +122,7 @@ selection_get_selection_count( AtkSelection *selection)
catch(const uno::Exception& e) {
g_warning( "Exception in getSelectedAccessibleChildCount()" );
}
-
+
return -1;
}
@@ -157,7 +157,7 @@ selection_remove_selection( AtkSelection *selection,
catch(const uno::Exception& e) {
g_warning( "Exception in getSelectedAccessibleChildCount()" );
}
-
+
return FALSE;
}
@@ -175,7 +175,7 @@ selection_select_all_selection( AtkSelection *selection)
catch(const uno::Exception& e) {
g_warning( "Exception in getSelectedAccessibleChildCount()" );
}
-
+
return FALSE;
}
diff --git a/vcl/unx/gtk/a11y/atktable.cxx b/vcl/unx/gtk/a11y/atktable.cxx
index dec06cd7005b..b9c41e7dc7f9 100644
--- a/vcl/unx/gtk/a11y/atktable.cxx
+++ b/vcl/unx/gtk/a11y/atktable.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,10 +45,10 @@ atk_object_wrapper_conditional_ref( const uno::Reference< accessibility::XAccess
#ifdef ENABLE_TRACING
fprintf( stderr, ": %p\n", rxAccessible.get() );
#endif
-
+
if( rxAccessible.is() )
return atk_object_wrapper_ref( rxAccessible );
-
+
return NULL;
}
@@ -80,10 +80,10 @@ static accessibility::XAccessibleTable*
pWrap->mpTable = reinterpret_cast< accessibility::XAccessibleTable * > (any.pReserved);
pWrap->mpTable->acquire();
}
-
+
return pWrap->mpTable;
}
-
+
return NULL;
}
@@ -98,20 +98,20 @@ table_wrapper_ref_at (AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
-
+
if( column >= 255 )
fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
-
+
#endif
if( pTable )
return atk_object_wrapper_conditional_ref( pTable->getAccessibleCellAt( row, column ) );
}
-
+
catch(const uno::Exception& e) {
g_warning( "Exception in getAccessibleCellAt()" );
}
@@ -128,13 +128,13 @@ table_wrapper_get_index_at (AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleIndex( %u, %u ) returns %u\n",
+ fprintf(stderr, "getAccessibleIndex( %u, %u ) returns %u\n",
row, column, pTable->getAccessibleIndex( row, column ) );
#endif
-
+
if( pTable )
return pTable->getAccessibleIndex( row, column );
}
@@ -153,13 +153,13 @@ table_wrapper_get_column_at_index (AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleColumn( %u ) returns %u\n",
+ fprintf(stderr, "getAccessibleColumn( %u ) returns %u\n",
nIndex, pTable->getAccessibleColumn( nIndex ) );
#endif
-
+
if( pTable )
return pTable->getAccessibleColumn( nIndex );
}
@@ -178,10 +178,10 @@ table_wrapper_get_row_at_index( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleRow( %u ) returns %u\n",
+ fprintf(stderr, "getAccessibleRow( %u ) returns %u\n",
nIndex, pTable->getAccessibleRow( nIndex ) );
#endif
@@ -205,7 +205,7 @@ table_wrapper_get_n_columns( AtkTable *table )
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "XAccessibleTable::getAccessibleColumnCount returns %u\n",
+ fprintf(stderr, "XAccessibleTable::getAccessibleColumnCount returns %u\n",
pTable->getAccessibleColumnCount() );
#endif
@@ -226,10 +226,10 @@ table_wrapper_get_n_rows( AtkTable *table )
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleRowCount() returns %u\n",
+ fprintf(stderr, "getAccessibleRowCount() returns %u\n",
pTable->getAccessibleRowCount() );
#endif
@@ -252,10 +252,10 @@ table_wrapper_get_column_extent_at( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleColumnExtentAt( %u, %u ) returns %u\n",
+ fprintf(stderr, "getAccessibleColumnExtentAt( %u, %u ) returns %u\n",
row, column, pTable->getAccessibleColumnExtentAt( row, column ) );
#endif
@@ -278,10 +278,10 @@ table_wrapper_get_row_extent_at( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleRowExtentAt( %u, %u ) returns %u\n",
+ fprintf(stderr, "getAccessibleRowExtentAt( %u, %u ) returns %u\n",
row, column, pTable->getAccessibleRowExtentAt( row, column ) );
#endif
@@ -302,7 +302,7 @@ table_wrapper_get_caption( AtkTable *table )
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
fprintf(stderr, "getAccessibleCaption() returns" );
@@ -311,7 +311,7 @@ table_wrapper_get_caption( AtkTable *table )
if( pTable )
return atk_object_wrapper_conditional_ref( pTable->getAccessibleCaption() );
}
-
+
catch(const uno::Exception& e) {
g_warning( "Exception in getAccessibleCaption()" );
}
@@ -330,7 +330,7 @@ table_wrapper_get_row_description( AtkTable *table,
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleRowDescription( %u ) returns %s\n",
+ fprintf(stderr, "getAccessibleRowDescription( %u ) returns %s\n",
row, getAsConst( pTable->getAccessibleRowDescription( row ) ) );
#endif
@@ -352,10 +352,10 @@ table_wrapper_get_column_description( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "getAccessibleColumnDescription( %u ) returns %s\n",
+ fprintf(stderr, "getAccessibleColumnDescription( %u ) returns %s\n",
column, getAsConst( pTable->getAccessibleColumnDescription( column ) ) );
#endif
@@ -408,7 +408,7 @@ table_wrapper_get_column_header( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
if( pTable )
{
uno::Reference< accessibility::XAccessibleTable > xColumnHeaders( pTable->getAccessibleColumnHeaders() );
@@ -439,7 +439,7 @@ table_wrapper_get_summary( AtkTable *table )
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
fprintf(stderr, "getAccessibleSummary() returns" );
@@ -447,6 +447,8 @@ table_wrapper_get_summary( AtkTable *table )
if( pTable )
{
+ // FIXME: Summary ??
+// AtkObject* summary;
return atk_object_wrapper_conditional_ref( pTable->getAccessibleSummary() );
}
}
@@ -482,12 +484,12 @@ table_wrapper_get_selected_columns( AtkTable *table,
*pSelected = NULL;
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
fprintf(stderr, "getSelectedAccessibleColumns() \n" );
#endif
-
+
if( pTable )
return convertToGIntArray( pTable->getSelectedAccessibleColumns(), pSelected );
}
@@ -507,12 +509,12 @@ table_wrapper_get_selected_rows( AtkTable *table,
*pSelected = NULL;
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
fprintf(stderr, "getSelectedAccessibleRows() \n" );
#endif
-
+
if( pTable )
return convertToGIntArray( pTable->getSelectedAccessibleRows(), pSelected );
}
@@ -531,13 +533,13 @@ table_wrapper_is_column_selected( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "isAccessibleColumnSelected( %u ) returns %s\n",
+ fprintf(stderr, "isAccessibleColumnSelected( %u ) returns %s\n",
column, pTable->isAccessibleColumnSelected( column ) ? "true" : "false" );
#endif
-
+
if( pTable )
return pTable->isAccessibleColumnSelected( column );
}
@@ -556,13 +558,13 @@ table_wrapper_is_row_selected( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "isAccessibleRowSelected( %u ) returns %s\n",
+ fprintf(stderr, "isAccessibleRowSelected( %u ) returns %s\n",
row, pTable->isAccessibleRowSelected( row ) ? "true" : "false" );
#endif
-
+
if( pTable )
return pTable->isAccessibleRowSelected( row );
}
@@ -582,13 +584,13 @@ table_wrapper_is_selected( AtkTable *table,
{
try {
accessibility::XAccessibleTable* pTable = getTable( table );
-
+
#ifdef ENABLE_TRACING
if( pTable )
- fprintf(stderr, "isAccessibleSelected( %u, %u ) returns %s\n",
+ fprintf(stderr, "isAccessibleSelected( %u, %u ) returns %s\n",
row, column, pTable->isAccessibleSelected( row , column ) ? "true" : "false" );
#endif
-
+
if( pTable )
return pTable->isAccessibleSelected( row, column );
}
@@ -689,11 +691,11 @@ tableIfaceInit (AtkTableIface *iface)
g_return_if_fail (iface != NULL);
iface->ref_at = table_wrapper_ref_at;
- iface->get_n_rows = table_wrapper_get_n_rows;
- iface->get_n_columns = table_wrapper_get_n_columns;
- iface->get_index_at = table_wrapper_get_index_at;
- iface->get_column_at_index = table_wrapper_get_column_at_index;
- iface->get_row_at_index = table_wrapper_get_row_at_index;
+ iface->get_n_rows = table_wrapper_get_n_rows;
+ iface->get_n_columns = table_wrapper_get_n_columns;
+ iface->get_index_at = table_wrapper_get_index_at;
+ iface->get_column_at_index = table_wrapper_get_column_at_index;
+ iface->get_row_at_index = table_wrapper_get_row_at_index;
iface->is_row_selected = table_wrapper_is_row_selected;
iface->is_selected = table_wrapper_is_selected;
iface->get_selected_rows = table_wrapper_get_selected_rows;
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index 1b21fa66837c..81f5669632dc 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -455,7 +455,7 @@ text_wrapper_set_caret_offset (AtkText *text,
return FALSE;
}
-// #i92232#
+// --> OD 2010-03-04 #i92232#
AtkAttributeSet*
handle_text_markup_as_run_attribute( accessibility::XAccessibleTextMarkup* pTextMarkup,
const gint nTextMarkupType,
@@ -531,6 +531,7 @@ handle_text_markup_as_run_attribute( accessibility::XAccessibleTextMarkup* pText
return pSet;
}
+// <--
static AtkAttributeSet *
text_wrapper_get_run_attributes( AtkText *text,
@@ -551,22 +552,26 @@ text_wrapper_get_run_attributes( AtkText *text,
pTextAttributes->getRunAttributes( offset, uno::Sequence< rtl::OUString > () );
pSet = attribute_set_new_from_property_values( aAttributeList, true, text );
- // #i100938#
+ // --> OD 2009-06-22 #i100938#
// - always provide start_offset and end_offset
+// if( pSet )
+ // <--
{
accessibility::TextSegment aTextSegment =
pText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN);
*start_offset = aTextSegment.SegmentStart;
- // #i100938#
+ // --> OD 2009-06-22 #i100938#
// Do _not_ increment the end_offset provide by <accessibility::TextSegment> instance
+// *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME
*end_offset = aTextSegment.SegmentEnd;
+ // <--
bOffsetsAreValid = true;
}
}
// Special handling for misspelled text
- // #i92232#
+ // --> OD 2010-03-01 #i92232#
// - add special handling for tracked changes and refactor the
// corresponding code for handling misspelled text.
accessibility::XAccessibleTextMarkup* pTextMarkup = getTextMarkup( text );
@@ -599,6 +604,7 @@ text_wrapper_get_run_attributes( AtkText *text,
com::sun::star::text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE,
offset, pSet, start_offset, end_offset );
}
+ // <--
}
catch(const uno::Exception& e){
diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index bcf880160224..2c8887c103ca 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -75,10 +75,12 @@ static AtkTextAttribute atk_text_attribute_tab_stops = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_writing_mode = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_vertical_align = ATK_TEXT_ATTR_INVALID;
static AtkTextAttribute atk_text_attribute_misspelled = ATK_TEXT_ATTR_INVALID;
-// #i92232#
+// --> OD 2010-03-01 #i92232#
static AtkTextAttribute atk_text_attribute_tracked_change = ATK_TEXT_ATTR_INVALID;
-// #i92233#
+// <--
+// --> OD 2010-03-05 #i92233#
static AtkTextAttribute atk_text_attribute_mm_to_pixel_ratio = ATK_TEXT_ATTR_INVALID;
+// <--
/*****************************************************************************/
@@ -108,8 +110,9 @@ enum ExportedAttribute
TEXT_ATTRIBUTE_STRIKETHROUGH,
TEXT_ATTRIBUTE_UNDERLINE,
TEXT_ATTRIBUTE_WEIGHT,
- // #i92233#
+ // --> OD 2010-03-05 #i92233#
TEXT_ATTRIBUTE_MM_TO_PIXEL_RATIO,
+ // <--
TEXT_ATTRIBUTE_JUSTIFICATION,
TEXT_ATTRIBUTE_BOTTOM_MARGIN,
TEXT_ATTRIBUTE_FIRST_LINE_INDENT,
@@ -174,6 +177,7 @@ get_value( const uno::Sequence< beans::PropertyValue >& rAttributeList,
#define get_bool_value( list, index ) get_value( list, index, Bool2String )
#define get_short_value( list, index ) get_value( list, index, Short2String )
+//#define get_long_value( list, index ) get_value( list, index, Long2String ) pb: not used (warning on linux)
#define get_height_value( list, index ) get_value( list, index, Float2String )
#define get_justification_value( list, index ) get_value( list, index, Adjust2Justification )
#define get_cmm_value( list, index ) get_value( list, index, CMM2UnitString )
@@ -186,6 +190,36 @@ get_value( const uno::Sequence< beans::PropertyValue >& rAttributeList,
#define get_weight_value( list, index ) get_value( list, index, Weight2String )
#define get_language_string( list, index ) get_value( list, index, Locale2String )
+/*
+static gchar*
+dump_value( const uno::Sequence< beans::PropertyValue >& rAttributeList, sal_Int32 nIndex )
+{
+ if( nIndex != -1 )
+ {
+ rtl::OString aName = rtl::OUStringToOString(rAttributeList[nIndex].Name, RTL_TEXTENCODING_UTF8);
+
+ if( rAttributeList[nIndex].Value.has<sal_Int16> () )
+ OSL_TRACE( "%s = %d (short value)", aName.getStr(),
+ rAttributeList[nIndex].Value.get<sal_Int16> () );
+
+ else if( rAttributeList[nIndex].Value.has<sal_Int8> () )
+ OSL_TRACE( "%s = %d (byte value)", aName.getStr(),
+ rAttributeList[nIndex].Value.get<sal_Int8> () );
+
+ else if( rAttributeList[nIndex].Value.has<sal_Bool> () )
+ OSL_TRACE( "%s = %s (bool value)", aName.getStr(),
+ rAttributeList[nIndex].Value.get<sal_Bool> () ? "true" : "false" );
+
+ else if( rAttributeList[nIndex].Value.has<rtl::OUString> () )
+ OSL_TRACE( "%s = %s", aName.getStr(),
+ rtl::OUStringToOString(rAttributeList[nIndex].Value.get<rtl::OUString> (),
+ RTL_TEXTENCODING_UTF8).getStr() );
+ }
+
+ return NULL;
+}
+*/
+
static inline
double toPoint(sal_Int16 n)
{
@@ -196,6 +230,14 @@ double toPoint(sal_Int16 n)
/*****************************************************************************/
+/*
+static gchar*
+NullString(const uno::Any&)
+{
+ return NULL;
+}
+*/
+
static bool
InvalidValue( uno::Any&, const gchar * )
{
@@ -224,6 +266,48 @@ String2Float( uno::Any& rAny, const gchar * value )
/*****************************************************************************/
+/*
+static gchar*
+Short2String(const uno::Any& rAny)
+{
+ return g_strdup_printf( "%d", rAny.get<sal_Int16>() );
+}
+
+static bool
+String2Short( uno::Any& rAny, const gchar * value )
+{
+ sal_Int32 lval;
+
+ if( 1 != sscanf( value, "%d", &lval ) )
+ return false;
+
+ rAny = uno::makeAny( (sal_Int16) lval );
+ return true;
+}
+*/
+
+/*****************************************************************************/
+/* pb: not used (warning on linux)
+static gchar*
+Long2String(const uno::Any& rAny)
+{
+ return g_strdup_printf( "%ld", rAny.get<sal_Int32>() );
+}
+
+static bool
+String2Long( uno::Any& rAny, const gchar * value )
+{
+ sal_Int32 lval;
+
+ if( 1 != sscanf( value, "%ld", &lval ) )
+ return false;
+
+ rAny = uno::makeAny( lval );
+ return true;
+}
+*/
+/*****************************************************************************/
+
static accessibility::XAccessibleComponent*
getComponent( AtkText *pText ) throw (uno::RuntimeException)
{
@@ -1222,12 +1306,13 @@ attribute_set_new_from_property_values(
attribute_set = attribute_set_prepend(attribute_set, atk_text_attribute_tab_stops,
get_value(rAttributeList, aIndexList[TEXT_ATTRIBUTE_TAB_STOPS], TabStops2String));
- // #i92233#
+ // --> OD 2010-03-05 #i92233#
if( ATK_TEXT_ATTR_INVALID == atk_text_attribute_mm_to_pixel_ratio )
atk_text_attribute_mm_to_pixel_ratio = atk_text_attribute_register("mm-to-pixel-ratio");
attribute_set = attribute_set_prepend( attribute_set, atk_text_attribute_mm_to_pixel_ratio,
get_value(rAttributeList, aIndexList[TEXT_ATTRIBUTE_MM_TO_PIXEL_RATIO], Float2String));
+ // <--
return attribute_set;
}
@@ -1244,7 +1329,7 @@ AtkAttributeSet* attribute_set_prepend_misspelled( AtkAttributeSet* attribute_se
return attribute_set;
}
-// #i92232#
+// --> OD 2010-03-01 #i92232#
AtkAttributeSet* attribute_set_prepend_tracked_change_insertion( AtkAttributeSet* attribute_set )
{
if ( ATK_TEXT_ATTR_INVALID == atk_text_attribute_tracked_change )
@@ -1286,6 +1371,7 @@ AtkAttributeSet* attribute_set_prepend_tracked_change_formatchange( AtkAttribute
return attribute_set;
}
+// <--
/*****************************************************************************/
diff --git a/vcl/unx/gtk/a11y/atktextattributes.hxx b/vcl/unx/gtk/a11y/atktextattributes.hxx
index 1366fb861955..6e74318e4f28 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.hxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.hxx
@@ -46,10 +46,11 @@ attribute_set_map_to_property_values(
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rValueList );
AtkAttributeSet* attribute_set_prepend_misspelled( AtkAttributeSet* attribute_set );
-// #i92232#
+// --> OD 2010-03-01 #i92232#
AtkAttributeSet* attribute_set_prepend_tracked_change_insertion( AtkAttributeSet* attribute_set );
AtkAttributeSet* attribute_set_prepend_tracked_change_deletion( AtkAttributeSet* attribute_set );
AtkAttributeSet* attribute_set_prepend_tracked_change_formatchange( AtkAttributeSet* attribute_set );
+// <--
#endif
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index f7e849e44e87..3cb121109a12 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,6 +40,7 @@
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+// --> OD 2009-04-14 #i93269#
#include <com/sun/star/accessibility/XAccessibleText.hpp>
// <--
#include <cppuhelper/implbase1.hxx>
@@ -91,7 +92,7 @@ atk_wrapper_focus_idle_handler (gpointer data)
fprintf(stderr, "notifying focus event for %p\n", atk_obj);
#endif
atk_focus_tracker_notify(atk_obj);
- // #i93269#
+ // --> OD 2009-04-14 #i93269#
// emit text_caret_moved event for <XAccessibleText> object,
// if cursor is inside the <XAccessibleText> object.
// also emit state-changed:focused event under the same condition.
@@ -118,6 +119,7 @@ atk_wrapper_focus_idle_handler (gpointer data)
}
}
}
+ // <--
g_object_unref(atk_obj);
}
}
@@ -194,12 +196,16 @@ public:
void DocumentFocusListener::disposing( const lang::EventObject& aEvent )
throw (uno::RuntimeException)
{
+// fprintf(stderr, "In DocumentFocusListener::disposing (%p)\n", this);
+// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
// Unref the object here, but do not remove as listener since the object
// might no longer be in a state that safely allows this.
if( aEvent.Source.is() )
m_aRefList.erase(aEvent.Source);
+// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
+
}
/*****************************************************************************/
@@ -236,6 +242,12 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj
break;
case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
+/* {
+ uno::Reference< accessibility::XAccessible > xAccessible( getAccessible(aEvent) );
+ detachRecursive(xAccessible);
+ attachRecursive(xAccessible);
+ }
+*/
g_warning( "Invalidate all children called\n" );
break;
default:
@@ -492,6 +504,27 @@ static void handle_toolbox_buttonchange(VclWindowEvent const *pEvent)
}
}
+/*****************************************************************************/
+
+/* currently not needed anymore...
+static void create_wrapper_for_children(Window *pWindow)
+{
+ if( pWindow && pWindow->IsReallyVisible() )
+ {
+ uno::Reference< accessibility::XAccessible > xAccessible(pWindow->GetAccessible());
+ if( xAccessible.is() )
+ {
+ uno::Reference< accessibility::XAccessibleContext > xContext(xAccessible->getAccessibleContext());
+ if( xContext.is() )
+ {
+ sal_Int32 nChildren = xContext->getAccessibleChildCount();
+ for( sal_Int32 i = 0; i < nChildren; ++i )
+ create_wrapper_for_child(xContext, i);
+ }
+ }
+ }
+}
+*/
/*****************************************************************************/
@@ -572,7 +605,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
try
{
Menu* pMenu = pEvent->GetMenu();
- sal_uInt16 nPos = pEvent->GetItemPos();
+ USHORT nPos = pEvent->GetItemPos();
if( pMenu && nPos != 0xFFFF)
{
@@ -597,30 +630,46 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
{
- try {
switch (pEvent->GetId())
{
case VCLEVENT_WINDOW_SHOW:
+// fprintf(stderr, "got VCLEVENT_WINDOW_SHOW for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_HIDE:
+// fprintf(stderr, "got VCLEVENT_WINDOW_HIDE for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_CLOSE:
+// fprintf(stderr, "got VCLEVENT_WINDOW_CLOSE for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_GETFOCUS:
handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent));
break;
case VCLEVENT_WINDOW_LOSEFOCUS:
+// fprintf(stderr, "got VCLEVENT_WINDOW_LOSEFOCUS for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_MINIMIZE:
+// fprintf(stderr, "got VCLEVENT_WINDOW_MINIMIZE for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_NORMALIZE:
+// fprintf(stderr, "got VCLEVENT_WINDOW_NORMALIZE for %p\n",
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
break;
case VCLEVENT_WINDOW_KEYINPUT:
case VCLEVENT_WINDOW_KEYUP:
case VCLEVENT_WINDOW_COMMAND:
case VCLEVENT_WINDOW_MOUSEMOVE:
break;
-
+ /*
+ fprintf(stderr, "got VCLEVENT_WINDOW_COMMAND (%d) for %p\n",
+ static_cast< ::CommandEvent const * > (
+ static_cast< ::VclWindowEvent const * >(pEvent)->GetData())->GetCommand(),
+ static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
+ */
case VCLEVENT_MENU_HIGHLIGHT:
if (const VclMenuEvent* pMenuEvent = dynamic_cast<const VclMenuEvent*>(pEvent))
{
@@ -654,7 +703,7 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
break;
case VCLEVENT_COMBOBOX_SETTEXT:
- // This looks quite strange to me. Stumbled over this when fixing #i104290#.
+ // MT 2010/02: This looks quite strange to me. Stumbled over this when fixing #i104290#.
// This kicked in when leaving the combobox in the toolbar, after that the events worked.
// I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore.
// Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general.
@@ -662,12 +711,9 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
break;
default:
+// OSL_TRACE("got event %d \n", pEvent->GetId());
break;
}
- } catch(lang::IndexOutOfBoundsException e)
- {
- g_warning("Focused object has invalid index in parent");
- }
return 0;
}
@@ -741,13 +787,13 @@ ooo_atk_util_get_type (void)
static const GTypeInfo typeInfo =
{
- static_cast<guint16>(type_query.class_size),
+ type_query.class_size,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) ooo_atk_util_class_init,
(GClassFinalizeFunc) NULL,
NULL,
- static_cast<guint16>(type_query.instance_size),
+ type_query.instance_size,
0,
(GInstanceInitFunc) NULL,
NULL
diff --git a/vcl/unx/gtk/a11y/atkutil.hxx b/vcl/unx/gtk/a11y/atkutil.hxx
index c996b955d8c1..bcf146b2fd6d 100644
--- a/vcl/unx/gtk/a11y/atkutil.hxx
+++ b/vcl/unx/gtk/a11y/atkutil.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#ifndef __ATK_UTIL_HXX__
-#define __ATK_UTIL_HXX__
+#define __ATK_UTIL_HXX__
#include <atk/atk.h>
diff --git a/vcl/unx/gtk/a11y/atkvalue.cxx b/vcl/unx/gtk/a11y/atkvalue.cxx
index 19e92cb9d3b1..0fbb6152c40a 100644
--- a/vcl/unx/gtk/a11y/atkvalue.cxx
+++ b/vcl/unx/gtk/a11y/atkvalue.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,10 +50,10 @@ static accessibility::XAccessibleValue*
pWrap->mpValue = reinterpret_cast< accessibility::XAccessibleValue * > (any.pReserved);
pWrap->mpValue->acquire();
}
-
+
return pWrap->mpValue;
}
-
+
return NULL;
}
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index 1b84026dd281..4a6b63b5084b 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
+
#include <plugins/gtk/gtkframe.hxx>
#include <vcl/window.hxx>
#include "vcl/popupmenuwindow.hxx"
@@ -46,12 +46,12 @@ extern "C" {
static void (* window_real_initialize) (AtkObject *obj, gpointer data) = NULL;
static void (* window_real_finalize) (GObject *obj) = NULL;
-
+
static void
init_from_window( AtkObject *accessible, Window *pWindow )
{
static AtkRole aDefaultRole = ATK_ROLE_INVALID;
-
+
// Special role for sub-menu and combo-box popups that are exposed directly
// by their parents already.
if( aDefaultRole == ATK_ROLE_INVALID )
@@ -73,21 +73,21 @@ init_from_window( AtkObject *accessible, Window *pWindow )
case AccessibleRole::FRAME:
role = ATK_ROLE_FRAME;
break;
-
+
/* Ignore window objects for sub-menus, combo- and list boxes,
* which are exposed as children of their parents.
*/
case AccessibleRole::WINDOW:
{
- sal_uInt16 type = WINDOW_WINDOW;
+ USHORT type = WINDOW_WINDOW;
bool parentIsMenuFloatingWindow = false;
-
+
Window *pParent = pWindow->GetParent();
if( pParent ) {
type = pParent->GetType();
parentIsMenuFloatingWindow = ( TRUE == pParent->IsMenuFloatingWindow() );
}
-
+
if( (WINDOW_LISTBOX != type) && (WINDOW_COMBOBOX != type) &&
(WINDOW_MENUBARWINDOW != type) && ! parentIsMenuFloatingWindow )
{
@@ -95,7 +95,7 @@ init_from_window( AtkObject *accessible, Window *pWindow )
}
}
break;
-
+
default:
{
Window *pChild = pWindow->GetChild( 0 );
@@ -125,10 +125,10 @@ init_from_window( AtkObject *accessible, Window *pWindow )
accessible->role = role;
}
-
-/*****************************************************************************/
-
-static gint
+
+/*****************************************************************************/
+
+static gint
ooo_window_wrapper_clear_focus(gpointer)
{
atk_focus_tracker_notify( NULL );
@@ -137,7 +137,7 @@ ooo_window_wrapper_clear_focus(gpointer)
/*****************************************************************************/
-static gboolean
+static gboolean
ooo_window_wrapper_real_focus_gtk (GtkWidget *, GdkEventFocus *)
{
g_idle_add( ooo_window_wrapper_clear_focus, NULL );
@@ -191,7 +191,7 @@ ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data)
if( pWindow )
{
init_from_window( obj, pWindow );
-
+
Reference< XAccessible > xAccessible( pWindow->GetAccessible(true) );
/* We need the wrapper object for the top-level XAccessible to be
@@ -221,11 +221,11 @@ ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data)
}
}
}
-
+
g_signal_connect_after( GTK_WIDGET( data ), "focus-out-event",
G_CALLBACK (ooo_window_wrapper_real_focus_gtk),
NULL);
-
+
if( obj->role == ATK_ROLE_TOOL_TIP )
{
g_signal_connect_after( GTK_WIDGET( data ), "map-event",
@@ -254,18 +254,18 @@ ooo_window_wrapper_class_init (AtkObjectClass *klass, gpointer)
AtkObjectClass *atk_class;
GObjectClass *gobject_class;
gpointer data;
-
- /*
+
+ /*
* Patch the gobject vtable of GailWindow to refer to our instance of
* "initialize".
*/
-
+
data = g_type_class_peek_parent( klass );
atk_class = ATK_OBJECT_CLASS (data);
-
+
window_real_initialize = atk_class->initialize;
atk_class->initialize = ooo_window_wrapper_real_initialize;
-
+
gobject_class = G_OBJECT_CLASS (data);
window_real_finalize = gobject_class->finalize;
@@ -276,7 +276,7 @@ ooo_window_wrapper_class_init (AtkObjectClass *klass, gpointer)
/*****************************************************************************/
-GType
+GType
ooo_window_wrapper_get_type (void)
{
static GType type = 0;
@@ -284,33 +284,33 @@ ooo_window_wrapper_get_type (void)
if (!type)
{
GType parent_type = g_type_from_name( "GailWindow" );
-
+
if( ! parent_type )
{
g_warning( "Unknown type: GailWindow" );
parent_type = ATK_TYPE_OBJECT;
}
-
+
GTypeQuery type_query;
g_type_query( parent_type, &type_query );
-
+
static const GTypeInfo typeInfo =
{
- static_cast<guint16>(type_query.class_size),
+ type_query.class_size,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) ooo_window_wrapper_class_init,
(GClassFinalizeFunc) NULL,
NULL,
- static_cast<guint16>(type_query.instance_size),
+ type_query.instance_size,
0,
(GInstanceInitFunc) NULL,
NULL
} ;
-
+
type = g_type_register_static (parent_type, "OOoWindowAtkObject", &typeInfo, (GTypeFlags)0) ;
}
-
+
return type;
}
@@ -320,13 +320,13 @@ void restore_gail_window_vtable (void)
gpointer data;
GType type = g_type_from_name( "GailWindow" );
-
+
if( type == G_TYPE_INVALID )
return;
-
+
data = g_type_class_peek( type );
atk_class = ATK_OBJECT_CLASS (data);
-
+
atk_class->initialize = window_real_initialize;
}
diff --git a/vcl/unx/gtk/a11y/atkwindow.hxx b/vcl/unx/gtk/a11y/atkwindow.hxx
index d0bfe41e1601..301dc8f3d218 100644
--- a/vcl/unx/gtk/a11y/atkwindow.hxx
+++ b/vcl/unx/gtk/a11y/atkwindow.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#ifndef __ATK_WINDOW_HXX__
-#define __ATK_WINDOW_HXX__
+#define __ATK_WINDOW_HXX__
#include <atk/atk.h>
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index f4e0badab1f4..3b74af8c1b54 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -397,7 +397,7 @@ wrapper_get_n_children( AtkObject *atk_obj )
n = obj->mpContext->getAccessibleChildCount();
}
catch(const uno::Exception& e) {
- OSL_FAIL("Exception in getAccessibleChildCount()" );
+ OSL_ENSURE(0, "Exception in getAccessibleChildCount()" );
}
}
@@ -429,7 +429,7 @@ wrapper_ref_child( AtkObject *atk_obj,
child = atk_object_wrapper_ref( xAccessible );
}
catch(const uno::Exception& e) {
- OSL_FAIL("Exception in getAccessibleChild");
+ OSL_ENSURE(0, "Exception in getAccessibleChild");
}
}
@@ -508,6 +508,64 @@ wrapper_ref_relation_set( AtkObject *atk_obj )
return pSet;
}
+/*****************************************************************************/
+
+#if 0
+
+#include <sal/macros.h>
+struct {
+ sal_Int16 value;
+ const sal_Char* name;
+} aStateTypeTable[] = {
+ { accessibility::AccessibleStateType::INVALID, "INVALID" },
+ { accessibility::AccessibleStateType::ACTIVE, "ACTIVE" },
+ { accessibility::AccessibleStateType::ARMED, "ARMED" },
+ { accessibility::AccessibleStateType::BUSY, "BUSY" },
+ { accessibility::AccessibleStateType::CHECKED, "CHECKED" },
+ { accessibility::AccessibleStateType::DEFUNC, "DEFUNC" },
+ { accessibility::AccessibleStateType::EDITABLE, "EDITABLE" },
+ { accessibility::AccessibleStateType::ENABLED, "ENABLED" },
+ { accessibility::AccessibleStateType::EXPANDABLE, "EXPANDABLE" },
+ { accessibility::AccessibleStateType::EXPANDED, "EXPANDED" },
+ { accessibility::AccessibleStateType::FOCUSABLE, "FOCUSABLE" },
+ { accessibility::AccessibleStateType::FOCUSED, "FOCUSED" },
+ { accessibility::AccessibleStateType::HORIZONTAL, "HORIZONTAL" },
+ { accessibility::AccessibleStateType::ICONIFIED, "ICONIFIED" },
+ { accessibility::AccessibleStateType::INDETERMINATE, "INDETERMINATE" },
+ { accessibility::AccessibleStateType::MANAGES_DESCENDANTS, "MANAGES_DESCENDANTS" },
+ { accessibility::AccessibleStateType::MODAL, "MODAL" },
+ { accessibility::AccessibleStateType::MULTI_LINE, "MULTI_LINE" },
+ { accessibility::AccessibleStateType::MULTI_SELECTABLE, "MULTI_SELECTABLE" },
+ { accessibility::AccessibleStateType::OPAQUE, "OPAQUE" },
+ { accessibility::AccessibleStateType::PRESSED, "PRESSED" },
+ { accessibility::AccessibleStateType::RESIZABLE, "RESIZABLE" },
+ { accessibility::AccessibleStateType::SELECTABLE, "SELECTABLE" },
+ { accessibility::AccessibleStateType::SELECTED, "SELECTED" },
+ { accessibility::AccessibleStateType::SENSITIVE, "SENSITIVE" },
+ { accessibility::AccessibleStateType::SHOWING, "SHOWING" },
+ { accessibility::AccessibleStateType::SINGLE_LINE, "SINGLE_LINE" },
+ { accessibility::AccessibleStateType::STALE, "STALE" },
+ { accessibility::AccessibleStateType::TRANSIENT, "TRANSIENT" },
+ { accessibility::AccessibleStateType::VERTICAL, "VERTICAL" },
+ { accessibility::AccessibleStateType::VISIBLE, "VISIBLE" }
+};
+
+static void printStates(const uno::Sequence<sal_Int16>& rStates)
+{
+ sal_Int32 n = rStates.getLength();
+ size_t nTypes = SAL_N_ELEMENTS(aStateTypeTable);
+ for (sal_Int32 i = 0; i < n; ++i)
+ {
+ for (size_t j = 0; j < nTypes; ++j)
+ {
+ if (aStateTypeTable[j].value == rStates[i])
+ printf("%s ", aStateTypeTable[j].name);
+ }
+ }
+ printf("\n");
+}
+#endif
+
static AtkStateSet *
wrapper_ref_state_set( AtkObject *atk_obj )
{
@@ -724,6 +782,8 @@ ensureTypeFor( uno::XInterface *pAccessible )
aTypeName += aTypeTable[i].name;
bTypes[i] = TRUE;
}
+// g_message( "Accessible %p has type '%s' (%d)",
+// pAccessible, aTypeTable[i].name, bTypes[i] );
}
GType nType = g_type_from_name( aTypeName );
diff --git a/vcl/unx/gtk/a11y/atkwrapper.hxx b/vcl/unx/gtk/a11y/atkwrapper.hxx
index 94a8b1981688..0433e11fa066 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -71,7 +71,7 @@ struct _AtkObjectWrapper
::com::sun::star::accessibility::XAccessibleTextMarkup *mpTextMarkup;
::com::sun::star::accessibility::XAccessibleTextAttributes *mpTextAttributes;
::com::sun::star::accessibility::XAccessibleValue *mpValue;
-
+
AtkObject *child_about_to_be_removed;
gint index_of_child_about_to_be_removed;
// ::rtl::OString * m_pKeyBindings
@@ -86,7 +86,7 @@ GType atk_object_wrapper_get_type (void) G_GNUC_CONST;
AtkObject * atk_object_wrapper_ref(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
bool create = true );
-
+
AtkObject * atk_object_wrapper_new(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
AtkObject* parent = NULL );
@@ -121,7 +121,7 @@ OUStringToGChar(const rtl::OUString& rString )
return g_strdup( aUtf8 );
}
-#define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
+#define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
#endif /* __ATK_WRAPPER_HXX__ */
diff --git a/vcl/unx/gtk/a11y/makefile.mk b/vcl/unx/gtk/a11y/makefile.mk
index 30c6d5e7cfb3..14d3014ddf11 100644
--- a/vcl/unx/gtk/a11y/makefile.mk
+++ b/vcl/unx/gtk/a11y/makefile.mk
@@ -31,6 +31,10 @@ 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 bd038cc55966..cf21f6e73ffc 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -64,10 +64,9 @@
#include <vcl/svapp.hxx>
+using namespace rtl;
using namespace vcl_sal;
-using ::rtl::OUString;
-
/***************************************************************************
* class GtkDisplay *
***************************************************************************/
@@ -204,7 +203,7 @@ void GtkSalDisplay::screenSizeChanged( GdkScreen* pScreen )
}
else
{
- OSL_FAIL( "unknown screen changed size" );
+ DBG_ERROR( "unknown screen changed size" );
}
}
}
@@ -233,7 +232,7 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
}
else
{
- OSL_FAIL( "monitors for non-default screen changed, extend-me" );
+ DBG_ERROR( "monitors for non-default screen changed, extend-me" );
}
}
}
@@ -246,15 +245,14 @@ 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)
- n = gdk_screen_get_primary_monitor(pScreen);
+ return m_aXineramaScreenIndexMap[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)
- n = sym_gdk_screen_get_primary_monitor( pScreen );
+ return m_aXineramaScreenIndexMap[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
@@ -267,9 +265,6 @@ 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
@@ -279,7 +274,7 @@ void GtkSalDisplay::initScreen( int nScreen ) const
ScreenData& rSD = const_cast<ScreenData&>(m_aScreens[nScreen]);
if( rSD.m_bInit )
return;
-
+
// choose visual for screen
SalDisplay::initScreen( nScreen );
// now set a gdk default colormap matching the chosen visual to the screen
@@ -321,17 +316,17 @@ long GtkSalDisplay::Dispatch( XEvent* pEvent )
return GDK_FILTER_CONTINUE;
}
-GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap,
- const unsigned char *pMask,
+GdkCursor* GtkSalDisplay::getFromXPM( const char *pBitmap,
+ const char *pMask,
int nWidth, int nHeight,
int nXHot, int nYHot )
{
GdkScreen *pScreen = gdk_display_get_default_screen( m_pGdkDisplay );
GdkDrawable *pDrawable = GDK_DRAWABLE( gdk_screen_get_root_window (pScreen) );
GdkBitmap *pBitmapPix = gdk_bitmap_create_from_data
- ( pDrawable, reinterpret_cast<const char*>(pBitmap), nWidth, nHeight );
+ ( pDrawable, pBitmap, nWidth, nHeight );
GdkBitmap *pMaskPix = gdk_bitmap_create_from_data
- ( pDrawable, reinterpret_cast<const char*>(pMask), nWidth, nHeight );
+ ( pDrawable, pMask, nWidth, nHeight );
GdkColormap *pColormap = gdk_drawable_get_colormap( pDrawable );
GdkColor aWhite = { 0, 0xffff, 0xffff, 0xffff };
@@ -396,7 +391,7 @@ GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle )
MAP_BUILTIN( POINTER_HSIZEBAR, GDK_SB_H_DOUBLE_ARROW );
MAP_BUILTIN( POINTER_VSIZEBAR, GDK_SB_V_DOUBLE_ARROW );
- MAP_BUILTIN( POINTER_REFHAND, GDK_HAND2 );
+ MAP_BUILTIN( POINTER_REFHAND, GDK_HAND1 );
MAP_BUILTIN( POINTER_HAND, GDK_HAND2 );
MAP_BUILTIN( POINTER_PEN, GDK_PENCIL );
@@ -523,7 +518,7 @@ class GtkXLib : public SalXLib
GtkSalDisplay *m_pGtkSalDisplay;
std::list<GSource *> m_aSources;
GSource *m_pTimeout;
- GSource *m_pUserEvent;
+ GSource *m_pUserEvent;
oslMutex m_aDispatchMutex;
oslCondition m_aDispatchCondition;
XIOErrorHandler m_aOrigGTKXIOErrorHandler;
@@ -538,12 +533,12 @@ public:
virtual void Init();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual void Insert( int fd, void* data,
- YieldFunc pending,
- YieldFunc queued,
- YieldFunc handle );
+ YieldFunc pending,
+ YieldFunc queued,
+ YieldFunc handle );
virtual void Remove( int fd );
- virtual void StartTimer( sal_uLong nMS );
+ virtual void StartTimer( ULONG nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
@@ -613,7 +608,7 @@ void GtkXLib::Init()
osl_getCommandArg(i, &aParam.pData );
OString aBParam( OUStringToOString( aParam, aEnc ) );
- if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--display" ) ) )
+ if( aParam.equalsAscii( "-display" ) || aParam.equalsAscii( "--display" ) )
{
pCmdLineAry[i+1] = g_strdup( "--display" );
osl_getCommandArg(i+1, &aParam.pData );
@@ -634,7 +629,7 @@ void GtkXLib::Init()
rtl::OString aPrgName = rtl::OUStringToOString(aAppName, aEnc);
g_set_prgname(aPrgName);
}
-
+
// init gtk/gdk
gtk_init_check( &nParams, &pCmdLineAry );
@@ -691,13 +686,13 @@ void GtkXLib::Init()
SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
XSync( pDisp, False );
- pKbdExtension->UseExtension( ! HasXErrorOccurred() );
+ pKbdExtension->UseExtension( ! HasXErrorOccured() );
PopXErrorLevel();
m_pGtkSalDisplay->SetKbdExtension( pKbdExtension );
g_signal_connect( G_OBJECT(gdk_keymap_get_default()), "keys_changed", G_CALLBACK(signalKeysChanged), m_pGtkSalDisplay );
-
+
// add signal handler to notify screen size changes
int nScreens = gdk_display_get_n_screens( pGdkDisp );
for( int n = 0; n < nScreens; n++ )
@@ -743,7 +738,7 @@ gboolean GtkXLib::timeoutFn(gpointer data)
return FALSE;
}
-void GtkXLib::StartTimer( sal_uLong nMS )
+void GtkXLib::StartTimer( ULONG nMS )
{
m_nTimeoutMS = nMS; // for restarting
@@ -761,7 +756,7 @@ void GtkXLib::StartTimer( sal_uLong nMS )
g_source_set_callback (m_pTimeout, call_timeoutFn,
(gpointer) this, NULL);
g_source_attach (m_pTimeout, g_main_context_default ());
-
+
SalXLib::StartTimer( nMS );
}
@@ -842,7 +837,7 @@ void GtkXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
* another thread in in there. Having only one yieldin thread actually dispatch
* fits the vcl event model (see e.g. the generic plugin).
*/
-
+
bool bDispatchThread = false;
gboolean wasEvent = FALSE;
{
@@ -853,7 +848,7 @@ void GtkXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
else if( ! bWait )
return; // someone else is waiting already, return
-
+
if( bDispatchThread )
{
int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index abaf97c2a00f..3eb410e0dbcd 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,8 +40,6 @@
#include <rtl/strbuf.hxx>
-#include <rtl/uri.hxx>
-
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -66,7 +64,7 @@ void GtkHookedYieldMutex::ThreadsEnter()
acquire();
if( !aYieldStack.empty() )
{ /* Previously called ThreadsLeave() */
- sal_uLong nCount = aYieldStack.front();
+ ULONG nCount = aYieldStack.front();
aYieldStack.pop_front();
while( nCount-- > 1 )
acquire();
@@ -98,7 +96,7 @@ void GtkHookedYieldMutex::release()
SalYieldMutex::release();
}
-extern "C"
+extern "C"
{
#define GET_YIELD_MUTEX() static_cast<GtkHookedYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())
static void GdkThreadsEnter( void )
@@ -163,7 +161,7 @@ extern "C"
pYieldMutex = new GtkHookedYieldMutex();
else
pYieldMutex = new GtkYieldMutex();
-
+
gdk_threads_init();
GtkInstance* pInstance = new GtkInstance( pYieldMutex );
@@ -189,25 +187,25 @@ GtkInstance::~GtkInstance()
DeInitAtkBridge();
}
-SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
+SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
{
return new GtkSalFrame( pParent, nStyle );
}
-SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong )
+SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, ULONG )
{
SalFrame* pFrame = new GtkSalFrame( pParentData );
return pFrame;
}
-SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
+SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
{
// there is no method to set a visual for a GtkWidget
// so we need the X11SalObject in that case
if( pWindowData )
return X11SalObject::CreateObject( pParent, pWindowData, bShow );
-
+
return new GtkSalObject( static_cast<GtkSalFrame*>(pParent), bShow );
}
@@ -219,34 +217,21 @@ 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, sGtkURL);
+ gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
(getDefaultFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_get_default" );
-
- static addItemFnc sym_gtk_recent_manager_add_item =
+
+ 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(), sGtkURL);
+ {
+ sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
+ rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+ }
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
@@ -322,13 +307,13 @@ sal_Bool GtkYieldMutex::tryToAcquire()
// how to we do a try_lock without having a gdk_threads_try_enter ?
if( ! g_mutex_trylock( gdk_threads_mutex ) )
return sal_False;
-
+
// obtained gdk mutex, now lock count is one by definition
SolarMutexObject::acquire();
mnCount = 1;
mnThreadId = aCurrentThread;
SolarMutexObject::release();
-
+
return sal_True;
}
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index db90edf39b99..04dc1269a04a 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,14 +53,6 @@ GtkSalSystem::~GtkSalSystem()
{
}
-// convert ~ to indicate mnemonic to '_'
-static ByteString MapToGtkAccelerator (const String &rStr)
-{
- String aRet( rStr );
- aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_"));
- return ByteString( aRet, RTL_TEXTENCODING_UTF8 );
-}
-
int GtkSalSystem::ShowNativeDialog( const String& rTitle,
const String& rMessage,
const std::list< String >& rButtons,
@@ -89,16 +81,15 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle,
int nButton = 0;
for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
+ ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 );
+
if( nButton == nDefButton )
{
- gtk_dialog_add_button( GTK_DIALOG( mainwin ), MapToGtkAccelerator(*it).GetBuffer(), nButtons );
+ gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons );
gtk_dialog_set_default_response( GTK_DIALOG( mainwin ), nButtons );
}
else
- {
- ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 );
gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons );
- }
nButtons++;
}
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 553ec6c85e0f..0dcaf0c9caa8 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -40,7 +40,7 @@
#include <cmath>
#include <vector>
#include <algorithm>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include "saldata.hxx"
#include "saldisp.hxx"
@@ -49,17 +49,18 @@
typedef struct _cairo_font_options cairo_font_options_t;
// initialize statics
-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;
+BOOL GtkSalGraphics::bThemeChanged = TRUE;
+BOOL GtkSalGraphics::bNeedPixmapPaint = FALSE;
+BOOL GtkSalGraphics::bGlobalNeedPixmapPaint = FALSE;
+BOOL GtkSalGraphics::bToolbarGripWorkaround = FALSE;
+BOOL GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = FALSE;
GtkSalGraphics::~GtkSalGraphics()
{
}
-using ::rtl::OUString;
+
+using namespace rtl;
/*************************************
* Cached native widget objects
@@ -68,23 +69,23 @@ class NWPixmapCacheList;
class NWPixmapCache;
struct NWFWidgetData
{
- GtkWidget * gCacheWindow;
- GtkWidget * gDumbContainer;
-
- GtkWidget * gBtnWidget;
- GtkWidget * gRadioWidget;
- GtkWidget * gRadioWidgetSibling;
- GtkWidget * gCheckWidget;
- GtkWidget * gScrollHorizWidget;
- GtkWidget * gScrollVertWidget;
- GtkWidget * gArrowWidget;
- GtkWidget * gDropdownWidget;
- GtkWidget * gEditBoxWidget;
- GtkWidget * gSpinButtonWidget;
- GtkWidget * gNotebookWidget;
- GtkWidget * gOptionMenuWidget;
- GtkWidget * gComboWidget;
- GtkWidget * gScrolledWindowWidget;
+ GtkWidget * gCacheWindow;
+ GtkWidget * gDumbContainer;
+
+ GtkWidget * gBtnWidget;
+ GtkWidget * gRadioWidget;
+ GtkWidget * gRadioWidgetSibling;
+ GtkWidget * gCheckWidget;
+ GtkWidget * gScrollHorizWidget;
+ GtkWidget * gScrollVertWidget;
+ GtkWidget * gArrowWidget;
+ GtkWidget * gDropdownWidget;
+ GtkWidget * gEditBoxWidget;
+ GtkWidget * gSpinButtonWidget;
+ GtkWidget * gNotebookWidget;
+ GtkWidget * gOptionMenuWidget;
+ GtkWidget * gComboWidget;
+ GtkWidget * gScrolledWindowWidget;
GtkWidget * gToolbarWidget;
GtkWidget * gToolbarButtonWidget;
GtkWidget * gToolbarToggleWidget;
@@ -101,7 +102,6 @@ struct NWFWidgetData
GtkWidget * gTreeView;
GtkWidget * gHScale;
GtkWidget * gVScale;
- GtkWidget * gVSeparator;
NWPixmapCacheList* gNWPixmapCacheList;
NWPixmapCache* gCacheTabItems;
@@ -140,7 +140,6 @@ struct NWFWidgetData
gTreeView( NULL ),
gHScale( NULL ),
gVScale( NULL ),
- gVSeparator ( NULL ),
gNWPixmapCacheList( NULL ),
gCacheTabItems( NULL ),
gCacheTabPages( NULL )
@@ -150,29 +149,29 @@ struct NWFWidgetData
// Keep a hash table of Widgets->default flags so that we can
// easily and quickly reset each to a default state before using
// them
-static boost::unordered_map<long, guint> gWidgetDefaultFlags;
+static std::hash_map<long, guint> gWidgetDefaultFlags;
static std::vector<NWFWidgetData> gWidgetData;
-static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
+static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
// Some GTK defaults
-#define MIN_ARROW_SIZE 11
-#define BTN_CHILD_SPACING 1
-#define MIN_SPIN_ARROW_WIDTH 6
-
-
-static void NWEnsureGTKRadio ( int nScreen );
-static void NWEnsureGTKButton ( int nScreen );
-static void NWEnsureGTKCheck ( int nScreen );
-static void NWEnsureGTKScrollbars ( int nScreen );
-static void NWEnsureGTKArrow ( int nScreen );
-static void NWEnsureGTKEditBox ( int nScreen );
-static void NWEnsureGTKSpinButton ( int nScreen );
-static void NWEnsureGTKNotebook ( int nScreen );
-static void NWEnsureGTKOptionMenu ( int nScreen );
-static void NWEnsureGTKCombo ( int nScreen );
-static void NWEnsureGTKScrolledWindow ( int nScreen );
-static void NWEnsureGTKToolbar ( int nScreen );
+#define MIN_ARROW_SIZE 11
+#define BTN_CHILD_SPACING 1
+#define MIN_SPIN_ARROW_WIDTH 6
+
+
+static void NWEnsureGTKRadio ( int nScreen );
+static void NWEnsureGTKButton ( int nScreen );
+static void NWEnsureGTKCheck ( int nScreen );
+static void NWEnsureGTKScrollbars ( int nScreen );
+static void NWEnsureGTKArrow ( int nScreen );
+static void NWEnsureGTKEditBox ( int nScreen );
+static void NWEnsureGTKSpinButton ( int nScreen );
+static void NWEnsureGTKNotebook ( int nScreen );
+static void NWEnsureGTKOptionMenu ( int nScreen );
+static void NWEnsureGTKCombo ( int nScreen );
+static void NWEnsureGTKScrolledWindow ( int nScreen );
+static void NWEnsureGTKToolbar ( int nScreen );
static void NWEnsureGTKMenubar ( int nScreen );
static void NWEnsureGTKMenu ( int nScreen );
static void NWEnsureGTKTooltip ( int nScreen );
@@ -231,7 +230,7 @@ static Rectangle NWGetToolbarRect( int nScreen,
const OUString& rCaption );
//---
-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
//---
/*********************************************************
@@ -269,9 +268,9 @@ public:
void SetSize( int n)
{ delete [] pData; m_idx = 0; m_size = n; pData = new NWPixmapCacheData[m_size]; }
- int GetSize() const { return m_size; }
+ int GetSize() { return m_size; }
- sal_Bool Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
+ 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 +323,7 @@ void NWPixmapCache::ThemeChanged()
pData[i].SetPixmap( NULL );
}
-sal_Bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
+BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
{
aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag
int i;
@@ -337,10 +336,10 @@ sal_Bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rec
pData[i].m_pixmap != NULL )
{
*pPixmap = pData[i].m_pixmap;
- return sal_True;
+ return TRUE;
}
}
- return sal_False;
+ return FALSE;
}
void NWPixmapCache::Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap )
@@ -384,10 +383,10 @@ void NWPixmapCacheList::ThemeChanged( )
*********************************************************/
inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc )
{
- aDst.left = pSrc->left;
- aDst.top = pSrc->top;
- aDst.right = pSrc->right;
- aDst.bottom = pSrc->bottom;
+ aDst.left = pSrc->left;
+ aDst.top = pSrc->top;
+ aDst.right = pSrc->right;
+ aDst.bottom = pSrc->bottom;
}
@@ -404,6 +403,9 @@ void GtkData::initNWF( void )
// draw separate buttons for toolbox dropdown items
pSVData->maNWFData.mbToolboxDropDownSeparate = true;
+ // small extra border around menu items
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 1;
+
// draw toolbars in separate lines
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
@@ -418,15 +420,7 @@ void GtkData::initNWF( void )
for( int i = 0; i < nScreens; i++ )
gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList;
- // small extra border around menu items
- NWEnsureGTKMenu( 0 );
- gint horizontal_padding = 1;
- gtk_widget_style_get( gWidgetData[0].gMenuItemMenuWidget,
- "horizontal_padding", &horizontal_padding,
- (char *)NULL);
- pSVData->maNWFData.mnMenuFormatExtraBorder = horizontal_padding;
-
- if( SalGetDesktopEnvironment().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) )
+ if( SalGetDesktopEnvironment().equalsAscii( "KDE" ) )
{
// #i97196# ensure a widget exists and the style engine was loaded
NWEnsureGTKButton( 0 );
@@ -485,13 +479,30 @@ void GtkSalGraphics::ResetClipRegion()
X11SalGraphics::ResetClipRegion();
}
-bool GtkSalGraphics::setClipRegion( const Region& i_rClip )
+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()
{
- m_aClipRegion = i_rClip;
- bool bRet = X11SalGraphics::setClipRegion( m_aClipRegion );
if( m_aClipRegion.IsEmpty() )
m_aClipRegion.SetNull();
- return bRet;
+ X11SalGraphics::EndSetClipRegion();
}
void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
@@ -522,59 +533,55 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
/*
* IsNativeControlSupported()
*
- * Returns sal_True if the platform supports native
+ * Returns TRUE if the platform supports native
* drawing of the control defined by nPart
*/
-sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if (
- ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
- ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
- ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
((nType==CTRL_SCROLLBAR) &&
( (nPart==PART_DRAW_BACKGROUND_HORZ)
|| (nPart==PART_DRAW_BACKGROUND_VERT)
|| (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_THREE_BUTTONS) ) ) ||
+ || (nPart==HAS_THREE_BUTTONS) ) ) ||
((nType==CTRL_EDITBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_MULTILINE_EDITBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_SPINBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_ALL_BUTTONS)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType==CTRL_SPINBUTTONS) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==PART_ALL_BUTTONS) ) ) ||
+ || (nPart==PART_ALL_BUTTONS) ) ) ||
((nType==CTRL_COMBOBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
(((nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) ||
(nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER)) &&
( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==PART_TABS_DRAW_RTL) ) ) ||
+ || (nPart==PART_TABS_DRAW_RTL) ) ) ||
((nType==CTRL_LISTBOX) &&
( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_WINDOW)
- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
((nType == CTRL_TOOLBAR) &&
- ( (nPart==PART_ENTIRE_CONTROL)
+ ( (nPart==PART_ENTIRE_CONTROL)
|| (nPart==PART_DRAW_BACKGROUND_HORZ)
|| (nPart==PART_DRAW_BACKGROUND_VERT)
|| (nPart==PART_THUMB_HORZ)
|| (nPart==PART_THUMB_VERT)
|| (nPart==PART_BUTTON)
- || (nPart==PART_SEPARATOR)
)
) ||
((nType == CTRL_MENUBAR) &&
- ( (nPart==PART_ENTIRE_CONTROL)
- || (nPart==PART_MENU_ITEM)
- )
- ) ||
+ ( (nPart==PART_ENTIRE_CONTROL) ) ) ||
((nType == CTRL_TOOLTIP) &&
( (nPart==PART_ENTIRE_CONTROL) ) ) ||
((nType == CTRL_MENU_POPUP) &&
@@ -596,25 +603,26 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
)
)
)
- return( sal_True );
- return( sal_False );
+ return( TRUE );
+
+ return( FALSE );
}
/*
* HitTestNativeControl()
*
- * bIsInside is set to sal_True if aPos is contained within the
+ * bIsInside is set to 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.
*/
-sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- const Point& aPos,
- sal_Bool& rIsInside )
+BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
+ ControlPart nPart,
+ const Rectangle& rControlRegion,
+ const Point& aPos,
+ BOOL& rIsInside )
{
if ( ( nType == CTRL_SCROLLBAR ) &&
( ( nPart == PART_BUTTON_UP ) ||
@@ -637,7 +645,7 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
Rectangle aForward;
Rectangle aBackward;
- rIsInside = sal_False;
+ rIsInside = FALSE;
ControlPart nCounterPart = 0;
if ( nPart == PART_BUTTON_UP )
@@ -696,17 +704,17 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
if ( has_forward2 )
rIsInside |= aForward.IsInside( aPos );
}
- return ( sal_True );
+ return ( TRUE );
}
if( IsNativeControlSupported(nType, nPart) )
{
rIsInside = rControlRegion.IsInside( aPos );
- return( sal_True );
+ return( TRUE );
}
else
{
- return( sal_False );
+ return( FALSE );
}
}
@@ -716,20 +724,26 @@ sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
*
* Draws the requested control described by nPart/nState.
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
-sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
+BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- sal_Bool returnVal = sal_False;
+ if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) &&
+ aValue.getTristateVal() == BUTTONVALUE_MIXED )
+ {
+ return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption );
+ }
+
+ BOOL returnVal = FALSE;
// get a GC with current clipping region set
- GetFontGC();
+ SelectFont();
// theme changed ?
@@ -739,7 +753,7 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
for( unsigned int i = 0; i < gWidgetData.size(); i++ )
if( gWidgetData[i].gNWPixmapCacheList )
gWidgetData[i].gNWPixmapCacheList->ThemeChanged();
- GtkSalGraphics::bThemeChanged = sal_False;
+ GtkSalGraphics::bThemeChanged = FALSE;
}
Rectangle aCtrlRect( rControlRegion );
@@ -766,7 +780,7 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) );
pixmap = NWGetPixmapFromScreen( aPixmapRect );
if( ! pixmap )
- return sal_False;
+ return FALSE;
gdkDrawable = GDK_DRAWABLE( pixmap );
aCtrlRect = Rectangle( Point(1,1), aCtrlRect.GetSize() );
aClip.push_back( aCtrlRect );
@@ -827,7 +841,7 @@ sal_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 = sal_True;
+ returnVal = TRUE;
else
returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption);
}
@@ -868,7 +882,7 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
else if( (nType == CTRL_LISTNET) && (nPart == PART_ENTIRE_CONTROL) )
{
// don't actually draw anything; gtk treeviews do not draw lines
- returnVal = TRUE;
+ returnVal = true;
}
else if( (nType == CTRL_SLIDER) )
{
@@ -884,41 +898,90 @@ sal_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 = { aCtrlRect.Left(), aCtrlRect.Top(), aCtrlRect.GetWidth(), 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()
*
* OPTIONAL. Draws the requested text for the control described by nPart/nState.
* Used if text not drawn by DrawNativeControl().
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
-sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
+BOOL GtkSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( sal_False );
+ return( FALSE );
}
/*
* GetNativeControlRegion()
*
- * If the return value is sal_True, rNativeBoundingRegion
- * contains the true bounding region covered by the control
+ * If the return value is 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.
*
- * rControlRegion: The bounding region of the control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * rCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * rCaption: A caption or title string (like button text etc)
*/
-sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
+BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -927,7 +990,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- sal_Bool returnVal = sal_False;
+ BOOL returnVal = FALSE;
if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)
&& (rControlRegion.GetWidth() > 16)
@@ -937,7 +1000,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
nState, aValue, rCaption );
rNativeContentRegion = rControlRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -945,7 +1008,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -954,7 +1017,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -962,19 +1025,19 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if ( (nType==CTRL_TOOLBAR) &&
- ((nPart==PART_DRAW_BACKGROUND_HORZ) ||
- (nPart==PART_DRAW_BACKGROUND_VERT) ||
- (nPart==PART_THUMB_HORZ) ||
+ ((nPart==PART_DRAW_BACKGROUND_HORZ) ||
+ (nPart==PART_DRAW_BACKGROUND_VERT) ||
+ (nPart==PART_THUMB_HORZ) ||
(nPart==PART_THUMB_VERT) ||
(nPart==PART_BUTTON)
))
{
rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
(nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) )
@@ -982,12 +1045,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion );
rNativeContentRegion = rNativeBoundingRegion;
- //See fdo#33523, possibly makes sense to do this test for all return values
- if (!rNativeContentRegion.GetWidth())
- rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1;
- if (!rNativeContentRegion.GetHeight())
- rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
-
+ returnVal = TRUE;
}
if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) )
{
@@ -999,7 +1057,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aMenuBarRect.GetWidth(), aReq.height+1 ) );
rNativeBoundingRegion = aMenuBarRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if( (nType == CTRL_MENU_POPUP) )
{
@@ -1019,7 +1077,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = sal_True;
+ returnVal = TRUE;
}
}
if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) )
@@ -1038,7 +1096,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL )
{
@@ -1052,7 +1110,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aEditRect.GetWidth(), nHeight ) );
rNativeBoundingRegion = aEditRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = sal_True;
+ returnVal = TRUE;
}
if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
{
@@ -1076,7 +1134,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
aRect.Right() = aRect.Left() + slider_width - 1;
}
rNativeBoundingRegion = rNativeContentRegion = aRect;
- returnVal = sal_True;
+ returnVal = TRUE;
}
return( returnVal );
@@ -1086,7 +1144,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
/************************************************************************
* Individual control drawing functions
************************************************************************/
-sal_Bool GtkSalGraphics::NWPaintGTKButton(
+BOOL GtkSalGraphics::NWPaintGTKButton(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -1094,16 +1152,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
ControlState nState, const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- gboolean interiorFocus;
- gint focusWidth;
- gint focusPad;
- sal_Bool bDrawFocus = sal_True;
- gint x, y, w, h;
- GtkBorder aDefBorder;
- GtkBorder* pBorder;
- GdkRectangle clipRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gboolean interiorFocus;
+ gint focusWidth;
+ gint focusPad;
+ BOOL bDrawFocus = TRUE;
+ gint x, y, w, h;
+ GtkBorder aDefBorder;
+ GtkBorder* pBorder;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -1114,10 +1172,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
h = rControlRectangle.GetHeight();
// Grab some button style attributes
- gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
- "focus-padding", &focusPad,
- "interior_focus", &interiorFocus,
- "default_border", &pBorder,
+ gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
+ "focus-padding", &focusPad,
+ "interior_focus", &interiorFocus,
+ "default_border", &pBorder,
(char *)NULL );
// Make sure the border values exist, otherwise use some defaults
@@ -1130,7 +1188,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
// If the button is too small, don't ever draw focus or grab more space
if ( (w < 16) || (h < 16) )
- bDrawFocus = sal_False;
+ bDrawFocus = FALSE;
NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
@@ -1159,7 +1217,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
clipRect.height = it->GetHeight();
// Buttons must paint opaque since some themes have alpha-channel enabled buttons
- gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base", x, y, w, h );
if ( (nState & CTRL_STATE_DEFAULT) && (GTK_BUTTON(gWidgetData[m_nScreen].gBtnWidget)->relief == GTK_RELIEF_NORMAL) )
@@ -1176,29 +1234,52 @@ sal_Bool GtkSalGraphics::NWPaintGTKButton(
&clipRect, gWidgetData[m_nScreen].gBtnWidget, "button", xi, yi, wi, hi );
}
}
+#if 0 // VCL draws focus rects
+ // Draw focus rect
+ if ( (nState & CTRL_STATE_FOCUSED) && (nState & CTRL_STATE_ENABLED) && bDrawFocus )
+ {
+ if (interiorFocus)
+ {
+ x += gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad;
+ y += gWidgetData[m_nScreen].gBtnWidget->style->ythickness + focusPad;
+ w -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
+ h -= 2 * (gWidgetData[m_nScreen].gBtnWidget->style->xthickness + focusPad);
+ }
+ else
+ {
+ x -= focusWidth + focusPad;
+ y -= focusWidth + focusPad;
+ w += 2 * (focusWidth + focusPad);
+ h += 2 * (focusWidth + focusPad);
+ }
+ if ( !interiorFocus )
+ gtk_paint_focus( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, stateType, &clipRect,
+ gWidgetData[m_nScreen].gBtnWidget, "button", x, y, w, h );
+ }
+#endif
- return( sal_True );
+ return( TRUE );
}
static Rectangle NWGetButtonArea( int nScreen,
ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
const ImplControlValue&, const OUString& )
{
- gboolean interiorFocus;
- gint focusWidth;
- gint focusPad;
- GtkBorder aDefBorder;
- GtkBorder * pBorder;
- sal_Bool bDrawFocus = sal_True;
- Rectangle aRect;
- gint x, y, w, h;
+ gboolean interiorFocus;
+ gint focusWidth;
+ gint focusPad;
+ GtkBorder aDefBorder;
+ GtkBorder * pBorder;
+ BOOL bDrawFocus = TRUE;
+ Rectangle aRect;
+ gint x, y, w, h;
NWEnsureGTKButton( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gBtnWidget,
- "focus-line-width", &focusWidth,
- "focus-padding", &focusPad,
- "interior_focus", &interiorFocus,
- "default_border", &pBorder,
+ "focus-line-width", &focusWidth,
+ "focus-padding", &focusPad,
+ "interior_focus", &interiorFocus,
+ "default_border", &pBorder,
(char *)NULL );
// Make sure the border values exist, otherwise use some defaults
@@ -1216,7 +1297,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 = sal_False;
+ bDrawFocus = FALSE;
if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
{
@@ -1233,7 +1314,7 @@ static Rectangle NWGetButtonArea( int nScreen,
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
+BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1241,11 +1322,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
gint x, y;
- GdkRectangle clipRect;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKRadio( m_nScreen );
@@ -1271,7 +1352,7 @@ sal_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 = sal_True;
+ GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE;
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked;
for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
@@ -1286,12 +1367,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( sal_True );
+ return( TRUE );
}
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
+BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1299,12 +1380,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
- bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED);
- GdkRectangle clipRect;
- gint x,y;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+ GdkRectangle clipRect;
+ gint x,y;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKCheck( m_nScreen );
@@ -1317,7 +1397,7 @@ sal_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 : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT;
+ shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
@@ -1333,7 +1413,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( sal_True );
+ return( TRUE );
}
//-------------------------------------
@@ -1349,7 +1429,7 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
) );
}
-sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
+BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -1359,32 +1439,32 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
OSL_ASSERT( aValue.getType() == CTRL_SCROLLBAR );
const ScrollbarValue* pScrollbarVal = static_cast<const ScrollbarValue *>(&aValue);
GdkPixmap* pixmap = NULL;
- Rectangle pixmapRect, scrollbarRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- GtkScrollbar * scrollbarWidget;
- GtkStyle * style;
+ Rectangle pixmapRect, scrollbarRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ GtkScrollbar * scrollbarWidget;
+ GtkStyle * style;
GtkAdjustment* scrollbarValues = NULL;
- GtkOrientation scrollbarOrientation;
- Rectangle thumbRect = pScrollbarVal->maThumbRect;
- Rectangle button11BoundRect = pScrollbarVal->maButton1Rect; // backward
- Rectangle button22BoundRect = pScrollbarVal->maButton2Rect; // forward
- Rectangle button12BoundRect = pScrollbarVal->maButton1Rect; // secondary forward
- Rectangle button21BoundRect = pScrollbarVal->maButton2Rect; // secondary backward
- GtkArrowType button1Type; // backward
- GtkArrowType button2Type; // forward
- gchar * scrollbarTagH = (gchar *) "hscrollbar";
- gchar * scrollbarTagV = (gchar *) "vscrollbar";
- gchar * scrollbarTag = NULL;
- Rectangle arrowRect;
- gint slider_width = 0;
- gint stepper_size = 0;
- gint stepper_spacing = 0;
- gint trough_border = 0;
- gint min_slider_length = 0;
- gint vShim = 0;
- gint hShim = 0;
- gint x,y,w,h;
+ GtkOrientation scrollbarOrientation;
+ Rectangle thumbRect = pScrollbarVal->maThumbRect;
+ Rectangle button11BoundRect = pScrollbarVal->maButton1Rect; // backward
+ Rectangle button22BoundRect = pScrollbarVal->maButton2Rect; // forward
+ Rectangle button12BoundRect = pScrollbarVal->maButton1Rect; // secondary forward
+ Rectangle button21BoundRect = pScrollbarVal->maButton2Rect; // secondary backward
+ GtkArrowType button1Type; // backward
+ GtkArrowType button2Type; // forward
+ gchar * scrollbarTagH = (gchar *) "hscrollbar";
+ gchar * scrollbarTagV = (gchar *) "vscrollbar";
+ gchar * scrollbarTag = NULL;
+ Rectangle arrowRect;
+ gint slider_width = 0;
+ gint stepper_size = 0;
+ gint stepper_spacing = 0;
+ gint trough_border = 0;
+ gint min_slider_length = 0;
+ gint vShim = 0;
+ gint hShim = 0;
+ gint x,y,w,h;
// make controlvalue rectangles relative to area
thumbRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() );
@@ -1404,7 +1484,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
scrollbarRect = pixmapRect;
if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
- return( sal_True );
+ return( TRUE );
// Grab some button style attributes
gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget,
@@ -1516,7 +1596,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 );
}
- sal_Bool has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
+ BOOL has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
if ( scrollbarValues == NULL )
@@ -1541,7 +1621,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// painting them directly to the window flickers
pixmap = NWGetPixmapFromScreen( pixmapRect );
if( ! pixmap )
- return sal_False;
+ return FALSE;
x = y = 0;
w = pixmapRect.GetWidth();
@@ -1555,12 +1635,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
style = GTK_WIDGET( scrollbarWidget )->style;
- gtk_style_apply_default_background( m_pWindow->style, gdkDrawable, TRUE,
- GTK_STATE_NORMAL, gdkRect,
- x, y, w, h );
-
// ----------------- TROUGH
- gtk_paint_flat_box( m_pWindow->style, gdkDrawable,
+ gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable,
GTK_STATE_NORMAL, GTK_SHADOW_NONE, gdkRect,
m_pWindow, "base", x, y,
w, h );
@@ -1591,7 +1667,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_backward )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button11BoundRect.Left(), y+vShim+button11BoundRect.Top(),
@@ -1599,14 +1675,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button11BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
if ( has_forward2 )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType,
gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button12BoundRect.Left(), y+vShim+button12BoundRect.Top(),
@@ -1614,7 +1690,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button12BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1622,7 +1698,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if ( has_backward2 )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button21BoundRect.Left(), y+vShim+button21BoundRect.Top(),
@@ -1630,14 +1706,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button21BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
if ( has_forward )
{
NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
GTK_WIDGET(scrollbarWidget), "stepper",
x+hShim+button22BoundRect.Left(), y+vShim+button22BoundRect.Top(),
@@ -1645,7 +1721,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button22BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1653,16 +1729,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( sal_False );
+ return( FALSE );
}
g_object_unref( pixmap );
- return( sal_True );
+ return( TRUE );
}
//---
-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
+static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
{
gint slider_width;
gint stepper_size;
@@ -1745,7 +1821,7 @@ static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangl
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
+BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1753,7 +1829,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
+ Rectangle pixmapRect;
GdkRectangle clipRect;
// Find the overall bounding rect of the buttons's drawing area,
@@ -1770,7 +1846,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption );
}
- return( sal_True );
+ return( TRUE );
}
@@ -1786,16 +1862,16 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen,
const ImplControlValue&,
const OUString& )
{
- Rectangle pixmapRect = aAreaRect;
- gboolean interiorFocus;
- gint focusWidth;
+ Rectangle pixmapRect = aAreaRect;
+ gboolean interiorFocus;
+ gint focusWidth;
NWEnsureGTKEditBox( nScreen );
// Grab some entry style attributes
gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget,
- "focus-line-width", &focusWidth,
- "interior-focus", &interiorFocus, (char *)NULL );
+ "focus-line-width", &focusWidth,
+ "interior-focus", &interiorFocus, (char *)NULL );
if ( !interiorFocus )
{
@@ -1812,18 +1888,18 @@ static Rectangle NWGetEditBoxPixmapRect(int nScreen,
* All coordinates should be local to the Pixmap, NOT
* screen/window coordinates.
*/
-static void NWPaintOneEditBox( int nScreen,
+static void NWPaintOneEditBox( int nScreen,
GdkDrawable * gdkDrawable,
- GdkRectangle * gdkRect,
- ControlType nType,
+ GdkRectangle * gdkRect,
+ ControlType nType,
ControlPart,
- Rectangle aEditBoxRect,
- ControlState nState,
+ Rectangle aEditBoxRect,
+ ControlState nState,
const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkWidget *widget;
NWEnsureGTKButton( nScreen );
@@ -1833,6 +1909,10 @@ static void NWPaintOneEditBox( int nScreen,
NWEnsureGTKScrolledWindow( nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+ /* border's shadowType for gtk entries is always GTK_SHADOW_IN (see gtkentry.c)
+ shadowType = GTK_SHADOW_IN;
+ */
+
switch ( nType )
{
case CTRL_SPINBOX:
@@ -1864,7 +1944,7 @@ static void NWPaintOneEditBox( int nScreen,
}
NWSetWidgetState( widget, nState, stateType );
- gtk_paint_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( pBGWidget->style, gdkDrawable, stateType, GTK_SHADOW_NONE,
gdkRect, pBGWidget, "entry_bg",
aEditBoxRect.Left(), aEditBoxRect.Top(),
aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
@@ -1879,24 +1959,24 @@ static void NWPaintOneEditBox( int nScreen,
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- GdkPixmap * pixmap;
- Rectangle pixmapRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL;
- Rectangle upBtnRect;
- ControlPart upBtnPart = PART_BUTTON_UP;
- ControlState upBtnState = CTRL_STATE_ENABLED;
- Rectangle downBtnRect;
- ControlPart downBtnPart = PART_BUTTON_DOWN;
- ControlState downBtnState = CTRL_STATE_ENABLED;
+ GdkPixmap * pixmap;
+ Rectangle pixmapRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL;
+ Rectangle upBtnRect;
+ ControlPart upBtnPart = PART_BUTTON_UP;
+ ControlState upBtnState = CTRL_STATE_ENABLED;
+ Rectangle downBtnRect;
+ ControlPart downBtnPart = PART_BUTTON_DOWN;
+ ControlState downBtnState = CTRL_STATE_ENABLED;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKSpinButton( m_nScreen );
@@ -1930,7 +2010,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
pixmap = NWGetPixmapFromScreen( pixmapRect );
if ( !pixmap )
- return( sal_False );
+ return( FALSE );
upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption );
downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption );
@@ -1951,7 +2031,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
if ( shadowType != GTK_SHADOW_NONE )
{
- Rectangle shadowRect( upBtnRect );
+ Rectangle shadowRect( upBtnRect );
shadowRect.Union( downBtnRect );
gtk_paint_box( gWidgetData[m_nScreen].gSpinButtonWidget->style, pixmap, GTK_STATE_NORMAL, shadowType, NULL,
@@ -1966,25 +2046,25 @@ sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( sal_False );
+ return( FALSE );
}
g_object_unref( pixmap );
- return( sal_True );
+ return( TRUE );
}
//---
static Rectangle NWGetSpinButtonRect( int nScreen,
ControlType,
- ControlPart nPart,
- Rectangle aAreaRect,
+ ControlPart nPart,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
{
- gint buttonSize;
- Rectangle buttonRect;
+ gint buttonSize;
+ Rectangle buttonRect;
NWEnsureGTKSpinButton( nScreen );
@@ -2018,19 +2098,19 @@ static Rectangle NWGetSpinButtonRect( int nScreen,
//---
static void NWPaintOneSpinButton( int nScreen,
- GdkPixmap* pixmap,
- ControlType nType,
- ControlPart nPart,
- Rectangle aAreaRect,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
-{
- Rectangle buttonRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- Rectangle arrowRect;
- gint arrowSize;
+ GdkPixmap* pixmap,
+ ControlType nType,
+ ControlPart nPart,
+ Rectangle aAreaRect,
+ ControlState nState,
+ const ImplControlValue& aValue,
+ const OUString& rCaption )
+{
+ Rectangle buttonRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ Rectangle arrowRect;
+ gint arrowSize;
NWEnsureGTKSpinButton( nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2053,7 +2133,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, sal_True,
+ "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE,
(arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -2061,7 +2141,7 @@ static void NWPaintOneSpinButton( int nScreen,
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
+BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2069,13 +2149,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
- Rectangle buttonRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- Rectangle arrowRect;
- gint x,y;
- GdkRectangle clipRect;
+ Rectangle pixmapRect;
+ Rectangle buttonRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ Rectangle arrowRect;
+ gint x,y;
+ GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
NWEnsureGTKArrow( m_nScreen );
@@ -2096,10 +2176,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
if( nPart == PART_BUTTON_DOWN )
buttonRect.Left() += 1;
- Rectangle aEditBoxRect( pixmapRect );
+ Rectangle aEditBoxRect( pixmapRect );
aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) );
- #define ARROW_EXTENT 0.7
+ #define ARROW_EXTENT 0.7
arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT),
(gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) );
arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2),
@@ -2117,7 +2197,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
nState, aValue, rCaption );
// Buttons must paint opaque since some themes have alpha-channel enabled buttons
- gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base",
x+(buttonRect.Left() - pixmapRect.Left()),
y+(buttonRect.Top() - pixmapRect.Top()),
@@ -2129,12 +2209,12 @@ sal_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, sal_True,
+ &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
- return( sal_True );
+ return( TRUE );
}
//----
@@ -2142,23 +2222,23 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
static Rectangle NWGetComboBoxButtonRect( int nScreen,
ControlType,
ControlPart nPart,
- Rectangle aAreaRect,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
{
- Rectangle aButtonRect;
- gint nArrowWidth;
+ Rectangle aButtonRect;
+ gint nArrowWidth;
gint nButtonWidth;
- gint nFocusWidth;
- gint nFocusPad;
+ gint nFocusWidth;
+ gint nFocusPad;
NWEnsureGTKArrow( nScreen );
// Grab some button style attributes
gtk_widget_style_get( gWidgetData[nScreen].gDropdownWidget,
- "focus-line-width", &nFocusWidth,
- "focus-padding", &nFocusPad, (char *)NULL );
+ "focus-line-width", &nFocusWidth,
+ "focus-padding", &nFocusPad, (char *)NULL );
nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gArrowWidget)->xpad * 2);
nButtonWidth = nArrowWidth +
@@ -2194,7 +2274,7 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen,
-sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
+BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -2202,11 +2282,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const OUString& )
{
OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM );
- GdkPixmap * pixmap;
- Rectangle pixmapRect;
- Rectangle tabRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GdkPixmap * pixmap;
+ Rectangle pixmapRect;
+ Rectangle tabRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
if( ! gWidgetData[ m_nScreen ].gCacheTabItems )
{
gWidgetData[ m_nScreen ].gCacheTabItems = new NWPixmapCache( m_nScreen );
@@ -2234,7 +2314,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
pixmapRect = rControlRectangle;
if ( nType == CTRL_TAB_ITEM )
{
- const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue);
+ const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue);
if ( !pTabitemValue->isFirst() )
{
// GTK+ tabs overlap on the right edge (the top tab obscures the
@@ -2258,7 +2338,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
// Allow the tab to draw a right border if needed
tabRect.Right() -= 1;
- // avoid degenerate cases which might lead to crashes
+ // #129732# avoid degenerate cases which might lead to crashes
if( tabRect.GetWidth() <= 1 || tabRect.GetHeight() <= 1 )
return false;
}
@@ -2274,6 +2354,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
return NWRenderPixmapToScreen( pixmap, pixmapRect );
}
+
+// gtk_widget_set_state( gWidgetData[m_nScreen].gNotebookWidget, stateType );
+
pixmap = gdk_pixmap_new( NULL, pixmapRect.GetWidth(), pixmapRect.GetHeight(),
GetX11SalData()->GetDisplay()->GetVisual( m_nScreen ).GetDepth() );
GdkRectangle paintRect;
@@ -2306,8 +2389,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
if ( nState & CTRL_STATE_SELECTED )
{
- gtk_paint_flat_box( m_pWindow->style, pixmap, stateType, GTK_SHADOW_NONE, NULL, m_pWindow,
- "base", 0, (pixmapRect.GetHeight() - 1), pixmapRect.GetWidth(), 1 );
+ gtk_paint_flat_box( gWidgetData[m_nScreen].gNotebookWidget->style, pixmap, stateType, GTK_SHADOW_NONE, NULL, m_pWindow,
+ (char *)"base", 0, (pixmapRect.GetHeight() - 1), pixmapRect.GetWidth(), 1 );
}
break;
@@ -2325,14 +2408,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
else
aCachePage.Fill( nType, nState, pixmapRect, pixmap );
- sal_Bool bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
+ BOOL bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
g_object_unref( pixmap );
return bSuccess;
}
//-------------------------------------
-sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
+BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2340,15 +2423,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- Rectangle pixmapRect;
- Rectangle widgetRect;
- Rectangle aIndicatorRect;
- GtkStateType stateType;
- GtkShadowType shadowType;
- gint bInteriorFocus;
- gint nFocusLineWidth;
- gint nFocusPadding;
- gint x,y;
+ Rectangle pixmapRect;
+ Rectangle widgetRect;
+ Rectangle aIndicatorRect;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gint bInteriorFocus;
+ gint nFocusLineWidth;
+ gint nFocusPadding;
+ gint x,y;
GdkRectangle clipRect;
NWEnsureGTKButton( m_nScreen );
@@ -2380,9 +2463,9 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
if ( nPart != PART_WINDOW )
{
gtk_widget_style_get( gWidgetData[m_nScreen].gOptionMenuWidget,
- "interior_focus", &bInteriorFocus,
- "focus_line_width", &nFocusLineWidth,
- "focus_padding", &nFocusPadding,
+ "interior_focus", &bInteriorFocus,
+ "focus_line_width", &nFocusLineWidth,
+ "focus_padding", &nFocusPadding,
(char *)NULL);
}
@@ -2396,7 +2479,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
if ( nPart != PART_WINDOW )
{
// Listboxes must paint opaque since some themes have alpha-channel enabled bodies
- gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
&clipRect, m_pWindow, "base", x, y,
pixmapRect.GetWidth(), pixmapRect.GetHeight() );
gtk_paint_box( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect,
@@ -2423,10 +2506,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
}
}
- return( sal_True );
+ return( TRUE );
}
-sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
+BOOL GtkSalGraphics::NWPaintGTKToolbar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2434,13 +2517,14 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
ControlState nState, const ImplControlValue& aValue,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
- gint x, y, w, h;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ gint x, y, w, h;
gint g_x=0, g_y=0, g_w=10, g_h=10;
bool bPaintButton = true;
GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget;
- GdkRectangle clipRect;
+ const gchar* pButtonDetail = "button";
+ GdkRectangle clipRect;
NWEnsureGTKToolbar( m_nScreen );
if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk
@@ -2498,18 +2582,13 @@ sal_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_ROLLOVER|CTRL_STATE_PRESSED)) )
- {
- stateType = GTK_STATE_PRELIGHT;
- shadowType = GTK_SHADOW_OUT;
- }
+ if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) )
+ stateType = GTK_STATE_ACTIVE;
+ pButtonDetail = "togglebutton";
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 );
@@ -2567,32 +2646,17 @@ sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
stateType,
shadowType,
&clipRect,
- pButtonWidget, "button", x, y, w, h );
+ pButtonWidget, pButtonDetail, x, y, w, h );
}
}
- else if(nPart == PART_SEPARATOR )
- {
- gtk_paint_vline( gWidgetData[m_nScreen].gVSeparator->style,
- gdkDrawable,
- GTK_STATE_NORMAL,
- &clipRect,
- gWidgetData[m_nScreen].gVSeparator,
- "vseparator",
- y + 4, y + h - 8 /* -2 and -4 is a dirty
- * hack, to fit most gtk
- * style, but it must be
- * fixed, FIXME */,
- x
- );
- }
}
- return( sal_True );
+ return( TRUE );
}
//----
-sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
+BOOL GtkSalGraphics::NWPaintGTKMenubar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2600,11 +2664,11 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
ControlState nState, const ImplControlValue&,
const OUString& )
{
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
NWEnsureGTKMenubar( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2640,7 +2704,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
if ( nState & CTRL_STATE_ENABLED )
GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gMenubarWidget, GTK_SENSITIVE );
- // for translucent menubar styles paint background first
+ // #118704# for translucent menubar styles paint background first
gtk_paint_flat_box( gWidgetData[m_nScreen].gMenubarWidget->style,
gdkDrawable,
GTK_STATE_NORMAL,
@@ -2658,7 +2722,6 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
"menubar",
x, y, w, h );
}
-
else if( nPart == PART_MENU_ITEM )
{
if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) )
@@ -2675,10 +2738,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
}
}
- return( sal_True );
+ return( TRUE );
}
-sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
+BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2687,16 +2750,15 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
const OUString& )
{
// #i50745# gtk does not draw disabled menu entries (and crux theme
- // 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 sal_True;
+ // even crashes), draw them using vcl functionality.
+ if( nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
+ return FALSE;
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
NWEnsureGTKMenu( m_nScreen );
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
@@ -2729,7 +2791,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
if( nPart == PART_ENTIRE_CONTROL )
{
- // for translucent menubar styles paint background first
+ // #118704# for translucent menubar styles paint background first
gtk_paint_flat_box( gWidgetData[m_nScreen].gMenuWidget->style,
gdkDrawable,
GTK_STATE_NORMAL,
@@ -2806,10 +2868,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
}
}
- return( sal_True );
+ return( TRUE );
}
-sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
+BOOL GtkSalGraphics::NWPaintGTKTooltip(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2819,8 +2881,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
{
NWEnsureGTKTooltip( m_nScreen );
- gint x, y, w, h;
- GdkRectangle clipRect;
+ gint x, y, w, h;
+ GdkRectangle clipRect;
x = rControlRectangle.Left();
y = rControlRectangle.Top();
@@ -2844,10 +2906,10 @@ sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
x, y, w, h );
}
- return( sal_True );
+ return( TRUE );
}
-sal_Bool GtkSalGraphics::NWPaintGTKListNode(
+BOOL GtkSalGraphics::NWPaintGTKListNode(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2862,12 +2924,12 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode(
aRect.Right() += 2;
aRect.Top() -= 2;
aRect.Bottom() += 2;
- gint w, h;
+ gint w, h;
w = aRect.GetWidth();
h = aRect.GetHeight();
- GtkStateType stateType;
- GtkShadowType shadowType;
+ GtkStateType stateType;
+ GtkShadowType shadowType;
NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
ButtonValue aButtonValue = rValue.getTristateVal();
@@ -2883,7 +2945,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode(
GdkPixmap* pixmap = NWGetPixmapFromScreen( aRect );
if( ! pixmap )
- return sal_False;
+ return FALSE;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
gtk_paint_expander( gWidgetData[m_nScreen].gTreeView->style,
@@ -2895,13 +2957,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKListNode(
w/2, h/2,
eStyle );
- sal_Bool bRet = NWRenderPixmapToScreen( pixmap, aRect );
+ BOOL bRet = NWRenderPixmapToScreen( pixmap, aRect );
g_object_unref( pixmap );
return bRet;
}
-sal_Bool GtkSalGraphics::NWPaintGTKProgress(
+BOOL GtkSalGraphics::NWPaintGTKProgress(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2911,7 +2973,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress(
{
NWEnsureGTKProgressBar( m_nScreen );
- gint w, h;
+ gint w, h;
w = rControlRectangle.GetWidth();
h = rControlRectangle.GetHeight();
@@ -2919,7 +2981,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress(
GdkPixmap* pixmap = NWGetPixmapFromScreen( Rectangle( Point( 0, 0 ), Size( w, h ) ) );
if( ! pixmap )
- return sal_False;
+ return FALSE;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
@@ -2959,13 +3021,13 @@ sal_Bool GtkSalGraphics::NWPaintGTKProgress(
}
}
- sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
}
-sal_Bool GtkSalGraphics::NWPaintGTKSlider(
+BOOL GtkSalGraphics::NWPaintGTKSlider(
GdkDrawable*,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2976,7 +3038,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider(
OSL_ASSERT( rValue.getType() == CTRL_SLIDER );
NWEnsureGTKSlider( m_nScreen );
- gint w, h;
+ gint w, h;
w = rControlRectangle.GetWidth();
h = rControlRectangle.GetHeight();
@@ -2984,7 +3046,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider(
GdkPixmap* pixmap = NWGetPixmapFromScreen( rControlRectangle );
if( ! pixmap )
- return sal_False;
+ return FALSE;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA)
@@ -3049,7 +3111,7 @@ sal_Bool GtkSalGraphics::NWPaintGTKSlider(
}
- sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
@@ -3068,15 +3130,15 @@ static Rectangle NWGetListBoxButtonRect( int nScreen,
Rectangle aPartRect;
GtkRequisition *pIndicatorSize = NULL;
GtkBorder *pIndicatorSpacing = NULL;
- gint width = 13; // GTK+ default
- gint right = 5; // GTK+ default
+ gint width = 13; // GTK+ default
+ gint right = 5; // GTK+ default
gint nButtonAreaWidth = 0;
gint xthickness = 0;
NWEnsureGTKOptionMenu( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
- "indicator_size", &pIndicatorSize,
+ "indicator_size", &pIndicatorSize,
"indicator_spacing",&pIndicatorSpacing, (char *)NULL);
if ( pIndicatorSize )
@@ -3122,7 +3184,7 @@ static Rectangle NWGetListBoxButtonRect( int nScreen,
static Rectangle NWGetListBoxIndicatorRect( int nScreen,
ControlType,
ControlPart,
- Rectangle aAreaRect,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -3130,14 +3192,14 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
Rectangle aIndicatorRect;
GtkRequisition *pIndicatorSize = NULL;
GtkBorder *pIndicatorSpacing = NULL;
- gint width = 13; // GTK+ default
- gint height = 13; // GTK+ default
- gint right = 5; // GTK+ default
+ gint width = 13; // GTK+ default
+ gint height = 13; // GTK+ default
+ gint right = 5; // GTK+ default
NWEnsureGTKOptionMenu( nScreen );
gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
- "indicator_size", &pIndicatorSize,
+ "indicator_size", &pIndicatorSize,
"indicator_spacing",&pIndicatorSpacing, (char *)NULL);
if ( pIndicatorSize )
@@ -3167,8 +3229,8 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
static Rectangle NWGetToolbarRect( int nScreen,
ControlType,
- ControlPart nPart,
- Rectangle aAreaRect,
+ ControlPart nPart,
+ Rectangle aAreaRect,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -3298,9 +3360,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
else
{
Color aColor2 = aStyleSet.GetLightColor();
- 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)
+ 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)
);
aStyleSet.SetCheckedColor( aCheck );
}
@@ -3336,7 +3398,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetInactiveTabColor( aSelectedBackColor );
// menu disabled entries handling
- aStyleSet.SetSkipDisabledInMenus( sal_True );
+ aStyleSet.SetSkipDisabledInMenus( TRUE );
// menu colors
GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget );
GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget );
@@ -3386,10 +3448,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
// UI font
- OString aFamily = pango_font_description_get_family( pStyle->font_desc );
- int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
- PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
- PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
+ OString aFamily = pango_font_description_get_family( pStyle->font_desc );
+ int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
+ PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
+ PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
PangoStretch eStretch = pango_font_description_get_stretch( pStyle->font_desc );
psp::FastPrintFontInfo aInfo;
@@ -3398,9 +3460,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set italic
switch( eStyle )
{
- case PANGO_STYLE_NORMAL: aInfo.m_eItalic = psp::italic::Upright;break;
- case PANGO_STYLE_ITALIC: aInfo.m_eItalic = psp::italic::Italic;break;
- case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = psp::italic::Oblique;break;
+ case PANGO_STYLE_NORMAL: aInfo.m_eItalic = psp::italic::Upright;break;
+ case PANGO_STYLE_ITALIC: aInfo.m_eItalic = psp::italic::Italic;break;
+ case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = psp::italic::Oblique;break;
}
// set weight
if( eWeight <= PANGO_WEIGHT_ULTRALIGHT )
@@ -3416,15 +3478,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// set width
switch( eStretch )
{
- case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = psp::width::UltraCondensed;break;
- case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = psp::width::ExtraCondensed;break;
- case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = psp::width::Condensed;break;
- case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = psp::width::SemiCondensed;break;
- case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = psp::width::Normal;break;
- case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = psp::width::SemiExpanded;break;
- case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = psp::width::Expanded;break;
- case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = psp::width::ExtraExpanded;break;
- case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = psp::width::UltraExpanded;break;
+ case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = psp::width::UltraCondensed;break;
+ case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = psp::width::ExtraCondensed;break;
+ case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = psp::width::Condensed;break;
+ case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = psp::width::SemiCondensed;break;
+ case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = psp::width::Normal;break;
+ case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = psp::width::SemiExpanded;break;
+ case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = psp::width::Expanded;break;
+ case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = psp::width::ExtraExpanded;break;
+ case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = psp::width::UltraExpanded;break;
}
#if OSL_DEBUG_LEVEL > 1
@@ -3519,11 +3581,12 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetPreferredSymbolsStyleName( OUString::createFromAscii( pIconThemeName ) );
g_free( pIconThemeName );
- aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
+ aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
const cairo_font_options_t* pNewOptions = NULL;
if( GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ) )
{
+//#if !GTK_CHECK_VERSION(2,8,1)
#if !GTK_CHECK_VERSION(2,9,0)
static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) =
(cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" );
@@ -3589,8 +3652,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
{
// Create a new pixmap to hold the composite of the window background and the control
- GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
- GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
+ GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
+ GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
if( !pPixmap || !pPixmapGC )
{
@@ -3622,18 +3685,17 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
* Copy an alpha pixmap to screen using a gc with clipping
************************************************************************/
-sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
+BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
{
// The GC can't be null, otherwise we'd have no clip region
- GC aFontGC = GetFontGC();
- if( aFontGC == NULL )
+ if( SelectFont() == NULL )
{
std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" );
- return( sal_False );
+ return( FALSE );
}
if ( !pPixmap )
- return( sal_False );
+ return( FALSE );
// Copy the background of the screen into a composite pixmap
CopyScreenArea( GetXDisplay(),
@@ -3641,10 +3703,10 @@ sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle d
gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ),
gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ),
GetDrawable(), m_nScreen, GetVisual().GetDepth(),
- aFontGC,
+ SelectFont(),
0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() );
- return( sal_True );
+ return( TRUE );
}
@@ -3891,8 +3953,6 @@ static void NWEnsureGTKToolbar( int nScreen )
NWAddWidgetToCacheWindow( gWidgetData[nScreen].gToolbarWidget, nScreen );
gWidgetData[nScreen].gToolbarButtonWidget = gtk_button_new();
gWidgetData[nScreen].gToolbarToggleWidget = gtk_toggle_button_new();
- gWidgetData[nScreen].gVSeparator = gtk_vseparator_new();
- NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVSeparator, nScreen );
GtkReliefStyle aRelief = GTK_RELIEF_NORMAL;
gtk_widget_ensure_style( gWidgetData[nScreen].gToolbarWidget );
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 2ae761aaa1a4..3061ae0081c5 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -85,9 +85,9 @@ using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
-static sal_uInt16 GetKeyModCode( guint state )
+static USHORT GetKeyModCode( guint state )
{
- sal_uInt16 nCode = 0;
+ USHORT nCode = 0;
if( (state & GDK_SHIFT_MASK) )
nCode |= KEY_SHIFT;
if( (state & GDK_CONTROL_MASK) )
@@ -102,9 +102,9 @@ static sal_uInt16 GetKeyModCode( guint state )
return nCode;
}
-static sal_uInt16 GetMouseModCode( guint state )
+static USHORT GetMouseModCode( guint state )
{
- sal_uInt16 nCode = GetKeyModCode( state );
+ USHORT nCode = GetKeyModCode( state );
if( (state & GDK_BUTTON1_MASK) )
nCode |= MOUSE_LEFT;
if( (state & GDK_BUTTON2_MASK) )
@@ -115,9 +115,9 @@ static sal_uInt16 GetMouseModCode( guint state )
return nCode;
}
-static sal_uInt16 GetKeyCode( guint keyval )
+static USHORT GetKeyCode( guint keyval )
{
- sal_uInt16 nCode = 0;
+ USHORT 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 )
@@ -158,61 +158,61 @@ static sal_uInt16 GetKeyCode( guint keyval )
switch( keyval )
{
case GDK_KP_Down:
- case GDK_Down: nCode = KEY_DOWN; break;
+ case GDK_Down: nCode = KEY_DOWN; break;
case GDK_KP_Up:
- case GDK_Up: nCode = KEY_UP; break;
+ case GDK_Up: nCode = KEY_UP; break;
case GDK_KP_Left:
- case GDK_Left: nCode = KEY_LEFT; break;
+ case GDK_Left: nCode = KEY_LEFT; break;
case GDK_KP_Right:
- case GDK_Right: nCode = KEY_RIGHT; break;
+ case GDK_Right: nCode = KEY_RIGHT; break;
case GDK_KP_Begin:
case GDK_KP_Home:
case GDK_Begin:
- case GDK_Home: nCode = KEY_HOME; break;
+ case GDK_Home: nCode = KEY_HOME; break;
case GDK_KP_End:
- case GDK_End: nCode = KEY_END; break;
+ case GDK_End: nCode = KEY_END; break;
case GDK_KP_Page_Up:
- case GDK_Page_Up: nCode = KEY_PAGEUP; break;
+ case GDK_Page_Up: nCode = KEY_PAGEUP; break;
case GDK_KP_Page_Down:
- case GDK_Page_Down: nCode = KEY_PAGEDOWN; break;
+ case GDK_Page_Down: nCode = KEY_PAGEDOWN; break;
case GDK_KP_Enter:
- case GDK_Return: nCode = KEY_RETURN; break;
- case GDK_Escape: nCode = KEY_ESCAPE; break;
+ case GDK_Return: nCode = KEY_RETURN; break;
+ case GDK_Escape: nCode = KEY_ESCAPE; break;
case GDK_ISO_Left_Tab:
case GDK_KP_Tab:
- case GDK_Tab: nCode = KEY_TAB; break;
- case GDK_BackSpace: nCode = KEY_BACKSPACE; break;
+ case GDK_Tab: nCode = KEY_TAB; break;
+ case GDK_BackSpace: nCode = KEY_BACKSPACE; break;
case GDK_KP_Space:
- case GDK_space: nCode = KEY_SPACE; break;
+ case GDK_space: nCode = KEY_SPACE; break;
case GDK_KP_Insert:
- case GDK_Insert: nCode = KEY_INSERT; break;
+ case GDK_Insert: nCode = KEY_INSERT; break;
case GDK_KP_Delete:
- case GDK_Delete: nCode = KEY_DELETE; break;
+ case GDK_Delete: nCode = KEY_DELETE; break;
case GDK_plus:
- case GDK_KP_Add: nCode = KEY_ADD; break;
+ case GDK_KP_Add: nCode = KEY_ADD; break;
case GDK_minus:
- case GDK_KP_Subtract: nCode = KEY_SUBTRACT; break;
+ case GDK_KP_Subtract: nCode = KEY_SUBTRACT; break;
case GDK_asterisk:
- case GDK_KP_Multiply: nCode = KEY_MULTIPLY; break;
+ case GDK_KP_Multiply: nCode = KEY_MULTIPLY; break;
case GDK_slash:
- case GDK_KP_Divide: nCode = KEY_DIVIDE; break;
+ case GDK_KP_Divide: nCode = KEY_DIVIDE; break;
case GDK_period:
- case GDK_decimalpoint: nCode = KEY_POINT; break;
- case GDK_comma: nCode = KEY_COMMA; break;
- case GDK_less: nCode = KEY_LESS; break;
- case GDK_greater: nCode = KEY_GREATER; break;
+ case GDK_decimalpoint: nCode = KEY_POINT; break;
+ case GDK_comma: nCode = KEY_COMMA; break;
+ case GDK_less: nCode = KEY_LESS; break;
+ case GDK_greater: nCode = KEY_GREATER; break;
case GDK_KP_Equal:
- case GDK_equal: nCode = KEY_EQUAL; break;
- case GDK_Find: nCode = KEY_FIND; break;
- case GDK_Menu: nCode = KEY_CONTEXTMENU;break;
- case GDK_Help: nCode = KEY_HELP; break;
- case GDK_Undo: nCode = KEY_UNDO; break;
+ case GDK_equal: nCode = KEY_EQUAL; break;
+ case GDK_Find: nCode = KEY_FIND; break;
+ case GDK_Menu: nCode = KEY_CONTEXTMENU;break;
+ case GDK_Help: nCode = KEY_HELP; break;
+ case GDK_Undo: nCode = KEY_UNDO; break;
case GDK_Redo: nCode = KEY_REPEAT; break;
case GDK_KP_Decimal:
- case GDK_KP_Separator: nCode = KEY_DECIMAL; break;
- case GDK_asciitilde: nCode = KEY_TILDE; break;
+ case GDK_KP_Separator: nCode = KEY_DECIMAL; break;
+ case GDK_asciitilde: nCode = KEY_TILDE; break;
case GDK_leftsinglequotemark:
- case GDK_quoteleft: nCode = KEY_QUOTELEFT; break;
+ case GDK_quoteleft: nCode = KEY_QUOTELEFT; break;
case GDK_bracketleft: nCode = KEY_BRACKETLEFT; break;
case GDK_bracketright: nCode = KEY_BRACKETRIGHT; break;
case GDK_semicolon: nCode = KEY_SEMICOLON; break;
@@ -302,14 +302,14 @@ static sal_uInt16 GetKeyCode( guint keyval )
// in the independent part.
struct KeyAlternate
{
- sal_uInt16 nKeyCode;
- sal_Unicode nCharCode;
+ USHORT nKeyCode;
+ sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const sal_uInt16 nKeyCode )
+GetAlternateKeyCode( const USHORT nKeyCode )
{
KeyAlternate aAlternate;
@@ -334,10 +334,10 @@ void GtkSalFrame::doKeyCallback( guint state,
{
SalKeyEvent aEvent;
- aEvent.mnTime = time;
- aEvent.mnCharCode = aOrigCode;
- aEvent.mnRepeat = 0;
-
+ aEvent.mnTime = time;
+ aEvent.mnCharCode = aOrigCode;
+ aEvent.mnRepeat = 0;
+
vcl::DeletionListener aDel( this );
/* #i42122# translate all keys with Ctrl and/or Alt to group 0
* else shortcuts (e.g. Ctrl-o) will not work but be inserted by
@@ -363,11 +363,11 @@ void GtkSalFrame::doKeyCallback( guint state,
&level,
&consumed ) )
{
- aEvent.mnCode = GetKeyCode( updated_keyval );
+ aEvent.mnCode = GetKeyCode( updated_keyval );
}
}
- aEvent.mnCode |= GetKeyModCode( state );
-
+ aEvent.mnCode |= GetKeyModCode( state );
+
if( bDown )
{
bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent );
@@ -397,12 +397,12 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder()
delete pGraphics;
}
-GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle )
+GtkSalFrame::GtkSalFrame( SalFrame* pParent, ULONG nStyle )
{
m_nScreen = getDisplay()->GetDefaultScreenNumber();
getDisplay()->registerFrame( this );
- m_bDefaultPos = true;
- m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent );
+ m_bDefaultPos = true;
+ m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent );
m_bWindowIsGtkPlug = false;
Init( pParent, nStyle );
}
@@ -412,8 +412,8 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
m_nScreen = getDisplay()->GetDefaultScreenNumber();
getDisplay()->registerFrame( this );
getDisplay()->setHaveSystemChildFrame();
- m_bDefaultPos = true;
- m_bDefaultSize = true;
+ m_bDefaultPos = true;
+ m_bDefaultSize = true;
Init( pSysData );
}
@@ -429,9 +429,9 @@ GtkSalFrame::~GtkSalFrame()
if( m_pParent )
m_pParent->m_aChildren.remove( this );
-
+
getDisplay()->deregisterFrame( this );
-
+
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -479,13 +479,13 @@ void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
else if( ! isChild( true, false ) )
gtk_window_resize( GTK_WINDOW(m_pWindow), nWidth, nHeight );
}
-
+
/*
* Always use a sub-class of GtkFixed we can tag for a11y. This allows us to
- * utilize GAIL for the toplevel window and toolkit implementation incl.
+ * utilize GAIL for the toplevel window and toolkit implementation incl.
* key event listener support ..
*/
-
+
GType
ooo_fixed_get_type()
{
@@ -506,11 +506,11 @@ ooo_fixed_get_type()
NULL /* value table */
};
- type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed",
+ type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed",
&tinfo, (GTypeFlags) 0);
}
- return type;
+ return type;
}
void GtkSalFrame::updateScreenNumber()
@@ -560,10 +560,10 @@ void GtkSalFrame::InitCommon()
m_pCurrentCursor = NULL;
m_nKeyModifiers = 0;
m_bFullscreen = false;
- m_nState = GDK_WINDOW_STATE_WITHDRAWN;
- m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED;
+ m_nState = GDK_WINDOW_STATE_WITHDRAWN;
+ m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED;
m_bSendModChangeOnRelease = false;
- m_pIMHandler = NULL;
+ m_pIMHandler = NULL;
m_hBackgroundPixmap = None;
m_nSavedScreenSaverTimeout = 0;
m_nGSMCookie = 0;
@@ -571,8 +571,8 @@ void GtkSalFrame::InitCommon()
m_pRegion = NULL;
m_ePointerStyle = 0xffff;
m_bSetFocusOnMap = false;
-
- gtk_widget_set_app_paintable( m_pWindow, sal_True );
+
+ gtk_widget_set_app_paintable( m_pWindow, TRUE );
gtk_widget_set_double_buffered( m_pWindow, FALSE );
gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE );
gtk_widget_add_events( m_pWindow,
@@ -585,7 +585,7 @@ void GtkSalFrame::InitCommon()
// fixed is needed since we have to position plugin windows
m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL ));
gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) );
-
+
// show the widgets
gtk_widget_show( GTK_WIDGET(m_pFixedContainer) );
@@ -594,42 +594,42 @@ void GtkSalFrame::InitCommon()
//system data
SalDisplay* pDisp = GetX11SalData()->GetDisplay();
- m_aSystemData.nSize = sizeof( SystemChildData );
- m_aSystemData.pDisplay = pDisp->GetDisplay();
- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
- m_aSystemData.pSalFrame = this;
- m_aSystemData.pWidget = m_pWindow;
- m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
- m_aSystemData.nScreen = m_nScreen;
- m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth();
- m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap();
- m_aSystemData.pAppContext = NULL;
- m_aSystemData.aShellWindow = m_aSystemData.aWindow;
- m_aSystemData.pShellWidget = m_aSystemData.pWidget;
+ m_aSystemData.nSize = sizeof( SystemChildData );
+ m_aSystemData.pDisplay = pDisp->GetDisplay();
+ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
+ m_aSystemData.pSalFrame = this;
+ m_aSystemData.pWidget = m_pWindow;
+ m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
+ m_aSystemData.nScreen = m_nScreen;
+ m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth();
+ m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap();
+ m_aSystemData.pAppContext = NULL;
+ m_aSystemData.aShellWindow = m_aSystemData.aWindow;
+ m_aSystemData.pShellWidget = m_aSystemData.pWidget;
// fake an initial geometry, gets updated via configure event or SetPosSize
if( m_bDefaultPos || m_bDefaultSize )
{
Size aDefSize = calcDefaultSize();
- maGeometry.nX = -1;
- maGeometry.nY = -1;
- maGeometry.nWidth = aDefSize.Width();
- maGeometry.nHeight = aDefSize.Height();
+ maGeometry.nX = -1;
+ maGeometry.nY = -1;
+ maGeometry.nWidth = aDefSize.Width();
+ maGeometry.nHeight = aDefSize.Height();
if( m_pParent )
{
// approximation
- maGeometry.nTopDecoration = m_pParent->maGeometry.nTopDecoration;
- maGeometry.nBottomDecoration = m_pParent->maGeometry.nBottomDecoration;
- maGeometry.nLeftDecoration = m_pParent->maGeometry.nLeftDecoration;
- maGeometry.nRightDecoration = m_pParent->maGeometry.nRightDecoration;
+ maGeometry.nTopDecoration = m_pParent->maGeometry.nTopDecoration;
+ maGeometry.nBottomDecoration = m_pParent->maGeometry.nBottomDecoration;
+ maGeometry.nLeftDecoration = m_pParent->maGeometry.nLeftDecoration;
+ maGeometry.nRightDecoration = m_pParent->maGeometry.nRightDecoration;
}
else
{
- maGeometry.nTopDecoration = 0;
- maGeometry.nBottomDecoration = 0;
- maGeometry.nLeftDecoration = 0;
- maGeometry.nRightDecoration = 0;
+ maGeometry.nTopDecoration = 0;
+ maGeometry.nBottomDecoration = 0;
+ maGeometry.nLeftDecoration = 0;
+ maGeometry.nRightDecoration = 0;
}
}
else
@@ -664,7 +664,7 @@ extern "C" {
typedef void(*setAcceptFn)( GtkWindow*, gboolean );
static setAcceptFn p_gtk_window_set_accept_focus = NULL;
static bool bGetAcceptFocusFn = true;
-
+
typedef void(*setUserTimeFn)( GdkWindow*, guint32 );
static setUserTimeFn p_gdk_x11_window_set_user_time = NULL;
static bool bGetSetUserTimeFn = true;
@@ -749,7 +749,7 @@ static void lcl_set_user_time( GdkWindow* i_pWindow, guint32 i_nTime )
{
XChangeProperty( pDisplay, aWindow,
nUserTime, XA_CARDINAL, 32,
- PropModeReplace, (unsigned char*)&i_nTime, 1 );
+ PropModeReplace, (unsigned char*)&i_nTime, 1 );
}
}
};
@@ -759,7 +759,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow )
return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" );
}
-void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
+void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
{
if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style
{
@@ -815,7 +815,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
bool bNoDecor = ! (nStyle & (SAL_FRAME_STYLE_MOVEABLE | SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_CLOSEABLE ) );
GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL;
if( (nStyle & SAL_FRAME_STYLE_DIALOG) && m_pParent != 0 )
- eType = GDK_WINDOW_TYPE_HINT_DIALOG;
+ eType = GDK_WINDOW_TYPE_HINT_DIALOG;
if( (nStyle & SAL_FRAME_STYLE_INTRO) )
{
gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" );
@@ -829,21 +829,21 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, true );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
bNoDecor = true;
}
else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
{
eType = GDK_WINDOW_TYPE_HINT_UTILITY;
}
-
+
if( (nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN )
&& getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), true );
}
-
+
gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType );
if( bNoDecor )
gtk_window_set_decorated( GTK_WINDOW(m_pWindow), FALSE );
@@ -867,17 +867,18 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
{
/* #i99360# ugly workaround an X11 library bug */
nUserTime= getDisplay()->GetLastUserEventTime( true );
+ // nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window);
}
lcl_set_user_time(GTK_WIDGET(m_pWindow)->window, nUserTime);
}
if( bDecoHandling )
{
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? sal_True : FALSE );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) )
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, false );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
}
-
+
}
GdkNativeWindow GtkSalFrame::findTopLevelSystemWindow( GdkNativeWindow aWindow )
@@ -917,7 +918,7 @@ void GtkSalFrame::Init( SystemParentData* pSysData )
m_aForeignTopLevelWindow = findTopLevelSystemWindow( (GdkNativeWindow)pSysData->aWindow );
m_pForeignTopLevel = gdk_window_foreign_new_for_display( getGdkDisplay(), m_aForeignTopLevelWindow );
gdk_window_set_events( m_pForeignTopLevel, GDK_STRUCTURE_MASK );
-
+
if( pSysData->nSize > sizeof(pSysData->nSize)+sizeof(pSysData->aWindow) && pSysData->bXEmbedSupport )
{
m_pWindow = gtk_plug_new( pSysData->aWindow );
@@ -956,7 +957,7 @@ void GtkSalFrame::Init( SystemParentData* pSysData )
void GtkSalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
{
XEvent aEvent;
-
+
rtl_zeroMemory( &aEvent, sizeof(aEvent) );
aEvent.xclient.window = m_aForeignParentWindow;
aEvent.xclient.type = ClientMessage;
@@ -967,7 +968,7 @@ void GtkSalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
aEvent.xclient.data.l[2] = 0;
aEvent.xclient.data.l[3] = 0;
aEvent.xclient.data.l[4] = 0;
-
+
getDisplay()->GetXLib()->PushXErrorLevel( true );
XSendEvent( getDisplay()->GetDisplay(),
m_aForeignParentWindow,
@@ -1019,10 +1020,10 @@ void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
}
}
-sal_Bool GtkSalFrame::PostEvent( void* pData )
+BOOL GtkSalFrame::PostEvent( void* pData )
{
getDisplay()->SendInternalEvent( this, pData );
- return sal_True;
+ return TRUE;
}
void GtkSalFrame::SetTitle( const String& rTitle )
@@ -1032,8 +1033,8 @@ void GtkSalFrame::SetTitle( const String& rTitle )
gtk_window_set_title( GTK_WINDOW(m_pWindow), rtl::OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() );
}
-static inline sal_uInt8 *
-getRow( BitmapBuffer *pBuffer, sal_uLong nRow )
+static inline BYTE *
+getRow( BitmapBuffer *pBuffer, ULONG nRow )
{
if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN )
return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize;
@@ -1047,11 +1048,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( sal_True );
+ BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( TRUE );
g_return_val_if_fail( pBitmap != NULL, NULL );
g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL );
- BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( sal_True );
+ BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( TRUE );
g_return_val_if_fail( pAlpha != NULL, NULL );
g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL );
@@ -1064,8 +1065,8 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
for( nY = 0; nY < pBitmap->mnHeight; nY++ )
{
- sal_uInt8 *pData = getRow( pBitmap, nY );
- sal_uInt8 *pAlphaData = getRow( pAlpha, nY );
+ BYTE *pData = getRow( pBitmap, nY );
+ BYTE *pAlphaData = getRow( pAlpha, nY );
for( nX = 0; nX < pBitmap->mnWidth; nX++ )
{
@@ -1086,18 +1087,18 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
}
}
- pSalBitmap->ReleaseBuffer( pBitmap, sal_True );
- pSalAlpha->ReleaseBuffer( pAlpha, sal_True );
+ pSalBitmap->ReleaseBuffer( pBitmap, TRUE );
+ pSalAlpha->ReleaseBuffer( pAlpha, TRUE );
return gdk_pixbuf_new_from_data( pPixbufData,
- GDK_COLORSPACE_RGB, sal_True, 8,
+ GDK_COLORSPACE_RGB, TRUE, 8,
aSize.Width(), aSize.Height(),
aSize.Width() * 4,
(GdkPixbufDestroyNotify) g_free,
NULL );
}
-void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
+void GtkSalFrame::SetIcon( USHORT 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 +1110,17 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
GdkPixbuf *pBuf;
GList *pIcons = NULL;
- sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
- sal_uInt16 nIndex;
+ USHORT nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
+ USHORT nIndex;
- for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ )
+ // Use high contrast icons where appropriate
+ if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ nOffsets[0] = SV_ICON_LARGE_HC_START;
+ nOffsets[1] = SV_ICON_SMALL_HC_START;
+ }
+
+ for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(USHORT); nIndex++ )
{
// #i44723# workaround gcc temporary problem
ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() );
@@ -1131,7 +1139,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
{
case TRANSPARENT_NONE:
{
- sal_uInt8 nTrans = 0;
+ BYTE nTrans = 0;
aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans );
}
break;
@@ -1142,7 +1150,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
aMask = AlphaMask( aIcon.GetMask() );
break;
default:
- OSL_FAIL( "unhandled transparent type" );
+ DBG_ERROR( "unhandled transparent type" );
break;
}
}
@@ -1150,16 +1158,16 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
aMask = aIcon.GetAlpha();
aIcon = BitmapEx( aBmp, aMask );
}
-
+
ImpBitmap *pIconImpBitmap = aIcon.ImplGetBitmapImpBitmap();
ImpBitmap *pIconImpMask = aIcon.ImplGetMaskImpBitmap();
-
+
if( pIconImpBitmap && pIconImpMask )
{
- SalBitmap *pIconBitmap =
+ SalBitmap *pIconBitmap =
pIconImpBitmap->ImplGetSalBitmap();
- SalBitmap *pIconMask =
+ SalBitmap *pIconMask =
pIconImpMask->ImplGetSalBitmap();
if( ( pBuf = bitmapToPixbuf( pIconBitmap, pIconMask ) ) )
@@ -1193,12 +1201,12 @@ void GtkSalFrame::Center()
}
else
{
- long nScreenWidth, nScreenHeight;
- long nScreenX = 0, nScreenY = 0;
+ long nScreenWidth, nScreenHeight;
+ long nScreenX = 0, nScreenY = 0;
- Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
- nScreenWidth = aScreenSize.Width();
- nScreenHeight = aScreenSize.Height();
+ Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
+ nScreenWidth = aScreenSize.Width();
+ nScreenHeight = aScreenSize.Height();
if( GetX11SalData()->GetDisplay()->IsXinerama() )
{
// get xinerama screen we are on
@@ -1213,10 +1221,10 @@ void GtkSalFrame::Center()
for( unsigned int i = 0; i < rScreens.size(); i++ )
if( rScreens[i].IsInside( Point( x, y ) ) )
{
- nScreenX = rScreens[i].Left();
- nScreenY = rScreens[i].Top();
- nScreenWidth = rScreens[i].GetWidth();
- nScreenHeight = rScreens[i].GetHeight();
+ nScreenX = rScreens[i].Left();
+ nScreenY = rScreens[i].Top();
+ nScreenWidth = rScreens[i].GetWidth();
+ nScreenHeight = rScreens[i].GetHeight();
break;
}
}
@@ -1228,7 +1236,7 @@ void GtkSalFrame::Center()
Size GtkSalFrame::calcDefaultSize()
{
- Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
+ Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
long w = aScreenSize.Width();
long h = aScreenSize.Height();
@@ -1271,28 +1279,29 @@ static void initClientId()
}
}
-void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
if( m_pWindow )
{
- if( m_pParent && (m_pParent->m_nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN)
+ if( m_pParent && (m_pParent->m_nStyle & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN)
&& getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), bVisible );
if( bVisible )
{
+ SessionManagerClient::open(); // will simply return after the first time
initClientId();
getDisplay()->startupNotificationCompleted();
-
+
if( m_bDefaultPos )
Center();
if( m_bDefaultSize )
SetDefaultSize();
setMinMaxSize();
-
+
// #i45160# switch to desktop where a dialog with parent will appear
if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && GTK_WIDGET_MAPPED(m_pParent->m_pWindow) )
getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea );
-
+
if( isFloatGrabWindow() &&
m_pParent &&
m_nFloats == 0 &&
@@ -1305,7 +1314,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
* showing the float (cannot grab it to the float
* before show).
*/
- m_pParent->grabPointer( sal_True, sal_True );
+ m_pParent->grabPointer( TRUE, TRUE );
}
guint32 nUserTime = 0;
@@ -1318,7 +1327,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
// metacity-2.24.0/src/core/window.c
//
// if ((focus_window != NULL) && XSERVER_TIME_IS_BEFORE (compare, focus_window->net_wm_user_time))
- // "compare" window focus prevented by other activity
+ // "compare" window focus prevented by other activity
//
// where "compare" is this window
@@ -1342,7 +1351,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
//nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window);
}
lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
-
+
if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
m_bSetFocusOnMap = true;
@@ -1352,7 +1361,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
m_nFloats++;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
- grabPointer( sal_True, sal_True );
+ grabPointer( TRUE, TRUE );
// #i44068# reset parent's IM context
if( m_pParent )
m_pParent->EndExtTextInput(0);
@@ -1366,7 +1375,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
m_nFloats--;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0)
- grabPointer( sal_False );
+ grabPointer( FALSE );
}
gtk_widget_hide( m_pWindow );
if( m_pIMHandler )
@@ -1379,7 +1388,7 @@ void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
}
}
-void GtkSalFrame::Enable( sal_Bool /*bEnable*/ )
+void GtkSalFrame::Enable( BOOL /*bEnable*/ )
{
// Not implemented by X11SalFrame either
}
@@ -1407,14 +1416,14 @@ void GtkSalFrame::setMinMaxSize()
{
if( m_aMinSize.Width() && m_aMinSize.Height() )
{
- aGeo.min_width = m_aMinSize.Width()+CONTAINER_ADJUSTMENT;
- aGeo.min_height = m_aMinSize.Height()+CONTAINER_ADJUSTMENT;
+ aGeo.min_width = m_aMinSize.Width()+CONTAINER_ADJUSTMENT;
+ aGeo.min_height = m_aMinSize.Height()+CONTAINER_ADJUSTMENT;
aHints |= GDK_HINT_MIN_SIZE;
}
if( m_aMaxSize.Width() && m_aMaxSize.Height() && ! m_bFullscreen )
{
- aGeo.max_width = m_aMaxSize.Width()+CONTAINER_ADJUSTMENT;
- aGeo.max_height = m_aMaxSize.Height()+CONTAINER_ADJUSTMENT;
+ aGeo.max_width = m_aMaxSize.Width()+CONTAINER_ADJUSTMENT;
+ aGeo.max_height = m_aMaxSize.Height()+CONTAINER_ADJUSTMENT;
aHints |= GDK_HINT_MAX_SIZE;
}
}
@@ -1430,12 +1439,6 @@ 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,
@@ -1469,7 +1472,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
}
}
-void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
{
if( !m_pWindow || isChild( true, false ) )
return;
@@ -1484,8 +1487,8 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
if( (unsigned long)nWidth != maGeometry.nWidth || (unsigned long)nHeight != maGeometry.nHeight )
bSized = true;
- maGeometry.nWidth = nWidth;
- maGeometry.nHeight = nHeight;
+ maGeometry.nWidth = nWidth;
+ maGeometry.nHeight = nHeight;
if( isChild( false, true ) )
gtk_widget_set_size_request( m_pWindow, nWidth, nHeight );
@@ -1507,10 +1510,10 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
nX += m_pParent->maGeometry.nX;
nY += m_pParent->maGeometry.nY;
}
-
+
// adjust position to avoid off screen windows
// but allow toolbars to be positioned partly off screen by the user
- Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
+ Size aScreenSize = GetX11SalData()->GetDisplay()->GetScreenSize( m_nScreen );
if( ! (m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
{
if( nX < (long)maGeometry.nLeftDecoration )
@@ -1533,14 +1536,14 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
if( nY > (long)aScreenSize.Height() - 10 )
nY = (long)aScreenSize.Height() - 10;
}
-
+
if( nX != maGeometry.nX || nY != maGeometry.nY )
bMoved = true;
maGeometry.nX = nX;
maGeometry.nY = nY;
-
+
m_bDefaultPos = false;
-
+
moveWindow( maGeometry.nX, maGeometry.nY );
updateScreenNumber();
@@ -1583,13 +1586,13 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
{
if( ! m_pWindow || ! pState || isChild( true, false ) )
return;
-
- const sal_uLong nMaxGeometryMask =
+
+ const 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 |
SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH | SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT;
-
+
if( (pState->mnMask & SAL_FRAMESTATE_MASK_STATE) &&
! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) &&
(pState->mnState & SAL_FRAMESTATE_MAXIMIZED) &&
@@ -1598,7 +1601,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
resizeWindow( pState->mnWidth, pState->mnHeight );
moveWindow( pState->mnX, pState->mnY );
m_bDefaultPos = m_bDefaultSize = false;
-
+
maGeometry.nX = pState->mnMaximizedX;
maGeometry.nY = pState->mnMaximizedY;
maGeometry.nWidth = pState->mnMaximizedWidth;
@@ -1612,9 +1615,11 @@ 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 ) )
{
- 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);
+ USHORT nPosSizeFlags = 0;
+ long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
+ long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
+ long nWidth = pState->mnWidth;
+ long nHeight = pState->mnHeight;
if( pState->mnMask & SAL_FRAMESTATE_MASK_X )
nPosSizeFlags |= SAL_FRAME_POSSIZE_X;
else
@@ -1625,8 +1630,12 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
nY = maGeometry.nY - (m_pParent ? m_pParent->maGeometry.nY : 0);
if( pState->mnMask & SAL_FRAMESTATE_MASK_WIDTH )
nPosSizeFlags |= SAL_FRAME_POSSIZE_WIDTH;
+ else
+ nWidth = maGeometry.nWidth;
if( pState->mnMask & SAL_FRAMESTATE_MASK_HEIGHT )
nPosSizeFlags |= SAL_FRAME_POSSIZE_HEIGHT;
+ else
+ nHeight = maGeometry.nHeight;
SetPosSize( nX, nY, pState->mnWidth, pState->mnHeight, nPosSizeFlags );
}
if( pState->mnMask & SAL_FRAMESTATE_MASK_STATE && ! isChild() )
@@ -1651,7 +1660,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
}
}
-sal_Bool GtkSalFrame::GetWindowState( SalFrameState* pState )
+BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
pState->mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -1669,37 +1678,37 @@ sal_Bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnMaximizedY = maGeometry.nY;
pState->mnMaximizedWidth = maGeometry.nWidth;
pState->mnMaximizedHeight = maGeometry.nHeight;
- pState->mnMask |= SAL_FRAMESTATE_MASK_MAXIMIZED_X |
- SAL_FRAMESTATE_MASK_MAXIMIZED_Y |
- SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH |
+ pState->mnMask |= SAL_FRAMESTATE_MASK_MAXIMIZED_X |
+ SAL_FRAMESTATE_MASK_MAXIMIZED_Y |
+ SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH |
SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT;
}
else
{
-
- pState->mnX = maGeometry.nX;
- pState->mnY = maGeometry.nY;
- pState->mnWidth = maGeometry.nWidth;
- pState->mnHeight = maGeometry.nHeight;
+
+ pState->mnX = maGeometry.nX;
+ pState->mnY = maGeometry.nY;
+ pState->mnWidth = maGeometry.nWidth;
+ pState->mnHeight = maGeometry.nHeight;
}
- pState->mnMask |= SAL_FRAMESTATE_MASK_X |
- SAL_FRAMESTATE_MASK_Y |
- SAL_FRAMESTATE_MASK_WIDTH |
+ pState->mnMask |= SAL_FRAMESTATE_MASK_X |
+ SAL_FRAMESTATE_MASK_Y |
+ SAL_FRAMESTATE_MASK_WIDTH |
SAL_FRAMESTATE_MASK_HEIGHT;
- return sal_True;
+ return TRUE;
}
void GtkSalFrame::moveToScreen( int nScreen )
{
if( isChild() )
return;
-
+
if( nScreen < 0 || nScreen >= gdk_display_get_n_screens( getGdkDisplay() ) )
nScreen = m_nScreen;
if( nScreen == m_nScreen )
return;
-
+
GdkScreen* pScreen = gdk_display_get_screen( getGdkDisplay(), nScreen );
if( pScreen )
{
@@ -1709,13 +1718,13 @@ void GtkSalFrame::moveToScreen( int nScreen )
gtk_widget_realize( m_pWindow );
// update system data
GtkSalDisplay* pDisp = getDisplay();
- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
- m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
- m_aSystemData.nScreen = nScreen;
- m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth();
- m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap();
- m_aSystemData.pAppContext = NULL;
- m_aSystemData.aShellWindow = m_aSystemData.aWindow;
+ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
+ m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
+ m_aSystemData.nScreen = nScreen;
+ m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth();
+ m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap();
+ m_aSystemData.pAppContext = NULL;
+ m_aSystemData.aShellWindow = m_aSystemData.aWindow;
// update graphics if necessary
for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); i++ )
{
@@ -1730,7 +1739,7 @@ void GtkSalFrame::moveToScreen( int nScreen )
std::list< GtkSalFrame* > aChildren = m_aChildren;
for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it )
(*it)->moveToScreen( m_nScreen );
-
+
// FIXME: SalObjects
}
@@ -1738,7 +1747,7 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen )
{
if( nNewScreen == maGeometry.nScreenNumber )
return;
-
+
if( m_pWindow && ! isChild() )
{
GtkSalDisplay* pDisp = getDisplay();
@@ -1746,18 +1755,18 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen )
{
if( nNewScreen >= pDisp->GetXineramaScreens().size() )
return;
-
+
Rectangle aOldScreenRect( pDisp->GetXineramaScreens()[maGeometry.nScreenNumber] );
Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( sal_False );
+ Show( 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( sal_True );
+ Show( TRUE );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < pDisp->GetScreenCount() )
@@ -1803,7 +1812,7 @@ void GtkSalFrame::SetApplicationID( const rtl::OUString &rWMClass )
}
}
-void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
+void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
{
if( m_pWindow && ! isChild() )
{
@@ -1817,7 +1826,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
Size( maGeometry.nWidth, maGeometry.nHeight ) );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
Rectangle aNewPosSize;
@@ -1840,11 +1849,11 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
{
if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), sal_True );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) );
}
if( bVisible )
- Show( sal_True );
+ Show( TRUE );
}
else
{
@@ -1852,7 +1861,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
if( ! m_aRestorePosSize.IsEmpty() )
@@ -1866,7 +1875,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
m_aRestorePosSize = Rectangle();
}
if( bVisible )
- Show( sal_True );
+ Show( TRUE );
}
}
else
@@ -1877,7 +1886,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
gtk_window_fullscreen( GTK_WINDOW(m_pWindow) );
moveToScreen( nScreen );
- Size aScreenSize = pDisp->GetScreenSize( m_nScreen );
+ Size aScreenSize = pDisp->GetScreenSize( m_nScreen );
maGeometry.nX = 0;
maGeometry.nY = 0;
maGeometry.nWidth = aScreenSize.Width();
@@ -1906,7 +1915,7 @@ void GtkSalFrame::setAutoLock( bool bLock )
{
if( isChild() )
return;
-
+
GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) );
GdkDisplay *pDisplay = gdk_screen_get_display( pScreen );
GdkWindow *pRootWin = gdk_screen_get_root_window( pScreen );
@@ -2035,7 +2044,7 @@ dbus_uninhibit_gsm (guint cookie)
}
#endif
-void GtkSalFrame::StartPresentation( sal_Bool bStart )
+void GtkSalFrame::StartPresentation( BOOL bStart )
{
Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
@@ -2055,7 +2064,7 @@ void GtkSalFrame::StartPresentation( sal_Bool bStart )
bPreferBlanking, bAllowExposures );
}
#ifdef ENABLE_DBUS
- m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation",
+ m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation",
GDK_WINDOW_XID(m_pWindow->window));
#endif
}
@@ -2072,11 +2081,11 @@ void GtkSalFrame::StartPresentation( sal_Bool bStart )
}
}
-void GtkSalFrame::SetAlwaysOnTop( sal_Bool /*bOnTop*/ )
+void GtkSalFrame::SetAlwaysOnTop( BOOL /*bOnTop*/ )
{
}
-void GtkSalFrame::ToTop( sal_uInt16 nFlags )
+void GtkSalFrame::ToTop( USHORT nFlags )
{
if( m_pWindow )
{
@@ -2088,6 +2097,7 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags )
gtk_window_present( GTK_WINDOW(m_pWindow) );
else
{
+ // gdk_window_focus( m_pWindow->window, gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) );
/* #i99360# ugly workaround an X11 library bug */
guint32 nUserTime= getDisplay()->GetLastUserEventTime( true );
gdk_window_focus( m_pWindow->window, nUserTime );
@@ -2123,19 +2133,17 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle )
GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle );
gdk_window_set_cursor( m_pWindow->window, pCursor );
m_pCurrentCursor = pCursor;
-
+
// #i80791# use grabPointer the same way as CaptureMouse, respective float grab
if( getDisplay()->MouseCaptured( this ) )
- grabPointer( sal_True, sal_False );
+ grabPointer( TRUE, FALSE );
else if( m_nFloats > 0 )
- grabPointer( sal_True, sal_True );
+ grabPointer( TRUE, TRUE );
}
}
-void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
+void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents )
{
- static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
-
if( m_pWindow )
{
if( bGrab )
@@ -2157,11 +2165,10 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
if( bUseGdkGrab )
{
const int nMask = ( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK );
-
- if( !pEnv || !*pEnv )
- gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
- (GdkEventMask) nMask, NULL, m_pCurrentCursor,
- GDK_CURRENT_TIME );
+
+ gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
+ (GdkEventMask) nMask, NULL, m_pCurrentCursor,
+ GDK_CURRENT_TIME );
}
else
{
@@ -2171,30 +2178,28 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
//
// this is of course a bad hack, especially as we cannot
// set the right cursor this way
- if( !pEnv || !*pEnv )
- XGrabPointer( getDisplay()->GetDisplay(),
- GDK_WINDOW_XWINDOW( m_pWindow->window),
- bOwnerEvents,
- PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
- GrabModeAsync,
- GrabModeAsync,
- None,
- None,
- CurrentTime
- );
+ XGrabPointer( getDisplay()->GetDisplay(),
+ GDK_WINDOW_XWINDOW( m_pWindow->window),
+ bOwnerEvents,
+ PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync,
+ GrabModeAsync,
+ None,
+ None,
+ CurrentTime
+ );
}
}
else
{
// Two GdkDisplays may be open
- if( !pEnv || !*pEnv )
- gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME);
+ gdk_display_pointer_ungrab( getGdkDisplay(), GDK_CURRENT_TIME);
}
}
}
-void GtkSalFrame::CaptureMouse( sal_Bool bCapture )
+void GtkSalFrame::CaptureMouse( BOOL bCapture )
{
getDisplay()->CaptureMouse( bCapture ? this : NULL );
}
@@ -2206,11 +2211,11 @@ void GtkSalFrame::SetPointerPos( long nX, long nY )
pFrame = pFrame->m_pParent;
if( ! pFrame )
return;
-
+
GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(pFrame->m_pWindow) );
GdkDisplay *pDisplay = gdk_screen_get_display( pScreen );
- /* when the application tries to center the mouse in the dialog the
+ /* #87921# when the application tries to center the mouse in the dialog the
* window isn't mapped already. So use coordinates relative to the root window.
*/
unsigned int nWindowLeft = maGeometry.nX + nX;
@@ -2239,12 +2244,12 @@ void GtkSalFrame::Sync()
gdk_display_sync( getGdkDisplay() );
}
-String GtkSalFrame::GetSymbolKeyName( const String&, sal_uInt16 nKeyCode )
+String GtkSalFrame::GetSymbolKeyName( const String&, USHORT nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
-String GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode )
+String GtkSalFrame::GetKeyName( USHORT nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
@@ -2278,7 +2283,7 @@ SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
return aState;
}
-void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
+void GtkSalFrame::SimulateKeyPress( USHORT nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
@@ -2297,16 +2302,16 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext )
m_pIMHandler->setInputContext( pContext );
}
-void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags )
+void GtkSalFrame::EndExtTextInput( USHORT nFlags )
{
if( m_pIMHandler )
m_pIMHandler->endExtTextInput( nFlags );
}
-sal_Bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+BOOL GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return sal_False;
+ return FALSE;
}
LanguageType GtkSalFrame::GetInputLanguage()
@@ -2343,8 +2348,8 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings )
bFreeGraphics = true;
}
- pGraphics->updateSettings( rSettings );
-
+ pGraphics->updateSettings( rSettings );
+
if( bFreeGraphics )
ReleaseGraphics( pGraphics );
}
@@ -2384,8 +2389,8 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
{
bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bWasVisible )
- Show( sal_False );
-
+ Show( FALSE );
+
if( nScreen < 0 || nScreen >= getDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2459,18 +2464,18 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
m_aGraphics[i].pGraphics->SetWindow( m_pWindow );
}
}
-
+
if( m_aTitle.Len() )
SetTitle( m_aTitle );
-
+
if( bWasVisible )
- Show( sal_True );
-
+ Show( TRUE );
+
std::list< GtkSalFrame* > aChildren = m_aChildren;
m_aChildren.clear();
for( std::list< GtkSalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it )
(*it)->createNewWindow( None, false, m_nScreen );
-
+
// FIXME: SalObjects
}
@@ -2488,7 +2493,7 @@ void GtkSalFrame::ResetClipRegion()
gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 );
}
-void GtkSalFrame::BeginSetClipRegion( sal_uLong )
+void GtkSalFrame::BeginSetClipRegion( ULONG )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -2500,11 +2505,11 @@ void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
if( m_pRegion )
{
GdkRectangle aRect;
- aRect.x = nX;
- aRect.y = nY;
- aRect.width = nWidth;
- aRect.height = nHeight;
-
+ aRect.x = nX;
+ aRect.y = nY;
+ aRect.width = nWidth;
+ aRect.height = nHeight;
+
gdk_region_union_with_rect( m_pRegion, &aRect );
}
}
@@ -2518,7 +2523,7 @@ void GtkSalFrame::EndSetClipRegion()
bool GtkSalFrame::Dispatch( const XEvent* pEvent )
{
bool bContinueDispatch = true;
-
+
if( pEvent->type == PropertyNotify )
{
vcl_sal::WMAdaptor* pAdaptor = getDisplay()->getWMAdaptor();
@@ -2581,7 +2586,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
GdkEventFocus aEvent;
aEvent.type = GDK_FOCUS_CHANGE;
aEvent.window = m_pWindow->window;
- aEvent.send_event = sal_True;
+ aEvent.send_event = TRUE;
aEvent.in = (pEvent->xclient.data.l[1] == 1);
signalFocus( m_pWindow, &aEvent, this );
}
@@ -2635,7 +2640,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
{
GtkSalFrame* pThis = (GtkSalFrame*)frame;
SalMouseEvent aEvent;
- sal_uInt16 nEventType = 0;
+ USHORT nEventType = 0;
switch( pEvent->type )
{
case GDK_BUTTON_PRESS:
@@ -2645,19 +2650,19 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
nEventType = SALEVENT_MOUSEBUTTONUP;
break;
default:
- return sal_False;
+ return 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 sal_False;
+ case 1: aEvent.mnButton = MOUSE_LEFT; break;
+ case 2: aEvent.mnButton = MOUSE_MIDDLE; break;
+ case 3: aEvent.mnButton = MOUSE_RIGHT; break;
+ default: return FALSE;
}
- aEvent.mnTime = pEvent->time;
- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
- aEvent.mnCode = GetMouseModCode( pEvent->state );
+ aEvent.mnTime = pEvent->time;
+ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
+ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
+ aEvent.mnCode = GetMouseModCode( pEvent->state );
bool bClosePopups = false;
if( pEvent->type == GDK_BUTTON_PRESS &&
@@ -2689,7 +2694,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
// --- RTL --- (mirror mouse pos)
if( Application::GetSettings().GetLayoutRTL() )
aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
-
+
vcl::DeletionListener aDel( pThis );
pThis->CallCallback( nEventType, &aEvent );
@@ -2720,7 +2725,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
}
}
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame )
@@ -2728,7 +2733,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
GtkSalFrame* pThis = (GtkSalFrame*)frame;
GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent;
- static sal_uLong nLines = 0;
+ static ULONG nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -2739,14 +2744,14 @@ 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 = (sal_uLong)pSEvent->x;
- aEvent.mnY = (sal_uLong)pSEvent->y;
- aEvent.mnDelta = bNeg ? -120 : 120;
- aEvent.mnNotchDelta = bNeg ? -1 : 1;
- aEvent.mnScrollLines = nLines;
- aEvent.mnCode = GetMouseModCode( pSEvent->state );
- aEvent.mbHorz = (pSEvent->direction == GDK_SCROLL_LEFT || pSEvent->direction == GDK_SCROLL_RIGHT);
+ aEvent.mnTime = pSEvent->time;
+ aEvent.mnX = (ULONG)pSEvent->x;
+ aEvent.mnY = (ULONG)pSEvent->y;
+ aEvent.mnDelta = bNeg ? -120 : 120;
+ aEvent.mnNotchDelta = bNeg ? -1 : 1;
+ aEvent.mnScrollLines = nLines;
+ aEvent.mnCode = GetMouseModCode( pSEvent->state );
+ aEvent.mbHorz = (pSEvent->direction == GDK_SCROLL_LEFT || pSEvent->direction == GDK_SCROLL_RIGHT);
GTK_YIELD_GRAB();
@@ -2756,7 +2761,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame )
@@ -2764,15 +2769,15 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
GtkSalFrame* pThis = (GtkSalFrame*)frame;
SalMouseEvent aEvent;
- aEvent.mnTime = pEvent->time;
- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
- aEvent.mnCode = GetMouseModCode( pEvent->state );
- aEvent.mnButton = 0;
+ aEvent.mnTime = pEvent->time;
+ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
+ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
+ aEvent.mnCode = GetMouseModCode( pEvent->state );
+ aEvent.mnButton = 0;
GTK_YIELD_GRAB();
-
+
// --- RTL --- (mirror mouse pos)
if( Application::GetSettings().GetLayoutRTL() )
aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
@@ -2801,23 +2806,23 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
}
}
- return sal_True;
+ return TRUE;
}
gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame )
{
GtkSalFrame* pThis = (GtkSalFrame*)frame;
SalMouseEvent aEvent;
- aEvent.mnTime = pEvent->time;
- aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
- aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
- aEvent.mnCode = GetMouseModCode( pEvent->state );
- aEvent.mnButton = 0;
+ aEvent.mnTime = pEvent->time;
+ aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
+ aEvent.mnY = (long)pEvent->y_root - pThis->maGeometry.nY;
+ aEvent.mnCode = GetMouseModCode( pEvent->state );
+ aEvent.mnButton = 0;
GTK_YIELD_GRAB();
pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
- return sal_True;
+ return TRUE;
}
@@ -2830,7 +2835,7 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_PAINT, &aEvent );
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame )
@@ -2839,11 +2844,8 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
GTK_YIELD_GRAB();
- X11SalInstance *pSalInstance =
- static_cast< X11SalInstance* >(GetSalData()->m_pInstance);
-
// check if printers have changed (analogous to salframe focus handler)
- pSalInstance->updatePrinterUpdate();
+ vcl_sal::PrinterUpdate::update();
if( !pEvent->in )
{
@@ -2855,8 +2857,9 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
pThis->m_pIMHandler->focusChanged( pEvent->in );
// ask for changed printers like generic implementation
- if( pEvent->in && pSalInstance->isPrinterInit() )
- pSalInstance->updatePrinterUpdate();
+ if( pEvent->in )
+ if( static_cast< X11SalInstance* >(GetSalData()->m_pInstance)->isPrinterInit() )
+ vcl_sal::PrinterUpdate::update();
// FIXME: find out who the hell steals the focus from our frame
// while we have the pointer grabbed, this should not come from
@@ -2867,7 +2870,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
if( m_nFloats == 0 )
pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL );
- return sal_False;
+ return FALSE;
}
IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
@@ -2881,16 +2884,16 @@ IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
to fullscreen to be safe
*/
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = getDisplay()->GetDisplay();
- aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window);
- aEvent.xclient.message_type = nStateAtom;
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = 1;
- aEvent.xclient.data.l[1] = nFSAtom;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = getDisplay()->GetDisplay();
+ aEvent.xclient.window = GDK_WINDOW_XWINDOW(m_pWindow->window);
+ aEvent.xclient.message_type = nStateAtom;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = 1;
+ aEvent.xclient.data.l[1] = nFSAtom;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( getDisplay()->GetDisplay(),
getDisplay()->GetRootWindow( m_nScreen ),
False,
@@ -2907,7 +2910,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
GtkSalFrame* pThis = (GtkSalFrame*)frame;
GTK_YIELD_GRAB();
-
+
if( pThis->m_bFullscreen )
{
/* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
@@ -2915,7 +2918,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
*/
Application::PostUserEvent( LINK( pThis, GtkSalFrame, ImplDelayedFullScreenHdl ) );
}
-
+
bool bSetFocus = pThis->m_bSetFocusOnMap;
pThis->m_bSetFocusOnMap = false;
if( ImplGetSVData()->mbIsTestTool )
@@ -2936,10 +2939,10 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
GDK_WINDOW_XWINDOW( GTK_WIDGET(pThis->m_pWindow)->window),
RevertToParent, CurrentTime );
}
-
+
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
@@ -2949,7 +2952,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame )
@@ -2969,7 +2972,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
*/
if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) &&
pThis->getDisplay()->GetCaptureFrame() == pThis )
- return sal_False;
+ return FALSE;
// in child case the coordinates are not root coordinates,
@@ -2990,8 +2993,8 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
if( x != pThis->maGeometry.nX || y != pThis->maGeometry.nY )
{
bMoved = true;
- pThis->maGeometry.nX = x;
- pThis->maGeometry.nY = y;
+ pThis->maGeometry.nX = x;
+ pThis->maGeometry.nY = y;
}
/* #i86302#
* for non sizeable windows we set the min and max hint for the window manager to
@@ -3006,20 +3009,20 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight )
{
bSized = true;
- pThis->maGeometry.nWidth = pEvent->width;
- pThis->maGeometry.nHeight = pEvent->height;
+ pThis->maGeometry.nWidth = pEvent->width;
+ pThis->maGeometry.nHeight = pEvent->height;
}
}
-
+
// update decoration hints
if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) )
{
GdkRectangle aRect;
gdk_window_get_frame_extents( GTK_WIDGET(pThis->m_pWindow)->window, &aRect );
- pThis->maGeometry.nTopDecoration = y - aRect.y;
- pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height;
- pThis->maGeometry.nLeftDecoration = x - aRect.x;
- pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width;
+ pThis->maGeometry.nTopDecoration = y - aRect.y;
+ pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height;
+ pThis->maGeometry.nLeftDecoration = x - aRect.x;
+ pThis->maGeometry.nRightDecoration = aRect.x + aRect.width - x - pEvent->width;
}
else
{
@@ -3038,7 +3041,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
else if( bSized )
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame )
@@ -3050,7 +3053,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pThis->m_pIMHandler )
{
if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
- return sal_True;
+ return TRUE;
}
GTK_YIELD_GRAB();
@@ -3063,7 +3066,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
{
SalKeyModEvent aModEvt;
- sal_uInt16 nModCode = GetKeyModCode( pEvent->state );
+ USHORT nModCode = GetKeyModCode( pEvent->state );
aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events
if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers )
@@ -3076,8 +3079,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
pThis->m_nKeyModifiers = 0;
}
- sal_uInt16 nExtModMask = 0;
- sal_uInt16 nModMask = 0;
+ USHORT nExtModMask = 0;
+ USHORT 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.
@@ -3112,7 +3115,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
// except Mac OS X
case GDK_Meta_L:
case GDK_Super_L:
- nExtModMask = MODKEY_LMOD3;
+ nExtModMask = MODKEY_LMOD3;
nModMask = KEY_MOD3;
break;
case GDK_Meta_R:
@@ -3155,7 +3158,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( !aDel.isDeleted() && pThis->m_pIMHandler )
pThis->m_pIMHandler->updateIMSpotLocation();
- return sal_True;
+ return TRUE;
}
gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
@@ -3165,7 +3168,7 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_CLOSE, NULL );
- return sal_True;
+ return TRUE;
}
void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame )
@@ -3199,12 +3202,12 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
aWin,
pThis->m_hBackgroundPixmap );
}
-
+
if( ! pThis->m_pParent )
{
// signalize theme changed for NWF caches
// FIXME: should be called only once for a style change
- GtkSalGraphics::bThemeChanged = sal_True;
+ GtkSalGraphics::bThemeChanged = TRUE;
}
}
@@ -3213,7 +3216,7 @@ gboolean GtkSalFrame::signalState( GtkWidget*, GdkEvent* pEvent, gpointer frame
GtkSalFrame* pThis = (GtkSalFrame*)frame;
if( (pThis->m_nState & GDK_WINDOW_STATE_ICONIFIED) != (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED ) )
pThis->getDisplay()->SendInternalEvent( pThis, NULL, SALEVENT_RESIZE );
-
+
if( (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_MAXIMIZED) &&
! (pThis->m_nState & GDK_WINDOW_STATE_MAXIMIZED) )
{
@@ -3232,7 +3235,7 @@ gboolean GtkSalFrame::signalState( GtkWidget*, GdkEvent* pEvent, gpointer frame
}
#endif
- return sal_False;
+ return FALSE;
}
gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame )
@@ -3240,7 +3243,7 @@ gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent,
GtkSalFrame* pThis = (GtkSalFrame*)frame;
pThis->m_nVisibility = pEvent->state;
- return sal_False;
+ return FALSE;
}
void GtkSalFrame::signalDestroy( GtkObject* pObj, gpointer frame )
@@ -3330,9 +3333,7 @@ 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* )
@@ -3342,21 +3343,21 @@ void GtkSalFrame::IMHandler::setInputContext( SalInputContext* )
void GtkSalFrame::IMHandler::sendEmptyCommit()
{
vcl::DeletionListener aDel( m_pFrame );
-
+
SalExtTextInputEvent aEmptyEv;
- aEmptyEv.mnTime = 0;
- aEmptyEv.mpTextAttr = 0;
- aEmptyEv.maText = String();
- aEmptyEv.mnCursorPos = 0;
- aEmptyEv.mnCursorFlags = 0;
- aEmptyEv.mnDeltaStart = 0;
- aEmptyEv.mbOnlyCursor = False;
+ aEmptyEv.mnTime = 0;
+ aEmptyEv.mpTextAttr = 0;
+ aEmptyEv.maText = String();
+ aEmptyEv.mnCursorPos = 0;
+ aEmptyEv.mnCursorFlags = 0;
+ aEmptyEv.mnDeltaStart = 0;
+ aEmptyEv.mbOnlyCursor = False;
m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv );
if( ! aDel.isDeleted() )
m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL );
}
-void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ )
+void GtkSalFrame::IMHandler::endExtTextInput( USHORT /*nFlags*/ )
{
gtk_im_context_reset ( m_pIMContext );
@@ -3416,7 +3417,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
// for us.
m_aPrevKeyPresses.push_back( PreviousKeyPress(pEvent) );
m_nPrevKeyPresses++;
-
+
// Also pop off the earliest key press event if there are more than 10
// already.
while (m_nPrevKeyPresses > 10)
@@ -3424,7 +3425,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
m_aPrevKeyPresses.pop_front();
m_nPrevKeyPresses--;
}
-
+
GObject* pRef = G_OBJECT( g_object_ref( G_OBJECT( m_pIMContext ) ) );
// #i51353# update spot location on every key input since we cannot
@@ -3432,7 +3433,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
updateIMSpotLocation();
if( aDel.isDeleted() )
return true;
-
+
gboolean bResult = gtk_im_context_filter_keypress( m_pIMContext, pEvent );
g_object_unref( pRef );
@@ -3459,7 +3460,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
}
}
}
-
+
// Determine if we got an earlier key press event corresponding to this key release
if (pEvent->type == GDK_KEY_RELEASE)
{
@@ -3469,7 +3470,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
if( aDel.isDeleted() )
return true;
-
+
m_bPreeditJustChanged = false;
std::list<PreviousKeyPress>::iterator iter = m_aPrevKeyPresses.begin();
@@ -3490,7 +3491,7 @@ bool GtkSalFrame::IMHandler::handleKeyEvent( GdkEventKey* pEvent )
if( bResult )
return true;
}
-
+
return false;
}
@@ -3538,17 +3539,17 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
const bool bWasPreedit =
(pThis->m_aInputEvent.mpTextAttr != 0) ||
pThis->m_bPreeditJustChanged;
-
- pThis->m_aInputEvent.mnTime = 0;
- pThis->m_aInputEvent.mpTextAttr = 0;
- pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
- pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.Len();
- pThis->m_aInputEvent.mnCursorFlags = 0;
- pThis->m_aInputEvent.mnDeltaStart = 0;
- pThis->m_aInputEvent.mbOnlyCursor = False;
-
+
+ pThis->m_aInputEvent.mnTime = 0;
+ pThis->m_aInputEvent.mpTextAttr = 0;
+ pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
+ pThis->m_aInputEvent.mnCursorPos = pThis->m_aInputEvent.maText.Len();
+ pThis->m_aInputEvent.mnCursorFlags = 0;
+ pThis->m_aInputEvent.mnDeltaStart = 0;
+ pThis->m_aInputEvent.mbOnlyCursor = False;
+
pThis->m_aInputFlags.clear();
-
+
/* necessary HACK: all keyboard input comes in here as soon as a IMContext is set
* which is logical and consequent. But since even simple input like
* <space> comes through the commit signal instead of signalKey
@@ -3569,7 +3570,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* CONTEXT_ARG, gchar* p
{
const PreviousKeyPress& rKP = pThis->m_aPrevKeyPresses.back();
sal_Unicode aOrigCode = pThis->m_aInputEvent.maText.GetChar(0);
-
+
if( checkSingleKeyCommitHack( rKP.keyval, aOrigCode ) )
{
pThis->m_pFrame->doKeyCallback( rKP.state, rKP.keyval, rKP.hardware_keycode, rKP.group, rKP.time, aOrigCode, true, true );
@@ -3603,9 +3604,9 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
{
GtkSalFrame::IMHandler* pThis = (GtkSalFrame::IMHandler*)im_handler;
- char* pText = NULL;
- PangoAttrList* pAttrs = NULL;
- gint nCursorPos = 0;
+ char* pText = NULL;
+ PangoAttrList* pAttrs = NULL;
+ gint nCursorPos = 0;
gtk_im_context_get_preedit_string( pThis->m_pIMContext,
&pText,
@@ -3619,21 +3620,21 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
if( pThis->m_aInputEvent.maText.Len() == 0 )
{
g_free( pText );
- return;
+ return;
}
}
pThis->m_bPreeditJustChanged = true;
bool bEndPreedit = (!pText || !*pText) && pThis->m_aInputEvent.mpTextAttr != NULL;
- pThis->m_aInputEvent.mnTime = 0;
- pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
- pThis->m_aInputEvent.mnCursorPos = nCursorPos;
+ pThis->m_aInputEvent.mnTime = 0;
+ pThis->m_aInputEvent.maText = String( pText, RTL_TEXTENCODING_UTF8 );
+ pThis->m_aInputEvent.mnCursorPos = nCursorPos;
pThis->m_aInputEvent.mnCursorFlags = 0;
pThis->m_aInputEvent.mnDeltaStart = 0;
pThis->m_aInputEvent.mbOnlyCursor = False;
- pThis->m_aInputFlags = std::vector<sal_uInt16>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
+ pThis->m_aInputFlags = std::vector<USHORT>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
PangoAttrIterator *iter = pango_attr_list_get_iterator (pAttrs);
do
@@ -3642,21 +3643,21 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
GSList *tmp_list = NULL;
gint start, end;
guint sal_attr = 0;
-
+
pango_attr_iterator_range (iter, &start, &end);
if (end == G_MAXINT)
end = pText ? strlen (pText) : 0;
if (end == start)
continue;
-
+
start = g_utf8_pointer_to_offset (pText, pText + start);
end = g_utf8_pointer_to_offset (pText, pText + end);
-
+
tmp_list = attr_list = pango_attr_iterator_get_attrs (iter);
while (tmp_list)
{
PangoAttribute *pango_attr = (PangoAttribute *)(tmp_list->data);
-
+
switch (pango_attr->klass->type)
{
case PANGO_ATTR_BACKGROUND:
@@ -3677,21 +3678,21 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
if (sal_attr == 0)
sal_attr |= SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
g_slist_free (attr_list);
-
+
// Set the sal attributes on our text
for (int i = start; i < end; i++)
pThis->m_aInputFlags[i] |= sal_attr;
} while (pango_attr_iterator_next (iter));
- pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
+ pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
g_free( pText );
pango_attr_list_unref( pAttrs );
GTK_YIELD_GRAB();
-
+
vcl::DeletionListener aDel( pThis->m_pFrame );
-
+
pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pThis->m_aInputEvent);
if( bEndPreedit && ! aDel.isDeleted() )
pThis->doCallEndExtTextInput();
@@ -3709,14 +3710,14 @@ void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_hand
GTK_YIELD_GRAB();
pThis->m_bPreeditJustChanged = true;
-
+
vcl::DeletionListener aDel( pThis->m_pFrame );
pThis->doCallEndExtTextInput();
if( ! aDel.isDeleted() )
pThis->updateIMSpotLocation();
}
-uno::Reference<accessibility::XAccessibleEditableText>
+uno::Reference<accessibility::XAccessibleEditableText>
FindFocus(uno::Reference< accessibility::XAccessibleContext > xContext)
{
if (!xContext.is())
@@ -3773,18 +3774,18 @@ gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pCon
sal_uInt32 nPosition = xText->getCaretPosition();
rtl::OUString sAllText = xText->getText();
if (!sAllText.getLength())
- return sal_False;
+ return 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(),
+ gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(),
rtl::OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength());
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
-gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars,
+gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars,
gpointer /*im_handler*/ )
{
uno::Reference<accessibility::XAccessibleEditableText> xText = lcl_GetxText();
@@ -3792,7 +3793,9 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
if (xText.is())
{
sal_uInt32 nPosition = xText->getCaretPosition();
- // #i111768# range checking
+ // --> OD 2010-06-04 #i111768# - apply patch from kstribley:
+ // range checking
+// xText->deleteText(nPosition + offset, nPosition + offset + nchars);
sal_Int32 nDeletePos = nPosition + offset;
sal_Int32 nDeleteEnd = nDeletePos + nchars;
if (nDeletePos < 0)
@@ -3803,10 +3806,11 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
nDeleteEnd = xText->getCharacterCount();
xText->deleteText(nDeletePos, nDeleteEnd);
- return sal_True;
+ // <--
+ return TRUE;
}
- return sal_False;
+ return 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 ac4d7af56674..7308dabfae27 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@
#include <plugins/gtk/gtkdata.hxx>
#include <plugins/gtk/gtkinst.hxx>
-GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
+GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow )
: m_pSocket( NULL ),
m_pRegion( NULL )
{
@@ -63,25 +63,25 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
//system data
SalDisplay* pDisp = GetX11SalData()->GetDisplay();
- m_aSystemData.nSize = sizeof( SystemChildData );
- m_aSystemData.pDisplay = pDisp->GetDisplay();
- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pSocket->window);
- m_aSystemData.pSalFrame = NULL;
- m_aSystemData.pWidget = m_pSocket;
- m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual();
- m_aSystemData.nScreen = pParent->getScreenNumber();
- m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth();
- m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap();
- m_aSystemData.pAppContext = NULL;
- m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window);
- m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow());
+ m_aSystemData.nSize = sizeof( SystemChildData );
+ m_aSystemData.pDisplay = pDisp->GetDisplay();
+ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pSocket->window);
+ m_aSystemData.pSalFrame = NULL;
+ m_aSystemData.pWidget = m_pSocket;
+ m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual();
+ m_aSystemData.nScreen = pParent->getScreenNumber();
+ m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth();
+ m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap();
+ m_aSystemData.pAppContext = NULL;
+ m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window);
+ m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow());
g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this );
g_signal_connect( G_OBJECT(m_pSocket), "button-release-event", G_CALLBACK(signalButton), this );
g_signal_connect( G_OBJECT(m_pSocket), "focus-in-event", G_CALLBACK(signalFocus), this );
g_signal_connect( G_OBJECT(m_pSocket), "focus-out-event", G_CALLBACK(signalFocus), this );
g_signal_connect( G_OBJECT(m_pSocket), "destroy", G_CALLBACK(signalDestroy), this );
-
+
// #i59255# necessary due to sync effects with java child windows
pParent->Sync();
}
@@ -111,12 +111,12 @@ void GtkSalObject::ResetClipRegion()
gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 );
}
-sal_uInt16 GtkSalObject::GetClipRegionType()
+USHORT GtkSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
-void GtkSalObject::BeginSetClipRegion( sal_uLong )
+void GtkSalObject::BeginSetClipRegion( ULONG )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -126,11 +126,11 @@ void GtkSalObject::BeginSetClipRegion( sal_uLong )
void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
GdkRectangle aRect;
- aRect.x = nX;
- aRect.y = nY;
- aRect.width = nWidth;
- aRect.height = nHeight;
-
+ aRect.x = nX;
+ aRect.y = nY;
+ aRect.width = nWidth;
+ aRect.height = nHeight;
+
gdk_region_union_with_rect( m_pRegion, &aRect );
}
@@ -151,7 +151,7 @@ void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
}
}
-void GtkSalObject::Show( sal_Bool bVisible )
+void GtkSalObject::Show( BOOL bVisible )
{
if( m_pSocket )
{
@@ -162,7 +162,7 @@ void GtkSalObject::Show( sal_Bool bVisible )
}
}
-void GtkSalObject::Enable( sal_Bool )
+void GtkSalObject::Enable( BOOL )
{
}
@@ -183,7 +183,7 @@ const SystemEnvData* GtkSalObject::GetSystemData() const
return &m_aSystemData;
}
-
+
gboolean GtkSalObject::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer object )
{
GtkSalObject* pThis = (GtkSalObject*)object;
@@ -217,16 +217,13 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
}
}
-void GtkSalObject::SetForwardKey( sal_Bool bEnable )
+void GtkSalObject::SetForwardKey( BOOL bEnable )
{
+ printf ("GtkSalObject::SetForwardKey\n");
if( bEnable )
gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE );
else
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 2d8309af5eba..fddc36753878 100644
--- a/vcl/unx/headless/svpbmp.cxx
+++ b/vcl/unx/headless/svpbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,8 +43,8 @@ SvpSalBitmap::~SvpSalBitmap()
{
}
-bool SvpSalBitmap::Create( const Size& rSize,
- sal_uInt16 nBitCount,
+bool SvpSalBitmap::Create( const Size& rSize,
+ USHORT 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*/,
- sal_uInt16 /*nNewBitCount*/ )
+ USHORT /*nNewBitCount*/ )
{
return false;
}
@@ -135,25 +135,25 @@ Size SvpSalBitmap::GetSize() const
B2IVector aVec( m_aBitmap->getSize() );
aSize = Size( aVec.getX(), aVec.getY() );
}
-
+
return aSize;
}
-sal_uInt16 SvpSalBitmap::GetBitCount() const
+USHORT SvpSalBitmap::GetBitCount() const
{
- sal_uInt16 nDepth = 0;
+ USHORT nDepth = 0;
if( m_aBitmap.get() )
nDepth = getBitCountFromScanlineFormat( m_aBitmap->getScanlineFormat() );
return nDepth;
}
-
+
BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
{
BitmapBuffer* pBuf = NULL;
if( m_aBitmap.get() )
{
pBuf = new BitmapBuffer();
- sal_uInt16 nBitCount = 1;
+ USHORT 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 = (sal_uInt8*)m_aBitmap->getBuffer().get();
+ pBuf->mpBits = (BYTE*)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)
- sal_uInt16 nBitCount = 0;
+ USHORT nBitCount = 0;
switch( m_aBitmap->getScanlineFormat() )
{
case Format::ONE_BIT_MSB_GREY:
@@ -299,7 +299,7 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
sal_uInt32 nEntries = 1U << nBitCount;
boost::shared_ptr< std::vector<basebmp::Color> > pPal(
- new std::vector<basebmp::Color>( nEntries,
+ new std::vector<basebmp::Color>( nEntries,
basebmp::Color(COL_WHITE)));
const sal_uInt32 nColors = std::min(
(sal_uInt32)pBuffer->maPalette.GetEntryCount(),
@@ -309,9 +309,9 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
const BitmapColor& rCol = pBuffer->maPalette[i];
(*pPal)[i] = basebmp::Color( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() );
}
-
- m_aBitmap = basebmp::createBitmapDevice( m_aBitmap->getSize(),
- m_aBitmap->isTopDown(),
+
+ m_aBitmap = basebmp::createBitmapDevice( m_aBitmap->getSize(),
+ m_aBitmap->isTopDown(),
m_aBitmap->getScanlineFormat(),
m_aBitmap->getBuffer(),
pPal );
diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx
index 695d7226b0f0..f8810acd0fbd 100644
--- a/vcl/unx/headless/svpbmp.hxx
+++ b/vcl/unx/headless/svpbmp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,31 +38,31 @@ class SvpSalBitmap : public SalBitmap, public SvpElement
public:
SvpSalBitmap() {}
virtual ~SvpSalBitmap();
-
+
const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; }
void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; }
-
+
// SvpElement
virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; }
-
+
// SalBitmap
- virtual bool Create( const Size& rSize,
- sal_uInt16 nBitCount,
+ virtual bool Create( const Size& rSize,
+ USHORT nBitCount,
const BitmapPalette& rPal );
- virtual bool Create( const SalBitmap& rSalBmp );
- virtual bool Create( const SalBitmap& rSalBmp,
+ virtual bool Create( const SalBitmap& rSalBmp );
+ virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmp,
- sal_uInt16 nNewBitCount );
+ virtual bool Create( const SalBitmap& rSalBmp,
+ USHORT 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 sal_uInt16 GetBitCount() const;
-
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
- virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
+ virtual void Destroy();
+ virtual Size GetSize() const;
+ virtual USHORT GetBitCount() const;
+
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
virtual bool GetSystemData( BitmapSystemData& rData );
};
diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx
index 3bf1a4da9cc0..3b6a61fdae5e 100644
--- a/vcl/unx/headless/svpdummies.cxx
+++ b/vcl/unx/headless/svpdummies.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,17 +33,17 @@
// SalObject
SvpSalObject::SvpSalObject()
{
- m_aSystemChildData.nSize = sizeof( SystemChildData );
- m_aSystemChildData.pDisplay = NULL;
- m_aSystemChildData.aWindow = 0;
+ m_aSystemChildData.nSize = sizeof( SystemChildData );
+ m_aSystemChildData.pDisplay = NULL;
+ m_aSystemChildData.aWindow = 0;
m_aSystemChildData.pSalFrame = 0;
- m_aSystemChildData.pWidget = 0;
- m_aSystemChildData.pVisual = 0;
- m_aSystemChildData.nDepth = 0;
- m_aSystemChildData.aColormap = 0;
- m_aSystemChildData.pAppContext = NULL;
- m_aSystemChildData.aShellWindow = 0;
- m_aSystemChildData.pShellWidget = NULL;
+ m_aSystemChildData.pWidget = 0;
+ m_aSystemChildData.pVisual = 0;
+ m_aSystemChildData.nDepth = 0;
+ m_aSystemChildData.aColormap = 0;
+ m_aSystemChildData.pAppContext = NULL;
+ m_aSystemChildData.aShellWindow = 0;
+ m_aSystemChildData.pShellWidget = NULL;
}
SvpSalObject::~SvpSalObject()
@@ -51,18 +51,17 @@ SvpSalObject::~SvpSalObject()
}
void SvpSalObject::ResetClipRegion() {}
-sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; }
-void SvpSalObject::BeginSetClipRegion( sal_uLong ) {}
+USHORT SvpSalObject::GetClipRegionType() { return 0; }
+void SvpSalObject::BeginSetClipRegion( ULONG ) {}
void SvpSalObject::UnionClipRegion( long, long, long, long ) {}
void SvpSalObject::EndSetClipRegion() {}
void SvpSalObject::SetPosSize( long, long, long, long ) {}
-void SvpSalObject::Show( sal_Bool ) {}
-void SvpSalObject::Enable( sal_Bool ) {}
+void SvpSalObject::Show( BOOL ) {}
+void SvpSalObject::Enable( 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 86a9382adb96..f005e4276f9a 100644
--- a/vcl/unx/headless/svpdummies.hxx
+++ b/vcl/unx/headless/svpdummies.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,23 +44,21 @@ public:
virtual ~SvpSalObject();
// overload all pure virtual methods
- virtual void ResetClipRegion();
- 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( sal_Bool bVisible );
- virtual void Enable( sal_Bool nEnable );
- virtual void GrabFocus();
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
- virtual void SetBackground();
- virtual void SetBackground( SalColor nSalColor );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
+ virtual void Show( BOOL bVisible );
+ virtual void Enable( BOOL nEnable );
+ virtual void GrabFocus();
- virtual const SystemEnvData* GetSystemData() const;
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
- virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+ virtual const SystemEnvData* GetSystemData() const;
};
class SvpImeStatus : public SalI18NImeStatus
@@ -86,7 +84,7 @@ class SvpSalSystem : public SalSystem
virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetScreenName( unsigned int nScreen );
-
+
virtual int ShowNativeMessageBox( const String& rTitle,
const String& rMessage,
int nButtonCombination,
diff --git a/vcl/unx/headless/svpelement.cxx b/vcl/unx/headless/svpelement.cxx
index b6bf4822b576..ee3256085bd2 100644
--- a/vcl/unx/headless/svpelement.cxx
+++ b/vcl/unx/headless/svpelement.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,6 @@
#include <basebmp/scanlineformats.hxx>
#include <tools/debug.hxx>
-#include <osl/diagnose.h>
#if defined WITH_SVP_LISTENING
#include <osl/thread.h>
@@ -44,7 +43,7 @@
#include "svpframe.hxx"
#include <list>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <sys/types.h>
#include <sys/socket.h>
@@ -59,16 +58,16 @@ class SvpElementContainer
std::list< SvpElement* > m_aElements;
int m_nSocket;
oslThread m_aThread;
-
+
SvpElementContainer();
~SvpElementContainer();
public:
void registerElement( SvpElement* pElement ) { m_aElements.push_back(pElement); }
void deregisterElement( SvpElement* pElement ) { m_aElements.remove(pElement); }
-
+
void run();
DECL_LINK(processRequest,void*);
-
+
static SvpElementContainer& get();
};
@@ -88,7 +87,7 @@ SvpElementContainer::SvpElementContainer()
if( m_nSocket >= 0)
{
int nOn = 1;
- if( setsockopt(m_nSocket, SOL_SOCKET, SO_REUSEADDR,
+ if( setsockopt(m_nSocket, SOL_SOCKET, SO_REUSEADDR,
(char*)&nOn, sizeof(nOn)) )
{
perror( "SvpElementContainer: changing socket options failed" );
@@ -167,7 +166,7 @@ static const char* matchType( SvpElement* pEle )
IMPL_LINK( SvpElementContainer, processRequest, void*, pSocket )
{
int nFile = (int)pSocket;
-
+
rtl::OStringBuffer aBuf( 256 ), aAnswer( 256 );
char c;
while( read( nFile, &c, 1 ) && c != '\n' )
@@ -175,14 +174,14 @@ IMPL_LINK( SvpElementContainer, processRequest, void*, pSocket )
rtl::OString aCommand( aBuf.makeStringAndClear() );
if( aCommand.compareTo( "list", 4 ) == 0 )
{
- boost::unordered_map< rtl::OString, std::list<SvpElement*>, rtl::OStringHash > aMap;
+ std::hash_map< rtl::OString, std::list<SvpElement*>, rtl::OStringHash > aMap;
for( std::list< SvpElement* >::const_iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
{
std::list<SvpElement*>& rList = aMap[matchType(*it)];
rList.push_back( *it );
}
- for( boost::unordered_map< rtl::OString, std::list<SvpElement*>, rtl::OStringHash>::const_iterator hash_it = aMap.begin();
+ for( std::hash_map< rtl::OString, std::list<SvpElement*>, rtl::OStringHash>::const_iterator hash_it = aMap.begin();
hash_it != aMap.end(); ++hash_it )
{
aAnswer.append( "ElementType: " );
@@ -230,7 +229,7 @@ IMPL_LINK( SvpElementContainer, processRequest, void*, pSocket )
}
write( nFile, aAnswer.getStr(), aAnswer.getLength() );
close( nFile );
-
+
return 0;
}
@@ -284,7 +283,7 @@ sal_uInt32 SvpElement::getBitCountFromScanlineFormat( sal_Int32 nFormat )
nBitCount = 32;
break;
default:
- OSL_FAIL( "unsupported basebmp format" );
+ DBG_ERROR( "unsupported basebmp format" );
break;
}
return nBitCount;
diff --git a/vcl/unx/headless/svpelement.hxx b/vcl/unx/headless/svpelement.hxx
index c7f647cf3a03..24302d5b6b14 100644
--- a/vcl/unx/headless/svpelement.hxx
+++ b/vcl/unx/headless/svpelement.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@ class SvpElement
protected:
SvpElement();
virtual ~SvpElement();
- public:
+ public:
virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0;
static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat );
diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx
index 1b8455557fac..9d1f89b385e4 100644
--- a/vcl/unx/headless/svpframe.cxx
+++ b/vcl/unx/headless/svpframe.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,9 +38,9 @@ using namespace basegfx;
SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL;
-SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
+SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- sal_uLong nSalFrameStyle,
+ ULONG nSalFrameStyle,
SystemParentData* ) :
m_pInstance( pInstance ),
m_pParent( static_cast<SvpSalFrame*>(pParent) ),
@@ -51,24 +51,24 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
m_nMaxWidth( 0 ),
m_nMaxHeight( 0 )
{
- m_aSystemChildData.nSize = sizeof( SystemChildData );
- m_aSystemChildData.pDisplay = NULL;
- m_aSystemChildData.aWindow = 0;
- m_aSystemChildData.pSalFrame = this;
- m_aSystemChildData.pWidget = NULL;
- m_aSystemChildData.pVisual = NULL;
- m_aSystemChildData.nDepth = 24;
- m_aSystemChildData.aColormap = 0;
- m_aSystemChildData.pAppContext = NULL;
- m_aSystemChildData.aShellWindow = 0;
- m_aSystemChildData.pShellWidget = NULL;
-
+ m_aSystemChildData.nSize = sizeof( SystemChildData );
+ m_aSystemChildData.pDisplay = NULL;
+ m_aSystemChildData.aWindow = 0;
+ m_aSystemChildData.pSalFrame = this;
+ m_aSystemChildData.pWidget = NULL;
+ m_aSystemChildData.pVisual = NULL;
+ m_aSystemChildData.nDepth = 24;
+ m_aSystemChildData.aColormap = 0;
+ m_aSystemChildData.pAppContext = NULL;
+ m_aSystemChildData.aShellWindow = 0;
+ m_aSystemChildData.pShellWidget = NULL;
+
if( m_pParent )
m_pParent->m_aChildren.push_back( this );
-
+
if( m_pInstance )
m_pInstance->registerFrame( this );
-
+
SetPosSize( 0, 0, 800, 600, SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
@@ -76,14 +76,14 @@ SvpSalFrame::~SvpSalFrame()
{
if( m_pInstance )
m_pInstance->deregisterFrame( this );
-
+
std::list<SvpSalFrame*> Children = m_aChildren;
for( std::list<SvpSalFrame*>::iterator it = Children.begin();
it != Children.end(); ++it )
(*it)->SetParent( m_pParent );
if( m_pParent )
m_pParent->m_aChildren.remove( this );
-
+
if( s_pFocusFrame == this )
{
s_pFocusFrame = NULL;
@@ -147,10 +147,10 @@ void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
delete pSvpGraphics;
}
-sal_Bool SvpSalFrame::PostEvent( void* pData )
+BOOL SvpSalFrame::PostEvent( void* pData )
{
m_pInstance->PostEvent( this, pData, SALEVENT_USEREVENT );
- return sal_True;
+ return TRUE;
}
void SvpSalFrame::PostPaint() const
@@ -166,7 +166,7 @@ void SvpSalFrame::SetTitle( const XubString& )
{
}
-void SvpSalFrame::SetIcon( sal_uInt16 )
+void SvpSalFrame::SetIcon( USHORT )
{
}
@@ -182,7 +182,7 @@ void SvpSalFrame::SetExtendedFrameStyle( SalExtStyle )
{
}
-void SvpSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
if( bVisible && ! m_bVisible )
{
@@ -199,7 +199,7 @@ void SvpSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
}
}
-void SvpSalFrame::Enable( sal_Bool )
+void SvpSalFrame::Enable( 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, sal_uInt16 nFlags )
+void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
{
if( (nFlags & SAL_FRAME_POSSIZE_X) != 0 )
maGeometry.nX = nX;
@@ -305,40 +305,40 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState )
nWidth = pState->mnWidth;
if (pState->mnMask & SAL_FRAMESTATE_MASK_HEIGHT)
nHeight = pState->mnHeight;
-
+
SetPosSize( nX, nY, nWidth, nHeight,
SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y |
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
}
-sal_Bool SvpSalFrame::GetWindowState( SalFrameState* pState )
+BOOL SvpSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
- pState->mnX = maGeometry.nX;
- pState->mnY = maGeometry.nY;
+ pState->mnX = maGeometry.nX;
+ pState->mnY = maGeometry.nY;
pState->mnWidth = maGeometry.nWidth;
pState->mnHeight = maGeometry.nHeight;
pState->mnMask = _FRAMESTATE_MASK_GEOMETRY | SAL_FRAMESTATE_MASK_STATE;
- return sal_True;
+ return TRUE;
}
-void SvpSalFrame::ShowFullScreen( sal_Bool, sal_Int32 )
+void SvpSalFrame::ShowFullScreen( BOOL, sal_Int32 )
{
SetPosSize( 0, 0, VIRTUAL_DESKTOP_WIDTH, VIRTUAL_DESKTOP_HEIGHT,
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
-void SvpSalFrame::StartPresentation( sal_Bool )
+void SvpSalFrame::StartPresentation( BOOL )
{
}
-void SvpSalFrame::SetAlwaysOnTop( sal_Bool )
+void SvpSalFrame::SetAlwaysOnTop( BOOL )
{
}
-void SvpSalFrame::ToTop( sal_uInt16 )
+void SvpSalFrame::ToTop( USHORT )
{
GetFocus();
}
@@ -347,7 +347,7 @@ void SvpSalFrame::SetPointer( PointerStyle )
{
}
-void SvpSalFrame::CaptureMouse( sal_Bool )
+void SvpSalFrame::CaptureMouse( BOOL )
{
}
@@ -367,23 +367,23 @@ void SvpSalFrame::SetInputContext( SalInputContext* )
{
}
-void SvpSalFrame::EndExtTextInput( sal_uInt16 )
+void SvpSalFrame::EndExtTextInput( USHORT )
{
}
-String SvpSalFrame::GetKeyName( sal_uInt16 )
+String SvpSalFrame::GetKeyName( USHORT )
{
return String();
}
-String SvpSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 )
+String SvpSalFrame::GetSymbolKeyName( const XubString&, USHORT )
{
return String();
}
-sal_Bool SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
+BOOL SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
{
- return sal_False;
+ return FALSE;
}
LanguageType SvpSalFrame::GetInputLanguage()
@@ -423,7 +423,7 @@ SalFrame::SalIndicatorState SvpSalFrame::GetIndicatorState()
return aState;
}
-void SvpSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
+void SvpSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
{
}
@@ -447,7 +447,7 @@ void SvpSalFrame::ResetClipRegion()
{
}
-void SvpSalFrame::BeginSetClipRegion( sal_uLong )
+void SvpSalFrame::BeginSetClipRegion( ULONG )
{
}
diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx
index be160626957a..7b4f92a379cc 100644
--- a/vcl/unx/headless/svpframe.hxx
+++ b/vcl/unx/headless/svpframe.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _SVP_SVPFRAME_HXX
#include <vcl/salframe.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
- sal_uLong m_nStyle;
+ ULONG m_nStyle;
bool m_bVisible;
long m_nMinWidth;
long m_nMinHeight;
@@ -51,77 +51,77 @@ class SvpSalFrame : public SalFrame, public SvpElement
long m_nMaxHeight;
SystemEnvData m_aSystemChildData;
-
+
basebmp::BitmapDeviceSharedPtr m_aFrame;
std::list< SvpSalGraphics* > m_aGraphics;
-
+
static SvpSalFrame* s_pFocusFrame;
public:
SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- sal_uLong nSalFrameStyle,
+ ULONG nSalFrameStyle,
SystemParentData* pSystemParent = NULL );
virtual ~SvpSalFrame();
-
+
void GetFocus();
void LoseFocus();
void PostPaint() const;
-
+
// SvpElement
virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; }
// SalFrame
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool PostEvent( void* pData );
+ virtual BOOL PostEvent( void* pData );
- virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( sal_uInt16 nIcon );
- virtual void SetMenu( SalMenu* pMenu );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT nIcon );
+ virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
- virtual void Enable( sal_Bool bEnable );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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, 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 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( sal_Bool bMouse );
- virtual void SetPointerPos( long nX, long nY );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT 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 void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( 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( 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 );
- virtual void Beep( SoundType eSoundType );
- virtual const SystemEnvData* GetSystemData() const;
+ 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 LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
- virtual void SetParent( SalFrame* pNewParent );
- virtual bool SetPluginParent( SystemParentData* pNewParent );
+ virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SetParent( SalFrame* pNewParent );
+ virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
- virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uLong nRects );
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual void EndSetClipRegion();
+ virtual void ResetClipRegion();
+ virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
/*TODO: functional implementation */
virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; }
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 8c9a4e42a65a..301fd2101ff9 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,6 @@
#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>
@@ -64,7 +63,7 @@ rDevice
aBuf.append( "debug" );
mkdir( aBuf.getStr(), 0777 );
aBuf.append( "/" );
- aBuf.append( sal_Int64(reinterpret_cast<sal_IntPtr>(rDevice.get())), 16 );
+ aBuf.append( sal_Int64(reinterpret_cast<sal_uInt32>(rDevice.get())), 16 );
mkdir( aBuf.getStr(), 0777 );
aBuf.append( "/bmp" );
aBuf.append( sal_Int32(dbgStreamNum++) );
@@ -112,7 +111,7 @@ void SvpSalGraphics::setDevice( BitmapDeviceSharedPtr& rDevice )
// determine matching bitmap format for masks
sal_uInt32 nDeviceFmt = m_aDevice->getScanlineFormat();
- DBG_ASSERT( (nDeviceFmt <= (sal_uInt32)Format::MAX), "SVP::setDevice() with invalid bitmap format" );
+ DBG_ASSERT( (nDeviceFmt <= (sal_uInt32)Format::MAX), "SVP::setDevice() with invalid bitmap format" );
switch( nDeviceFmt )
{
case Format::EIGHT_BIT_GREY:
@@ -133,7 +132,7 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIX = rDPIY = 96;
}
-sal_uInt16 SvpSalGraphics::GetBitCount() const
+USHORT SvpSalGraphics::GetBitCount()
{
return SvpElement::getBitCountFromScanlineFormat( m_aDevice->getScanlineFormat() );
}
@@ -154,16 +153,11 @@ void SvpSalGraphics::ResetClipRegion()
m_aClipMap.reset();
}
-bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
+void SvpSalGraphics::BeginSetClipRegion( ULONG n )
{
- if( i_rClip.IsEmpty() )
- m_aClipMap.reset();
- else if( i_rClip.GetRectCount() == 1 )
+ if( n <= 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
{
@@ -171,22 +165,34 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
B2IVector aSize = m_aDevice->getSize();
m_aClipMap = createBitmapDevice( aSize, false, Format::ONE_BIT_MSB_GREY );
m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) );
+ }
+}
- 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 );
- }
+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 );
}
- return true;
+ else
+ {
+ m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
+ basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) );
+ }
+
+ return TRUE;
+}
+
+bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
+{
+ // TODO: implement and advertise OutDevSupport_B2DClip support
+ return false;
+}
+
+void SvpSalGraphics::EndSetClipRegion()
+{
}
void SvpSalGraphics::SetLineColor()
@@ -273,7 +279,7 @@ void SvpSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
aColor,
m_aDrawMode,
m_aClipMap
- );
+ );
dbgOut( m_aDevice );
}
@@ -304,13 +310,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
{
if( m_bUseLineColor && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( sal_uLong i = 1; i < nPoints; i++ )
+ for( 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 );
@@ -318,13 +324,13 @@ void SvpSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
{
if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( sal_uLong i = 1; i < nPoints; i++ )
+ for( ULONG i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
if( m_bUseFillColor )
{
@@ -355,7 +361,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
PCONSTSALPOINT pPoints = pPtAry[nPolygon];
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPoints->mnX, pPoints->mnY ), nPoints );
- for( sal_uInt32 i = 1; i < nPoints; i++ )
+ for( ULONG i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPoints[i].mnX, pPoints[i].mnY ) );
aPolyPoly.append( aPoly );
@@ -383,16 +389,16 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans
return false;
}
-sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uLong,
+sal_Bool SvpSalGraphics::drawPolyLineBezier( ULONG,
const SalPoint*,
- const sal_uInt8* )
+ const BYTE* )
{
return sal_False;
}
-sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uLong,
+sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG,
const SalPoint*,
- const sal_uInt8* )
+ const BYTE* )
{
return sal_False;
}
@@ -400,7 +406,7 @@ sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uLong,
sal_Bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32,
const sal_uInt32*,
const SalPoint* const*,
- const sal_uInt8* const* )
+ const BYTE* const* )
{
return sal_False;
}
@@ -417,7 +423,7 @@ void SvpSalGraphics::copyArea( long nDestX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 /*nFlags*/ )
+ USHORT /*nFlags*/ )
{
B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
@@ -428,7 +434,7 @@ void SvpSalGraphics::copyArea( long nDestX,
void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics )
{
- SvpSalGraphics* pSrc = pSrcGraphics ?
+ SvpSalGraphics* pSrc = pSrcGraphics ?
static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcX+pPosAry->mnSrcWidth,
@@ -436,7 +442,7 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
pPosAry->mnDestX+pPosAry->mnDestWidth,
pPosAry->mnDestY+pPosAry->mnDestHeight );
- m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
+ m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
dbgOut( m_aDevice );
}
@@ -450,7 +456,7 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
pPosAry->mnDestX+pPosAry->mnDestWidth,
pPosAry->mnDestY+pPosAry->mnDestHeight );
- m_aDevice->drawBitmap( rSrc.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
+ m_aDevice->drawBitmap( rSrc.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
dbgOut( m_aDevice );
}
@@ -533,21 +539,21 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
dbgOut( m_aDevice );
}
-void SvpSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ )
+void SvpSalGraphics::invert( 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( sal_uLong i = 1; i < nPoints; i++ )
+ for( 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 );
}
-sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
+BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG )
{
- return sal_False;
+ return FALSE;
}
SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
@@ -556,7 +562,7 @@ SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
-
+
aSysFontData.nSize = sizeof( SystemFontData );
aSysFontData.nFontId = 0;
aSysFontData.nFontFlags = 0;
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index 0489606e9fce..2a05b104d7d2 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@ class SvpSalGraphics : public SalGraphics
bool m_bUseLineColor;
basebmp::Color m_aLineColor;
bool m_bUseFillColor;
- basebmp::Color m_aFillColor;
+ basebmp::Color m_aFillColor;
basebmp::Color m_aTextColor;
basebmp::DrawMode m_aDrawMode;
@@ -58,40 +58,42 @@ protected:
public:
SvpSalGraphics();
- virtual ~SvpSalGraphics();
+ virtual ~SvpSalGraphics();
const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice );
// overload all pure virtual methods
- virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual sal_uInt16 GetBitCount() const;
- virtual long GetGraphicsWidth() const;
-
- virtual void ResetClipRegion();
- virtual bool setClipRegion( const Region& );
-
- virtual void SetLineColor();
- virtual void SetLineColor( SalColor nSalColor );
- virtual void SetFillColor();
-
- virtual void SetFillColor( SalColor nSalColor );
-
- virtual void SetXORMode( bool bSet, bool );
-
- virtual void SetROPLineColor( SalROPColor nROPColor );
- virtual void SetROPFillColor( SalROPColor nROPColor );
-
- virtual void SetTextColor( SalColor nSalColor );
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- 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 sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
+ virtual USHORT GetBitCount();
+ 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 void SetLineColor();
+ virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetFillColor();
+
+ virtual void SetFillColor( SalColor nSalColor );
+
+ virtual void SetXORMode( bool bSet, bool );
+
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual ImplFontCharMap* GetImplFontCharMap() 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,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -100,69 +102,69 @@ public:
FontSubsetInfo& rInfo
);
virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- 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 GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
- 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 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 bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
- virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
- virtual void drawPolyPolygon( sal_uInt32 nPoly,
+ virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
+ virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry );
+ const BYTE* const* pFlgAry );
- virtual void copyArea( long nDestX,
+ virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ USHORT nFlags );
+ virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- 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( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ 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 sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, 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 f4fe1dbdc649..4a48ce77d64d 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/apptypes.hxx>
+#include <vcl/salatype.hxx>
#include <vcl/saldatabasic.hxx>
#include <vcl/solarmutex.hxx>
#include <sal/types.h>
@@ -74,9 +74,9 @@ SvpSalInstance* SvpSalInstance::s_pDefaultInstance = NULL;
SvpSalInstance::SvpSalInstance()
{
- m_aTimeout.tv_sec = 0;
- m_aTimeout.tv_usec = 0;
- m_nTimeoutMS = 0;
+ m_aTimeout.tv_sec = 0;
+ m_aTimeout.tv_usec = 0;
+ m_nTimeoutMS = 0;
m_pTimeoutFDS[0] = m_pTimeoutFDS[1] = -1;
if (pipe (m_pTimeoutFDS) != -1)
@@ -124,7 +124,7 @@ SvpSalInstance::~SvpSalInstance()
osl_destroyMutex( m_aEventGuard );
}
-void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent )
{
if( osl_acquireMutex( m_aEventGuard ) )
{
@@ -134,7 +134,7 @@ void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16
Wakeup();
}
-void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, USHORT 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, sal_uLong t2 )
+inline timeval &operator += ( timeval &t1, 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, sal_uLong nStyle )
+SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, ULONG nStyle )
{
return new SvpSalFrame( this, NULL, nStyle, pParent );
}
-SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
+SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
{
return new SvpSalFrame( this, pParent, nStyle );
}
@@ -252,7 +252,7 @@ void SvpSalInstance::DestroyFrame( SalFrame* pFrame )
delete pFrame;
}
-SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, sal_Bool )
+SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, BOOL )
{
return new SvpSalObject();
}
@@ -264,7 +264,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics*,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData* )
+ USHORT nBitCount, const SystemGraphicsData* )
{
SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount );
pNew->SetSize( nDX, nDY );
@@ -301,13 +301,13 @@ osl::SolarMutex* SvpSalInstance::GetYieldMutex()
return &m_aYieldMutex;
}
-sal_uLong SvpSalInstance::ReleaseYieldMutex()
+ULONG SvpSalInstance::ReleaseYieldMutex()
{
if ( m_aYieldMutex.GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- sal_uLong nCount = m_aYieldMutex.GetAcquireCount();
- sal_uLong n = nCount;
+ ULONG nCount = m_aYieldMutex.GetAcquireCount();
+ ULONG n = nCount;
while ( n )
{
m_aYieldMutex.release();
@@ -320,7 +320,7 @@ sal_uLong SvpSalInstance::ReleaseYieldMutex()
return 0;
}
-void SvpSalInstance::AcquireYieldMutex( sal_uLong nCount )
+void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
{
while ( nCount )
{
@@ -329,25 +329,13 @@ void SvpSalInstance::AcquireYieldMutex( sal_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;
- sal_uLong nAcquireCount = ReleaseYieldMutex();
+ ULONG nAcquireCount = ReleaseYieldMutex();
if( osl_acquireMutex( m_aEventGuard ) )
{
if( ! m_aUserEvents.empty() )
@@ -426,13 +414,31 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
}
}
-bool SvpSalInstance::AnyInput( sal_uInt16 nType )
+bool SvpSalInstance::AnyInput( USHORT 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;
@@ -453,8 +459,8 @@ void* SvpSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
SvpSalYieldMutex::SvpSalYieldMutex()
{
- mnCount = 0;
- mnThreadId = 0;
+ mnCount = 0;
+ mnThreadId = 0;
}
void SvpSalYieldMutex::acquire()
@@ -493,12 +499,12 @@ sal_Bool SvpSalYieldMutex::tryToAcquire()
void SvpSalInstance::StopTimer()
{
- m_aTimeout.tv_sec = 0;
- m_aTimeout.tv_usec = 0;
- m_nTimeoutMS = 0;
+ m_aTimeout.tv_sec = 0;
+ m_aTimeout.tv_usec = 0;
+ m_nTimeoutMS = 0;
}
-void SvpSalInstance::StartTimer( sal_uLong nMS )
+void SvpSalInstance::StartTimer( ULONG nMS )
{
timeval Timeout (m_aTimeout); // previous timeout.
gettimeofday (&m_aTimeout, 0);
@@ -526,7 +532,7 @@ void SvpSalTimer::Stop()
m_pInstance->StopTimer();
}
-void SvpSalTimer::Start( sal_uLong nMS )
+void SvpSalTimer::Start( ULONG nMS )
{
m_pInstance->StartTimer( nMS );
}
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index eaffc99978d6..ac4e9361074e 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,18 +52,18 @@
class SvpSalYieldMutex : public ::vcl::SolarMutexObject
{
protected:
- sal_uLong mnCount;
- oslThreadIdentifier mnThreadId;
+ ULONG mnCount;
+ oslThreadIdentifier mnThreadId;
public:
SvpSalYieldMutex();
- virtual void acquire();
- virtual void release();
- virtual sal_Bool tryToAcquire();
+ virtual void acquire();
+ virtual void release();
+ virtual sal_Bool tryToAcquire();
- sal_uLong GetAcquireCount() const { return mnCount; }
- oslThreadIdentifier GetThreadId() const { return mnThreadId; }
+ 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( sal_uLong nMS );
+ virtual void Start( ULONG nMS );
virtual void Stop();
};
@@ -88,19 +88,19 @@ public:
class SvpSalFrame;
class SvpSalInstance : public SalInstance
{
- timeval m_aTimeout;
- sal_uLong m_nTimeoutMS;
+ timeval m_aTimeout;
+ ULONG m_nTimeoutMS;
int m_pTimeoutFDS[2];
SvpSalYieldMutex m_aYieldMutex;
// internal event queue
struct SalUserEvent
{
- const SalFrame* m_pFrame;
- void* m_pData;
- sal_uInt16 m_nEvent;
-
- SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
+ const SalFrame* m_pFrame;
+ void* m_pData;
+ USHORT m_nEvent;
+
+ SalUserEvent( const SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -109,7 +109,7 @@ class SvpSalInstance : public SalInstance
oslMutex m_aEventGuard;
std::list< SalUserEvent > m_aUserEvents;
-
+
std::list< SalFrame* > m_aFrames;
bool isFrameAlive( const SalFrame* pFrame ) const;
@@ -119,84 +119,85 @@ public:
SvpSalInstance();
virtual ~SvpSalInstance();
-
- void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
- void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
-
- void StartTimer( sal_uLong nMS );
+
+ void PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
+ void CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
+
+ void StartTimer( ULONG nMS );
void StopTimer();
void Wakeup();
-
+
void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); }
void deregisterFrame( SalFrame* pFrame );
const std::list< SalFrame* >& getFrames() const { return m_aFrames; }
-
+
bool CheckTimeout( bool bExecuteTimers = true );
// Frame
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
- virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
- virtual void DestroyObject( SalObject* pObject );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual void DestroyObject( SalObject* pObject );
// VirtualDevice
// nDX and nDY in Pixel
// nBitCount: 0 == Default(=as window) / 1 == Mono
// pData allows for using a system dependent graphics or device context
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+ USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
// Printer
// pSetupData->mpDriverData can be 0
// pSetupData must be updatet with the current
// JobSetup
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
virtual String GetDefaultPrinter();
// SalTimer
- virtual SalTimer* CreateSalTimer();
+ virtual SalTimer* CreateSalTimer();
// SalI18NImeStatus
virtual SalI18NImeStatus* CreateI18NImeStatus();
// SalSystem
- virtual SalSystem* CreateSalSystem();
+ virtual SalSystem* CreateSalSystem();
// SalBitmap
- virtual SalBitmap* CreateSalBitmap();
+ virtual SalBitmap* CreateSalBitmap();
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex();
- virtual sal_uLong ReleaseYieldMutex();
- virtual void AcquireYieldMutex( sal_uLong nCount );
- virtual bool CheckYieldMutex();
+ virtual ULONG ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( ULONG nCount );
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
// and timer
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( sal_uInt16 nType );
+ 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 );
// may return NULL to disable session management
- virtual SalSession* CreateSalSession();
+ virtual SalSession* CreateSalSession();
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
-
- virtual void updatePrinterUpdate();
- virtual void jobStartedPrinterUpdate();
- virtual void jobEndedPrinterUpdate();
};
#endif // _SV_SALINST_HXX
diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx
index 35ca451e432c..8c985d0b37d6 100644
--- a/vcl/unx/headless/svpprn.cxx
+++ b/vcl/unx/headless/svpprn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,12 +45,10 @@
#include <sys/wait.h>
using namespace psp;
-
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
+using namespace rtl;
/*
- * static helpers
+ * static helpers
*/
static String getPdfDir( const PrinterInfo& rInfo )
@@ -78,30 +76,30 @@ inline int TenMuToPt( int nUnits ) { return (int)((((double)nUnits)/35.27777778)
static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
{
- pJobSetup->meOrientation = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
+ pJobSetup->meOrientation = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
// copy page size
String aPaper;
int width, height;
rData.m_aContext.getPageSize( aPaper, width, height );
- pJobSetup->mePaperFormat = PaperInfo::fromPSName(OUStringToOString( aPaper, RTL_TEXTENCODING_ISO_8859_1 ));
- pJobSetup->mnPaperWidth = 0;
- pJobSetup->mnPaperHeight = 0;
+ pJobSetup->mePaperFormat = PaperInfo::fromPSName(OUStringToOString( aPaper, RTL_TEXTENCODING_ISO_8859_1 ));
+ pJobSetup->mnPaperWidth = 0;
+ pJobSetup->mnPaperHeight = 0;
if( pJobSetup->mePaperFormat == PAPER_USER )
{
// transform to 100dth mm
- width = PtTo10Mu( width );
- height = PtTo10Mu( height );
+ width = PtTo10Mu( width );
+ height = PtTo10Mu( height );
if( rData.m_eOrientation == psp::orientation::Portrait )
{
- pJobSetup->mnPaperWidth = width;
+ pJobSetup->mnPaperWidth = width;
pJobSetup->mnPaperHeight= height;
}
else
{
- pJobSetup->mnPaperWidth = height;
+ pJobSetup->mnPaperWidth = height;
pJobSetup->mnPaperHeight= width;
}
}
@@ -112,9 +110,9 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->mnPaperBin = 0xffff;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
if( pKey )
- pValue = rData.m_aContext.getValue( pKey );
+ pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
{
for( pJobSetup->mnPaperBin = 0;
@@ -129,7 +127,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
// copy duplex
pKey = NULL;
pValue = NULL;
-
+
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser )
pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) );
@@ -162,7 +160,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
+ pJobSetup->mpDriverData = (BYTE*)pBuffer;
}
else
{
@@ -171,17 +169,155 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
}
}
+static bool passFileToCommandLine( const String& rFilename, const String& rCommandLine, bool bRemoveFile = true )
+{
+ bool bSuccess = false;
+
+ rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
+ ByteString aCmdLine( rCommandLine, aEncoding );
+ ByteString aFilename( rFilename, aEncoding );
+
+ bool bPipe = aCmdLine.Search( "(TMP)" ) != STRING_NOTFOUND ? false : true;
+
+ // setup command line for exec
+ if( ! bPipe )
+ while( aCmdLine.SearchAndReplace( "(TMP)", aFilename ) != STRING_NOTFOUND )
+ ;
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "%s commandline: \"%s\"\n",
+ bPipe ? "piping to" : "executing",
+ aCmdLine.GetBuffer() );
+ struct stat aStat;
+ if( stat( aFilename.GetBuffer(), &aStat ) )
+ fprintf( stderr, "stat( %s ) failed\n", aFilename.GetBuffer() );
+ fprintf( stderr, "Tmp file %s has modes: 0%03lo\n", aFilename.GetBuffer(), (long)aStat.st_mode );
+#endif
+ const char* argv[4];
+ if( ! ( argv[ 0 ] = getenv( "SHELL" ) ) )
+ argv[ 0 ] = "/bin/sh";
+ argv[ 1 ] = "-c";
+ argv[ 2 ] = aCmdLine.GetBuffer();
+ argv[ 3 ] = 0;
+
+ bool bHavePipes = false;
+ int pid, fd[2];
+
+ if( bPipe )
+ bHavePipes = pipe( fd ) ? false : true;
+ if( ( pid = fork() ) > 0 )
+ {
+ if( bPipe && bHavePipes )
+ {
+ close( fd[0] );
+ char aBuffer[ 2048 ];
+ FILE* fp = fopen( aFilename.GetBuffer(), "r" );
+ while( fp && ! feof( fp ) )
+ {
+ int nBytes = fread( aBuffer, 1, sizeof( aBuffer ), fp );
+ if( nBytes )
+ write( fd[ 1 ], aBuffer, nBytes );
+ }
+ fclose( fp );
+ close( fd[ 1 ] );
+ }
+ int status = 0;
+ waitpid( pid, &status, 0 );
+ if( ! status )
+ bSuccess = true;
+ }
+ else if( ! pid )
+ {
+ if( bPipe && bHavePipes )
+ {
+ close( fd[1] );
+ if( fd[0] != STDIN_FILENO ) // not probable, but who knows :)
+ dup2( fd[0], STDIN_FILENO );
+ }
+ execv( argv[0], const_cast<char**>(argv) );
+ fprintf( stderr, "failed to execute \"%s\"\n", aCmdLine.GetBuffer() );
+ _exit( 1 );
+ }
+ else
+ fprintf( stderr, "failed to fork\n" );
+
+ // clean up the mess
+ if( bRemoveFile )
+ unlink( aFilename.GetBuffer() );
+
+ return bSuccess;
+}
+
+static bool sendAFax( const String& rFaxNumber, const String& rFileName, const String& rCommand )
+{
+ std::list< OUString > aFaxNumbers;
+
+ if( ! rFaxNumber.Len() )
+ return false;
+
+ sal_Int32 nIndex = 0;
+ OUString aFaxes( rFaxNumber );
+ OUString aBeginToken( RTL_CONSTASCII_USTRINGPARAM("<Fax#>") );
+ OUString aEndToken( RTL_CONSTASCII_USTRINGPARAM("</Fax#>") );
+ while( nIndex != -1 )
+ {
+ nIndex = aFaxes.indexOf( aBeginToken, nIndex );
+ if( nIndex != -1 )
+ {
+ sal_Int32 nBegin = nIndex + aBeginToken.getLength();
+ nIndex = aFaxes.indexOf( aEndToken, nIndex );
+ if( nIndex != -1 )
+ {
+ aFaxNumbers.push_back( aFaxes.copy( nBegin, nIndex-nBegin ) );
+ nIndex += aEndToken.getLength();
+ }
+ }
+ }
+
+ bool bSuccess = true;
+ if( aFaxNumbers.begin() != aFaxNumbers.end() )
+ {
+ while( aFaxNumbers.begin() != aFaxNumbers.end() && bSuccess )
+ {
+ String aCmdLine( rCommand );
+ String aFaxNumber( aFaxNumbers.front() );
+ aFaxNumbers.pop_front();
+ while( aCmdLine.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(PHONE)" ) ), aFaxNumber ) != STRING_NOTFOUND )
+ ;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "sending fax to \"%s\"\n", OUStringToOString( aFaxNumber, osl_getThreadTextEncoding() ).getStr() );
+#endif
+ bSuccess = passFileToCommandLine( rFileName, aCmdLine, false );
+ }
+ }
+ else
+ bSuccess = false;
+
+ // clean up temp file
+ unlink( ByteString( rFileName, osl_getThreadTextEncoding() ).GetBuffer() );
+
+ return bSuccess;
+}
+
+static bool createPdf( const String& rToFile, const String& rFromFile, const String& rCommandLine )
+{
+ String aCommandLine( rCommandLine );
+ while( aCommandLine.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(OUTFILE)" ) ), rToFile ) != STRING_NOTFOUND )
+ ;
+ return passFileToCommandLine( rFromFile, aCommandLine );
+}
+
/*
- * SalInstance
+ * SalInstance
*/
// -----------------------------------------------------------------------
-SalInfoPrinter* SvpSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
- ImplJobSetup* pJobSetup )
+SalInfoPrinter* SvpSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ ImplJobSetup* pJobSetup )
{
// create and initialize SalInfoPrinter
- SvpSalInfoPrinter* pPrinter = new SvpSalInfoPrinter;
+ PspSalInfoPrinter* pPrinter = new PspSalInfoPrinter;
if( pJobSetup )
{
@@ -193,14 +329,14 @@ SalInfoPrinter* SvpSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
if( pJobSetup->mpDriverData )
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aInfo );
- pJobSetup->mnSystem = JOBSETUP_SYSTEM_UNIX;
- pJobSetup->maPrinterName = pQueueInfo->maPrinterName;
- pJobSetup->maDriver = aInfo.m_aDriverName;
+ pJobSetup->mnSystem = JOBSETUP_SYSTEM_UNIX;
+ pJobSetup->maPrinterName = pQueueInfo->maPrinterName;
+ pJobSetup->maDriver = aInfo.m_aDriverName;
copyJobDataToJobSetup( pJobSetup, aInfo );
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
- boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
if( compat_it != pJobSetup->maValueMap.end() )
{
@@ -226,8 +362,8 @@ void SvpSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
SalPrinter* SvpSalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter )
{
// create and initialize SalPrinter
- SvpSalPrinter* pPrinter = new SvpSalPrinter( pInfoPrinter );
- pPrinter->m_aJobData = static_cast<SvpSalInfoPrinter*>(pInfoPrinter)->m_aJobData;
+ PspSalPrinter* pPrinter = new PspSalPrinter( pInfoPrinter );
+ pPrinter->m_aJobData = static_cast<PspSalInfoPrinter*>(pInfoPrinter)->m_aJobData;
return pPrinter;
}
@@ -258,11 +394,11 @@ void SvpSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
const PrinterInfo& rInfo( rManager.getPrinterInfo( *it ) );
// Neuen Eintrag anlegen
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
- pInfo->maPrinterName = *it;
- pInfo->maDriver = rInfo.m_aDriverName;
- pInfo->maLocation = rInfo.m_aLocation;
- pInfo->maComment = rInfo.m_aComment;
- pInfo->mpSysData = NULL;
+ pInfo->maPrinterName = *it;
+ pInfo->maDriver = rInfo.m_aDriverName;
+ pInfo->maLocation = rInfo.m_aLocation;
+ pInfo->maComment = rInfo.m_aComment;
+ pInfo->mpSysData = NULL;
sal_Int32 nIndex = 0;
while( nIndex != -1 )
@@ -300,37 +436,574 @@ String SvpSalInstance::GetDefaultPrinter()
return rManager.getDefaultPrinter();
}
+// =======================================================================
+
+PspSalInfoPrinter::PspSalInfoPrinter()
+{
+ m_pGraphics = NULL;
+ m_bPapersInit = false;
+}
+
+// -----------------------------------------------------------------------
+
+PspSalInfoPrinter::~PspSalInfoPrinter()
+{
+ if( m_pGraphics )
+ {
+ delete m_pGraphics;
+ m_pGraphics = NULL;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* )
+{
+ m_aPaperFormats.clear();
+ m_bPapersInit = true;
+
+ if( m_aJobData.m_pParser )
+ {
+ const PPDKey* pKey = m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ if( pKey )
+ {
+ int nValues = pKey->countValues();
+ for( int i = 0; i < nValues; i++ )
+ {
+ const PPDValue* pValue = pKey->getValue( i );
+ int nWidth = 0, nHeight = 0;
+ m_aJobData.m_pParser->getPaperDimension( pValue->m_aOption, nWidth, nHeight );
+ PaperInfo aInfo(PtTo10Mu( nWidth ), PtTo10Mu( nHeight ));
+ m_aPaperFormats.push_back( aInfo );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+int PspSalInfoPrinter::GetLandscapeAngle( const ImplJobSetup* )
+{
+ return 900;
+}
+
+// -----------------------------------------------------------------------
+
+SalGraphics* PspSalInfoPrinter::GetGraphics()
+{
+ // return a valid pointer only once
+ // the reasoning behind this is that we could have different
+ // SalGraphics that can run in multiple threads
+ // (future plans)
+ SalGraphics* pRet = NULL;
+ if( ! m_pGraphics )
+ {
+ m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, NULL, false, this );
+ m_pGraphics->SetLayout( 0 );
+ pRet = m_pGraphics;
+ }
+ return pRet;
+}
+
+// -----------------------------------------------------------------------
+
+void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics )
+{
+ if( pGraphics == m_pGraphics )
+ {
+ delete pGraphics;
+ m_pGraphics = NULL;
+ }
+ return;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL PspSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+// This function gets the driver data and puts it into pJobSetup
+// If pJobSetup->mpDriverData is NOT NULL, then the independend
+// 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 )
+{
+ if( pJobSetup->mpDriverData )
+ return SetData( ~0, pJobSetup );
+
+ copyJobDataToJobSetup( pJobSetup, m_aJobData );
+
+ // set/clear backwards compatibility flag
+ bool bStrictSO52Compatibility = false;
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
+ if( compat_it != pJobSetup->maValueMap.end() )
+ {
+ if( compat_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
+ bStrictSO52Compatibility = true;
+ }
+ m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
+
+ return TRUE;
+}
+
// -----------------------------------------------------------------------
-sal_Bool SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
+// This function merges the independ driver data
+// 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,
+ ImplJobSetup* pJobSetup )
{
- return sal_False;
+ JobData aData;
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+
+ if( aData.m_pParser )
+ {
+ const PPDKey* pKey;
+ const PPDValue* pValue;
+
+ // merge papersize if necessary
+ if( nSetDataFlags & SAL_JOBSET_PAPERSIZE )
+ {
+ int nWidth, nHeight;
+ if( pJobSetup->meOrientation == ORIENTATION_PORTRAIT )
+ {
+ nWidth = pJobSetup->mnPaperWidth;
+ nHeight = pJobSetup->mnPaperHeight;
+ }
+ else
+ {
+ nWidth = pJobSetup->mnPaperHeight;
+ nHeight = pJobSetup->mnPaperWidth;
+ }
+ String aPaper;
+
+ if( pJobSetup->mePaperFormat == PAPER_USER )
+ aPaper = aData.m_pParser->matchPaper(
+ TenMuToPt( pJobSetup->mnPaperWidth ),
+ TenMuToPt( pJobSetup->mnPaperHeight ) );
+ else
+ aPaper = rtl::OStringToOUString(PaperInfo::toPSName(pJobSetup->mePaperFormat), RTL_TEXTENCODING_ISO_8859_1);
+
+ pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ pValue = pKey ? pKey->getValue( aPaper ) : NULL;
+ if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) )
+ return FALSE;
+ }
+
+ // merge paperbin if necessary
+ if( nSetDataFlags & SAL_JOBSET_PAPERBIN )
+ {
+ pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ if( pKey )
+ {
+ int nPaperBin = pJobSetup->mnPaperBin;
+ if( nPaperBin == 0xffff )
+ pValue = pKey->getDefaultValue();
+ else
+ pValue = pKey->getValue( pJobSetup->mnPaperBin );
+
+ // may fail due to constraints;
+ // real paper bin is copied back to jobsetup in that case
+ aData.m_aContext.setValue( pKey, pValue );
+ }
+ // if printer has no InputSlot key simply ignore this setting
+ // (e.g. SGENPRT has no InputSlot)
+ }
+
+ // merge orientation if necessary
+ if( nSetDataFlags & SAL_JOBSET_ORIENTATION )
+ aData.m_eOrientation = pJobSetup->meOrientation == ORIENTATION_LANDSCAPE ? orientation::Landscape : orientation::Portrait;
+
+ // merge duplex if necessary
+ if( nSetDataFlags & SAL_JOBSET_DUPLEXMODE )
+ {
+ pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) );
+ if( pKey )
+ {
+ pValue = NULL;
+ switch( pJobSetup->meDuplexMode )
+ {
+ case DUPLEX_OFF:
+ pValue = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
+ if( pValue == NULL )
+ pValue = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "SimplexNoTumble" ) ) );
+ break;
+ case DUPLEX_SHORTEDGE:
+ pValue = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "DuplexTumble" ) ) );
+ break;
+ case DUPLEX_LONGEDGE:
+ pValue = pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "DuplexNoTumble" ) ) );
+ break;
+ case DUPLEX_UNKNOWN:
+ default:
+ pValue = 0;
+ break;
+ }
+ if( ! pValue )
+ pValue = pKey->getDefaultValue();
+ aData.m_aContext.setValue( pKey, pValue );
+ }
+ }
+
+ m_aJobData = aData;
+ copyJobDataToJobSetup( pJobSetup, aData );
+ return TRUE;
+ }
+
+ return FALSE;
}
+// -----------------------------------------------------------------------
+
+void PspSalInfoPrinter::GetPageInfo(
+ const ImplJobSetup* pJobSetup,
+ long& rOutWidth, long& rOutHeight,
+ long& rPageOffX, long& rPageOffY,
+ long& rPageWidth, long& rPageHeight )
+{
+ if( ! pJobSetup )
+ return;
+
+ JobData aData;
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+
+ // get the selected page size
+ if( aData.m_pParser )
+ {
+
+ String aPaper;
+ int width, height;
+ int left = 0, top = 0, right = 0, bottom = 0;
+ int nDPI = aData.m_aContext.getRenderResolution();
+
+
+ if( aData.m_eOrientation == psp::orientation::Portrait )
+ {
+ aData.m_aContext.getPageSize( aPaper, width, height );
+ aData.m_pParser->getMargins( aPaper, left, right, top, bottom );
+ }
+ else
+ {
+ aData.m_aContext.getPageSize( aPaper, height, width );
+ aData.m_pParser->getMargins( aPaper, top, bottom, right, left );
+ }
+
+ rPageWidth = width * nDPI / 72;
+ rPageHeight = height * nDPI / 72;
+ rPageOffX = left * nDPI / 72;
+ rPageOffY = top * nDPI / 72;
+ rOutWidth = ( width - left - right ) * nDPI / 72;
+ rOutHeight = ( height - top - bottom ) * nDPI / 72;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
+{
+ if( ! pJobSetup )
+ return 0;
+
+ JobData aData;
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+
+ const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
+ return pKey ? pKey->countValues() : 0;
+}
+
+// -----------------------------------------------------------------------
+
+String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin )
+{
+ JobData aData;
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+
+ String aRet;
+ if( aData.m_pParser )
+ {
+ const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
+ if( nPaperBin == 0xffff || ! pKey )
+ aRet = aData.m_pParser->getDefaultInputSlot();
+ else
+ {
+ const PPDValue* pValue = pKey->getValue( nPaperBin );
+ if( pValue )
+ aRet = aData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption );
+ }
+ }
+
+ return aRet;
+}
+
+// -----------------------------------------------------------------------
+
+ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType )
+{
+ switch( nType )
+ {
+ case PRINTER_CAPABILITIES_SUPPORTDIALOG:
+ return 1;
+ case PRINTER_CAPABILITIES_COPIES:
+ return 0xffff;
+ case PRINTER_CAPABILITIES_COLLATECOPIES:
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData;
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+
+ const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) ) : NULL;
+ const PPDValue* pVal = pKey ? pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) ) : NULL;
+
+ // PPDs don't mention the number of possible collated copies.
+ // so let's guess as many as we want ?
+ return pVal ? 0xffff : 0;
+ }
+ case PRINTER_CAPABILITIES_SETORIENTATION:
+ return 1;
+ case PRINTER_CAPABILITIES_SETDUPLEX:
+ return 1;
+ case PRINTER_CAPABILITIES_SETPAPERBIN:
+ return 1;
+ case PRINTER_CAPABILITIES_SETPAPERSIZE:
+ return 1;
+ case PRINTER_CAPABILITIES_SETPAPER:
+ return 0;
+ case PRINTER_CAPABILITIES_FAX:
+ {
+ PrinterInfoManager& rManager = PrinterInfoManager::get();
+ PrinterInfo aInfo( rManager.getPrinterInfo( pJobSetup->maPrinterName ) );
+ String aFeatures( aInfo.m_aFeatures );
+ int nTokenCount = aFeatures.GetTokenCount( ',' );
+ for( int i = 0; i < nTokenCount; i++ )
+ {
+ if( aFeatures.GetToken( i ).CompareToAscii( "fax", 3 ) == COMPARE_EQUAL )
+ return 1;
+ }
+ return 0;
+ }
+ case PRINTER_CAPABILITIES_PDF:
+ {
+ PrinterInfoManager& rManager = PrinterInfoManager::get();
+ PrinterInfo aInfo( rManager.getPrinterInfo( pJobSetup->maPrinterName ) );
+ String aFeatures( aInfo.m_aFeatures );
+ int nTokenCount = aFeatures.GetTokenCount( ',' );
+ for( int i = 0; i < nTokenCount; i++ )
+ {
+ if( aFeatures.GetToken( i ).CompareToAscii( "pdf=", 4 ) == COMPARE_EQUAL )
+ return 1;
+ }
+ return 0;
+ }
+ default: break;
+ };
+ return 0;
+}
+
+// =======================================================================
+
/*
- * svp::PrinterUpdate
+ * SalPrinter
*/
-namespace svp
+PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter )
+ : m_bFax( false ),
+ m_bPdf( false ),
+ m_bSwallowFaxNo( false ),
+ m_pGraphics( NULL ),
+ m_nCopies( 1 ),
+ m_bCollate( false ),
+ m_pInfoPrinter( pInfoPrinter )
{
- class PrinterUpdate
+}
+
+// -----------------------------------------------------------------------
+
+PspSalPrinter::~PspSalPrinter()
+{
+}
+
+// -----------------------------------------------------------------------
+
+static String getTmpName()
+{
+ rtl::OUString aTmp, aSys;
+ osl_createTempFile( NULL, NULL, &aTmp.pData );
+ osl_getSystemPathFromFileURL( aTmp.pData, &aSys.pData );
+
+ return aSys;
+}
+
+BOOL PspSalPrinter::StartJob(
+ const XubString* pFileName,
+ const XubString& rJobName,
+ const XubString& rAppName,
+ ULONG nCopies,
+ bool bCollate,
+ bool /*bDirect*/,
+ ImplJobSetup* pJobSetup )
+{
+ vcl_sal::PrinterUpdate::jobStarted();
+
+ m_bFax = false;
+ m_bPdf = false;
+ m_aFileName = pFileName ? *pFileName : String();
+ m_aTmpFile = String();
+ m_nCopies = nCopies;
+ m_bCollate = bCollate;
+
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
+ if( m_nCopies > 1 )
{
- static Timer* pPrinterUpdateTimer;
- static int nActiveJobs;
+ // in case user did not do anything (m_nCopies=1)
+ // take the default from jobsetup
+ m_aJobData.m_nCopies = m_nCopies;
+ m_aJobData.setCollate( bCollate );
+ }
- static void doUpdate();
- DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* );
- public:
- static void update();
- static void jobStarted() { nActiveJobs++; }
- static void jobEnded();
- };
+ // check wether this printer is configured as fax
+ int nMode = 0;
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ sal_Int32 nIndex = 0;
+ while( nIndex != -1 )
+ {
+ OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
+ if( ! aToken.compareToAscii( "fax", 3 ) )
+ {
+ m_bFax = true;
+ m_aTmpFile = getTmpName();
+ nMode = S_IRUSR | S_IWUSR;
+
+ ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ it = pJobSetup->maValueMap.find( ::rtl::OUString::createFromAscii( "FAX#" ) );
+ if( it != pJobSetup->maValueMap.end() )
+ m_aFaxNr = it->second;
+
+ sal_Int32 nPos = 0;
+ m_bSwallowFaxNo = ! aToken.getToken( 1, '=', nPos ).compareToAscii( "swallow", 7 ) ? true : false;
+
+ break;
+ }
+ if( ! aToken.compareToAscii( "pdf=", 4 ) )
+ {
+ m_bPdf = true;
+ m_aTmpFile = getTmpName();
+ nMode = S_IRUSR | S_IWUSR;
+
+ if( ! m_aFileName.Len() )
+ {
+ m_aFileName = getPdfDir( rInfo );
+ m_aFileName.Append( '/' );
+ m_aFileName.Append( rJobName );
+ m_aFileName.AppendAscii( ".pdf" );
+ }
+ break;
+ }
+ }
+ m_aPrinterGfx.Init( m_aJobData );
+
+ // set/clear backwards compatibility flag
+ bool bStrictSO52Compatibility = false;
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
+ if( compat_it != pJobSetup->maValueMap.end() )
+ {
+ if( compat_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
+ bStrictSO52Compatibility = true;
+ }
+ m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
+
+ return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, false ) ? TRUE : FALSE;
}
-Timer* svp::PrinterUpdate::pPrinterUpdateTimer = NULL;
-int svp::PrinterUpdate::nActiveJobs = 0;
+// -----------------------------------------------------------------------
-void svp::PrinterUpdate::doUpdate()
+BOOL PspSalPrinter::EndJob()
+{
+ BOOL bSuccess = m_aPrintJob.EndJob();
+
+ if( bSuccess )
+ {
+ // 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 );
+ }
+ }
+ vcl_sal::PrinterUpdate::jobEnded();
+ return bSuccess;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL PspSalPrinter::AbortJob()
+{
+ BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE;
+ vcl_sal::PrinterUpdate::jobEnded();
+ return bAbort;
+}
+
+// -----------------------------------------------------------------------
+
+SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, 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 );
+ m_pGraphics->SetLayout( 0 );
+ if( m_nCopies > 1 )
+ {
+ // in case user did not do anything (m_nCopies=1)
+ // take the default from jobsetup
+ m_aJobData.m_nCopies = m_nCopies;
+ m_aJobData.setCollate( m_nCopies > 1 && m_bCollate );
+ }
+
+ m_aPrintJob.StartPage( m_aJobData );
+ m_aPrinterGfx.Init( m_aPrintJob );
+
+ return m_pGraphics;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL PspSalPrinter::EndPage()
+{
+ sal_Bool bResult = m_aPrintJob.EndPage();
+ m_aPrinterGfx.Clear();
+ return bResult ? TRUE : FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+ULONG PspSalPrinter::GetErrorCode()
+{
+ return 0;
+}
+
+/*
+ * vcl::PrinterUpdate
+ */
+
+Timer* vcl_sal::PrinterUpdate::pPrinterUpdateTimer = NULL;
+int vcl_sal::PrinterUpdate::nActiveJobs = 0;
+
+void vcl_sal::PrinterUpdate::doUpdate()
{
::psp::PrinterInfoManager& rManager( ::psp::PrinterInfoManager::get() );
if( rManager.checkPrintersChanged( false ) && SvpSalInstance::s_pDefaultInstance )
@@ -344,7 +1017,7 @@ void svp::PrinterUpdate::doUpdate()
// -----------------------------------------------------------------------
-IMPL_STATIC_LINK_NOINSTANCE( svp::PrinterUpdate, UpdateTimerHdl, void*, )
+IMPL_STATIC_LINK_NOINSTANCE( vcl_sal::PrinterUpdate, UpdateTimerHdl, void*, )
{
if( nActiveJobs < 1 )
{
@@ -360,12 +1033,12 @@ IMPL_STATIC_LINK_NOINSTANCE( svp::PrinterUpdate, UpdateTimerHdl, void*, )
// -----------------------------------------------------------------------
-void svp::PrinterUpdate::update()
+void vcl_sal::PrinterUpdate::update()
{
if( Application::GetSettings().GetMiscSettings().GetDisablePrinting() )
return;
- static bool bOnce = false;
+ static bool bOnce = false;
if( ! bOnce )
{
bOnce = true;
@@ -373,26 +1046,21 @@ void svp::PrinterUpdate::update()
psp::PrinterInfoManager::get();
return;
}
-
+
if( nActiveJobs < 1 )
doUpdate();
else if( ! pPrinterUpdateTimer )
{
pPrinterUpdateTimer = new Timer();
pPrinterUpdateTimer->SetTimeout( 500 );
- pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, svp::PrinterUpdate, UpdateTimerHdl ) );
+ pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, vcl_sal::PrinterUpdate, UpdateTimerHdl ) );
pPrinterUpdateTimer->Start();
}
}
-void SvpSalInstance::updatePrinterUpdate()
-{
- svp::PrinterUpdate::update();
-}
-
// -----------------------------------------------------------------------
-void svp::PrinterUpdate::jobEnded()
+void vcl_sal::PrinterUpdate::jobEnded()
{
nActiveJobs--;
if( nActiveJobs < 1 )
@@ -407,14 +1075,4 @@ void svp::PrinterUpdate::jobEnded()
}
}
-void SvpSalInstance::jobStartedPrinterUpdate()
-{
- svp::PrinterUpdate::jobStarted();
-}
-
-void SvpSalInstance::jobEndedPrinterUpdate()
-{
- svp::PrinterUpdate::jobEnded();
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx
index 3a143443a599..75359178cfbc 100644
--- a/vcl/unx/headless/svpprn.hxx
+++ b/vcl/unx/headless/svpprn.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,21 +33,88 @@
#include "vcl/printergfx.hxx"
#include "vcl/printerjob.hxx"
#include "vcl/salprn.hxx"
-#include "salprn.h"
class PspGraphics;
-class SvpSalInfoPrinter : public PspSalInfoPrinter
+class PspSalInfoPrinter : public SalInfoPrinter
{
public:
- virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ PspGraphics* m_pGraphics;
+ psp::JobData m_aJobData;
+ psp::PrinterGfx m_aPrinterGfx;
+
+ PspSalInfoPrinter();
+ virtual ~PspSalInfoPrinter();
+
+ // 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 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 void InitPaperFormats( const ImplJobSetup* pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
-class SvpSalPrinter : public PspSalPrinter
+class PspSalPrinter : public SalPrinter
{
public:
- SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {}
+ String m_aFileName;
+ String m_aTmpFile;
+ String m_aFaxNr;
+ bool m_bFax:1;
+ bool m_bPdf:1;
+ bool m_bSwallowFaxNo:1;
+ PspGraphics* m_pGraphics;
+ psp::PrinterJob m_aPrintJob;
+ psp::JobData m_aJobData;
+ psp::PrinterGfx m_aPrinterGfx;
+ ULONG m_nCopies;
+ bool m_bCollate;
+ SalInfoPrinter* m_pInfoPrinter;
+
+ PspSalPrinter( SalInfoPrinter* );
+ virtual ~PspSalPrinter();
+
+ // overload all pure virtual methods
+ using SalPrinter::StartJob;
+ virtual BOOL StartJob( const XubString* pFileName,
+ const XubString& rJobName,
+ const XubString& rAppName,
+ ULONG 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();
+};
+
+class Timer;
+
+namespace vcl_sal {
+class VCL_DLLPUBLIC PrinterUpdate
+{
+ static Timer* pPrinterUpdateTimer;
+ static int nActiveJobs;
+
+ static void doUpdate();
+ DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* );
+public:
+ static void update();
+ static void jobStarted() { nActiveJobs++; }
+ static void jobEnded();
};
+}
#endif // _SVP_SVPPRN_HXX
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 7200019db9d2..a7b3c11a0bc3 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,6 @@
#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"
@@ -58,10 +57,10 @@
#include <sys/types.h>
using namespace psp;
+using namespace rtl;
using namespace basebmp;
using namespace basegfx;
-using ::rtl::OUString;
-using ::rtl::OString;
+
// ----- Implementation of PrinterBmp by means of SalBitmap/BitmapBuffer ---------------
class SalPrinterBmp : public psp::PrinterBmp
@@ -73,19 +72,19 @@ class SalPrinterBmp : public psp::PrinterBmp
public:
SalPrinterBmp (const BitmapDeviceSharedPtr& rDevice);
- virtual ~SalPrinterBmp ();
- virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const;
- virtual sal_uInt32 GetPaletteEntryCount () const;
- virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt32 GetWidth () const;
- virtual sal_uInt32 GetHeight() const;
- virtual sal_uInt32 GetDepth () const;
-
+ virtual ~SalPrinterBmp ();
+ virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const;
+ virtual sal_uInt32 GetPaletteEntryCount () const;
+ virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt32 GetWidth () const;
+ virtual sal_uInt32 GetHeight() const;
+ virtual sal_uInt32 GetDepth () const;
+
static sal_uInt32 getRGBFromColor( const basebmp::Color& rCol )
{
- return ((rCol.getBlue()) & 0x000000ff)
+ return ((rCol.getBlue()) & 0x000000ff)
| ((rCol.getGreen() << 8) & 0x0000ff00)
| ((rCol.getRed() << 16) & 0x00ff0000);
}
@@ -206,7 +205,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-sal_uInt16 PspGraphics::GetBitCount() const
+USHORT PspGraphics::GetBitCount()
{
return m_pPrinterGfx->GetBitCount();
}
@@ -218,27 +217,28 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion();
+ m_pPrinterGfx->ResetClipRegion ();
}
-bool PspGraphics::setClipRegion( const Region& i_rClip )
+void PspGraphics::BeginSetClipRegion( ULONG n )
{
- // TODO: support polygonal clipregions here
- m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
+ m_pPrinterGfx->BeginSetClipRegion(n);
+}
- 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;
+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;
+}
+
+void PspGraphics::EndSetClipRegion()
+{
+ m_pPrinterGfx->EndSetClipRegion ();
}
void PspGraphics::SetLineColor()
@@ -306,18 +306,18 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
+void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32 *pPoints,
PCONSTSALPOINT *pPtAry )
{
@@ -330,13 +330,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -345,10 +345,10 @@ sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtA
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry )
+ const BYTE* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
return sal_True;
}
@@ -358,13 +358,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra
return false;
}
-void PspGraphics::invert( sal_uLong /*nPoints*/,
+void PspGraphics::invert( ULONG /*nPoints*/,
const SalPoint* /*pPtAry*/,
SalInvert /*nFlags*/ )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
+BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -372,15 +372,15 @@ sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void
void PspGraphics::copyBits( const SalTwoRect* /*pPosAry*/,
SalGraphics* /*pSSrcGraphics*/ )
{
- OSL_FAIL( "Error: PrinterGfx::CopyBits() not implemented" );
+ DBG_ERROR( "Error: PrinterGfx::CopyBits() not implemented" );
}
void PspGraphics::copyArea ( long /*nDestX*/, long /*nDestY*/,
long /*nSrcX*/, long /*nSrcY*/,
long /*nSrcWidth*/, long /*nSrcHeight*/,
- sal_uInt16 /*nFlags*/ )
+ USHORT /*nFlags*/ )
{
- OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
+ DBG_ERROR( "Error: PrinterGfx::CopyArea() not implemented" );
}
void PspGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
@@ -402,21 +402,21 @@ void PspGraphics::drawBitmap( const SalTwoRect* /*pPosAry*/,
const SalBitmap& /*rSalBitmap*/,
const SalBitmap& /*rTransBitmap*/ )
{
- OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent bitmap");
+ DBG_ERROR("Error: no PrinterGfx::DrawBitmap() for transparent bitmap");
}
void PspGraphics::drawBitmap( const SalTwoRect* /*pPosAry*/,
const SalBitmap& /*rSalBitmap*/,
SalColor /*nTransparentColor*/ )
{
- OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent color");
+ DBG_ERROR("Error: no PrinterGfx::DrawBitmap() for transparent color");
}
void PspGraphics::drawMask( const SalTwoRect* /*pPosAry*/,
const SalBitmap& /*rSalBitmap*/,
SalColor /*nMaskColor*/ )
{
- OSL_FAIL("Error: PrinterGfx::DrawMask() not implemented");
+ DBG_ERROR("Error: PrinterGfx::DrawMask() not implemented");
}
SalBitmap* PspGraphics::getBitmap( long /*nX*/, long /*nY*/, long /*nDX*/, long /*nDY*/ )
@@ -427,18 +427,18 @@ SalBitmap* PspGraphics::getBitmap( long /*nX*/, long /*nY*/, long /*nDX*/, long
SalColor PspGraphics::getPixel( long /*nX*/, long /*nY*/ )
{
- OSL_FAIL("Warning: PrinterGfx::GetPixel() not implemented");
+ DBG_ERROR ("Warning: PrinterGfx::GetPixel() not implemented");
return 0;
}
void PspGraphics::invert(
- long /*nX*/,
- long /*nY*/,
- long /*nDX*/,
- long /*nDY*/,
- SalInvert /*nFlags*/ )
+ long /*nX*/,
+ long /*nY*/,
+ long /*nDX*/,
+ long /*nDY*/,
+ SalInvert /*nFlags*/ )
{
- OSL_FAIL("Warning: PrinterGfx::Invert() not implemented");
+ DBG_ERROR ("Warning: PrinterGfx::Invert() not implemented");
}
//==========================================================================
@@ -500,8 +500,8 @@ PspFontLayout::PspFontLayout( ::psp::PrinterGfx& rGfx )
mnFontHeight = mrPrinterGfx.GetFontHeight();
mnFontWidth = mrPrinterGfx.GetFontWidth();
mbVertical = mrPrinterGfx.GetFontVertical();
- mbArtItalic = mrPrinterGfx.GetArtificialItalic();
- mbArtBold = mrPrinterGfx.GetArtificialBold();
+ mbArtItalic = mrPrinterGfx.GetArtificialItalic();
+ mbArtBold = mrPrinterGfx.GetArtificialBold();
}
//--------------------------------------------------------------------------
@@ -589,19 +589,19 @@ public:
PspServerFontLayout( psp::PrinterGfx&, ServerFont& rFont, const ImplLayoutArgs& rArgs );
virtual void InitFont() const;
- const sal_Unicode* getTextPtr() const { return maText.getStr() - mnMinCharPos; }
- int getMinCharPos() const { return mnMinCharPos; }
- int getMaxCharPos() const { return mnMinCharPos+maText.getLength()-1; }
+ const sal_Unicode* getTextPtr() const { return maText.getStr() - mnMinCharPos; }
+ int getMinCharPos() const { return mnMinCharPos; }
+ int getMaxCharPos() const { return mnMinCharPos+maText.getLength()-1; }
private:
::psp::PrinterGfx& mrPrinterGfx;
sal_IntPtr mnFontID;
int mnFontHeight;
int mnFontWidth;
bool mbVertical;
- bool mbArtItalic;
- bool mbArtBold;
- rtl::OUString maText;
- int mnMinCharPos;
+ bool mbArtItalic;
+ bool mbArtBold;
+ rtl::OUString maText;
+ int mnMinCharPos;
};
PspServerFontLayout::PspServerFontLayout( ::psp::PrinterGfx& rGfx, ServerFont& rFont, const ImplLayoutArgs& rArgs )
@@ -612,9 +612,9 @@ PspServerFontLayout::PspServerFontLayout( ::psp::PrinterGfx& rGfx, ServerFont& r
mnFontHeight = mrPrinterGfx.GetFontHeight();
mnFontWidth = mrPrinterGfx.GetFontWidth();
mbVertical = mrPrinterGfx.GetFontVertical();
- mbArtItalic = mrPrinterGfx.GetArtificialItalic();
- mbArtBold = mrPrinterGfx.GetArtificialBold();
- maText = OUString( rArgs.mpStr + rArgs.mnMinCharPos, rArgs.mnEndCharPos - rArgs.mnMinCharPos+1 );
+ mbArtItalic = mrPrinterGfx.GetArtificialItalic();
+ mbArtBold = mrPrinterGfx.GetArtificialBold();
+ maText = OUString( rArgs.mpStr + rArgs.mnMinCharPos, rArgs.mnEndCharPos - rArgs.mnMinCharPos+1 );
mnMinCharPos = rArgs.mnMinCharPos;
}
@@ -633,7 +633,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
sal_Int32 aWidthAry[ nMaxGlyphs ];
sal_Int32 aIdxAry [ nMaxGlyphs ];
sal_Ucs aUnicodes[ nMaxGlyphs ];
- int aCharPosAry [ nMaxGlyphs ];
+ int aCharPosAry [ nMaxGlyphs ];
Point aPos;
long nUnitsPerPixel = rLayout.GetUnitsPerPixel();
@@ -684,23 +684,19 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
+ // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
- return pIFCMap;
-}
-
-bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if (!m_pServerFont[0])
- return false;
- return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
+ CmapResult aCmapResult;
+ if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
+ return NULL;
+ return new ImplFontCharMap( aCmapResult );
}
-sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -792,7 +788,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
const psp::PrinterInfo& rInfo = psp::PrinterInfoManager::get().getPrinterInfo( m_pJobData->m_aPrinterName );
if( rInfo.m_bPerformFontSubstitution )
{
- for( boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator it = rInfo.m_aFontSubstitutes.begin(); it != rInfo.m_aFontSubstitutes.end(); ++it )
+ for( std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator it = rInfo.m_aFontSubstitutes.begin(); it != rInfo.m_aFontSubstitutes.end(); ++it )
AddDevFontSubstitute( pOutDev, it->first, it->second, FONT_SUBSTITUTE_ALWAYS );
}
}
@@ -809,26 +805,26 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
pMetric->mbDevice = aDFA.mbDevice;
pMetric->mbScalableFont = true;
- pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
- pMetric->mnSlant = 0;
+ pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
+ pMetric->mnSlant = 0;
- sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight();
- sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth();
+ sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight();
+ sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth();
if( ! nTextWidth )
nTextWidth = nTextHeight;
- pMetric->mnWidth = nTextWidth;
- pMetric->mnAscent = ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000;
- pMetric->mnDescent = ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000;
- pMetric->mnIntLeading = ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000;
- pMetric->mnExtLeading = 0;
+ pMetric->mnWidth = nTextWidth;
+ pMetric->mnAscent = ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000;
+ pMetric->mnDescent = ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000;
+ pMetric->mnIntLeading = ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000;
+ pMetric->mnExtLeading = 0;
}
}
-sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
+ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- sal_uLong nHavePairs = rPairs.size();
+ ULONG nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -838,47 +834,47 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa
nTextScale = m_pPrinterGfx->GetFontHeight();
for( i = 0, it = rPairs.begin(); i < nPairs && i < nHavePairs; i++, ++it )
{
- pKernPairs[i].mnChar1 = it->first;
- pKernPairs[i].mnChar2 = it->second;
- pKernPairs[i].mnKern = it->kern_x * nTextScale / 1000;
+ pKernPairs[i].mnChar1 = it->first;
+ pKernPairs[i].mnChar2 = it->second;
+ pKernPairs[i].mnKern = it->kern_x * nTextScale / 1000;
}
}
return nHavePairs;
}
-sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return sal_True;
+ return TRUE;
}
-sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
+BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -903,7 +899,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-sal_Bool PspGraphics::CreateFontSubset(
+BOOL PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -991,9 +987,9 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
return NULL;
// fill in font info
- rInfo.m_nAscent = aFontInfo.m_nAscend;
- rInfo.m_nDescent = aFontInfo.m_nDescend;
- rInfo.m_aPSName = rMgr.getPSName( aFont );
+ rInfo.m_nAscent = aFontInfo.m_nAscend;
+ rInfo.m_nDescent = aFontInfo.m_nDescend;
+ rInfo.m_aPSName = rMgr.getPSName( aFont );
int xMin, yMin, xMax, yMax;
rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax );
@@ -1023,8 +1019,8 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
*pDataLen = aStat.st_size;
- rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
- rInfo.m_nCapHeight = yMax; // Well ...
+ rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
+ rInfo.m_nCapHeight = yMax; // Well ...
for( int i = 0; i < 256; i++ )
pWidths[i] = (aMetrics[i].width > 0 ? aMetrics[i].width : 0);
@@ -1084,13 +1080,13 @@ FontWidth PspGraphics::ToFontWidth (psp::width::type eWidth)
{
case psp::width::UltraCondensed: return WIDTH_ULTRA_CONDENSED;
case psp::width::ExtraCondensed: return WIDTH_EXTRA_CONDENSED;
- case psp::width::Condensed: return WIDTH_CONDENSED;
- case psp::width::SemiCondensed: return WIDTH_SEMI_CONDENSED;
- case psp::width::Normal: return WIDTH_NORMAL;
- case psp::width::SemiExpanded: return WIDTH_SEMI_EXPANDED;
- case psp::width::Expanded: return WIDTH_EXPANDED;
- case psp::width::ExtraExpanded: return WIDTH_EXTRA_EXPANDED;
- case psp::width::UltraExpanded: return WIDTH_ULTRA_EXPANDED;
+ case psp::width::Condensed: return WIDTH_CONDENSED;
+ case psp::width::SemiCondensed: return WIDTH_SEMI_CONDENSED;
+ case psp::width::Normal: return WIDTH_NORMAL;
+ case psp::width::SemiExpanded: return WIDTH_SEMI_EXPANDED;
+ case psp::width::Expanded: return WIDTH_EXPANDED;
+ case psp::width::ExtraExpanded: return WIDTH_EXTRA_EXPANDED;
+ case psp::width::UltraExpanded: return WIDTH_ULTRA_EXPANDED;
default: break;
}
return WIDTH_DONTKNOW;
@@ -1100,16 +1096,16 @@ FontWeight PspGraphics::ToFontWeight (psp::weight::type eWeight)
{
switch (eWeight)
{
- case psp::weight::Thin: return WEIGHT_THIN;
+ case psp::weight::Thin: return WEIGHT_THIN;
case psp::weight::UltraLight: return WEIGHT_ULTRALIGHT;
- case psp::weight::Light: return WEIGHT_LIGHT;
+ case psp::weight::Light: return WEIGHT_LIGHT;
case psp::weight::SemiLight: return WEIGHT_SEMILIGHT;
- case psp::weight::Normal: return WEIGHT_NORMAL;
- case psp::weight::Medium: return WEIGHT_MEDIUM;
- case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
- case psp::weight::Bold: return WEIGHT_BOLD;
+ case psp::weight::Normal: return WEIGHT_NORMAL;
+ case psp::weight::Medium: return WEIGHT_MEDIUM;
+ case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
+ case psp::weight::Bold: return WEIGHT_BOLD;
case psp::weight::UltraBold: return WEIGHT_ULTRABOLD;
- case psp::weight::Black: return WEIGHT_BLACK;
+ case psp::weight::Black: return WEIGHT_BLACK;
default: break;
}
return WEIGHT_DONTKNOW;
@@ -1119,8 +1115,8 @@ FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
{
switch (ePitch)
{
- case psp::pitch::Fixed: return PITCH_FIXED;
- case psp::pitch::Variable: return PITCH_VARIABLE;
+ case psp::pitch::Fixed: return PITCH_FIXED;
+ case psp::pitch::Variable: return PITCH_VARIABLE;
default: break;
}
return PITCH_DONTKNOW;
@@ -1130,9 +1126,9 @@ FontItalic PspGraphics::ToFontItalic (psp::italic::type eItalic)
{
switch (eItalic)
{
- case psp::italic::Upright: return ITALIC_NONE;
- case psp::italic::Oblique: return ITALIC_OBLIQUE;
- case psp::italic::Italic: return ITALIC_NORMAL;
+ case psp::italic::Upright: return ITALIC_NONE;
+ case psp::italic::Oblique: return ITALIC_OBLIQUE;
+ case psp::italic::Italic: return ITALIC_NORMAL;
default: break;
}
return ITALIC_DONTKNOW;
@@ -1143,11 +1139,11 @@ FontFamily PspGraphics::ToFontFamily (psp::family::type eFamily)
switch (eFamily)
{
case psp::family::Decorative: return FAMILY_DECORATIVE;
- case psp::family::Modern: return FAMILY_MODERN;
- case psp::family::Roman: return FAMILY_ROMAN;
- case psp::family::Script: return FAMILY_SCRIPT;
- case psp::family::Swiss: return FAMILY_SWISS;
- case psp::family::System: return FAMILY_SYSTEM;
+ case psp::family::Modern: return FAMILY_MODERN;
+ case psp::family::Roman: return FAMILY_ROMAN;
+ case psp::family::Script: return FAMILY_SCRIPT;
+ case psp::family::Swiss: return FAMILY_SWISS;
+ case psp::family::System: return FAMILY_SYSTEM;
default: break;
}
return FAMILY_DONTKNOW;
@@ -1289,9 +1285,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- sal_uInt16 nPos;
- sal_uInt16 nStart = 0;
- sal_uInt16 nStop = rLen;
+ USHORT nPos;
+ USHORT nStart = 0;
+ USHORT 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 78f36f85295e..6e865f3409ba 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,15 +42,15 @@ class SalInfoPrinter;
class PspGraphics : public SalGraphics
{
- psp::JobData* m_pJobData;
- psp::PrinterGfx* m_pPrinterGfx;
- String* m_pPhoneNr;
- bool m_bSwallowFaxNo;
- String m_aPhoneCollection;
- bool m_bPhoneCollectionActive;
-
- ServerFont* m_pServerFont[ MAX_FALLBACK ];
- bool m_bFontVertical;
+ psp::JobData* m_pJobData;
+ psp::PrinterGfx* m_pPrinterGfx;
+ String* m_pPhoneNr;
+ bool m_bSwallowFaxNo;
+ String m_aPhoneCollection;
+ bool m_bPhoneCollectionActive;
+
+ ServerFont* m_pServerFont[ MAX_FALLBACK ];
+ bool m_bFontVertical;
SalInfoPrinter* m_pInfoPrinter;
protected:
@@ -79,38 +79,40 @@ public:
Ucs2UIntMap& rUnicodeEnc );
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWidth ToFontWidth (psp::width::type eWidth);
- static FontWeight ToFontWeight (psp::weight::type eWeight);
- static FontPitch ToFontPitch (psp::pitch::type ePitch);
- static FontItalic ToFontItalic (psp::italic::type eItalic);
- static FontFamily ToFontFamily (psp::family::type eFamily);
+ static FontWidth ToFontWidth (psp::width::type eWidth);
+ static FontWeight ToFontWeight (psp::weight::type eWeight);
+ static FontPitch ToFontPitch (psp::pitch::type ePitch);
+ static FontItalic ToFontItalic (psp::italic::type eItalic);
+ static FontFamily ToFontFamily (psp::family::type eFamily);
// overload all pure virtual methods
- virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual sal_uInt16 GetBitCount() const;
- virtual long GetGraphicsWidth() const;
-
- virtual void ResetClipRegion();
- virtual bool setClipRegion( const Region& );
-
- virtual void SetLineColor();
- virtual void SetLineColor( SalColor nSalColor );
- virtual void SetFillColor();
- virtual void SetFillColor( SalColor nSalColor );
- virtual void SetXORMode( bool bSet, bool );
- virtual void SetROPLineColor( SalROPColor nROPColor );
- virtual void SetROPFillColor( SalROPColor nROPColor );
-
- virtual void SetTextColor( SalColor nSalColor );
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- 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 sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
+ virtual USHORT GetBitCount();
+ 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 void SetLineColor();
+ virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetFillColor();
+ virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetXORMode( bool bSet, bool );
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual ImplFontCharMap* GetImplFontCharMap() 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,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -119,72 +121,72 @@ public:
FontSubsetInfo& rInfo
);
virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- 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 GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
- 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( sal_uLong nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
+ 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 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,
+ virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
+ virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry );
+ const BYTE* const* pFlgAry );
- virtual void copyArea( long nDestX,
+ virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ USHORT nFlags );
+ virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- 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( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ 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 sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, 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;
+
+ virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index 18e2f4af8c90..8701a7fcddcb 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -89,7 +89,7 @@ SvpGlyphCache& SvpGlyphCache::GetInstance()
{
static SvpGlyphPeer aSvpGlyphPeer;
static SvpGlyphCache aGC( aSvpGlyphPeer );
- return aGC;
+ return aGC;
}
// ===========================================================================
@@ -118,7 +118,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont,
bFound = rServerFont.GetGlyphBitmap8( nGlyphIndex, pGcpHelper->maRawBitmap );
break;
default:
- OSL_FAIL( "SVP GCP::GetGlyphBmp(): illegal scanline format");
+ DBG_ERROR( "SVP GCP::GetGlyphBmp(): illegal scanline format");
// fall back to black&white mask
nBmpFormat = Format::ONE_BIT_LSB_GREY;
bFound = false;
@@ -162,7 +162,7 @@ void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGly
if( rGlyphData.ExtDataRef().mpData != Format::NONE )
{
// release the glyph related resources
- DBG_ASSERT( (rGlyphData.ExtDataRef().meInfo <= Format::MAX), "SVP::RG() invalid alpha format" );
+ DBG_ASSERT( (rGlyphData.ExtDataRef().meInfo <= Format::MAX), "SVP::RG() invalid alpha format" );
SvpGcpHelper* pGcpHelper = (SvpGcpHelper*)rGlyphData.ExtDataRef().mpData;
delete[] pGcpHelper->maRawBitmap.mpBits;
delete pGcpHelper;
@@ -193,6 +193,8 @@ void PspKernInfo::Initialize() const
if( rKernPairs.empty() )
return;
+ // feed psprint's kerning list into a lookup-friendly container
+ maUnicodeKernPairs.resize( rKernPairs.size() );
PspKernPairs::const_iterator it = rKernPairs.begin();
for(; it != rKernPairs.end(); ++it )
{
@@ -203,7 +205,7 @@ void PspKernInfo::Initialize() const
// ===========================================================================
-sal_uInt16 SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
+USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
{
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -253,15 +255,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// ---------------------------------------------------------------------------
-sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
+ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
{
- sal_uLong nGotPairs = 0;
+ ULONG nGotPairs = 0;
if( m_pServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs = NULL;
nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs );
- for( sal_uLong i = 0; i < nPairs && i < nGotPairs; ++i )
+ for( ULONG i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
}
@@ -271,21 +273,15 @@ sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
// ---------------------------------------------------------------------------
-const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
+ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
{
if( !m_pServerFont[0] )
return NULL;
- const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
- return pIFCMap;
-}
-
-bool SvpSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if (!m_pServerFont[0])
- return false;
-
- return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
+ CmapResult aCmapResult;
+ if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
+ return NULL;
+ return new ImplFontCharMap( aCmapResult );
}
// ---------------------------------------------------------------------------
@@ -346,7 +342,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*,
// ---------------------------------------------------------------------------
-sal_Bool SvpSalGraphics::CreateFontSubset(
+BOOL SvpSalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -429,39 +425,39 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
// ---------------------------------------------------------------------------
-sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+BOOL SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return sal_True;
+ return TRUE;
}
// ---------------------------------------------------------------------------
-sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
+BOOL SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
const ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
// ---------------------------------------------------------------------------
diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx
index 8477da7b3bfc..87dff53cfbeb 100644
--- a/vcl/unx/headless/svpvd.cxx
+++ b/vcl/unx/headless/svpvd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,7 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
delete pGraphics;
}
-sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
+BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
{
B2IVector aDevSize( nNewDX, nNewDY );
if( aDevSize.getX() == 0 )
@@ -87,12 +87,12 @@ sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
m_aDevice = aDevPal.empty()
? createBitmapDevice( aDevSize, false, nFormat )
: createBitmapDevice( aDevSize, false, nFormat, PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) );
-
+
// update device in existing graphics
for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin();
it != m_aGraphics.end(); ++it )
(*it)->setDevice( m_aDevice );
-
+
}
return true;
}
diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx
index c6dde57abd38..d4769fca7f34 100644
--- a/vcl/unx/headless/svpvd.hxx
+++ b/vcl/unx/headless/svpvd.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,23 +38,23 @@ class SvpSalGraphics;
class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement
{
- sal_uInt16 m_nBitCount;
+ USHORT m_nBitCount;
basebmp::BitmapDeviceSharedPtr m_aDevice;
std::list< SvpSalGraphics* > m_aGraphics;
public:
- SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
+ SvpSalVirtualDevice( USHORT nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
virtual ~SvpSalVirtualDevice();
-
+
// SvpElement
virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; }
// SalVirtualDevice
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool SetSize( long nNewDX, long nNewDY );
- virtual void GetSize( long& rWidth, long& rHeight );
+ virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual void GetSize( long& rWidth, long& rHeight );
};
#endif // _SVP_SVPVD_HXX
diff --git a/vcl/unx/inc/XIM.h b/vcl/unx/inc/XIM.h
index 9a061edd1ed4..2aa84ecee71e 100644
--- a/vcl/unx/inc/XIM.h
+++ b/vcl/unx/inc/XIM.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,9 +63,9 @@ typedef struct _XIMUnicodeText {
char *multi_byte;
wchar_t *wide_char;
unsigned short *utf16_char;
- } string;
+ } string;
unsigned int count_annotations;
- XIMAnnotation *annotations;
+ XIMAnnotation *annotations;
} XIMUnicodeText;
/* lookup choice */
@@ -75,11 +75,11 @@ typedef enum {
} XIMDrawUpDirection ;
typedef struct _XIMLookupStartCallbackStruct {
- int choice_per_window; /* Number of choices can be display
+ int choice_per_window; /* Number of choices can be display
* in the region
*/
- int nrows;
- int ncolumns;
+ int nrows;
+ int ncolumns;
XIMDrawUpDirection draw_up_direction;
} XIMLookupStartCallbackStruct;
@@ -102,19 +102,19 @@ typedef enum {
XIMKatakana, XIMHanzi
} XIMUnicodeCharacterSubsetID;
-typedef struct _XIMUncodeSubset {
- XIMUnicodeCharacterSubsetID index;
- XIMUnicodeCharacterSubsetID subset_id;
- char *name;
- Bool is_active;
+typedef struct _XIMUncodeSubset {
+ XIMUnicodeCharacterSubsetID index;
+ XIMUnicodeCharacterSubsetID subset_id;
+ char *name;
+ Bool is_active;
} XIMUnicodeCharacterSubset;
-typedef struct _XIMUncodeSubsets {
+typedef struct _XIMUncodeSubsets {
unsigned short count_subsets;
XIMUnicodeCharacterSubset *supported_subsets;
} XIMUnicodeCharacterSubsets;
-typedef struct _XIMSwitchIMNotifyCallbackStruct {
+typedef struct _XIMSwitchIMNotifyCallbackStruct {
XIMUnicodeCharacterSubset *from;
XIMUnicodeCharacterSubset *to;
} XIMSwitchIMNotifyCallbackStruct;
diff --git a/vcl/unx/inc/Xproto.h b/vcl/unx/inc/Xproto.h
index b6db98dbfe15..07b3394cca4d 100644
--- a/vcl/unx/inc/Xproto.h
+++ b/vcl/unx/inc/Xproto.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/cdeint.hxx b/vcl/unx/inc/cdeint.hxx
index e88d221f3aff..f6f24d1301bf 100644
--- a/vcl/unx/inc/cdeint.hxx
+++ b/vcl/unx/inc/cdeint.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx
index 010a0417d89b..b17383090016 100644
--- a/vcl/unx/inc/dtint.hxx
+++ b/vcl/unx/inc/dtint.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,12 +32,19 @@
#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
@@ -46,27 +53,27 @@ enum DtType {
class DtIntegrator
{
protected:
- DtType meType;
- Display* mpDisplay;
- SalDisplay* mpSalDisplay;
- int mnSystemLookCommandProcess;
+ DtType meType;
+ Display* mpDisplay;
+ SalDisplay* mpSalDisplay;
+ int mnSystemLookCommandProcess;
DtIntegrator();
- static String aHomeDir;
+ static String aHomeDir;
public:
static DtIntegrator* CreateDtIntegrator();
-
+
virtual ~DtIntegrator();
// SystemLook
virtual void GetSystemLook( AllSettings& rSettings );
-
- DtType GetDtType() { return meType; }
- SalDisplay* GetSalDisplay() { return mpSalDisplay; }
- Display* GetDisplay() { return mpDisplay; }
+
+ DtType GetDtType() { return meType; }
+ SalDisplay* GetSalDisplay() { return mpSalDisplay; }
+ Display* GetDisplay() { return mpDisplay; }
};
#endif
diff --git a/vcl/unx/inc/i18n_cb.hxx b/vcl/unx/inc/i18n_cb.hxx
index 22aee5aeb41a..8f22b935d4cf 100644
--- a/vcl/unx/inc/i18n_cb.hxx
+++ b/vcl/unx/inc/i18n_cb.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,18 +42,18 @@ int CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data);
void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data);
int PreeditStartCallback( XIC ic, XPointer client_data, XPointer call_data);
void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data);
-void PreeditDrawCallback ( XIC ic, XPointer client_data,
+void PreeditDrawCallback ( XIC ic, XPointer client_data,
XIMPreeditDrawCallbackStruct *call_data );
-void PreeditCaretCallback( XIC ic, XPointer client_data,
+void PreeditCaretCallback( XIC ic, XPointer client_data,
XIMPreeditCaretCallbackStruct *call_data );
void GetPreeditSpotLocation(XIC ic, XPointer client_data);
-// private hook to prevent from sending further edit events
+// private hook to prevent from sending further edit events
void PreeditCancelCallback( XPointer client_data );
void StatusStartCallback (XIC ic, XPointer client_data, XPointer call_data);
void StatusDoneCallback (XIC ic, XPointer client_data, XPointer call_data);
-void StatusDrawCallback (XIC ic, XPointer client_data,
+void StatusDrawCallback (XIC ic, XPointer client_data,
XIMStatusDrawCallbackStruct *call_data);
void SwitchIMCallback (XIC ix, XPointer client_data, XPointer call_data );
@@ -85,12 +85,12 @@ typedef enum {
} preedit_status_t;
typedef struct {
- SalFrame* pFrame;
- Bool bIsMultilingual;
- preedit_status_t eState;
- preedit_text_t aText;
+ SalFrame* pFrame;
+ Bool bIsMultilingual;
+ preedit_status_t eState;
+ preedit_text_t aText;
SalExtTextInputEvent aInputEv;
- std::vector< sal_uInt16 > aInputFlags;
+ std::vector< USHORT > 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 b038d179f4a2..f082433810cb 100644
--- a/vcl/unx/inc/i18n_ic.hxx
+++ b/vcl/unx/inc/i18n_ic.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,9 +37,9 @@ class SalI18N_InputContext
private:
- Bool mbUseable; // system supports current locale ?
- Bool mbMultiLingual; // system supports iiimp ?
- XIC maContext;
+ Bool mbUseable; // system supports current locale ?
+ Bool mbMultiLingual; // system supports iiimp ?
+ XIC maContext;
XIMStyle mnSupportedStatusStyle;
XIMStyle mnSupportedPreeditStyle;
@@ -58,17 +58,17 @@ private:
XVaNestedList mpAttributes;
XVaNestedList mpStatusAttributes;
XVaNestedList mpPreeditAttributes;
-
- Bool SupportInputMethodStyle( XIMStyles *pIMStyles );
+
+ Bool SupportInputMethodStyle( XIMStyles *pIMStyles );
unsigned int GetWeightingOfIMStyle( XIMStyle n_style ) const ;
- Bool IsSupportedIMStyle( XIMStyle n_style ) const ;
+ Bool IsSupportedIMStyle( XIMStyle n_style ) const ;
public:
- Bool UseContext() { return mbUseable; }
- Bool IsMultiLingual() { return mbMultiLingual; }
- Bool IsPreeditMode() { return maClientData.eState == ePreeditStatusActive; }
- XIC GetContext() { return maContext; }
+ Bool UseContext() { return mbUseable; }
+ Bool IsMultiLingual() { return mbMultiLingual; }
+ Bool IsPreeditMode() { return maClientData.eState == ePreeditStatusActive; }
+ XIC GetContext() { return maContext; }
void ExtendEventMask( XLIB_Window aFocusWindow );
void SetICFocus( SalFrame* pFocusFrame );
@@ -76,7 +76,7 @@ public:
void HandleDestroyIM();
int HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused
- void EndExtTextInput( sal_uInt16 nFlags ); // unused
+ void EndExtTextInput( USHORT 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 92931ec6353e..9277c9c8491f 100644
--- a/vcl/unx/inc/i18n_im.hxx
+++ b/vcl/unx/inc/i18n_im.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,25 +37,29 @@ extern "C" char* GetMethodName( XIMStyle nStyle, char *pBuf, int nBufSize);
class VCL_DLLPUBLIC SalI18N_InputMethod
{
- Bool mbUseable; // system supports locale as well as status
- // and preedit style ?
- Bool mbMultiLingual; // system supports iiimp
- XIM maMethod;
+ Bool mbUseable; // system supports locale as well as status
+ // and preedit style ?
+ Bool mbMultiLingual; // system supports iiimp
+ XIM maMethod;
XIMCallback maDestroyCallback;
XIMStyles *mpStyles;
public:
- Bool IsMultiLingual() { return mbMultiLingual; }
+ Bool IsMultiLingual() { return mbMultiLingual; }
Bool PosixLocale();
- Bool UseMethod() { return mbUseable; }
- XIM GetMethod() { return maMethod; }
+ Bool UseMethod() { return mbUseable; }
+ XIM GetMethod() { return maMethod; }
void HandleDestroyIM();
- Bool CreateMethod( Display *pDisplay );
- XIMStyles *GetSupportedStyles() { return mpStyles; }
- Bool SetLocale( const char* pLocale = "" );
- Bool FilterEvent( XEvent *pEvent, XLIB_Window window );
- Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler);
+ Bool CreateMethod( Display *pDisplay );
+ XIMStyles *GetSupportedStyles() { return mpStyles; }
+ Bool SetLocale( const char* pLocale = "" );
+ 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/i18n_keysym.hxx b/vcl/unx/inc/i18n_keysym.hxx
index e34d80900b79..637459627add 100644
--- a/vcl/unx/inc/i18n_keysym.hxx
+++ b/vcl/unx/inc/i18n_keysym.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,36 +31,36 @@
/*
convert a keysym as defined in /usr/{X11R6|openwin}/include/X11/keysymdef.h
- to unicode
+ to unicode
supported charsets: (byte1 and byte2 are always 0x0)
-
- Latin-1 Byte 3 = 0x00
- Latin-2 Byte 3 = 0x01
- Latin-3 Byte 3 = 0x02
- Latin-4 Byte 3 = 0x03
- Kana Byte 3 = 0x04
- Arabic Byte 3 = 0x05
- Cyrillic Byte 3 = 0x06
- Greek Byte 3 = 0x07
- Technical Byte 3 = 0x08
- Special Byte 3 = 0x09
- Publishing Byte 3 = 0x0a = 10
- APL Byte 3 = 0x0b = 11
- Hebrew Byte 3 = 0x0c = 12
- Thai Byte 3 = 0x0d = 13
- Korean Byte 3 = 0x0e = 14
- Latin-9 Byte 3 = 0x13 = 19
- Currency Byte 3 = 0x20 = 32
- Keyboard Byte 3 = 0xff = 255
+
+ Latin-1 Byte 3 = 0x00
+ Latin-2 Byte 3 = 0x01
+ Latin-3 Byte 3 = 0x02
+ Latin-4 Byte 3 = 0x03
+ Kana Byte 3 = 0x04
+ Arabic Byte 3 = 0x05
+ Cyrillic Byte 3 = 0x06
+ Greek Byte 3 = 0x07
+ Technical Byte 3 = 0x08
+ Special Byte 3 = 0x09
+ Publishing Byte 3 = 0x0a = 10
+ APL Byte 3 = 0x0b = 11
+ Hebrew Byte 3 = 0x0c = 12
+ Thai Byte 3 = 0x0d = 13
+ Korean Byte 3 = 0x0e = 14
+ Latin-9 Byte 3 = 0x13 = 19
+ Currency Byte 3 = 0x20 = 32
+ Keyboard Byte 3 = 0xff = 255
missing charsets:
- Latin-8 Byte 3 = 0x12 = 18
- Armenian Byte 3 = 0x14 = 20
- Georgian Byte 3 = 0x15 = 21
- Azeri Byte 3 = 0x16 = 22
- Vietnamese Byte 3 = 0x1e = 30
+ Latin-8 Byte 3 = 0x12 = 18
+ Armenian Byte 3 = 0x14 = 20
+ Georgian Byte 3 = 0x15 = 21
+ Azeri Byte 3 = 0x16 = 22
+ Vietnamese Byte 3 = 0x1e = 30
of course not all keysyms can be mapped to a unicode code point
*/
diff --git a/vcl/unx/inc/i18n_status.hxx b/vcl/unx/inc/i18n_status.hxx
index 832f2a713091..6d6f72ceaaac 100644
--- a/vcl/unx/inc/i18n_status.hxx
+++ b/vcl/unx/inc/i18n_status.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,7 @@ class X11ImeStatus : public SalI18NImeStatus
public:
X11ImeStatus() {}
virtual ~X11ImeStatus();
-
+
virtual bool canToggle();
virtual void toggle();
};
@@ -65,13 +65,13 @@ class I18NStatus
public:
struct ChoiceData
{
- String aString;
- void* pData;
+ String aString;
+ void* pData;
};
private:
- SalFrame* m_pParent;
- StatusWindow* m_pStatusWindow;
- String m_aCurrentIM;
+ SalFrame* m_pParent;
+ StatusWindow* m_pStatusWindow;
+ String m_aCurrentIM;
::std::vector< ChoiceData > m_aChoices;
I18NStatus();
diff --git a/vcl/unx/inc/i18n_xkb.hxx b/vcl/unx/inc/i18n_xkb.hxx
index e077fdb67526..3695466b77ef 100644
--- a/vcl/unx/inc/i18n_xkb.hxx
+++ b/vcl/unx/inc/i18n_xkb.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,83 +27,83 @@
************************************************************************/
#ifndef _SAL_I18N_XKBDEXTENSION_HXX
-#define _SAL_I18N_XKBDEXTENSION_HXX
+#define _SAL_I18N_XKBDEXTENSION_HXX
#include <sal/types.h>
#include <vcl/dllapi.h>
-class VCL_DLLPUBLIC SalI18N_KeyboardExtension
+class VCL_DLLPUBLIC SalI18N_KeyboardExtension
{
private:
- sal_Bool mbUseExtension;
- sal_uInt32 mnDefaultGroup;
- sal_uInt32 mnGroup;
- int mnEventBase;
+ sal_Bool mbUseExtension;
+ sal_uInt32 mnDefaultGroup;
+ sal_uInt32 mnGroup;
+ int mnEventBase;
int mnErrorBase;
- Display* mpDisplay;
+ Display* mpDisplay;
public:
SalI18N_KeyboardExtension( Display *pDisplay );
- inline ~SalI18N_KeyboardExtension();
+ inline ~SalI18N_KeyboardExtension();
- inline sal_Bool UseExtension() const ; // server and client support the
- // extension
- inline void UseExtension( sal_Bool bState );// used to disable the Extension
+ inline sal_Bool UseExtension() const ; // server and client support the
+ // extension
+ inline void UseExtension( sal_Bool bState );// used to disable the Extension
- void Dispatch( XEvent *pEvent ); // keep track of group changes
+ void Dispatch( XEvent *pEvent ); // keep track of group changes
- sal_uInt32 LookupKeysymInGroup( sal_uInt32 nKeyCode,
- sal_uInt32 nShiftState,
+ sal_uInt32 LookupKeysymInGroup( sal_uInt32 nKeyCode,
+ sal_uInt32 nShiftState,
sal_uInt32 nGroup ) const ;
- inline sal_uInt32 LookupKeysymInDefaultGroup(
- sal_uInt32 nKeyCode,
+ inline sal_uInt32 LookupKeysymInDefaultGroup(
+ sal_uInt32 nKeyCode,
sal_uInt32 nShiftState ) const ;
- inline sal_uInt32 GetGroup() const ; // the current keyboard group
- inline sal_uInt32 GetDefaultGroup() const ; // base group, usually group 1
- inline int GetEventBase() const ;
+ inline sal_uInt32 GetGroup() const ; // the current keyboard group
+ inline sal_uInt32 GetDefaultGroup() const ; // base group, usually group 1
+ inline int GetEventBase() const ;
protected:
-
- SalI18N_KeyboardExtension(); // disabled
+
+ SalI18N_KeyboardExtension(); // disabled
};
-inline
+inline
SalI18N_KeyboardExtension::~SalI18N_KeyboardExtension()
{
}
-inline sal_Bool
+inline sal_Bool
SalI18N_KeyboardExtension::UseExtension() const
-{
- return mbUseExtension;
+{
+ return mbUseExtension;
}
inline void
-SalI18N_KeyboardExtension::UseExtension( sal_Bool bState )
-{
+SalI18N_KeyboardExtension::UseExtension( sal_Bool bState )
+{
mbUseExtension = mbUseExtension && bState;
}
-inline sal_uInt32
-SalI18N_KeyboardExtension::LookupKeysymInDefaultGroup( sal_uInt32 nKeyCode,
+inline sal_uInt32
+SalI18N_KeyboardExtension::LookupKeysymInDefaultGroup( sal_uInt32 nKeyCode,
sal_uInt32 nShiftState ) const
-{
- return LookupKeysymInGroup( nKeyCode, nShiftState, mnDefaultGroup );
+{
+ return LookupKeysymInGroup( nKeyCode, nShiftState, mnDefaultGroup );
}
-inline sal_uInt32
-SalI18N_KeyboardExtension::GetGroup() const
-{
+inline sal_uInt32
+SalI18N_KeyboardExtension::GetGroup() const
+{
return mnGroup;
-}
-
-inline sal_uInt32
+}
+
+inline sal_uInt32
SalI18N_KeyboardExtension::GetDefaultGroup() const
-{
- return mnDefaultGroup;
+{
+ return mnDefaultGroup;
}
inline int
diff --git a/vcl/unx/inc/kde_headers.h b/vcl/unx/inc/kde_headers.h
deleted file mode 100644
index 7ec45fdc383d..000000000000
--- a/vcl/unx/inc/kde_headers.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#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/atkbridge.hxx b/vcl/unx/inc/plugins/gtk/atkbridge.hxx
index 2624f046a612..4b81eca9d082 100644
--- a/vcl/unx/inc/plugins/gtk/atkbridge.hxx
+++ b/vcl/unx/inc/plugins/gtk/atkbridge.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index e4a1bb5e9527..1c7a729ffdc5 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,9 +46,9 @@ class GtkData : public X11SalData
public:
GtkData() {}
virtual ~GtkData();
-
+
virtual void Init();
-
+
virtual void initNWF();
virtual void deInitNWF();
};
@@ -57,12 +57,10 @@ class GtkSalFrame;
class GtkSalDisplay : public SalDisplay
{
- GdkDisplay* m_pGdkDisplay;
+ 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,
+ GdkCursor* getFromXPM( const char *pBitmap, const char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
public:
GtkSalDisplay( GdkDisplay* pDisplay );
@@ -85,7 +83,7 @@ public:
inline void EventGuardAcquire() { osl_acquireMutex( hEventGuard_ ); }
inline void EventGuardRelease() { osl_releaseMutex( hEventGuard_ ); }
void startupNotificationCompleted() { m_bStartupCompleted = true; }
-
+
void screenSizeChanged( GdkScreen* );
void monitorsChanged( GdkScreen* );
};
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index 010844ec3c78..2831f33af8ac 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,7 +61,7 @@ class GtkSalFrame : public SalFrame
{}
~GraphicsHolder();
};
-
+
struct IMHandler
{
//--------------------------------------------------------
@@ -81,7 +81,7 @@ class GtkSalFrame : public SalFrame
guint keyval;
guint16 hardware_keycode;
guint8 group;
-
+
PreviousKeyPress (GdkEventKey *event)
: window (NULL),
send_event (0),
@@ -102,7 +102,7 @@ class GtkSalFrame : public SalFrame
group = event->group;
}
}
-
+
PreviousKeyPress( const PreviousKeyPress& rPrev )
: window( rPrev.window ),
send_event( rPrev.send_event ),
@@ -112,7 +112,7 @@ class GtkSalFrame : public SalFrame
hardware_keycode( rPrev.hardware_keycode ),
group( rPrev.group )
{}
-
+
bool operator== (GdkEventKey *event) const
{
return (event != NULL)
@@ -127,8 +127,8 @@ class GtkSalFrame : public SalFrame
;
}
};
-
-
+
+
GtkSalFrame* m_pFrame;
std::list< PreviousKeyPress > m_aPrevKeyPresses;
int m_nPrevKeyPresses; // avoid using size()
@@ -136,8 +136,8 @@ class GtkSalFrame : public SalFrame
bool m_bFocused;
bool m_bPreeditJustChanged;
SalExtTextInputEvent m_aInputEvent;
- std::vector< sal_uInt16 > m_aInputFlags;
-
+ std::vector< USHORT > m_aInputFlags;
+
IMHandler( GtkSalFrame* );
~IMHandler();
@@ -145,20 +145,20 @@ class GtkSalFrame : public SalFrame
void deleteIMContext();
void updateIMSpotLocation();
void setInputContext( SalInputContext* pContext );
- void endExtTextInput( sal_uInt16 nFlags );
+ void endExtTextInput( USHORT nFlags );
bool handleKeyEvent( GdkEventKey* pEvent );
void focusChanged( bool bFocusIn );
-
+
void doCallEndExtTextInput();
void sendEmptyCommit();
-
-
- static void signalIMCommit( GtkIMContext*, gchar*, gpointer );
- static gboolean signalIMDeleteSurrounding( GtkIMContext*, gint, gint, gpointer );
- static void signalIMPreeditChanged( GtkIMContext*, gpointer );
- static void signalIMPreeditEnd( GtkIMContext*, gpointer );
- static void signalIMPreeditStart( GtkIMContext*, gpointer );
- static gboolean signalIMRetrieveSurrounding( GtkIMContext*, gpointer );
+
+
+ static void signalIMCommit( GtkIMContext*, gchar*, gpointer );
+ static gboolean signalIMDeleteSurrounding( GtkIMContext*, gint, gint, gpointer );
+ static void signalIMPreeditChanged( GtkIMContext*, gpointer );
+ static void signalIMPreeditEnd( GtkIMContext*, gpointer );
+ static void signalIMPreeditStart( GtkIMContext*, gpointer );
+ static gboolean signalIMRetrieveSurrounding( GtkIMContext*, gpointer );
};
friend struct IMHandler;
@@ -169,7 +169,7 @@ class GtkSalFrame : public SalFrame
GdkWindow* m_pForeignTopLevel;
GdkNativeWindow m_aForeignTopLevelWindow;
Pixmap m_hBackgroundPixmap;
- sal_uLong m_nStyle;
+ 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 ];
- sal_uInt16 m_nKeyModifiers;
+ USHORT m_nKeyModifiers;
GdkCursor *m_pCurrentCursor;
GdkVisibilityState m_nVisibility;
PointerStyle m_ePointerStyle;
@@ -192,40 +192,40 @@ class GtkSalFrame : public SalFrame
bool m_bSetFocusOnMap;
String m_aTitle;
rtl::OUString m_sWMClass;
-
+
IMHandler* m_pIMHandler;
-
+
Size m_aMaxSize;
Size m_aMinSize;
- Rectangle m_aRestorePosSize;
-
- GdkRegion* m_pRegion;
+ Rectangle m_aRestorePosSize;
+
+ GdkRegion* m_pRegion;
- void Init( SalFrame* pParent, sal_uLong nStyle );
+ void Init( SalFrame* pParent, ULONG nStyle );
void Init( SystemParentData* pSysData );
void InitCommon();
// signals
- static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
- static void signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer );
- static gboolean signalExpose( GtkWidget*, GdkEventExpose*, gpointer );
- static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
- static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
- static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
- static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
- static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalState( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
- static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
- static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer );
- static void signalDestroy( GtkObject*, gpointer );
-
- void Center();
- void SetDefaultSize();
- void setAutoLock( bool bLock );
- void setScreenSaverTimeout( int nTimeout );
+ static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
+ static void signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer );
+ static gboolean signalExpose( GtkWidget*, GdkEventExpose*, gpointer );
+ static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
+ static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
+ static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
+ static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
+ static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalState( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
+ static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer );
+ static void signalDestroy( GtkObject*, gpointer );
+
+ void Center();
+ void SetDefaultSize();
+ void setAutoLock( bool bLock );
+ void setScreenSaverTimeout( int nTimeout );
void doKeyCallback( guint state,
guint keyval,
@@ -250,17 +250,17 @@ class GtkSalFrame : public SalFrame
!(m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) && // toolbars are also not
!(m_nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE); // focusable floats are not
}
-
+
bool isChild( bool bPlug = true, bool bSysChild = true )
{
- sal_uLong nMask = 0;
+ ULONG nMask = 0;
if( bPlug )
nMask |= SAL_FRAME_STYLE_PLUG;
if( bSysChild )
nMask |= SAL_FRAME_STYLE_SYSTEMCHILD;
return (m_nStyle & nMask) != 0;
}
-
+
void resizeWindow( long nWidth, long nHeight );
void moveWindow( long nX, long nY );
@@ -271,32 +271,32 @@ class GtkSalFrame : public SalFrame
void askForXEmbedFocus( sal_Int32 nTimecode );
void updateWMClass();
-
+
DECL_LINK( ImplDelayedFullScreenHdl, void* );
public:
- GtkSalFrame( SalFrame* pParent, sal_uLong nStyle );
+ GtkSalFrame( SalFrame* pParent, 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( sal_Bool bGrab, sal_Bool bOwnerEvents = sal_False );
-
- GtkSalDisplay* getDisplay();
- GdkDisplay* getGdkDisplay();
- GtkWidget* getWindow() const { return m_pWindow; }
- GtkFixed* getFixedContainer() const { return m_pFixedContainer; }
- GdkWindow* getForeignParent() const { return m_pForeignParent; }
- GdkNativeWindow getForeignParentWindow() const { return m_aForeignParentWindow; }
- GdkWindow* getForeignTopLevel() const { return m_pForeignTopLevel; }
- GdkNativeWindow getForeignTopLevelWindow() const { return m_aForeignTopLevelWindow; }
+ void grabPointer( BOOL bGrab, BOOL bOwnerEvents = FALSE );
+
+ GtkSalDisplay* getDisplay();
+ GdkDisplay* getGdkDisplay();
+ GtkWidget* getWindow() const { return m_pWindow; }
+ GtkFixed* getFixedContainer() const { return m_pFixedContainer; }
+ GdkWindow* getForeignParent() const { return m_pForeignParent; }
+ GdkNativeWindow getForeignParentWindow() const { return m_aForeignParentWindow; }
+ GdkWindow* getForeignTopLevel() const { return m_pForeignTopLevel; }
+ GdkNativeWindow getForeignTopLevelWindow() const { return m_aForeignTopLevelWindow; }
GdkVisibilityState getVisibilityState() const
{ return m_nVisibility; }
Pixmap getBackgroundPixmap() const { return m_hBackgroundPixmap; }
int getScreenNumber() const { return m_nScreen; }
void updateScreenNumber();
-
+
void moveToScreen( int nScreen );
virtual ~GtkSalFrame();
@@ -308,41 +308,41 @@ public:
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual sal_Bool PostEvent( void* pData );
+ virtual BOOL PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( sal_uInt16 nIcon );
+ virtual void SetIcon( USHORT 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( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
- virtual void Enable( sal_Bool bEnable );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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, sal_uInt16 nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual sal_Bool GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual BOOL GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( sal_Bool bStart );
+ virtual void StartPresentation( BOOL bStart );
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void SetAlwaysOnTop( BOOL bOnTop );
// Window to top and grab focus
- virtual void ToTop( sal_uInt16 nFlags );
+ virtual void ToTop( USHORT nFlags );
// this function can call with the same
// pointer style
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( sal_Bool bMouse );
+ virtual void CaptureMouse( 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( sal_uInt16 nFlags );
+ virtual void EndExtTextInput( USHORT 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 String GetKeyName( USHORT nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
+ virtual 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( sal_uInt16 nKeyCode );
+ virtual void SimulateKeyPress( USHORT nKeyCode );
// set new parent window
virtual void SetParent( SalFrame* pNewParent );
@@ -393,13 +393,13 @@ public:
// shaped system windows
// set clip region to none (-> rectangular windows, normal state)
- virtual void ResetClipRegion();
+ virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( sal_uLong nRects );
+ virtual void BeginSetClipRegion( ULONG nRects );
// add a rectangle to the clip region
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
- virtual void EndSetClipRegion();
+ virtual void EndSetClipRegion();
static GtkSalFrame *getFromWindow( GtkWindow *pWindow );
};
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 4f7d66712ac7..6782e2043502 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,148 +34,155 @@
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <tools/postx.h>
-
+
#include <salgdi.h>
class GtkSalGraphics : public X11SalGraphics
{
GtkWidget *m_pWindow;
Region m_aClipRegion;
-
+
public:
GtkSalGraphics( GtkWidget *window )
: m_pWindow( window ),
m_aClipRegion( REGION_NULL )
{}
virtual ~GtkSalGraphics();
-
+
inline GtkWidget* GetGtkWidget() const { return m_pWindow; }
inline GdkWindow* GetGdkWindow() const { return m_pWindow->window; }
inline GtkSalFrame* GetGtkFrame() const { return static_cast<GtkSalFrame*>(m_pFrame); }
- void SetWindow( GtkWidget* window ) { m_pWindow = window; }
-
-
+ void SetWindow( GtkWidget* window ) { m_pWindow = window; }
+
+
// will be set when UI theme was changed
- static sal_Bool bThemeChanged;
- static sal_Bool bNeedPixmapPaint;
- static sal_Bool bGlobalNeedPixmapPaint;
- static sal_Bool bToolbarGripWorkaround;
- static sal_Bool bNeedButtonStyleAsEditBackgroundWorkaround;
-
+ static BOOL bThemeChanged;
+ static BOOL bNeedPixmapPaint;
+ static BOOL bGlobalNeedPixmapPaint;
+ static BOOL bToolbarGripWorkaround;
+ static BOOL bNeedButtonStyleAsEditBackgroundWorkaround;
+
// native widget methods
- 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,
+ 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,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual 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 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
// the background set to None; workaround: set the background
// before copyBits
- virtual void copyBits( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
protected:
typedef std::list< Rectangle > clipList;
GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
- sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
+ BOOL NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
- sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
-
- sal_Bool NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+
+ BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ BOOL NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- sal_Bool NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ 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 07549776e9cf..c0c08594e442 100644
--- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,19 +36,19 @@ class GtkYieldMutex : public SalYieldMutex
{
public:
GtkYieldMutex();
- virtual void acquire();
- virtual void release();
- virtual sal_Bool tryToAcquire();
+ virtual void acquire();
+ virtual void release();
+ virtual sal_Bool tryToAcquire();
virtual int Grab();
virtual void Ungrab( int );
class GtkYieldGuard
{
- GtkYieldMutex* m_pMutex;
- int m_nGrab;
+ GtkYieldMutex* m_pMutex;
+ int m_nGrab;
public:
- GtkYieldGuard( GtkYieldMutex* pMutex )
+ GtkYieldGuard( GtkYieldMutex* pMutex )
: m_pMutex( pMutex )
{
m_nGrab = m_pMutex->Grab();
@@ -62,9 +62,9 @@ public:
class GtkHookedYieldMutex : public GtkYieldMutex
{
- virtual int Grab() { return 0; };
- virtual void Ungrab(int ) {};
- std::list<sal_uLong> aYieldStack;
+ virtual int Grab() { return 0; };
+ virtual void Ungrab(int ) {};
+ std::list<ULONG> aYieldStack;
public:
GtkHookedYieldMutex();
virtual void acquire();
@@ -80,15 +80,15 @@ public:
class GtkInstance : public X11SalInstance
{
public:
- GtkInstance( SalYieldMutex* pMutex )
+ GtkInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex )
{}
virtual ~GtkInstance();
- 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 SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = 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 72b33b0e5c3b..7daea86a8a3b 100644
--- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,38 +36,37 @@
class GtkSalObject : public SalObject
{
- SystemChildData m_aSystemData;
- GtkWidget* m_pSocket;
- GdkRegion* m_pRegion;
+ SystemChildData m_aSystemData;
+ GtkWidget* m_pSocket;
+ GdkRegion* m_pRegion;
// signals
- static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
- static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
- static void signalDestroy( GtkObject*, gpointer );
+ static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
+ static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
+ static void signalDestroy( GtkObject*, gpointer );
public:
- GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow = sal_True );
+ GtkSalObject( GtkSalFrame* pParent, BOOL bShow = TRUE );
virtual ~GtkSalObject();
// overload all pure virtual methods
- virtual void ResetClipRegion();
- 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( sal_Bool bVisible );
- virtual void Enable( sal_Bool nEnable );
- virtual void GrabFocus();
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
- virtual void SetBackground();
- virtual void SetBackground( SalColor nSalColor );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
+ virtual void Show( BOOL bVisible );
+ virtual void Enable( BOOL nEnable );
+ virtual void GrabFocus();
- virtual void SetForwardKey( sal_Bool bEnable );
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
- virtual const SystemEnvData* GetSystemData() const;
+ virtual void SetForwardKey( BOOL bEnable );
- virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+ virtual const SystemEnvData* GetSystemData() const;
+
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx
index 9125b33f1b20..29148b2c658e 100644
--- a/vcl/unx/inc/plugins/kde/kdedata.hxx
+++ b/vcl/unx/inc/plugins/kde/kdedata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@ class KDEData : public X11SalData
public:
KDEData() {}
virtual ~KDEData();
-
+
virtual void Init();
virtual void initNWF();
virtual void deInitNWF();
@@ -57,9 +57,9 @@ class KDESalFrame : public X11SalFrame
struct GraphicsHolder
{
- X11SalGraphics* pGraphics;
- bool bInUse;
- GraphicsHolder()
+ X11SalGraphics* pGraphics;
+ bool bInUse;
+ GraphicsHolder()
: pGraphics( NULL ),
bInUse( false )
{}
@@ -68,23 +68,23 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, sal_uLong );
+ KDESalFrame( SalFrame* pParent, ULONG nStyle );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate );
};
class KDESalInstance : public X11SalInstance
{
public:
- KDESalInstance( SalYieldMutex* pMutex )
+ KDESalInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
};
class KDEXLib : public SalXLib
@@ -104,7 +104,7 @@ public:
{}
virtual ~KDEXLib();
virtual void Init();
-
+
void doStartup();
};
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 80d1f5fb92cc..9616202e74f7 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,15 +43,15 @@ class SalInfoPrinter;
class VCL_DLLPUBLIC PspGraphics : public SalGraphics
{
- psp::JobData* m_pJobData;
- psp::PrinterGfx* m_pPrinterGfx;
- String* m_pPhoneNr;
- bool m_bSwallowFaxNo;
- String m_aPhoneCollection;
- bool m_bPhoneCollectionActive;
-
- ServerFont* m_pServerFont[ MAX_FALLBACK ];
- bool m_bFontVertical;
+ psp::JobData* m_pJobData;
+ psp::PrinterGfx* m_pPrinterGfx;
+ String* m_pPhoneNr;
+ bool m_bSwallowFaxNo;
+ String m_aPhoneCollection;
+ bool m_bPhoneCollectionActive;
+
+ ServerFont* m_pServerFont[ MAX_FALLBACK ];
+ bool m_bFontVertical;
SalInfoPrinter* m_pInfoPrinter;
public:
PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter )
@@ -76,38 +76,40 @@ public:
static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& );
static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& );
- static FontWidth ToFontWidth (psp::width::type eWidth);
- static FontWeight ToFontWeight (psp::weight::type eWeight);
- static FontPitch ToFontPitch (psp::pitch::type ePitch);
- static FontItalic ToFontItalic (psp::italic::type eItalic);
- static FontFamily ToFontFamily (psp::family::type eFamily);
+ static FontWidth ToFontWidth (psp::width::type eWidth);
+ static FontWeight ToFontWeight (psp::weight::type eWeight);
+ static FontPitch ToFontPitch (psp::pitch::type ePitch);
+ static FontItalic ToFontItalic (psp::italic::type eItalic);
+ static FontFamily ToFontFamily (psp::family::type eFamily);
// overload all pure virtual methods
- virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual sal_uInt16 GetBitCount() const;
- virtual long GetGraphicsWidth() const;
-
- virtual void ResetClipRegion();
- virtual bool setClipRegion( const Region& );
-
- virtual void SetLineColor();
- virtual void SetLineColor( SalColor nSalColor );
- virtual void SetFillColor();
- virtual void SetFillColor( SalColor nSalColor );
- virtual void SetXORMode( bool bSet, bool );
- virtual void SetROPLineColor( SalROPColor nROPColor );
- virtual void SetROPFillColor( SalROPColor nROPColor );
-
- virtual void SetTextColor( SalColor nSalColor );
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- 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 sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
+ virtual USHORT GetBitCount();
+ 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 void SetLineColor();
+ virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetFillColor();
+ virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetXORMode( bool bSet, bool );
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
+ virtual ImplFontCharMap* GetImplFontCharMap() 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,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -116,76 +118,76 @@ public:
FontSubsetInfo& rInfo
);
virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- 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 GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
- 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( sal_uIntPtr nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
- virtual void drawPolyPolygon( sal_uInt32 nPoly,
+ 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( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
+ 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( sal_uIntPtr nPoints,
+ virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry );
- virtual void copyArea( long nDestX,
+ const BYTE* const* pFlgAry );
+ virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ USHORT nFlags );
+ virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- 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( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ 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 sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG 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&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
- virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h
index f72f77b9909f..bd9f2ae0ed5b 100644
--- a/vcl/unx/inc/salbmp.h
+++ b/vcl/unx/inc/salbmp.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,11 +37,11 @@
#include <vcl/salbmp.hxx>
#include <vcl/dllapi.h>
-struct BitmapBuffer;
-class BitmapPalette;
-class SalGraphics;
-class ImplSalDDB;
-class ImplSalBitmapCache;
+struct BitmapBuffer;
+class BitmapPalette;
+class SalGraphics;
+class ImplSalDDB;
+class ImplSalBitmapCache;
// -------------
// - SalBitmap -
@@ -51,10 +51,10 @@ class VCL_DLLPUBLIC X11SalBitmap : public SalBitmap
{
private:
- static BitmapBuffer* ImplCreateDIB( const Size& rSize,
- sal_uInt16 nBitCount,
+ static BitmapBuffer* ImplCreateDIB( const Size& rSize,
+ USHORT nBitCount,
const BitmapPalette& rPal );
- static BitmapBuffer* ImplCreateDIB( Drawable aDrawable,
+ static BitmapBuffer* ImplCreateDIB( Drawable aDrawable,
int nScreen,
long nDrawableDepth,
long nX, long nY,
@@ -63,12 +63,12 @@ private:
public:
- static ImplSalBitmapCache* mpCache;
- static sal_uIntPtr mnCacheInstCount;
+ static ImplSalBitmapCache* mpCache;
+ static ULONG mnCacheInstCount;
- static void ImplCreateCache();
- static void ImplDestroyCache();
- void ImplRemovedFromCache();
+ static void ImplCreateCache();
+ static void ImplDestroyCache();
+ void ImplRemovedFromCache();
bool SnapShot (Display* pDisplay, XLIB_Window hWindow);
bool ImplCreateFromXImage( Display* pDisplay,
@@ -78,52 +78,52 @@ public:
private:
- BitmapBuffer* mpDIB;
- ImplSalDDB* mpDDB;
+ BitmapBuffer* mpDIB;
+ ImplSalDDB* mpDDB;
bool mbGrey;
-
+
public:
SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable,
int nScreen,
long nDrawableDepth,
- long nX, long nY,
+ long nX, long nY,
long nWidth, long nHeight );
SAL_DLLPRIVATE XImage* ImplCreateXImage( SalDisplay* pSalDisp,
- int nScreen, long nDepth,
+ int nScreen, long nDepth,
const SalTwoRect& rTwoRect ) const;
SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( Drawable, int nScreen, long nDrawableDepth,
const SalTwoRect& ) const;
- void ImplDraw( Drawable aDrawable, int nScreen, long nDrawableDepth,
+ void ImplDraw( Drawable aDrawable, int nScreen, long nDrawableDepth,
const SalTwoRect& rTwoRect, const GC& rGC ) const;
-
-public:
-
+
+public:
+
X11SalBitmap();
virtual ~X11SalBitmap();
// overload pure virtual methods
- virtual bool Create( const Size& rSize,
- sal_uInt16 nBitCount,
+ virtual bool Create( const Size& rSize,
+ USHORT nBitCount,
const BitmapPalette& rPal );
- virtual bool Create( const SalBitmap& rSalBmp );
- virtual bool Create( const SalBitmap& rSalBmp,
+ virtual bool Create( const SalBitmap& rSalBmp );
+ virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmp,
- sal_uInt16 nNewBitCount );
- virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
+ virtual bool Create( const SalBitmap& rSalBmp,
+ USHORT 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 sal_uInt16 GetBitCount() const;
-
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
- virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
+
+ virtual void Destroy();
+
+ virtual Size GetSize() const;
+ virtual USHORT GetBitCount() const;
+
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
virtual bool GetSystemData( BitmapSystemData& rData );
};
@@ -135,23 +135,23 @@ class ImplSalDDB
{
private:
- Pixmap maPixmap;
- SalTwoRect maTwoRect;
- long mnDepth;
+ Pixmap maPixmap;
+ SalTwoRect maTwoRect;
+ long mnDepth;
int mnScreen;
ImplSalDDB() {}
- static void ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
+ static void ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
Drawable aDstDrawable, long nDstDrawableDepth,
- long nSrcX, long nSrcY,
- long nDestWidth, long nDestHeight,
+ long nSrcX, long nSrcY,
+ long nDestWidth, long nDestHeight,
long nDestX, long nDestY, const GC& rGC );
-
-public:
-
+
+public:
+
ImplSalDDB( XImage* pImage,
- Drawable aDrawable, int nScreen,
+ Drawable aDrawable, int nScreen,
const SalTwoRect& rTwoRect );
ImplSalDDB( Drawable aDrawable,
int nScreen,
@@ -160,18 +160,18 @@ public:
ImplSalDDB( Display* pDisplay,
XLIB_Window hWindow,
int nScreen,
- XImage* pImage);
+ XImage* pImage);
~ImplSalDDB();
-
- Pixmap ImplGetPixmap() const { return maPixmap; }
- long ImplGetWidth() const { return maTwoRect.mnDestWidth; }
- long ImplGetHeight() const { return maTwoRect.mnDestHeight; }
- long ImplGetDepth() const { return mnDepth; }
- sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
+
+ Pixmap ImplGetPixmap() const { return maPixmap; }
+ 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 ); }
int ImplGetScreen() const { return mnScreen; }
-
- bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
- void ImplDraw( Drawable aDrawable, long nDrawableDepth,
+
+ bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
+ void ImplDraw( Drawable aDrawable, long nDrawableDepth,
const SalTwoRect& rTwoRect, const GC& rGC ) const;
};
@@ -183,17 +183,17 @@ class ImplSalBitmapCache
{
private:
- List maBmpList;
- sal_uIntPtr mnTotalSize;
-
-public:
+ List maBmpList;
+ ULONG mnTotalSize;
+public:
+
ImplSalBitmapCache();
~ImplSalBitmapCache();
- void ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize = 0UL, sal_uIntPtr nFlags = 0UL );
- void ImplRemove( X11SalBitmap* pBmp );
- void ImplClear();
+ void ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize = 0UL, ULONG nFlags = 0UL );
+ void ImplRemove( X11SalBitmap* pBmp );
+ void ImplClear();
};
#endif // _SV_SALBMP_HXX
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index e967b0f7e4d0..83a8ce79d7a1 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,50 +45,50 @@ class SalPrinter;
// -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#if defined LINUX || defined NETBSD || defined AIX || \
- defined FREEBSD || defined OPENBSD || defined DRAGONFLY
+DECLARE_LIST( SalDisplays, SalDisplay* )
+
+#if defined SCO || defined LINUX || defined NETBSD || defined AIX || \
+ defined HPUX || defined FREEBSD || defined OPENBSD
#include <pthread.h>
#else
-typedef unsigned int pthread_t;
+typedef unsigned int pthread_t;
#endif
// -=-= SalData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class VCL_DLLPUBLIC X11SalData : public SalData
{
protected:
- sal_Bool bNoExceptions_;
- SalXLib *pXLib_;
- SalDisplay *m_pSalDisplay;
- pthread_t hMainThread_;
+ BOOL bNoExceptions_;
+ SalXLib *pXLib_;
+ SalDisplay *m_pSalDisplay;
+ pthread_t hMainThread_;
rtl::OUString maLocalHostName;
- rtl::OUString maUnicodeAccumulator;
public:
X11SalData();
virtual ~X11SalData();
-
- virtual void Init();
- virtual void initNWF();
- virtual void deInitNWF();
-
- inline void XError( Display *pDisplay, XErrorEvent *pEvent ) const;
-
- SalDisplay* GetDisplay() const
+
+ virtual void Init();
+ virtual void initNWF();
+ virtual void deInitNWF();
+
+ inline void XError( Display *pDisplay, XErrorEvent *pEvent ) const;
+
+ SalDisplay* GetDisplay() const
{ return m_pSalDisplay; }
- void SetSalDisplay( SalDisplay* pDisplay )
+ void SetSalDisplay( SalDisplay* pDisplay )
{ m_pSalDisplay = pDisplay; }
- void DeleteDisplay(); // for shutdown
-
- inline SalXLib* GetLib() const { return pXLib_; }
- inline pthread_t GetMainThread() const { return hMainThread_; }
+ void DeleteDisplay(); // for shutdown
+
+ inline SalXLib* GetLib() const { return pXLib_; }
+ inline pthread_t GetMainThread() const { return hMainThread_; }
- void StartTimer( sal_uLong nMS );
- inline void StopTimer();
- void Timeout() const;
+ void StartTimer( 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* );
@@ -105,13 +105,13 @@ inline X11SalData* GetX11SalData()
#ifdef _SV_SALDISP_HXX
-inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const
+inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const
{ pXLib_->XError( pDisplay, pEvent ); }
#endif
class YieldMutexReleaser
{
- sal_uLong m_nYieldCount;
+ ULONG m_nYieldCount;
public:
inline YieldMutexReleaser();
inline ~YieldMutexReleaser();
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 630e665c9def..0f3d3f3bf55e 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,10 +30,10 @@
#define _SV_SALDISP_HXX
// -=-= exports =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-class SalDisplay;
-class SalColormap;
-class SalVisual;
-class SalXLib;
+class SalDisplay;
+class SalColormap;
+class SalVisual;
+class SalXLib;
// -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <salunx.h>
@@ -43,43 +43,43 @@ class SalXLib;
#include <osl/mutex.h>
#include <vector>
#include <list>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <tools/gen.hxx>
#include <vcl/salwtype.hxx>
#include <vcl/dllapi.h>
// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-class BitmapPalette;
-class SalFrame;
-class ColorMask;
+class BitmapPalette;
+class SalFrame;
+class ColorMask;
namespace vcl_sal { class WMAdaptor; }
class DtIntegrator;
// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#define PROPERTY_SUPPORT_WM_SetPos 0x00000001
-#define PROPERTY_SUPPORT_WM_Screen 0x00000002
-#define PROPERTY_SUPPORT_WM_Parent_Pixmap_None 0x00000004
-#define PROPERTY_SUPPORT_WM_ClientPos 0x00000008
-#define PROPERTY_SUPPORT_XSetClipMask 0x00000010 // for bitmap ops.
-#define PROPERTY_SUPPORT_3ButtonMouse 0x00000020
-
-#define PROPERTY_BUG_XA_FAMILY_NAME_nil 0x00001000
-#define PROPERTY_BUG_XCopyArea_GXxor 0x00002000 // from window
-#define PROPERTY_BUG_Stipple 0x00004000 // 0/1 inverted
+#define PROPERTY_SUPPORT_WM_SetPos 0x00000001
+#define PROPERTY_SUPPORT_WM_Screen 0x00000002
+#define PROPERTY_SUPPORT_WM_Parent_Pixmap_None 0x00000004
+#define PROPERTY_SUPPORT_WM_ClientPos 0x00000008
+#define PROPERTY_SUPPORT_XSetClipMask 0x00000010 // for bitmap ops.
+#define PROPERTY_SUPPORT_3ButtonMouse 0x00000020
+
+#define PROPERTY_BUG_XA_FAMILY_NAME_nil 0x00001000
+#define PROPERTY_BUG_XCopyArea_GXxor 0x00002000 // from window
+#define PROPERTY_BUG_Stipple 0x00004000 // 0/1 inverted
#define PROPERTY_BUG_Tile 0x00008000 // Recreate the
// dither brush each time
#define PROPERTY_BUG_FillPolygon_Tile 0x00010000 // always Toggle Fillstyle
-#define PROPERTY_BUG_DrawLine 0x00020000 // a DrawLine is one point to short
-#define PROPERTY_BUG_CopyPlane_RevertBWPixel 0x00040000 // revert fg and bg for xcopyplane
-#define PROPERTY_BUG_CopyArea_OnlySmallSlices 0x00080000
-#define PROPERTY_BUG_Bitmap_Bit_Order 0x00100000
+#define PROPERTY_BUG_DrawLine 0x00020000 // a DrawLine is one point to short
+#define PROPERTY_BUG_CopyPlane_RevertBWPixel 0x00040000 // revert fg and bg for xcopyplane
+#define PROPERTY_BUG_CopyArea_OnlySmallSlices 0x00080000
+#define PROPERTY_BUG_Bitmap_Bit_Order 0x00100000
-#define PROPERTY_FEATURE_Maximize 0x01000000
+#define PROPERTY_FEATURE_Maximize 0x01000000
#define PROPERTY_FEATURE_SharedMemory 0x02000000
#define PROPERTY_FEATURE_TrustedSolaris 0x04000000
-#define PROPERTY_DEFAULT 0x00000FCB
+#define PROPERTY_DEFAULT 0x00000FCB
// ------------------------------------------------------------------------
// server vendor
@@ -103,16 +103,16 @@ typedef enum {
extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display );
// -=-= SalWM =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-enum SalWM { olwm, // Open Look
- mwm, // Motif
- kwm, // KDE Desktop Environment
- FourDwm, // SGI
- vuewm, // HP
- dtwm, // CDE
- winmgr, // Oracle NC
+enum SalWM { olwm, // Open Look
+ mwm, // Motif
+ kwm, // KDE Desktop Environment
+ FourDwm, // SGI
+ vuewm, // HP
+ dtwm, // CDE
+ winmgr, // Oracle NC
twm,
- fvwm, // ...
- pmwm, // SCO
+ fvwm, // ...
+ pmwm, // SCO
otherwm };
// -=-= SalRGB -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -121,36 +121,36 @@ enum SalWM { olwm, // Open Look
enum SalRGB { RGB, RBG,
GBR, GRB,
BGR, BRG,
- RGBA, RBGA,
+ RGBA, RBGA,
GBRA, GRBA,
BGRA, BRGA,
- otherSalRGB };
+ other };
// -=-= SalVisual =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class SalVisual : public XVisualInfo
{
- SalRGB eRGBMode_;
- int nRedShift_;
- int nGreenShift_;
- int nBlueShift_;
- int nRedBits_;
- int nGreenBits_;
- int nBlueBits_;
+ SalRGB eRGBMode_;
+ int nRedShift_;
+ int nGreenShift_;
+ int nBlueShift_;
+ int nRedBits_;
+ int nGreenBits_;
+ int nBlueBits_;
public:
SalVisual();
~SalVisual();
SalVisual( const XVisualInfo* pXVI );
- inline VisualID GetVisualId() const { return visualid; }
- inline Visual *GetVisual() const { return visual; }
- inline int GetClass() const { return c_class; }
- inline int GetDepth() const { return depth; }
- inline SalRGB GetMode() const { return eRGBMode_; }
-
- Pixel GetTCPixel( SalColor nColor ) const;
- SalColor GetTCColor( Pixel nPixel ) const;
- sal_Bool Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit
- sal_Bool Convert( int &n0, int &n1, int &n2 ); // 24bit
+ inline VisualID GetVisualId() const { return visualid; }
+ inline Visual *GetVisual() const { return visual; }
+ inline int GetClass() const { return c_class; }
+ inline int GetDepth() const { return depth; }
+ inline SalRGB GetMode() const { return eRGBMode_; }
+
+ 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
};
// -=-= SalColormap =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -158,47 +158,47 @@ class SalColormap
{
const SalDisplay* m_pDisplay;
Colormap m_hColormap;
- std::vector<SalColor> m_aPalette; // Pseudocolor
+ std::vector<SalColor> m_aPalette; // Pseudocolor
SalVisual m_aVisual;
- std::vector<sal_uInt16> m_aLookupTable; // Pseudocolor: 12bit reduction
+ std::vector<USHORT> m_aLookupTable; // Pseudocolor: 12bit reduction
Pixel m_nWhitePixel;
Pixel m_nBlackPixel;
- Pixel m_nUsed; // Pseudocolor
+ Pixel m_nUsed; // Pseudocolor
int m_nScreen;
- void GetPalette();
- void GetLookupTable();
+ void GetPalette();
+ void GetLookupTable();
public:
SalColormap( const SalDisplay* pSalDisplay,
Colormap hColormap,
int nScreen );
SalColormap( const BitmapPalette &rpPalette );
- SalColormap( sal_uInt16 nDepth );
+ SalColormap( USHORT nDepth );
SalColormap();
~SalColormap();
- inline Colormap GetXColormap() const { return m_hColormap; }
- inline const SalDisplay* GetDisplay() const { return m_pDisplay; }
- inline Display* GetXDisplay() const;
- inline const SalVisual& GetVisual() const { return m_aVisual; }
- inline Visual* GetXVisual() const { return m_aVisual.GetVisual(); }
- inline Pixel GetWhitePixel() const { return m_nWhitePixel; }
- inline Pixel GetBlackPixel() const { return m_nBlackPixel; }
- inline Pixel GetUsed() const { return m_nUsed; }
- inline int GetClass() const { return m_aVisual.GetClass(); }
+ inline Colormap GetXColormap() const { return m_hColormap; }
+ inline const SalDisplay* GetDisplay() const { return m_pDisplay; }
+ inline Display* GetXDisplay() const;
+ inline const SalVisual& GetVisual() const { return m_aVisual; }
+ inline Visual* GetXVisual() const { return m_aVisual.GetVisual(); }
+ inline Pixel GetWhitePixel() const { return m_nWhitePixel; }
+ inline Pixel GetBlackPixel() const { return m_nBlackPixel; }
+ inline Pixel GetUsed() const { return m_nUsed; }
+ inline int GetClass() const { return m_aVisual.GetClass(); }
inline int GetScreenNumber() const { return m_nScreen; }
- sal_Bool GetXPixels( XColor &rColor,
+ BOOL GetXPixels( XColor &rColor,
int r,
int g,
int b ) const;
- inline sal_Bool GetXPixel( XColor &rColor,
+ inline BOOL GetXPixel( XColor &rColor,
int r,
int g,
int b ) const;
- Pixel GetPixel( SalColor nColor ) const;
- SalColor GetColor( Pixel nPixel ) const;
- void SetPalette( const BitmapPalette &rPalette );
+ Pixel GetPixel( SalColor nColor ) const;
+ SalColor GetColor( Pixel nPixel ) const;
+ void SetPalette( const BitmapPalette &rPalette );
};
// -=-= SalXLib =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -208,18 +208,18 @@ struct YieldEntry;
class VCL_DLLPUBLIC SalXLib
{
protected:
- timeval m_aTimeout;
- sal_uLong m_nTimeoutMS;
+ timeval m_aTimeout;
+ ULONG m_nTimeoutMS;
int m_pTimeoutFDS[2];
- bool m_bHaveSystemChildFrames;
-
- int nFDs_;
- fd_set aReadFDS_;
- fd_set aExceptionFDS_;
- YieldEntry *pYieldEntries_;
+ bool m_bHaveSystemChildFrames;
+ int nFDs_;
+ fd_set aReadFDS_;
+ fd_set aExceptionFDS_;
+ YieldEntry *pYieldEntries_;
+
struct XErrorStackEntry
{
bool m_bIgnore;
@@ -231,32 +231,32 @@ protected:
XIOErrorHandler m_aOrigXIOErrorHandler;
public:
SalXLib();
- virtual ~SalXLib();
- virtual void Init();
+ virtual ~SalXLib();
+ virtual void Init();
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
+ virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual void Wakeup();
- virtual void PostUserEvent();
+ virtual void PostUserEvent();
virtual void Insert( int fd, void* data,
- YieldFunc pending,
- YieldFunc queued,
- YieldFunc handle );
+ YieldFunc pending,
+ YieldFunc queued,
+ YieldFunc handle );
virtual void Remove( int fd );
- void XError( Display *pDisp, XErrorEvent *pEvent );
- bool HasXErrorOccurred() const { return m_aXErrorHandlerStack.back().m_bWas; }
+ void XError( Display *pDisp, XErrorEvent *pEvent );
+ bool HasXErrorOccured() const { return m_aXErrorHandlerStack.back().m_bWas; }
unsigned int GetLastXErrorRequestCode() const { return m_aXErrorHandlerStack.back().m_nLastErrorRequest; }
- void ResetXErrorOccurred() { m_aXErrorHandlerStack.back().m_bWas = false; }
+ void ResetXErrorOccured() { m_aXErrorHandlerStack.back().m_bWas = false; }
void PushXErrorLevel( bool bIgnore );
void PopXErrorLevel();
- virtual void StartTimer( sal_uLong nMS );
- virtual void StopTimer();
+ virtual void StartTimer( ULONG nMS );
+ virtual void StopTimer();
bool CheckTimeout( bool bExecuteTimers = true );
- void setHaveSystemChildFrame()
+ void setHaveSystemChildFrame()
{ m_bHaveSystemChildFrames = true; }
bool getHaveSystemChildFrame() const
{ return m_bHaveSystemChildFrames; }
@@ -266,10 +266,15 @@ public:
class SalI18N_InputMethod;
class SalI18N_KeyboardExtension;
+class XlfdStorage;
+class ExtendedFontStruct;
+class ExtendedXlfd;
class AttributeProvider;
class SalUnicodeConverter;
class SalConverterCache;
+DECLARE_LIST( SalFontCache, ExtendedFontStruct* )
+
extern "C" {
struct SnDisplay;
struct SnLauncheeContext;
@@ -287,7 +292,7 @@ public:
RenderEntry() : m_aPixmap( 0 ), m_aPicture( 0 ) {}
};
- typedef boost::unordered_map<int,RenderEntry> RenderEntryMap;
+ typedef std::hash_map<int,RenderEntry> RenderEntryMap;
struct ScreenData
{
@@ -298,13 +303,13 @@ public:
Size m_aSize;
SalVisual m_aVisual;
SalColormap m_aColormap;
- GC m_aMonoGC;
- GC m_aCopyGC;
- GC m_aAndInvertedGC;
- GC m_aAndGC;
- GC m_aOrGC;
- GC m_aStippleGC;
- Pixmap m_hInvert50;
+ GC m_aMonoGC;
+ GC m_aCopyGC;
+ GC m_aAndInvertedGC;
+ GC m_aAndGC;
+ GC m_aOrGC;
+ GC m_aStippleGC;
+ Pixmap m_hInvert50;
mutable RenderEntryMap m_aRenderData;
ScreenData() :
@@ -324,79 +329,84 @@ public:
// -=-= UserEvent =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
struct SalUserEvent
{
- SalFrame* m_pFrame;
- void* m_pData;
- sal_uInt16 m_nEvent;
+ SalFrame* m_pFrame;
+ void* m_pData;
+ USHORT m_nEvent;
- SalUserEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
{}
};
-protected:
- SalXLib *pXLib_;
- SalI18N_InputMethod *mpInputMethod;
- SalI18N_KeyboardExtension *mpKbdExtension;
+protected:
+ SalXLib *pXLib_;
+ SalI18N_InputMethod *mpInputMethod;
+ SalI18N_KeyboardExtension *mpKbdExtension;
- AttributeProvider *mpFactory;
+ AttributeProvider *mpFactory;
+ XlfdStorage *mpFontList;
+ const ExtendedXlfd *mpFallbackFactory;
- Display *pDisp_; // X Display
- int m_nDefaultScreen; // XDefaultScreen
+ Display *pDisp_; // X Display
+ int m_nDefaultScreen; // XDefaultScreen
std::vector< ScreenData > m_aScreens;
ScreenData m_aInvalidScreenData;
- Pair aResolution_; // [dpi]
- bool mbExactResolution;
- sal_uLong nMaxRequestSize_; // [byte]
-
- srv_vendor_t meServerVendor;
- SalWM eWindowManager_;
- sal_uLong nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
- sal_Bool bLocal_; // Server==Client? Init
+ Pair aResolution_; // [dpi]
+ bool mbExactResolution;
+ ULONG nMaxRequestSize_; // [byte]
+
+ srv_vendor_t meServerVendor;
+ SalWM eWindowManager_;
+ ULONG nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
+ BOOL bLocal_; // Server==Client? Init
// in SalDisplay::IsLocal()
- sal_Bool mbLocalIsValid; // bLocal_ is valid ?
+ BOOL mbLocalIsValid; // bLocal_ is valid ?
// until x bytes
oslMutex hEventGuard_;
std::list< SalUserEvent > m_aUserEvents;
- XLIB_Cursor aPointerCache_[POINTER_COUNT];
- SalFrame* m_pCapture;
+ XLIB_Cursor aPointerCache_[POINTER_COUNT];
+ SalFrame* m_pCapture;
+
+ mutable SalFontCache* m_pFontCache;
// Keyboard
- 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
- KeySym nCtrlKeySym_; // first control modifier
- KeySym nMod1KeySym_; // first mod1 modifier
- ByteString m_aKeyboardName;
-
- vcl_sal::WMAdaptor* m_pWMAdaptor;
+ 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
+ KeySym nCtrlKeySym_; // first control modifier
+ KeySym nMod1KeySym_; // first mod1 modifier
+ ByteString m_aKeyboardName;
+
+ vcl_sal::WMAdaptor* m_pWMAdaptor;
DtIntegrator* m_pDtIntegrator;
- bool m_bXinerama;
+ bool m_bXinerama;
std::vector< Rectangle > m_aXineramaScreens;
std::vector< int > m_aXineramaScreenIndexMap;
std::list<SalFrame*> m_aFrames;
std::list<SalObject*> m_aSalObjects;
-
+
bool m_bUseRandRWrapper; // don't use randr on gtk, use gdk signals there
-
+
mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access
- virtual long Dispatch( XEvent *pEvent ) = 0;
- void InitXinerama();
+ void DestroyFontCache();
+ virtual long Dispatch( XEvent *pEvent ) = 0;
+ void InitXinerama();
void InitRandR( XLIB_Window aRoot ) const;
void DeInitRandR();
int processRandREvent( XEvent* );
- void doDestruct();
+ void doDestruct();
void addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight );
public:
- static SalDisplay *GetSalDisplay( Display* display );
- static sal_Bool BestVisual( Display *pDisp,
+ static SalDisplay *GetSalDisplay( Display* display );
+ static BOOL BestVisual( Display *pDisp,
int nScreen,
XVisualInfo &rVI );
@@ -405,44 +415,52 @@ public:
virtual ~SalDisplay();
- virtual void registerFrame( SalFrame* pFrame );
- virtual void deregisterFrame( SalFrame* pFrame );
- void setHaveSystemChildFrame() const
+ virtual void registerFrame( SalFrame* pFrame );
+ virtual void deregisterFrame( SalFrame* pFrame );
+ void setHaveSystemChildFrame() const
{ pXLib_->setHaveSystemChildFrame(); }
bool getHaveSystemChildFrame() const
{ return pXLib_->getHaveSystemChildFrame(); }
- void Init();
+ void Init();
- 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 SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT );
+ void CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent );
+ bool DispatchInternalEvent();
+ void PrintInfo() const;
- void PrintEvent( const ByteString &rComment,
+ void PrintEvent( const ByteString &rComment,
XEvent *pEvent ) const;
- void Beep() const;
-
- void ModifierMapping();
- void SimulateKeyPress( sal_uInt16 nKeyCode );
- sal_uInt16 GetIndicatorState() const;
- String GetKeyNameFromKeySym( KeySym keysym ) const;
- XubString GetKeyName( sal_uInt16 nKeyCode ) const;
- sal_uInt16 GetKeyCode( KeySym keysym, char*pcPrintable ) const;
- KeySym GetKeySym( XKeyEvent *pEvent,
+ 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;
+ String GetKeyNameFromKeySym( KeySym keysym ) const;
+ XubString GetKeyName( USHORT nKeyCode ) const;
+ USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const;
+ KeySym GetKeySym( XKeyEvent *pEvent,
unsigned char *pPrintable,
- int *pLen,
+ int *pLen,
KeySym *pUnmodifiedKeySym,
Status *pStatus,
XIC = NULL ) const;
- XLIB_Cursor GetPointer( int ePointerStyle );
- virtual int CaptureMouse( SalFrame *pCapture );
+ XLIB_Cursor GetPointer( int ePointerStyle );
+ virtual int CaptureMouse( SalFrame *pCapture );
- sal_Bool IsLocal();
+ BOOL IsLocal();
- void Remove( XEvent *pEvent );
+ void Remove( XEvent *pEvent );
virtual void initScreen( int nScreen ) const;
const ScreenData& getDataForScreen( int nScreen ) const
@@ -454,49 +472,49 @@ public:
return m_aScreens[nScreen];
}
- XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; }
- Display *GetDisplay() const { return pDisp_; }
- int GetDefaultScreenNumber() const { return m_nDefaultScreen; }
+ XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; }
+ Display *GetDisplay() const { return pDisp_; }
+ int GetDefaultScreenNumber() const { return m_nDefaultScreen; }
virtual int GetDefaultMonitorNumber() const { return 0; }
const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
- srv_vendor_t GetServerVendor() const { return meServerVendor; }
- void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
- 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( sal_uInt16 nDepth, int nScreen ) const;
- Pixmap GetInvert50( int nScreen ) const { return getDataForScreen(nScreen).m_hInvert50; }
+ srv_vendor_t GetServerVendor() const { return meServerVendor; }
+ void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
+ 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;
+ 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; }
- sal_uLong GetProperties() const { return nProperties_; }
- sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; }
+ const Pair &GetResolution() const { return aResolution_; }
+ bool GetExactResolution() const { return mbExactResolution; }
+ ULONG GetProperties() const { return nProperties_; }
+ ULONG GetMaxRequestSize() const { return nMaxRequestSize_; }
XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const;
-
+
bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const;
- sal_Bool MouseCaptured( const SalFrame *pFrameData ) const
+ BOOL MouseCaptured( const SalFrame *pFrameData ) const
{ return m_pCapture == pFrameData; }
- SalFrame* GetCaptureFrame() const
+ SalFrame* GetCaptureFrame() const
{ return m_pCapture; }
SalXLib* GetXLib() const { return pXLib_; }
- SalI18N_InputMethod* GetInputMethod() const { return mpInputMethod; }
- SalI18N_KeyboardExtension* GetKbdExtension() const { return mpKbdExtension; }
- void SetInputMethod( SalI18N_InputMethod *pInputMethod )
+ SalI18N_InputMethod* GetInputMethod() const { return mpInputMethod; }
+ SalI18N_KeyboardExtension* GetKbdExtension() const { return mpKbdExtension; }
+ void SetInputMethod( SalI18N_InputMethod *pInputMethod )
{ mpInputMethod = pInputMethod; }
- void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension)
- { mpKbdExtension = pKbdExtension; }
- const char* GetKeyboardName( bool bRefresh = false );
+ void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension)
+ { mpKbdExtension = pKbdExtension; }
+ const char* GetKeyboardName( bool bRefresh = false );
::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; }
DtIntegrator* getDtIntegrator() const { return m_pDtIntegrator; }
- bool IsXinerama() const { return m_bXinerama; }
+ bool IsXinerama() const { return m_bXinerama; }
const std::vector< Rectangle >& GetXineramaScreens() const { return m_aXineramaScreens; }
XLIB_Window GetRootWindow( int nScreen ) const
{ return getDataForScreen( nScreen ).m_aRoot; }
@@ -507,21 +525,21 @@ public:
const std::list< SalFrame* >& getFrames() const
{ return m_aFrames; }
- sal_Bool IsNumLockFromXS() const { return bNumLockFromXS_; }
+ BOOL IsNumLockFromXS() const { return bNumLockFromXS_; }
std::list< SalObject* >& getSalObjects() { return m_aSalObjects; }
};
// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-inline GC SalDisplay::GetGC( sal_uInt16 nDepth, int nScreen ) const
+inline GC SalDisplay::GetGC( USHORT nDepth, int nScreen ) const
{ return 1 == nDepth
? GetMonoGC( nScreen )
: getDataForScreen(nScreen).m_aVisual.GetDepth() == nDepth
? GetCopyGC( nScreen )
: None; }
-inline Display *SalColormap::GetXDisplay() const
+inline Display *SalColormap::GetXDisplay() const
{ return m_pDisplay->GetDisplay(); }
class VCL_DLLPUBLIC SalX11Display : public SalDisplay
@@ -530,10 +548,10 @@ public:
SalX11Display( Display* pDisp );
virtual ~SalX11Display();
- virtual long Dispatch( XEvent *pEvent );
- virtual void Yield();
+ virtual long Dispatch( XEvent *pEvent );
+ virtual void Yield();
- sal_Bool IsEvent();
+ BOOL IsEvent();
};
/*----------------------------------------------------------
diff --git a/vcl/unx/inc/salfont.h b/vcl/unx/inc/salfont.h
new file mode 100644
index 000000000000..f5d7a937d43c
--- /dev/null
+++ b/vcl/unx/inc/salfont.h
@@ -0,0 +1,182 @@
+/* -*- 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_SALFONT_H
+#define _SV_SALFONT_H
+
+// -=-= exports =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+class SalFontCache;
+struct SalFontDimension;
+class SalFontFamily;
+class SalFontFamilyList;
+class SalFontStruct;
+class SalFontStructList;
+class SalFonts;
+
+// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#include <salstd.hxx>
+#include <vcl/outfont.hxx>
+
+// -=-= forwards =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+typedef ULONG XFP_FLAGS;
+
+class SalDisplay;
+class SalFontCacheItem;
+
+// -=-= SalFontCache -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+DECLARE_LIST( SalFontCache, SalFontCacheItem* )
+
+// -=-= SalFontDimension -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+struct SalFontDimension
+{
+ USHORT nHeight_; // [pixel]
+ USHORT nPtHeight_; // [point/10]
+ USHORT nAverage_; // [pixel/10]
+ USHORT nXRes_; // [dpi]
+ USHORT nYRes_; // [dpi]
+ USHORT nSlant_; // [pixel]
+// size_t nUnderlineThickness_; // [pixel]
+// size_t nUnderlinePosition_; // [pixel]
+// size_t nStrikeoutAscent_; // [pixel]
+// size_t nStrikeoutDescent_; // [pixel]
+// Subscript, Superscript, Capital, Space ...
+
+ inline SalFontDimension( USHORT nA = 0, USHORT nH = 0 );
+
+ inline BOOL IsScalable() const;
+ inline USHORT GetWidth() const { return (nAverage_ + 5) / 10; }
+ inline Size GetSize() const;
+ inline void SetSize( const Size & rSize );
+ inline BOOL operator == ( const SalFontDimension &r ) const;
+ inline BOOL operator != ( const SalFontDimension &r ) const;
+ inline BOOL operator >= ( const SalFontDimension &r ) const;
+};
+
+inline SalFontDimension::SalFontDimension( USHORT nA, USHORT nH )
+ : nHeight_( nH ), nAverage_( nA )
+{ nPtHeight_ = nXRes_ = nYRes_ = nSlant_ = 0; }
+
+inline BOOL SalFontDimension::IsScalable() const
+{ return !nHeight_ && !nPtHeight_ && !nAverage_; }
+
+inline Size SalFontDimension::GetSize() const
+{ return Size( (nAverage_ + 5) / 10, nHeight_ ); }
+
+inline void SalFontDimension::SetSize( const Size & rSize )
+{ nAverage_ = (USHORT)rSize.Width() * 10; nHeight_ = (USHORT)rSize.Height(); }
+
+inline BOOL SalFontDimension::operator == ( const SalFontDimension &r ) const
+{ return nHeight_ == r.nHeight_ && (!r.nAverage_ || nAverage_ == r.nAverage_); }
+
+inline BOOL SalFontDimension::operator != ( const SalFontDimension &r ) const
+{ return !(*this == r); }
+
+inline BOOL SalFontDimension::operator >= ( const SalFontDimension &r ) const
+{ return nHeight_ > r.nHeight_
+ || (nHeight_ == r.nHeight_ && nAverage_ >= r.nAverage_); }
+
+// -=-= SalFontStruct =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+class SalFontStruct : public ImplFontMetricData
+{
+ friend class SalDisplay;
+ friend class SalGraphicsData;
+
+ SalFontCacheItem*pCache_;
+
+#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+ ByteString aFontName_;
+#endif
+ USHORT nHeightCount_; // Anzahl der Hoehen-Eintraege
+ SalFontDimension*pDimensions_; // Hoehen-Array
+ USHORT nWeight_;
+
+ USHORT nFoundry_; // properties indexies
+ USHORT nFamily_;
+ USHORT nWeightName_;
+ USHORT nSlant_;
+ USHORT nSetWidthName_;
+ ByteString aAddStyleName_;
+ USHORT nSpacing_;
+ USHORT nCharSet_;
+ USHORT nFaceName_;
+ BOOL mbValidFontDescription; // valid xlfd entries
+
+ void Init();
+ BOOL Init( SalDisplay* pDisp,
+ const char* pFontName,
+ SalFontDimension& rDim );
+
+ ByteString GetXFontName( const SalFontDimension& );
+
+ inline void SetFoundry( USHORT n )
+ { nFoundry_ = n; }
+ inline void SetFamily( USHORT n )
+ { meFamily = sal_FamilyToSal( nFamily_ = n ); }
+ inline void SetWeightName( USHORT n )
+ { meWeight = sal_WeightToSal( nWeightName_ = n ); }
+ inline void SetSlant( USHORT n )
+ { meItalic = sal_ItalicToSal( nSlant_ = n ); }
+ inline void SetSetWidthName( USHORT n )
+ { nSetWidthName_ = n; }
+ inline void SetAddStyleName( const ByteString& rAddStyle )
+ { aAddStyleName_ = rAddStyle; aAddStyleName_.ToLowerAscii(); }
+ inline void SetSpacing( USHORT n )
+ { mePitch = sal_PitchToSal( nSpacing_ = n ); }
+ inline void SetAverage( long n )
+ { mnWidth = (n + 5) / 10; }
+ void SetCharSet( USHORT n );
+
+ SalFontStruct( const SalFontStruct& rFont );
+public:
+ SalFontStruct( SalDisplay* pDisp,
+ const char* pFontName,
+ SalFontDimension& rDim );
+
+ ~SalFontStruct();
+
+ inline void Cache( SalFontCacheItem *p ) { pCache_ = p; }
+ inline SalFontCacheItem*IsCache() const { return pCache_; }
+ inline BOOL IsScalable() const { return TYPE_SCALABLE==meType; }
+ inline SalFontDimension*GetDim() const { return pDimensions_; }
+ inline BOOL IsValid() const { return mbValidFontDescription; }
+#ifdef DBG_UTIL
+ const ByteString& GetName() const { return aFontName_; }
+#endif
+
+ ImplFontData *GetDevFontData();
+ SalFontCacheItem*Load( SalDisplay *pDisp, const SalFontDimension &rDim );
+ CharSet GetCharSet() { return meCharSet; }
+
+};
+
+// -=-= SalFontStructList =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+DECLARE_LIST( SalFontStructList, SalFontStruct* )
+
+#endif // _SV_SALFONT_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index 0025afce2ad6..7986ee1ddc6a 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,249 +44,242 @@
#include <list>
// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-class SalDisplay;
-class X11SalGraphics;
+class SalDisplay;
+class X11SalGraphics;
class SalGraphicsLayout;
class SalI18N_InputContext;
namespace vcl_sal { class WMAdaptor; class NetWMAdaptor; class GnomeWMAdaptor; }
// -=-= X11SalFrame =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-#define SHOWSTATE_UNKNOWN -1
-#define SHOWSTATE_MINIMIZED 0
-#define SHOWSTATE_NORMAL 1
-#define SHOWSTATE_HIDDEN 2
+#define SHOWSTATE_UNKNOWN -1
+#define SHOWSTATE_MINIMIZED 0
+#define SHOWSTATE_NORMAL 1
+#define SHOWSTATE_HIDDEN 2
class VCL_DLLPUBLIC X11SalFrame : public SalFrame
{
friend class vcl_sal::WMAdaptor;
friend class vcl_sal::NetWMAdaptor;
friend class vcl_sal::GnomeWMAdaptor;
-
+
static X11SalFrame* s_pSaveYourselfFrame;
-
- X11SalFrame* mpParent; // pointer to parent frame
+
+ X11SalFrame* mpParent; // pointer to parent frame
// which should never obscur this frame
- bool mbTransientForRoot;
+ bool mbTransientForRoot;
std::list< X11SalFrame* > maChildren; // List of child frames
-
- SalDisplay *pDisplay_;
+
+ SalDisplay *pDisplay_;
int m_nScreen;
- XLIB_Window mhWindow;
- XLIB_Window mhShellWindow;
- XLIB_Window mhForeignParent;
+ XLIB_Window mhWindow;
+ XLIB_Window mhShellWindow;
+ XLIB_Window mhForeignParent;
// window to fall back to when no longer in fullscreen mode
- XLIB_Window mhStackingWindow;
+ XLIB_Window mhStackingWindow;
// window to listen for CirculateNotify events
-
+
Pixmap mhBackgroundPixmap;
-
- XLIB_Cursor hCursor_;
- int nCaptured_; // is captured
-
- X11SalGraphics *pGraphics_; // current frame graphics
- X11SalGraphics *pFreeGraphics_; // first free frame graphics
-
- XLIB_Time nReleaseTime_; // timestamp of last key release
- sal_uInt16 nKeyCode_; // last key code
- sal_uInt16 nKeyState_; // last key state
- int nCompose_; // compose state
- bool mbSendExtKeyModChange;
- sal_uInt16 mnExtKeyMod;
-
- int nShowState_; // show state
- int nWidth_; // client width
- int nHeight_; // client height
- Rectangle maRestorePosSize;
- sal_uIntPtr nStyle_;
+
+ XLIB_Cursor hCursor_;
+ int nCaptured_; // is captured
+
+ X11SalGraphics *pGraphics_; // current frame graphics
+ X11SalGraphics *pFreeGraphics_; // first free frame graphics
+
+ XLIB_Time nReleaseTime_; // timestamp of last key release
+ USHORT nKeyCode_; // last key code
+ USHORT nKeyState_; // last key state
+ int nCompose_; // compose state
+ bool mbKeyMenu;
+ bool mbSendExtKeyModChange;
+ USHORT mnExtKeyMod;
+
+ int nShowState_; // show state
+ int nWidth_; // client width
+ int nHeight_; // client height
+ Rectangle maRestorePosSize;
+ ULONG nStyle_;
SalExtStyle mnExtStyle;
- sal_Bool bAlwaysOnTop_;
- sal_Bool bViewable_;
- sal_Bool bMapped_;
- sal_Bool mbInShow;
- sal_Bool bDefaultPosition_; // client is centered initially
+ BOOL bAlwaysOnTop_;
+ BOOL bViewable_;
+ BOOL bMapped_;
+ BOOL mbInShow;
+ BOOL bDefaultPosition_; // client is centered initially
bool m_bXEmbed;
- int nVisibility_;
+ int nVisibility_;
int m_nWorkArea;
bool m_bSetFocusOnMap;
+
+ int nScreenSaversTimeout_;
+ Rectangle maPaintRegion;
- int nScreenSaversTimeout_;
- Rectangle maPaintRegion;
-
- Timer maAlwaysOnTopRaiseTimer;
-
+ Timer maAlwaysOnTopRaiseTimer;
+
// data for WMAdaptor
- int meWindowType;
- int mnDecorationFlags;
- bool mbMaximizedVert;
- bool mbMaximizedHorz;
- bool mbShaded;
- bool mbFullScreen;
-
+ int meWindowType;
+ int mnDecorationFlags;
+ bool mbMaximizedVert;
+ bool mbMaximizedHorz;
+ bool mbShaded;
+ bool mbFullScreen;
+
// icon id
- int mnIconID;
-
+ int mnIconID;
+
String m_aTitle;
rtl::OUString m_sWMClass;
-
+
SystemChildData maSystemChildData;
-
+
SalI18N_InputContext *mpInputContext;
- Bool mbInputFocus;
-
+ Bool mbInputFocus;
+
XRectangle* m_pClipRectangles;
int m_nCurClipRect;
int m_nMaxClipRect;
-
- bool mPendingSizeEvent;
-
- void GetPosSize( Rectangle &rPosSize );
- void SetSize ( const Size &rSize );
+
+
+ void GetPosSize( Rectangle &rPosSize );
+ void SetSize ( const Size &rSize );
void Center();
- void SetPosSize( const Rectangle &rPosSize );
- void Minimize();
- void Maximize();
- void Restore();
+ void SetPosSize( const Rectangle &rPosSize );
+ void Minimize();
+ void Maximize();
+ void Restore();
void SetWindowGravity (int nGravity ) const;
-
- void RestackChildren( XLIB_Window* pTopLevelWindows, int nTopLevelWindows );
- void RestackChildren();
-
- long HandleKeyEvent ( XKeyEvent *pEvent );
- long HandleMouseEvent ( XEvent *pEvent );
- long HandleFocusEvent ( XFocusChangeEvent *pEvent );
- long HandleExposeEvent ( XEvent *pEvent );
- long HandleSizeEvent ( XConfigureEvent *pEvent );
- long HandleColormapEvent ( XColormapEvent *pEvent );
- long HandleMapUnmapEvent ( XEvent *pEvent );
- long HandleStateEvent ( XPropertyEvent *pEvent );
- long HandleReparentEvent ( XReparentEvent *pEvent );
- long HandleClientMessage ( XClientMessageEvent*pEvent );
-
+
+ void RestackChildren( XLIB_Window* pTopLevelWindows, int nTopLevelWindows );
+ void RestackChildren();
+
+ long HandleKeyEvent ( XKeyEvent *pEvent );
+ long HandleMouseEvent ( XEvent *pEvent );
+ long HandleFocusEvent ( XFocusChangeEvent *pEvent );
+ long HandleExposeEvent ( XEvent *pEvent );
+ long HandleSizeEvent ( XConfigureEvent *pEvent );
+ long HandleColormapEvent ( XColormapEvent *pEvent );
+ long HandleMapUnmapEvent ( XEvent *pEvent );
+ long HandleStateEvent ( XPropertyEvent *pEvent );
+ long HandleReparentEvent ( XReparentEvent *pEvent );
+ long HandleClientMessage ( XClientMessageEvent*pEvent );
+
DECL_LINK( HandleAlwaysOnTopRaise, void* );
- void passOnSaveYourSelf();
-
+ void passOnSaveYourSelf();
+
void createNewWindow( XLIB_Window aParent, int nScreen = -1 );
void updateScreenNumber();
-
+
void setXEmbedInfo();
void askForXEmbedFocus( sal_Int32 i_nTimeCode );
void updateWMClass();
public:
- X11SalFrame( SalFrame* pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent = NULL );
+ X11SalFrame( SalFrame* pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent = NULL );
virtual ~X11SalFrame();
- long Dispatch( XEvent *pEvent );
- void Init( sal_uIntPtr nSalFrameStyle, int nScreen = -1,
+ long Dispatch( XEvent *pEvent );
+ void Init( ULONG nSalFrameStyle, int nScreen = -1,
SystemParentData* pParentData = NULL, bool bUseGeometry = false );
- SalDisplay* GetDisplay() const { return pDisplay_; }
- Display* GetXDisplay() const;
- XLIB_Window GetDrawable() const;
+ SalDisplay* GetDisplay() const { return pDisplay_; }
+ Display* GetXDisplay() const;
+ XLIB_Window GetDrawable() const;
int GetScreenNumber() const { return m_nScreen; }
- XLIB_Window GetWindow() const { return mhWindow; }
- XLIB_Window GetShellWindow() const { return mhShellWindow; }
- XLIB_Window GetForeignParent() const { return mhForeignParent; }
- XLIB_Window GetStackingWindow() const { return mhStackingWindow; }
- long ShutDown() const { return CallCallback( SALEVENT_SHUTDOWN, 0 ); }
- long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); }
- sal_uIntPtr GetStyle() const { return nStyle_; }
-
- inline XLIB_Cursor GetCursor() const { return hCursor_; }
- inline sal_Bool IsCaptured() const { return nCaptured_ == 1; }
+ XLIB_Window GetWindow() const { return mhWindow; }
+ XLIB_Window GetShellWindow() const { return mhShellWindow; }
+ XLIB_Window GetForeignParent() const { return mhForeignParent; }
+ 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_; }
+
+ inline XLIB_Cursor GetCursor() const { return hCursor_; }
+ inline BOOL IsCaptured() const { return nCaptured_ == 1; }
#if !defined(__synchronous_extinput__)
- void HandleExtTextEvent (XClientMessageEvent *pEvent);
- void PostExtTextEvent (sal_uInt16 nExtTextEventType,
+ void HandleExtTextEvent (XClientMessageEvent *pEvent);
+ void PostExtTextEvent (sal_uInt16 nExtTextEventType,
void *pExtTextEvent);
#endif
- bool IsOverrideRedirect() const;
+ bool IsOverrideRedirect() const;
bool IsChildWindow() const { return (nStyle_ & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD)) != 0; }
bool IsSysChildWindow() const { return (nStyle_ & (SAL_FRAME_STYLE_SYSTEMCHILD)) != 0; }
- bool IsFloatGrabWindow() const;
+ bool IsFloatGrabWindow() const;
SalI18N_InputContext* getInputContext() const { return mpInputContext; }
- void getPosSize( Rectangle& rRect ) { GetPosSize( rRect ); }
- void setPosSize( const Rectangle& rRect ) { SetPosSize( rRect ); }
- bool isMapped() const { return bMapped_; }
+ void getPosSize( Rectangle& rRect ) { GetPosSize( rRect ); }
+ void setPosSize( const Rectangle& rRect ) { SetPosSize( rRect ); }
+ 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 );
-
+
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+
// call with true to clear graphics (setting None as drawable)
// call with false to setup graphics with window (GetWindow())
virtual void updateGraphics( bool bClear );
- virtual sal_Bool PostEvent( void* pData );
+ virtual BOOL PostEvent( void* pData );
- virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( sal_uInt16 nIcon );
- virtual void SetMenu( SalMenu* pMenu );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT nIcon );
+ virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
- virtual void Enable( sal_Bool bEnable );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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, 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 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( sal_Bool bMouse );
- virtual void SetPointerPos( long nX, long nY );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT 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 void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( 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( 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 );
- virtual void Beep( SoundType eSoundType );
- virtual const SystemEnvData* GetSystemData() const;
+ 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 LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
- virtual void SetParent( SalFrame* pNewParent );
- virtual bool SetPluginParent( SystemParentData* pNewParent );
+ virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SetParent( SalFrame* pNewParent );
+ virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
virtual void SetScreenNumber( unsigned int );
virtual void SetApplicationID( const rtl::OUString &rWMClass );
-
+
// shaped system windows
// set clip region to none (-> rectangular windows, normal state)
- virtual void ResetClipRegion();
+ virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( sal_uIntPtr nRects );
+ virtual void BeginSetClipRegion( ULONG nRects );
// add a rectangle to the clip region
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
- virtual void EndSetClipRegion();
+ virtual void EndSetClipRegion();
static void SaveYourselfDone( SalFrame* );
static Bool checkKeyReleaseForRepeat( Display*, XEvent*, XPointer pX11SalFrame );
-
- /// @internal
- void setPendingSizeEvent();
};
#ifdef _SV_SALDISP_HXX
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index a2774099673b..038e12911a9b 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,15 +29,18 @@
#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;
@@ -63,27 +66,14 @@ namespace basegfx {
class CairoFontsCache
{
-public:
- struct CacheId
- {
- const void *mpFace;
- const void *mpOptions;
- bool mbEmbolden;
- bool operator ==(const CacheId& rOther) const
- {
- return mpFace == rOther.mpFace &&
- mpOptions == rOther.mpOptions &&
- mbEmbolden == rOther.mbEmbolden;
- }
- };
private:
static int mnRefCount;
- typedef std::deque< std::pair<void *, CacheId> > LRUFonts;
+ typedef std::deque< std::pair<void *, void*> > LRUFonts;
static LRUFonts maLRUFonts;
public:
CairoFontsCache();
- static void CacheFont(void *pFont, const CacheId &rId);
- static void* FindCachedFont(const CacheId &rId);
+ static void CacheFont(void *pFont, void *pId);
+ static void* FindCachedFont(void *pId);
~CairoFontsCache();
};
@@ -92,8 +82,8 @@ class VCL_DLLPUBLIC X11SalGraphics : public SalGraphics
friend class X11FontLayout;
friend class ServerFontLayout;
protected:
- SalFrame* m_pFrame; // the SalFrame which created this Graphics or NULL
- X11SalVirtualDevice* m_pVDev; // the SalVirtualDevice which created this Graphics or NULL
+ SalFrame* m_pFrame; // the SalFrame which created this Graphics or NULL
+ X11SalVirtualDevice* m_pVDev; // the SalVirtualDevice which created this Graphics or NULL
const SalColormap* m_pColormap;
SalColormap *m_pDeleteColormap;
@@ -104,85 +94,85 @@ protected:
CairoFontsCache m_aCairoFontsCache;
XLIB_Region pPaintRegion_;
- XLIB_Region mpClipRegion;
+ XLIB_Region pClipRegion_;
GC pPenGC_; // Pen attributes
SalColor nPenColor_;
Pixel nPenPixel_;
GC pFontGC_; // Font attributes
+ ExtendedFontStructRef mXFont[ MAX_FALLBACK ];
ServerFont* mpServerFont[ MAX_FALLBACK ];
SalColor nTextColor_;
Pixel nTextPixel_;
- sal_Bool bFontVertical_;
+ BOOL bFontVertical_;
- sal_Bool bDisableGraphite_;
+ BOOL bDisableGraphite_;
GC pBrushGC_; // Brush attributes
SalColor nBrushColor_;
Pixel nBrushPixel_;
Pixmap hBrush_; // Dither
- GC pMonoGC_;
- GC pCopyGC_;
- GC pMaskGC_;
- GC pInvertGC_;
- GC pInvert50GC_;
- GC pStippleGC_;
- GC pTrackingGC_;
-
- 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
- sal_Bool bDitherBrush_ : 1; // is solid or tile
-
- using SalGraphics::SetClipRegion;
- void SetClipRegion( GC pGC,
+ GC pMonoGC_;
+ GC pCopyGC_;
+ GC pMaskGC_;
+ GC pInvertGC_;
+ GC pInvert50GC_;
+ 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
+ bool bXORMode_ : 1; // is ROP XOR Mode set
+ BOOL bDitherBrush_ : 1; // is solid or tile
+
+ void SetClipRegion( GC pGC,
XLIB_Region pXReg = NULL ) const;
- GC GetTrackingGC();
- GC GetInvertGC();
- GC GetInvert50GC();
- GC CreateGC( Drawable hDrawable,
+ GC GetTrackingGC();
+ GC GetInvertGC();
+ GC GetInvert50GC();
+ GC CreateGC( Drawable hDrawable,
unsigned long nMask = GCGraphicsExposures );
- GC SelectPen();
- GC SelectBrush();
- void DrawLines( sal_uIntPtr nPoints,
+ GC SelectPen();
+ GC SelectBrush();
+ void DrawLines( ULONG nPoints,
const SalPolyLine &rPoints,
- GC pGC,
+ GC pGC,
bool bClose
);
- sal_Bool GetDitherPixmap ( SalColor nSalColor );
+ BOOL GetDitherPixmap ( SalColor nSalColor );
- inline GC GetMonoGC( Pixmap hPixmap );
- inline GC GetCopyGC();
- inline GC GetStippleGC();
+ inline GC GetMonoGC( Pixmap hPixmap );
+ inline GC GetCopyGC();
+ inline GC GetStippleGC();
- int Clip ( XLIB_Region pRegion,
+ int Clip ( XLIB_Region pRegion,
int &nX,
int &nY,
unsigned int &nDX,
unsigned int &nDY,
int &nSrcX,
int &nSrcY ) const;
- int Clip ( int &nX,
+ int Clip ( int &nX,
int &nY,
unsigned int &nDX,
unsigned int &nDY,
int &nSrcX,
int &nSrcY ) const;
- GC SetMask ( int &nX,
+ GC SetMask ( int &nX,
int &nY,
unsigned int &nDX,
unsigned int &nDY,
@@ -196,7 +186,7 @@ protected:
const SalBitmap &rTransparentBitmap,
SalColor nTransparentColor );
- GC GetFontGC();
+ GC SelectFont();
bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
void drawMaskedBitmap( const SalTwoRect* pPosAry,
@@ -204,6 +194,9 @@ 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& );
@@ -211,11 +204,11 @@ protected:
void DrawServerAAFontString( const ServerFontLayout& );
bool DrawServerAAForcedString( const ServerFontLayout& );
void DrawCairoAAFontString( const ServerFontLayout& );
-
+
void freeResources();
public:
X11SalGraphics();
- virtual ~X11SalGraphics();
+ virtual ~X11SalGraphics();
void Init( SalFrame *pFrame, Drawable aDrawable, int nScreen );
void Init( X11SalVirtualDevice *pVirtualDevice, SalColormap* pColormap = NULL, bool bDeleteColormap = false );
@@ -237,35 +230,37 @@ public:
int GetScreenNumber() const { return m_nScreen; }
// overload all pure virtual methods
- virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual sal_uInt16 GetBitCount() const;
- virtual long GetGraphicsWidth() const;
- virtual long GetGraphicsHeight() const;
-
- virtual void ResetClipRegion();
- virtual bool setClipRegion( const Region& );
-
- virtual void SetLineColor();
- virtual void SetLineColor( SalColor nSalColor );
- virtual void SetFillColor();
-
- virtual void SetFillColor( SalColor nSalColor );
-
- virtual void SetXORMode( bool bSet, bool );
-
- virtual void SetROPLineColor( SalROPColor nROPColor );
- virtual void SetROPFillColor( SalROPColor nROPColor );
-
- virtual void SetTextColor( SalColor nSalColor );
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- 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 sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
+ virtual USHORT GetBitCount();
+ 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 void SetLineColor();
+ virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetFillColor();
+
+ virtual void SetFillColor( SalColor nSalColor );
+
+ virtual void SetXORMode( bool bSet, bool );
+
+ virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
+ virtual ImplFontCharMap* GetImplFontCharMap() 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,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -274,80 +269,80 @@ public:
FontSubsetInfo& rInfo
);
virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded );
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- 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 GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
- 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 );
- 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,
+ 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 );
+ 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 );
+ 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 bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
+ virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
+ virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
+ virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
#if 1 // TODO: remove these obselete methods
- virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints,
+ virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( ULONG nPoints,
const SalPoint* pPtAry,
- const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
+ const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry );
+ const BYTE* const* pFlgAry );
#endif
- virtual void copyArea( long nDestX,
+ virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- sal_uInt16 nFlags );
- virtual void copyBits( const SalTwoRect* pPosAry,
+ USHORT nFlags );
+ virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rMaskBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- 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( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ 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 sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
- virtual bool drawAlphaBitmap( const SalTwoRect&,
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
- virtual bool drawAlphaRect( long nX, long nY, long nWidth,
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
virtual SystemGraphicsData GetGraphicsData() const;
@@ -391,9 +386,20 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const
// -=-= Shortcuts =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#ifdef DBG_UTIL
-#define stderr0( s ) fprintf( stderr, s )
+#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 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 a571303333b3..1d7419993a25 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -39,26 +39,26 @@
class VCL_DLLPUBLIC SalYieldMutex : public vcl::SolarMutexObject
{
protected:
- sal_uIntPtr mnCount;
- oslThreadIdentifier mnThreadId;
+ ULONG mnCount;
+ oslThreadIdentifier mnThreadId;
public:
SalYieldMutex();
- virtual void acquire();
- virtual void release();
- virtual sal_Bool tryToAcquire();
+ virtual void acquire();
+ virtual void release();
+ virtual sal_Bool tryToAcquire();
- sal_uIntPtr GetAcquireCount() const { return mnCount; }
- oslThreadIdentifier GetThreadId() const { return mnThreadId; }
+ ULONG GetAcquireCount() const { return mnCount; }
+ oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
// -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class VCL_DLLPUBLIC X11SalInstance : public SalInstance
{
protected:
- SalYieldMutex* mpSalYieldMutex;
- bool mbPrinterInit;
+ SalYieldMutex* mpSalYieldMutex;
+ bool mbPrinterInit;
public:
X11SalInstance( SalYieldMutex* pMutex )
@@ -67,44 +67,47 @@ public:
{}
virtual ~X11SalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
- virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
- virtual void DestroyObject( SalObject* pObject );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual void DestroyObject( SalObject* pObject );
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+ USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
virtual String GetDefaultPrinter();
- virtual SalTimer* CreateSalTimer();
- virtual SalI18NImeStatus* CreateI18NImeStatus();
- virtual SalSystem* CreateSalSystem();
- virtual SalBitmap* CreateSalBitmap();
- virtual SalSession* CreateSalSession();
+ virtual SalTimer* CreateSalTimer();
+ virtual SalI18NImeStatus* CreateI18NImeStatus();
+ virtual SalSystem* CreateSalSystem();
+ virtual SalBitmap* CreateSalBitmap();
+ virtual SalSession* CreateSalSession();
virtual osl::SolarMutex* GetYieldMutex();
- virtual sal_uIntPtr ReleaseYieldMutex();
- virtual void AcquireYieldMutex( sal_uIntPtr nCount );
- virtual bool CheckYieldMutex();
+ virtual ULONG ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( ULONG nCount );
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( sal_uInt16 nType );
+ 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 void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
// dtrans implementation
@@ -114,9 +117,6 @@ public:
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
- virtual void updatePrinterUpdate();
- virtual void jobStartedPrinterUpdate();
- virtual void jobEndedPrinterUpdate();
bool isPrinterInit() const
{
diff --git a/vcl/unx/inc/salmenu.h b/vcl/unx/inc/salmenu.h
index e7b5effed653..d761cc1cb929 100644
--- a/vcl/unx/inc/salmenu.h
+++ b/vcl/unx/inc/salmenu.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h
index 577a3675fa3d..ecfea5eee3d1 100644
--- a/vcl/unx/inc/salobj.h
+++ b/vcl/unx/inc/salobj.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,26 +42,26 @@ public:
SalClipRegion();
~SalClipRegion();
- void BeginSetClipRegion( sal_uIntPtr nRects );
- void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ void BeginSetClipRegion( ULONG nRects );
+ void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
- XRectangle *EndSetClipRegion() {
- return ClipRectangleList; }
- void ResetClipRegion() {
- numClipRectangles = 0; }
- sal_uInt16 GetClipRegionType() {
- return nClipRegionType; }
- void SetClipRegionType( sal_uInt16 nType ) {
- nClipRegionType = nType; }
- int GetRectangleCount() {
- return numClipRectangles; }
+ XRectangle *EndSetClipRegion() {
+ return ClipRectangleList; }
+ void ResetClipRegion() {
+ numClipRectangles = 0; }
+ USHORT GetClipRegionType() {
+ return nClipRegionType; }
+ void SetClipRegionType( USHORT nType ) {
+ nClipRegionType = nType; }
+ int GetRectangleCount() {
+ return numClipRectangles; }
private:
XRectangle* ClipRectangleList;
int numClipRectangles;
int maxClipRectangles;
- sal_uInt16 nClipRegionType;
+ USHORT nClipRegionType;
};
@@ -70,36 +70,35 @@ class X11SalObject : public SalObject
public:
SystemChildData maSystemChildData;
SalFrame* mpParent;
- XLIB_Window maPrimary;
- XLIB_Window maSecondary;
+ XLIB_Window maPrimary;
+ XLIB_Window maSecondary;
Colormap maColormap;
- SalClipRegion maClipRegion;
- sal_Bool mbVisible;
+ SalClipRegion maClipRegion;
+ BOOL mbVisible;
static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent );
- static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
+ static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
X11SalObject();
virtual ~X11SalObject();
// overload all pure virtual methods
- virtual void ResetClipRegion();
- 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( 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 );
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( 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 GrabFocus();
+
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
+
+ virtual const SystemEnvData* GetSystemData() const;
+
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index bf71205586fa..674053477ee2 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,48 +36,47 @@
class PspGraphics;
-class VCL_DLLPUBLIC PspSalInfoPrinter : public SalInfoPrinter
+class PspSalInfoPrinter : public SalInfoPrinter
{
public:
- PspGraphics* m_pGraphics;
- psp::JobData m_aJobData;
- psp::PrinterGfx m_aPrinterGfx;
+ PspGraphics* m_pGraphics;
+ psp::JobData m_aJobData;
+ psp::PrinterGfx m_aPrinterGfx;
PspSalInfoPrinter();
virtual ~PspSalInfoPrinter();
// overload all pure virtual methods
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- 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,
+ 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 void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- 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 );
+ virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
+ virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
-class VCL_DLLPUBLIC PspSalPrinter : public SalPrinter
+class PspSalPrinter : public SalPrinter
{
public:
- String m_aFileName;
- String m_aTmpFile;
- String m_aFaxNr;
- 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;
- sal_uIntPtr m_nCopies;
+ String m_aFileName;
+ String m_aTmpFile;
+ String m_aFaxNr;
+ bool m_bFax:1;
+ bool m_bPdf:1;
+ bool m_bSwallowFaxNo:1;
+ PspGraphics* m_pGraphics;
+ psp::PrinterJob m_aPrintJob;
+ psp::JobData m_aJobData;
+ psp::PrinterGfx m_aPrinterGfx;
+ ULONG m_nCopies;
bool m_bCollate;
SalInfoPrinter* m_pInfoPrinter;
@@ -85,24 +84,37 @@ public:
virtual ~PspSalPrinter();
// overload all pure virtual methods
- virtual sal_Bool StartJob( const XubString* pFileName,
+ using SalPrinter::StartJob;
+ virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- sal_uIntPtr nCopies,
+ ULONG nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- 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();
+ virtual BOOL EndJob();
+ virtual BOOL AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
+ virtual BOOL EndPage();
+ virtual ULONG GetErrorCode();
+};
+
+class Timer;
+
+namespace vcl_sal {
+class VCL_DLLPUBLIC PrinterUpdate
+{
+ static Timer* pPrinterUpdateTimer;
+ static int nActiveJobs;
+
+ static void doUpdate();
+ DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* );
+public:
+ static void update();
+ static void jobStarted() { nActiveJobs++; }
+ static void jobEnded();
};
+}
#endif // _SV_SALPRN_H
diff --git a/vcl/unx/inc/salstd.hxx b/vcl/unx/inc/salstd.hxx
index 07056a91bdec..afe2b875036a 100644
--- a/vcl/unx/inc/salstd.hxx
+++ b/vcl/unx/inc/salstd.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,41 +37,41 @@
// -=-= X-Lib forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#ifndef _SVUNX_H
-typedef unsigned long Pixel;
-typedef unsigned long XID;
-typedef unsigned long XLIB_Time;
-typedef unsigned long XtIntervalId;
+typedef unsigned long Pixel;
+typedef unsigned long XID;
+typedef unsigned long XLIB_Time;
+typedef unsigned long XtIntervalId;
-typedef XID Colormap;
-typedef XID Drawable;
-typedef XID Pixmap;
-typedef XID XLIB_Cursor;
-typedef XID XLIB_Font;
-typedef XID XLIB_Window;
+typedef XID Colormap;
+typedef XID Drawable;
+typedef XID Pixmap;
+typedef XID XLIB_Cursor;
+typedef XID XLIB_Font;
+typedef XID XLIB_Window;
-typedef struct _XDisplay Display;
-typedef struct _XGC *GC;
-typedef struct _XImage XImage;
-typedef struct _XRegion *XLIB_Region;
+typedef struct _XDisplay Display;
+typedef struct _XGC *GC;
+typedef struct _XImage XImage;
+typedef struct _XRegion *XLIB_Region;
-typedef union _XEvent XEvent;
+typedef union _XEvent XEvent;
-typedef struct _XConfigureEvent XConfigureEvent;
-typedef struct _XReparentEvent XReparentEvent;
-typedef struct _XClientMessageEvent XClientMessageEvent;
-typedef struct _XErrorEvent XErrorEvent;
+typedef struct _XConfigureEvent XConfigureEvent;
+typedef struct _XReparentEvent XReparentEvent;
+typedef struct _XClientMessageEvent XClientMessageEvent;
+typedef struct _XErrorEvent XErrorEvent;
-struct Screen;
-struct Visual;
-struct XColormapEvent;
-struct XFocusChangeEvent;
-struct XFontStruct;
-struct XKeyEvent;
-struct XPropertyEvent;
-struct XTextItem;
-struct XWindowChanges;
+struct Screen;
+struct Visual;
+struct XColormapEvent;
+struct XFocusChangeEvent;
+struct XFontStruct;
+struct XKeyEvent;
+struct XPropertyEvent;
+struct XTextItem;
+struct XWindowChanges;
-#define None 0L
+#define None 0L
#endif
#endif
diff --git a/vcl/unx/inc/saltimer.h b/vcl/unx/inc/saltimer.h
index 9820ba32d40c..e60ffb3a1353 100644
--- a/vcl/unx/inc/saltimer.h
+++ b/vcl/unx/inc/saltimer.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,8 +38,8 @@ public:
virtual ~X11SalTimer();
// overload all pure virtual methods
- void Start( sal_uIntPtr nMS );
- void Stop();
+ void Start( ULONG nMS );
+ void Stop();
};
#endif
diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h
index 1c331d06b9e8..5946492d6cc6 100644
--- a/vcl/unx/inc/salunx.h
+++ b/vcl/unx/inc/salunx.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,8 +30,8 @@
#define _SALUNX_H
// -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#if defined LINUX || defined FREEBSD || \
- defined NETBSD || defined OPENBSD || defined DRAGONFLY
+#if defined SCO || defined LINUX || defined HPUX || defined FREEBSD || \
+ defined NETBSD || defined OPENBSD
#include <sys/time.h>
#elif defined AIX
#include <time.h>
@@ -42,7 +42,7 @@
#include <salstd.hxx>
// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#define capacityof(a) (sizeof(a)/sizeof(*a))
+#define capacityof(a) (sizeof(a)/sizeof(*a))
// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
inline long Divide( long nDividend, long nDivisor )
@@ -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 sal_False;
+ return 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, sal_uIntPtr t2 )
+inline timeval &operator += ( timeval &t1, ULONG 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, sal_uIntPtr t2 )
+inline timeval operator + ( const timeval &t1, ULONG t2 )
{
timeval t0 = t1;
return t0 += t2;
diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h
index 9add5c261bbd..81f1e8035b1b 100644
--- a/vcl/unx/inc/salvd.h
+++ b/vcl/unx/inc/salvd.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,46 +40,46 @@ class X11SalGraphics;
// -=-= SalVirDevData -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class X11SalVirtualDevice : public SalVirtualDevice
{
- SalDisplay *pDisplay_;
- X11SalGraphics *pGraphics_;
-
-
- Pixmap hDrawable_;
+ SalDisplay *pDisplay_;
+ X11SalGraphics *pGraphics_;
+
+
+ Pixmap hDrawable_;
int m_nScreen;
-
- int nDX_;
- int nDY_;
- sal_uInt16 nDepth_;
- sal_Bool bGraphics_; // is Graphics used
- sal_Bool bExternPixmap_;
-
+
+ int nDX_;
+ int nDY_;
+ USHORT nDepth_;
+ BOOL bGraphics_; // is Graphics used
+ BOOL bExternPixmap_;
+
public:
X11SalVirtualDevice();
virtual ~X11SalVirtualDevice();
- sal_Bool Init( SalDisplay *pDisplay,
+ BOOL Init( SalDisplay *pDisplay,
long nDX, long nDY,
- sal_uInt16 nBitCount,
+ USHORT nBitCount,
int nScreen,
Pixmap hDrawable = None,
XRenderPictFormat* pXRenderFormat = NULL );
- inline void InitGraphics( X11SalVirtualDevice *pVD );
-
- inline Display *GetXDisplay() const;
- inline SalDisplay *GetDisplay() const;
- inline sal_Bool IsDisplay() const;
- inline Pixmap GetDrawable() const { return hDrawable_; }
- inline sal_uInt16 GetDepth() const { return nDepth_; }
- int GetWidth() const { return nDX_; }
- int GetHeight() const { return nDY_; }
+ inline void InitGraphics( X11SalVirtualDevice *pVD );
+
+ inline Display *GetXDisplay() const;
+ inline SalDisplay *GetDisplay() const;
+ inline BOOL IsDisplay() const;
+ inline Pixmap GetDrawable() const { return hDrawable_; }
+ inline USHORT GetDepth() const { return nDepth_; }
+ int GetWidth() const { return nDX_; }
+ int GetHeight() const { return nDY_; }
int GetScreenNumber() const { return m_nScreen; }
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
// Set new size, without saving the old contents
- virtual sal_Bool SetSize( long nNewDX, long nNewDY );
- virtual void GetSize( long& rWidth, long& rHeight );
+ virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual void GetSize( long& rWidth, long& rHeight );
};
#ifdef _SV_SALDISP_HXX
@@ -93,7 +93,7 @@ inline Display *X11SalVirtualDevice::GetXDisplay() const
inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
{ return pDisplay_; }
-inline sal_Bool X11SalVirtualDevice::IsDisplay() const
+inline BOOL X11SalVirtualDevice::IsDisplay() const
{ return pDisplay_->IsDisplay(); }
#endif
diff --git a/vcl/unx/inc/sm.hxx b/vcl/unx/inc/sm.hxx
index b13d25cc5cc8..31852d7a8923 100644
--- a/vcl/unx/inc/sm.hxx
+++ b/vcl/unx/inc/sm.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,23 +35,23 @@
class SessionManagerClient
{
- static SmcConn aSmcConnection;
- static ByteString aClientID;
- static bool bDocSaveDone;
+ static SmcConn aSmcConnection;
+ static ByteString aClientID;
+ static bool bDocSaveDone;
- static void SaveYourselfProc( SmcConn connection,
+ static void SaveYourselfProc( SmcConn connection,
SmPointer client_data,
int save_type,
Bool shutdown,
int interact_style,
Bool fast );
- static void DieProc( SmcConn connection,
+ static void DieProc( SmcConn connection,
SmPointer client_data );
- static void SaveCompleteProc( SmcConn connection,
+ static void SaveCompleteProc( SmcConn connection,
SmPointer client_data );
- static void ShutdownCanceledProc( SmcConn connection,
+ static void ShutdownCanceledProc( SmcConn connection,
SmPointer client_data );
- static void InteractProc( SmcConn connection,
+ static void InteractProc( SmcConn connection,
SmPointer clientData );
static const ByteString& getPreviousSessionID();
@@ -69,7 +69,7 @@ public:
static void saveDone();
static void interactionDone( bool bCancelShutdown );
- static rtl::OUString getExecName();
+ static String getExecName();
static VCL_DLLPUBLIC const ByteString& getSessionID();
};
@@ -80,7 +80,7 @@ class IceSalSession : public SalSession
public:
IceSalSession();
virtual ~IceSalSession();
-
+
virtual void queryInteraction();
virtual void interactionDone();
virtual void saveDone();
diff --git a/vcl/unx/inc/soicon.hxx b/vcl/unx/inc/soicon.hxx
index cb3302cb777b..9d08053d48d8 100644
--- a/vcl/unx/inc/soicon.hxx
+++ b/vcl/unx/inc/soicon.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,8 +32,8 @@ class SalDisplay;
class SalBitmap;
class Bitmap;
-sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
- sal_uInt16 nIcon, sal_uInt16 iconSize,
+BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
+ USHORT nIcon, USHORT iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask );
#endif
diff --git a/vcl/unx/inc/strhelper.hxx b/vcl/unx/inc/strhelper.hxx
index 78db60567133..aeb5828a5cf6 100644
--- a/vcl/unx/inc/strhelper.hxx
+++ b/vcl/unx/inc/strhelper.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/svsys.h b/vcl/unx/inc/svsys.h
index 149acc4cc644..5a3dd7013b21 100644
--- a/vcl/unx/inc/svsys.h
+++ b/vcl/unx/inc/svsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/svunx.h b/vcl/unx/inc/svunx.h
index e3ea4cc3e790..1a3ae2bc4b0c 100644
--- a/vcl/unx/inc/svunx.h
+++ b/vcl/unx/inc/svunx.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx
index c6ef6d98bca8..997023c1e468 100644
--- a/vcl/unx/inc/wmadaptor.hxx
+++ b/vcl/unx/inc/wmadaptor.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -99,7 +99,7 @@ public:
WIN_ICONS,
WIN_WORKSPACE_NAMES,
WIN_CLIENT_LIST,
-
+
// atoms for general WM hints
WM_STATE,
MOTIF_WM_HINTS,
@@ -128,13 +128,13 @@ public:
/*
* flags for frame decoration
*/
- static const int decoration_Title = 0x00000001;
- static const int decoration_Border = 0x00000002;
- static const int decoration_Resize = 0x00000004;
- static const int decoration_MinimizeBtn = 0x00000008;
- static const int decoration_MaximizeBtn = 0x00000010;
- static const int decoration_CloseBtn = 0x00000020;
- static const int decoration_All = 0x10000000;
+ static const int decoration_Title = 0x00000001;
+ static const int decoration_Border = 0x00000002;
+ static const int decoration_Resize = 0x00000004;
+ static const int decoration_MinimizeBtn = 0x00000008;
+ static const int decoration_MaximizeBtn = 0x00000010;
+ static const int decoration_CloseBtn = 0x00000020;
+ static const int decoration_All = 0x10000000;
/*
* window type
@@ -151,21 +151,19 @@ public:
};
protected:
- SalDisplay* m_pSalDisplay; // Display to use
- Display* m_pDisplay; // X Display of SalDisplay
- String m_aWMName;
- Atom m_aWMAtoms[ NetAtomMax];
- int m_nDesktops;
- bool m_bEqualWorkAreas;
+ SalDisplay* m_pSalDisplay; // Display to use
+ Display* m_pDisplay; // X Display of SalDisplay
+ String m_aWMName;
+ Atom m_aWMAtoms[ NetAtomMax];
+ int m_nDesktops;
+ bool m_bEqualWorkAreas;
::std::vector< Rectangle >
m_aWMWorkAreas;
- bool m_bTransientBehaviour;
- bool m_bEnableAlwaysOnTopWorks;
+ bool m_bTransientBehaviour;
+ bool m_bEnableAlwaysOnTopWorks;
bool m_bLegacyPartialFullscreen;
- int m_nWinGravity;
- int m_nInitWinGravity;
- bool m_bWMshouldSwitchWorkspace;
- bool m_bWMshouldSwitchWorkspaceInit;
+ int m_nWinGravity;
+ int m_nInitWinGravity;
WMAdaptor( SalDisplay * )
;
@@ -178,7 +176,6 @@ protected:
*/
virtual bool isValid() const;
- bool getWMshouldSwitchWorkspace() const;
public:
virtual ~WMAdaptor();
@@ -213,18 +210,17 @@ public:
*/
const Rectangle& getWorkArea( int n ) const
{ return m_aWMWorkAreas[n]; }
-
+
/*
* 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, bool bConsiderWM = true ) const;
-
+ void switchToWorkArea( int nWorkArea ) const;
+
/*
* sets window title
*/
virtual void setWMName( X11SalFrame* pFrame, const String& rWMName ) const;
-
+
/*
* set NET_WM_PID
*/
@@ -234,7 +230,7 @@ public:
* set WM_CLIENT_MACHINE
*/
virtual void setClientMachine( X11SalFrame* pFrame ) const;
-
+
virtual void answerPing( X11SalFrame*, XClientMessageEvent* ) const;
/*
@@ -270,7 +266,7 @@ public:
* set _NET_WM_USER_TIME property, if NetWM
*/
virtual void setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const;
-
+
/*
* tells whether fullscreen mode is supported by WM
*/
@@ -306,12 +302,12 @@ public:
* tells whether enableAlwaysOnTop actually works with this WM
*/
bool isAlwaysOnTopOK() const { return m_bEnableAlwaysOnTopWorks; }
-
+
/*
* handle WM messages (especially WM state changes)
*/
virtual int handlePropertyNotify( X11SalFrame* pFrame, XPropertyEvent* pEvent ) const;
-
+
/*
* called by SalFrame::Show: time to update state properties
*/
@@ -345,7 +341,7 @@ public:
* changes the transient hint of a window to reference frame
* if reference frame is NULL the root window is used instead
*/
- void changeReferenceFrame( X11SalFrame* pFrame, X11SalFrame* pReferenceFrame ) const;
+ void changeReferenceFrame( X11SalFrame* pFrame, X11SalFrame* pReferenceFrame ) const;
};
} // namespace
diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx
new file mode 100644
index 000000000000..9edf50ef3f8b
--- /dev/null
+++ b/vcl/unx/inc/xfont.hxx
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 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 b87e7a0aea5b..363036520e19 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALDATA_CXX
-#include <kde_headers.h>
+#include <shell/kde_headers.h>
#include <unistd.h>
#include <fcntl.h>
@@ -63,7 +63,7 @@ class VCLKDEApplication : public KApplication
{
public:
VCLKDEApplication() : KApplication() {}
-
+
virtual void commitData(QSessionManager &sm);
};
@@ -96,7 +96,7 @@ SalKDEDisplay::~SalKDEDisplay()
KDEXLib::~KDEXLib()
{
- // on 64 bit linux using libXRandr.so.2 will crash in
+ // #158056# on 64 bit linux using libXRandr.so.2 will crash in
// XCloseDisplay when freeing extension data
// no known work around, therefor currently leak. Hopefully
// this does not make problems since we're shutting down anyway
@@ -135,7 +135,7 @@ void KDEXLib::Init()
"http://artax.karlin.mff.cuni.cz/~kendy" );
m_nFakeCmdLineArgs = 1;
- sal_uInt16 nIdx;
+ USHORT nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
rtl::OUString aParam, aBin;
@@ -143,7 +143,7 @@ void KDEXLib::Init()
for ( nIdx = 0; nIdx < nParams; ++nIdx )
{
osl_getCommandArg( nIdx, &aParam.pData );
- if ( !m_pFreeCmdLineArgs && aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) && nIdx + 1 < nParams )
+ if ( !m_pFreeCmdLineArgs && aParam.equalsAscii( "-display" ) && nIdx + 1 < nParams )
{
osl_getCommandArg( nIdx + 1, &aParam.pData );
aDisplay = rtl::OUStringToOString( aParam, osl_getThreadTextEncoding() );
@@ -187,7 +187,7 @@ void KDEXLib::Init()
SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
XSync( pDisp, False );
- pKbdExtension->UseExtension( ! HasXErrorOccurred() );
+ pKbdExtension->UseExtension( ! HasXErrorOccured() );
PopXErrorLevel();
pSalDisplay->SetKbdExtension( pKbdExtension );
@@ -253,7 +253,7 @@ extern "C" {
#endif
return NULL;
}
-
+
KDESalInstance* pInstance = new KDESalInstance( new SalYieldMutex() );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "created KDESalInstance 0x%p\n", pInstance );
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index bf080084ed5b..c15e61780922 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALNATIVEWIDGETS_KDE_CXX
-#include <kde_headers.h>
+#include <shell/kde_headers.h>
#include <salunx.h>
#include <saldata.hxx>
@@ -49,7 +49,7 @@
using namespace ::rtl;
/** Cached native widgets.
-
+
A class which caches and paints the native widgets.
*/
class WidgetPainter
@@ -191,7 +191,7 @@ class WidgetPainter
/** Identifiers of popup menu items.
*/
int m_nPopupMenuEnabledItem, m_nPopupMenuDisabledItem;
-
+
/** cached progress bar
*/
QProgressBar *m_pProgressBar;
@@ -239,7 +239,7 @@ class WidgetPainter
@param gc
The graphics context.
*/
- sal_Bool drawStyledWidget( QWidget *pWidget,
+ 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, sal_Bool bDefault );
+ QPushButton *pushButton( const Rectangle& rControlRegion, BOOL bDefault );
/** 'Get' method for radio button.
@@ -273,7 +273,7 @@ class WidgetPainter
@see pushButton(), m_pEditableComboBox
*/
- QComboBox *comboBox( const Rectangle& rControlRegion, sal_Bool bEditable );
+ QComboBox *comboBox( const Rectangle& rControlRegion, BOOL bEditable );
/** 'Get' method for line edit box.
@@ -310,13 +310,13 @@ class WidgetPainter
@see pushButton()
*/
QScrollBar *scrollBar( const Rectangle& rControlRegion,
- sal_Bool bHorizontal, const ImplControlValue& aValue );
+ BOOL bHorizontal, const ImplControlValue& aValue );
/** 'Get' method for tool bar.
@see pushButton()
*/
- QToolBar *toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal );
+ QToolBar *toolBar( const Rectangle& rControlRegion, BOOL bHorizontal );
/** 'Get' method for tool button.
@@ -335,9 +335,9 @@ class WidgetPainter
@see pushButton()
*/
QPopupMenu *popupMenu( const Rectangle& rControlRegion );
-
+
/** 'Get' method for progress bar
-
+
@see pushButton()
*/
QProgressBar *progressBar( const Rectangle& rControlRegion );
@@ -394,11 +394,7 @@ WidgetPainter::WidgetPainter( void )
m_pToolBarVert( NULL ),
m_pToolButton( NULL ),
m_pMenuBar( NULL ),
- m_nMenuBarEnabledItem( 0 ),
- m_nMenuBarDisabledItem( 0 ),
m_pPopupMenu( NULL ),
- m_nPopupMenuEnabledItem( 0 ),
- m_nPopupMenuDisabledItem( 0 ),
m_pProgressBar( NULL )
{
}
@@ -431,13 +427,13 @@ WidgetPainter::~WidgetPainter( void )
delete m_pProgressBar, m_pProgressBar = NULL;
}
-sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
+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 sal_False;
+ return FALSE;
// Normalize the widget
QPoint qWidgetPos( pWidget->pos() );
@@ -453,13 +449,13 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
// Use the background of the widget
qPixmap.fill( pWidget, QPoint(0, 0) );
-
+
// Convert the flags
QStyle::SFlags nStyle = vclStateValue2SFlags( nState, aValue );
-
+
// Store the widget class
const char *pClassName = pWidget->className();
-
+
// Draw the widget to the pixmap
if ( strcmp( "QPushButton", pClassName ) == 0 )
{
@@ -472,7 +468,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
pPushButton->setOn ( nStyle & QStyle::Style_On );
pPushButton->setEnabled( nStyle & QStyle::Style_Enabled );
}
-
+
kapp->style().drawControl( QStyle::CE_PushButton,
&qPainter, pWidget, qRect,
pWidget->colorGroup(), nStyle );
@@ -505,15 +501,15 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
kapp->style().drawComplexControl( QStyle::CC_ComboBox,
&qPainter, pWidget, qRect,
pWidget->colorGroup(), nStyle );
-
+
// Editable combo box uses the background of the associated edit box
QComboBox *pComboBox = static_cast<QComboBox *>( pWidget->qt_cast( "QComboBox" ) );
if ( pComboBox && pComboBox->editable() && pComboBox->lineEdit() )
{
QColorGroup::ColorRole eColorRole = ( pComboBox->isEnabled() )?
QColorGroup::Base: QColorGroup::Background;
- qPainter.fillRect(
- kapp->style().querySubControlMetrics( QStyle::CC_ComboBox,
+ qPainter.fillRect(
+ kapp->style().querySubControlMetrics( QStyle::CC_ComboBox,
pComboBox, QStyle::SC_ComboBoxEditField ),
pComboBox->lineEdit()->colorGroup().brush( eColorRole ) );
}
@@ -527,7 +523,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
else if ( strcmp( "QSpinWidget", pClassName ) == 0 )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue *> ( &aValue );
-
+
// Is any of the buttons pressed?
QStyle::SCFlags eActive = QStyle::SC_None;
if ( pValue )
@@ -560,8 +556,8 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
{
QColorGroup::ColorRole eColorRole = ( pSpinWidget->isEnabled() )?
QColorGroup::Base: QColorGroup::Background;
- qPainter.fillRect(
- kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget,
+ qPainter.fillRect(
+ kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget,
pSpinWidget, QStyle::SC_SpinWidgetEditField ),
pSpinWidget->editWidget()->colorGroup().brush( eColorRole ) );
}
@@ -569,7 +565,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
// Adjust the frame (needed for Motif Plus style)
QRect qFrameRect = kapp->style().querySubControlMetrics( QStyle::CC_SpinWidget,
pWidget, QStyle::SC_SpinWidgetFrame );
-
+
kapp->style().drawComplexControl( QStyle::CC_SpinWidget,
&qPainter, pWidget, qFrameRect,
pWidget->colorGroup(), nStyle,
@@ -578,7 +574,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
else if ( strcmp( "QTabBar", pClassName ) == 0 )
{
const TabitemValue *pValue = static_cast<const TabitemValue *> ( &aValue );
-
+
QTab *pTab = NULL;
if ( pValue )
{
@@ -592,10 +588,10 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
pTab = m_pTabMiddle;
}
if ( !pTab )
- return sal_False;
-
+ return FALSE;
+
pTab->setRect( qRect );
-
+
kapp->style().drawControl( QStyle::CE_TabBarTab,
&qPainter, pWidget, qRect,
pWidget->colorGroup(), nStyle,
@@ -665,7 +661,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
else
pWidget->setEnabled( false );
}
-
+
// Is it a horizontal scroll bar?
QScrollBar *pScrollBar = static_cast<QScrollBar *> ( pWidget->qt_cast( "QScrollBar" ) );
QStyle::StyleFlags eHoriz = QStyle::Style_Default;
@@ -693,11 +689,11 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
kapp->style().drawPrimitive( QStyle::PE_PanelDockWindow,
&qPainter, qRect, pWidget->colorGroup(), nStyle );
-
+
if ( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
{
const ToolbarValue *pValue = static_cast< const ToolbarValue * >( &aValue );
-
+
QRect qThumbRect = region2QRect( pValue->maGripRect );
qThumbRect.moveBy( -qWidgetPos.x(), -qWidgetPos.y() );
if ( bIsHorizontal )
@@ -780,7 +776,7 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
pWidget->colorGroup(), nStyle );
}
else
- return sal_False;
+ return FALSE;
// Bitblt it to the screen
X11SalGraphics::CopyScreenArea( dpy,
@@ -793,11 +789,11 @@ sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
// Restore widget's position
pWidget->move( qWidgetPos );
- return sal_True;
+ return TRUE;
}
QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
- sal_Bool bDefault )
+ BOOL bDefault )
{
if ( !m_pPushButton )
m_pPushButton = new QPushButton( NULL, "push_button" );
@@ -817,7 +813,7 @@ QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
m_pPushButton->setDefault( true );
QSize qDefSize = kapp->style().sizeFromContents( QStyle::CT_PushButton,
m_pPushButton, qContentsSize );
-
+
int nIndicatorSize = kapp->style().pixelMetric(
QStyle::PM_ButtonDefaultIndicator, m_pPushButton );
if ( qNormalSize.width() == qDefSize.width() )
@@ -825,7 +821,7 @@ QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
if ( qNormalSize.height() == qDefSize.height() )
qRect.addCoords( 0, nIndicatorSize, 0, -nIndicatorSize );
}
-
+
m_pPushButton->move( qRect.topLeft() );
m_pPushButton->resize( qRect.size() );
m_pPushButton->setDefault( bDefault );
@@ -846,19 +842,19 @@ QRadioButton *WidgetPainter::radioButton( const Rectangle& rControlRegion )
if ( strcmp( "KThemeStyle", pStyleName ) == 0 )
{
QRect qOldRect( qRect );
-
+
qRect.setWidth( kapp->style().pixelMetric(
QStyle::PM_ExclusiveIndicatorWidth, m_pRadioButton ) );
qRect.setHeight( kapp->style().pixelMetric(
QStyle::PM_ExclusiveIndicatorHeight, m_pRadioButton ) );
-
+
qRect.moveBy( ( qOldRect.width() - qRect.width() ) / 2,
( qOldRect.height() - qRect.height() ) / 2 );
}
m_pRadioButton->move( qRect.topLeft() );
m_pRadioButton->resize( qRect.size() );
-
+
return m_pRadioButton;
}
@@ -875,12 +871,12 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion )
if ( strcmp( "KThemeStyle", pStyleName ) == 0 )
{
QRect qOldRect( qRect );
-
+
qRect.setWidth( kapp->style().pixelMetric(
QStyle::PM_IndicatorWidth, m_pCheckBox ) );
qRect.setHeight( kapp->style().pixelMetric(
QStyle::PM_IndicatorHeight, m_pCheckBox ) );
-
+
qRect.moveBy( ( qOldRect.width() - qRect.width() ) / 2,
( qOldRect.height() - qRect.height() ) / 2 );
}
@@ -892,7 +888,7 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion )
}
QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion,
- sal_Bool bEditable )
+ BOOL bEditable )
{
QComboBox *pComboBox = NULL;
if ( bEditable )
@@ -909,7 +905,7 @@ QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion,
}
QRect qRect = region2QRect( rControlRegion );
-
+
pComboBox->move( qRect.topLeft() );
pComboBox->resize( qRect.size() );
@@ -922,7 +918,7 @@ QLineEdit *WidgetPainter::lineEdit( const Rectangle& rControlRegion )
m_pLineEdit = new QLineEdit( NULL, "line_edit" );
QRect qRect = region2QRect( rControlRegion );
-
+
m_pLineEdit->move( qRect.topLeft() );
m_pLineEdit->resize( qRect.size() );
@@ -934,13 +930,13 @@ QSpinWidget *WidgetPainter::spinWidget( const Rectangle& rControlRegion )
if ( !m_pSpinWidget )
{
m_pSpinWidget = new QSpinWidget( NULL, "spin_widget" );
-
+
m_pSpinEdit = new QLineEdit( NULL, "line_edit_spin" );
m_pSpinWidget->setEditWidget( m_pSpinEdit );
}
QRect qRect = region2QRect( rControlRegion );
-
+
m_pSpinWidget->move( qRect.topLeft() );
m_pSpinWidget->resize( qRect.size() );
m_pSpinWidget->arrange();
@@ -956,7 +952,7 @@ QTabBar *WidgetPainter::tabBar( const Rectangle& rControlRegion )
m_pTabBarParent = new QWidget( NULL, "tab_bar_parent" );
m_pTabBar = new QTabBar( m_pTabBarParent, "tab_bar" );
-
+
m_pTabLeft = new QTab();
m_pTabMiddle = new QTab();
m_pTabRight = new QTab();
@@ -971,7 +967,7 @@ QTabBar *WidgetPainter::tabBar( const Rectangle& rControlRegion )
m_pTabBar->move( qRect.topLeft() );
m_pTabBar->resize( qRect.size() );
-
+
m_pTabBar->setShape( QTabBar::RoundedAbove );
return m_pTabBar;
@@ -984,10 +980,10 @@ QTabWidget *WidgetPainter::tabWidget( const Rectangle& rControlRegion )
QRect qRect = region2QRect( rControlRegion );
--qRect.rTop();
-
+
m_pTabWidget->move( qRect.topLeft() );
m_pTabWidget->resize( qRect.size() );
-
+
return m_pTabWidget;
}
@@ -997,7 +993,7 @@ QListView *WidgetPainter::listView( const Rectangle& rControlRegion )
m_pListView = new QListView( NULL, "list_view" );
QRect qRect = region2QRect( rControlRegion );
-
+
m_pListView->move( qRect.topLeft() );
m_pListView->resize( qRect.size() );
@@ -1005,7 +1001,7 @@ QListView *WidgetPainter::listView( const Rectangle& rControlRegion )
}
QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
- sal_Bool bHorizontal, const ImplControlValue& aValue )
+ BOOL bHorizontal, const ImplControlValue& aValue )
{
if ( !m_pScrollBar )
{
@@ -1015,7 +1011,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
}
QRect qRect = region2QRect( rControlRegion );
-
+
m_pScrollBar->move( qRect.topLeft() );
m_pScrollBar->resize( qRect.size() );
m_pScrollBar->setOrientation( bHorizontal? Qt::Horizontal: Qt::Vertical );
@@ -1032,7 +1028,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
return m_pScrollBar;
}
-QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal )
+QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, BOOL bHorizontal )
{
if ( !m_pMainWindow )
m_pMainWindow = new QMainWindow( NULL, "main_window" );
@@ -1124,9 +1120,9 @@ QProgressBar *WidgetPainter::progressBar( const Rectangle& rControlRegion )
{
if ( !m_pProgressBar )
m_pProgressBar = new QProgressBar( NULL, "progress_bar" );
-
+
QRect qRect = region2QRect( rControlRegion );
-
+
m_pProgressBar->move( qRect.topLeft() );
m_pProgressBar->resize( qRect.size() );
@@ -1173,19 +1169,19 @@ class KDESalGraphics : public X11SalGraphics
public:
KDESalGraphics() {}
virtual ~KDESalGraphics() {}
- virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart,
+ virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& aPos,
- sal_Bool& rIsInside );
- virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart,
+ BOOL& rIsInside );
+ virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption,
@@ -1196,14 +1192,14 @@ class KDESalGraphics : public X11SalGraphics
@param nType
Type of the widget.
-
+
@param nPart
Specification of the widget's part if it consists of more than one.
-
- @return sal_True if the platform supports native drawing of the widget nType
+
+ @return TRUE if the platform supports native drawing of the widget nType
defined by nPart.
*/
-sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
return
( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) ||
@@ -1235,22 +1231,22 @@ sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
/** Test whether the position is in the native widget.
- If the return value is sal_True, bIsInside contains information whether
+ If the return value is TRUE, bIsInside contains information whether
aPos was or was not inside the native widget specified by the
nType/nPart combination.
*/
-sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
+BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& rPos,
- sal_Bool& rIsInside )
+ BOOL& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
// make position relative to rControlRegion
Point aPos = rPos - rControlRegion.TopLeft();
- rIsInside = sal_False;
-
- sal_Bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
+ rIsInside = FALSE;
+ BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
+
QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
bHorizontal, ImplControlValue() );
QRect qRectSubLine = kapp->style().querySubControlMetrics(
@@ -1259,10 +1255,10 @@ sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nP
QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddLine );
// There are 2 buttons on the right/bottom side of the scrollbar
- sal_Bool bTwoSubButtons = sal_False;
+ BOOL bTwoSubButtons = FALSE;
// It is a Platinum style scroll bar
- sal_Bool bPlatinumStyle = sal_False;
+ BOOL bPlatinumStyle = FALSE;
// Workaround for Platinum and 3 button style scroll bars.
// It makes the right/down button bigger.
@@ -1272,9 +1268,9 @@ sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nP
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).right() + 1 );
if ( qRectAddLine.width() > qRectSubLine.width() )
- bTwoSubButtons = sal_True;
+ bTwoSubButtons = TRUE;
if ( qRectSubLine.left() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).left() )
- bPlatinumStyle = sal_True;
+ bPlatinumStyle = TRUE;
}
else
{
@@ -1282,81 +1278,81 @@ sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nP
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
if ( qRectAddLine.height() > qRectSubLine.height() )
- bTwoSubButtons = sal_True;
+ bTwoSubButtons = TRUE;
if ( qRectSubLine.top() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).top() )
- bPlatinumStyle = sal_True;
+ bPlatinumStyle = TRUE;
}
switch ( nPart )
{
case PART_BUTTON_LEFT:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = sal_True;
+ rIsInside = TRUE;
else if ( bTwoSubButtons )
{
qRectAddLine.setWidth( qRectAddLine.width() / 2 );
rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
}
break;
-
+
case PART_BUTTON_UP:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = sal_True;
+ rIsInside = TRUE;
else if ( bTwoSubButtons )
{
qRectAddLine.setHeight( qRectAddLine.height() / 2 );
rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
}
break;
-
+
case PART_BUTTON_RIGHT:
if ( bTwoSubButtons )
qRectAddLine.setLeft( qRectAddLine.left() + qRectAddLine.width() / 2 );
rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
break;
-
+
case PART_BUTTON_DOWN:
if ( bTwoSubButtons )
qRectAddLine.setTop( qRectAddLine.top() + qRectAddLine.height() / 2 );
rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
break;
-
+
// cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA
default:
- return sal_False;
+ return FALSE;
}
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
/** Draw the requested control described by nPart/nState.
-
+
@param rControlRegion
The bounding region of the complete control in VCL frame coordinates.
-
+
@param aValue
An optional value (tristate/numerical/string).
-
+
@param aCaption
A caption or title string (like button text etc.)
*/
-sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
+BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& )
{
- sal_Bool bReturn = sal_False;
+ BOOL bReturn = FALSE;
Display *dpy = GetXDisplay();
XLIB_Window drawable = GetDrawable();
GC gc = SelectPen(); //SelectFont(); // GC with current clipping region set
-
+
if ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
@@ -1381,7 +1377,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart
else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, sal_True ),
+ pWidgetPainter->comboBox( rControlRegion, TRUE ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1395,7 +1391,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart
else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, sal_False ),
+ pWidgetPainter->comboBox( rControlRegion, FALSE ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1475,30 +1471,30 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart
/** Draw text on the widget.
-
+
OPTIONAL. Draws the requested text for the control described by nPart/nState.
Used if text is not drawn by DrawNativeControl().
-
+
@param rControlRegion
The bounding region of the complete control in VCL frame coordinates.
-
+
@param aValue
An optional value (tristate/numerical/string)
-
+
@param aCaption
A caption or title string (like button text etc.)
*/
-sal_Bool KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
+BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
const Rectangle&, ControlState,
const ImplControlValue&,
const OUString& )
{
- return sal_False;
+ return FALSE;
}
/** Check if the bounding regions match.
- If the return value is sal_True, rNativeBoundingRegion
+ If the return value is 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
@@ -1506,23 +1502,23 @@ sal_Bool KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
@param rControlRegion
The bounding region of the control in VCL frame coordinates.
-
+
@param aValue
An optional value (tristate/numerical/string)
-
+
@param aCaption
A caption or title string (like button text etc.)
*/
-sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
+BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue&,
const OUString&,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- sal_Bool bReturn = sal_False;
+ BOOL bReturn = FALSE;
QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion );
QRect qRect;
-
+
QWidget *pWidget = NULL;
switch ( nType )
{
@@ -1541,7 +1537,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
QStyle::PM_ButtonDefaultIndicator, pWidget );
qBoundingRect.addCoords( -nIndicatorSize, -nIndicatorSize,
nIndicatorSize, nIndicatorSize );
- bReturn = sal_True;
+ bReturn = TRUE;
}
break;
}
@@ -1556,7 +1552,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) );
- bReturn = sal_True;
+ bReturn = TRUE;
}
break;
@@ -1569,7 +1565,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) );
- bReturn = sal_True;
+ bReturn = TRUE;
}
break;
@@ -1586,14 +1582,14 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
QStyle::CC_ComboBox, pWidget,
QStyle::SC_ComboBoxEditField ).right() + 1 );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = sal_True;
+ bReturn = TRUE;
break;
case PART_SUB_EDIT:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = sal_True;
+ bReturn = TRUE;
break;
}
break;
@@ -1606,14 +1602,14 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
case PART_BUTTON_UP:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp );
- bReturn = sal_True;
+ bReturn = TRUE;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
case PART_BUTTON_DOWN:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown );
- bReturn = sal_True;
+ bReturn = TRUE;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
@@ -1621,7 +1617,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = sal_True;
+ bReturn = TRUE;
break;
}
break;
@@ -1660,10 +1656,10 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
qRect.setBottom( 0 );
}
}
-
+
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = sal_True;
+ bReturn = TRUE;
break;
case PART_BUTTON_RIGHT:
@@ -1684,7 +1680,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = sal_True;
+ bReturn = TRUE;
break;
}
break;
@@ -1703,7 +1699,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
Size aSize( qRect.width(), qRect.height() );
rNativeContentRegion = Rectangle( aPoint, aSize );
}
-
+
return bReturn;
}
@@ -1711,12 +1707,12 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart
// KDESalFrame implementation
// -----------------------------------------------------------------------
-KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nStyle ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nStyle ) :
X11SalFrame( pParent, nStyle )
{
}
-void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
{
@@ -1755,13 +1751,13 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
{
psp::FastPrintFontInfo aInfo;
QFontInfo qFontInfo( rQFont );
-
+
// set family name
aInfo.m_aFamilyName = String( rQFont.family().utf8(), RTL_TEXTENCODING_UTF8 );
// set italic
aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
-
+
// set weight
int nWeight = qFontInfo.weight();
if ( nWeight <= QFont::Light )
@@ -1774,7 +1770,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_eWeight = psp::weight::Bold;
else
aInfo.m_eWeight = psp::weight::UltraBold;
-
+
// set width
int nStretch = rQFont.stretch();
if ( nStretch <= QFont::UltraCondensed )
@@ -1795,7 +1791,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_eWidth = psp::width::ExtraExpanded;
else
aInfo.m_eWidth = psp::width::UltraExpanded;
-
+
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "font name BEFORE system match: \"%s\"\n", OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
#endif
@@ -1813,7 +1809,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
int nPointHeight = qFontInfo.pointSize();
if ( nPointHeight <= 0 )
nPointHeight = rQFont.pointSize();
-
+
// Create the font
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
if( aInfo.m_eWeight != psp::weight::Unknown )
@@ -1890,7 +1886,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
Color aBack = toColor( qColorGroup.background() );
Color aText = toColor( qColorGroup.text() );
Color aBase = toColor( qColorGroup.base() );
-
+
// Foreground
aStyleSettings.SetRadioCheckTextColor( aFore );
aStyleSettings.SetLabelTextColor( aFore );
@@ -1909,7 +1905,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHelpColor( aBase );
aStyleSettings.SetWindowColor( aBase );
aStyleSettings.SetActiveTabColor( aBase );
-
+
// Buttons
aStyleSettings.SetButtonTextColor( toColor( qColorGroup.buttonText() ) );
aStyleSettings.SetButtonRolloverTextColor( toColor( qColorGroup.buttonText() ) );
@@ -1931,9 +1927,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = aStyleSettings.GetLightColor();
aStyleSettings.
- 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)
+ 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)
) );
}
@@ -1968,13 +1964,13 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
qMainWindow.createGUI( "/dev/null" ); // hack
// Menu
- aStyleSettings.SetSkipDisabledInMenus( sal_True );
+ aStyleSettings.SetSkipDisabledInMenus( TRUE );
KMenuBar *pMenuBar = qMainWindow.menuBar();
if ( pMenuBar )
{
// Color
QColorGroup qMenuCG = pMenuBar->colorGroup();
-
+
// Menu text and background color, theme specific
Color aMenuFore = toColor( qMenuCG.foreground() );
Color aMenuBack = toColor( qMenuCG.background() );
@@ -1986,7 +1982,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
aMenuFore = toColor( qMenuCG.buttonText() );
aMenuBack = toColor( qMenuCG.button() );
}
-
+
aStyleSettings.SetMenuTextColor( aMenuFore );
aStyleSettings.SetMenuBarTextColor( aMenuFore );
aStyleSettings.SetMenuColor( aMenuBack );
@@ -2005,7 +2001,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
}
else
aStyleSettings.SetMenuHighlightTextColor( aMenuFore );
-
+
// set special menubar higlight text color
if ( kapp->style().inherits( "HighContrastStyle" ) )
ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.highlightedText() );
@@ -2027,7 +2023,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Scroll bar size
aStyleSettings.SetScrollBarSize( kapp->style().pixelMetric( QStyle::PM_ScrollBarExtent ) );
-
+
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -2049,7 +2045,7 @@ SalGraphics* KDESalFrame::GetGraphics()
}
}
}
-
+
return NULL;
}
@@ -2089,7 +2085,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder()
// -----------------------------------------------------------------------
SalFrame *
-KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nStyle )
+KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nStyle )
{
return new KDESalFrame( pParent, nStyle );
}
diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index 97654cf41e76..655a759138f4 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@ void KDEData::Init()
void KDEData::initNWF()
{
ImplSVData *pSVData = ImplGetSVData();
-
+
// draw toolbars on separate lines
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
// no borders for menu, theming does that
diff --git a/vcl/unx/kde4/KDEData.hxx b/vcl/unx/kde4/KDEData.hxx
index 31dc7b9dcba7..612ea7566642 100644
--- a/vcl/unx/kde4/KDEData.hxx
+++ b/vcl/unx/kde4/KDEData.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,7 +36,7 @@ class KDEData : public X11SalData
public:
KDEData() {}
virtual ~KDEData();
-
+
virtual void Init();
virtual void initNWF();
virtual void deInitNWF();
diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
index 29292b68f142..252429594ef5 100644
--- a/vcl/unx/kde4/KDESalDisplay.cxx
+++ b/vcl/unx/kde4/KDESalDisplay.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/kde4/KDESalDisplay.hxx b/vcl/unx/kde4/KDESalDisplay.hxx
index 3b7117684942..25a8b9f54870 100644
--- a/vcl/unx/kde4/KDESalDisplay.hxx
+++ b/vcl/unx/kde4/KDESalDisplay.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 69826443a6c2..80adaa973007 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,19 +57,19 @@
#include <stdio.h>
#endif
-KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nState ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
X11SalFrame( pParent, nState )
{
}
-void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
{
KDEXLib* pXLib = static_cast<KDEXLib*>(GetDisplay()->GetXLib());
pXLib->doStartup();
}
-
+
X11SalFrame::Show( bVisible, bNoActivate );
}
@@ -87,8 +87,13 @@ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey )
return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() );
}
-#if 0
-#endif
+/** Helper function to read color from KConfig configuration repository.
+*/
+static Color readColor( KConfigGroup *pGroup, const char *pKey )
+{
+ return toColor( pGroup->readEntry( pKey, QColor(Qt::white) ) );
+}
+
/** Helper function to add information to Font from QFont.
Mostly grabbed from the Gtk+ vclplug (salnativewidgets-gtk.cxx).
@@ -97,13 +102,13 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
{
psp::FastPrintFontInfo aInfo;
QFontInfo qFontInfo( rQFont );
-
+
// set family name
aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 );
// set italic
aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
-
+
// set weight
int nWeight = qFontInfo.weight();
if ( nWeight <= QFont::Light )
@@ -116,7 +121,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_eWeight = psp::weight::Bold;
else
aInfo.m_eWeight = psp::weight::UltraBold;
-
+
// set width
int nStretch = rQFont.stretch();
if ( nStretch <= QFont::UltraCondensed )
@@ -137,7 +142,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
aInfo.m_eWidth = psp::width::ExtraExpanded;
else
aInfo.m_eWidth = psp::width::UltraExpanded;
-
+
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "font name BEFORE system match: \"%s\"\n", OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
#endif
@@ -155,7 +160,7 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
int nPointHeight = qFontInfo.pointSize();
if ( nPointHeight <= 0 )
nPointHeight = rQFont.pointSize();
-
+
// Create the font
Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
if( aInfo.m_eWeight != psp::weight::Unknown )
@@ -175,29 +180,29 @@ static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& r
void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
StyleSettings style( rSettings.GetStyleSettings() );
- bool bSetTitleFont = false;
-
+ BOOL bSetTitleFont = false;
+
// General settings
QPalette pal = kapp->palette();
-
+
style.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window)));
style.SetDeactiveColor(toColor(pal.color(QPalette::Inactive, QPalette::Window)));
-
+
style.SetActiveColor2(toColor(pal.color(QPalette::Active, QPalette::Window)));
style.SetDeactiveColor2(toColor(pal.color(QPalette::Inactive, QPalette::Window)));
-
+
style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText)));
style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText)));
-
+
// WM settings
KConfig *pConfig = KGlobal::config().data();
if ( pConfig )
{
KConfigGroup aGroup = pConfig->group( "WM" );
const char *pKey;
-
+
pKey = "titleFont";
if ( aGroup.hasKey( pKey ) )
{
@@ -205,13 +210,13 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetTitleFont( aFont );
bSetTitleFont = true;
}
-
+
aGroup = pConfig->group( "Icons" );
pKey = "Theme";
if ( aGroup.hasKey( pKey ) )
style.SetPreferredSymbolsStyleName( readEntryUntranslated( &aGroup, pKey ) );
-
+
//toolbar
pKey = "toolbarFont";
if ( aGroup.hasKey( pKey ) )
@@ -220,7 +225,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetToolFont( aFont );
}
}
-
+
Color aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) );
Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) );
@@ -247,7 +252,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetHelpColor( aBase );
style.SetWindowColor( aBase );
style.SetActiveTabColor( aBase );
-
+
// Buttons
style.SetButtonTextColor( aButn );
style.SetButtonRolloverTextColor( aButn );
@@ -263,16 +268,16 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetFaceColor( aBack );
style.SetInactiveTabColor( aBack );
style.SetDialogColor( aBack );
-
+
if( aBack == COL_LIGHTGRAY )
style.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
else
{
Color aColor2 = style.GetLightColor();
style.
- 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)
+ 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)
) );
}
@@ -282,10 +287,10 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Font
Font aFont = toFont( kapp->font(), rSettings.GetUILocale() );
-
+
style.SetAppFont( aFont );
style.SetHelpFont( aFont );
-
+
style.SetMenuFont( aFont ); // will be changed according to pMenuBar
//style.SetToolFont( aFont ); //already set above
style.SetLabelFont( aFont );
@@ -302,7 +307,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetTitleFont( aFont );
}
style.SetFloatTitleFont( aFont );
-
+
int flash_time = QApplication::cursorFlashTime();
style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
@@ -313,14 +318,14 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
// Color
QPalette qMenuCG = pMenuBar->palette();
-
+
// Menu text and background color, theme specific
Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
-
+
aMenuFore = toColor( qMenuCG.color( QPalette::ButtonText ) );
aMenuBack = toColor( qMenuCG.color( QPalette::Button ) );
-
+
style.SetMenuTextColor( aMenuFore );
style.SetMenuBarTextColor( aMenuFore );
style.SetMenuColor( aMenuBack );
@@ -329,7 +334,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
style.SetMenuHighlightTextColor( aMenuFore );
-
+
// set special menubar higlight text color
if ( kapp->style()->inherits( "HighContrastStyle" ) )
ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.color( QPalette::HighlightedText ) );
@@ -340,13 +345,12 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
aFont = toFont( pMenuBar->font(), rSettings.GetUILocale() );
style.SetMenuFont( aFont );
}
-
+
delete pMenuBar;
-
+
// Scroll bar size
style.SetScrollBarSize( kapp->style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
- style.SetMinThumbSize( kapp->style()->pixelMetric( QStyle::PM_ScrollBarSliderMin ));
-
+
rSettings.SetStyleSettings( style );
}
@@ -400,7 +404,7 @@ SalGraphics* KDESalFrame::GetGraphics()
}
}
}
-
+
return NULL;
}
diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx
index f006a6e0d796..d6ae5a842dc1 100644
--- a/vcl/unx/kde4/KDESalFrame.hxx
+++ b/vcl/unx/kde4/KDESalFrame.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,22 +40,22 @@ class KDESalFrame : public X11SalFrame
{
X11SalGraphics* pGraphics;
bool bInUse;
-
+
GraphicsHolder() : pGraphics(0),bInUse( false ) {}
~GraphicsHolder();
};
-
+
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, sal_uLong nStyle );
+ KDESalFrame( SalFrame* pParent, ULONG nStyle );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 16cb27744394..925696ac5df3 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,7 +52,7 @@
using namespace ::rtl;
-/**
+/**
Conversion function between VCL ControlState together with
ImplControlValue and Qt state flags.
@param nControlState State of the widget (default, focused, ...) in Native Widget Framework.
@@ -81,7 +81,7 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState,
return nState;
}
-/**
+/**
Convert VCL Rectangle to QRect.
@param rControlRegion The Rectangle to convert.
@return The matching QRect
@@ -91,7 +91,7 @@ QRect region2QRect( const Rectangle& rControlRegion )
return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight());
}
-KDESalGraphics::KDESalGraphics() :
+KDESalGraphics::KDESalGraphics() :
m_image(0)
{
}
@@ -102,69 +102,75 @@ KDESalGraphics::~KDESalGraphics()
delete m_image;
}
-sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
+BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
{
if (type == CTRL_PUSHBUTTON) return true;
-
+
if (type == CTRL_MENUBAR) return true;
-
+
if (type == CTRL_MENU_POPUP) return true;
-
+
if (type == CTRL_EDITBOX) return true;
-
+
if (type == CTRL_COMBOBOX) return true;
-
+
if (type == CTRL_TOOLBAR) return true;
-
+
if (type == CTRL_CHECKBOX) return true;
-
+
if (type == CTRL_LISTBOX) return true;
-
+
if (type == CTRL_LISTNODE) return true;
-
+
if (type == CTRL_FRAME) return true;
-
+
if (type == CTRL_SCROLLBAR) return true;
-
+
if (type == CTRL_WINDOW_BACKGROUND) return true;
-
+
if (type == CTRL_SPINBOX && (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE) ) return true;
// no spinbuttons for KDE, paint spinbox complete
//if (type == CTRL_SPINBUTTONS) return true;
-
+
if (type == CTRL_GROUPBOX) return true;
-
+
if (type == CTRL_FIXEDLINE) return true;
-
+
if (type == CTRL_FIXEDBORDER) return true;
-
+
if (type == CTRL_TOOLTIP) return true;
-
+
if (type == CTRL_RADIOBUTTON) return true;
-
+
if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA) )
return true;
-
- if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true;
-
+
return false;
-
+
if ( (type == CTRL_TAB_ITEM) && (part == PART_ENTIRE_CONTROL) ) return true;
if ( (type == CTRL_TAB_PANE) && (part == PART_ENTIRE_CONTROL) ) return true;
// no CTRL_TAB_BODY for KDE
-
+ if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true;
+
return false;
}
+BOOL KDESalGraphics::hitTestNativeControl( ControlType, ControlPart,
+ const Rectangle&, const Point&,
+ BOOL& )
+{
+ return FALSE;
+}
+
/// helper drawing methods
-namespace
+namespace
{
- void draw( QStyle::ControlElement element, QStyleOption* option, QImage* image, QStyle::State state, QRect rect = QRect())
+ void draw( QStyle::ControlElement element, QStyleOption* option, QImage* image, QStyle::State state )
{
option->state |= state;
- option->rect = !rect.isNull() ? rect : image->rect();
-
+ option->rect = image->rect();
+
QPainter painter(image);
kapp->style()->drawControl(element, option, &painter);
}
@@ -173,7 +179,7 @@ namespace
{
option->state |= state;
option->rect = !rect.isNull() ? rect : image->rect();
-
+
QPainter painter(image);
kapp->style()->drawPrimitive(element, option, &painter);
}
@@ -182,11 +188,11 @@ namespace
{
option->state |= state;
option->rect = image->rect();
-
+
QPainter painter(image);
kapp->style()->drawComplexControl(element, option, &painter);
}
-
+
int getFrameWidth()
{
static int s_nFrameWidth = -1;
@@ -211,12 +217,12 @@ namespace
option.state = QStyle::State_Sunken;
#else
QStyleOptionFrame option;
-
+
QFrame aFrame( NULL );
aFrame.setFrameRect( QRect(0, 0, image->width(), image->height()) );
aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
aFrame.ensurePolished();
-
+
option.initFrom( &aFrame );
option.lineWidth = aFrame.lineWidth();
option.midLineWidth = aFrame.midLineWidth();
@@ -226,54 +232,18 @@ namespace
}
}
-#if QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 )
-#define IMAGE_BASED_PAINTING
-#else
-#undef IMAGE_BASED_PAINTING
-#endif
-
-#ifdef IMAGE_BASED_PAINTING
-// There is a small catch with this function, although hopefully only philosophical.
-// Officially Xlib's Region is an opaque data type, with only functions for manipulating it.
-// However, whoever designed it apparently didn't give it that much thought, as it's impossible
-// to find out what exactly a region actually is (except for really weird ways like XClipBox()
-// and repeated XPointInRegion(), which would be awfully slow). Fortunately, the header file
-// describing the structure actually happens to be installed too, and there's at least one
-// widely used software using it (Compiz). So access the data directly too and assume that
-// everybody who compiles with Qt4 support has Xlib new enough and good enough to support this.
-// In case this doesn't work for somebody, try #include <X11/region.h> instead, or build
-// without IMAGE_BASED_PAINTING (in which case QApplication::setGraphicsSystem( "native" ) may
-// be needed too).
-#include <X11/Xregion.h>
-static QRegion XRegionToQRegion( XLIB_Region xr )
-{
- QRegion qr;
- for( int i = 0;
- i < xr->numRects;
- ++i )
- {
- BOX& b = xr->rects[ i ];
- qr |= QRect( b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1 ); // x2,y2 is outside, not the bottom-right corner
- }
- return qr;
-}
-#endif
-
-sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
+BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& value,
const OUString& )
{
- if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part != PART_MENU_ITEM ))
- lastPopupRect = QRect();
-
// put not implemented types here
if (type == CTRL_SPINBUTTONS)
{
return false;
}
-
- sal_Bool returnVal = true;
+
+ BOOL returnVal = true;
QRect widgetRect = region2QRect(rControlRegion);
if( type == CTRL_SPINBOX && part == PART_ALL_BUTTONS )
@@ -287,33 +257,34 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
widgetRect = QRect( aButtonRect.Left(), aButtonRect.Top(),
aButtonRect.Right(), aButtonRect.Bottom() );
}
-
+
//if no image, or resized, make a new image
if (!m_image || m_image->size() != widgetRect.size())
{
if (m_image)
delete m_image;
-
+
m_image = new QImage( widgetRect.width(),
- widgetRect.height(),
+ widgetRect.height(),
QImage::Format_ARGB32 );
}
m_image->fill(KApplication::palette().color(QPalette::Window).rgb());
-
- QRegion* clipRegion = NULL;
+
+
+ XLIB_Region pTempClipRegion = 0;
if (type == CTRL_PUSHBUTTON)
{
QStyleOptionButton option;
- draw( QStyle::CE_PushButton, &option, m_image,
+ draw( QStyle::CE_PushButton, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if ( (type == CTRL_MENUBAR))
{
- if (part == PART_MENU_ITEM)
+ if (part == PART_MENU_ITEM)
{
QStyleOptionMenuItem option;
- draw( QStyle::CE_MenuBarItem, &option, m_image,
+ draw( QStyle::CE_MenuBarItem, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (part == PART_ENTIRE_CONTROL)
@@ -325,106 +296,72 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
}
}
else if (type == CTRL_MENU_POPUP)
- {
- OSL_ASSERT( part == PART_MENU_ITEM ? lastPopupRect.isValid() : !lastPopupRect.isValid());
- if( part == PART_MENU_ITEM )
+ {
+ if (part == PART_MENU_ITEM)
{
QStyleOptionMenuItem option;
- draw( QStyle::CE_MenuItem, &option, m_image,
+ draw( QStyle::CE_MenuItem, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
- // HACK: LO core first paints the entire popup and only then it paints menu items,
- // but QMenu::paintEvent() paints popup frame after all items. That means highlighted
- // items here would paint the highlight over the frame border. Since calls to PART_MENU_ITEM
- // are always preceded by calls to PART_ENTIRE_CONTROL, just remember the size for the whole
- // popup (otherwise not possible to get here) and draw the border afterwards.
- QRect framerect( lastPopupRect.topLeft() - widgetRect.topLeft(),
- widgetRect.size().expandedTo( lastPopupRect.size()));
- QStyleOptionFrame frame;
- draw( QStyle::PE_FrameMenu, &frame, m_image, vclStateValue2StateFlag( nControlState, value ), framerect );
}
- else if( part == PART_MENU_SEPARATOR )
+ else if (part == PART_MENU_ITEM_CHECK_MARK && (nControlState & CTRL_STATE_PRESSED) )
{
- QStyleOptionMenuItem option;
- option.menuItemType = QStyleOptionMenuItem::Separator;
- // Painting the whole menu item area results in different background
- // with at least Plastique style, so clip only to the separator itself
- // (QSize( 2, 2 ) is hardcoded in Qt)
- option.rect = m_image->rect();
- QSize size = kapp->style()->sizeFromContents( QStyle::CT_MenuItem, &option, QSize( 2, 2 ));
- QRect rect = m_image->rect();
- QPoint center = rect.center();
- rect.setHeight( size.height());
- rect.moveCenter( center );
- // don't paint over popup frame border (like the hack above, but here it can be simpler)
- int fw = kapp->style()->pixelMetric( QStyle::PM_MenuPanelWidth );
- clipRegion = new QRegion( rect.translated( widgetRect.topLeft()).adjusted( fw, 0, -fw, 0 ));
- draw( QStyle::CE_MenuItem, &option, m_image,
- vclStateValue2StateFlag(nControlState, value), rect );
+ QStyleOptionButton option;
+ draw( QStyle::PE_IndicatorMenuCheckMark, &option, m_image,
+ vclStateValue2StateFlag(nControlState, value) );
}
- else if( part == PART_MENU_ITEM_CHECK_MARK || part == PART_MENU_ITEM_RADIO_MARK )
+ else if (part == PART_MENU_ITEM_RADIO_MARK && (nControlState & CTRL_STATE_PRESSED) )
{
- QStyleOptionMenuItem option;
- option.checkType = ( part == PART_MENU_ITEM_CHECK_MARK )
- ? QStyleOptionMenuItem::NonExclusive : QStyleOptionMenuItem::Exclusive;
- option.checked = ( nControlState & CTRL_STATE_PRESSED );
- // widgetRect is now the rectangle for the checkbox/radiobutton itself, but Qt
- // paints the whole menu item, so translate position (and it'll be clipped);
- // it is also necessary to fill the background transparently first, as this
- // is painted after menuitem highlight, otherwise there would be a grey area
- const MenupopupValue* menuVal = static_cast<const MenupopupValue*>(&value);
- QRect menuItemRect( region2QRect( menuVal->maItemRect ));
- QRect rect( menuItemRect.topLeft() - widgetRect.topLeft(),
- widgetRect.size().expandedTo( menuItemRect.size()));
- m_image->fill( Qt::transparent );
- draw( QStyle::CE_MenuItem, &option, m_image,
- vclStateValue2StateFlag(nControlState, value), rect );
+ QStyleOptionButton option;
+ draw( QStyle::PE_IndicatorRadioButton, &option, m_image,
+ vclStateValue2StateFlag(nControlState, value) );
}
- else if( part == PART_ENTIRE_CONTROL )
+ else
{
- QStyleOptionMenuItem option;
- draw( QStyle::PE_PanelMenu, &option, m_image, vclStateValue2StateFlag( nControlState, value ));
- QStyleOptionFrame frame;
- draw( QStyle::PE_FrameMenu, &frame, m_image, vclStateValue2StateFlag( nControlState, value ));
- lastPopupRect = widgetRect;
+ #if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) )
+ QStyleOptionFrameV3 option;
+ option.frameShape = QFrame::StyledPanel;
+ #else
+ QStyleOptionFrameV2 option;
+ #endif
+ draw( QStyle::PE_FrameMenu, &option, m_image,
+ vclStateValue2StateFlag(nControlState, value) );
}
- else
- returnVal = false;
}
else if ( (type == CTRL_TOOLBAR) && (part == PART_BUTTON) )
{
QStyleOptionToolButton option;
-
+
option.arrowType = Qt::NoArrow;
option.subControls = QStyle::SC_ToolButton;
-
+
option.state = vclStateValue2StateFlag( nControlState, value );
option.state |= QStyle::State_Raised | QStyle::State_Enabled | QStyle::State_AutoRaise;
-
- draw( QStyle::CC_ToolButton, &option, m_image,
+
+ draw( QStyle::CC_ToolButton, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if ( (type == CTRL_TOOLBAR) && (part == PART_ENTIRE_CONTROL) )
{
QStyleOptionToolBar option;
-
+
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
option.state = vclStateValue2StateFlag( nControlState, value );
-
- draw( QStyle::CE_ToolBar, &option, m_image,
+
+ draw( QStyle::CE_ToolBar, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if ( (type == CTRL_TOOLBAR) && (part == PART_THUMB_VERT) )
{ // reduce paint area only to the handle area
const int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QRect rect( 0, 0, width, widgetRect.height());
- clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
+ pTempClipRegion = XCreateRegion();
XRectangle xRect = { widgetRect.x(), widgetRect.y(), width, widgetRect.height() };
XUnionRectWithRegion( &xRect, pTempClipRegion, pTempClipRegion );
-
+
QStyleOption option;
option.state = QStyle::State_Horizontal;
-
- draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image,
+
+ draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image,
vclStateValue2StateFlag(nControlState, value), rect );
}
else if (type == CTRL_EDITBOX)
@@ -432,7 +369,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
QStyleOptionFrameV2 option;
draw( QStyle::PE_PanelLineEdit, &option, m_image,
vclStateValue2StateFlag(nControlState, value), m_image->rect().adjusted( 2, 2, -2, -2 ));
-
+
draw( QStyle::PE_FrameLineEdit, &option, m_image,
vclStateValue2StateFlag(nControlState, value));
}
@@ -440,15 +377,15 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{
QStyleOptionComboBox option;
option.editable = true;
-
- draw( QStyle::CC_ComboBox, &option, m_image,
+
+ draw( QStyle::CC_ComboBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_LISTBOX)
{
if( part == PART_WINDOW )
{
- lcl_drawFrame( QStyle::PE_Frame, m_image,
+ lcl_drawFrame( QStyle::PE_Frame, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else
@@ -456,12 +393,12 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
QStyleOptionComboBox option;
if (part == PART_SUB_EDIT)
{
- draw( QStyle::CE_ComboBoxLabel, &option, m_image,
+ draw( QStyle::CE_ComboBoxLabel, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else
{
- draw( QStyle::CC_ComboBox, &option, m_image,
+ draw( QStyle::CC_ComboBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
}
@@ -470,15 +407,15 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{
QStyleOption option;
option.state = QStyle::State_Item | QStyle::State_Children;
-
+
if (nControlState & CTRL_STATE_PRESSED)
option.state |= QStyle::State_Open;
-
+
draw( QStyle::PE_IndicatorBranch, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_CHECKBOX)
- {
+ {
QStyleOptionButton option;
draw( QStyle::CE_CheckBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
@@ -490,17 +427,17 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
QStyleOptionSlider option;
OSL_ASSERT( value.getType() == CTRL_SCROLLBAR );
const ScrollbarValue* sbVal = static_cast<const ScrollbarValue *>(&value);
-
+
//if the scroll bar is active (aka not degenrate...allow for hover events
if (sbVal->mnVisibleSize < sbVal->mnMax)
option.state = QStyle::State_MouseOver;
-
+
//horizontal or vertical
if (part == PART_DRAW_BACKGROUND_VERT)
option.orientation = Qt::Vertical;
else
option.state |= QStyle::State_Horizontal;
-
+
//setup parameters from the OO values
option.minimum = sbVal->mnMin;
option.maximum = sbVal->mnMax - sbVal->mnVisibleSize;
@@ -508,12 +445,12 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
option.sliderValue = sbVal->mnCur;
option.sliderPosition = sbVal->mnCur;
option.pageStep = sbVal->mnVisibleSize;
-
+
//setup the active control...always the slider
if (sbVal->mnThumbState & CTRL_STATE_ROLLOVER)
option.activeSubControls = QStyle::SC_ScrollBarSlider;
-
- draw( QStyle::CC_ScrollBar, &option, m_image,
+
+ draw( QStyle::CC_ScrollBar, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else
@@ -524,7 +461,7 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
else if (type == CTRL_SPINBOX)
{
QStyleOptionSpinBox option;
-
+
// determine active control
if( value.getType() == CTRL_SPINBUTTONS )
{
@@ -534,40 +471,56 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
if( (pSpinVal->mnLowerState & CTRL_STATE_PRESSED) )
option.activeSubControls |= QStyle::SC_SpinBoxDown;
}
-
- draw( QStyle::CC_SpinBox, &option, m_image,
+
+ draw( QStyle::CC_SpinBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_GROUPBOX)
{
QStyleOptionGroupBox option;
- draw( QStyle::CC_GroupBox, &option, m_image,
+ draw( QStyle::CC_GroupBox, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_RADIOBUTTON)
{
QStyleOptionButton option;
- draw( QStyle::CE_RadioButton, &option, m_image,
+ draw( QStyle::CE_RadioButton, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_TOOLTIP)
{
QStyleOption option;
- draw( QStyle::PE_PanelTipLabel, &option, m_image,
+ draw( QStyle::PE_PanelTipLabel, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_FRAME)
{
- lcl_drawFrame( QStyle::PE_Frame, m_image,
+ lcl_drawFrame( QStyle::PE_Frame, m_image,
vclStateValue2StateFlag(nControlState, value) );
-
+
// draw just the border, see http://qa.openoffice.org/issues/show_bug.cgi?id=107945
- int fw = getFrameWidth();
- clipRegion = new QRegion( QRegion( widgetRect ).subtracted( widgetRect.adjusted( fw, fw, -fw, -fw )));
+ int nFrameWidth = getFrameWidth();
+ pTempClipRegion = XCreateRegion();
+ XRectangle xRect = { widgetRect.left(), widgetRect.top(), widgetRect.width(), widgetRect.height() };
+ XUnionRectWithRegion( &xRect, pTempClipRegion, pTempClipRegion );
+ xRect.x += nFrameWidth;
+ xRect.y += nFrameWidth;
+
+ // do not crash for too small widgets, see http://qa.openoffice.org/issues/show_bug.cgi?id=112102
+ if( xRect.width > 2*nFrameWidth && xRect.height > 2*nFrameWidth )
+ {
+ xRect.width -= 2*nFrameWidth;
+ xRect.height -= 2*nFrameWidth;
+
+ XLIB_Region pSubtract = XCreateRegion();
+ XUnionRectWithRegion( &xRect, pSubtract, pSubtract );
+ XSubtractRegion( pTempClipRegion, pSubtract, pTempClipRegion );
+ XDestroyRegion( pSubtract );
+ }
}
else if (type == CTRL_FIXEDBORDER)
{
- lcl_drawFrame( QStyle::PE_FrameWindow, m_image,
+ lcl_drawFrame( QStyle::PE_FrameWindow, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_WINDOW_BACKGROUND)
@@ -579,8 +532,8 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
QStyleOptionMenuItem option;
option.menuItemType = QStyleOptionMenuItem::Separator;
option.state |= QStyle::State_Item;
-
- draw( QStyle::CE_MenuItem, &option, m_image,
+
+ draw( QStyle::CE_MenuItem, &option, m_image,
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA))
@@ -588,71 +541,31 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
OSL_ASSERT( value.getType() == CTRL_SLIDER );
const SliderValue* slVal = static_cast<const SliderValue *>(&value);
QStyleOptionSlider option;
-
+
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
option.state = vclStateValue2StateFlag( nControlState, value );
option.maximum = slVal->mnMax;
option.minimum = slVal->mnMin;
option.sliderPosition = option.sliderValue = slVal->mnCur;
option.orientation = (part == PART_TRACK_HORZ_AREA) ? Qt::Horizontal : Qt::Vertical;
-
+
draw( QStyle::CC_Slider, &option, m_image, vclStateValue2StateFlag(nControlState, value) );
}
- else if( type == CTRL_PROGRESS && part == PART_ENTIRE_CONTROL )
- {
- QStyleOptionProgressBarV2 option;
- option.minimum = 0;
- option.maximum = widgetRect.width();
- option.progress = value.getNumericVal();
- option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
- option.state = vclStateValue2StateFlag( nControlState, value );
-
- draw( QStyle::CE_ProgressBar, &option, m_image,
- vclStateValue2StateFlag(nControlState, value) );
- }
else
{
returnVal = false;
}
-
+
if (returnVal)
{
-#ifdef IMAGE_BASED_PAINTING
- // Create a wrapper QPixmap around the destination pixmap, allowing the use of QPainter.
- // Using X11SalGraphics::CopyScreenArea() would require using QPixmap and if Qt uses
- // other graphics system than native, QPixmap::handle() would be 0 (i.e. it wouldn't work),
- // I have no idea how to create QPixmap with non-null handle() in such case, so go this way.
- // See XRegionToQRegion() comment for a small catch (although not real hopefully).
- QPixmap destPixmap = QPixmap::fromX11Pixmap( GetDrawable(), QPixmap::ExplicitlyShared );
- QPainter paint( &destPixmap );
- if( clipRegion && mpClipRegion )
- paint.setClipRegion( clipRegion->intersected( XRegionToQRegion( mpClipRegion )));
- else if( clipRegion )
- paint.setClipRegion( *clipRegion );
- else if( mpClipRegion )
- paint.setClipRegion( XRegionToQRegion( mpClipRegion ));
- paint.drawImage( widgetRect.left(), widgetRect.top(), *m_image,
- 0, 0, widgetRect.width(), widgetRect.height(),
- Qt::ColorOnly | Qt::OrderedDither | Qt::OrderedAlphaDither );
-#else
GC gc = SelectFont();
+
if( gc )
{
- XLIB_Region pTempClipRegion = NULL;
- if( clipRegion )
+ if( pTempClipRegion )
{
- pTempClipRegion = XCreateRegion();
- foreach( const QRect& r, clipRegion->rects())
- {
- XRectangle xr;
- xr.x = r.x();
- xr.y = r.y();
- xr.width = r.width();
- xr.height = r.height();
- XUnionRectWithRegion( &xr, pTempClipRegion, pTempClipRegion );
- }
- if( mpClipRegion )
- XIntersectRegion( pTempClipRegion, mpClipRegion, pTempClipRegion );
+ if( pClipRegion_ )
+ XIntersectRegion( pTempClipRegion, pClipRegion_, pTempClipRegion );
XSetRegion( GetXDisplay(), gc, pTempClipRegion );
}
QPixmap pixmap = QPixmap::fromImage(*m_image, Qt::ColorOnly | Qt::OrderedDither | Qt::OrderedAlphaDither);
@@ -660,36 +573,36 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
pixmap.handle(), pixmap.x11Info().screen(), pixmap.x11Info().depth(),
GetDrawable(), GetScreenNumber(), GetVisual().GetDepth(),
gc, 0, 0, widgetRect.width(), widgetRect.height(), widgetRect.left(), widgetRect.top());
-
+
if( pTempClipRegion )
{
- if( mpClipRegion )
- XSetRegion( GetXDisplay(), gc, mpClipRegion );
+ if( pClipRegion_ )
+ XSetRegion( GetXDisplay(), gc, pClipRegion_ );
else
XSetClipMask( GetXDisplay(), gc, None );
- XDestroyRegion( pTempClipRegion );
}
}
else
returnVal = false;
-#endif
}
- delete clipRegion;
+ if( pTempClipRegion )
+ XDestroyRegion( pTempClipRegion );
+
return returnVal;
}
-sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
+BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
const Rectangle& controlRegion, ControlState controlState,
const ImplControlValue& val,
const OUString&,
Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion )
{
- sal_Bool retVal = false;
-
+ bool retVal = false;
+
QRect boundingRect = region2QRect( controlRegion );
QRect contentRect = boundingRect;
QStyleOptionComplex styleOption;
-
+
switch ( type )
{
// Metrics of the push button
@@ -702,9 +615,9 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
{
int size = kapp->style()->pixelMetric(
QStyle::PM_ButtonDefaultIndicator, &styleOption );
-
+
boundingRect.adjust( -size, -size, size, size );
-
+
retVal = true;
}
}
@@ -727,46 +640,46 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
contentRect = boundingRect;
contentRect.adjust( -nLayoutLeft+1, -nLayoutTop+1, nLayoutRight-1, nLayoutBottom-1 );
retVal = true;
-
+
break;
}
case CTRL_CHECKBOX:
if (part == PART_ENTIRE_CONTROL)
{
styleOption.state = vclStateValue2StateFlag(controlState, val);
-
+
contentRect.setWidth(kapp->style()->pixelMetric(
QStyle::PM_IndicatorWidth, &styleOption));
contentRect.setHeight(kapp->style()->pixelMetric(
QStyle::PM_IndicatorHeight, &styleOption));
-
+
contentRect.adjust(0, 0,
2 * kapp->style()->pixelMetric(
QStyle::PM_FocusFrameHMargin, &styleOption),
2 * kapp->style()->pixelMetric(
QStyle::PM_FocusFrameVMargin, &styleOption)
);
-
+
boundingRect = contentRect;
-
+
retVal = true;
-
+
break;
}
case CTRL_COMBOBOX:
case CTRL_LISTBOX:
{
QStyleOptionComboBox cbo;
-
+
cbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
cbo.state = vclStateValue2StateFlag(controlState, val);
-
+
switch ( part )
{
case PART_ENTIRE_CONTROL:
{
int size = kapp->style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
-
+
// find out the minimum size that should be used
// assume contents is a text ling
int nHeight = kapp->fontMetrics().height();
@@ -791,9 +704,9 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
case PART_SUB_EDIT:
contentRect = kapp->style()->subControlRect(
QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
-
+
contentRect.translate( boundingRect.left(), boundingRect.top() );
-
+
retVal = true;
break;
case PART_WINDOW:
@@ -808,7 +721,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
sbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
sbo.state = vclStateValue2StateFlag(controlState, val);
-
+
switch ( part )
{
case PART_BUTTON_UP:
@@ -818,7 +731,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
retVal = true;
boundingRect = QRect();
break;
-
+
case PART_BUTTON_DOWN:
contentRect = kapp->style()->subControlRect(
QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxDown );
@@ -839,8 +752,16 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
break;
}
case CTRL_MENU_POPUP:
- if (part == PART_MENU_ITEM_CHECK_MARK || part == PART_MENU_ITEM_RADIO_MARK)
- { // core uses this to detect radio/checkbox sizes, so just set a square
+ //just limit the widget of the menu items
+ //OO isn't very flexible in all reguards with the menu
+ //so we do the best we can
+ if (part == PART_MENU_ITEM_CHECK_MARK)
+ {
+ contentRect.setWidth(contentRect.height());
+ retVal = true;
+ }
+ else if (part == PART_MENU_ITEM_RADIO_MARK)
+ {
contentRect.setWidth(contentRect.height());
retVal = true;
}
@@ -850,7 +771,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
if( part == PART_BORDER )
{
int nFrameWidth = getFrameWidth();
- sal_uInt16 nStyle = val.getNumericVal();
+ USHORT nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
{
// in this case the question is: how thick would a frame be
@@ -866,7 +787,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
{
const int h = kapp->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight);
const int w = kapp->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
-
+
contentRect = QRect(boundingRect.left(), boundingRect.top(), w, h);
contentRect.adjust(0, 0,
2 * kapp->style()->pixelMetric(
@@ -875,7 +796,7 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
QStyle::PM_FocusFrameVMargin, &styleOption)
);
boundingRect = contentRect;
-
+
retVal = true;
break;
}
@@ -896,35 +817,6 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
}
break;
}
- case CTRL_SCROLLBAR:
- {
- // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(),
- // for the rest also provide the track area (i.e. area not taken by buttons)
- if( part == PART_TRACK_VERT_AREA || part == PART_TRACK_HORZ_AREA )
- {
- QStyleOptionSlider option;
- OSL_ASSERT( val.getType() == CTRL_SCROLLBAR );
- const ScrollbarValue* sbVal = static_cast<const ScrollbarValue *>(&val);
- option.orientation = ( part == PART_TRACK_HORZ_AREA ) ? Qt::Horizontal : Qt::Vertical;
- option.minimum = sbVal->mnMin;
- option.maximum = sbVal->mnMax;
- option.sliderValue = sbVal->mnCur;
- option.sliderPosition = sbVal->mnCur;
- option.pageStep = sbVal->mnVisibleSize;
- // Adjust coordinates to make the widget appear to be at (0,0), i.e. make
- // widget and screen coordinates the same. QStyle functions should use screen
- // coordinates but at least QPlastiqueStyle::subControlRect() is buggy
- // and sometimes uses widget coordinates.
- QRect rect = contentRect;
- rect.moveTo( 0, 0 );
- option.rect = rect;
- rect = kapp->style()->subControlRect( QStyle::CC_ScrollBar, &option,
- QStyle::SC_ScrollBarGroove );
- rect.translate( contentRect.topLeft()); // reverse the workaround above
- contentRect = boundingRect = rect;
- retVal = true;
- }
- }
default:
break;
}
@@ -940,55 +832,8 @@ sal_Bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart p
Size aSize( contentRect.width(), contentRect.height() );
nativeContentRegion = Rectangle( aPoint, aSize );
}
-
+
return retVal;
}
-/** Test whether the position is in the native widget.
- If the return value is TRUE, bIsInside contains information whether
- aPos was or was not inside the native widget specified by the
- nType/nPart combination.
-*/
-sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
- const Rectangle& rControlRegion, const Point& rPos,
- sal_Bool& rIsInside )
-{
- if ( nType == CTRL_SCROLLBAR )
- {
- if( nPart != PART_BUTTON_UP && nPart != PART_BUTTON_DOWN
- && nPart != PART_BUTTON_LEFT && nPart != PART_BUTTON_RIGHT )
- { // we adjust only for buttons (because some scrollbars have 3 buttons,
- // and LO core doesn't handle such scrollbars well)
- return FALSE;
- }
- rIsInside = FALSE;
- bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
- QRect rect = region2QRect( rControlRegion );
- QPoint pos( rPos.X(), rPos.Y());
- // Adjust coordinates to make the widget appear to be at (0,0), i.e. make
- // widget and screen coordinates the same. QStyle functions should use screen
- // coordinates but at least QPlastiqueStyle::subControlRect() is buggy
- // and sometimes uses widget coordinates.
- pos -= rect.topLeft();
- rect.moveTo( 0, 0 );
- QStyleOptionSlider options;
- options.orientation = bHorizontal ? Qt::Horizontal : Qt::Vertical;
- options.rect = rect;
- // some random sensible values, since we call this code only for scrollbar buttons,
- // the slider position does not exactly matter
- options.maximum = 10;
- options.minimum = 0;
- options.sliderPosition = options.sliderValue = 4;
- options.pageStep = 2;
- QStyle::SubControl control = kapp->style()->hitTestComplexControl( QStyle::CC_ScrollBar, &options, pos );
- if( nPart == PART_BUTTON_UP || nPart == PART_BUTTON_LEFT )
- rIsInside = ( control == QStyle::SC_ScrollBarSubLine );
- else // DOWN, RIGHT
- rIsInside = ( control == QStyle::SC_ScrollBarAddLine );
- return TRUE;
- }
- return FALSE;
-}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx
index 5d1f3541a9b5..b9f4ec14590a 100644
--- a/vcl/unx/kde4/KDESalGraphics.hxx
+++ b/vcl/unx/kde4/KDESalGraphics.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,58 +40,57 @@
class KDESalGraphics : public X11SalGraphics
{
QImage* m_image;
- QRect lastPopupRect;
public:
KDESalGraphics();
virtual ~KDESalGraphics();
-
+
/**
What widgets can be drawn the native way.
@param type Type of the widget.
@param part Specification of the widget's part if it consists of more than one.
@return true if the platform supports native drawing of the widget type defined by part.
*/
- virtual sal_Bool IsNativeControlSupported( ControlType type, ControlPart part );
-
+ virtual BOOL IsNativeControlSupported( ControlType type, ControlPart part );
+
/** Test whether the position is in the native widget.
If the return value is TRUE, bIsInside contains information whether
aPos was or was not inside the native widget specified by the
type/part combination.
*/
- virtual sal_Bool hitTestNativeControl( ControlType type, ControlPart part,
+ virtual BOOL hitTestNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, const Point& aPos,
- sal_Bool& rIsInside );
+ BOOL& rIsInside );
/** Draw the requested control described by part/nControlState.
-
+
@param rControlRegion
The bounding Rectangle of the complete control in VCL frame coordinates.
-
+
@param aValue
An optional value (tristate/numerical/string).
-
+
@param aCaption
A caption or title string (like button text etc.)
*/
- virtual sal_Bool drawNativeControl( ControlType type, ControlPart part,
+ virtual BOOL drawNativeControl( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption );
-
+
/** Draw text on the widget.
OPTIONAL. Draws the requested text for the control described by part/nControlState.
Used if text is not drawn by DrawNativeControl().
-
+
@param rControlRegion The bounding region of the complete control in VCL frame coordinates.
@param aValue An optional value (tristate/numerical/string)
- @param aCaption A caption or title string (like button text etc.)
+ @param aCaption A caption or title string (like button text etc.)
*/
- virtual sal_Bool drawNativeControlText( ControlType, ControlPart,
+ virtual BOOL drawNativeControlText( ControlType, ControlPart,
const Rectangle&, ControlState,
const ImplControlValue&,
const rtl::OUString& ) { return false; }
/** Check if the bounding regions match.
-
+
If the return value is TRUE, rNativeBoundingRegion
contains the true bounding region covered by the control
including any adornment, while rNativeContentRegion contains the area
@@ -100,14 +99,14 @@ class KDESalGraphics : public X11SalGraphics
@param rControlRegion
The bounding region of the control in VCL frame coordinates.
-
+
@param aValue
An optional value (tristate/numerical/string)
-
+
@param aCaption
A caption or title string (like button text etc.)
*/
- virtual sal_Bool getNativeControlRegion( ControlType type, ControlPart part,
+ virtual BOOL getNativeControlRegion( ControlType type, ControlPart part,
const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index c63d328e29c3..976e77a32839 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,7 +30,7 @@
#include "KDESalFrame.hxx"
-SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState )
+SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
{
return new KDESalFrame( pParent, nState );
}
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index 9f35557061bb..ed463605f95c 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@ class KDESalInstance : public X11SalInstance
public:
KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 03bcfca8e47e..1bca18e58af4 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,9 +57,8 @@
#include <stdio.h>
-#if QT_VERSION >= QT_VERSION_CHECK( 4, 8, 0 )
-#define QT_UNIX_EVENT_LOOP_SUPPORT
#ifdef KDE_HAVE_GLIB
+#if QT_VERSION >= QT_VERSION_CHECK( 4, 8, 0 )
#define GLIB_EVENT_LOOP_SUPPORT
#endif
#endif
@@ -68,8 +67,8 @@
#include <glib-2.0/glib.h>
#endif
-KDEXLib::KDEXLib() :
- SalXLib(), m_bStartupDone(false), m_pApplication(0),
+KDEXLib::KDEXLib() :
+ SalXLib(), m_bStartupDone(false), m_pApplication(0),
m_pFreeCmdLineArgs(0), m_pAppCmdLineArgs(0), m_nFakeCmdLineArgs( 0 ),
eventLoopType( LibreOfficeEventLoop )
{
@@ -89,13 +88,13 @@ KDEXLib::KDEXLib() :
KDEXLib::~KDEXLib()
{
delete m_pApplication;
-
+
// free the faked cmdline arguments no longer needed by KApplication
for( int i = 0; i < m_nFakeCmdLineArgs; i++ )
{
free( m_pFreeCmdLineArgs[i] );
}
-
+
delete [] m_pFreeCmdLineArgs;
delete [] m_pAppCmdLineArgs;
}
@@ -116,7 +115,7 @@ void KDEXLib::Init()
ki18n( "LibreOffice is an office suite.\n" ),
"http://libreoffice.org",
"libreoffice@lists.freedesktop.org" );
-
+
kAboutData->addAuthor( ki18n( "Jan Holesovsky" ),
ki18n( "Original author and maintainer of the KDE NWF." ),
"kendy@artax.karlin.mff.cuni.cz",
@@ -127,11 +126,11 @@ void KDEXLib::Init()
kAboutData->addAuthor( ki18n("Eric Bischoff"),
ki18n( "Accessibility fixes, porting to KDE 4." ),
"bischoff@kde.org" );
-
+
//kAboutData->setProgramIconName("OpenOffice");
m_nFakeCmdLineArgs = 2;
- sal_uInt16 nIdx;
+ USHORT nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
@@ -140,7 +139,7 @@ void KDEXLib::Init()
for ( nIdx = 0; nIdx < nParams; ++nIdx )
{
osl_getCommandArg( nIdx, &aParam.pData );
- if ( !m_pFreeCmdLineArgs && aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) && nIdx + 1 < nParams )
+ if ( !m_pFreeCmdLineArgs && aParam.equalsAscii( "-display" ) && nIdx + 1 < nParams )
{
osl_getCommandArg( nIdx + 1, &aParam.pData );
aDisplay = rtl::OUStringToOString( aParam, osl_getThreadTextEncoding() );
@@ -169,6 +168,9 @@ void KDEXLib::Init()
KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
+#if QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 )
+ QApplication::setGraphicsSystem( "native" ); // fdo#30991
+#endif
m_pApplication = new VCLKDEApplication();
kapp->disableSessionManagement();
KApplication::setQuitOnLastWindowClosed(false);
@@ -176,7 +178,7 @@ void KDEXLib::Init()
Display* pDisp = QX11Info::display();
SalKDEDisplay *pSalDisplay = new SalKDEDisplay(pDisp);
-
+
pInputMethod->CreateMethod( pDisp );
pInputMethod->AddConnectionWatch( pDisp, (void*)this );
pSalDisplay->SetInputMethod( pInputMethod );
@@ -185,7 +187,7 @@ void KDEXLib::Init()
SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
XSync( pDisp, False );
- pKbdExtension->UseExtension( ! HasXErrorOccurred() );
+ pKbdExtension->UseExtension( ! HasXErrorOccured() );
PopXErrorLevel();
pSalDisplay->SetKbdExtension( pKbdExtension );
@@ -202,22 +204,6 @@ void KDEXLib::Init()
static GPollFunc old_gpoll = NULL;
static gint gpoll_wrapper( GPollFD*, guint, gint );
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
-static int (*qt_select)(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
- const struct timeval *orig_timeout);
-static int lo_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
- const struct timeval *orig_timeout);
-#endif
-
-static bool ( *old_qt_event_filter )( void* );
-static bool qt_event_filter( void* m )
-{
- if( old_qt_event_filter != NULL && old_qt_event_filter( m ))
- return true;
- if( SalKDEDisplay::self() && SalKDEDisplay::self()->checkDirectInputEvent( static_cast< XEvent* >( m )))
- return true;
- return false;
-}
static bool ( *old_qt_event_filter )( void* );
static bool qt_event_filter( void* m )
@@ -249,24 +235,7 @@ void KDEXLib::setupEventLoop()
return;
}
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
-// When Qt does not use Glib support, it uses its own Unix event dispatcher.
-// That one has aboutToBlock() and awake() signals, but they are broken (either
-// functionality or semantics), as e.g. awake() is not emitted right after the dispatcher
-// is woken up from sleep again, but only later (which is too late for re-acquiring SolarMutex).
-// This should be fixed with Qt-4.8.0 (?) where support for adding custom select() function
-// has been added too (http://bugreports.qt.nokia.com/browse/QTBUG-16934).
- if( QAbstractEventDispatcher::instance()->inherits( "QEventDispatcherUNIX" ))
- {
- eventLoopType = QtUnixEventLoop;
- QInternal::callFunction( QInternal::GetUnixSelectFunction, reinterpret_cast< void** >( &qt_select ));
- QInternal::callFunction( QInternal::SetUnixSelectFunction, reinterpret_cast< void** >( lo_select ));
- // set QClipboard to use event loop, otherwise the main thread will hold
- // SolarMutex locked, which will prevent the clipboard thread from answering
- m_pApplication->clipboard()->setProperty( "useEventLoopWhenWaiting", true );
- return;
- }
-#endif
+ // TODO handle also Qt's own event loop (requires fixing Qt too)
}
#ifdef GLIB_EVENT_LOOP_SUPPORT
@@ -277,15 +246,6 @@ gint gpoll_wrapper( GPollFD* ufds, guint nfds, gint timeout )
}
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
-int lo_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
- const struct timeval *orig_timeout)
-{
- YieldMutexReleaser release; // release YieldMutex (and re-acquire at block end)
- return qt_select( nfds, fdread, fdwrite, fdexcept, orig_timeout );
-}
-#endif
-
void KDEXLib::Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle )
{
if( eventLoopType == LibreOfficeEventLoop )
@@ -355,7 +315,7 @@ bool KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
return wasEvent;
}
-void KDEXLib::StartTimer( sal_uLong nMS )
+void KDEXLib::StartTimer( ULONG nMS )
{
if( eventLoopType == LibreOfficeEventLoop )
return SalXLib::StartTimer( nMS );
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 72848ed4084c..ffe93b40c735 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -58,7 +58,7 @@ class KDEXLib : public QObject, public SalXLib
QHash< int, SocketData > socketData; // key is fd
QTimer timeoutTimer;
QTimer userEventTimer;
- enum { LibreOfficeEventLoop, GlibEventLoop, QtUnixEventLoop } eventLoopType;
+ enum { LibreOfficeEventLoop, GlibEventLoop } eventLoopType;
private:
void setupEventLoop();
@@ -74,7 +74,7 @@ class KDEXLib : public QObject, public SalXLib
void startTimeoutTimerSignal();
void startUserEventTimerSignal();
void processYieldSignal( bool bWait, bool bHandleAllCurrentEvents );
-
+
public:
KDEXLib();
virtual ~KDEXLib();
@@ -83,11 +83,11 @@ 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( sal_uLong nMS );
+ virtual void StartTimer( ULONG nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
-
+
void doStartup();
};
diff --git a/vcl/unx/kde4/VCLKDEApplication.cxx b/vcl/unx/kde4/VCLKDEApplication.cxx
index c923598736e8..678731c6fdb0 100644
--- a/vcl/unx/kde4/VCLKDEApplication.cxx
+++ b/vcl/unx/kde4/VCLKDEApplication.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,7 +34,7 @@
#include "KDESalDisplay.hxx"
-VCLKDEApplication::VCLKDEApplication() :
+VCLKDEApplication::VCLKDEApplication() :
KApplication()
{
}
@@ -47,7 +47,7 @@ bool VCLKDEApplication::x11EventFilter(XEvent* event)
{
return true;
}
-
+
return false;
}
diff --git a/vcl/unx/kde4/VCLKDEApplication.hxx b/vcl/unx/kde4/VCLKDEApplication.hxx
index 17a9b6eb0917..d86e85910af4 100644
--- a/vcl/unx/kde4/VCLKDEApplication.hxx
+++ b/vcl/unx/kde4/VCLKDEApplication.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@ class VCLKDEApplication : public KApplication
{
public:
VCLKDEApplication();
-
+
virtual void commitData(QSessionManager&) {};
-
+
virtual bool x11EventFilter(XEvent* event);
};
diff --git a/vcl/unx/kde4/main.cxx b/vcl/unx/kde4/main.cxx
index d38c346c21b8..32561d9c9ee4 100644
--- a/vcl/unx/kde4/main.cxx
+++ b/vcl/unx/kde4/main.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,7 +55,7 @@ extern "C" {
*/
if( ! ( pNoXInitThreads && *pNoXInitThreads ) )
XInitThreads();
-
+
#if QT_VERSION < 0x050000
// Qt 4.x support needs >= 4.1.0
rtl::OString aVersion( qVersion() );
@@ -76,12 +76,12 @@ extern "C" {
return NULL;
}
#endif
-
+
KDESalInstance* pInstance = new KDESalInstance( new SalYieldMutex() );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "created KDESalInstance 0x%p\n", pInstance );
#endif
-
+
// initialize SalData
KDEData *salData = new KDEData();
SetSalData(salData);
diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx
index fbbb6eeabbf1..5cb51b1e4589 100644
--- a/vcl/unx/source/app/i18n_cb.cxx
+++ b/vcl/unx/source/app/i18n_cb.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -126,6 +126,7 @@ Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch)
ptext->nLength -= howmuch;
}
else
+ // if ( to > pText->nLength )
{
// XXX this indicates an error, are we out of sync ?
fprintf(stderr, "Preedit_DeleteText( from=%i to=%i length=%i )\n",
@@ -282,12 +283,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
-sal_uInt16*
-Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uInt16>& rSalAttr )
+USHORT*
+Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<USHORT>& rSalAttr )
{
- sal_uInt16 *psalattr;
- sal_uInt16 nval;
- sal_uInt16 noldval = 0;
+ USHORT *psalattr;
+ USHORT nval;
+ USHORT noldval = 0;
XIMFeedback nfeedback;
// only work with reasonable length
@@ -297,7 +298,7 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uIn
psalattr = &rSalAttr[0];
}
else
- return (sal_uInt16*)NULL;
+ return (USHORT*)NULL;
for (int npos = 0; npos < nlength; npos++)
{
@@ -325,6 +326,13 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uIn
if (nfeedback & XIMTertiary) // same as 2ery
nval |= SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE;
+ /*
+ // visibility feedback not supported now
+ if ( (nfeedback & XIMVisibleToForward)
+ || (nfeedback & XIMVisibleToBackward)
+ || (nfeedback & XIMVisibleCenter) )
+ { }
+ */
}
// copy in list
psalattr[npos] = nval;
@@ -345,7 +353,7 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
|| pPreeditData->pFrame == NULL )
return;
- // Solaris 7 deletes the preedit buffer after commit
+ // #88564# Solaris 7 deletes the preedit buffer after commit
// since the next call to preeditstart will have the same effect just skip this.
// if (pPreeditData->eState == ePreeditStatusStartPending && call_data->text == NULL)
// return;
@@ -403,7 +411,7 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
pPreeditData->aInputEv.mnCursorPos = call_data->caret;
pPreeditData->aInputEv.maText = String (pPreeditData->aText.pUnicodeBuffer,
pPreeditData->aText.nLength);
- pPreeditData->aInputEv.mnCursorFlags = 0; // default: make cursor visible
+ pPreeditData->aInputEv.mnCursorFlags = 0; // default: make cursor visible
pPreeditData->aInputEv.mnDeltaStart = 0; // call_data->chg_first;
pPreeditData->aInputEv.mbOnlyCursor = False;
@@ -501,7 +509,8 @@ PreeditCaretCallback ( XIC, XPointer,XIMPreeditCaretCallbackStruct* )
Bool
IsControlCode(sal_Unicode nChar)
{
- if ( nChar <= 0x1F /* C0 controls */ )
+ if ( nChar <= 0x1F // C0 controls
+ /* || (0x80 <= nChar && nChar <= 0x9F) C1 controls */ )
return True;
else
return False;
@@ -515,7 +524,7 @@ CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data )
XIMUnicodeText *cbtext = (XIMUnicodeText *)call_data;
sal_Unicode *p_unicode_data = (sal_Unicode*)cbtext->string.utf16_char;
- // filter unexpected pure control events
+ // #86964# filter unexpected pure control events
if (cbtext->length == 1 && IsControlCode(p_unicode_data[0]) )
{
if( pPreeditData->pFrame )
@@ -527,13 +536,13 @@ CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data )
{
if( pPreeditData->pFrame )
{
- pPreeditData->aInputEv.mnTime = 0;
- pPreeditData->aInputEv.mpTextAttr = 0;
- pPreeditData->aInputEv.mnCursorPos = cbtext->length;
- pPreeditData->aInputEv.maText = UniString(p_unicode_data, cbtext->length);
- pPreeditData->aInputEv.mnCursorFlags = 0; // default: make cursor visible
- pPreeditData->aInputEv.mnDeltaStart = 0;
- pPreeditData->aInputEv.mbOnlyCursor = False;
+ pPreeditData->aInputEv.mnTime = 0;
+ pPreeditData->aInputEv.mpTextAttr = 0;
+ pPreeditData->aInputEv.mnCursorPos = cbtext->length;
+ pPreeditData->aInputEv.maText = UniString(p_unicode_data, cbtext->length);
+ pPreeditData->aInputEv.mnCursorFlags = 0; // default: make cursor visible
+ pPreeditData->aInputEv.mnDeltaStart = 0;
+ pPreeditData->aInputEv.mbOnlyCursor = False;
pPreeditData->pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&pPreeditData->aInputEv);
pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, (void*)NULL );
diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx
index 9b30ba6a6546..5a50b6a04937 100644
--- a/vcl/unx/source/app/i18n_ic.cxx
+++ b/vcl/unx/source/app/i18n_ic.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,15 +55,15 @@ using namespace vcl;
static void sendEmptyCommit( SalFrame* pFrame )
{
vcl::DeletionListener aDel( pFrame );
-
+
SalExtTextInputEvent aEmptyEv;
- aEmptyEv.mnTime = 0;
- aEmptyEv.mpTextAttr = 0;
- aEmptyEv.maText = String();
- aEmptyEv.mnCursorPos = 0;
- aEmptyEv.mnCursorFlags = 0;
- aEmptyEv.mnDeltaStart = 0;
- aEmptyEv.mbOnlyCursor = False;
+ aEmptyEv.mnTime = 0;
+ aEmptyEv.mpTextAttr = 0;
+ aEmptyEv.maText = String();
+ aEmptyEv.mnCursorPos = 0;
+ aEmptyEv.mnCursorFlags = 0;
+ aEmptyEv.mnDeltaStart = 0;
+ aEmptyEv.mbOnlyCursor = False;
pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, (void*)&aEmptyEv );
if( ! aDel.isDeleted() )
pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL );
@@ -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 = sal_False;
+ maClientData.aInputEv.mbOnlyCursor = FALSE;
SalI18N_InputMethod *pInputMethod;
pInputMethod = GetX11SalData()->GetDisplay()->GetInputMethod();
@@ -334,7 +334,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
if ( mnPreeditStyle != XIMPreeditNone )
{
-#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || defined DRAGONFLY
+#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD
if ( mpPreeditAttributes != NULL )
#endif
mpAttributes = XVaAddToNestedList( mpAttributes,
@@ -342,7 +342,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
}
if ( mnStatusStyle != XIMStatusNone )
{
-#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || defined DRAGONFLY
+#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD
if ( mpStatusAttributes != NULL )
#endif
mpAttributes = XVaAddToNestedList( mpAttributes,
@@ -559,14 +559,14 @@ SalI18N_InputContext::IsSupportedIMStyle( XIMStyle nStyle ) const
Bool
SalI18N_InputContext::SupportInputMethodStyle( XIMStyles *pIMStyles )
{
+ int nBestScore = 0;
+ int nActualScore = 0;
+
mnPreeditStyle = 0;
mnStatusStyle = 0;
if ( pIMStyles != NULL )
{
- int nBestScore = 0;
- int nActualScore = 0;
-
// check whether the XIM supports one of the desired styles
// only a single preedit and a single status style must occure
// in a inpuut method style. Hideki said so, so i trust him
@@ -682,10 +682,10 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame )
if ( mbUseable && (maContext != NULL) )
{
maClientData.pFrame = pFocusFrame;
-
- const SystemEnvData* pEnv = pFocusFrame->GetSystemData();
- XLIB_Window aClientWindow = pEnv->aShellWindow;
- XLIB_Window aFocusWindow = pEnv->aWindow;
+
+ const SystemEnvData* pEnv = pFocusFrame->GetSystemData();
+ XLIB_Window aClientWindow = pEnv->aShellWindow;
+ XLIB_Window aFocusWindow = pEnv->aWindow;
XSetICValues( maContext,
XNFocusWindow, aFocusWindow,
@@ -698,7 +698,7 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame )
// begin preedit again
GetX11SalData()->GetDisplay()->SendInternalEvent( pFocusFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
}
-
+
XSetICFocus( maContext );
}
}
@@ -760,7 +760,7 @@ SalI18N_InputContext::SetLanguage(LanguageType)
}
void
-SalI18N_InputContext::EndExtTextInput( sal_uInt16 /*nFlags*/ )
+SalI18N_InputContext::EndExtTextInput( USHORT /*nFlags*/ )
{
if ( mbUseable && (maContext != NULL) && maClientData.pFrame )
{
diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx
index 32233cfb748c..580a2515bed1 100644
--- a/vcl/unx/source/app/i18n_im.cxx
+++ b/vcl/unx/source/app/i18n_im.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -217,10 +217,10 @@ IsXWindowCompatibleLocale( const char* p_locale )
return True;
}
-// Set the operating system locale prior to trying to open an
+// Set the operating system locale prior to trying to open an
// XIM InputMethod.
// Handle the cases where the current locale is either not supported by the
-// operating system (LANG=gaga) or by the XWindow system (LANG=aa_ER@saaho)
+// operating system (LANG=gaga) or by the XWindow system (LANG=aa_ER@saaho)
// by providing a fallback.
// Upgrade "C" or "POSIX" to "en_US" locale to allow umlauts and accents
// see i8988, i9188, i8930, i16318
@@ -251,7 +251,7 @@ SalI18N_InputMethod::SetLocale( const char* pLocale )
mbUseable = False;
}
}
-
+
// must not fail if mbUseable since XSupportsLocale() asserts success
if ( mbUseable && XSetLocaleModifiers("") == NULL )
{
@@ -317,15 +317,15 @@ GetMethodName( XIMStyle nStyle, char *pBuf, int nBufSize)
StyleName *pDescPtr;
static const StyleName pDescription[] = {
- { XIMPreeditArea, "PreeditArea ", sizeof("PreeditArea ") },
+ { XIMPreeditArea, "PreeditArea ", sizeof("PreeditArea ") },
{ XIMPreeditCallbacks, "PreeditCallbacks ",sizeof("PreeditCallbacks ")},
{ XIMPreeditPosition, "PreeditPosition ", sizeof("PreeditPosition ") },
{ XIMPreeditNothing, "PreeditNothing ", sizeof("PreeditNothing ") },
- { XIMPreeditNone, "PreeditNone ", sizeof("PreeditNone ") },
- { XIMStatusArea, "StatusArea ", sizeof("StatusArea ") },
+ { XIMPreeditNone, "PreeditNone ", sizeof("PreeditNone ") },
+ { XIMStatusArea, "StatusArea ", sizeof("StatusArea ") },
{ XIMStatusCallbacks, "StatusCallbacks ", sizeof("StatusCallbacks ") },
- { XIMStatusNothing, "StatusNothing ", sizeof("StatusNothing ") },
- { XIMStatusNone, "StatusNone ", sizeof("StatusNone ") },
+ { XIMStatusNothing, "StatusNothing ", sizeof("StatusNothing ") },
+ { XIMStatusNone, "StatusNone ", sizeof("StatusNone ") },
{ 0, "NULL", 0 }
};
@@ -459,7 +459,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
fprintf(stderr, "input method creation failed\n");
#endif
- maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback;
+ maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback;
maDestroyCallback.client_data = (XPointer)this;
if (mbUseable && maMethod != NULL)
XSetIMValues(maMethod, XNDestroyCallback, &maDestroyCallback, NULL);
@@ -472,7 +472,7 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
//
Bool
-SalI18N_InputMethod::FilterEvent( XEvent *pEvent, XLIB_Window window )
+SalI18N_InputMethod::FilterEvent( XEvent *pEvent, XLIB_Window window )
{
if (!mbUseable)
return False;
@@ -532,9 +532,9 @@ InputMethod_HasPendingEvent(int nFileDescriptor, void *pData)
struct pollfd aFileDescriptor;
#ifdef SOLARIS
- nfds_t nNumDescriptor = 1;
+ nfds_t nNumDescriptor = 1;
#else
- unsigned int nNumDescriptor = 1;
+ unsigned int nNumDescriptor = 1;
#endif
aFileDescriptor.fd = nFileDescriptor;
aFileDescriptor.events = POLLRDNORM;
diff --git a/vcl/unx/source/app/i18n_keysym.cxx b/vcl/unx/source/app/i18n_keysym.cxx
index 985448f3eb8d..3c060e4fc30a 100644
--- a/vcl/unx/source/app/i18n_keysym.cxx
+++ b/vcl/unx/source/app/i18n_keysym.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,18 +34,18 @@
#include <i18n_keysym.hxx>
-// convert keysyms to unicode
+// convert keysyms to unicode
// for all keysyms with byte1 and byte2 equal zero, and of course only for
// keysyms that have a unicode counterpart
typedef const sal_Unicode unicode_t;
-typedef struct {
+typedef struct {
const int first; const int last;
- unicode_t *map;
+ unicode_t *map;
} keymap_t;
-// Latin-1 Byte 3 = 0x00
-unicode_t keymap00_map[] = {
+// Latin-1 Byte 3 = 0x00
+unicode_t keymap00_map[] = {
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
@@ -73,11 +73,11 @@ unicode_t keymap00_map[] = {
0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff };
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff };
const keymap_t keymap00 = { 32, 255, keymap00_map };
-// Latin-2 Byte 3 = 0x01
-unicode_t keymap01_map[] = {
+// Latin-2 Byte 3 = 0x01
+unicode_t keymap01_map[] = {
0x0104, 0x02d8, 0x0141, 0x0000, 0x013d, 0x015a, 0x0000, 0x0000,
0x0160, 0x015e, 0x0164, 0x0179, 0x0000, 0x017d, 0x017b, 0x0000,
0x0105, 0x02db, 0x0142, 0x0000, 0x013e, 0x015b, 0x02c7, 0x0000,
@@ -89,11 +89,11 @@ unicode_t keymap01_map[] = {
0x0000, 0x0000, 0x0103, 0x0000, 0x013a, 0x0107, 0x0000, 0x010d,
0x0000, 0x0119, 0x0000, 0x011b, 0x0000, 0x0000, 0x010f, 0x0111,
0x0144, 0x0148, 0x0000, 0x0000, 0x0151, 0x0000, 0x0000, 0x0159,
- 0x016f, 0x0000, 0x0171, 0x0000, 0x0000, 0x0163, 0x02d9 };
+ 0x016f, 0x0000, 0x0171, 0x0000, 0x0000, 0x0163, 0x02d9 };
const keymap_t keymap01 = { 161, 255, keymap01_map };
-// Latin-3 Byte 3 = 0x02
-unicode_t keymap02_map[] = {
+// Latin-3 Byte 3 = 0x02
+unicode_t keymap02_map[] = {
0x0126, 0x0000, 0x0000, 0x0000, 0x0000, 0x0124, 0x0000, 0x0000,
0x0130, 0x0000, 0x011e, 0x0134, 0x0000, 0x0000, 0x0000, 0x0000,
0x0127, 0x0000, 0x0000, 0x0000, 0x0000, 0x0125, 0x0000, 0x0000,
@@ -105,11 +105,11 @@ unicode_t keymap02_map[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x010b, 0x0109, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0121, 0x0000, 0x0000, 0x011d,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x016d, 0x015d };
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x016d, 0x015d };
const keymap_t keymap02 = { 161, 254, keymap02_map };
-// Latin-4 Byte 3 = 0x03
-unicode_t keymap03_map[] = {
+// Latin-4 Byte 3 = 0x03
+unicode_t keymap03_map[] = {
0x0138, 0x0156, 0x0000, 0x0128, 0x013b, 0x0000, 0x0000, 0x0000,
0x0112, 0x0122, 0x0166, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0157, 0x0000, 0x0129, 0x013c, 0x0000, 0x0000, 0x0000,
@@ -121,11 +121,11 @@ unicode_t keymap03_map[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x012f, 0x0000, 0x0000,
0x0000, 0x0000, 0x0117, 0x0000, 0x0000, 0x012b, 0x0000, 0x0146,
0x014d, 0x0137, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0173,
- 0x0000, 0x0000, 0x0000, 0x0169, 0x016b };
+ 0x0000, 0x0000, 0x0000, 0x0169, 0x016b };
const keymap_t keymap03 = { 162, 254, keymap03_map };
-// Kana Byte 3 = 0x04
-unicode_t keymap04_map[] = {
+// Kana Byte 3 = 0x04
+unicode_t keymap04_map[] = {
0x203e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -138,11 +138,11 @@ unicode_t keymap04_map[] = {
0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5, 0x30d8,
0x30db, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e4, 0x30e6,
0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ef, 0x30f3,
- 0x309b, 0x309c };
+ 0x309b, 0x309c };
const keymap_t keymap04 = { 126, 223, keymap04_map };
-// Arabic Byte 3 = 0x05
-unicode_t keymap05_map[] = {
+// Arabic Byte 3 = 0x05
+unicode_t keymap05_map[] = {
0x060c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x061b,
0x0000, 0x0000, 0x0000, 0x061f, 0x0000, 0x0621, 0x0622, 0x0623,
@@ -151,11 +151,11 @@ unicode_t keymap05_map[] = {
0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063a, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0640, 0x0641, 0x0642, 0x0643,
0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064a, 0x064b,
- 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652 };
+ 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652 };
const keymap_t keymap05 = { 172, 242, keymap05_map };
-// Cyrillic Byte 3 = 0x06
-unicode_t keymap06_map[] = {
+// Cyrillic Byte 3 = 0x06
+unicode_t keymap06_map[] = {
0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458,
0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f, 0x2116,
0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408,
@@ -167,11 +167,11 @@ unicode_t keymap06_map[] = {
0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425,
0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042c,
- 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a };
+ 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a };
const keymap_t keymap06 = { 161, 255, keymap06_map };
-// Greek Byte 3 = 0x07
-unicode_t keymap07_map[] = {
+// Greek Byte 3 = 0x07
+unicode_t keymap07_map[] = {
0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c, 0x038e,
0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015, 0x0000,
0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc, 0x03cd,
@@ -183,11 +183,11 @@ unicode_t keymap07_map[] = {
0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8,
0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0,
0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8,
- 0x03c9 };
+ 0x03c9 };
const keymap_t keymap07 = { 161, 249, keymap07_map };
-// Technical Byte 3 = 0x08
-unicode_t keymap08_map[] = {
+// Technical Byte 3 = 0x08
+unicode_t keymap08_map[] = {
0x23b7, 0x250c, 0x2500, 0x2320, 0x2321, 0x2502, 0x23a1, 0x23a3,
0x23a4, 0x23a6, 0x239b, 0x239d, 0x239e, 0x23a0, 0x23a8, 0x23ac,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -199,19 +199,19 @@ unicode_t keymap08_map[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193 };
+ 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193 };
const keymap_t keymap08 = { 161, 254, keymap08_map };
-// Special Byte 3 = 0x09
-unicode_t keymap09_map[] = {
+// Special Byte 3 = 0x09
+unicode_t keymap09_map[] = {
0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x0000, 0x0000,
0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba,
0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c,
- 0x2502 };
+ 0x2502 };
const keymap_t keymap09 = { 224, 248, keymap09_map };
-// Publishing Byte 3 = 0x0a = 10
-unicode_t keymap10_map[] = {
+// Publishing Byte 3 = 0x0a = 10
+unicode_t keymap10_map[] = {
0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009, 0x200a,
0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025, 0x2153,
0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a, 0x2105,
@@ -223,11 +223,11 @@ unicode_t keymap10_map[] = {
0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa, 0x25b2,
0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000, 0x2720,
0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642, 0x2640,
- 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e };
+ 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e };
const keymap_t keymap10 = { 161, 254, keymap10_map };
-// APL Byte 3 = 0x0b = 11
-unicode_t keymap11_map[] = {
+// APL Byte 3 = 0x0b = 11
+unicode_t keymap11_map[] = {
0x003c, 0x0000, 0x0000, 0x003e, 0x0000, 0x2228, 0x2227, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -239,19 +239,19 @@ unicode_t keymap11_map[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x22a3 };
+ 0x0000, 0x22a3 };
const keymap_t keymap11 = { 163, 252, keymap11_map };
-// Hebrew Byte 3 = 0x0c = 12
-unicode_t keymap12_map[] = {
+// Hebrew Byte 3 = 0x0c = 12
+unicode_t keymap12_map[] = {
0x2017, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6,
0x05d7, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de,
0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6,
- 0x05e7, 0x05e8, 0x05e9, 0x05ea };
+ 0x05e7, 0x05e8, 0x05e9, 0x05ea };
const keymap_t keymap12 = { 223, 250, keymap12_map };
-// Thai Byte 3 = 0x0d = 13
-unicode_t keymap13_map[] = {
+// Thai Byte 3 = 0x0d = 13
+unicode_t keymap13_map[] = {
0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 0x0e08,
0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 0x0e10,
0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, 0x0e18,
@@ -263,11 +263,11 @@ unicode_t keymap13_map[] = {
0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, 0x0e48,
0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0000, 0x0000, 0x0e50,
0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58,
- 0x0e59 };
+ 0x0e59 };
const keymap_t keymap13 = { 161, 249, keymap13_map };
-// Korean Byte 3 = 0x0e = 14
-unicode_t keymap14_map[] = {
+// Korean Byte 3 = 0x0e = 14
+unicode_t keymap14_map[] = {
0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138,
0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, 0x3140,
0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148,
@@ -279,31 +279,31 @@ unicode_t keymap14_map[] = {
0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb, 0x11bc,
0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d, 0x3171,
0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e, 0x11eb,
- 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9 };
+ 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9 };
const keymap_t keymap14 = { 161, 255, keymap14_map };
// missing:
-// Latin-8 Byte 3 = 0x12 = 18
+// Latin-8 Byte 3 = 0x12 = 18
-// Latin-9 Byte 3 = 0x13 = 19
-unicode_t keymap19_map[] = {
- 0x0152, 0x0153, 0x0178 };
+// Latin-9 Byte 3 = 0x13 = 19
+unicode_t keymap19_map[] = {
+ 0x0152, 0x0153, 0x0178 };
const keymap_t keymap19 = { 188, 190, keymap19_map };
// missing:
-// Armenian Byte 3 = 0x14 = 20
-// Georgian Byte 3 = 0x15 = 21
-// Azeri Byte 3 = 0x16 = 22
-// Vietnamese Byte 3 = 0x1e = 30
+// Armenian Byte 3 = 0x14 = 20
+// Georgian Byte 3 = 0x15 = 21
+// Azeri Byte 3 = 0x16 = 22
+// Vietnamese Byte 3 = 0x1e = 30
-// Currency Byte 3 = 0x20 = 32
-unicode_t keymap32_map[] = {
+// Currency Byte 3 = 0x20 = 32
+unicode_t keymap32_map[] = {
0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7,
- 0x20a8, 0x0000, 0x20aa, 0x20ab, 0x20ac };
+ 0x20a8, 0x0000, 0x20aa, 0x20ab, 0x20ac };
const keymap_t keymap32 = { 160, 172, keymap32_map };
// Keyboard (Keypad mappings) Byte 3 = 0xff = 255
-unicode_t keymap255_map[] = {
+unicode_t keymap255_map[] = {
0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -311,20 +311,20 @@ unicode_t keymap255_map[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x0000, 0x0000, 0x0000, 0x003d };
+ 0x0038, 0x0039, 0x0000, 0x0000, 0x0000, 0x003d };
const keymap_t keymap255 = { 128, 189, keymap255_map };
#define INITIAL_KEYMAPS 33
const keymap_t* p_keymap[INITIAL_KEYMAPS] = {
- &keymap00, &keymap01, &keymap02, &keymap03, /* 00 -- 03 */
- &keymap04, &keymap05, &keymap06, &keymap07, /* 04 -- 07 */
- &keymap08, &keymap09, &keymap10, &keymap11, /* 08 -- 11 */
- &keymap12, &keymap13, &keymap14, (keymap_t*)NULL, /* 12 -- 15 */
- (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, &keymap19, /* 16 -- 19 */
+ &keymap00, &keymap01, &keymap02, &keymap03, /* 00 -- 03 */
+ &keymap04, &keymap05, &keymap06, &keymap07, /* 04 -- 07 */
+ &keymap08, &keymap09, &keymap10, &keymap11, /* 08 -- 11 */
+ &keymap12, &keymap13, &keymap14, (keymap_t*)NULL, /* 12 -- 15 */
+ (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, &keymap19, /* 16 -- 19 */
(keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 20 -- 23 */
(keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 24 -- 27 */
(keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, (keymap_t*)NULL, /* 28 -- 31 */
- &keymap32 /* 32 */
+ &keymap32 /* 32 */
};
sal_Unicode
diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx
index bfea280dc687..98d26e4509df 100644
--- a/vcl/unx/source/app/i18n_status.cxx
+++ b/vcl/unx/source/app/i18n_status.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,6 +56,7 @@
#include <vcl/sysdata.hxx>
using namespace vcl;
+using namespace rtl;
namespace vcl {
@@ -92,17 +93,17 @@ namespace vcl {
class XIMStatusWindow : public StatusWindow
{
- FixedText m_aStatusText;
- SalFrame* m_pLastParent;
- Size m_aWindowSize;
+ FixedText m_aStatusText;
+ SalFrame* m_pLastParent;
+ Size m_aWindowSize;
bool m_bAnchoredAtRight;
// true if the right edge (instead of the left edge) should stay at a
// fixed position when re-sizing the window
// for delayed showing
- bool m_bDelayedShow;
- I18NStatus::ShowReason m_eDelayedReason;
- sal_uLong m_nDelayedEvent;
+ bool m_bDelayedShow;
+ I18NStatus::ShowReason m_eDelayedReason;
+ ULONG m_nDelayedEvent;
// for toggling
bool m_bOn;
@@ -165,7 +166,7 @@ void XIMStatusWindow::layout()
m_aStatusText.SetPosSizePixel( Point( 1, 1 ), aControlSize );
m_aStatusText.SetFont( aFont );
- m_aStatusText.Show( sal_True );
+ m_aStatusText.Show( TRUE );
if (m_bAnchoredAtRight && IsVisible())
{
@@ -207,7 +208,7 @@ Point XIMStatusWindow::updatePosition()
if( checkLastParent() )
{
const SystemEnvData* pParentEnvData = m_pLastParent->GetSystemData();
-
+
SalExtTextInputPosEvent aPosEvent;
m_pLastParent->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void*)&aPosEvent );
int x, y;
@@ -257,7 +258,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent )
{
setText( String() );
m_pLastParent = pParent;
- Show( sal_False, SHOW_NOACTIVATE );
+ Show( FALSE, SHOW_NOACTIVATE );
}
if( IsVisible() )
{
@@ -318,9 +319,9 @@ namespace vcl {
class IIIMPStatusWindow : public StatusWindow
{
- MenuButton m_aStatusBtn;
- PopupMenu m_aMenu;
- SalFrame* m_pResetFocus;
+ MenuButton m_aStatusBtn;
+ PopupMenu m_aMenu;
+ SalFrame* m_pResetFocus;
bool m_bShow;
bool m_bOn;
@@ -359,7 +360,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
m_aStatusBtn.SetSelectHdl( LINK( this, IIIMPStatusWindow, SelectHdl ) );
m_aStatusBtn.SetPopupMenu( &m_aMenu );
- m_aStatusBtn.Show( sal_True );
+ m_aStatusBtn.Show( TRUE );
const ::std::vector< I18NStatus::ChoiceData >& rChoices( I18NStatus::get().getChoices() );
int i = 1;
@@ -384,7 +385,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
else
fprintf( stderr, "Warning: could not reposition status window since no frame\n" );
#endif
- EnableAlwaysOnTop( sal_True );
+ EnableAlwaysOnTop( TRUE );
}
IIIMPStatusWindow::~IIIMPStatusWindow()
@@ -613,7 +614,7 @@ void I18NStatus::setStatusText( const String& rText )
String aText( pBuffer );
m_pStatusWindow->setText( aText );
m_pStatusWindow->setPosition( m_pParent );
-
+
bool bVisible = true;
if( m_pParent )
{
@@ -624,7 +625,7 @@ void I18NStatus::setStatusText( const String& rText )
bVisible = false;
}
}
-
+
m_pStatusWindow->show( bVisible, contextmap );
}
}
@@ -655,8 +656,8 @@ void I18NStatus::clearChoices()
void I18NStatus::addChoice( const String& rChoice, void* pData )
{
ChoiceData aData;
- aData.pData = pData;
- aData.aString = rChoice;
+ aData.pData = pData;
+ aData.aString = rChoice;
m_aChoices.push_back( aData );
}
diff --git a/vcl/unx/source/app/i18n_wrp.cxx b/vcl/unx/source/app/i18n_wrp.cxx
index baf7e175eac5..df64a69b8a36 100644
--- a/vcl/unx/source/app/i18n_wrp.cxx
+++ b/vcl/unx/source/app/i18n_wrp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-struct XIMArg
+struct XIMArg
{
char *name;
char *value;
@@ -48,7 +48,7 @@ struct XIMArg
#include <X11/Xlibint.h>
#include "XIM.h"
-#define XIIIMP_LIB "xiiimp.so.2"
+#define XIIIMP_LIB "xiiimp.so.2"
#ifdef SOLARIS
#define XIIIMP_PATH "/usr/openwin/lib/locale/common/" XIIIMP_LIB
@@ -169,8 +169,8 @@ XvaGetArgs( va_list pInArgs, XIMArg *pOutArgs )
#ifdef __cplusplus
extern "C"
#endif
-XIM
-XvaOpenIM(Display *display, XrmDatabase rdb,
+XIM
+XvaOpenIM(Display *display, XrmDatabase rdb,
char *res_name, char *res_class, ...)
{
XIM xim = (XIM)0;
@@ -180,7 +180,7 @@ XvaOpenIM(Display *display, XrmDatabase rdb,
/*
* so count the stuff dangling here
*/
-
+
#if defined(SOLARIS) && !defined(__GNUC__)
va_start(variable);
#else
@@ -189,8 +189,8 @@ XvaOpenIM(Display *display, XrmDatabase rdb,
total_count = XvaCountArgs(variable);
va_end(variable);
- if (total_count > 0)
- {
+ if (total_count > 0)
+ {
/* call a new open IM method */
XIMArg* args = (XIMArg*)alloca( (total_count + 1) * sizeof(XIMArg) );
@@ -206,23 +206,23 @@ XvaOpenIM(Display *display, XrmDatabase rdb,
XvaGetArgs( variable, args );
va_end(variable);
- if (!g_dlmodule)
+ if (!g_dlmodule)
{
g_dlmodule = dlopen(XIIIMP_LIB, RTLD_LAZY);
if(!g_dlmodule)
{
g_dlmodule = dlopen(XIIIMP_PATH, RTLD_LAZY);
- if (!g_dlmodule)
+ if (!g_dlmodule)
goto legacy_XIM;
}
g_open_im = (OpenFunction)(long)dlsym(g_dlmodule, "__XOpenIM");
- if (!g_open_im)
+ if (!g_open_im)
goto legacy_XIM;
xim = (*g_open_im)(display, (XrmDatabase)rdb,
(char*)res_name, (char *)res_class, (XIMArg*)args);
- }
- else
+ }
+ else
{
goto legacy_XIM;
}
@@ -230,10 +230,10 @@ XvaOpenIM(Display *display, XrmDatabase rdb,
// in #if to prevent warning "warning: label 'legacy_XIM' defined but not used"
legacy_XIM:
-
+
if (!xim)
xim = XOpenIM(display, rdb, res_name, res_class);
-
+
return xim;
}
@@ -245,8 +245,8 @@ Status XvaCloseIM(XIM)
{
Status s = False;
- if (!g_dlmodule)
- {
+ if (!g_dlmodule)
+ {
/* assuming one XvaOpenIM call */
dlclose(g_dlmodule);
g_dlmodule = (void*)0;
diff --git a/vcl/unx/source/app/i18n_xkb.cxx b/vcl/unx/source/app/i18n_xkb.cxx
index bb62e248b1d7..830290405f9d 100644
--- a/vcl/unx/source/app/i18n_xkb.cxx
+++ b/vcl/unx/source/app/i18n_xkb.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,8 +50,8 @@ pDisplay
// allow user to set the default keyboard group idx or to disable the usage
// of x keyboard extension at all:
- // setenv SAL_XKEYBOARDGROUP disables keyboard extension
- // setenv SAL_XKEYBOARDGROUP 2 sets the keyboard group index to 2
+ // setenv SAL_XKEYBOARDGROUP disables keyboard extension
+ // setenv SAL_XKEYBOARDGROUP 2 sets the keyboard group index to 2
// keyboard group index must be in [1,4], may be specified in hex or decimal
static char *pUseKeyboardExtension = getenv( "SAL_XKEYBOARDGROUP" );
if ( pUseKeyboardExtension != NULL )
@@ -150,7 +150,7 @@ SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32
nShiftState &= ShiftMask;
- KeySym nKeySymbol;
+ KeySym nKeySymbol;
nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState );
return nKeySymbol;
diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx
index 3ea61eb86bdc..023848adc510 100644
--- a/vcl/unx/source/app/keysymnames.cxx
+++ b/vcl/unx/source/app/keysymnames.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,16 +40,16 @@
#include <sal/macros.h>
#if !defined (SunXK_Undo)
-#define SunXK_Undo 0x0000FF65 // XK_Undo
-#define SunXK_Again 0x0000FF66 // XK_Redo
-#define SunXK_Find 0x0000FF68 // XK_Find
-#define SunXK_Stop 0x0000FF69 // XK_Cancel
-#define SunXK_Props 0x1005FF70
-#define SunXK_Front 0x1005FF71
-#define SunXK_Copy 0x1005FF72
-#define SunXK_Open 0x1005FF73
-#define SunXK_Paste 0x1005FF74
-#define SunXK_Cut 0x1005FF75
+#define SunXK_Undo 0x0000FF65 // XK_Undo
+#define SunXK_Again 0x0000FF66 // XK_Redo
+#define SunXK_Find 0x0000FF68 // XK_Find
+#define SunXK_Stop 0x0000FF69 // XK_Cancel
+#define SunXK_Props 0x1005FF70
+#define SunXK_Front 0x1005FF71
+#define SunXK_Copy 0x1005FF72
+#define SunXK_Open 0x1005FF73
+#define SunXK_Paste 0x1005FF74
+#define SunXK_Cut 0x1005FF75
#endif
#ifdef SOLARIS
@@ -70,17 +70,17 @@ namespace vcl_sal {
struct KeysymNameReplacement
{
- KeySym aSymbol;
- const char* pName;
+ KeySym aSymbol;
+ const char* pName;
};
struct KeyboardReplacements
{
- const char* pKeyboardName;
- const KeysymNameReplacement* pReplacements;
- int nReplacements;
+ const char* pKeyboardName;
+ const KeysymNameReplacement* pReplacements;
+ int nReplacements;
};
-
+
// ====================================================================
//
// CAUTION CAUTION CAUTION
@@ -93,7 +93,7 @@ namespace vcl_sal {
{
{ XK_Control_L, "Ctrl" },
{ XK_Control_R, "Ctrl" },
- { XK_Escape, "Esc" },
+ { XK_Escape, "Esc" },
{ XK_space, "Space" },
{ XK_minus, "-" },
{ XK_plus, "+" }
@@ -107,7 +107,7 @@ namespace vcl_sal {
{ XK_Left, "Sol" },
{ XK_Up, "Yukarı" },
{ XK_Down, "Aşağı" },
- { XK_space, "BoÅŸluk" }
+ { XK_space, "BoÅŸluk" }
};
static const struct KeysymNameReplacement aImplReplacements_Russian[] =
@@ -116,7 +116,7 @@ namespace vcl_sal {
{ XK_Left, "Влево" },
{ XK_Up, "Вверх" },
{ XK_Down, "Вниз" },
- { XK_space, "Пробел" }
+ { XK_space, "Пробел" }
};
static const struct KeysymNameReplacement aImplReplacements_German[] =
@@ -450,7 +450,7 @@ namespace vcl_sal {
#ifdef SOLARIS
typedef struct {
- int n_layout;
+ int n_layout;
const char* p_description;
} keyboard_layout;
diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx
index eb266485ce03..ef4f5de9b583 100644
--- a/vcl/unx/source/app/randrwrapper.cxx
+++ b/vcl/unx/source/app/randrwrapper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@ namespace
class RandRWrapper
{
oslModule m_pRandRLib;
-
+
// function pointers
Bool(*m_pXRRQueryExtension)(Display*,int*,int*);
Status(*m_pXRRQueryVersion)(Display*,int*,int*);
@@ -55,17 +55,17 @@ class RandRWrapper
XRRScreenSize*(*m_pXRRConfigSizes)(XRRScreenConfiguration*,int*);
SizeID(*m_pXRRConfigCurrentConfiguration)(XRRScreenConfiguration*,Rotation*);
int(*m_pXRRRootToScreen)(Display*, XLIB_Window);
-
+
bool m_bValid;
-
+
void initFromModule();
-
+
RandRWrapper(Display*);
~RandRWrapper();
public:
static RandRWrapper& get(Display*);
static void releaseWrapper();
-
+
Bool XRRQueryExtension(Display* i_pDisp, int* o_event_base, int* o_error_base )
{
Bool bRet = False;
@@ -125,7 +125,7 @@ void RandRWrapper::initFromModule()
m_pXRRConfigSizes = (XRRScreenSize*(*)(XRRScreenConfiguration*,int*))osl_getAsciiFunctionSymbol( m_pRandRLib, "XRRConfigSizes" );
m_pXRRConfigCurrentConfiguration = (SizeID(*)(XRRScreenConfiguration*,Rotation*))osl_getAsciiFunctionSymbol( m_pRandRLib, "XRRConfigCurrentConfiguration" );
m_pXRRRootToScreen = (int(*)(Display*,XLIB_Window))osl_getAsciiFunctionSymbol( m_pRandRLib, "XRRRootToScreen" );
-
+
m_bValid = m_pXRRQueryExtension &&
m_pXRRQueryVersion &&
m_pXRRGetScreenInfo &&
@@ -201,12 +201,12 @@ void RandRWrapper::releaseWrapper()
class RandRWrapper
{
bool m_bValid;
-
+
RandRWrapper(Display*);
public:
static RandRWrapper& get(Display*);
static void releaseWrapper();
-
+
Bool XRRQueryExtension(Display* i_pDisp, int* o_event_base, int* o_error_base )
{
Bool bRet = False;
@@ -282,7 +282,7 @@ void RandRWrapper::releaseWrapper()
} // namespace
#endif
-
+
#include "saldisp.hxx"
#include "salframe.h"
#if OSL_DEBUG_LEVEL > 1
@@ -306,7 +306,7 @@ void SalDisplay::DeInitRandR()
RandRWrapper::releaseWrapper();
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "SalDisplay::DeInitRandR()\n" );
-#endif
+#endif
#endif
}
@@ -331,18 +331,18 @@ int SalDisplay::processRandREvent( XEvent* pEvent )
int nSizes = 0;
Rotation nRot = 0;
SizeID nId = 0;
-
+
pConfig = pWrapper->XRRGetScreenInfo( GetDisplay(), m_aScreens[i].m_aRoot );
nId = pWrapper->XRRConfigCurrentConfiguration( pConfig, &nRot );
pSizes = pWrapper->XRRConfigSizes( pConfig, &nSizes );
XRRScreenSize *pTargetSize = pSizes + nId;
-
+
bNotify = bNotify ||
m_aScreens[i].m_aSize.Width() != pTargetSize->width ||
m_aScreens[i].m_aSize.Height() != pTargetSize->height;
-
+
m_aScreens[i].m_aSize = Size( pTargetSize->width, pTargetSize->height );
-
+
pWrapper->XRRFreeScreenConfigInfo( pConfig );
#if OSL_DEBUG_LEVEL > 1
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index d8d54ddcc081..38408441fd70 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -91,7 +91,7 @@
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
static const struct timeval noyield__ = { 0, 0 };
-static const struct timeval yield__ = { 0, 10000 };
+static const struct timeval yield__ = { 0, 10000 };
static const char* XRequest[] = {
// see /usr/lib/X11/XErrorDB, /usr/openwin/lib/XErrorDB ...
@@ -235,7 +235,7 @@ int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent *pEvent )
}
int X11SalData::XIOErrorHdl( Display * )
-{
+{
/* #106197# hack: until a real shutdown procedure exists
* _exit ASAP
*/
@@ -264,14 +264,14 @@ int X11SalData::XIOErrorHdl( Display * )
X11SalData::X11SalData()
{
- bNoExceptions_ = !!getenv( "SAL_NOSEGV" );
+ bNoExceptions_ = !!getenv( "SAL_NOSEGV" );
- pXLib_ = NULL;
- m_pSalDisplay = NULL;
- m_pInstance = NULL;
- m_pPlugin = NULL;
+ pXLib_ = NULL;
+ m_pSalDisplay = NULL;
+ m_pInstance = NULL;
+ m_pPlugin = NULL;
- hMainThread_ = pthread_self();
+ hMainThread_ = pthread_self();
}
const rtl::OUString& X11SalData::GetLocalHostName()
@@ -289,9 +289,9 @@ X11SalData::~X11SalData()
void X11SalData::DeleteDisplay()
{
delete m_pSalDisplay;
- m_pSalDisplay = NULL;
+ m_pSalDisplay = NULL;
delete pXLib_;
- pXLib_ = NULL;
+ pXLib_ = NULL;
}
void X11SalData::Init()
@@ -312,11 +312,11 @@ void X11SalData::deInitNWF( void )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SalXLib::SalXLib()
{
- m_aTimeout.tv_sec = 0;
- m_aTimeout.tv_usec = 0;
- m_nTimeoutMS = 0;
+ m_aTimeout.tv_sec = 0;
+ m_aTimeout.tv_usec = 0;
+ m_nTimeoutMS = 0;
- nFDs_ = 0;
+ nFDs_ = 0;
FD_ZERO( &aReadFDS_ );
FD_ZERO( &aExceptionFDS_ );
@@ -355,8 +355,8 @@ SalXLib::SalXLib()
nFDs_ = m_pTimeoutFDS[0] + 1;
}
- m_bHaveSystemChildFrames = false;
- m_aOrigXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
+ m_bHaveSystemChildFrames = false;
+ m_aOrigXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) );
}
@@ -365,7 +365,7 @@ SalXLib::~SalXLib()
// close 'wakeup' pipe.
close (m_pTimeoutFDS[0]);
close (m_pTimeoutFDS[1]);
-
+
PopXErrorLevel();
XSetIOErrorHandler (m_aOrigXIOErrorHandler);
}
@@ -410,10 +410,10 @@ void SalXLib::Init()
sal_uInt32 nParams = osl_getCommandArgCount();
rtl::OUString aParam;
rtl::OString aDisplay;
- for (sal_uInt16 i=0; i<nParams; i++)
+ for (USHORT i=0; i<nParams; i++)
{
osl_getCommandArg(i, &aParam.pData);
- if (aParam.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("-display")))
+ if (aParam.equalsAscii("-display"))
{
osl_getCommandArg(i+1, &aParam.pData);
aDisplay = rtl::OUStringToOString(
@@ -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;
}
@@ -453,9 +453,9 @@ void SalXLib::Init()
aProgramSystemPath,
osl_getThreadTextEncoding() );
std::fprintf( stderr, "%s X11 error: Can't open display: %s\n",
- aProgramName.getStr(), aDisplay.getStr());
- std::fprintf( stderr, " Set DISPLAY environment variable, use -display option\n");
- std::fprintf( stderr, " or check permissions of your X-Server\n");
+ aProgramName.getStr(), aDisplay.getStr());
+ std::fprintf( stderr, " Set DISPLAY environment variable, use -display option\n");
+ std::fprintf( stderr, " or check permissions of your X-Server\n");
std::fprintf( stderr, " (See \"man X\" resp. \"man xhost\" for details)\n");
std::fflush( stderr );
exit(0);
@@ -471,7 +471,7 @@ void SalXLib::Init()
SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
XSync( pDisp, False );
- pKbdExtension->UseExtension( ! HasXErrorOccurred() );
+ pKbdExtension->UseExtension( ! HasXErrorOccured() );
PopXErrorLevel();
pSalDisplay->SetKbdExtension( pKbdExtension );
@@ -523,7 +523,7 @@ static void PrintXError( Display *pDisplay, XErrorEvent *pEvent )
std::fprintf( stderr, "These errors are reported asynchronously,\n");
std::fprintf( stderr, "set environment variable SAL_SYNCHRONIZE to 1 to help debugging\n");
}
-
+
std::fflush( stdout );
std::fflush( stderr );
}
@@ -541,7 +541,7 @@ void SalXLib::XError( Display *pDisplay, XErrorEvent *pEvent )
static Bool bOnce = False;
if ( !bOnce )
{
- std::fprintf(stderr, "X-Error occurred in a request for X_OpenFont\n");
+ std::fprintf(stderr, "X-Error occured in a request for X_OpenFont\n");
EmitFontpathWarning();
bOnce = True ;
@@ -567,13 +567,13 @@ void SalXLib::XError( Display *pDisplay, XErrorEvent *pEvent )
oslSignalAction eToDo = osl_raiseSignal (OSL_SIGNAL_USER_X11SUBSYSTEMERROR, NULL);
switch (eToDo)
{
- case osl_Signal_ActIgnore :
+ case osl_Signal_ActIgnore :
return;
- case osl_Signal_ActAbortApp :
+ case osl_Signal_ActAbortApp :
abort();
- case osl_Signal_ActKillApp :
+ case osl_Signal_ActKillApp :
exit(0);
- case osl_Signal_ActCallNextHdl :
+ case osl_Signal_ActCallNextHdl :
break;
default :
break;
@@ -586,16 +586,16 @@ void SalXLib::XError( Display *pDisplay, XErrorEvent *pEvent )
struct YieldEntry
{
- YieldEntry* next; // pointer to next entry
- int fd; // file descriptor for reading
- void* data; // data for predicate and callback
- YieldFunc pending; // predicate (determins pending events)
- YieldFunc queued; // read and queue up events
- YieldFunc handle; // handle pending events
-
- inline int HasPendingEvent() const { return pending( fd, data ); }
- inline int IsEventQueued() const { return queued( fd, data ); }
- inline void HandleNextEvent() const { handle( fd, data ); }
+ YieldEntry* next; // pointer to next entry
+ int fd; // file descriptor for reading
+ void* data; // data for predicate and callback
+ YieldFunc pending; // predicate (determins pending events)
+ YieldFunc queued; // read and queue up events
+ YieldFunc handle; // handle pending events
+
+ inline int HasPendingEvent() const { return pending( fd, data ); }
+ inline int IsEventQueued() const { return queued( fd, data ); }
+ inline void HandleNextEvent() const { handle( fd, data ); }
};
#define MAX_NUM_DESCRIPTORS 128
@@ -603,18 +603,18 @@ struct YieldEntry
static YieldEntry yieldTable[ MAX_NUM_DESCRIPTORS ];
void SalXLib::Insert( int nFD, void* data,
- YieldFunc pending,
- YieldFunc queued,
- YieldFunc handle )
+ YieldFunc pending,
+ YieldFunc queued,
+ YieldFunc handle )
{
DBG_ASSERT( nFD, "can not insert stdin descriptor" );
DBG_ASSERT( !yieldTable[nFD].fd, "SalXLib::Insert fd twice" );
- yieldTable[nFD].fd = nFD;
- yieldTable[nFD].data = data;
+ yieldTable[nFD].fd = nFD;
+ yieldTable[nFD].data = data;
yieldTable[nFD].pending = pending;
- yieldTable[nFD].queued = queued;
- yieldTable[nFD].handle = handle;
+ yieldTable[nFD].queued = queued;
+ yieldTable[nFD].handle = handle;
FD_SET( nFD, &aReadFDS_ );
FD_SET( nFD, &aExceptionFDS_ );
@@ -689,7 +689,7 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
// #63862# da jetzt alle user-events ueber die interne
// queue kommen, wird die Kontrolle analog zum select
// gesteuerten Zweig einmal bei bWait abgegeben
-
+
/* #i9277# do not reschedule since performance gets down the
the drain under heavy load
YieldMutexReleaser aReleaser;
@@ -866,7 +866,7 @@ rtl::OString X11SalData::getFrameResName( SalExtStyle nStyle )
aBuf.append( getFrameResName() );
if( (nStyle & SAL_FRAME_EXT_STYLE_DOCUMENT) )
aBuf.append( ".DocumentWindow" );
-
+
return aBuf.makeStringAndClear();
}
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index f3527ff3cead..69ab594ec387 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -97,10 +97,9 @@ Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*);
#include <osl/socket.h>
#include <poll.h>
+using namespace rtl;
using namespace vcl_sal;
-using ::rtl::OUString;
-
// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#define PSEUDOCOLOR12
@@ -213,7 +212,7 @@ static int sal_significantBits( Pixel nMask )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static sal_Bool sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
+static BOOL sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
{
int nInfos;
XVisualInfo aTemplate;
@@ -223,25 +222,25 @@ static sal_Bool sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI
pInfos = XGetVisualInfo( pDisplay, VisualIDMask, &aTemplate, &nInfos );
if( !pInfos )
- return sal_False;
+ return FALSE;
rVI = *pInfos;
XFree( pInfos );
DBG_ASSERT( rVI.visualid == nVID,
"sal_GetVisualInfo: could not get correct visual by visualId" );
- return sal_True;
+ return TRUE;
}
// ---------------------------------------------------------------------------
// check wether displaystring is in format N.M or N. or just N
// with N and M beeing natural numbers
-static sal_Bool
+static BOOL
sal_IsDisplayNumber( const char *pDisplayString )
{
if ( ! isdigit(*pDisplayString) )
- return sal_False;
+ return FALSE;
while ( isdigit(*(++pDisplayString)) )
; /* do nothing */
@@ -255,12 +254,12 @@ sal_IsDisplayNumber( const char *pDisplayString )
}
// check whether host1 and host2 point to the same ip address
-static sal_Bool
+static BOOL
sal_EqualHosts( const OUString& Host1, const OUString& Host2)
{
oslSocketAddr pHostAddr1;
oslSocketAddr pHostAddr2;
- sal_Bool bEqualAddress = sal_False;
+ BOOL bEqualAddress = FALSE;
if ( Host1.toChar() >= '0' && Host1.toChar() <= '9' )
pHostAddr1 = osl_createInetSocketAddr( Host1.pData, 0 );
@@ -273,7 +272,7 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
pHostAddr2 = osl_resolveHostname( Host2.pData );
if( pHostAddr1 && pHostAddr2 )
- bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? sal_True : sal_False;
+ bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? TRUE : FALSE;
if( pHostAddr1 )
osl_destroySocketAddr( pHostAddr1 );
@@ -283,40 +282,40 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
return bEqualAddress;
}
-static sal_Bool
+static BOOL
sal_IsLocalDisplay( Display *pDisplay )
{
const char *pDisplayString = DisplayString( pDisplay );
// no string, no idea
if ( pDisplayString == NULL || pDisplayString[ 0 ] == '\0')
- return sal_False;
+ return FALSE;
// check for ":x.y"
if ( pDisplayString[ 0 ] == ':' )
return sal_IsDisplayNumber( pDisplayString + 1 );
// check for fixed token which all mean localhost:x.y
- const char pLocal[] = "localhost:";
- const int nLocalLen = sizeof(pLocal) - 1;
+ const char pLocal[] = "localhost:";
+ const int nLocalLen = sizeof(pLocal) - 1;
if ( strncmp(pDisplayString, pLocal, nLocalLen) == 0 )
return sal_IsDisplayNumber( pDisplayString + nLocalLen );
- const char pUnix[] = "unix:";
- const int nUnixLen = sizeof(pUnix) - 1;
- if ( strncmp(pDisplayString, pUnix, nUnixLen) == 0 )
+ const char pUnix[] = "unix:";
+ const int nUnixLen = sizeof(pUnix) - 1;
+ if ( strncmp(pDisplayString, pUnix, nUnixLen) == 0 )
return sal_IsDisplayNumber( pDisplayString + nUnixLen );
const char pLoopback[] = "127.0.0.1:";
const int nLoopbackLen= sizeof(pLoopback) - 1;
- if ( strncmp(pDisplayString, pLoopback, nLoopbackLen) == 0 )
+ if ( strncmp(pDisplayString, pLoopback, nLoopbackLen) == 0 )
return sal_IsDisplayNumber( pDisplayString + nLoopbackLen );
// compare local hostname to displaystring, both may be ip address or
// hostname
- sal_Bool bEqual = sal_False;
- char *pDisplayHost = strdup( pDisplayString );
- char *pPtr = strrchr( pDisplayHost, ':' );
+ BOOL bEqual = FALSE;
+ char *pDisplayHost = strdup( pDisplayString );
+ char *pPtr = strrchr( pDisplayHost, ':' );
if( pPtr != NULL )
{
@@ -339,14 +338,14 @@ sal_IsLocalDisplay( Display *pDisplay )
// since it is not called very often and sal_IsLocalDisplay() is relative
// expensive bLocal_ is initialized on first call
-sal_Bool SalDisplay::IsLocal()
+BOOL SalDisplay::IsLocal()
{
if ( ! mbLocalIsValid )
{
bLocal_ = sal_IsLocalDisplay( pDisp_ );
- mbLocalIsValid = sal_True;
+ mbLocalIsValid = TRUE;
}
- return (sal_Bool)bLocal_;
+ return (BOOL)bLocal_;
}
// ---------------------------------------------------------------------------
@@ -354,27 +353,32 @@ extern "C" srv_vendor_t
sal_GetServerVendor( Display *p_display )
{
typedef struct {
- srv_vendor_t e_vendor; // vendor as enum
- const char *p_name; // vendor name as returned by VendorString()
- unsigned int n_len; // number of chars to compare
+ srv_vendor_t e_vendor; // vendor as enum
+ const char *p_name; // vendor name as returned by VendorString()
+ unsigned int n_len; // number of chars to compare
} vendor_t;
const vendor_t p_vendorlist[] = {
- { vendor_xfree, "The XFree86 Project, Inc", 13 },
- { vendor_sun, "Sun Microsystems, Inc.", 10 },
- { vendor_attachmate, "Attachmate Corporation", 10 },
+ { vendor_xfree, "The XFree86 Project, Inc", 13 },
+ { vendor_sun, "Sun Microsystems, Inc.", 10 },
+ { vendor_attachmate, "Attachmate Corporation", 10 },
{ vendor_excursion,
"DECWINDOWS DigitalEquipmentCorporation, eXcursion", 42 },
- { vendor_hp, "Hewlett-Packard Company", 17 },
+ { vendor_hp, "Hewlett-Packard Company", 17 },
{ vendor_hummingbird, "Hummingbird Communications Ltd.", 11 },
{ vendor_ibm, "International Business Machines", 24 },
{ vendor_sgi, "Silicon Graphics", 9 },
- { vendor_sco, "The Santa Cruz Operation", 16 },
- { vendor_xinside, "X Inside Inc.", 10 },
+ { vendor_sco, "The Santa Cruz Operation", 16 },
+ { vendor_xinside, "X Inside Inc.", 10 },
// allways the last entry: vendor_none to indicate eol
- { vendor_none, NULL, 0 },
+ { 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;
@@ -406,7 +410,7 @@ static sal_Bool sal_IsTrustedSolaris (Display *p_display)
// -=-= SalDisplay -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool SalDisplay::BestVisual( Display *pDisplay,
+BOOL SalDisplay::BestVisual( Display *pDisplay,
int nScreen,
XVisualInfo &rVI )
{
@@ -431,51 +435,51 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay,
int i;
for( i = 0; i < nVisuals; i++ )
{
- sal_Bool bUsable = sal_False;
+ BOOL bUsable = FALSE;
int nTrueColor = 1;
if ( pVInfos[i].screen != nScreen )
{
- bUsable = sal_False;
+ bUsable = FALSE;
}
else
if( pVInfos[i].c_class == TrueColor )
{
nTrueColor = 2048;
if( pVInfos[i].depth == 24 )
- bUsable = sal_True;
-#ifdef sal_TrueCOLOR8
+ bUsable = TRUE;
+#ifdef TRUECOLOR8
else if( pVInfos[i].depth == 8 )
{
nTrueColor = -1; // strongly discourage 8 bit true color
- bUsable = sal_True;
+ bUsable = TRUE;
}
#endif
-#ifdef sal_TrueCOLOR15
+#ifdef TRUECOLOR15
else if( pVInfos[i].depth == 15 )
- bUsable = sal_True;
+ bUsable = TRUE;
#endif
-#ifdef sal_TrueCOLOR16
+#ifdef TRUECOLOR16
else if( pVInfos[i].depth == 16 )
- bUsable = sal_True;
+ bUsable = TRUE;
#endif
-#ifdef sal_TrueCOLOR32
+#ifdef 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 = sal_True;
+ bUsable = TRUE;
}
#endif
}
else if( pVInfos[i].c_class == PseudoColor )
{
if( pVInfos[i].depth <= 8 )
- bUsable = sal_True;
+ bUsable = TRUE;
#ifdef PSEUDOCOLOR12
else if( pVInfos[i].depth == 12 )
- bUsable = sal_True;
+ bUsable = TRUE;
#endif
}
pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
@@ -503,6 +507,7 @@ sal_Bool SalDisplay::BestVisual( Display *pDisplay,
SalDisplay::SalDisplay( Display *display ) :
mpInputMethod( NULL ),
+ mpFallbackFactory ( NULL ),
pDisp_( display ),
m_pWMAdaptor( NULL ),
m_pDtIntegrator( NULL ),
@@ -551,6 +556,7 @@ void SalDisplay::doDestruct()
m_pDtIntegrator = NULL;
X11SalBitmap::ImplDestroyCache();
X11SalGraphics::releaseGlyphPeer();
+ DestroyFontCache();
if( IsDisplay() )
{
@@ -643,7 +649,7 @@ fd
GetSalData()->m_pInstance->GetYieldMutex()->acquire();
pDisplay->Yield();
GetSalData()->m_pInstance->GetYieldMutex()->release();
- return sal_True;
+ return TRUE;
}
SalX11Display::SalX11Display( Display *display )
@@ -681,8 +687,8 @@ void SalDisplay::initScreen( int nScreen ) const
rSD.m_bInit = true;
XVisualInfo aVI;
- Colormap aColMap;
-
+ Colormap aColMap;
+
if( SalDisplay::BestVisual( pDisp_, nScreen, aVI ) ) // DefaultVisual
aColMap = DefaultColormap( pDisp_, nScreen );
else
@@ -697,7 +703,7 @@ void SalDisplay::initScreen( int nScreen ) const
rSD.m_aRoot = RootWindow( pDisp_, nScreen );
rSD.m_aVisual = SalVisual( &aVI );
rSD.m_aColormap = SalColormap( this, aColMap, nScreen );
-
+
// we're interested in configure notification of root windows
InitRandR( rSD.m_aRoot );
@@ -729,10 +735,10 @@ void SalDisplay::initScreen( int nScreen ) const
1
);
- rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding()));
+ ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() );
const char* argv[2];
argv[0] = "/bin/sh";
- argv[1] = aExec.getStr();
+ argv[1] = aExec.GetBuffer();
XSetCommand( pDisp_, rSD.m_aRefWindow, const_cast<char**>(argv), 2 );
XSelectInput( pDisp_, rSD.m_aRefWindow, PropertyChangeMask );
@@ -740,9 +746,9 @@ void SalDisplay::initScreen( int nScreen ) const
XGCValues values;
values.graphics_exposures = False;
values.fill_style = FillOpaqueStippled;
- values.background = (1<<rSD.m_aVisual.GetDepth())-1;
- values.foreground = 0;
-
+ values.background = (1<<rSD.m_aVisual.GetDepth())-1;
+ values.foreground = 0;
+
rSD.m_aCopyGC = XCreateGC( pDisp_,
rSD.m_aRefWindow,
GCGraphicsExposures
@@ -774,12 +780,13 @@ void SalDisplay::initScreen( int nScreen ) const
| GCForeground
| GCBackground,
&values );
-
+
XSetFunction( pDisp_, rSD.m_aAndInvertedGC, GXandInverted );
XSetFunction( pDisp_, rSD.m_aAndGC, GXand );
- // PowerPC Solaris 2.5 (XSun 3500) Bug: GXor = GXnop
+ // #44556# PowerPC Solaris 2.5 (XSun 3500) Bug: GXor = GXnop
+ //XSetFunction( pDisp_, pOrGC_, GXor );
XSetFunction( pDisp_, rSD.m_aOrGC, GXxor );
-
+
if( 1 == rSD.m_aVisual.GetDepth() )
{
XSetFunction( pDisp_, rSD.m_aCopyGC, GXcopyInverted );
@@ -796,7 +803,7 @@ void SalDisplay::initScreen( int nScreen ) const
}
rSD.m_hInvert50 = XCreateBitmapFromData( pDisp_,
rSD.m_aRefWindow,
- reinterpret_cast<const char*>(invert50_bits),
+ invert50_bits,
invert50_width,
invert50_height );
}
@@ -811,10 +818,12 @@ void SalDisplay::Init()
eWindowManager_ = otherwm;
nProperties_ = PROPERTY_DEFAULT;
hEventGuard_ = NULL;
- mpFactory = (AttributeProvider*)NULL;
- m_pCapture = NULL;
- m_bXinerama = false;
-
+ m_pFontCache = NULL;
+ mpFontList = (XlfdStorage*)NULL;
+ mpFactory = (AttributeProvider*)NULL;
+ m_pCapture = NULL;
+ m_bXinerama = false;
+
int nDisplayScreens = ScreenCount( pDisp_ );
m_aScreens = std::vector<ScreenData>(nDisplayScreens);
@@ -850,9 +859,9 @@ void SalDisplay::Init()
X11SalBitmap::ImplCreateCache();
hEventGuard_ = osl_createMutex();
- bLocal_ = sal_False; /* dont care, initialize later by
+ bLocal_ = FALSE; /* dont care, initialize later by
calling SalDisplay::IsLocal() */
- mbLocalIsValid = sal_False; /* bLocal_ is not yet initialized */
+ mbLocalIsValid = FALSE; /* bLocal_ is not yet initialized */
// - - - - - - - - - - Synchronize - - - - - - - - - - - - -
if( getenv( "SAL_SYNCHRONIZE" ) )
@@ -885,8 +894,7 @@ void SalDisplay::Init()
sscanf( pProperties, "%li", &nProperties_ );
else
{
-#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || \
- defined NETBSD || defined OPENBSD || defined DRAGONFLY
+#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || defined OPENBSD
nProperties_ |= PROPERTY_FEATURE_Maximize;
#endif
// Server Bugs & Properties
@@ -912,13 +920,12 @@ void SalDisplay::Init()
if( GetServerVendor() == vendor_xfree )
{
nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor;
-#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || \
- defined DRAGONFLY
+#if defined LINUX || defined FREEBSD || defined OPENBSD
// otherwm and olwm are a kind of default, which are not detected
// carefully. if we are running linux (i.e. not netbsd) on an xfree
// display, fvwm is most probable the wm to choose, confusing with mwm
// doesn't harm. #57791# start maximized if possible
- if( (otherwm == eWindowManager_)
+ if( (otherwm == eWindowManager_)
|| (olwm == eWindowManager_ ))
{
eWindowManager_ = fvwm; // ???
@@ -1070,7 +1077,7 @@ unsigned int GetKeySymMask(Display* dpy, KeySym nKeySym)
}
-void SalDisplay::SimulateKeyPress( sal_uInt16 nKeyCode )
+void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
{
if (nKeyCode == KEY_CAPSLOCK)
{
@@ -1089,10 +1096,10 @@ void SalDisplay::SimulateKeyPress( sal_uInt16 nKeyCode )
}
}
-sal_uInt16 SalDisplay::GetIndicatorState() const
+USHORT SalDisplay::GetIndicatorState() const
{
unsigned int _state = 0;
- sal_uInt16 nState = 0;
+ USHORT nState = 0;
XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
if ((_state & 0x00000001))
@@ -1108,7 +1115,7 @@ sal_uInt16 SalDisplay::GetIndicatorState() const
String SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const
{
String aRet;
-
+
// return an empty string for keysyms that are not bound to
// any key code
XLIB_KeyCode aKeyCode = XKeysymToKeycode( GetDisplay(), nKeySym );
@@ -1152,7 +1159,7 @@ void SalDisplay::ModifierMapping()
nMod1KeySym_ = sal_XModifier2Keysym( pDisp_, pXModMap, Mod1MapIndex );
// Auf Sun-Servern und SCO-Severn beruecksichtigt XLookupString
// nicht den NumLock Modifier.
- if( (GetServerVendor() == vendor_sun)
+ if( (GetServerVendor() == vendor_sun)
|| (GetServerVendor() == vendor_sco) )
{
XLIB_KeyCode aNumLock = XKeysymToKeycode( pDisp_, XK_Num_Lock );
@@ -1173,10 +1180,9 @@ void SalDisplay::ModifierMapping()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
+XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
{
String aStrMap;
- String aCustomKeyName;
if( nKeyCode & KEY_MOD1 )
aStrMap += GetKeyNameFromKeySym( nCtrlKeySym_ );
@@ -1253,13 +1259,13 @@ XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
break;
#if !defined (SunXK_Undo)
- #define SunXK_Stop 0x0000FF69 // XK_Cancel
- #define SunXK_Props 0x1005FF70
- #define SunXK_Front 0x1005FF71
- #define SunXK_Copy 0x1005FF72
- #define SunXK_Open 0x1005FF73
- #define SunXK_Paste 0x1005FF74
- #define SunXK_Cut 0x1005FF75
+ #define SunXK_Stop 0x0000FF69 // XK_Cancel
+ #define SunXK_Props 0x1005FF70
+ #define SunXK_Front 0x1005FF71
+ #define SunXK_Copy 0x1005FF72
+ #define SunXK_Open 0x1005FF73
+ #define SunXK_Paste 0x1005FF74
+ #define SunXK_Cut 0x1005FF75
#endif
case KEY_REPEAT:
@@ -1329,13 +1335,13 @@ XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
nKeySym = XK_grave;
break;
case KEY_BRACKETLEFT:
- aCustomKeyName = '[';
+ nKeySym = XK_bracketleft;
break;
case KEY_BRACKETRIGHT:
- aCustomKeyName = ']';
+ nKeySym = XK_bracketright;
break;
case KEY_SEMICOLON:
- aCustomKeyName = ';';
+ nKeySym = XK_semicolon;
break;
default:
@@ -1355,14 +1361,6 @@ XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
else
aStrMap.Erase();
}
- else if (aCustomKeyName.Len())
- {
- // For semicolumn, bracket left and bracket right, it's better to use
- // their keys than their names. (fdo#32891)
- if (aStrMap.Len())
- aStrMap += '+';
- aStrMap += aCustomKeyName;
- }
else
aStrMap.Erase();
@@ -1374,27 +1372,27 @@ XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
#define IsISOKey( n ) (0x0000FE00==((n)&0xFFFFFF00))
#endif
-sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
+USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
{
- sal_uInt16 nKey = 0;
+ USHORT nKey = 0;
if( XK_a <= keysym && XK_z >= keysym )
- nKey = (sal_uInt16)(KEY_A + (keysym - XK_a));
+ nKey = (USHORT)(KEY_A + (keysym - XK_a));
else if( XK_A <= keysym && XK_Z >= keysym )
- nKey = (sal_uInt16)(KEY_A + (keysym - XK_A));
+ nKey = (USHORT)(KEY_A + (keysym - XK_A));
else if( XK_0 <= keysym && XK_9 >= keysym )
- nKey = (sal_uInt16)(KEY_0 + (keysym - XK_0));
+ nKey = (USHORT)(KEY_0 + (keysym - XK_0));
else if( IsModifierKey( keysym ) )
;
else if( IsKeypadKey( keysym ) )
{
if( (keysym >= XK_KP_0) && (keysym <= XK_KP_9) )
{
- nKey = (sal_uInt16)(KEY_0 + (keysym - XK_KP_0));
+ nKey = (USHORT)(KEY_0 + (keysym - XK_KP_0));
*pcPrintable = '0' + nKey - KEY_0;
}
else if( IsPFKey( keysym ) )
- nKey = (sal_uInt16)(KEY_F1 + (keysym - XK_KP_F1));
+ nKey = (USHORT)(KEY_F1 + (keysym - XK_KP_F1));
else switch( keysym )
{
case XK_KP_Space:
@@ -1473,7 +1471,7 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
if( bNumLockFromXS_ )
{
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
+ nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
}
else switch( keysym )
{
@@ -1542,7 +1540,7 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
break;
default:
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
+ nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
break;
}
}
@@ -1599,6 +1597,13 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
case XK_Menu:
nKey = KEY_CONTEXTMENU;
break;
+/*
+ case XK_Break:
+ case XK_Select:
+ case XK_Execute:
+ case XK_Print:
+ case XK_Cancel:
+*/
}
}
else if( IsISOKey( keysym ) ) // XK_ISO_
@@ -1680,6 +1685,9 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
nKey = KEY_SEMICOLON;
*pcPrintable = ';';
break;
+// case XK_Linefeed:
+// *pcPrintable = '\n';
+// break;
// - - - - - - - - - - - - - Apollo - - - - - - - - - - - - - 0x1000
case 0x1000FF02: // apXK_Copy
nKey = KEY_COPY;
@@ -1764,8 +1772,8 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent,
unsigned char *pPrintable,
int *pLen,
KeySym *pUnmodifiedKeySym,
- Status *pStatusReturn,
- XIC aInputContext ) const
+ Status *pStatusReturn,
+ XIC aInputContext ) const
{
KeySym nKeySym = 0;
memset( pPrintable, 0, *pLen );
@@ -1801,7 +1809,7 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent,
/* unhandled error */
break;
case XLookupKeySym:
- /* this is a strange one: on exceed sometimes
+ /* #72223# this is a strange one: on exceed sometimes
* no printable is returned for the first char entered,
* just to retry lookup solves the problem. The problem
* is not yet fully understood, so restrict 2nd lookup
@@ -1848,7 +1856,7 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent,
#define MAKE_BITMAP( name ) \
XCreateBitmapFromData( pDisp_, \
DefaultRootWindow( pDisp_ ), \
- reinterpret_cast<const char*>(name##_bits), \
+ name##_bits, \
name##_width, \
name##_height )
@@ -2158,7 +2166,7 @@ XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle )
MAKE_CURSOR( vertcurs_ );
break;
- // #i32329# Enhanced table selection
+ // --> FME 2004-07-30 #i32329# Enhanced table selection
case POINTER_TAB_SELECT_S:
MAKE_CURSOR( tblsels_ );
break;
@@ -2174,14 +2182,16 @@ XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle )
case POINTER_TAB_SELECT_SW:
MAKE_CURSOR( tblselsw_ );
break;
+ // <--
- // #i20119# Paintbrush tool
+ // --> FME 2004-08-16 #i20119# Paintbrush tool
case POINTER_PAINTBRUSH :
MAKE_CURSOR( paintbrush_ );
break;
+ // <--
default:
- OSL_FAIL("pointer not implemented");
+ DBG_ERROR("pointer not implemented");
aCur = XCreateFontCursor( pDisp_, XC_arrow );
break;
}
@@ -2208,13 +2218,10 @@ XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle )
int SalDisplay::CaptureMouse( SalFrame *pCapture )
{
- static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
-
if( !pCapture )
{
m_pCapture = NULL;
- if( !pEnv || !*pEnv )
- XUngrabPointer( GetDisplay(), CurrentTime );
+ XUngrabPointer( GetDisplay(), CurrentTime );
XFlush( GetDisplay() );
return 0;
}
@@ -2223,23 +2230,20 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
// FIXME: get rid of X11SalFrame
const SystemEnvData* pEnvData = pCapture->GetSystemData();
- if( !pEnv || !*pEnv )
- {
- int ret = XGrabPointer( GetDisplay(),
- (XLIB_Window)pEnvData->aWindow,
- False,
- PointerMotionMask| ButtonPressMask|ButtonReleaseMask,
- GrabModeAsync,
- GrabModeAsync,
- None,
- static_cast<X11SalFrame*>(pCapture)->GetCursor(),
- CurrentTime );
-
- if( ret != GrabSuccess )
- {
- DBG_ASSERT( 1, "SalDisplay::CaptureMouse could not grab pointer\n");
- return -1;
- }
+ int ret = XGrabPointer( GetDisplay(),
+ (XLIB_Window)pEnvData->aWindow,
+ False,
+ PointerMotionMask| ButtonPressMask|ButtonReleaseMask,
+ GrabModeAsync,
+ GrabModeAsync,
+ None,
+ static_cast<X11SalFrame*>(pCapture)->GetCursor(),
+ CurrentTime );
+
+ if( ret != GrabSuccess )
+ {
+ DBG_ASSERT( 1, "SalDisplay::CaptureMouse could not grab pointer\n");
+ return -1;
}
m_pCapture = pCapture;
@@ -2249,7 +2253,7 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
// Events
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2265,7 +2269,7 @@ void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nE
}
}
-void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2292,37 +2296,37 @@ void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16
}
}
-sal_Bool SalX11Display::IsEvent()
+BOOL SalX11Display::IsEvent()
{
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( osl_acquireMutex( hEventGuard_ ) )
{
if( m_aUserEvents.begin() != m_aUserEvents.end() )
- bRet = sal_True;
+ bRet = TRUE;
osl_releaseMutex( hEventGuard_ );
}
if( bRet || XEventsQueued( pDisp_, QueuedAlready ) )
- return sal_True;
+ return TRUE;
XFlush( pDisp_ );
- return sal_False;
+ return FALSE;
}
bool SalDisplay::DispatchInternalEvent()
{
SalFrame* pFrame = NULL;
void* pData = NULL;
- sal_uInt16 nEvent = 0;
+ USHORT nEvent = 0;
if( osl_acquireMutex( hEventGuard_ ) )
{
if( m_aUserEvents.begin() != m_aUserEvents.end() )
{
- pFrame = m_aUserEvents.front().m_pFrame;
- pData = m_aUserEvents.front().m_pData;
- nEvent = m_aUserEvents.front().m_nEvent;
+ pFrame = m_aUserEvents.front().m_pFrame;
+ pData = m_aUserEvents.front().m_pData;
+ nEvent = m_aUserEvents.front().m_nEvent;
m_aUserEvents.pop_front();
}
@@ -2355,13 +2359,13 @@ void SalX11Display::Yield()
Dispatch( &aEvent );
#ifdef DBG_UTIL
- if( pXLib_->HasXErrorOccurred() )
+ if( pXLib_->HasXErrorOccured() )
{
XFlush( pDisp_ );
PrintEvent( "SalDisplay::Yield (WasXError)", &aEvent );
}
#endif
- pXLib_->ResetXErrorOccurred();
+ pXLib_->ResetXErrorOccured();
}
long SalX11Display::Dispatch( XEvent *pEvent )
@@ -2465,7 +2469,7 @@ long SalX11Display::Dispatch( XEvent *pEvent )
return pFrame->Dispatch( pEvent );
}
}
-
+
// dispatch to salobjects
X11SalObject::Dispatch( pEvent );
@@ -2667,7 +2671,6 @@ 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",
@@ -2794,7 +2797,7 @@ void SalDisplay::deregisterFrame( SalFrame* pFrame )
osl_releaseMutex( hEventGuard_ );
}
else {
- OSL_FAIL( "SalDisplay::deregisterFrame !acquireMutex\n" );
+ DBG_ERROR( "SalDisplay::deregisterFrame !acquireMutex\n" );
}
m_aFrames.remove( pFrame );
@@ -2884,9 +2887,9 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
nGreenShift_ = sal_Shift( green_mask );
nBlueShift_ = sal_Shift( blue_mask );
- nRedBits_ = sal_significantBits( red_mask );
- nGreenBits_ = sal_significantBits( green_mask );
- nBlueBits_ = sal_significantBits( blue_mask );
+ nRedBits_ = sal_significantBits( red_mask );
+ nGreenBits_ = sal_significantBits( green_mask );
+ nBlueBits_ = sal_significantBits( blue_mask );
if( GetDepth() == 24 )
if( red_mask == 0xFF0000 )
@@ -2894,44 +2897,44 @@ SalVisual::SalVisual( const XVisualInfo* pXVI )
if( blue_mask == 0xFF )
eRGBMode_ = RGB;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else if( blue_mask == 0xFF00 )
if( green_mask == 0xFF )
eRGBMode_ = RBG;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else if( green_mask == 0xFF0000 )
if( red_mask == 0xFF00 )
if( blue_mask == 0xFF )
eRGBMode_ = GRB;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else if( blue_mask == 0xFF00 )
if( red_mask == 0xFF )
eRGBMode_ = GBR;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else if( blue_mask == 0xFF0000 )
if( red_mask == 0xFF00 )
if( green_mask == 0xFF )
eRGBMode_ = BRG;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else if( green_mask == 0xFF00 )
if( red_mask == 0xFF )
eRGBMode_ = BGR;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
else
- eRGBMode_ = otherSalRGB;
+ eRGBMode_ = other;
}
}
@@ -2949,14 +2952,14 @@ SalVisual::~SalVisual()
#define SALCOLOR RGB
#define SALCOLORREVERSE BGR
-sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
+BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
{
int n;
switch( GetMode() )
{
- case otherSalRGB:
- return sal_False;
+ case other:
+ return FALSE;
case SALCOLOR:
break;
case SALCOLORREVERSE:
@@ -2981,17 +2984,17 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return sal_True;
+ return TRUE;
}
-sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 )
+BOOL SalVisual::Convert( int &n0, int &n1, int &n2 )
{
int n;
switch( GetMode() )
{
- case otherSalRGB:
- return sal_False;
+ case other:
+ return FALSE;
case SALCOLOR:
break;
case RBG:
@@ -3025,7 +3028,7 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return sal_True;
+ return TRUE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -3043,7 +3046,7 @@ SalColor SalVisual::GetTCColor( Pixel nPixel ) const
Pixel g = nPixel & green_mask;
Pixel b = nPixel & blue_mask;
- if( otherSalRGB != eRGBMode_ ) // 8+8+8=24
+ if( other != eRGBMode_ ) // 8+8+8=24
return MAKE_SALCOLOR( r >> nRedShift_,
g >> nGreenShift_,
b >> nBlueShift_ );
@@ -3074,7 +3077,7 @@ Pixel SalVisual::GetTCPixel( SalColor nSalColor ) const
if( SALCOLORREVERSE == eRGBMode_ )
return (b << 16) | (g << 8) | (r);
- if( otherSalRGB != eRGBMode_ ) // 8+8+8=24
+ if( other != eRGBMode_ ) // 8+8+8=24
return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_);
if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_;
@@ -3111,12 +3114,17 @@ SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap, int nS
GetXPixels( aColor, 0xC0, 0xC0, 0xC0 );
// light colors: 3 * 2 = 6
-
+// GetXPixels( aColor, 0x00, 0x00, 0x00 );
GetXPixels( aColor, 0x00, 0x00, 0xFF );
GetXPixels( aColor, 0x00, 0xFF, 0x00 );
GetXPixels( aColor, 0x00, 0xFF, 0xFF );
+// GetXPixels( aColor, 0xFF, 0x00, 0x00 );
+// GetXPixels( aColor, 0xFF, 0x00, 0xFF );
+// GetXPixels( aColor, 0xFF, 0xFF, 0x00 );
+// GetXPixels( aColor, 0xFF, 0xFF, 0xFF );
// standard colors: 7 * 2 = 14
+// GetXPixels( aColor, 0x00, 0x00, 0x00 );
GetXPixels( aColor, 0x00, 0x00, 0x80 );
GetXPixels( aColor, 0x00, 0x80, 0x00 );
GetXPixels( aColor, 0x00, 0x80, 0x80 );
@@ -3124,7 +3132,7 @@ SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap, int nS
GetXPixels( aColor, 0x80, 0x00, 0x80 );
GetXPixels( aColor, 0x80, 0x80, 0x00 );
GetXPixels( aColor, 0x80, 0x80, 0x80 );
- GetXPixels( aColor, 0x00, 0xB8, 0xFF ); // Blue 7
+ GetXPixels( aColor, 0x00, 0xB8, 0xFF ); // Blau 7
// cube: 6*6*6 - 8 = 208
for( r = 0; r < 0x100; r += 0x33 ) // 0x33, 0x66, 0x99, 0xCC, 0xFF
@@ -3192,7 +3200,7 @@ SalColormap::SalColormap()
}
// TrueColor
-SalColormap::SalColormap( sal_uInt16 nDepth )
+SalColormap::SalColormap( USHORT nDepth )
: m_pDisplay( GetX11SalData()->GetDisplay() ),
m_hColormap( None ),
m_nWhitePixel( (1 << nDepth) - 1 ),
@@ -3342,14 +3350,14 @@ void SalColormap::GetPalette()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static sal_uInt16 sal_Lookup( const std::vector<SalColor>& rPalette,
+static USHORT sal_Lookup( const std::vector<SalColor>& rPalette,
int r, int g, int b,
Pixel nUsed )
{
- sal_uInt16 nPixel = 0;
+ USHORT nPixel = 0;
int nBest = ColorDiff( rPalette[0], r, g, b );
- for( sal_uInt16 i = 1; i < nUsed; i++ )
+ for( USHORT i = 1; i < nUsed; i++ )
{
int n = ColorDiff( rPalette[i], r, g, b );
@@ -3367,7 +3375,7 @@ static sal_uInt16 sal_Lookup( const std::vector<SalColor>& rPalette,
void SalColormap::GetLookupTable()
{
- m_aLookupTable = std::vector<sal_uInt16>(16*16*16);
+ m_aLookupTable = std::vector<USHORT>(16*16*16);
int i = 0;
for( int r = 0; r < 256; r += 17 )
@@ -3417,7 +3425,7 @@ SalColor SalColormap::GetColor( Pixel nPixel ) const
return MAKE_SALCOLOR( aColor.red>>8, aColor.green>>8, aColor.blue>>8 );
}
-inline sal_Bool SalColormap::GetXPixel( XColor &rColor,
+inline BOOL SalColormap::GetXPixel( XColor &rColor,
int r,
int g,
int b ) const
@@ -3428,15 +3436,15 @@ inline sal_Bool SalColormap::GetXPixel( XColor &rColor,
return XAllocColor( GetXDisplay(), m_hColormap, &rColor );
}
-sal_Bool SalColormap::GetXPixels( XColor &rColor,
+BOOL SalColormap::GetXPixels( XColor &rColor,
int r,
int g,
int b ) const
{
if( !GetXPixel( rColor, r, g, b ) )
- return sal_False;
+ return FALSE;
if( rColor.pixel & 1 )
- return sal_True;
+ return TRUE;
return GetXPixel( rColor, r^0xFF, g^0xFF, b^0xFF );
}
@@ -3524,9 +3532,9 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
}
// Colormatching ueber Palette
- sal_uInt16 r = SALCOLOR_RED ( nSalColor );
- sal_uInt16 g = SALCOLOR_GREEN( nSalColor );
- sal_uInt16 b = SALCOLOR_BLUE ( nSalColor );
+ USHORT r = SALCOLOR_RED ( nSalColor );
+ USHORT g = SALCOLOR_GREEN( nSalColor );
+ USHORT 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 9b83ceb45413..4f0d67963378 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -46,7 +46,7 @@
#include "sm.hxx"
#include "vcl/salwtype.hxx"
-#include "vcl/apptypes.hxx"
+#include "vcl/salatype.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
#include "osl/mutex.hxx"
@@ -60,8 +60,8 @@
SalYieldMutex::SalYieldMutex()
{
- mnCount = 0;
- mnThreadId = 0;
+ mnCount = 0;
+ mnThreadId = 0;
::tools::SolarMutex::SetSolarMutex( this );
}
@@ -151,8 +151,8 @@ X11SalInstance::~X11SalInstance()
struct PredicateReturn
{
- sal_uInt16 nType;
- sal_Bool bRet;
+ USHORT nType;
+ BOOL bRet;
};
extern "C" {
@@ -163,7 +163,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
if ( pPre->bRet )
return False;
- sal_uInt16 nType;
+ USHORT nType;
switch( pEvent->type )
{
@@ -189,30 +189,30 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
}
if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) )
- pPre->bRet = sal_True;
+ pPre->bRet = TRUE;
return False;
}
}
-bool X11SalInstance::AnyInput(sal_uInt16 nType)
+bool X11SalInstance::AnyInput(USHORT nType)
{
X11SalData *pSalData = GetX11SalData();
Display *pDisplay = pSalData->GetDisplay()->GetDisplay();
- sal_Bool bRet = sal_False;
+ BOOL bRet = FALSE;
if( (nType & INPUT_TIMER) &&
pSalData->GetDisplay()->GetXLib()->CheckTimeout( false ) )
{
- bRet = sal_True;
+ bRet = TRUE;
}
else if (XPending(pDisplay) )
{
PredicateReturn aInput;
- XEvent aEvent;
+ XEvent aEvent;
- aInput.bRet = sal_False;
- aInput.nType = nType;
+ aInput.bRet = FALSE;
+ aInput.nType = nType;
XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent,
(char *)&aInput );
@@ -229,14 +229,14 @@ osl::SolarMutex* X11SalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-sal_uLong X11SalInstance::ReleaseYieldMutex()
+ULONG X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- sal_uLong nCount = pYieldMutex->GetAcquireCount();
- sal_uLong n = nCount;
+ ULONG nCount = pYieldMutex->GetAcquireCount();
+ ULONG n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -251,7 +251,7 @@ sal_uLong X11SalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void X11SalInstance::AcquireYieldMutex( sal_uLong nCount )
+void X11SalInstance::AcquireYieldMutex( ULONG nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -261,42 +261,25 @@ void X11SalInstance::AcquireYieldMutex( sal_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 ); }
void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
{
static const char* pDisplay = getenv( "DISPLAY" );
- rReturnedType = AsciiCString;
- rReturnedBytes = pDisplay ? strlen( pDisplay )+1 : 1;
+ rReturnedType = AsciiCString;
+ rReturnedBytes = pDisplay ? strlen( pDisplay )+1 : 1;
return pDisplay ? (void*)pDisplay : (void*)"";
}
-SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle )
+SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, ULONG nSalFrameStyle )
{
SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle );
return pFrame;
}
-SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong nStyle )
+SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, ULONG nStyle )
{
SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData );
@@ -361,14 +344,14 @@ static void getServerDirectories( std::list< rtl::OString >& o_rFontPaths )
void X11SalInstance::FillFontPathList( std::list< rtl::OString >& o_rFontPaths )
{
Display *pDisplay = GetX11SalData()->GetDisplay()->GetDisplay();
-
+
DBG_ASSERT( pDisplay, "No Display !" );
if( pDisplay )
{
// get font paths to look for fonts
int nPaths = 0, i;
char** pPaths = XGetFontPath( pDisplay, &nPaths );
-
+
bool bServerDirs = false;
for( i = 0; i < nPaths; i++ )
{
@@ -387,33 +370,33 @@ void X11SalInstance::FillFontPathList( std::list< rtl::OString >& o_rFontPaths )
o_rFontPaths.push_back( aPath );
}
}
-
+
if( nPaths )
XFreeFontPath( pPaths );
}
-
+
// insert some standard directories
o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/TrueType" );
o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/Type1" );
o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/Type1/sun" );
o_rFontPaths.push_back( "/usr/X11R6/lib/X11/fonts/truetype" );
o_rFontPaths.push_back( "/usr/X11R6/lib/X11/fonts/Type1" );
-
+
#ifdef SOLARIS
/* cde specials, from /usr/dt/bin/Xsession: here are the good fonts,
the OWfontpath file may contain as well multiple lines as a comma
separated list of fonts in each line. to make it even more weird
environment variables are allowed as well */
-
+
const char* lang = getenv("LANG");
if ( lang != NULL )
{
String aOpenWinDir( String::CreateFromAscii( "/usr/openwin/lib/locale/" ) );
aOpenWinDir.AppendAscii( lang );
aOpenWinDir.AppendAscii( "/OWfontpath" );
-
+
SvFileStream aStream( aOpenWinDir, STREAM_READ );
-
+
// TODO: replace environment variables
while( aStream.IsOpen() && ! aStream.IsEof() )
{
diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx
index 0b4ca3e84f0e..25a72159a663 100644
--- a/vcl/unx/source/app/salsys.cxx
+++ b/vcl/unx/source/app/salsys.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -90,7 +90,7 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
const SalDisplay::ScreenData& rScreen = pSalDisp->getDataForScreen( nScreen );
aRet = Rectangle( Point( 0, 0 ), rScreen.m_aSize );
}
-
+
return aRet;
}
@@ -153,14 +153,14 @@ int X11SalSystem::ShowNativeDialog( const String& rTitle, const String& rMessage
aWarn.SetText( rTitle );
aWarn.Clear();
- sal_uInt16 nButton = 0;
+ USHORT nButton = 0;
for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- aWarn.AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
+ aWarn.AddButton( *it, nButton+1, nButton == (USHORT)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
nButton++;
}
- aWarn.SetFocusButton( (sal_uInt16)nDefButton+1 );
-
+ aWarn.SetFocusButton( (USHORT)nDefButton+1 );
+
nRet = ((int)aWarn.Execute()) - 1;
// normalize behaviour, actually this should never happen
diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx
index 885aeb7c38e7..382cadf3de12 100644
--- a/vcl/unx/source/app/saltimer.cxx
+++ b/vcl/unx/source/app/saltimer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,12 +54,12 @@ void X11SalData::Timeout() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void SalXLib::StopTimer()
{
- m_aTimeout.tv_sec = 0;
- m_aTimeout.tv_usec = 0;
- m_nTimeoutMS = 0;
+ m_aTimeout.tv_sec = 0;
+ m_aTimeout.tv_usec = 0;
+ m_nTimeoutMS = 0;
}
-void SalXLib::StartTimer( sal_uLong nMS )
+void SalXLib::StartTimer( 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( sal_uLong nMS )
+void X11SalTimer::Start( ULONG nMS )
{
GetX11SalData()->GetLib()->StartTimer( nMS );
}
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index 6bfd09fc4f5d..c10e5f6573a7 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -82,7 +82,6 @@ SalSession* X11SalInstance::CreateSalSession()
{
if( ! pOneInstance )
pOneInstance = new IceSalSession();
- SessionManagerClient::open();
return pOneInstance;
}
@@ -141,7 +140,7 @@ void IceSalSession::handleOldX11SaveYourself( SalFrame* pFrame )
if( pOneInstance )
{
SalSessionSaveRequestEvent aEvent( true, false );
- pOneInstance->CallCallback( &aEvent );
+ pOneInstance->CallCallback( &aEvent );
}
}
}
@@ -151,7 +150,7 @@ extern "C" void SAL_CALL ICEConnectionWorker( void* );
class ICEConnectionObserver
{
friend void SAL_CALL ICEConnectionWorker(void*);
- static sal_Bool bIsWatching;
+ static BOOL bIsWatching;
static void ICEWatchProc( IceConn connection, IcePointer client_data,
Bool opening, IcePointer* watch_data );
@@ -175,15 +174,15 @@ public:
};
-SmcConn SessionManagerClient::aSmcConnection = NULL;
-ByteString SessionManagerClient::aClientID;
-sal_Bool ICEConnectionObserver::bIsWatching = sal_False;
-struct pollfd* ICEConnectionObserver::pFilehandles = NULL;
-IceConn* ICEConnectionObserver::pConnections = NULL;
-int ICEConnectionObserver::nConnections = 0;
-oslMutex ICEConnectionObserver::ICEMutex = NULL;
-oslThread ICEConnectionObserver::ICEThread = NULL;
-int ICEConnectionObserver::nWakeupFiles[2] = { 0, 0 };
+SmcConn SessionManagerClient::aSmcConnection = NULL;
+ByteString SessionManagerClient::aClientID;
+BOOL ICEConnectionObserver::bIsWatching = FALSE;
+struct pollfd* ICEConnectionObserver::pFilehandles = NULL;
+IceConn* ICEConnectionObserver::pConnections = NULL;
+int ICEConnectionObserver::nConnections = 0;
+oslMutex ICEConnectionObserver::ICEMutex = NULL;
+oslThread ICEConnectionObserver::ICEThread = NULL;
+int ICEConnectionObserver::nWakeupFiles[2] = { 0, 0 };
#ifdef USE_SM_EXTENSION
IceIOErrorHandler ICEConnectionObserver::origIOErrorHandler = NULL;
@@ -202,9 +201,9 @@ static void IgnoreIceIOErrors(IceConn)
bool SessionManagerClient::bDocSaveDone = false;
-static SmProp* pSmProps = NULL;
-static SmProp** ppSmProps = NULL;
-static int nSmProps = 0;
+static SmProp* pSmProps = NULL;
+static SmProp** ppSmProps = NULL;
+static int nSmProps = 0;
static unsigned char *pSmRestartHint = NULL;
@@ -212,38 +211,38 @@ static void BuildSmPropertyList()
{
if( ! pSmProps )
{
- rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding()));
+ ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() );
nSmProps = 5;
pSmProps = new SmProp[ nSmProps ];
- pSmProps[ 0 ].name = const_cast<char*>(SmCloneCommand);
- pSmProps[ 0 ].type = const_cast<char*>(SmLISTofARRAY8);
- pSmProps[ 0 ].num_vals = 1;
- pSmProps[ 0 ].vals = new SmPropValue;
- pSmProps[ 0 ].vals->length = aExec.getLength()+1;
- pSmProps[ 0 ].vals->value = strdup( aExec.getStr() );
-
- pSmProps[ 1 ].name = const_cast<char*>(SmProgram);
- pSmProps[ 1 ].type = const_cast<char*>(SmARRAY8);
- pSmProps[ 1 ].num_vals = 1;
- pSmProps[ 1 ].vals = new SmPropValue;
- pSmProps[ 1 ].vals->length = aExec.getLength()+1;
- pSmProps[ 1 ].vals->value = strdup( aExec.getStr() );
-
- pSmProps[ 2 ].name = const_cast<char*>(SmRestartCommand);
- pSmProps[ 2 ].type = const_cast<char*>(SmLISTofARRAY8);
- pSmProps[ 2 ].num_vals = 3;
- pSmProps[ 2 ].vals = new SmPropValue[3];
- pSmProps[ 2 ].vals[0].length = aExec.getLength()+1;
- pSmProps[ 2 ].vals[0].value = strdup( aExec.getStr() );
+ pSmProps[ 0 ].name = const_cast<char*>(SmCloneCommand);
+ pSmProps[ 0 ].type = const_cast<char*>(SmLISTofARRAY8);
+ pSmProps[ 0 ].num_vals = 1;
+ pSmProps[ 0 ].vals = new SmPropValue;
+ pSmProps[ 0 ].vals->length = aExec.Len()+1;
+ pSmProps[ 0 ].vals->value = strdup( aExec.GetBuffer() );
+
+ pSmProps[ 1 ].name = const_cast<char*>(SmProgram);
+ pSmProps[ 1 ].type = const_cast<char*>(SmARRAY8);
+ pSmProps[ 1 ].num_vals = 1;
+ pSmProps[ 1 ].vals = new SmPropValue;
+ pSmProps[ 1 ].vals->length = aExec.Len()+1;
+ pSmProps[ 1 ].vals->value = strdup( aExec.GetBuffer() );
+
+ pSmProps[ 2 ].name = const_cast<char*>(SmRestartCommand);
+ pSmProps[ 2 ].type = const_cast<char*>(SmLISTofARRAY8);
+ pSmProps[ 2 ].num_vals = 3;
+ pSmProps[ 2 ].vals = new SmPropValue[3];
+ pSmProps[ 2 ].vals[0].length = aExec.Len()+1;
+ pSmProps[ 2 ].vals[0].value = strdup( aExec.GetBuffer() );
ByteString aRestartOption( "-session=" );
aRestartOption.Append( SessionManagerClient::getSessionID() );
- pSmProps[ 2 ].vals[1].length = aRestartOption.Len()+1;
- pSmProps[ 2 ].vals[1].value = strdup( aRestartOption.GetBuffer() );
+ pSmProps[ 2 ].vals[1].length = aRestartOption.Len()+1;
+ pSmProps[ 2 ].vals[1].value = strdup( aRestartOption.GetBuffer() );
ByteString aRestartOptionNoLogo( "-nologo" );
- pSmProps[ 2 ].vals[2].length = aRestartOptionNoLogo.Len()+1;
- pSmProps[ 2 ].vals[2].value = strdup( aRestartOptionNoLogo.GetBuffer() );
+ pSmProps[ 2 ].vals[2].length = aRestartOptionNoLogo.Len()+1;
+ pSmProps[ 2 ].vals[2].value = strdup( aRestartOptionNoLogo.GetBuffer() );
rtl::OUString aUserName;
rtl::OString aUser;
@@ -255,21 +254,21 @@ static void BuildSmPropertyList()
osl_freeSecurityHandle( aSec );
}
- pSmProps[ 3 ].name = const_cast<char*>(SmUserID);
- pSmProps[ 3 ].type = const_cast<char*>(SmARRAY8);
- pSmProps[ 3 ].num_vals = 1;
- pSmProps[ 3 ].vals = new SmPropValue;
- pSmProps[ 3 ].vals->value = strdup( aUser.getStr() );
- pSmProps[ 3 ].vals->length = strlen( (char *)pSmProps[ 3 ].vals->value )+1;
-
- pSmProps[ 4 ].name = const_cast<char*>(SmRestartStyleHint);
- pSmProps[ 4 ].type = const_cast<char*>(SmCARD8);
- pSmProps[ 4 ].num_vals = 1;
- pSmProps[ 4 ].vals = new SmPropValue;
- pSmProps[ 4 ].vals->value = malloc(1);
+ pSmProps[ 3 ].name = const_cast<char*>(SmUserID);
+ pSmProps[ 3 ].type = const_cast<char*>(SmARRAY8);
+ pSmProps[ 3 ].num_vals = 1;
+ pSmProps[ 3 ].vals = new SmPropValue;
+ pSmProps[ 3 ].vals->value = strdup( aUser.getStr() );
+ pSmProps[ 3 ].vals->length = strlen( (char *)pSmProps[ 3 ].vals->value )+1;
+
+ pSmProps[ 4 ].name = const_cast<char*>(SmRestartStyleHint);
+ pSmProps[ 4 ].type = const_cast<char*>(SmCARD8);
+ pSmProps[ 4 ].num_vals = 1;
+ pSmProps[ 4 ].vals = new SmPropValue;
+ pSmProps[ 4 ].vals->value = malloc(1);
pSmRestartHint = (unsigned char *)pSmProps[ 4 ].vals->value;
*pSmRestartHint = SmRestartIfRunning;
- pSmProps[ 4 ].vals->length = 1;
+ pSmProps[ 4 ].vals->length = 1;
ppSmProps = new SmProp*[ nSmProps ];
for( int i = 0; i < nSmProps; i++ )
@@ -293,8 +292,8 @@ IMPL_STATIC_LINK( SessionManagerClient, SaveYourselfHdl, void*, EMPTYARG )
/*
If we have no actual frames open, e.g. we launched a quickstarter,
and then shutdown all our frames leaving just a quickstarter running,
- then we don't want to launch an empty toplevel frame on the next
- start. (The job of scheduling the restart of the quick-starter is a
+ then we don't want to launch an empty toplevel frame on the next
+ start. (The job of scheduling the restart of the quick-starter is a
task of the quick-starter)
*/
*pSmRestartHint = SmRestartNever;
@@ -313,7 +312,7 @@ IMPL_STATIC_LINK( SessionManagerClient, SaveYourselfHdl, void*, EMPTYARG )
if( pOneInstance )
{
SalSessionSaveRequestEvent aEvent( pThis != 0, false );
- pOneInstance->CallCallback( &aEvent );
+ pOneInstance->CallCallback( &aEvent );
}
else
saveDone();
@@ -329,7 +328,7 @@ IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, InteractionHdl, void*, EMPTYA
SalSessionInteractionEvent aEvent( true );
pOneInstance->CallCallback( &aEvent );
}
-
+
return 0;
}
@@ -341,7 +340,7 @@ IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, ShutDownCancelHdl, void*, EMP
SalSessionShutdownCancelEvent aEvent;
pOneInstance->CallCallback( &aEvent );
}
-
+
return 0;
}
@@ -378,8 +377,7 @@ void SessionManagerClient::SaveYourselfProc(
SessionManagerClient::saveDone();
return;
}
- sal_uIntPtr nStateVal = shutdown ? 0xffffffff : 0x0;
- Application::PostUserEvent( STATIC_LINK( (void*)nStateVal, SessionManagerClient, SaveYourselfHdl ) );
+ Application::PostUserEvent( STATIC_LINK( (void*)(shutdown ? 0xffffffff : 0x0), SessionManagerClient, SaveYourselfHdl ) );
SMprintf( "waiting for save yourself event to be processed\n" );
#endif
}
@@ -467,22 +465,22 @@ void SessionManagerClient::open()
char* pClientID = NULL;
const ByteString& rPrevId( getPreviousSessionID() );
- aCallbacks.save_yourself.callback = SaveYourselfProc;
- aCallbacks.save_yourself.client_data = NULL;
- aCallbacks.die.callback = DieProc;
- aCallbacks.die.client_data = NULL;
- aCallbacks.save_complete.callback = SaveCompleteProc;
- aCallbacks.save_complete.client_data = NULL;
- aCallbacks.shutdown_cancelled.callback = ShutdownCanceledProc;
- aCallbacks.shutdown_cancelled.client_data = NULL;
+ aCallbacks.save_yourself.callback = SaveYourselfProc;
+ aCallbacks.save_yourself.client_data = NULL;
+ aCallbacks.die.callback = DieProc;
+ aCallbacks.die.client_data = NULL;
+ aCallbacks.save_complete.callback = SaveCompleteProc;
+ aCallbacks.save_complete.client_data = NULL;
+ aCallbacks.shutdown_cancelled.callback = ShutdownCanceledProc;
+ aCallbacks.shutdown_cancelled.client_data = NULL;
aSmcConnection = SmcOpenConnection( NULL,
NULL,
SmProtoMajor,
SmProtoMinor,
- SmcSaveYourselfProcMask |
- SmcDieProcMask |
- SmcSaveCompleteProcMask |
- SmcShutdownCancelledProcMask ,
+ SmcSaveYourselfProcMask |
+ SmcDieProcMask |
+ SmcSaveCompleteProcMask |
+ SmcShutdownCancelledProcMask ,
&aCallbacks,
rPrevId.Len() ? const_cast<char*>(rPrevId.GetBuffer()) : NULL,
&pClientID,
@@ -561,12 +559,12 @@ void SessionManagerClient::interactionDone( bool bCancelShutdown )
}
-rtl::OUString SessionManagerClient::getExecName()
+String SessionManagerClient::getExecName()
{
rtl::OUString aExec, aSysExec;
osl_getExecutableFile( &aExec.pData );
osl_getSystemPathFromFileURL( aExec.pData, &aSysExec.pData );
-
+
int nPos = aSysExec.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".bin")) );
if( nPos != -1 )
aSysExec = aSysExec.copy( 0, nPos );
@@ -609,7 +607,7 @@ void ICEConnectionObserver::activate()
{
nWakeupFiles[0] = nWakeupFiles[1] = 0;
ICEMutex = osl_createMutex();
- bIsWatching = sal_True;
+ bIsWatching = TRUE;
#ifdef USE_SM_EXTENSION
/*
* Default handlers call exit, we don't care that strongly if something
@@ -627,7 +625,7 @@ void ICEConnectionObserver::deactivate()
if( bIsWatching )
{
lock();
- bIsWatching = sal_False;
+ bIsWatching = FALSE;
#ifdef USE_SM_EXTENSION
IceRemoveConnectionWatch( ICEWatchProc, NULL );
IceSetErrorHandler( origErrorHandler );
@@ -727,16 +725,16 @@ void ICEConnectionObserver::ICEWatchProc(
nConnections++;
pConnections = (IceConn*)rtl_reallocateMemory( pConnections, sizeof( IceConn )*nConnections );
pFilehandles = (struct pollfd*)rtl_reallocateMemory( pFilehandles, sizeof( struct pollfd )*(nConnections+1) );
- pConnections[ nConnections-1 ] = connection;
- pFilehandles[ nConnections ].fd = fd;
- pFilehandles[ nConnections ].events = POLLIN;
+ pConnections[ nConnections-1 ] = connection;
+ pFilehandles[ nConnections ].fd = fd;
+ pFilehandles[ nConnections ].events = POLLIN;
if( nConnections == 1 )
{
if( ! pipe( nWakeupFiles ) )
{
int flags;
- pFilehandles[0].fd = nWakeupFiles[0];
- pFilehandles[0].events = POLLIN;
+ pFilehandles[0].fd = nWakeupFiles[0];
+ pFilehandles[0].events = POLLIN;
// set close-on-exec and nonblock descriptor flag.
if ((flags = fcntl (nWakeupFiles[0], F_GETFD)) != -1)
{
diff --git a/vcl/unx/source/app/soicon.cxx b/vcl/unx/source/app/soicon.cxx
index 54240f8eef45..600370037de3 100644
--- a/vcl/unx/source/app/soicon.cxx
+++ b/vcl/unx/source/app/soicon.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,13 +42,13 @@
#include <salbmp.h>
#include <vcl/svids.hrc>
-sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon, sal_uInt16 iconSize,
+BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask)
{
if( ! ImplGetResMgr() )
- return sal_False;
-
- sal_uInt16 nIconSizeOffset;
+ return FALSE;
+
+ USHORT nIconSizeOffset;
if( iconSize >= 48 )
nIconSizeOffset = SV_ICON_SIZE48_START;
@@ -57,11 +57,11 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon
else if( iconSize >= 16 )
nIconSizeOffset = SV_ICON_SIZE16_START;
else
- return sal_False;
+ return FALSE;
BitmapEx aIcon( ResId(nIconSizeOffset + nIcon, *ImplGetResMgr()));
- if( sal_True == aIcon.IsEmpty() )
- return sal_False;
+ if( TRUE == aIcon.IsEmpty() )
+ return FALSE;
SalTwoRect aRect;
aRect.mnSrcX = 0; aRect.mnSrcY = 0;
@@ -69,7 +69,7 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon
aRect.mnDestX = 0; aRect.mnDestY = 0;
aRect.mnDestWidth = iconSize; aRect.mnDestHeight = iconSize;
- X11SalBitmap *pBitmap = static_cast < X11SalBitmap * >
+ X11SalBitmap *pBitmap = static_cast < X11SalBitmap * >
(aIcon.ImplGetBitmapImpBitmap()->ImplGetSalBitmap());
icon_pixmap = XCreatePixmap( pDisplay->GetDisplay(),
@@ -88,7 +88,7 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon
if( TRANSPARENT_BITMAP == aIcon.GetTransparentType() )
{
- icon_mask = XCreatePixmap( pDisplay->GetDisplay(),
+ icon_mask = XCreatePixmap( pDisplay->GetDisplay(),
pDisplay->GetRootWindow( pDisplay->GetDefaultScreenNumber() ),
iconSize, iconSize, 1);
@@ -102,14 +102,14 @@ sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon
Bitmap aMask = aIcon.GetMask();
aMask.Invert();
- X11SalBitmap *pMask = static_cast < X11SalBitmap * >
+ X11SalBitmap *pMask = static_cast < X11SalBitmap * >
(aMask.ImplGetImpBitmap()->ImplGetSalBitmap());
pMask->ImplDraw(icon_mask, nScreen, 1, aRect, aMonoGC);
XFreeGC( pDisplay->GetDisplay(), aMonoGC );
}
-
- return sal_True;
+
+ return 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 e03f357998ce..6338f24c7d03 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,23 +32,22 @@
#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>
@@ -106,8 +105,8 @@ using namespace vcl_sal;
struct WMAdaptorProtocol
{
- const char* pProtocol;
- int nProtocol;
+ const char* pProtocol;
+ int nProtocol;
};
@@ -197,7 +196,7 @@ static int compareProtocol( const void* pLeft, const void* pRight )
WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay )
{
- WMAdaptor* pAdaptor = NULL;
+ WMAdaptor* pAdaptor = NULL;
// try a NetWM
pAdaptor = new NetWMAdaptor( pSalDisplay );
@@ -241,15 +240,13 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) :
m_bEnableAlwaysOnTopWorks( false ),
m_bLegacyPartialFullscreen( false ),
m_nWinGravity( StaticGravity ),
- m_nInitWinGravity( StaticGravity ),
- m_bWMshouldSwitchWorkspace( true ),
- m_bWMshouldSwitchWorkspaceInit( false )
+ m_nInitWinGravity( StaticGravity )
{
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
// default desktops
m_nDesktops = 1;
@@ -431,12 +428,12 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) :
// currently all _NET WMs do transient like expected
m_bTransientBehaviour = true;
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
- bool bNetWM = false;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
+ bool bNetWM = false;
initAtoms();
@@ -490,7 +487,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) :
// #i80971# protect against invalid atoms
if( pAtomNames[i] == NULL )
continue;
-
+
int nProtocol = -1;
WMAdaptorProtocol aSearch;
aSearch.pProtocol = pAtomNames[i];
@@ -625,18 +622,18 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) :
// currently all Gnome WMs do transient like expected
m_bTransientBehaviour = true;
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
initAtoms();
// check for GnomeWM
if( m_aWMAtoms[ WIN_SUPPORTING_WM_CHECK ] && m_aWMAtoms[ WIN_PROTOCOLS ] )
{
- XLIB_Window aWMChild = None;
+ XLIB_Window aWMChild = None;
if( XGetWindowProperty( m_pDisplay,
m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ),
m_aWMAtoms[ WIN_SUPPORTING_WM_CHECK ],
@@ -672,7 +669,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) :
&& aRealType == XA_CARDINAL
&& nFormat == 32
&& nItems != 0
- && ! m_pSalDisplay->GetXLib()->HasXErrorOccurred()
+ && ! m_pSalDisplay->GetXLib()->HasXErrorOccured()
)
{
aCheckWindow = *(XLIB_Window*)pProperty;
@@ -746,7 +743,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) :
// #i80971# protect against invalid atoms
if( pAtomNames[i] == NULL )
continue;
-
+
int nProtocol = -1;
WMAdaptorProtocol aSearch;
aSearch.pProtocol = pAtomNames[i];
@@ -830,16 +827,16 @@ GnomeWMAdaptor::~GnomeWMAdaptor()
*/
bool WMAdaptor::getNetWmName()
{
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
- bool bNetWM = false;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
+ bool bNetWM = false;
if( m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ] && m_aWMAtoms[ NET_WM_NAME ] )
{
- XLIB_Window aWMChild = None;
+ XLIB_Window aWMChild = None;
if( XGetWindowProperty( m_pDisplay,
m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ),
m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ],
@@ -875,7 +872,7 @@ bool WMAdaptor::getNetWmName()
&& aRealType == XA_WINDOW
&& nFormat == 32
&& nItems != 0
- && ! m_pSalDisplay->GetXLib()->HasXErrorOccurred()
+ && ! m_pSalDisplay->GetXLib()->HasXErrorOccured()
)
{
aCheckWindow = *(XLIB_Window*)pProperty;
@@ -970,30 +967,6 @@ 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()
*/
@@ -1036,8 +1009,8 @@ void WMAdaptor::initAtoms()
// get basic atoms
for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAtomTab ); i++ )
m_aWMAtoms[ aAtomTab[i].nProtocol ] = XInternAtom( m_pDisplay, aAtomTab[i].pProtocol, False );
- m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ] = XInternAtom( m_pDisplay, "_NET_SUPPORTING_WM_CHECK", True );
- m_aWMAtoms[ NET_WM_NAME ] = XInternAtom( m_pDisplay, "_NET_WM_NAME", True );
+ m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ] = XInternAtom( m_pDisplay, "_NET_SUPPORTING_WM_CHECK", True );
+ m_aWMAtoms[ NET_WM_NAME ] = XInternAtom( m_pDisplay, "_NET_WM_NAME", True );
}
/*
@@ -1048,7 +1021,7 @@ void NetWMAdaptor::initAtoms()
{
WMAdaptor::initAtoms();
- m_aWMAtoms[ NET_SUPPORTED ] = XInternAtom( m_pDisplay, "_NET_SUPPORTED", True );
+ m_aWMAtoms[ NET_SUPPORTED ] = XInternAtom( m_pDisplay, "_NET_SUPPORTED", True );
}
/*
@@ -1059,8 +1032,8 @@ void GnomeWMAdaptor::initAtoms()
{
WMAdaptor::initAtoms();
- m_aWMAtoms[ WIN_PROTOCOLS ] = XInternAtom( m_pDisplay, "_WIN_PROTOCOLS", True );
- m_aWMAtoms[ WIN_SUPPORTING_WM_CHECK ] = XInternAtom( m_pDisplay, "_WIN_SUPPORTING_WM_CHECK", True );
+ m_aWMAtoms[ WIN_PROTOCOLS ] = XInternAtom( m_pDisplay, "_WIN_PROTOCOLS", True );
+ m_aWMAtoms[ WIN_SUPPORTING_WM_CHECK ] = XInternAtom( m_pDisplay, "_WIN_SUPPORTING_WM_CHECK", True );
}
/*
@@ -1072,7 +1045,7 @@ void GnomeWMAdaptor::initAtoms()
void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
{
ByteString aTitle( rWMName, osl_getThreadTextEncoding() );
-
+
if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) )
aTitle = " ";
@@ -1087,7 +1060,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
if( aCountry.getLength() )
{
- aLocaleString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_"));
+ aLocaleString += ::rtl::OUString::createFromAscii( "_" );
aLocaleString += aCountry;
}
if( aVariant.getLength() )
@@ -1099,7 +1072,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
static const char* pLang = getenv( "LANG" );
aWMLocale = pLang ? pLang : "C";
}
-
+
static bool bTrustXmb = true;
#ifdef SOLARIS
/* #i64273# there are some weird cases when using IIIMP on Solaris
@@ -1147,10 +1120,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
&aProp );
}
- unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer();
- Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
- int nFormat = aProp.nitems ? aProp.format : 8;
- int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len();
+ unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer();
+ Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
+ int nFormat = aProp.nitems ? aProp.format : 8;
+ int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len();
const SystemEnvData* pEnv = pFrame->GetSystemData();
XChangeProperty( m_pDisplay,
(XLIB_Window)pEnv->aShellWindow,
@@ -1278,8 +1251,8 @@ void NetWMAdaptor::setNetWMState( X11SalFrame* pFrame ) const
/*
* for maximizing use NorthWestGravity (including decoration)
*/
- XSizeHints hints;
- long supplied;
+ XSizeHints hints;
+ long supplied;
bool bHint = false;
if( XGetWMNormalHints( m_pDisplay,
pFrame->GetShellWindow(),
@@ -1368,8 +1341,8 @@ void GnomeWMAdaptor::setGnomeWMState( X11SalFrame* pFrame ) const
/*
* for maximizing use NorthWestGravity (including decoration)
*/
- XSizeHints hints;
- long supplied;
+ XSizeHints hints;
+ long supplied;
bool bHint = false;
if( XGetWMNormalHints( m_pDisplay,
pFrame->GetShellWindow(),
@@ -1428,13 +1401,13 @@ void GnomeWMAdaptor::setGnomeWMState( X11SalFrame* pFrame ) const
/*
* WMAdaptor::setFrameDecoration
* sets _MOTIF_WM_HINTS
- * WM_TRANSIENT_FOR
+ * WM_TRANSIENT_FOR
*/
void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eType, int nDecorationFlags, X11SalFrame* pReferenceFrame ) const
{
- pFrame->meWindowType = eType;
- pFrame->mnDecorationFlags = nDecorationFlags;
+ pFrame->meWindowType = eType;
+ pFrame->mnDecorationFlags = nDecorationFlags;
if( ! pFrame->mbFullScreen )
{
@@ -1444,13 +1417,13 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy
long input_mode;
unsigned long status;
} aHint;
-
+
aHint.flags = 15; /* flags for functions, decoration, input mode and status */
aHint.deco = 0;
aHint.func = 1L << 2;
aHint.status = 0;
aHint.input_mode = 0;
-
+
// evaluate decoration flags
if( nDecorationFlags & decoration_All )
aHint.deco = 1, aHint.func = 1;
@@ -1478,7 +1451,7 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy
default:
break;
}
-
+
// set the hint
XChangeProperty( m_pDisplay,
pFrame->GetShellWindow(),
@@ -1489,7 +1462,7 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy
(unsigned char*)&aHint,
5 );
}
-
+
// set transientFor hint
/* #91030# dtwm will not map a dialogue if the transient
* window is iconified. This is deemed undesireable because
@@ -1518,7 +1491,7 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy
* sets _MOTIF_WM_HINTS
* _NET_WM_WINDOW_TYPE
* _NET_WM_STATE
- * WM_TRANSIENT_FOR
+ * WM_TRANSIENT_FOR
*/
void NetWMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eType, int nDecorationFlags, X11SalFrame* pReferenceFrame ) const
@@ -1685,8 +1658,8 @@ void WMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool bVert
pFrame->maRestorePosSize = aRestore;
pFrame->SetPosSize( aTarget );
- pFrame->nWidth_ = aTarget.GetWidth();
- pFrame->nHeight_ = aTarget.GetHeight();
+ pFrame->nWidth_ = aTarget.GetWidth();
+ pFrame->nHeight_ = aTarget.GetHeight();
XRaiseWindow( m_pDisplay,
pFrame->GetShellWindow()
);
@@ -1700,8 +1673,8 @@ void WMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool bVert
{
pFrame->SetPosSize( pFrame->maRestorePosSize );
pFrame->maRestorePosSize = Rectangle();
- pFrame->nWidth_ = rGeom.nWidth;
- pFrame->nHeight_ = rGeom.nHeight;
+ pFrame->nWidth_ = rGeom.nWidth;
+ pFrame->nHeight_ = rGeom.nHeight;
if( m_aWMName.EqualsAscii( "Dtwm" ) && pFrame->bMapped_ )
{
pFrame->maGeometry.nX += rGeom.nLeftDecoration;
@@ -1730,16 +1703,16 @@ void NetWMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool bV
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = bHorizontal ? 1 : 0;
- aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_HORZ ];
- aEvent.xclient.data.l[2] = bHorizontal == bVertical ? m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_VERT ] : 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = bHorizontal ? 1 : 0;
+ aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_HORZ ];
+ aEvent.xclient.data.l[2] = bHorizontal == bVertical ? m_aWMAtoms[ NET_WM_STATE_MAXIMIZED_VERT ] : 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -1795,18 +1768,18 @@ void GnomeWMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ WIN_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = (1<<2)|(1<<3);
- aEvent.xclient.data.l[1] =
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ WIN_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = (1<<2)|(1<<3);
+ aEvent.xclient.data.l[1] =
(bVertical ? (1<<2) : 0)
| (bHorizontal ? (1<<3) : 0);
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -1871,16 +1844,16 @@ void NetWMAdaptor::enableAlwaysOnTop( X11SalFrame* pFrame, bool bEnable ) const
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = bEnable ? 1 : 0;
- aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_STAYS_ON_TOP ];
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = bEnable ? 1 : 0;
+ aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_STAYS_ON_TOP ];
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -1905,16 +1878,16 @@ void GnomeWMAdaptor::enableAlwaysOnTop( X11SalFrame* pFrame, bool bEnable ) cons
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ WIN_LAYER ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = bEnable ? 6 : 4;
- aEvent.xclient.data.l[1] = 0;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ WIN_LAYER ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = bEnable ? 6 : 4;
+ aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -2133,16 +2106,16 @@ void NetWMAdaptor::shade( X11SalFrame* pFrame, bool bToShaded ) const
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = bToShaded ? 1 : 0;
- aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_SHADED ];
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = bToShaded ? 1 : 0;
+ aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_SHADED ];
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -2170,16 +2143,16 @@ void GnomeWMAdaptor::shade( X11SalFrame* pFrame, bool bToShaded ) const
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ WIN_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = (1<<5);
- aEvent.xclient.data.l[1] = bToShaded ? (1<<5) : 0;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ WIN_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = (1<<5);
+ aEvent.xclient.data.l[1] = bToShaded ? (1<<5) : 0;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -2222,16 +2195,16 @@ void NetWMAdaptor::showFullScreen( X11SalFrame* pFrame, bool bFullScreen ) const
{
// window already mapped, send WM a message
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = pFrame->GetShellWindow();
- aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = bFullScreen ? 1 : 0;
- aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ];
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_WM_STATE ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = bFullScreen ? 1 : 0;
+ aEvent.xclient.data.l[1] = m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ];
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
False,
@@ -2293,11 +2266,11 @@ int WMAdaptor::getCurrentWorkArea() const
int nCurrent = -1;
if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] )
{
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
if( XGetWindowProperty( m_pDisplay,
m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ),
m_aWMAtoms[ NET_CURRENT_DESKTOP ],
@@ -2332,11 +2305,11 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const
int nCurrent = -1;
if( m_aWMAtoms[ NET_WM_DESKTOP ] )
{
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
if( XGetWindowProperty( m_pDisplay,
aWindow,
m_aWMAtoms[ NET_WM_DESKTOP ],
@@ -2367,24 +2340,21 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const
* WMAdaptor::getCurrentWorkArea
*/
// fixme: multi screen case
-void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const
+void WMAdaptor::switchToWorkArea( int nWorkArea ) const
{
- if( bConsiderWM && ! getWMshouldSwitchWorkspace() )
- return;
-
if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] )
{
XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() );
- aEvent.xclient.message_type = m_aWMAtoms[ NET_CURRENT_DESKTOP ];
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = nWorkArea;
- aEvent.xclient.data.l[1] = 0;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() );
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_CURRENT_DESKTOP ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = nWorkArea;
+ aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
XSendEvent( m_pDisplay,
m_pSalDisplay->GetRootWindow( m_pSalDisplay->GetDefaultScreenNumber() ),
False,
@@ -2444,7 +2414,7 @@ void NetWMAdaptor::setFrameStruts( X11SalFrame* pFrame,
nData[11]= bottom_end_x;
Atom aProperty = None;
int nSetData = 0;
-
+
if( m_aWMAtoms[NET_WM_STRUT_PARTIAL] )
{
aProperty = m_aWMAtoms[NET_WM_STRUT_PARTIAL];
diff --git a/vcl/unx/source/desktopdetect/desktopdetector.cxx b/vcl/unx/source/desktopdetect/desktopdetector.cxx
index cb3574591bcf..20468e71c36c 100644
--- a/vcl/unx/source/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/source/desktopdetect/desktopdetector.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,10 +42,9 @@
#include "osl/thread.h"
#include <unistd.h>
-#include <string.h>
-using ::rtl::OUString;
-using ::rtl::OString;
+using namespace rtl;
+
enum {
DESKTOP_NONE = 0,
DESKTOP_UNKNOWN,
@@ -60,13 +59,13 @@ static const char * desktop_strings[] = { "none", "unknown", "GNOME", "KDE", "KD
static bool is_gnome_desktop( Display* pDisplay )
{
bool ret = false;
-
+
// warning: these checks are coincidental, GNOME does not
// explicitly advertise itself
-
+
if ( NULL != getenv( "GNOME_DESKTOP_SESSION_ID" ) )
ret = true;
-
+
if( ! ret )
{
Atom nAtom1 = XInternAtom( pDisplay, "GNOME_SM_PROXY", True );
@@ -87,11 +86,11 @@ static bool is_gnome_desktop( Display* pDisplay )
}
}
}
-
+
if( ! ret )
{
- Atom nUTFAtom = XInternAtom( pDisplay, "UTF8_STRING", True );
- Atom nNetWMNameAtom = XInternAtom( pDisplay, "_NET_WM_NAME", True );
+ Atom nUTFAtom = XInternAtom( pDisplay, "UTF8_STRING", True );
+ Atom nNetWMNameAtom = XInternAtom( pDisplay, "_NET_WM_NAME", True );
if( nUTFAtom && nNetWMNameAtom )
{
// another, more expensive check: search for a gnome-panel
@@ -151,7 +150,7 @@ extern "C"
bWasXError = true;
return 0;
}
-
+
typedef int(* XErrorHandler)(Display*,XErrorEvent*);
}
@@ -167,11 +166,11 @@ static int KDEVersion( Display* pDisplay )
if( !nKDEVersion )
return 3;
- Atom aRealType = None;
- int nFormat = 8;
- unsigned long nItems = 0;
- unsigned long nBytesLeft = 0;
- unsigned char* pProperty = NULL;
+ Atom aRealType = None;
+ int nFormat = 8;
+ unsigned long nItems = 0;
+ unsigned long nBytesLeft = 0;
+ unsigned char* pProperty = NULL;
XGetWindowProperty( pDisplay,
DefaultRootWindow( pDisplay ),
nKDEVersion,
@@ -185,7 +184,7 @@ static int KDEVersion( Display* pDisplay )
&pProperty );
if( !WasXError() && nItems != 0 && pProperty )
{
- nRet = *reinterpret_cast< sal_Int32* >( pProperty );
+ nRet = *reinterpret_cast< sal_Int32* >( pProperty );
}
if( pProperty )
{
@@ -247,23 +246,23 @@ static bool is_cde_desktop( Display* pDisplay )
osl_unloadModule( (oslModule)pLibrary );
return true;
}
-
+
return false;
}
extern "C"
{
-
+
VCL_DLLPUBLIC rtl::OUString get_desktop_environment()
{
rtl::OUStringBuffer aRet( 8 );
static const char *pOverride = getenv( "OOO_FORCE_DESKTOP" );
-
+
if ( pOverride && *pOverride )
{
OString aOver( pOverride );
-
+
if ( aOver.equalsIgnoreAsciiCase( "cde" ) )
aRet.appendAscii( desktop_strings[DESKTOP_CDE] );
if ( aOver.equalsIgnoreAsciiCase( "kde4" ) )
@@ -280,35 +279,26 @@ VCL_DLLPUBLIC rtl::OUString get_desktop_environment()
{
// get display to connect to
const char* pDisplayStr = getenv( "DISPLAY" );
-
- const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" );
-
- if (pUsePlugin && (strcmp(pUsePlugin, "svp") == 0))
- pDisplayStr = NULL;
- else
+ int nParams = osl_getCommandArgCount();
+ OUString aParam;
+ OString aBParm;
+ for( int i = 0; i < nParams; i++ )
{
- int nParams = osl_getCommandArgCount();
- OUString aParam;
- OString aBParm;
- for( int i = 0; i < nParams; i++ )
+ osl_getCommandArg( i, &aParam.pData );
+ if( aParam.equalsAscii( "-headless" ) )
{
- osl_getCommandArg( i, &aParam.pData );
- if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-headless" ) ) ||
- aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--headless" ) ) )
- {
- pDisplayStr = NULL;
- break;
- }
- if( i < nParams-1 && (aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--display" ) )) )
- {
- osl_getCommandArg( i+1, &aParam.pData );
- aBParm = OUStringToOString( aParam, osl_getThreadTextEncoding() );
- pDisplayStr = aBParm.getStr();
- break;
- }
+ pDisplayStr = NULL;
+ break;
+ }
+ if( i < nParams-1 && (aParam.equalsAscii( "-display" ) || aParam.equalsAscii( "--display" )) )
+ {
+ osl_getCommandArg( i+1, &aParam.pData );
+ aBParm = OUStringToOString( aParam, osl_getThreadTextEncoding() );
+ pDisplayStr = aBParm.getStr();
+ break;
}
}
-
+
// no server at all
if( ! pDisplayStr || !*pDisplayStr )
aRet.appendAscii( desktop_strings[DESKTOP_NONE] );
@@ -323,12 +313,12 @@ VCL_DLLPUBLIC rtl::OUString get_desktop_environment()
*/
if( ! ( pNoXInitThreads && *pNoXInitThreads ) )
XInitThreads();
-
+
Display* pDisplay = XOpenDisplay( pDisplayStr );
if( pDisplay )
{
XErrorHandler pOldHdl = XSetErrorHandler( autodect_error_handler );
-
+
if ( is_kde4_desktop( pDisplay ) )
aRet.appendAscii( desktop_strings[DESKTOP_KDE4] );
else if ( is_gnome_desktop( pDisplay ) )
@@ -339,10 +329,10 @@ VCL_DLLPUBLIC rtl::OUString get_desktop_environment()
aRet.appendAscii( desktop_strings[DESKTOP_KDE] );
else
aRet.appendAscii( desktop_strings[DESKTOP_UNKNOWN] );
-
+
// set the default handler again
XSetErrorHandler( pOldHdl );
-
+
XCloseDisplay( pDisplay );
}
}
diff --git a/vcl/unx/source/dtrans/X11_clipboard.cxx b/vcl/unx/source/dtrans/X11_clipboard.cxx
index 4f1934397397..18b0bb4e575f 100644
--- a/vcl/unx/source/dtrans/X11_clipboard.cxx
+++ b/vcl/unx/source/dtrans/X11_clipboard.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,10 +53,9 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::awt;
using namespace cppu;
using namespace osl;
+using namespace rtl;
using namespace x11;
-using ::rtl::OUString;
-
X11Clipboard::X11Clipboard( SelectionManager& rManager, Atom aSelection ) :
::cppu::WeakComponentImplHelper4<
::com::sun::star::datatransfer::clipboard::XClipboardEx,
@@ -80,7 +79,7 @@ X11Clipboard::X11Clipboard( SelectionManager& rManager, Atom aSelection ) :
else
{
m_rSelectionManager.registerHandler( XA_PRIMARY, *this );
- m_rSelectionManager.registerHandler( m_rSelectionManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) ), *this );
+ m_rSelectionManager.registerHandler( m_rSelectionManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ), *this );
}
}
@@ -98,7 +97,7 @@ X11Clipboard::~X11Clipboard()
else
{
m_rSelectionManager.deregisterHandler( XA_PRIMARY );
- m_rSelectionManager.deregisterHandler( m_rSelectionManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) ) );
+ m_rSelectionManager.deregisterHandler( m_rSelectionManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ) );
}
}
@@ -109,7 +108,7 @@ void X11Clipboard::fireChangedContentsEvent()
{
ClearableMutexGuard aGuard( m_rSelectionManager.getMutex() );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "X11Clipboard::fireChangedContentsEvent for %s (%" SAL_PRI_SIZET "u listeners)\n",
+ fprintf( stderr, "X11Clipboard::fireChangedContentsEvent for %s (%d listeners)\n",
OUStringToOString( m_rSelectionManager.getString( m_aSelection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(), m_aListeners.size() );
#endif
::std::list< Reference< XClipboardListener > > listeners( m_aListeners );
@@ -138,7 +137,7 @@ void X11Clipboard::clearContents()
// clear members
m_aOwner.clear();
m_aContents.clear();
-
+
// release the mutex
aGuard.clear();
@@ -183,7 +182,7 @@ void SAL_CALL X11Clipboard::setContents(
else
{
m_rSelectionManager.requestOwnership( XA_PRIMARY );
- m_rSelectionManager.requestOwnership( m_rSelectionManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) ) );
+ m_rSelectionManager.requestOwnership( m_rSelectionManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ) );
}
// notify old owner on loss of ownership
@@ -262,7 +261,7 @@ Reference< XInterface > X11Clipboard::getReference() throw()
OUString SAL_CALL X11Clipboard::getImplementationName( )
throw(RuntimeException)
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM(X11_CLIPBOARD_IMPLEMENTATION_NAME));
+ return OUString::createFromAscii(X11_CLIPBOARD_IMPLEMENTATION_NAME);
}
// ------------------------------------------------------------------------
@@ -287,7 +286,7 @@ void SAL_CALL X11Clipboard::initialize( const Sequence< Any >& ) throw( ::com::s
// ------------------------------------------------------------------------
-Sequence< OUString > SAL_CALL X11Clipboard::getSupportedServiceNames( )
+Sequence< OUString > SAL_CALL X11Clipboard::getSupportedServiceNames( )
throw(RuntimeException)
{
return X11Clipboard_getSupportedServiceNames();
diff --git a/vcl/unx/source/dtrans/X11_clipboard.hxx b/vcl/unx/source/dtrans/X11_clipboard.hxx
index 73240d8715e6..05303e58f2af 100644
--- a/vcl/unx/source/dtrans/X11_clipboard.hxx
+++ b/vcl/unx/source/dtrans/X11_clipboard.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,13 +51,13 @@ namespace x11 {
>,
public SelectionAdaptor
{
- 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;
+ Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
+ Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
- SelectionManager& m_rSelectionManager;
- 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;
+ SelectionManager& m_rSelectionManager;
+ Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
+ ::std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+ Atom m_aSelection;
protected:
@@ -76,7 +76,7 @@ namespace x11 {
static X11Clipboard* get( const ::rtl::OUString& rDisplayName, Atom aSelection );
/*
- * XInitialization
+ * XInitialization
*/
virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
@@ -84,29 +84,29 @@ namespace x11 {
* XServiceInfo
*/
- virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
throw(RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw(RuntimeException);
- virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw(RuntimeException);
/*
* XClipboard
*/
- virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw(RuntimeException);
- virtual void SAL_CALL setContents(
- 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 )
+ virtual void SAL_CALL setContents(
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(RuntimeException);
- virtual ::rtl::OUString SAL_CALL getName()
- throw(RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getName()
+ throw(RuntimeException);
/*
* XClipboardEx
@@ -118,28 +118,28 @@ namespace x11 {
/*
* XClipboardNotifier
*/
- virtual void SAL_CALL addClipboardListener(
- const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ virtual void SAL_CALL addClipboardListener(
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
- virtual void SAL_CALL removeClipboardListener(
- 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 )
+ throw(RuntimeException);
/*
- * SelectionAdaptor
+ * SelectionAdaptor
*/
- virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
+ virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
virtual void clearTransferable();
virtual void fireContentsChanged();
- virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
+ virtual Reference< XInterface > getReference() throw();
};
// ------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL X11Clipboard_getSupportedServiceNames();
- com::sun::star::uno::Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
- const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
+ Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
+ const Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_dndcontext.cxx b/vcl/unx/source/dtrans/X11_dndcontext.cxx
index 988dce430a51..49baa396d121 100644
--- a/vcl/unx/source/dtrans/X11_dndcontext.cxx
+++ b/vcl/unx/source/dtrans/X11_dndcontext.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,7 +36,7 @@ using namespace cppu;
using namespace x11;
/*
- * DropTargetDropContext
+ * DropTargetDropContext
*/
DropTargetDropContext::DropTargetDropContext(
@@ -71,7 +71,7 @@ void DropTargetDropContext::dropComplete( sal_Bool success ) throw()
/*
- * DropTargetDragContext
+ * DropTargetDragContext
*/
DropTargetDragContext::DropTargetDragContext(
@@ -100,7 +100,7 @@ void DropTargetDragContext::rejectDrag() throw()
}
/*
- * DragSourceContext
+ * DragSourceContext
*/
DragSourceContext::DragSourceContext(
diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx
index bca708eb24c7..74d69cda0785 100644
--- a/vcl/unx/source/dtrans/X11_dndcontext.hxx
+++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,7 +52,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ 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;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ Reference< XInterface > m_xManagerRef;
public:
DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDragContext();
@@ -89,16 +89,16 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xManagerRef;
+ Reference< XInterface > m_xManagerRef;
public:
DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DragSourceContext();
// XDragSourceContext
- virtual sal_Int32 SAL_CALL getCurrentCursor() throw();
- virtual void SAL_CALL setCursor( sal_Int32 cursorId ) throw();
- virtual void SAL_CALL setImage( sal_Int32 imageId ) throw();
- virtual void SAL_CALL transferablesFlavorsChanged() throw();
+ virtual sal_Int32 SAL_CALL getCurrentCursor() throw();
+ virtual void SAL_CALL setCursor( sal_Int32 cursorId ) throw();
+ virtual void SAL_CALL setImage( sal_Int32 imageId ) throw();
+ virtual void SAL_CALL transferablesFlavorsChanged() throw();
};
} // namespace
diff --git a/vcl/unx/source/dtrans/X11_droptarget.cxx b/vcl/unx/source/dtrans/X11_droptarget.cxx
index d72c5c4c7eeb..ee35860ad7a7 100644
--- a/vcl/unx/source/dtrans/X11_droptarget.cxx
+++ b/vcl/unx/source/dtrans/X11_droptarget.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,13 +32,12 @@
#include <X11_selection.hxx>
using namespace x11;
+using namespace rtl;
using namespace com::sun::star::lang;
using namespace com::sun::star::awt;
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::dnd;
-using ::rtl::OUString;
-
DropTarget::DropTarget() :
::cppu::WeakComponentImplHelper3<
XDropTarget,
@@ -197,14 +196,14 @@ void DropTarget::dragOver( const DropTargetDragEvent& dtde ) throw()
// --------------------------------------------------------------------------
/*
- * XServiceInfo
+ * XServiceInfo
*/
// ------------------------------------------------------------------------
OUString DropTarget::getImplementationName() throw()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM(XDND_DROPTARGET_IMPLEMENTATION_NAME));
+ return OUString::createFromAscii(XDND_DROPTARGET_IMPLEMENTATION_NAME);
}
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index cd6f21327770..d06cb261b6f8 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -76,18 +76,12 @@
#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
-#define DRAG_EVENT_MASK ButtonPressMask |\
- ButtonReleaseMask |\
- PointerMotionMask |\
- EnterWindowMask |\
+#define DRAG_EVENT_MASK ButtonPressMask |\
+ ButtonReleaseMask |\
+ PointerMotionMask |\
+ 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;
@@ -95,13 +89,10 @@ using namespace com::sun::star::awt;
using namespace com::sun::star::uno;
using namespace com::sun::star::frame;
using namespace cppu;
+using namespace rtl;
using namespace x11;
-using ::rtl::OUString;
-using ::rtl::OUStringHash;
-using ::rtl::OStringToOUString;
-
// stubs to satisfy solaris compiler's rather rigid linking warning
extern "C"
{
@@ -123,10 +114,10 @@ static const long nXdndProtocolRevision = 5;
// and X convention types
struct NativeTypeEntry
{
- Atom nAtom;
- const char* pType; // Mime encoding on our side
- const char* pNativeType; // string corresponding to nAtom for the case of nAtom being uninitialized
- int nFormat; // the corresponding format
+ Atom nAtom;
+ const char* pType; // Mime encoding on our side
+ const char* pNativeType; // string corresponding to nAtom for the case of nAtom being uninitialized
+ int nFormat; // the corresponding format
};
// the convention for Xdnd is mime types as specified by the corresponding
@@ -218,9 +209,9 @@ rtl_TextEncoding x11::getTextPlainEncoding( const OUString& rMimeType )
// ------------------------------------------------------------------------
-::boost::unordered_map< OUString, SelectionManager*, OUStringHash >& SelectionManager::getInstances()
+::std::hash_map< OUString, SelectionManager*, OUStringHash >& SelectionManager::getInstances()
{
- static ::boost::unordered_map< OUString, SelectionManager*, OUStringHash > aInstances;
+ static ::std::hash_map< OUString, SelectionManager*, OUStringHash > aInstances;
return aInstances;
}
@@ -289,14 +280,13 @@ SelectionManager::SelectionManager() :
m_nXdndActionMove( None ),
m_nXdndActionLink( None ),
m_nXdndActionAsk( None ),
- m_nXdndActionPrivate( None ),
- m_bShutDown( false )
+ m_nXdndActionPrivate( None )
{
- m_aDropEnterEvent.data.l[0] = None;
+ m_aDropEnterEvent.data.l[0] = None;
m_aDragRunning.reset();
}
-XLIB_Cursor SelectionManager::createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY )
+XLIB_Cursor SelectionManager::createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY )
{
Pixmap aPointer;
Pixmap aMask;
@@ -313,13 +303,13 @@ XLIB_Cursor SelectionManager::createCursor( const unsigned char* pPointerData, c
aPointer =
XCreateBitmapFromData( m_pDisplay,
m_aWindow,
- reinterpret_cast<const char*>(pPointerData),
+ pPointerData,
width,
height );
aMask
= XCreateBitmapFromData( m_pDisplay,
m_aWindow,
- reinterpret_cast<const char*>(pMaskData),
+ pMaskData,
width,
height );
XLIB_Cursor aCursor =
@@ -340,11 +330,11 @@ void SelectionManager::initialize( const Sequence< Any >& arguments ) throw (::c
if( ! m_xDisplayConnection.is() )
{
/*
- * first argument must be a ::com::sun::star::awt::XDisplayConnection
- * from this we will get the XEvents of the vcl event loop by
- * registering us as XEventHandler on it.
+ * first argument must be a ::com::sun::star::awt::XDisplayConnection
+ * from this we will get the XEvents of the vcl event loop by
+ * registering us as XEventHandler on it.
*
- * implementor's note:
+ * implementor's note:
* FIXME:
* finally the clipboard and XDND service is back in the module it belongs
* now cleanup and sharing of resources with the normal vcl event loop
@@ -387,33 +377,34 @@ void SelectionManager::initialize( const Sequence< Any >& arguments ) throw (::c
XSynchronize( m_pDisplay, True );
#endif
// clipboard selection
- m_nCLIPBOARDAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
+ m_nCLIPBOARDAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
// special targets
- m_nTARGETSAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("TARGETS")) );
+ m_nTARGETSAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("TARGETS")) );
m_nTIMESTAMPAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP")) );
- m_nTEXTAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("TEXT")) );
- m_nINCRAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("INCR")) );
- m_nCOMPOUNDAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("COMPOUND_TEXT")) );
- m_nMULTIPLEAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("MULTIPLE")) );
- m_nUTF16Atom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("ISO10646-1")) );
+ m_nTEXTAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("TEXT")) );
+ m_nINCRAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("INCR")) );
+ m_nCOMPOUNDAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("COMPOUND_TEXT")) );
+ m_nMULTIPLEAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("MULTIPLE")) );
+ m_nUTF16Atom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("ISO10646-1")) );
+// m_nUTF16Atom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=ISO-10646-UCS-2")) );
m_nImageBmpAtom = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("image/bmp")) );
// Atoms for Xdnd protocol
- m_nXdndAware = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndAware")) );
- m_nXdndEnter = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndEnter")) );
- m_nXdndLeave = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndLeave")) );
- m_nXdndPosition = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndPosition")) );
- m_nXdndStatus = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndStatus")) );
- m_nXdndDrop = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndDrop")) );
- m_nXdndFinished = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndFinished")) );
- m_nXdndSelection = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndSelection")) );
- m_nXdndTypeList = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndTypeList")) );
- m_nXdndProxy = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndProxy")) );
- m_nXdndActionCopy = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionCopy")) );
- m_nXdndActionMove = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionMove")) );
- m_nXdndActionLink = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionLink")) );
- m_nXdndActionAsk = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionAsk")) );
+ m_nXdndAware = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndAware")) );
+ m_nXdndEnter = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndEnter")) );
+ m_nXdndLeave = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndLeave")) );
+ m_nXdndPosition = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndPosition")) );
+ m_nXdndStatus = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndStatus")) );
+ m_nXdndDrop = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndDrop")) );
+ m_nXdndFinished = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndFinished")) );
+ m_nXdndSelection = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndSelection")) );
+ m_nXdndTypeList = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndTypeList")) );
+ m_nXdndProxy = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndProxy")) );
+ m_nXdndActionCopy = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionCopy")) );
+ m_nXdndActionMove = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionMove")) );
+ m_nXdndActionLink = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionLink")) );
+ m_nXdndActionAsk = getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionAsk")) );
m_nXdndActionPrivate= getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("XdndActionPrivate")) );
// initialize map with member none
@@ -488,7 +479,7 @@ SelectionManager::~SelectionManager()
{
osl::MutexGuard aGuard( *osl::Mutex::getGlobalMutex() );
- ::boost::unordered_map< OUString, SelectionManager*, OUStringHash >::iterator it;
+ ::std::hash_map< OUString, SelectionManager*, OUStringHash >::iterator it;
for( it = getInstances().begin(); it != getInstances().end(); ++it )
if( it->second == this )
{
@@ -553,7 +544,7 @@ SelectionManager::~SelectionManager()
SelectionAdaptor* SelectionManager::getAdaptor( Atom selection )
{
- ::boost::unordered_map< Atom, Selection* >::iterator it =
+ ::std::hash_map< Atom, Selection* >::iterator it =
m_aSelections.find( selection );
return it != m_aSelections.end() ? it->second->m_pAdaptor : NULL;
}
@@ -571,10 +562,10 @@ OUString SelectionManager::convertFromCompound( const char* pText, int nLen )
int nTexts = 0;
XTextProperty aProp;
- aProp.value = (unsigned char*)pText;
- aProp.encoding = m_nCOMPOUNDAtom;
- aProp.format = 8;
- aProp.nitems = nLen;
+ aProp.value = (unsigned char*)pText;
+ aProp.encoding = m_nCOMPOUNDAtom;
+ aProp.format = 8;
+ aProp.nitems = nLen;
XmbTextPropertyToTextList( m_pDisplay,
&aProp,
&pTextList,
@@ -613,7 +604,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
aRet = (char*)aProp.value;
XFree( aProp.value );
#ifdef SOLARIS
- /*
+ /* #97070#
* for currently unknown reasons XmbTextListToTextProperty on Solaris returns
* no data in ISO8859-n encodings (at least for n = 1, 15)
* in these encodings the directly converted text does the
@@ -632,7 +623,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
// ------------------------------------------------------------------------
bool SelectionManager::convertData(
- const css::uno::Reference< XTransferable >& xTransferable,
+ const Reference< XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int& rFormat,
@@ -720,7 +711,7 @@ SelectionManager& SelectionManager::get( const OUString& rDisplayName )
aDisplayName = OStringToOUString( getenv( "DISPLAY" ), RTL_TEXTENCODING_ISO_8859_1 );
SelectionManager* pInstance = NULL;
- ::boost::unordered_map< OUString, SelectionManager*, OUStringHash >::iterator it = getInstances().find( aDisplayName );
+ ::std::hash_map< OUString, SelectionManager*, OUStringHash >::iterator it = getInstances().find( aDisplayName );
if( it != getInstances().end() )
pInstance = it->second;
else pInstance = getInstances()[ aDisplayName ] = new SelectionManager();
@@ -734,7 +725,7 @@ const OUString& SelectionManager::getString( Atom aAtom )
{
osl::MutexGuard aGuard(m_aMutex);
- ::boost::unordered_map< Atom, OUString >::const_iterator it;
+ ::std::hash_map< Atom, OUString >::const_iterator it;
if( ( it = m_aAtomToString.find( aAtom ) ) == m_aAtomToString.end() )
{
static OUString aEmpty;
@@ -755,7 +746,7 @@ Atom SelectionManager::getAtom( const OUString& rString )
{
osl::MutexGuard aGuard(m_aMutex);
- ::boost::unordered_map< OUString, Atom, OUStringHash >::const_iterator it;
+ ::std::hash_map< OUString, Atom, OUStringHash >::const_iterator it;
if( ( it = m_aStringToAtom.find( rString ) ) == m_aStringToAtom.end() )
{
static Atom nNoDisplayAtoms = 1;
@@ -910,7 +901,7 @@ OUString SelectionManager::convertTypeFromNative( Atom nType, Atom selection, in
bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData )
{
osl::ResettableMutexGuard aGuard(m_aMutex);
- ::boost::unordered_map< Atom, Selection* >::iterator it;
+ ::std::hash_map< Atom, Selection* >::iterator it;
bool bSuccess = false;
#if OSL_DEBUG_LEVEL > 1
@@ -948,9 +939,9 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In
XDeleteProperty( m_pDisplay, m_aWindow, selection );
XConvertSelection( m_pDisplay, selection, type, selection, m_aWindow, selection == m_nXdndSelection ? m_nDropTime : CurrentTime );
- it->second->m_eState = Selection::WaitingForResponse;
- it->second->m_aRequestedType = type;
- it->second->m_aData = Sequence< sal_Int8 >();
+ it->second->m_eState = Selection::WaitingForResponse;
+ it->second->m_aRequestedType = type;
+ it->second->m_aData = Sequence< sal_Int8 >();
it->second->m_aDataArrived.reset();
// really start the request; if we don't flush the
// queue the request won't leave it because there are no more
@@ -1048,9 +1039,10 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In
bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rType, Sequence< sal_Int8 >& rData )
{
+ int nFormat;
bool bSuccess = false;
- ::boost::unordered_map< Atom, Selection* >::iterator it;
+ ::std::hash_map< Atom, Selection* >::iterator it;
{
osl::MutexGuard aGuard(m_aMutex);
@@ -1106,8 +1098,8 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
for( int i = 0; i < rTypes.getLength(); i++ )
{
rtl_TextEncoding aEncoding = getTextPlainEncoding( rTypes.getConstArray()[i].MimeType );
- if( aEncoding != RTL_TEXTENCODING_DONTKNOW &&
- aEncoding != RTL_TEXTENCODING_UNICODE &&
+ if( aEncoding != RTL_TEXTENCODING_DONTKNOW &&
+ aEncoding != RTL_TEXTENCODING_UNICODE &&
getPasteData( selection,
rNativeTypes[i],
aData )
@@ -1231,7 +1223,6 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
if( ! bSuccess )
{
- int nFormat;
::std::list< Atom > aTypes;
convertTypeToNative( rType, selection, nFormat, aTypes );
::std::list< Atom >::const_iterator type_it;
@@ -1246,7 +1237,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
bSuccess = getPasteData( selection, nSelectedType, rData );
}
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "getPasteData for selection %s and data type %s returns %s, returned sequence has length %" SAL_PRIdINT32 "\n",
+ fprintf( stderr, "getPasteData for selection %s and data type %s returns %s, returned sequence has length %ld\n",
OUStringToOString( getString( selection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
bSuccess ? "true" : "false",
@@ -1260,13 +1251,13 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >& rTypes )
{
- ::boost::unordered_map< Atom, Selection* >::iterator it;
+ ::std::hash_map< Atom, Selection* >::iterator it;
{
osl::MutexGuard aGuard(m_aMutex);
it = m_aSelections.find( selection );
- if( it != m_aSelections.end() &&
- it->second->m_aTypes.getLength() &&
+ if( it != m_aSelections.end() &&
+ it->second->m_aTypes.getLength() &&
abs( it->second->m_nLastTimestamp - time( NULL ) ) < 2
)
{
@@ -1431,26 +1422,27 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
{
if( bSuccess )
{
- it->second->m_aTypes = rTypes;
- it->second->m_aNativeTypes = aNativeTypes;
- it->second->m_nLastTimestamp = time( NULL );
- it->second->m_bHaveUTF16 = bHaveUTF16;
+ it->second->m_aTypes = rTypes;
+ it->second->m_aNativeTypes = aNativeTypes;
+ it->second->m_nLastTimestamp = time( NULL );
+ it->second->m_bHaveUTF16 = bHaveUTF16;
it->second->m_aUTF8Type = aUTF8Type;
- it->second->m_bHaveCompound = bHaveCompound;
+ it->second->m_bHaveCompound = bHaveCompound;
}
else
{
- it->second->m_aTypes = Sequence< DataFlavor >();
- it->second->m_aNativeTypes = std::vector< Atom >();
- it->second->m_nLastTimestamp = 0;
- it->second->m_bHaveUTF16 = false;
+ it->second->m_aTypes = Sequence< DataFlavor >();
+ it->second->m_aNativeTypes = std::vector< Atom >();
+ it->second->m_nLastTimestamp = 0;
+ it->second->m_bHaveUTF16 = false;
it->second->m_aUTF8Type = None;
- it->second->m_bHaveCompound = false;
+ it->second->m_bHaveCompound = false;
}
}
}
#if OSL_DEBUG_LEVEL > 1
+// if( selection != m_nCLIPBOARDAtom )
{
fprintf( stderr, "SelectionManager::getPasteDataTypes( %s ) = %s\n", OUStringToOString( getString( selection ), RTL_TEXTENCODING_ISO_8859_1 ).getStr(), bSuccess ? "true" : "false" );
for( int i = 0; i < rTypes.getLength(); i++ )
@@ -1465,7 +1457,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
PixmapHolder* SelectionManager::getPixmapHolder( Atom selection )
{
- boost::unordered_map< Atom, Selection* >::const_iterator it = m_aSelections.find( selection );
+ std::hash_map< Atom, Selection* >::const_iterator it = m_aSelections.find( selection );
if( it == m_aSelections.end() )
return NULL;
if( ! it->second->m_pPixmap )
@@ -1522,7 +1514,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "trying bitmap conversion\n" );
#endif
- css::uno::Reference<XBitmap> xBM( new BmpTransporter( aData ) );
+ Reference<XBitmap> xBM( new BmpTransporter( aData ) );
Sequence<Any> aArgs(2), aOutArgs;
Sequence<sal_Int16> aOutIndex;
aArgs.getArray()[0] = makeAny( xBM );
@@ -1587,10 +1579,10 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
{
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "using INCR protocol\n" );
- boost::unordered_map< XLIB_Window, boost::unordered_map< Atom, IncrementalTransfer > >::const_iterator win_it = m_aIncrementals.find( requestor );
+ std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > >::const_iterator win_it = m_aIncrementals.find( requestor );
if( win_it != m_aIncrementals.end() )
{
- boost::unordered_map< Atom, IncrementalTransfer >::const_iterator inc_it = win_it->second.find( property );
+ std::hash_map< Atom, IncrementalTransfer >::const_iterator inc_it = win_it->second.find( property );
if( inc_it != win_it->second.end() )
{
const IncrementalTransfer& rInc = inc_it->second;
@@ -1604,14 +1596,14 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
#endif
// insert IncrementalTransfer
- IncrementalTransfer& rInc = m_aIncrementals[ requestor ][ property ];
- rInc.m_aData = aData;
- rInc.m_nBufferPos = 0;
- rInc.m_aRequestor = requestor;
- rInc.m_aProperty = property;
- rInc.m_aTarget = target;
- rInc.m_nFormat = nFormat;
- rInc.m_nTransferStartTime = time( NULL );
+ IncrementalTransfer& rInc = m_aIncrementals[ requestor ][ property ];
+ rInc.m_aData = aData;
+ rInc.m_nBufferPos = 0;
+ rInc.m_aRequestor = requestor;
+ rInc.m_aProperty = property;
+ rInc.m_aTarget = target;
+ rInc.m_nFormat = nFormat;
+ rInc.m_nTransferStartTime = time( NULL );
// use incr protocol, signal start to requestor
long nMinSize = m_nIncrementalThreshold;
@@ -1669,7 +1661,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
if( pAdaptor &&
XGetSelectionOwner( m_pDisplay, rRequest.selection ) == m_aWindow )
{
- css::uno::Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
+ Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
if( rRequest.target == m_nTARGETSAtom )
{
// someone requests our types
@@ -1820,25 +1812,25 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
}
XSendEvent( m_pDisplay, rRequest.requestor, False, 0, &aNotify );
- if( rRequest.selection == XA_PRIMARY &&
- m_bWaitingForPrimaryConversion &&
+ if( rRequest.selection == XA_PRIMARY &&
+ m_bWaitingForPrimaryConversion &&
m_xDragSourceListener.is() )
{
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, rRequest.time, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, rRequest.time, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
if( aNotify.xselection.property != None )
{
- dsde.DropAction = DNDConstants::ACTION_COPY;
- dsde.DropSuccess = sal_True;
+ dsde.DropAction = DNDConstants::ACTION_COPY;
+ dsde.DropSuccess = sal_True;
}
else
{
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
}
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
if( xListener.is() )
@@ -1861,12 +1853,12 @@ bool SelectionManager::handleReceivePropertyNotify( XPropertyEvent& rNotify )
#endif
bool bHandled = false;
- ::boost::unordered_map< Atom, Selection* >::iterator it =
+ ::std::hash_map< Atom, Selection* >::iterator it =
m_aSelections.find( rNotify.atom );
if( it != m_aSelections.end() &&
rNotify.state == PropertyNewValue &&
- ( it->second->m_eState == Selection::WaitingForResponse ||
- it->second->m_eState == Selection::WaitingForData ||
+ ( it->second->m_eState == Selection::WaitingForResponse ||
+ it->second->m_eState == Selection::WaitingForData ||
it->second->m_eState == Selection::IncrementalTransfer
)
)
@@ -1986,13 +1978,13 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify )
// feed incrementals
if( rNotify.state == PropertyDelete )
{
- boost::unordered_map< XLIB_Window, boost::unordered_map< Atom, IncrementalTransfer > >::iterator it;
+ std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > >::iterator it;
it = m_aIncrementals.find( rNotify.window );
if( it != m_aIncrementals.end() )
{
bHandled = true;
int nCurrentTime = time( NULL );
- boost::unordered_map< Atom, IncrementalTransfer >::iterator inc_it;
+ std::hash_map< Atom, IncrementalTransfer >::iterator inc_it;
// throw out aborted transfers
std::list< Atom > aTimeouts;
for( inc_it = it->second.begin(); inc_it != it->second.end(); ++inc_it )
@@ -2090,7 +2082,7 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify )
if( rNotify.requestor != m_aWindow && rNotify.requestor != m_aCurrentDropWindow )
fprintf( stderr, "Warning: selection notify for unknown window 0x%lx\n", rNotify.requestor );
#endif
- ::boost::unordered_map< Atom, Selection* >::iterator it =
+ ::std::hash_map< Atom, Selection* >::iterator it =
m_aSelections.find( rNotify.selection );
if (
(rNotify.requestor == m_aWindow || rNotify.requestor == m_aCurrentDropWindow) &&
@@ -2133,9 +2125,9 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify )
&nItems, &nBytes,
&pData );
}
- it->second->m_eState = Selection::Inactive;
+ it->second->m_eState = Selection::Inactive;
sal_Size nUnitSize = GetTrueFormatSize(nFormat);
- it->second->m_aData = Sequence< sal_Int8 >((sal_Int8*)pData, nItems * nUnitSize);
+ it->second->m_aData = Sequence< sal_Int8 >((sal_Int8*)pData, nItems * nUnitSize);
it->second->m_aDataArrived.set();
if( pData )
XFree( pData );
@@ -2146,8 +2138,8 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify )
else if( rNotify.property == None )
{
// conversion failed, stop transfer
- it->second->m_eState = Selection::Inactive;
- it->second->m_aData = Sequence< sal_Int8 >();
+ it->second->m_eState = Selection::Inactive;
+ it->second->m_aData = Sequence< sal_Int8 >();
it->second->m_aDataArrived.set();
}
// get the bytes, by INCR if necessary
@@ -2173,7 +2165,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
bool bHandled = false;
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::iterator it =
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::iterator it =
m_aDropTargets.find( aTarget );
#if OSL_DEBUG_LEVEL > 1
@@ -2198,7 +2190,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
m_bDropWaitingForCompletion && m_aDropEnterEvent.data.l[0] )
{
bHandled = true;
- OSL_FAIL( "someone forgot to call dropComplete ?" );
+ OSL_ENSURE( 0, "someone forgot to call dropComplete ?" );
// some listener forgot to call dropComplete in the last operation
// let us end it now and accept the new enter event
aGuard.clear();
@@ -2214,10 +2206,10 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
if( rMessage.message_type == m_nXdndEnter )
{
bHandled = true;
- m_aDropEnterEvent = rMessage;
- m_bDropEnterSent = false;
- m_aCurrentDropWindow = aTarget;
- m_nCurrentProtocolVersion = m_aDropEnterEvent.data.l[1] >> 24;
+ m_aDropEnterEvent = rMessage;
+ m_bDropEnterSent = false;
+ m_aCurrentDropWindow = aTarget;
+ m_nCurrentProtocolVersion = m_aDropEnterEvent.data.l[1] >> 24;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "received XdndEnter on 0x%lx\n", aTarget );
#endif
@@ -2245,10 +2237,10 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
fprintf( stderr, "received XdndPosition on 0x%lx (%d, %d)\n", aTarget, m_nLastX, m_nLastY );
#endif
DropTargetDragEnterEvent aEvent;
- aEvent.Source = static_cast< XDropTarget* >(it->second.m_pTarget);
- aEvent.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- aEvent.LocationX = m_nLastX;
- aEvent.LocationY = m_nLastY;
+ aEvent.Source = static_cast< XDropTarget* >(it->second.m_pTarget);
+ aEvent.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ aEvent.LocationX = m_nLastX;
+ aEvent.LocationY = m_nLastY;
aEvent.SourceActions = m_nSourceActions;
if( m_nCurrentProtocolVersion < 2 )
aEvent.DropAction = DNDConstants::ACTION_COPY;
@@ -2264,7 +2256,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
else
aEvent.DropAction = DNDConstants::ACTION_NONE;
- m_nLastDropAction = aEvent.DropAction;
+ m_nLastDropAction = aEvent.DropAction;
if( ! m_bDropEnterSent )
{
m_bDropEnterSent = true;
@@ -2310,15 +2302,15 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
if( m_bLastDropAccepted )
{
DropTargetDropEvent aEvent;
- aEvent.Source = static_cast< XDropTarget* >(it->second.m_pTarget);
- aEvent.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- aEvent.LocationX = m_nLastX;
- aEvent.LocationY = m_nLastY;
- aEvent.DropAction = m_nLastDropAction;
+ aEvent.Source = static_cast< XDropTarget* >(it->second.m_pTarget);
+ aEvent.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ aEvent.LocationX = m_nLastX;
+ aEvent.LocationY = m_nLastY;
+ aEvent.DropAction = m_nLastDropAction;
// there is nothing corresponding to source supported actions
// every source can do link, copy and move
aEvent.SourceActions= m_nLastDropAction;
- aEvent.Transferable = m_xDropTransferable;
+ aEvent.Transferable = m_xDropTransferable;
m_bDropWaitingForCompletion = true;
aGuard.clear();
@@ -2342,7 +2334,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage )
}
/*
- * methods for XDropTargetDropContext
+ * methods for XDropTargetDropContext
*/
void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow, XLIB_Time )
@@ -2354,12 +2346,12 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
if( m_xDragSourceListener.is() )
{
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = getUserDragAction();
- dsde.DropSuccess = bSuccess;
- css::uno::Reference< XDragSourceListener > xListener = m_xDragSourceListener;
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = getUserDragAction();
+ dsde.DropSuccess = bSuccess;
+ Reference< XDragSourceListener > xListener = m_xDragSourceListener;
m_xDragSourceListener.clear();
aGuard.clear();
@@ -2368,16 +2360,16 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
else if( m_aDropEnterEvent.data.l[0] && m_aCurrentDropWindow )
{
XEvent aEvent;
- aEvent.xclient.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = m_aDropEnterEvent.data.l[0];
- aEvent.xclient.message_type = m_nXdndFinished;
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = m_aCurrentDropWindow;
- aEvent.xclient.data.l[1] = bSuccess ? 1 : 0;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
+ aEvent.xclient.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = m_aDropEnterEvent.data.l[0];
+ aEvent.xclient.message_type = m_nXdndFinished;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = m_aCurrentDropWindow;
+ aEvent.xclient.data.l[1] = bSuccess ? 1 : 0;
+ aEvent.xclient.data.l[2] = 0;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
if( bSuccess )
{
if( m_nLastDropAction & DNDConstants::ACTION_MOVE )
@@ -2397,18 +2389,18 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
XSendEvent( m_pDisplay, m_aDropEnterEvent.data.l[0],
False, NoEventMask, & aEvent );
- m_aDropEnterEvent.data.l[0] = None;
- m_aCurrentDropWindow = None;
- m_nCurrentProtocolVersion = nXdndProtocolRevision;
+ m_aDropEnterEvent.data.l[0] = None;
+ m_aCurrentDropWindow = None;
+ m_nCurrentProtocolVersion = nXdndProtocolRevision;
}
m_bDropWaitingForCompletion = false;
}
else
- OSL_FAIL( "dropComplete from invalid DropTargetDropContext" );
+ OSL_ASSERT( "dropComplete from invalid DropTargetDropContext" );
}
/*
- * methods for XDropTargetDragContext
+ * methods for XDropTargetDragContext
*/
// ------------------------------------------------------------------------
@@ -2437,13 +2429,13 @@ void SelectionManager::sendDragStatus( Atom nDropAction )
}
DragSourceDragEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = m_nSourceActions;
- dsde.UserAction = getUserDragAction();
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = m_nSourceActions;
+ dsde.UserAction = getUserDragAction();
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
// caution: do not change anything after this
aGuard.clear();
if( xListener.is() )
@@ -2452,15 +2444,15 @@ void SelectionManager::sendDragStatus( Atom nDropAction )
else if( m_aDropEnterEvent.data.l[0] && m_aCurrentDropWindow )
{
XEvent aEvent;
- aEvent.xclient.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.window = m_aDropEnterEvent.data.l[0];
- aEvent.xclient.message_type = m_nXdndStatus;
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = m_aCurrentDropWindow;
- aEvent.xclient.data.l[1] = 2;
- if( nDropAction == m_nXdndActionMove ||
- nDropAction == m_nXdndActionLink ||
+ aEvent.xclient.type = ClientMessage;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.window = m_aDropEnterEvent.data.l[0];
+ aEvent.xclient.message_type = m_nXdndStatus;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = m_aCurrentDropWindow;
+ aEvent.xclient.data.l[1] = 2;
+ if( nDropAction == m_nXdndActionMove ||
+ nDropAction == m_nXdndActionLink ||
nDropAction == m_nXdndActionCopy )
aEvent.xclient.data.l[1] |= 1;
aEvent.xclient.data.l[2] = 0;
@@ -2529,12 +2521,12 @@ bool SelectionManager::updateDragAction( int modifierState )
m_nUserDragAction = nNewDropAction;
DragSourceDragEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = m_nUserDragAction;
- dsde.UserAction = m_nUserDragAction;
- m_nTargetAcceptAction = DNDConstants::ACTION_DEFAULT; // invalidate last accept
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = m_nUserDragAction;
+ dsde.UserAction = m_nUserDragAction;
+ m_nTargetAcceptAction = DNDConstants::ACTION_DEFAULT; // invalidate last accept
m_xDragSourceListener->dropActionChanged( dsde );
}
return bRet;
@@ -2549,7 +2541,7 @@ void SelectionManager::sendDropPosition( bool bForce, XLIB_Time eventTime )
if( m_bDropSent )
return;
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it =
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it =
m_aDropTargets.find( m_aDropWindow );
if( it != m_aDropTargets.end() )
{
@@ -2559,12 +2551,12 @@ void SelectionManager::sendDropPosition( bool bForce, XLIB_Time eventTime )
XLIB_Window aChild;
XTranslateCoordinates( m_pDisplay, it->second.m_aRootWindow, m_aDropWindow, m_nLastDragX, m_nLastDragY, &x, &y, &aChild );
DropTargetDragEvent dtde;
- dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
- dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- dtde.LocationX = x;
- dtde.LocationY = y;
- dtde.DropAction = getUserDragAction();
- dtde.SourceActions = m_nSourceActions;
+ dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
+ dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ dtde.LocationX = x;
+ dtde.LocationY = y;
+ dtde.DropAction = getUserDragAction();
+ dtde.SourceActions = m_nSourceActions;
aGuard.clear();
it->second->dragOver( dtde );
}
@@ -2578,14 +2570,14 @@ void SelectionManager::sendDropPosition( bool bForce, XLIB_Time eventTime )
// send XdndPosition
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndPosition;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
- aEvent.xclient.data.l[1] = 0;
- aEvent.xclient.data.l[2] = m_nLastDragX << 16 | (m_nLastDragY&0xffff);
- aEvent.xclient.data.l[3] = eventTime;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndPosition;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.data.l[2] = m_nLastDragX << 16 | (m_nLastDragY&0xffff);
+ aEvent.xclient.data.l[3] = eventTime;
if( m_nUserDragAction & DNDConstants::ACTION_COPY )
aEvent.xclient.data.l[4]=m_nXdndActionCopy;
@@ -2612,7 +2604,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
bool bHandled = false;
// for shortcut
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it =
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it =
m_aDropTargets.find( m_aDropWindow );
#if OSL_DEBUG_LEVEL > 1
switch( rMessage.type )
@@ -2621,6 +2613,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
fprintf( stderr, "handleDragEvent: %s\n", OUStringToOString( getString( rMessage.xclient.message_type ), RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
break;
case MotionNotify:
+// fprintf( stderr, "handleDragEvent: MotionNotify\n" );
break;
case EnterNotify:
fprintf( stderr, "handleDragEvent: EnterNotify\n" );
@@ -2653,9 +2646,9 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
{
bHandled = true;
DragSourceDragEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >( this );
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >( this );
dsde.UserAction = getUserDragAction();
dsde.DropAction = DNDConstants::ACTION_NONE;
m_bDropSuccess = rMessage.xclient.data.l[1] & 1 ? true : false;
@@ -2682,10 +2675,10 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
if( ! ( rMessage.xclient.data.l[1] & 2 ) )
{
- m_nNoPosX = rMessage.xclient.data.l[2] >> 16;
- m_nNoPosY = rMessage.xclient.data.l[2] & 0xffff;
- m_nNoPosWidth = rMessage.xclient.data.l[3] >> 16;
- m_nNoPosHeight = rMessage.xclient.data.l[3] & 0xffff;
+ m_nNoPosX = rMessage.xclient.data.l[2] >> 16;
+ m_nNoPosY = rMessage.xclient.data.l[2] & 0xffff;
+ m_nNoPosWidth = rMessage.xclient.data.l[3] >> 16;
+ m_nNoPosHeight = rMessage.xclient.data.l[3] & 0xffff;
}
else
m_nNoPosX = m_nNoPosY = m_nNoPosWidth = m_nNoPosHeight = 0;
@@ -2699,12 +2692,12 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
bHandled = true;
// notify the listener
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = m_nTargetAcceptAction;
- dsde.DropSuccess = m_bDropSuccess;
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = m_nTargetAcceptAction;
+ dsde.DropSuccess = m_bDropSuccess;
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2716,8 +2709,8 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
{
bHandled = true;
bool bForce = false;
- int root_x = rMessage.type == MotionNotify ? rMessage.xmotion.x_root : rMessage.xcrossing.x_root;
- int root_y = rMessage.type == MotionNotify ? rMessage.xmotion.y_root : rMessage.xcrossing.y_root;
+ int root_x = rMessage.type == MotionNotify ? rMessage.xmotion.x_root : rMessage.xcrossing.x_root;
+ int root_y = rMessage.type == MotionNotify ? rMessage.xmotion.y_root : rMessage.xcrossing.y_root;
XLIB_Window root = rMessage.type == MotionNotify ? rMessage.xmotion.root : rMessage.xcrossing.root;
m_nDragTimestamp = rMessage.type == MotionNotify ? rMessage.xmotion.time : rMessage.xcrossing.time;
@@ -2754,23 +2747,23 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
// send XdndLeave
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndLeave;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndLeave;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
memset( aEvent.xclient.data.l+1, 0, sizeof(long)*4);
m_aDropWindow = m_aDropProxy = None;
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
}
// notify the listener
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2778,9 +2771,9 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
else
{
/*
- * man page says: state is state immediate PRIOR to the
- * event. It would seem that this is a somewhat arguable
- * design decision.
+ * man page says: state is state immediate PRIOR to the
+ * event. It would seem that this is a somewhat arguable
+ * design decision.
*/
int nState = rMessage.xkey.state;
int nNewState = 0;
@@ -2817,15 +2810,15 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
XLIB_Window aChild;
XTranslateCoordinates( m_pDisplay, rMessage.xbutton.root, m_aDropWindow, rMessage.xbutton.x_root, rMessage.xbutton.y_root, &x, &y, &aChild );
DropTargetDropEvent dtde;
- dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
- dtde.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- dtde.LocationX = x;
- dtde.LocationY = y;
- dtde.DropAction = m_nUserDragAction;
- dtde.SourceActions = m_nSourceActions;
- dtde.Transferable = m_xDragSourceTransferable;
- m_bDropSent = true;
- m_nDropTimeout = time( NULL );
+ dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget );
+ dtde.Context = new DropTargetDropContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ dtde.LocationX = x;
+ dtde.LocationY = y;
+ dtde.DropAction = m_nUserDragAction;
+ dtde.SourceActions = m_nSourceActions;
+ dtde.Transferable = m_xDragSourceTransferable;
+ m_bDropSent = true;
+ m_nDropTimeout = time( NULL );
m_bDropWaitingForCompletion = true;
aGuard.clear();
it->second->drop( dtde );
@@ -2839,18 +2832,18 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndDrop;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
- aEvent.xclient.data.l[1] = 0;
- aEvent.xclient.data.l[2] = rMessage.xbutton.time;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
-
- m_bDropSent = true;
- m_nDropTimeout = time( NULL );
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndDrop;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.data.l[2] = rMessage.xbutton.time;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
+
+ m_bDropSent = true;
+ m_nDropTimeout = time( NULL );
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
bCancel = false;
}
@@ -2867,16 +2860,16 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
XLIB_Window aDummy;
XEvent aEvent;
aEvent.type = ButtonPress;
- aEvent.xbutton.display = m_pDisplay;
- aEvent.xbutton.window = m_aDropWindow;
- aEvent.xbutton.root = rMessage.xbutton.root;
- aEvent.xbutton.subwindow = m_aDropWindow;
- aEvent.xbutton.time = rMessage.xbutton.time+1;
- aEvent.xbutton.x_root = rMessage.xbutton.x_root;
- aEvent.xbutton.y_root = rMessage.xbutton.y_root;
- aEvent.xbutton.state = rMessage.xbutton.state;
- aEvent.xbutton.button = Button2;
- aEvent.xbutton.same_screen = True;
+ aEvent.xbutton.display = m_pDisplay;
+ aEvent.xbutton.window = m_aDropWindow;
+ aEvent.xbutton.root = rMessage.xbutton.root;
+ aEvent.xbutton.subwindow = m_aDropWindow;
+ aEvent.xbutton.time = rMessage.xbutton.time+1;
+ aEvent.xbutton.x_root = rMessage.xbutton.x_root;
+ aEvent.xbutton.y_root = rMessage.xbutton.y_root;
+ aEvent.xbutton.state = rMessage.xbutton.state;
+ aEvent.xbutton.button = Button2;
+ aEvent.xbutton.same_screen = True;
XTranslateCoordinates( m_pDisplay,
rMessage.xbutton.root, m_aDropWindow,
rMessage.xbutton.x_root, rMessage.xbutton.y_root,
@@ -2888,15 +2881,15 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
aEvent.xbutton.state |= Button2Mask;
XSendEvent( m_pDisplay, m_aDropWindow, False, ButtonReleaseMask, &aEvent );
- m_bDropSent = true;
- m_nDropTimeout = time( NULL );
+ m_bDropSent = true;
+ m_nDropTimeout = time( NULL );
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
- m_bWaitingForPrimaryConversion = true;
- m_bDropSent = true;
- m_nDropTimeout = time( NULL );
+ m_bWaitingForPrimaryConversion = true;
+ m_bDropSent = true;
+ m_nDropTimeout = time( NULL );
// HACK :-)
aGuard.clear();
- static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, css::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
+ static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
aGuard.reset();
bCancel = false;
}
@@ -2906,12 +2899,12 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
{
// cancel drag
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2957,11 +2950,11 @@ void SelectionManager::reject( XLIB_Window aDropWindow, XLIB_Time )
if( m_bDropSent && m_xDragSourceListener.is() )
{
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
m_xDragSourceListener->dragDropEnd( dsde );
m_xDragSourceListener.clear();
}
@@ -2969,7 +2962,7 @@ void SelectionManager::reject( XLIB_Window aDropWindow, XLIB_Time )
}
/*
- * XDragSource
+ * XDragSource
*/
sal_Bool SelectionManager::isDragImageSupported() throw()
@@ -3006,8 +2999,8 @@ int SelectionManager::getXdndVersion( XLIB_Window aWindow, XLIB_Window& rProxy )
rProxy = None;
/*
- * XListProperties is used here to avoid unnecessary XGetWindowProperty calls
- * and therefore reducing latency penalty
+ * XListProperties is used here to avoid unnecessary XGetWindowProperty calls
+ * and therefore reducing latency penalty
*/
pProperties = XListProperties( m_pDisplay, aWindow, &nProperties );
// first look for proxy
@@ -3065,7 +3058,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
osl::ResettableMutexGuard aGuard( m_aMutex );
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_nLastDragX = nX;
m_nLastDragY = nY;
@@ -3107,13 +3100,13 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
DragSourceDragEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY;
- dsde.UserAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY;
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY;
+ dsde.UserAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY;
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it;
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it;
if( aNewCurrentWindow != m_aDropWindow )
{
#if OSL_DEBUG_LEVEL > 1
@@ -3127,7 +3120,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
// shortcut for own drop targets
{
DropTargetEvent dte;
- dte.Source = static_cast< OWeakObject* >( it->second.m_pTarget );
+ dte.Source = static_cast< OWeakObject* >( it->second.m_pTarget );
aGuard.clear();
it->second.m_pTarget->dragExit( dte );
aGuard.reset();
@@ -3137,12 +3130,12 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
// send old drop target a XdndLeave
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndLeave;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
- aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndLeave;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.data.l[1] = 0;
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
}
if( xListener.is() )
@@ -3153,9 +3146,9 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
}
}
- m_nCurrentProtocolVersion = nNewProtocolVersion;
- m_aDropWindow = aNewCurrentWindow;
- m_aDropProxy = aNewProxy != None ? aNewProxy : m_aDropWindow;
+ m_nCurrentProtocolVersion = nNewProtocolVersion;
+ m_aDropWindow = aNewCurrentWindow;
+ m_aDropProxy = aNewProxy != None ? aNewProxy : m_aDropWindow;
it = m_aDropTargets.find( m_aDropWindow );
if( it != m_aDropTargets.end() && ! it->second.m_pTarget->m_bActive )
@@ -3175,13 +3168,13 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
XTranslateCoordinates( m_pDisplay, aRoot, m_aDropWindow, nX, nY, &nWinX, &nWinY, &aChild );
DropTargetDragEnterEvent dtde;
- dtde.Source = static_cast< OWeakObject* >( it->second.m_pTarget );
- dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
- dtde.LocationX = nWinX;
- dtde.LocationY = nWinY;
- dtde.DropAction = m_nUserDragAction;
- dtde.SourceActions = m_nSourceActions;
- dtde.SupportedDataFlavors = m_xDragSourceTransferable->getTransferDataFlavors();
+ dtde.Source = static_cast< OWeakObject* >( it->second.m_pTarget );
+ dtde.Context = new DropTargetDragContext( m_aCurrentDropWindow, m_nDropTimestamp, *this );
+ dtde.LocationX = nWinX;
+ dtde.LocationY = nWinY;
+ dtde.DropAction = m_nUserDragAction;
+ dtde.SourceActions = m_nSourceActions;
+ dtde.SupportedDataFlavors = m_xDragSourceTransferable->getTransferDataFlavors();
aGuard.clear();
it->second.m_pTarget->dragEnter( dtde );
aGuard.reset();
@@ -3190,12 +3183,12 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndEnter;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
- aEvent.xclient.data.l[1] = m_nCurrentProtocolVersion << 24;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndEnter;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.data.l[1] = m_nCurrentProtocolVersion << 24;
memset( aEvent.xclient.data.l + 2, 0, sizeof( long )*3 );
// fill in data types
::std::list< Atom > aConversions;
@@ -3225,8 +3218,8 @@ void SelectionManager::startDrag(
sal_Int8 sourceActions,
sal_Int32,
sal_Int32,
- const css::uno::Reference< XTransferable >& transferable,
- const css::uno::Reference< XDragSourceListener >& listener
+ const Reference< XTransferable >& transferable,
+ const Reference< XDragSourceListener >& listener
) throw()
{
#if OSL_DEBUG_LEVEL > 1
@@ -3234,11 +3227,11 @@ void SelectionManager::startDrag(
#endif
DragSourceDropEvent aDragFailedEvent;
- aDragFailedEvent.Source = static_cast< OWeakObject* >(this);
- aDragFailedEvent.DragSource = static_cast< XDragSource* >(this);
- aDragFailedEvent.DragSourceContext = new DragSourceContext( None, CurrentTime, *this );
- aDragFailedEvent.DropAction = DNDConstants::ACTION_NONE;
- aDragFailedEvent.DropSuccess = sal_False;
+ aDragFailedEvent.Source = static_cast< OWeakObject* >(this);
+ aDragFailedEvent.DragSource = static_cast< XDragSource* >(this);
+ aDragFailedEvent.DragSourceContext = new DragSourceContext( None, CurrentTime, *this );
+ aDragFailedEvent.DropAction = DNDConstants::ACTION_NONE;
+ aDragFailedEvent.DropSuccess = sal_False;
if( m_aDragRunning.check() )
{
@@ -3268,7 +3261,7 @@ void SelectionManager::startDrag(
int root_x, root_y, win_x, win_y;
unsigned int mask;
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it;
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it;
it = m_aDropTargets.begin();
while( it != m_aDropTargets.end() )
{
@@ -3380,16 +3373,16 @@ void SelectionManager::startDrag(
GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
else
- OSL_FAIL( "failed to acquire SolarMutex to reset capture frame" );
+ OSL_ENSURE( 0, "failed to acquire SolarMutex to reset capture frame" );
#endif
}
return;
}
- m_xDragSourceTransferable = transferable;
- m_xDragSourceListener = listener;
- m_aDragFlavors = transferable->getTransferDataFlavors();
- m_aCurrentCursor = None;
+ m_xDragSourceTransferable = transferable;
+ m_xDragSourceListener = listener;
+ m_aDragFlavors = transferable->getTransferDataFlavors();
+ m_aCurrentCursor = None;
requestOwnership( m_nXdndSelection );
@@ -3405,17 +3398,17 @@ void SelectionManager::startDrag(
XChangeProperty( m_pDisplay, m_aWindow, m_nXdndTypeList, XA_ATOM, 32, PropModeReplace, (unsigned char*)pTypes, nTypes );
- m_nSourceActions = sourceActions | DNDConstants::ACTION_DEFAULT;
- m_nUserDragAction = DNDConstants::ACTION_MOVE & m_nSourceActions;
+ m_nSourceActions = sourceActions | DNDConstants::ACTION_DEFAULT;
+ m_nUserDragAction = DNDConstants::ACTION_MOVE & m_nSourceActions;
if( ! m_nUserDragAction )
- m_nUserDragAction = DNDConstants::ACTION_COPY & m_nSourceActions;
+ m_nUserDragAction = DNDConstants::ACTION_COPY & m_nSourceActions;
if( ! m_nUserDragAction )
- m_nUserDragAction = DNDConstants::ACTION_LINK & m_nSourceActions;
- m_nTargetAcceptAction = DNDConstants::ACTION_DEFAULT;
- m_bDropSent = false;
- m_bDropSuccess = false;
- m_bWaitingForPrimaryConversion = false;
- m_nDragButton = Button1; // default to left button
+ m_nUserDragAction = DNDConstants::ACTION_LINK & m_nSourceActions;
+ m_nTargetAcceptAction = DNDConstants::ACTION_DEFAULT;
+ m_bDropSent = false;
+ m_bDropSuccess = false;
+ m_bWaitingForPrimaryConversion = false;
+ m_nDragButton = Button1; // default to left button
com::sun::star::awt::MouseEvent aEvent;
if( trigger.Event >>= aEvent )
{
@@ -3446,17 +3439,17 @@ void SelectionManager::startDrag(
m_xDragSourceListener.clear();
m_xDragSourceTransferable.clear();
- m_bDropSent = false;
- m_bDropSuccess = false;
- m_bWaitingForPrimaryConversion = false;
- m_aDropWindow = None;
- m_aDropProxy = None;
- m_nCurrentProtocolVersion = nXdndProtocolRevision;
- m_nNoPosX = 0;
- m_nNoPosY = 0;
- m_nNoPosWidth = 0;
- m_nNoPosHeight = 0;
- m_aCurrentCursor = None;
+ m_bDropSent = false;
+ m_bDropSuccess = false;
+ m_bWaitingForPrimaryConversion = false;
+ m_aDropWindow = None;
+ m_aDropProxy = None;
+ m_nCurrentProtocolVersion = nXdndProtocolRevision;
+ m_nNoPosX = 0;
+ m_nNoPosY = 0;
+ m_nNoPosWidth = 0;
+ m_nNoPosHeight = 0;
+ m_aCurrentCursor = None;
XUngrabPointer( m_pDisplay, CurrentTime );
XUngrabKeyboard( m_pDisplay, CurrentTime );
@@ -3469,7 +3462,7 @@ void SelectionManager::startDrag(
GetX11SalData()->GetDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
else
- OSL_FAIL( "failed to acquire SolarMutex to reset capture frame" );
+ OSL_ENSURE( 0, "failed to acquire SolarMutex to reset capture frame" );
#endif
}
@@ -3510,33 +3503,33 @@ void SelectionManager::dragDoDispatch()
{
osl::ClearableMutexGuard aGuard(m_aMutex);
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
- css::uno::Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
m_xDragSourceListener.clear();
m_xDragSourceTransferable.clear();
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
// cleanup after drag
if( m_bWaitingForPrimaryConversion )
getAdaptor( XA_PRIMARY )->clearTransferable();
- m_bDropSent = false;
- m_bDropSuccess = false;
- m_bWaitingForPrimaryConversion = false;
- m_aDropWindow = None;
- m_aDropProxy = None;
- m_nCurrentProtocolVersion = nXdndProtocolRevision;
- m_nNoPosX = 0;
- m_nNoPosY = 0;
- m_nNoPosWidth = 0;
- m_nNoPosHeight = 0;
- m_aCurrentCursor = None;
+ m_bDropSent = false;
+ m_bDropSuccess = false;
+ m_bWaitingForPrimaryConversion = false;
+ m_aDropWindow = None;
+ m_aDropProxy = None;
+ m_nCurrentProtocolVersion = nXdndProtocolRevision;
+ m_nNoPosX = 0;
+ m_nNoPosY = 0;
+ m_nNoPosWidth = 0;
+ m_nNoPosHeight = 0;
+ m_aCurrentCursor = None;
XUngrabPointer( m_pDisplay, CurrentTime );
XUngrabKeyboard( m_pDisplay, CurrentTime );
@@ -3556,7 +3549,7 @@ void SelectionManager::dragDoDispatch()
}
/*
- * XDragSourceContext
+ * XDragSourceContext
*/
sal_Int32 SelectionManager::getCurrentCursor()
@@ -3613,17 +3606,17 @@ void SelectionManager::transferablesFlavorsChanged()
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
- aEvent.xclient.message_type = m_nXdndLeave;
- aEvent.xclient.data.l[1] = 0;
+ aEvent.xclient.message_type = m_nXdndLeave;
+ aEvent.xclient.data.l[1] = 0;
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
- aEvent.xclient.message_type = m_nXdndEnter;
- aEvent.xclient.data.l[1] = m_nCurrentProtocolVersion << 24;
+ aEvent.xclient.message_type = m_nXdndEnter;
+ aEvent.xclient.data.l[1] = m_nCurrentProtocolVersion << 24;
memset( aEvent.xclient.data.l + 2, 0, sizeof( long )*3 );
// fill in data types
if( nTypes > 3 )
@@ -3636,7 +3629,7 @@ void SelectionManager::transferablesFlavorsChanged()
}
/*
- * dispatch loop
+ * dispatch loop
*/
// ------------------------------------------------------------------------
@@ -3644,11 +3637,11 @@ void SelectionManager::transferablesFlavorsChanged()
bool SelectionManager::handleXEvent( XEvent& rEvent )
{
/*
- * since we are XConnectionListener to a second X display
- * to get client messages it is essential not to dispatch
- * events twice that we get on both connections
+ * since we are XConnectionListener to a second X display
+ * to get client messages it is essential not to dispatch
+ * events twice that we get on both connections
*
- * between dispatching ButtonPress and startDrag
+ * #95201# between dispatching ButtonPress and startDrag
* the user can already have released the mouse. The ButtonRelease
* will then be dispatched in VCLs queue and never turn up here.
* Which is not so good, since startDrag will XGrabPointer and
@@ -3673,7 +3666,7 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
);
#endif
SelectionAdaptor* pAdaptor = getAdaptor( rEvent.xselectionclear.selection );
- boost::unordered_map< Atom, Selection* >::iterator it( m_aSelections.find( rEvent.xselectionclear.selection ) );
+ std::hash_map< Atom, Selection* >::iterator it( m_aSelections.find( rEvent.xselectionclear.selection ) );
if( it != m_aSelections.end() )
it->second->m_bOwner = false;
aGuard.clear();
@@ -3703,9 +3696,9 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
bHandled = handleDragEvent( rEvent );
// messages from drag source
else if(
- rEvent.xclient.message_type == m_nXdndEnter ||
- rEvent.xclient.message_type == m_nXdndLeave ||
- rEvent.xclient.message_type == m_nXdndPosition ||
+ rEvent.xclient.message_type == m_nXdndEnter ||
+ rEvent.xclient.message_type == m_nXdndLeave ||
+ rEvent.xclient.message_type == m_nXdndPosition ||
rEvent.xclient.message_type == m_nXdndDrop
)
bHandled = handleDropEvent( rEvent.xclient );
@@ -3729,29 +3722,41 @@ bool SelectionManager::handleXEvent( XEvent& rEvent )
void SelectionManager::dispatchEvent( int millisec )
{
- // acquire the mutex to prevent other threads
- // from using the same X connection
- osl::ResettableMutexGuard aGuard(m_aMutex);
+ pollfd aPollFD;
+ XEvent event;
- if( !XPending( m_pDisplay ))
- { // wait for any events if none are already queued
- pollfd aPollFD;
- aPollFD.fd = XConnectionNumber( m_pDisplay );
- aPollFD.events = POLLIN;
- aPollFD.revents = 0;
- // release mutex for the time of waiting for possible data
- aGuard.clear();
- if( poll( &aPollFD, 1, millisec ) <= 0 )
- return;
- aGuard.reset();
- }
- while( XPending( m_pDisplay ))
+ // query socket handle to poll on
+ aPollFD.fd = ConnectionNumber( m_pDisplay );
+ aPollFD.events = POLLIN;
+ aPollFD.revents = 0;
+
+ // wait for activity (outside the xlib)
+ if( poll( &aPollFD, 1, millisec ) > 0 )
{
- XEvent event;
- XNextEvent( m_pDisplay, &event );
- aGuard.clear();
- handleXEvent( event );
- aGuard.reset();
+ // now acquire the mutex to prevent other threads
+ // from using the same X connection
+ osl::ResettableMutexGuard aGuard(m_aMutex);
+
+ // prevent that another thread already ate the input
+ // this can happen if e.g. another thread does
+ // an X request getting a response. the response
+ // would be removed from the queue and we would end up
+ // with an empty socket here
+ if( poll( &aPollFD, 1, 0 ) > 0 )
+ {
+ int nPending = 1;
+ while( nPending )
+ {
+ nPending = XPending( m_pDisplay );
+ if( nPending )
+ {
+ XNextEvent( m_pDisplay, &event );
+ aGuard.clear();
+ handleXEvent( event );
+ aGuard.reset();
+ }
+ }
+ }
}
}
@@ -3769,10 +3774,10 @@ void SelectionManager::run( void* pThis )
timeval aLast;
gettimeofday( &aLast, 0 );
- css::uno::Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
+ Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
if( xFact.is() )
{
- css::uno::Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
+ Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
if( xDesktop.is() )
xDesktop->addTerminateListener(This);
}
@@ -3787,9 +3792,9 @@ void SelectionManager::run( void* pThis )
if( (aNow.tv_sec - aLast.tv_sec) > 0 )
{
osl::ClearableMutexGuard aGuard(This->m_aMutex);
- std::list< std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > > aChangeList;
+ std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList;
- for( boost::unordered_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
+ for( std::hash_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
{
if( it->first != This->m_nXdndSelection && ! it->second->m_bOwner )
{
@@ -3797,7 +3802,7 @@ void SelectionManager::run( void* pThis )
if( aOwner != it->second->m_aLastOwner )
{
it->second->m_aLastOwner = aOwner;
- std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > >
+ std::pair< SelectionAdaptor*, Reference< XInterface > >
aKeep( it->second->m_pAdaptor, it->second->m_pAdaptor->getReference() );
aChangeList.push_back( aKeep );
}
@@ -3820,11 +3825,6 @@ 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 +3914,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 )
{
- css::uno::Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
+ Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
#if OSL_DEBUG_LEVEL > 1
@@ -3929,10 +3929,10 @@ void SelectionManager::registerHandler( Atom selection, SelectionAdaptor& rAdapt
{
osl::MutexGuard aGuard(m_aMutex);
- Selection* pNewSelection = new Selection();
- pNewSelection->m_pAdaptor = &rAdaptor;
- pNewSelection->m_aAtom = selection;
- m_aSelections[ selection ] = pNewSelection;
+ Selection* pNewSelection = new Selection();
+ pNewSelection->m_pAdaptor = &rAdaptor;
+ pNewSelection->m_aAtom = selection;
+ m_aSelections[ selection ] = pNewSelection;
}
// ------------------------------------------------------------------------
@@ -3941,7 +3941,7 @@ void SelectionManager::deregisterHandler( Atom selection )
{
osl::MutexGuard aGuard(m_aMutex);
- ::boost::unordered_map< Atom, Selection* >::iterator it =
+ ::std::hash_map< Atom, Selection* >::iterator it =
m_aSelections.find( selection );
if( it != m_aSelections.end() )
{
@@ -3970,10 +3970,10 @@ void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTar
osl::MutexGuard aGuard(m_aMutex);
// sanity check
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it =
+ ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it =
m_aDropTargets.find( aWindow );
if( it != m_aDropTargets.end() )
- OSL_FAIL( "attempt to register window as drop target twice" );
+ OSL_ASSERT( "attempt to register window as drop target twice" );
else if( aWindow && m_pDisplay )
{
DropTargetEntry aEntry( pTarget );
@@ -4004,7 +4004,7 @@ void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTar
m_aDropTargets[ aWindow ] = aEntry;
}
else
- OSL_FAIL( "attempt to register None as drop target" );
+ OSL_ASSERT( "attempt to register None as drop target" );
}
// ------------------------------------------------------------------------
@@ -4017,7 +4017,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
if( aWindow == m_aDragSourceWindow && m_aDragRunning.check() )
{
// abort drag
- boost::unordered_map< XLIB_Window, DropTargetEntry >::const_iterator it =
+ std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it =
m_aDropTargets.find( m_aDropWindow );
if( it != m_aDropTargets.end() )
{
@@ -4031,23 +4031,23 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
// send XdndLeave
XEvent aEvent;
aEvent.type = ClientMessage;
- aEvent.xclient.display = m_pDisplay;
- aEvent.xclient.format = 32;
- aEvent.xclient.message_type = m_nXdndLeave;
- aEvent.xclient.window = m_aDropWindow;
- aEvent.xclient.data.l[0] = m_aWindow;
+ aEvent.xclient.display = m_pDisplay;
+ aEvent.xclient.format = 32;
+ aEvent.xclient.message_type = m_nXdndLeave;
+ aEvent.xclient.window = m_aDropWindow;
+ aEvent.xclient.data.l[0] = m_aWindow;
memset( aEvent.xclient.data.l+1, 0, sizeof(long)*4);
m_aDropWindow = m_aDropProxy = None;
XSendEvent( m_pDisplay, m_aDropProxy, False, NoEventMask, &aEvent );
}
// notify the listener
DragSourceDropEvent dsde;
- dsde.Source = static_cast< OWeakObject* >(this);
- dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
- dsde.DragSource = static_cast< XDragSource* >(this);
- dsde.DropAction = DNDConstants::ACTION_NONE;
- dsde.DropSuccess = sal_False;
- css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ dsde.Source = static_cast< OWeakObject* >(this);
+ dsde.DragSourceContext = new DragSourceContext( m_aDropWindow, m_nDragTimestamp, *this );
+ dsde.DragSource = static_cast< XDragSource* >(this);
+ dsde.DropAction = DNDConstants::ACTION_NONE;
+ dsde.DropSuccess = sal_False;
+ Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -4055,10 +4055,10 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
}
/*
- * SelectionAdaptor
+ * SelectionAdaptor
*/
-css::uno::Reference< XTransferable > SelectionManager::getTransferable() throw()
+Reference< XTransferable > SelectionManager::getTransferable() throw()
{
return m_xDragSourceTransferable;
}
@@ -4078,15 +4078,15 @@ void SelectionManager::fireContentsChanged() throw()
// ------------------------------------------------------------------------
-css::uno::Reference< XInterface > SelectionManager::getReference() throw()
+Reference< XInterface > SelectionManager::getReference() throw()
{
- return css::uno::Reference< XInterface >( static_cast<OWeakObject*>(this) );
+ return Reference< XInterface >( static_cast<OWeakObject*>(this) );
}
// ------------------------------------------------------------------------
/*
- * SelectionManagerHolder
+ * SelectionManagerHolder
*/
SelectionManagerHolder::SelectionManagerHolder() :
@@ -4111,7 +4111,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro
if( arguments.getLength() > 0 )
{
- css::uno::Reference< XDisplayConnection > xConn;
+ Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
{
@@ -4126,7 +4126,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro
}
/*
- * XDragSource
+ * XDragSource
*/
sal_Bool SelectionManagerHolder::isDragImageSupported() throw()
@@ -4146,8 +4146,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 css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const css::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw()
{
if( m_xRealDragSource.is() )
@@ -4157,14 +4157,14 @@ void SelectionManagerHolder::startDrag(
// ------------------------------------------------------------------------
/*
- * XServiceInfo
+ * XServiceInfo
*/
// ------------------------------------------------------------------------
OUString SelectionManagerHolder::getImplementationName() throw()
{
- return OUString(RTL_CONSTASCII_USTRINGPARAM(XDND_IMPLEMENTATION_NAME));
+ return OUString::createFromAscii(XDND_IMPLEMENTATION_NAME);
}
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx
index 42158e99802b..0b53e39a2e4f 100644
--- a/vcl/unx/source/dtrans/X11_selection.hxx
+++ b/vcl/unx/source/dtrans/X11_selection.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,7 +43,7 @@
#include <osl/conditn.hxx>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <list>
#include "tools/prex.h"
@@ -65,10 +65,10 @@ namespace x11 {
class SelectionAdaptor
{
public:
- virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
+ virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
virtual void clearTransferable() = 0;
virtual void fireContentsChanged() = 0;
- virtual com::sun::star::uno::Reference< XInterface > getReference() = 0;
+ virtual Reference< XInterface > getReference() = 0;
// returns a reference that will keep the SelectionAdaptor alive until the
// refernce is released
};
@@ -81,14 +81,14 @@ namespace x11 {
>
{
public:
- ::osl::Mutex m_aMutex;
- bool m_bActive;
- sal_Int8 m_nDefaultActions;
- XLIB_Window m_aTargetWindow;
- class SelectionManager* m_pSelectionManager;
- com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ ::osl::Mutex m_aMutex;
+ bool m_bActive;
+ sal_Int8 m_nDefaultActions;
+ XLIB_Window m_aTargetWindow;
+ class SelectionManager* m_pSelectionManager;
+ Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xSelectionManager;
- ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
+ ::std::list< Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
m_aListeners;
DropTarget();
@@ -101,19 +101,19 @@ namespace x11 {
void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw();
// XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
+ virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
// XDropTarget
- 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();
- virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
+ 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 sal_Bool SAL_CALL isActive() throw();
+ virtual void SAL_CALL setActive( sal_Bool active ) throw();
+ virtual sal_Int8 SAL_CALL getDefaultActions() throw();
+ virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw();
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
SAL_CALL getSupportedServiceNames() throw();
};
@@ -126,7 +126,7 @@ namespace x11 {
>
{
::osl::Mutex m_aMutex;
- com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xRealDragSource;
public:
SelectionManagerHolder();
@@ -134,26 +134,26 @@ namespace x11 {
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw();
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw();
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
SAL_CALL getSupportedServiceNames() throw();
// XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
+ virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
// XDragSource
- virtual sal_Bool SAL_CALL isDragImageSupported() throw();
- virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
- virtual void SAL_CALL startDrag(
+ virtual sal_Bool SAL_CALL isDragImageSupported() throw();
+ virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
+ virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- 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
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
};
-
-
+
+
class SelectionManager :
public ::cppu::WeakImplHelper4<
::com::sun::star::datatransfer::dnd::XDragSource,
@@ -163,7 +163,7 @@ namespace x11 {
>,
public SelectionAdaptor
{
- static ::boost::unordered_map< ::rtl::OUString, SelectionManager*, ::rtl::OUStringHash >& getInstances();
+ static ::std::hash_map< ::rtl::OUString, SelectionManager*, ::rtl::OUStringHash >& getInstances();
// for INCR type selection transfer
// INCR protocol is used if the data cannot
@@ -174,13 +174,13 @@ namespace x11 {
// property used to transfer the data
struct IncrementalTransfer
{
- Sequence< sal_Int8 > m_aData;
- int m_nBufferPos;
- XLIB_Window m_aRequestor;
- Atom m_aProperty;
- Atom m_aTarget;
- int m_nFormat;
- int m_nTransferStartTime;
+ Sequence< sal_Int8 > m_aData;
+ int m_nBufferPos;
+ XLIB_Window m_aRequestor;
+ Atom m_aProperty;
+ Atom m_aTarget;
+ int m_nFormat;
+ int m_nTransferStartTime;
};
int m_nIncrementalThreshold;
@@ -192,26 +192,26 @@ namespace x11 {
Inactive, WaitingForResponse, WaitingForData, IncrementalTransfer
};
- State m_eState;
- SelectionAdaptor* m_pAdaptor;
- Atom m_aAtom;
- ::osl::Condition m_aDataArrived;
- Sequence< sal_Int8 > m_aData;
+ State m_eState;
+ SelectionAdaptor* m_pAdaptor;
+ Atom m_aAtom;
+ ::osl::Condition m_aDataArrived;
+ Sequence< sal_Int8 > m_aData;
Sequence< ::com::sun::star::datatransfer::DataFlavor >
m_aTypes;
- std::vector< Atom > m_aNativeTypes;
+ std::vector< Atom > m_aNativeTypes;
// this is used for caching
// m_aTypes is invalid after 2 seconds
// m_aNativeTypes contains the corresponding original atom
- Atom m_aRequestedType;
+ Atom m_aRequestedType;
// m_aRequestedType is only valid while WaitingForResponse and WaitingFotData
- int m_nLastTimestamp;
- bool m_bHaveUTF16;
+ int m_nLastTimestamp;
+ bool m_bHaveUTF16;
Atom m_aUTF8Type;
- bool m_bHaveCompound;
- bool m_bOwner;
- XLIB_Window m_aLastOwner;
- PixmapHolder* m_pPixmap;
+ bool m_bHaveCompound;
+ bool m_bOwner;
+ XLIB_Window m_aLastOwner;
+ PixmapHolder* m_pPixmap;
// m_nOrigXLIB_Timestamp contains the XLIB_Timestamp at which the seclection
// was acquired; needed for XLIB_TimeSTAMP target
XLIB_Time m_nOrigTimestamp;
@@ -234,8 +234,8 @@ namespace x11 {
// a struct to hold data associated with a XDropTarget
struct DropTargetEntry
{
- DropTarget* m_pTarget;
- XLIB_Window m_aRootWindow;
+ DropTarget* m_pTarget;
+ XLIB_Window m_aRootWindow;
DropTargetEntry() : m_pTarget( NULL ), m_aRootWindow( None ) {}
DropTargetEntry( DropTarget* pTarget ) :
@@ -254,14 +254,14 @@ namespace x11 {
};
// internal data
- Display* m_pDisplay;
- oslThread m_aThread;
- oslThread m_aDragExecuteThread;
- ::osl::Condition m_aDragRunning;
- XLIB_Window m_aWindow;
- com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection >
+ Display* m_pDisplay;
+ oslThread m_aThread;
+ oslThread m_aDragExecuteThread;
+ ::osl::Condition m_aDragRunning;
+ XLIB_Window m_aWindow;
+ Reference< ::com::sun::star::awt::XDisplayConnection >
m_xDisplayConnection;
- com::sun::star::uno::Reference< com::sun::star::script::XInvocation >
+ Reference< com::sun::star::script::XInvocation >
m_xBitmapConverter;
sal_Int32 m_nSelectionTimeout;
XLIB_Time m_nSelectionTimestamp;
@@ -275,19 +275,19 @@ namespace x11 {
// with one of our targets. The data.l[0] member
// (conatining the drag source XLIB_Window) is set
// to None while that is not the case
- XClientMessageEvent m_aDropEnterEvent;
+ XClientMessageEvent m_aDropEnterEvent;
// set to false on XdndEnter
// set to true on first XdndPosition or XdndLeave
- bool m_bDropEnterSent;
- XLIB_Window m_aCurrentDropWindow;
+ bool m_bDropEnterSent;
+ XLIB_Window m_aCurrentDropWindow;
// XLIB_Time code of XdndDrop
- XLIB_Time m_nDropTime;
- sal_Int8 m_nLastDropAction;
+ XLIB_Time m_nDropTime;
+ sal_Int8 m_nLastDropAction;
// XTransferable for Xdnd with foreign drag source
- com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
+ Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDropTransferable;
- int m_nLastX, m_nLastY;
- XLIB_Time m_nDropTimestamp;
+ int m_nLastX, m_nLastY;
+ XLIB_Time m_nDropTimestamp;
// set to true when calling drop()
// if another XdndEnter is received this shows that
// someone forgot to call dropComplete - we should reset
@@ -297,32 +297,32 @@ namespace x11 {
// drag only
// None if no Dnd action is running with us as source
- XLIB_Window m_aDropWindow;
+ XLIB_Window m_aDropWindow;
// either m_aDropXLIB_Window or its XdndProxy
- XLIB_Window m_aDropProxy;
- XLIB_Window m_aDragSourceWindow;
+ XLIB_Window m_aDropProxy;
+ XLIB_Window m_aDragSourceWindow;
// XTransferable for Xdnd when we are drag source
- com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
+ Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDragSourceTransferable;
- com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
+ Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
m_xDragSourceListener;
// root coordinates
- int m_nLastDragX, m_nLastDragY;
+ int m_nLastDragX, m_nLastDragY;
Sequence< ::com::sun::star::datatransfer::DataFlavor >
m_aDragFlavors;
// the rectangle the pointer must leave until a new XdndPosition should
// be sent. empty unless the drop target told to fill
- int m_nNoPosX, m_nNoPosY, m_nNoPosWidth, m_nNoPosHeight;
- unsigned int m_nDragButton;
- sal_Int8 m_nUserDragAction;
- sal_Int8 m_nTargetAcceptAction;
- sal_Int8 m_nSourceActions;
- bool m_bLastDropAccepted;
- bool m_bDropSuccess;
- bool m_bDropSent;
- time_t m_nDropTimeout;
- bool m_bWaitingForPrimaryConversion;
- XLIB_Time m_nDragTimestamp;
+ int m_nNoPosX, m_nNoPosY, m_nNoPosWidth, m_nNoPosHeight;
+ unsigned int m_nDragButton;
+ sal_Int8 m_nUserDragAction;
+ sal_Int8 m_nTargetAcceptAction;
+ sal_Int8 m_nSourceActions;
+ bool m_bLastDropAccepted;
+ bool m_bDropSuccess;
+ bool m_bDropSent;
+ time_t m_nDropTimeout;
+ bool m_bWaitingForPrimaryConversion;
+ XLIB_Time m_nDragTimestamp;
// drag cursors
XLIB_Cursor m_aMoveCursor;
@@ -334,56 +334,55 @@ namespace x11 {
// drag and drop
- int m_nCurrentProtocolVersion;
- ::boost::unordered_map< XLIB_Window, DropTargetEntry >
+ int m_nCurrentProtocolVersion;
+ ::std::hash_map< XLIB_Window, DropTargetEntry >
m_aDropTargets;
// some special atoms that are needed often
- Atom m_nCLIPBOARDAtom;
- Atom m_nTARGETSAtom;
+ Atom m_nCLIPBOARDAtom;
+ Atom m_nTARGETSAtom;
Atom m_nTIMESTAMPAtom;
- Atom m_nTEXTAtom;
- Atom m_nINCRAtom;
- Atom m_nCOMPOUNDAtom;
- Atom m_nMULTIPLEAtom;
- Atom m_nUTF16Atom;
+ Atom m_nTEXTAtom;
+ Atom m_nINCRAtom;
+ Atom m_nCOMPOUNDAtom;
+ Atom m_nMULTIPLEAtom;
+ Atom m_nUTF16Atom;
Atom m_nImageBmpAtom;
- Atom m_nXdndAware;
- Atom m_nXdndEnter;
- Atom m_nXdndLeave;
- Atom m_nXdndPosition;
- Atom m_nXdndStatus;
- Atom m_nXdndDrop;
- Atom m_nXdndFinished;
- Atom m_nXdndSelection;
- Atom m_nXdndTypeList;
- Atom m_nXdndProxy;
- Atom m_nXdndActionCopy;
- Atom m_nXdndActionMove;
- Atom m_nXdndActionLink;
- Atom m_nXdndActionAsk;
- Atom m_nXdndActionPrivate;
+ Atom m_nXdndAware;
+ Atom m_nXdndEnter;
+ Atom m_nXdndLeave;
+ Atom m_nXdndPosition;
+ Atom m_nXdndStatus;
+ Atom m_nXdndDrop;
+ Atom m_nXdndFinished;
+ Atom m_nXdndSelection;
+ Atom m_nXdndTypeList;
+ Atom m_nXdndProxy;
+ Atom m_nXdndActionCopy;
+ Atom m_nXdndActionMove;
+ Atom m_nXdndActionLink;
+ Atom m_nXdndActionAsk;
+ Atom m_nXdndActionPrivate;
// caching for atoms
- ::boost::unordered_map< Atom, ::rtl::OUString >
+ ::std::hash_map< Atom, ::rtl::OUString >
m_aAtomToString;
- ::boost::unordered_map< ::rtl::OUString, Atom, ::rtl::OUStringHash >
+ ::std::hash_map< ::rtl::OUString, Atom, ::rtl::OUStringHash >
m_aStringToAtom;
// the registered selections
- ::boost::unordered_map< Atom, Selection* >
+ ::std::hash_map< Atom, Selection* >
m_aSelections;
// IncrementalTransfers in progress
- boost::unordered_map< XLIB_Window, boost::unordered_map< Atom, IncrementalTransfer > >
+ std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > >
m_aIncrementals;
-
+
// do not use X11 multithreading capabilities
// 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;
-
+ ::osl::Mutex m_aMutex;
+
SelectionManager();
~SelectionManager();
@@ -403,13 +402,13 @@ namespace x11 {
void sendDropPosition( bool bForce, XLIB_Time eventXLIB_Time );
bool updateDragAction( int modifierState );
int getXdndVersion( XLIB_Window aXLIB_Window, XLIB_Window& rProxy );
- XLIB_Cursor createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY );
+ XLIB_Cursor createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY );
// coordinates on root XLIB_Window
void updateDragWindow( int nX, int nY, XLIB_Window aRoot );
-
+
bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData );
// returns true if conversion was successful
- bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
+ bool convertData( const Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int & rFormat,
@@ -442,14 +441,14 @@ namespace x11 {
Display * getDisplay() { return m_pDisplay; };
XLIB_Window getWindow() { return m_aWindow; };
-
+
void registerHandler( Atom selection, SelectionAdaptor& rAdaptor );
void deregisterHandler( Atom selection );
bool requestOwnership( Atom selection );
-
+
// allow for synchronization over one mutex for XClipboard
osl::Mutex& getMutex() { return m_aMutex; }
-
+
Atom getAtom( const ::rtl::OUString& rString );
const ::rtl::OUString& getString( Atom nAtom );
@@ -483,26 +482,26 @@ namespace x11 {
void shutdown() throw();
// XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
+ virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
// XEventHandler
- virtual sal_Bool SAL_CALL handleEvent( const Any& event ) throw();
+ virtual sal_Bool SAL_CALL handleEvent( const Any& event ) throw();
// XDragSource
- virtual sal_Bool SAL_CALL isDragImageSupported() throw();
- virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
- virtual void SAL_CALL startDrag(
+ virtual sal_Bool SAL_CALL isDragImageSupported() throw();
+ virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
+ virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- 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
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
// SelectionAdaptor for XdndSelection Drag (we are drag source)
- virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
+ virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
virtual void clearTransferable() throw();
virtual void fireContentsChanged() throw();
- virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
+ virtual Reference< XInterface > getReference() throw();
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
@@ -517,11 +516,11 @@ namespace x11 {
// ------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL Xdnd_getSupportedServiceNames();
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_createInstance(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_createInstance(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL Xdnd_dropTarget_getSupportedServiceNames();
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_dropTarget_createInstance(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Xdnd_dropTarget_createInstance(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_service.cxx b/vcl/unx/source/dtrans/X11_service.cxx
index 7397f25e2c76..11c766f08c56 100644
--- a/vcl/unx/source/dtrans/X11_service.cxx
+++ b/vcl/unx/source/dtrans/X11_service.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,83 +40,76 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/compbase1.hxx>
-namespace {
-
-namespace css = com::sun::star;
-
-}
-
+using namespace rtl;
using namespace cppu;
using namespace com::sun::star::lang;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::awt;
using namespace x11;
-using ::rtl::OUString;
-
Sequence< OUString > SAL_CALL x11::X11Clipboard_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
return aRet;
}
Sequence< OUString > SAL_CALL x11::Xdnd_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DragSource"));
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.dnd.X11DragSource");
return aRet;
}
Sequence< OUString > SAL_CALL x11::Xdnd_dropTarget_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DropTarget"));
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.dnd.X11DropTarget");
return aRet;
}
// ------------------------------------------------------------------------
-css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
+Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
{
- static boost::unordered_map< OUString, ::boost::unordered_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
+ static std::hash_map< OUString, ::std::hash_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
OUString aDisplayName;
Atom nSelection;
-
+
// extract display name from connection argument. An exception is thrown
- // by SelectionManager.initialize() if no display connection is given.
+ // by SelectionManager.initialize() if no display connection is given.
if( arguments.getLength() > 0 )
{
- css::uno::Reference< XDisplayConnection > xConn;
+ Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
-
+
if( xConn.is() )
{
Any aIdentifier = xConn->getIdentifier();
aIdentifier >>= aDisplayName;
}
}
-
+
SelectionManager& rManager = SelectionManager::get( aDisplayName );
rManager.initialize( arguments );
-
+
// check if any other selection than clipboard selection is specified
if( arguments.getLength() > 1 )
{
OUString aSelectionName;
-
+
arguments.getConstArray()[1] >>= aSelectionName;
nSelection = rManager.getAtom( aSelectionName );
}
else
{
// default atom is clipboard selection
- nSelection = rManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
+ nSelection = rManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) );
}
-
- ::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 );
+
+ ::std::hash_map< Atom, Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
+ ::std::hash_map< Atom, Reference< XClipboard > >::iterator it = rMap.find( nSelection );
if( it != rMap.end() )
return it->second;
@@ -128,16 +121,16 @@ css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequenc
// ------------------------------------------------------------------------
-css::uno::Reference< XInterface > X11SalInstance::CreateDragSource()
+Reference< XInterface > X11SalInstance::CreateDragSource()
{
- return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
+ return Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
}
// ------------------------------------------------------------------------
-css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget()
+Reference< XInterface > X11SalInstance::CreateDropTarget()
{
- return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
+ return Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
}
diff --git a/vcl/unx/source/dtrans/X11_transferable.cxx b/vcl/unx/source/dtrans/X11_transferable.cxx
index 076da0917a40..edefc651b94a 100644
--- a/vcl/unx/source/dtrans/X11_transferable.cxx
+++ b/vcl/unx/source/dtrans/X11_transferable.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,10 +43,10 @@ using namespace com::sun::star::io;
using namespace com::sun::star::uno;
using namespace cppu;
using namespace osl;
+using namespace rtl;
-using namespace x11;
-using ::rtl::OUString;
+using namespace x11;
X11Transferable::X11Transferable(
@@ -75,13 +75,13 @@ Any SAL_CALL X11Transferable::getTransferData( const DataFlavor& rFlavor )
Sequence< sal_Int8 > aData;
bool bSuccess = m_rManager.getPasteData( m_aSelection ? m_aSelection : XA_PRIMARY, rFlavor.MimeType, aData );
if( ! bSuccess && m_aSelection == 0 )
- bSuccess = m_rManager.getPasteData( m_rManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) ), rFlavor.MimeType, aData );
+ bSuccess = m_rManager.getPasteData( m_rManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ), rFlavor.MimeType, aData );
if( ! bSuccess )
{
throw UnsupportedFlavorException( rFlavor.MimeType, static_cast < XTransferable * > ( this ) );
}
- if( rFlavor.MimeType.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=utf-16")) ) )
+ if( rFlavor.MimeType.equalsIgnoreAsciiCase( OUString::createFromAscii( "text/plain;charset=utf-16" ) ) )
{
int nLen = aData.getLength()/2;
if( ((sal_Unicode*)aData.getConstArray())[nLen-1] == 0 )
@@ -107,7 +107,7 @@ Sequence< DataFlavor > SAL_CALL X11Transferable::getTransferDataFlavors()
Sequence< DataFlavor > aFlavorList;
bool bSuccess = m_rManager.getPasteDataTypes( m_aSelection ? m_aSelection : XA_PRIMARY, aFlavorList );
if( ! bSuccess && m_aSelection == 0 )
- bSuccess = m_rManager.getPasteDataTypes( m_rManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) ), aFlavorList );
+ bSuccess = m_rManager.getPasteDataTypes( m_rManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) ), aFlavorList );
return aFlavorList;
}
@@ -119,7 +119,7 @@ sal_Bool SAL_CALL X11Transferable::isDataFlavorSupported( const DataFlavor& aFla
{
if( aFlavor.DataType != getCppuType( (Sequence< sal_Int8 >*)0 ) )
{
- if( ! aFlavor.MimeType.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=utf-16")) ) &&
+ if( ! aFlavor.MimeType.equalsIgnoreAsciiCase( OUString::createFromAscii( "text/plain;charset=utf-16" ) ) &&
aFlavor.DataType == getCppuType( (OUString*)0 ) )
return false;
}
diff --git a/vcl/unx/source/dtrans/X11_transferable.hxx b/vcl/unx/source/dtrans/X11_transferable.hxx
index 683faa0a7f87..ea66098107f1 100644
--- a/vcl/unx/source/dtrans/X11_transferable.hxx
+++ b/vcl/unx/source/dtrans/X11_transferable.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,28 +41,28 @@ namespace x11 {
::com::sun::star::datatransfer::XTransferable >
{
::osl::Mutex m_aMutex;
-
- SelectionManager& m_rManager;
- com::sun::star::uno::Reference< XInterface > m_xCreator;
- Atom m_aSelection;
+
+ SelectionManager& m_rManager;
+ Reference< XInterface > m_xCreator;
+ Atom m_aSelection;
public:
- X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
+ X11Transferable( SelectionManager& rManager, const Reference< XInterface >& xCreator, Atom selection = None );
virtual ~X11Transferable();
/*
* XTransferable
*/
- virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
- throw(::com::sun::star::datatransfer::UnsupportedFlavorException,
- ::com::sun::star::io::IOException,
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
+ throw(::com::sun::star::datatransfer::UnsupportedFlavorException,
+ ::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException
);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
+ virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor )
throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/vcl/unx/source/dtrans/bmp.cxx b/vcl/unx/source/dtrans/bmp.cxx
index 57ad8ecf8a4d..f42cf739ab89 100644
--- a/vcl/unx/source/dtrans/bmp.cxx
+++ b/vcl/unx/source/dtrans/bmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,6 +42,7 @@ using namespace x11;
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
using namespace com::sun::star::awt;
+using namespace rtl;
/*
* helper functions
@@ -88,8 +89,8 @@ BmpTransporter::BmpTransporter( const Sequence<sal_Int8>& rBmp ) :
if( pData[0] == 'B' || pData[1] == 'M' )
{
pData = pData+14;
- m_aSize.Width = readLE32( pData+4 );
- m_aSize.Height = readLE32( pData+8 );
+ m_aSize.Width = readLE32( pData+4 );
+ m_aSize.Height = readLE32( pData+8 );
}
else
m_aSize.Width = m_aSize.Height = 0;
@@ -408,17 +409,17 @@ PixmapHolder::PixmapHolder( Display* pDisplay ) :
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PixmapHolder reverting to default visual\n" );
#endif
- Visual* pVisual = DefaultVisual( m_pDisplay, DefaultScreen( m_pDisplay ) );
- m_aInfo.screen = DefaultScreen( m_pDisplay );
- m_aInfo.visual = pVisual;
- m_aInfo.visualid = pVisual->visualid;
- m_aInfo.c_class = pVisual->c_class;
- m_aInfo.red_mask = pVisual->red_mask;
- m_aInfo.green_mask = pVisual->green_mask;
- m_aInfo.blue_mask = pVisual->blue_mask;
- m_aInfo.depth = DefaultDepth( m_pDisplay, m_aInfo.screen );
+ Visual* pVisual = DefaultVisual( m_pDisplay, DefaultScreen( m_pDisplay ) );
+ m_aInfo.screen = DefaultScreen( m_pDisplay );
+ m_aInfo.visual = pVisual;
+ m_aInfo.visualid = pVisual->visualid;
+ m_aInfo.c_class = pVisual->c_class;
+ m_aInfo.red_mask = pVisual->red_mask;
+ m_aInfo.green_mask = pVisual->green_mask;
+ m_aInfo.blue_mask = pVisual->blue_mask;
+ m_aInfo.depth = DefaultDepth( m_pDisplay, m_aInfo.screen );
}
- m_aColormap = DefaultColormap( m_pDisplay, m_aInfo.screen );
+ m_aColormap = DefaultColormap( m_pDisplay, m_aInfo.screen );
#if OSL_DEBUG_LEVEL > 1
static const char* pClasses[] =
{ "StaticGray", "GrayScale", "StaticColor", "PseudoColor", "TrueColor", "DirectColor" };
@@ -477,17 +478,17 @@ void PixmapHolder::setBitmapDataPalette( const sal_uInt8* pData, XImage* pImage
XColor aPalette[256];
sal_uInt32 nColors = readLE32( pData+32 );
- sal_uInt32 nWidth = readLE32( pData+4 );
- sal_uInt32 nHeight = readLE32( pData+8 );
+ sal_uInt32 nWidth = readLE32( pData+4 );
+ sal_uInt32 nHeight = readLE32( pData+8 );
sal_uInt16 nDepth = readLE16( pData+14 );
for( sal_uInt16 i = 0 ; i < nColors; i++ )
{
if( m_aInfo.c_class != TrueColor )
{
- aPalette[i].red = ((unsigned short)pData[42 + i*4]) << 8 | ((unsigned short)pData[42 + i*4]);
- aPalette[i].green = ((unsigned short)pData[41 + i*4]) << 8 | ((unsigned short)pData[41 + i*4]);
- aPalette[i].blue = ((unsigned short)pData[40 + i*4]) << 8 | ((unsigned short)pData[40 + i*4]);
+ aPalette[i].red = ((unsigned short)pData[42 + i*4]) << 8 | ((unsigned short)pData[42 + i*4]);
+ aPalette[i].green = ((unsigned short)pData[41 + i*4]) << 8 | ((unsigned short)pData[41 + i*4]);
+ aPalette[i].blue = ((unsigned short)pData[40 + i*4]) << 8 | ((unsigned short)pData[40 + i*4]);
XAllocColor( m_pDisplay, m_aColormap, aPalette+i );
}
else
@@ -551,10 +552,10 @@ void PixmapHolder::setBitmapDataTCDither( const sal_uInt8* pData, XImage* pImage
for( int b = 0; b < 6; b++ )
{
int i = r*36+g*6+b;
- aPalette[i].red = r == 5 ? 0xffff : r*10922;
- aPalette[i].green = g == 5 ? 0xffff : g*10922;
- aPalette[i].blue = b == 5 ? 0xffff : b*10922;
- aPalette[i].pixel = 0;
+ aPalette[i].red = r == 5 ? 0xffff : r*10922;
+ aPalette[i].green = g == 5 ? 0xffff : g*10922;
+ aPalette[i].blue = b == 5 ? 0xffff : b*10922;
+ aPalette[i].pixel = 0;
if( ! XAllocColor( m_pDisplay, m_aColormap, aPalette+i ) )
nNonAllocs++;
}
@@ -580,8 +581,8 @@ void PixmapHolder::setBitmapDataTCDither( const sal_uInt8* pData, XImage* pImage
}
}
- sal_uInt32 nWidth = readLE32( pData+4 );
- sal_uInt32 nHeight = readLE32( pData+8 );
+ sal_uInt32 nWidth = readLE32( pData+4 );
+ sal_uInt32 nHeight = readLE32( pData+8 );
const sal_uInt8* pBMData = pData + readLE32( pData );
sal_uInt32 nScanlineSize = nWidth*3;
@@ -609,8 +610,8 @@ void PixmapHolder::setBitmapDataTCDither( const sal_uInt8* pData, XImage* pImage
void PixmapHolder::setBitmapDataTC( const sal_uInt8* pData, XImage* pImage )
{
- sal_uInt32 nWidth = readLE32( pData+4 );
- sal_uInt32 nHeight = readLE32( pData+8 );
+ sal_uInt32 nWidth = readLE32( pData+4 );
+ sal_uInt32 nHeight = readLE32( pData+8 );
const sal_uInt8* pBMData = pData + readLE32( pData );
sal_uInt32 nScanlineSize = nWidth*3;
@@ -664,9 +665,9 @@ Pixmap PixmapHolder::setBitmapData( const sal_uInt8* pData )
if( readLE32( pData + 16 ) != 0 )
return None;
- sal_uInt32 nWidth = readLE32( pData+4 );
- sal_uInt32 nHeight = readLE32( pData+8 );
-
+ sal_uInt32 nWidth = readLE32( pData+4 );
+ sal_uInt32 nHeight = readLE32( pData+8 );
+
if( m_aPixmap != None )
XFreePixmap( m_pDisplay, m_aPixmap ), m_aPixmap = None;
if( m_aBitmap != None )
@@ -679,25 +680,25 @@ Pixmap PixmapHolder::setBitmapData( const sal_uInt8* pData )
if( m_aPixmap != None )
{
XImage aImage;
- aImage.width = (int)nWidth;
- aImage.height = (int)nHeight;
- aImage.xoffset = 0;
- aImage.format = ZPixmap;
- aImage.data = NULL;
- aImage.byte_order = ImageByteOrder( m_pDisplay );
- aImage.bitmap_unit = BitmapUnit( m_pDisplay );
- aImage.bitmap_bit_order = BitmapBitOrder( m_pDisplay );
- aImage.bitmap_pad = BitmapPad( m_pDisplay );
- aImage.depth = m_aInfo.depth;
- aImage.red_mask = m_aInfo.red_mask;
- aImage.green_mask = m_aInfo.green_mask;
- aImage.blue_mask = m_aInfo.blue_mask;
- aImage.bytes_per_line = 0; // filled in by XInitImage
+ aImage.width = (int)nWidth;
+ aImage.height = (int)nHeight;
+ aImage.xoffset = 0;
+ aImage.format = ZPixmap;
+ aImage.data = NULL;
+ aImage.byte_order = ImageByteOrder( m_pDisplay );
+ aImage.bitmap_unit = BitmapUnit( m_pDisplay );
+ aImage.bitmap_bit_order = BitmapBitOrder( m_pDisplay );
+ aImage.bitmap_pad = BitmapPad( m_pDisplay );
+ aImage.depth = m_aInfo.depth;
+ aImage.red_mask = m_aInfo.red_mask;
+ aImage.green_mask = m_aInfo.green_mask;
+ aImage.blue_mask = m_aInfo.blue_mask;
+ aImage.bytes_per_line = 0; // filled in by XInitImage
if( m_aInfo.depth <= 8 )
aImage.bits_per_pixel = m_aInfo.depth;
else
aImage.bits_per_pixel = 8*((m_aInfo.depth+7)/8);
- aImage.obdata = NULL;
+ aImage.obdata = NULL;
XInitImage( &aImage );
aImage.data = (char*)rtl_allocateMemory( nHeight*aImage.bytes_per_line );
diff --git a/vcl/unx/source/dtrans/bmp.hxx b/vcl/unx/source/dtrans/bmp.hxx
index 6d2e76bae0bb..d7fd48f0598d 100644
--- a/vcl/unx/source/dtrans/bmp.hxx
+++ b/vcl/unx/source/dtrans/bmp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,16 +54,16 @@ void X11_freeBmp( sal_uInt8* pBmp );
class PixmapHolder
{
- Display* m_pDisplay;
- Colormap m_aColormap;
- Pixmap m_aPixmap;
- Pixmap m_aBitmap;
- XVisualInfo m_aInfo;
+ Display* m_pDisplay;
+ Colormap m_aColormap;
+ Pixmap m_aPixmap;
+ Pixmap m_aBitmap;
+ XVisualInfo m_aInfo;
- int m_nRedShift, m_nRedShift2;
- int m_nGreenShift, m_nGreenShift2;
- int m_nBlueShift, m_nBlueShift2;
- unsigned long m_nBlueShift2Mask, m_nRedShift2Mask, m_nGreenShift2Mask;
+ int m_nRedShift, m_nRedShift2;
+ int m_nGreenShift, m_nGreenShift2;
+ int m_nBlueShift, m_nBlueShift2;
+ unsigned long m_nBlueShift2Mask, m_nRedShift2Mask, m_nGreenShift2Mask;
// these expect data pointers to bitmapinfo header
void setBitmapDataTC( const sal_uInt8* pData, XImage* pImage );
@@ -90,12 +90,12 @@ public:
class BmpTransporter :
public cppu::WeakImplHelper1< com::sun::star::awt::XBitmap >
{
- com::sun::star::uno::Sequence<sal_Int8> m_aBM;
- com::sun::star::awt::Size m_aSize;
+ com::sun::star::uno::Sequence<sal_Int8> m_aBM;
+ com::sun::star::awt::Size m_aSize;
public:
BmpTransporter( const com::sun::star::uno::Sequence<sal_Int8>& rBmp );
virtual ~BmpTransporter();
-
+
virtual com::sun::star::awt::Size SAL_CALL getSize() throw();
virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getDIB() throw();
virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw();
diff --git a/vcl/unx/source/dtrans/config.cxx b/vcl/unx/source/dtrans/config.cxx
index 5f711da47434..45e56b48b474 100644
--- a/vcl/unx/source/dtrans/config.cxx
+++ b/vcl/unx/source/dtrans/config.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,7 +45,7 @@ class DtransX11ConfigItem : public ::utl::ConfigItem
sal_Int32 m_nSelectionTimeout;
virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames );
- virtual void Commit();
+ virtual void Commit();
public:
DtransX11ConfigItem();
virtual ~DtransX11ConfigItem();
@@ -57,10 +57,9 @@ public:
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
+using namespace rtl;
using namespace x11;
-using ::rtl::OUString;
-
sal_Int32 SelectionManager::getSelectionTimeout()
{
if( m_nSelectionTimeout < 1 )
@@ -68,7 +67,7 @@ sal_Int32 SelectionManager::getSelectionTimeout()
DtransX11ConfigItem aCfg;
m_nSelectionTimeout = aCfg.getSelectionTimeout();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "initialized selection timeout to %" SAL_PRIdINT32 " seconds\n", m_nSelectionTimeout );
+ fprintf( stderr, "initialized selection timeout to %ld seconds\n", m_nSelectionTimeout );
#endif
}
return m_nSelectionTimeout;
@@ -89,7 +88,7 @@ DtransX11ConfigItem::DtransX11ConfigItem() :
aKeys.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( SELECTION_PROPERTY ) );
Sequence< Any > aValues = GetProperties( aKeys );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "found %" SAL_PRIdINT32 " properties for %s\n", aValues.getLength(), SELECTION_PROPERTY );
+ fprintf( stderr, "found %ld properties for %s\n", aValues.getLength(), SELECTION_PROPERTY );
#endif
Any* pValue = aValues.getArray();
for( int i = 0; i < aValues.getLength(); i++, pValue++ )
diff --git a/vcl/unx/source/dtrans/copydata_curs.h b/vcl/unx/source/dtrans/copydata_curs.h
index a882a541a6d7..3f2bb060d56c 100644
--- a/vcl/unx/source/dtrans/copydata_curs.h
+++ b/vcl/unx/source/dtrans/copydata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydata_curs_height 32
#define copydata_curs_x_hot 1
#define copydata_curs_y_hot 1
-static unsigned char copydata_curs_bits[] = {
+static char copydata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/copydata_mask.h b/vcl/unx/source/dtrans/copydata_mask.h
index 9cd73b08d106..3f2009d72322 100644
--- a/vcl/unx/source/dtrans/copydata_mask.h
+++ b/vcl/unx/source/dtrans/copydata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydata_mask_height 32
#define copydata_mask_x_hot 1
#define copydata_mask_y_hot 1
-static unsigned char copydata_mask_bits[] = {
+static char copydata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/linkdata_curs.h b/vcl/unx/source/dtrans/linkdata_curs.h
index 054ef55ef2bb..5c0feab91cbd 100644
--- a/vcl/unx/source/dtrans/linkdata_curs.h
+++ b/vcl/unx/source/dtrans/linkdata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkdata_curs_height 32
#define linkdata_curs_x_hot 1
#define linkdata_curs_y_hot 1
-static unsigned char linkdata_curs_bits[] = {
+static char linkdata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/linkdata_mask.h b/vcl/unx/source/dtrans/linkdata_mask.h
index 429c603066dc..a84059c079c7 100644
--- a/vcl/unx/source/dtrans/linkdata_mask.h
+++ b/vcl/unx/source/dtrans/linkdata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkdata_mask_height 32
#define linkdata_mask_x_hot 1
#define linkdata_mask_y_hot 1
-static unsigned char linkdata_mask_bits[] = {
+static char linkdata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/movedata_curs.h b/vcl/unx/source/dtrans/movedata_curs.h
index 642bbd176e4b..cdbc15d948b9 100644
--- a/vcl/unx/source/dtrans/movedata_curs.h
+++ b/vcl/unx/source/dtrans/movedata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedata_curs_height 32
#define movedata_curs_x_hot 1
#define movedata_curs_y_hot 1
-static unsigned char movedata_curs_bits[] = {
+static char movedata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/movedata_mask.h b/vcl/unx/source/dtrans/movedata_mask.h
index f06c80f1728c..a10d7eab5f51 100644
--- a/vcl/unx/source/dtrans/movedata_mask.h
+++ b/vcl/unx/source/dtrans/movedata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedata_mask_height 32
#define movedata_mask_x_hot 1
#define movedata_mask_y_hot 1
-static unsigned char movedata_mask_bits[] = {
+static char movedata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/dtrans/nodrop_curs.h b/vcl/unx/source/dtrans/nodrop_curs.h
index 5c501d3876c4..82efb546d2f0 100644
--- a/vcl/unx/source/dtrans/nodrop_curs.h
+++ b/vcl/unx/source/dtrans/nodrop_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define nodrop_curs_height 32
#define nodrop_curs_x_hot 9
#define nodrop_curs_y_hot 9
-static unsigned char nodrop_curs_bits[] = {
+static char nodrop_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
0xf8, 0x7f, 0x00, 0x00, 0x7c, 0xf8, 0x00, 0x00, 0x1c, 0xfc, 0x00, 0x00,
0x1e, 0xfe, 0x01, 0x00, 0x0e, 0xdf, 0x01, 0x00, 0x8e, 0xcf, 0x01, 0x00,
diff --git a/vcl/unx/source/dtrans/nodrop_mask.h b/vcl/unx/source/dtrans/nodrop_mask.h
index bd315dc28df1..c3fa9cda4af4 100644
--- a/vcl/unx/source/dtrans/nodrop_mask.h
+++ b/vcl/unx/source/dtrans/nodrop_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define nodrop_mask_height 32
#define nodrop_mask_x_hot 9
#define nodrop_mask_y_hot 9
-static unsigned char nodrop_mask_bits[] = {
+static char nodrop_mask_bits[] = {
0xc0, 0x0f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
0xfc, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x7e, 0xfe, 0x01, 0x00,
0x3f, 0xff, 0x03, 0x00, 0x9f, 0xff, 0x03, 0x00, 0xdf, 0xff, 0x03, 0x00,
diff --git a/vcl/unx/source/fontmanager/adobeenc.tab b/vcl/unx/source/fontmanager/adobeenc.tab
index 492e92f3fcf2..26a03bf99059 100644
--- a/vcl/unx/source/fontmanager/adobeenc.tab
+++ b/vcl/unx/source/fontmanager/adobeenc.tab
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -26,9 +26,9 @@
************************************************************************/
struct AdobeEncEntry {
- sal_Unicode aUnicode;
- sal_uInt8 aAdobeStandardCode;
- const char* const pAdobename;
+ sal_Unicode aUnicode;
+ sal_uInt8 aAdobeStandardCode;
+ const char* const pAdobename;
};
static const AdobeEncEntry aAdobeCodes[]=
diff --git a/vcl/unx/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx
index e916e039d7f2..2dbf9aa085bf 100644
--- a/vcl/unx/source/fontmanager/fontcache.cxx
+++ b/vcl/unx/source/fontmanager/fontcache.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,13 +51,10 @@
#define CACHE_MAGIC "PspFontCacheFile format 4"
using namespace std;
+using namespace rtl;
using namespace psp;
using namespace utl;
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OUStringToOString;
-
/*
* static helpers
*/
@@ -262,7 +259,7 @@ void FontCache::read()
#endif
return;
}
-
+
ByteString aLine;
aStream.ReadLine( aLine );
@@ -273,7 +270,7 @@ void FontCache::read()
#endif
return;
}
-
+
int nDir = 0;
FontDirMap* pDir = NULL;
xub_StrLen nIndex;
@@ -306,7 +303,7 @@ void FontCache::read()
// is the directory modified ?
struct stat aStat;
- if( stat( aDir.getStr(), &aStat ) ||
+ if( stat( aDir.getStr(), &aStat ) ||
! S_ISDIR(aStat.st_mode) )
{
// remove outdated cache data
@@ -329,12 +326,12 @@ void FontCache::read()
{
OString aFile( aLine.Copy( 5 ) );
aStream.ReadLine( aLine );
-
+
const char* pLine = aLine.GetBuffer();
fonttype::type eType = (fonttype::type)atoi( pLine );
- if( eType != fonttype::TrueType &&
- eType != fonttype::Type1 &&
+ if( eType != fonttype::TrueType &&
+ eType != fonttype::Type1 &&
eType != fonttype::Builtin
)
continue;
@@ -342,15 +339,15 @@ void FontCache::read()
pLine++;
if( *pLine != ';' )
continue;
-
+
pLine++;
- sal_Int32 nFonts = atoi( pLine );
+ sal_Int32 nFonts = atoi( pLine );
for( int n = 0; n < nFonts; n++ )
{
aStream.ReadLine( aLine );
pLine = aLine.GetBuffer();
int nLen = aLine.Len();
-
+
PrintFontManager::PrintFont* pFont = NULL;
switch( eType )
{
@@ -365,10 +362,10 @@ void FontCache::read()
break;
default: break;
}
-
+
for( nIndex = 0; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ )
;
-
+
pFont->m_nFamilyName = pAtoms->getAtom( ATOM_FAMILYNAME,
OUString( pLine, nIndex, RTL_TEXTENCODING_UTF8 ),
sal_True );
@@ -386,7 +383,7 @@ void FontCache::read()
aStream.ReadLine( aLine );
pLine = aLine.GetBuffer();
nLen = aLine.Len();
-
+
// get up to 20 token positions
const int nMaxTokens = 20;
int nTokenPos[nMaxTokens];
@@ -491,8 +488,8 @@ void FontCache::read()
delete pFont;
continue;
}
-
- FontCacheEntry& rEntry = (*pDir)[aFile].m_aEntry;
+
+ FontCacheEntry& rEntry = (*pDir)[aFile].m_aEntry;
rEntry.push_back( pFont );
}
}
@@ -508,7 +505,7 @@ void FontCache::updateDirTimestamp( int nDirID )
const OString& rDir = rManager.getDirectory( nDirID );
struct stat aStat;
- if( ! stat( rDir.getStr(), &aStat ) )
+ if( ! stat( rDir.getStr(), &aStat ) )
m_aCache[ nDirID ].m_nTimestamp = (sal_Int64)aStat.st_mtime;
}
@@ -539,24 +536,24 @@ void FontCache::copyPrintFont( const PrintFontManager::PrintFont* pFrom, PrintFo
break;
default: break;
}
- pTo->m_nFamilyName = pFrom->m_nFamilyName;
+ pTo->m_nFamilyName = pFrom->m_nFamilyName;
pTo->m_aStyleName = pFrom->m_aStyleName;
- pTo->m_aAliases = pFrom->m_aAliases;
- pTo->m_nPSName = pFrom->m_nPSName;
- pTo->m_eItalic = pFrom->m_eItalic;
- pTo->m_eWeight = pFrom->m_eWeight;
- pTo->m_eWidth = pFrom->m_eWidth;
- pTo->m_ePitch = pFrom->m_ePitch;
- pTo->m_aEncoding = pFrom->m_aEncoding;
- pTo->m_aGlobalMetricX = pFrom->m_aGlobalMetricX;
- pTo->m_aGlobalMetricY = pFrom->m_aGlobalMetricY;
- pTo->m_nAscend = pFrom->m_nAscend;
- pTo->m_nDescend = pFrom->m_nDescend;
- pTo->m_nLeading = pFrom->m_nLeading;
- pTo->m_nXMin = pFrom->m_nXMin;
- pTo->m_nYMin = pFrom->m_nYMin;
- pTo->m_nXMax = pFrom->m_nXMax;
- pTo->m_nYMax = pFrom->m_nYMax;
+ pTo->m_aAliases = pFrom->m_aAliases;
+ pTo->m_nPSName = pFrom->m_nPSName;
+ pTo->m_eItalic = pFrom->m_eItalic;
+ pTo->m_eWeight = pFrom->m_eWeight;
+ pTo->m_eWidth = pFrom->m_eWidth;
+ pTo->m_ePitch = pFrom->m_ePitch;
+ pTo->m_aEncoding = pFrom->m_aEncoding;
+ pTo->m_aGlobalMetricX = pFrom->m_aGlobalMetricX;
+ pTo->m_aGlobalMetricY = pFrom->m_aGlobalMetricY;
+ pTo->m_nAscend = pFrom->m_nAscend;
+ pTo->m_nDescend = pFrom->m_nDescend;
+ pTo->m_nLeading = pFrom->m_nLeading;
+ pTo->m_nXMin = pFrom->m_nXMin;
+ pTo->m_nYMin = pFrom->m_nYMin;
+ pTo->m_nXMax = pFrom->m_nXMax;
+ pTo->m_nYMax = pFrom->m_nYMax;
pTo->m_bHaveVerticalSubstitutedGlyphs = pFrom->m_bHaveVerticalSubstitutedGlyphs;
pTo->m_bUserOverride = pFrom->m_bUserOverride;
}
@@ -574,10 +571,10 @@ bool FontCache::equalsPrintFont( const PrintFontManager::PrintFont* pLeft, Print
{
const PrintFontManager::TrueTypeFontFile* pLT = static_cast<const PrintFontManager::TrueTypeFontFile*>(pLeft);
const PrintFontManager::TrueTypeFontFile* pRT = static_cast<const PrintFontManager::TrueTypeFontFile*>(pRight);
- if( pRT->m_nDirectory != pLT->m_nDirectory ||
- pRT->m_aFontFile != pLT->m_aFontFile ||
- pRT->m_nCollectionEntry != pLT->m_nCollectionEntry ||
- pRT->m_nTypeFlags != pLT->m_nTypeFlags )
+ if( pRT->m_nDirectory != pLT->m_nDirectory ||
+ pRT->m_aFontFile != pLT->m_aFontFile ||
+ pRT->m_nCollectionEntry != pLT->m_nCollectionEntry ||
+ pRT->m_nTypeFlags != pLT->m_nTypeFlags )
return false;
}
break;
@@ -585,9 +582,9 @@ bool FontCache::equalsPrintFont( const PrintFontManager::PrintFont* pLeft, Print
{
const PrintFontManager::Type1FontFile* pLT = static_cast<const PrintFontManager::Type1FontFile*>(pLeft);
const PrintFontManager::Type1FontFile* pRT = static_cast<const PrintFontManager::Type1FontFile*>(pRight);
- if( pRT->m_nDirectory != pLT->m_nDirectory ||
- pRT->m_aFontFile != pLT->m_aFontFile ||
- pRT->m_aMetricFile != pLT->m_aMetricFile )
+ if( pRT->m_nDirectory != pLT->m_nDirectory ||
+ pRT->m_aFontFile != pLT->m_aFontFile ||
+ pRT->m_aMetricFile != pLT->m_aMetricFile )
return false;
}
break;
@@ -595,30 +592,30 @@ bool FontCache::equalsPrintFont( const PrintFontManager::PrintFont* pLeft, Print
{
const PrintFontManager::BuiltinFont* pLT = static_cast<const PrintFontManager::BuiltinFont*>(pLeft);
const PrintFontManager::BuiltinFont* pRT = static_cast<const PrintFontManager::BuiltinFont*>(pRight);
- if( pRT->m_nDirectory != pLT->m_nDirectory ||
- pRT->m_aMetricFile != pLT->m_aMetricFile )
+ if( pRT->m_nDirectory != pLT->m_nDirectory ||
+ pRT->m_aMetricFile != pLT->m_aMetricFile )
return false;
}
break;
default: break;
}
- if( pRight->m_nFamilyName != pLeft->m_nFamilyName ||
+ if( pRight->m_nFamilyName != pLeft->m_nFamilyName ||
pRight->m_aStyleName != pLeft->m_aStyleName ||
- pRight->m_nPSName != pLeft->m_nPSName ||
- pRight->m_eItalic != pLeft->m_eItalic ||
- pRight->m_eWeight != pLeft->m_eWeight ||
- pRight->m_eWidth != pLeft->m_eWidth ||
- pRight->m_ePitch != pLeft->m_ePitch ||
- pRight->m_aEncoding != pLeft->m_aEncoding ||
- pRight->m_aGlobalMetricX != pLeft->m_aGlobalMetricX ||
- pRight->m_aGlobalMetricY != pLeft->m_aGlobalMetricY ||
- pRight->m_nAscend != pLeft->m_nAscend ||
- pRight->m_nDescend != pLeft->m_nDescend ||
- pRight->m_nLeading != pLeft->m_nLeading ||
- pRight->m_nXMin != pLeft->m_nXMin ||
- pRight->m_nYMin != pLeft->m_nYMin ||
- pRight->m_nXMax != pLeft->m_nXMax ||
- pRight->m_nYMax != pLeft->m_nYMax ||
+ pRight->m_nPSName != pLeft->m_nPSName ||
+ pRight->m_eItalic != pLeft->m_eItalic ||
+ pRight->m_eWeight != pLeft->m_eWeight ||
+ pRight->m_eWidth != pLeft->m_eWidth ||
+ pRight->m_ePitch != pLeft->m_ePitch ||
+ pRight->m_aEncoding != pLeft->m_aEncoding ||
+ pRight->m_aGlobalMetricX != pLeft->m_aGlobalMetricX ||
+ pRight->m_aGlobalMetricY != pLeft->m_aGlobalMetricY ||
+ pRight->m_nAscend != pLeft->m_nAscend ||
+ pRight->m_nDescend != pLeft->m_nDescend ||
+ pRight->m_nLeading != pLeft->m_nLeading ||
+ pRight->m_nXMin != pLeft->m_nXMin ||
+ pRight->m_nYMin != pLeft->m_nYMin ||
+ pRight->m_nXMax != pLeft->m_nXMax ||
+ pRight->m_nYMax != pLeft->m_nYMax ||
pRight->m_bHaveVerticalSubstitutedGlyphs != pLeft->m_bHaveVerticalSubstitutedGlyphs ||
pRight->m_bUserOverride != pLeft->m_bUserOverride
)
@@ -787,7 +784,7 @@ bool FontCache::scanAdditionalFiles( const OString& rDir )
int nDirID = rManager.getDirectoryAtom( rDir );
FontCacheData::const_iterator dir = m_aCache.find( nDirID );
bool bFound = (dir != m_aCache.end());
-
+
return (bFound && dir->second.m_bUserOverrideOnly);
}
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index c938e25c0aec..abb8a6be4455 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,28 +40,22 @@ using namespace psp;
#include <ft2build.h>
#include <fontconfig/fcfreetype.h>
// allow compile on baseline (currently with fontconfig 2.2.0)
- #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1
+ #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1
#define FC_WEIGHT_BOOK 75
#endif
- #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92
+ #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92
#define FC_EMBEDDED_BITMAP "embeddedbitmap"
#endif
- #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97
+ #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97
#define FC_FAMILYLANG "familylang"
#endif
- #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91
+ #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91
#define FC_HINT_STYLE "hintstyle"
#define FC_HINT_NONE 0
#define FC_HINT_SLIGHT 1
#define FC_HINT_MEDIUM 2
#define FC_HINT_FULL 3
#endif
- #ifndef FC_FT_FACE
- #define FC_FT_FACE "ftface"
- #endif
- #ifndef FC_EMBOLDEN
- #define FC_EMBOLDEN "embolden"
- #endif
#else
typedef void FcConfig;
typedef void FcObjectSet;
@@ -96,62 +90,49 @@ using namespace psp;
#include <algorithm>
using namespace osl;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OString;
-
-namespace
-{
- typedef std::pair<FcChar8*, FcChar8*> lang_and_element;
-}
+using namespace rtl;
class FontCfgWrapper
{
- oslModule m_pLib;
+ oslModule m_pLib;
FcFontSet* m_pOutlineSet;
int m_nFcVersion;
FcBool (*m_pFcInit)();
- void (*m_pFcFini)();
int (*m_pFcGetVersion)();
- FcConfig* (*m_pFcConfigGetCurrent)();
- FcObjectSet* (*m_pFcObjectSetVaBuild)(const char*,va_list);
- void (*m_pFcObjectSetDestroy)(FcObjectSet* pSet);
- FcPattern* (*m_pFcPatternCreate)();
- void (*m_pFcPatternDestroy)(FcPattern*);
- FcBool (*m_pFcPatternEqual)(const FcPattern*,const FcPattern*);
+ FcConfig* (*m_pFcConfigGetCurrent)();
+ FcObjectSet* (*m_pFcObjectSetVaBuild)(const char*,va_list);
+ void (*m_pFcObjectSetDestroy)(FcObjectSet* pSet);
+ FcPattern* (*m_pFcPatternCreate)();
+ void (*m_pFcPatternDestroy)(FcPattern*);
+ FcFontSet* (*m_pFcFontList)(FcConfig*,FcPattern*,FcObjectSet*);
FcFontSet* (*m_pFcConfigGetFonts)(FcConfig*,FcSetName);
- FcFontSet* (*m_pFcFontSetCreate)();
+ FcFontSet* (*m_pFcFontSetCreate)();
FcCharSet* (*m_pFcCharSetCreate)();
FcBool (*m_pFcCharSetAddChar)(FcCharSet *, FcChar32);
FcBool (*m_pFcCharSetHasChar)(FcCharSet *, FcChar32);
void (*m_pFcCharSetDestroy)(FcCharSet*);
- void (*m_pFcFontSetDestroy)(FcFontSet*);
- FcBool (*m_pFcFontSetAdd)(FcFontSet*,FcPattern*);
+ void (*m_pFcFontSetDestroy)(FcFontSet*);
+ FcBool (*m_pFcFontSetAdd)(FcFontSet*,FcPattern*);
void (*m_pFcPatternReference)(FcPattern*);
FcResult (*m_pFcPatternGetCharSet)(const FcPattern*,const char*,int,FcCharSet**);
- FcResult (*m_pFcPatternGetString)(const FcPattern*,const char*,int,FcChar8**);
- FcResult (*m_pFcPatternGetInteger)(const FcPattern*,const char*,int,int*);
- FcResult (*m_pFcPatternGetDouble)(const FcPattern*,const char*,int,double*);
- 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);
+ FcResult (*m_pFcPatternGetString)(const FcPattern*,const char*,int,FcChar8**);
+ FcResult (*m_pFcPatternGetInteger)(const FcPattern*,const char*,int,int*);
+ FcResult (*m_pFcPatternGetDouble)(const FcPattern*,const char*,int,double*);
+ FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
+ void (*m_pFcDefaultSubstitute)(FcPattern *);
+ FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, 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);
+ 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*);
-
+ FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
- FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face);
oslGenericFunction loadSymbol( const char* );
void addFontSet( FcSetName );
@@ -163,20 +144,14 @@ public:
static FontCfgWrapper& get();
static void release();
- bool isValid() const
+ bool isValid() const
{ return m_pLib != NULL;}
FcFontSet* getFontSet();
-
+
FcBool FcInit()
{ return m_pFcInit(); }
-
- void FcFini()
- {
- //To-Do: get gtk vclplug smoketest to pass
- //if (m_pFcFini) m_pFcFini();
- }
-
+
int FcGetVersion()
{ return m_pFcGetVersion(); }
@@ -194,15 +169,15 @@ public:
void FcObjectSetDestroy( FcObjectSet* pSet )
{ m_pFcObjectSetDestroy( pSet ); }
-
+
FcPattern* FcPatternCreate()
{ return m_pFcPatternCreate(); }
void FcPatternDestroy( FcPattern* pPattern )
- { if (m_pFcPatternDestroy) m_pFcPatternDestroy( pPattern ); }
-
- FcBool FcPatternEqual( const FcPattern* pPatternA, const FcPattern *pPatternB )
- { return m_pFcPatternEqual( pPatternA, pPatternB ); }
+ { m_pFcPatternDestroy( pPattern ); }
+
+ FcFontSet* FcFontList( FcConfig* pConfig, FcPattern* pPattern, FcObjectSet* pSet )
+ { return m_pFcFontList( pConfig, pPattern, pSet ); }
FcFontSet* FcConfigGetFonts( FcConfig* pConfig, FcSetName eSet)
{ return m_pFcConfigGetFonts( pConfig, eSet ); }
@@ -256,13 +231,8 @@ 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 )
@@ -273,25 +243,14 @@ 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 )
- {
- return m_pFcPatternAddFTFace
- ? m_pFcPatternAddFTFace( pPattern, pObject, nValue )
- : false;
- }
-public:
- FcResult LocalizedElementFromPattern(FcPattern* pPattern, FcChar8 **family,
- const char *elementtype, const char *elementlangtype);
-//to-do, make private and add some cleanish accessor methods
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontNameToLocalized;
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aLocalizedToCanonical;
-private:
- void cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements);
+
+public: // TODO: cleanup
+ FcResult FamilyFromPattern(FcPattern* pPattern, FcChar8 **family);
+ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontNameToLocalized;
+ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aLocalizedToCanonical;
};
oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol )
@@ -327,8 +286,6 @@ FontCfgWrapper::FontCfgWrapper()
m_pFcInit = (FcBool(*)())
loadSymbol( "FcInit" );
- m_pFcFini = (void(*)())
- loadSymbol( "FcFini" );
m_pFcGetVersion = (int(*)())
loadSymbol( "FcGetVersion" );
m_pFcConfigGetCurrent = (FcConfig *(*)())
@@ -341,8 +298,8 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcPatternCreate" );
m_pFcPatternDestroy = (void(*)(FcPattern*))
loadSymbol( "FcPatternDestroy" );
- m_pFcPatternEqual = (FcBool(*)(const FcPattern*,const FcPattern*))
- loadSymbol( "FcPatternEqual" );
+ m_pFcFontList = (FcFontSet*(*)(FcConfig*,FcPattern*,FcObjectSet*))
+ loadSymbol( "FcFontList" );
m_pFcConfigGetFonts = (FcFontSet*(*)(FcConfig*,FcSetName))
loadSymbol( "FcConfigGetFonts" );
m_pFcFontSetCreate = (FcFontSet*(*)())
@@ -381,13 +338,8 @@ 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))
@@ -398,13 +350,8 @@ 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))
- loadSymbol( "FcPatternAddFTFace" );
m_nFcVersion = FcGetVersion();
#if (OSL_DEBUG_LEVEL > 1)
@@ -420,41 +367,38 @@ FontCfgWrapper::FontCfgWrapper()
}
if( ! (
- m_pFcInit &&
- m_pFcGetVersion &&
- m_pFcConfigGetCurrent &&
- m_pFcObjectSetVaBuild &&
- m_pFcObjectSetDestroy &&
- m_pFcPatternCreate &&
- m_pFcPatternDestroy &&
- m_pFcPatternEqual &&
+ m_pFcInit &&
+ m_pFcGetVersion &&
+ m_pFcConfigGetCurrent &&
+ m_pFcObjectSetVaBuild &&
+ m_pFcObjectSetDestroy &&
+ m_pFcPatternCreate &&
+ m_pFcPatternDestroy &&
+ m_pFcFontList &&
m_pFcConfigGetFonts &&
- m_pFcFontSetCreate &&
- m_pFcCharSetCreate &&
- m_pFcCharSetAddChar &&
+ m_pFcFontSetCreate &&
+ m_pFcCharSetCreate &&
+ m_pFcCharSetAddChar &&
m_pFcCharSetHasChar &&
m_pFcCharSetDestroy &&
- m_pFcFontSetDestroy &&
- m_pFcFontSetAdd &&
+ m_pFcFontSetDestroy &&
+ m_pFcFontSetAdd &&
m_pFcPatternReference &&
- m_pFcPatternGetCharSet &&
- m_pFcPatternGetString &&
- m_pFcPatternGetInteger &&
- m_pFcPatternGetDouble &&
- m_pFcPatternGetBool &&
- m_pFcConfigAppFontAddFile &&
- m_pFcConfigAppFontAddDir &&
- m_pFcConfigParseAndLoad &&
- m_pFcFontMatch &&
- m_pFcDefaultSubstitute &&
- m_pFcConfigSubstitute &&
- m_pFcPatternDuplicate &&
- m_pFcPatternAddInteger &&
+ m_pFcPatternGetCharSet &&
+ m_pFcPatternGetString &&
+ m_pFcPatternGetInteger &&
+ m_pFcPatternGetDouble &&
+ m_pFcPatternGetBool &&
+ m_pFcConfigAppFontAddFile &&
+ m_pFcConfigAppFontAddDir &&
+ m_pFcConfigParseAndLoad &&
+ m_pFcDefaultSubstitute &&
+ m_pFcConfigSubstitute &&
+ m_pFcPatternAddInteger &&
m_pFcPatternAddDouble &&
- m_pFcPatternAddCharSet &&
- m_pFcPatternAddBool &&
- m_pFcPatternAddString &&
- m_pFcPatternDel
+ m_pFcPatternAddCharSet &&
+ m_pFcPatternAddBool &&
+ m_pFcPatternAddString
) )
{
osl_unloadModule( (oslModule)m_pLib );
@@ -478,116 +422,30 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
{
#ifdef ENABLE_FONTCONFIG
/*
- add only acceptable outlined fonts to our config,
+ add only acceptable outlined fonts to our config,
for future fontconfig use
*/
FcFontSet* pOrig = FcConfigGetFonts( FcConfigGetCurrent(), eSetName );
if( !pOrig )
return;
- // filter the font sets to remove obsolete faces
for( int i = 0; i < pOrig->nfont; ++i )
{
- FcPattern* pPattern = pOrig->fonts[i];
- // #i115131# ignore non-outline fonts
- FcBool bOutline = FcFalse;
- FcResult eOutRes = FcPatternGetBool( pPattern, FC_OUTLINE, 0, &bOutline );
- if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ FcBool outline = false;
+ FcPattern *pOutlinePattern = pOrig->fonts[i];
+ FcResult eOutRes =
+ FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
+ if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
continue;
- FcPatternReference( pPattern );
- FcFontSetAdd( m_pOutlineSet, pPattern );
+ FcPatternReference(pOutlinePattern);
+ FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
}
-
- // TODO?: FcFontSetDestroy( pOrig );
+ // TODO: FcFontSetDestroy( pOrig );
#else
(void)eSetName; // prevent compiler warning about unused parameter
#endif
}
-
-#ifdef ENABLE_FONTCONFIG
-namespace
-{
- int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b)
- {
- FcChar8 *pNameA=NULL, *pNameB=NULL;
-
- bool bHaveA = rWrapper.FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
- bool bHaveB = rWrapper.FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
-
- if (bHaveA && bHaveB)
- return strcmp((const char*)pNameA, (const char*)pNameB);
-
- return bHaveA - bHaveB;
- }
-
- //Sort fonts so that fonts with the same family name are side-by-side, with
- //those with higher version numbers first
- class SortFont : public ::std::binary_function< const FcPattern*, const FcPattern*, bool >
- {
- private:
- FontCfgWrapper& m_rWrapper;
- public:
- SortFont(FontCfgWrapper& rWrapper) : m_rWrapper(rWrapper) {}
-
- bool operator()(const FcPattern *a, const FcPattern *b)
- {
- int comp = compareFontNames(m_rWrapper, a, b);
- if (comp != 0)
- return comp < 0;
-
- int nVersionA=0, nVersionB=0;
-
- bool bHaveA = m_rWrapper.FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
- bool bHaveB = m_rWrapper.FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
-
- if (bHaveA && bHaveB)
- return nVersionA > nVersionB;
-
- return bHaveA - bHaveA;
- }
- };
-
- //See fdo#30729 for where an old opensymbol installed system-wide can
- //clobber the new opensymbol installed locally
- //
- //See if this font is a duplicate with equal attributes which has already been
- //inserted, or if it an older version of an inserted fonts. Depends on FcFontSet
- //on being sorted with SortFont
- bool isPreviouslyDuplicateOrObsoleted(FontCfgWrapper& rWrapper, FcFontSet *pFSet, int i)
- {
- if (i == 0)
- return false;
-
- const FcPattern *a = pFSet->fonts[i];
- const FcPattern *b = pFSet->fonts[i-1];
-
- if (compareFontNames(rWrapper, a, b) != 0)
- return false;
-
- FcPattern* pTestPatternA = rWrapper.FcPatternDuplicate(a);
- rWrapper.FcPatternDel(pTestPatternA, FC_FILE);
- rWrapper.FcPatternDel(pTestPatternA, FC_CHARSET);
- rWrapper.FcPatternDel(pTestPatternA, FC_CAPABILITY);
- rWrapper.FcPatternDel(pTestPatternA, FC_FONTVERSION);
-
- FcPattern* pTestPatternB = rWrapper.FcPatternDuplicate(b);
- rWrapper.FcPatternDel(pTestPatternB, FC_FILE);
- rWrapper.FcPatternDel(pTestPatternB, FC_CHARSET);
- rWrapper.FcPatternDel(pTestPatternB, FC_CAPABILITY);
- rWrapper.FcPatternDel(pTestPatternB, FC_FONTVERSION);
-
- bool bIsDup = false;
- if (rWrapper.FcPatternEqual(pTestPatternA, pTestPatternB))
- bIsDup = true;
-
- rWrapper.FcPatternDestroy(pTestPatternB);
- rWrapper.FcPatternDestroy(pTestPatternA);
-
- return bIsDup;
- }
-}
-#endif
-
+
FcFontSet* FontCfgWrapper::getFontSet()
{
#ifdef ENABLE_FONTCONFIG
@@ -595,10 +453,8 @@ FcFontSet* FontCfgWrapper::getFontSet()
{
m_pOutlineSet = FcFontSetCreate();
addFontSet( FcSetSystem );
- if( m_nFcVersion > 20400 ) // #i85462# prevent crashes
+ if( m_nFcVersion > 20400 ) // #i85462# prevent crashes
addFontSet( FcSetApplication );
-
- ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this));
}
#endif
@@ -609,7 +465,6 @@ FontCfgWrapper::~FontCfgWrapper()
{
if( m_pOutlineSet )
FcFontSetDestroy( m_pOutlineSet );
- FcFini();
if( m_pLib )
osl_unloadModule( (oslModule)m_pLib );
}
@@ -635,25 +490,27 @@ void FontCfgWrapper::release()
#ifdef ENABLE_FONTCONFIG
namespace
{
+ typedef std::pair<FcChar8*, FcChar8*> lang_and_family;
+
class localizedsorter
{
rtl::OLocale maLoc;
public:
localizedsorter(rtl_Locale* pLoc) : maLoc(pLoc) {}
- FcChar8* bestname(const std::vector<lang_and_element> &elements);
+ FcChar8* bestname(const std::vector<lang_and_family> &families);
};
- FcChar8* localizedsorter::bestname(const std::vector<lang_and_element> &elements)
+ FcChar8* localizedsorter::bestname(const std::vector<lang_and_family> &families)
{
- FcChar8* candidate = elements.begin()->second;
+ FcChar8* candidate = families.begin()->second;
rtl::OString sLangMatch(rtl::OUStringToOString(maLoc.getLanguage().toAsciiLowerCase(), RTL_TEXTENCODING_UTF8));
- rtl::OString sFullMatch = sLangMatch;
+ rtl::OString sFullMatch = sLangMatch;
sFullMatch += OString('-');
sFullMatch += rtl::OUStringToOString(maLoc.getCountry().toAsciiLowerCase(), RTL_TEXTENCODING_UTF8);
- std::vector<lang_and_element>::const_iterator aEnd = elements.end();
+ std::vector<lang_and_family>::const_iterator aEnd = families.end();
bool alreadyclosematch = false;
- for( std::vector<lang_and_element>::const_iterator aIter = elements.begin(); aIter != aEnd; ++aIter )
+ for( std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter )
{
const char *pLang = (const char*)aIter->first;
if( rtl_str_compare( pLang, sFullMatch.getStr() ) == 0)
@@ -675,7 +532,7 @@ namespace
}
else if( rtl_str_compare( pLang, "en") == 0)
{
- // fallback to the english element name
+ // fallback to the english family name
candidate = aIter->second;
}
}
@@ -683,58 +540,49 @@ namespace
}
}
-//Set up maps to quickly map between a fonts best UI name and all the rest of its names, and vice versa
-void FontCfgWrapper::cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements)
+FcResult FontCfgWrapper::FamilyFromPattern(FcPattern* pPattern, FcChar8 **family)
{
- std::vector<lang_and_element>::const_iterator aEnd = lang_and_elements.end();
- for (std::vector<lang_and_element>::const_iterator aIter = lang_and_elements.begin(); aIter != aEnd; ++aIter)
+ FcChar8 *origfamily;
+ FcResult eFamilyRes = FcPatternGetString( pPattern, FC_FAMILY, 0, &origfamily );
+ *family = origfamily;
+
+ if( eFamilyRes == FcResultMatch)
{
- const char *candidate = (const char*)(aIter->second);
- if (rtl_str_compare(candidate, (const char*)bestfontname) != 0)
- m_aFontNameToLocalized[OString(candidate)] = OString((const char*)bestfontname);
- }
- if (rtl_str_compare((const char*)origfontname, (const char*)bestfontname) != 0)
- m_aLocalizedToCanonical[OString((const char*)bestfontname)] = OString((const char*)origfontname);
-}
-
-FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern* pPattern, FcChar8 **element,
- const char *elementtype, const char *elementlangtype)
-{ /* e. g.: ^ FC_FAMILY ^ FC_FAMILYLANG */
- FcChar8 *origelement;
- FcResult eElementRes = FcPatternGetString( pPattern, elementtype, 0, &origelement );
- *element = origelement;
-
- if( eElementRes == FcResultMatch)
- {
- FcChar8* elementlang = NULL;
- if (FcPatternGetString( pPattern, elementlangtype, 0, &elementlang ) == FcResultMatch)
+ FcChar8* familylang = NULL;
+ if (FcPatternGetString( pPattern, FC_FAMILYLANG, 0, &familylang ) == FcResultMatch)
{
- std::vector< lang_and_element > lang_and_elements;
- lang_and_elements.push_back(lang_and_element(elementlang, *element));
+ std::vector< lang_and_family > lang_and_families;
+ lang_and_families.push_back(lang_and_family(familylang, *family));
int k = 1;
while (1)
{
- if (FcPatternGetString( pPattern, elementlangtype, k, &elementlang ) != FcResultMatch)
+ if (FcPatternGetString( pPattern, FC_FAMILYLANG, k, &familylang ) != FcResultMatch)
break;
- if (FcPatternGetString( pPattern, elementtype, k, element ) != FcResultMatch)
+ if (FcPatternGetString( pPattern, FC_FAMILY, k, family ) != FcResultMatch)
break;
- lang_and_elements.push_back(lang_and_element(elementlang, *element));
+ lang_and_families.push_back(lang_and_family(familylang, *family));
++k;
}
-
+
//possible to-do, sort by UILocale instead of process locale
rtl_Locale* pLoc;
osl_getProcessLocale(&pLoc);
localizedsorter aSorter(pLoc);
- *element = aSorter.bestname(lang_and_elements);
-
- //if this element is a fontname, map the other names to this best-name
- if (rtl_str_compare(elementtype, FC_FAMILY) == 0)
- cacheLocalizedFontNames(origelement, *element, lang_and_elements);
+ *family = aSorter.bestname(lang_and_families);
+
+ std::vector<lang_and_family>::const_iterator aEnd = lang_and_families.end();
+ for (std::vector<lang_and_family>::const_iterator aIter = lang_and_families.begin(); aIter != aEnd; ++aIter)
+ {
+ const char *candidate = (const char*)(aIter->second);
+ if (rtl_str_compare(candidate, (const char*)(*family)) != 0)
+ m_aFontNameToLocalized[OString(candidate)] = OString((const char*)(*family));
+ }
+ if (rtl_str_compare((const char*)origfamily, (const char*)(*family)) != 0)
+ m_aLocalizedToCanonical[OString((const char*)(*family))] = OString((const char*)origfamily);
}
}
-
- return eElementRes;
+
+ return eFamilyRes;
}
/*
@@ -814,7 +662,7 @@ namespace
}
}
-int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths )
+int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths )
{
int nFonts = 0;
@@ -838,16 +686,16 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
int spacing = 0;
int nCollectionEntry = -1;
FcBool outline = false;
-
- FcResult eFileRes = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_FILE, 0, &file );
- FcResult eFamilyRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &family, FC_FAMILY, FC_FAMILYLANG );
- FcResult eStyleRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &style, FC_STYLE, FC_STYLELANG );
- FcResult eSlantRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant );
- FcResult eWeightRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight );
- FcResult eSpacRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing );
- FcResult eOutRes = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline );
+
+ FcResult eFileRes = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_FILE, 0, &file );
+ FcResult eFamilyRes = rWrapper.FamilyFromPattern( pFSet->fonts[i], &family );
+ FcResult eStyleRes = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_STYLE, 0, &style );
+ FcResult eSlantRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant );
+ FcResult eWeightRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight );
+ FcResult eSpacRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing );
+ FcResult eOutRes = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline );
FcResult eIndexRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry );
-
+
if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch )
continue;
@@ -864,28 +712,20 @@ 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 )
continue;
- if (isPreviouslyDuplicateOrObsoleted(rWrapper, pFSet, i))
- {
-#if OSL_DEBUG_LEVEL > 2
- fprintf(stderr, "Ditching %s as duplicate/obsolete\n", file);
-#endif
- continue;
- }
-
// see if this font is already cached
// update attributes
std::list< PrintFont* > aFonts;
OString aDir, aBase, aOrgPath( (sal_Char*)file );
splitPath( aOrgPath, aDir, aBase );
-
+
o_rVisitedPaths[aDir] = 1;
-
+
int nDirID = getDirectoryAtom( aDir, true );
if( ! m_pFontCache->getFontCacheFile( nDirID, aBase, aFonts ) )
{
@@ -902,10 +742,7 @@ 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();
@@ -943,7 +780,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
pUpdate = NULL;
}
}
-
+
if( pUpdate )
{
// set family name
@@ -960,7 +797,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
{
pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 );
}
-
+
// update font cache
m_pFontCache->updateFontCacheEntry( pUpdate, false );
// sort into known fonts
@@ -983,7 +820,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
}
}
}
-
+
// how does one get rid of the config ?
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "inserted %d fonts from fontconfig\n", nFonts );
@@ -1038,7 +875,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
return true;
}
-static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
+static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
italic::type eItalic, weight::type eWeight, width::type eWidth, pitch::type ePitch)
{
if( eItalic != italic::Unknown )
@@ -1046,8 +883,8 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
int nSlant = FC_SLANT_ROMAN;
switch( eItalic )
{
- case italic::Italic: nSlant = FC_SLANT_ITALIC;break;
- case italic::Oblique: nSlant = FC_SLANT_OBLIQUE;break;
+ case italic::Italic: nSlant = FC_SLANT_ITALIC;break;
+ case italic::Oblique: nSlant = FC_SLANT_OBLIQUE;break;
default:
break;
}
@@ -1058,16 +895,16 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
int nWeight = FC_WEIGHT_NORMAL;
switch( eWeight )
{
- case weight::Thin: nWeight = FC_WEIGHT_THIN;break;
- case weight::UltraLight: nWeight = FC_WEIGHT_ULTRALIGHT;break;
- case weight::Light: nWeight = FC_WEIGHT_LIGHT;break;
- case weight::SemiLight: nWeight = FC_WEIGHT_BOOK;break;
- case weight::Normal: nWeight = FC_WEIGHT_NORMAL;break;
- case weight::Medium: nWeight = FC_WEIGHT_MEDIUM;break;
- case weight::SemiBold: nWeight = FC_WEIGHT_SEMIBOLD;break;
- case weight::Bold: nWeight = FC_WEIGHT_BOLD;break;
- case weight::UltraBold: nWeight = FC_WEIGHT_ULTRABOLD;break;
- case weight::Black: nWeight = FC_WEIGHT_BLACK;break;
+ case weight::Thin: nWeight = FC_WEIGHT_THIN;break;
+ case weight::UltraLight: nWeight = FC_WEIGHT_ULTRALIGHT;break;
+ case weight::Light: nWeight = FC_WEIGHT_LIGHT;break;
+ case weight::SemiLight: nWeight = FC_WEIGHT_BOOK;break;
+ case weight::Normal: nWeight = FC_WEIGHT_NORMAL;break;
+ case weight::Medium: nWeight = FC_WEIGHT_MEDIUM;break;
+ case weight::SemiBold: nWeight = FC_WEIGHT_SEMIBOLD;break;
+ case weight::Bold: nWeight = FC_WEIGHT_BOLD;break;
+ case weight::UltraBold: nWeight = FC_WEIGHT_ULTRABOLD;break;
+ case weight::Black: nWeight = FC_WEIGHT_BLACK;break;
default:
break;
}
@@ -1078,15 +915,15 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
int nWidth = FC_WIDTH_NORMAL;
switch( eWidth )
{
- case width::UltraCondensed: nWidth = FC_WIDTH_ULTRACONDENSED;break;
+ case width::UltraCondensed: nWidth = FC_WIDTH_ULTRACONDENSED;break;
case width::ExtraCondensed: nWidth = FC_WIDTH_EXTRACONDENSED;break;
- case width::Condensed: nWidth = FC_WIDTH_CONDENSED;break;
- case width::SemiCondensed: nWidth = FC_WIDTH_SEMICONDENSED;break;
- case width::Normal: nWidth = FC_WIDTH_NORMAL;break;
- case width::SemiExpanded: nWidth = FC_WIDTH_SEMIEXPANDED;break;
- case width::Expanded: nWidth = FC_WIDTH_EXPANDED;break;
- case width::ExtraExpanded: nWidth = FC_WIDTH_EXTRAEXPANDED;break;
- case width::UltraExpanded: nWidth = FC_WIDTH_ULTRACONDENSED;break;
+ case width::Condensed: nWidth = FC_WIDTH_CONDENSED;break;
+ case width::SemiCondensed: nWidth = FC_WIDTH_SEMICONDENSED;break;
+ case width::Normal: nWidth = FC_WIDTH_NORMAL;break;
+ case width::SemiExpanded: nWidth = FC_WIDTH_SEMIEXPANDED;break;
+ case width::Expanded: nWidth = FC_WIDTH_EXPANDED;break;
+ case width::ExtraExpanded: nWidth = FC_WIDTH_EXTRAEXPANDED;break;
+ case width::UltraExpanded: nWidth = FC_WIDTH_ULTRACONDENSED;break;
default:
break;
}
@@ -1097,8 +934,8 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
int nSpacing = FC_PROPORTIONAL;
switch( ePitch )
{
- case pitch::Fixed: nSpacing = FC_MONO;break;
- case pitch::Variable: nSpacing = FC_PROPORTIONAL;break;
+ case pitch::Fixed: nSpacing = FC_MONO;break;
+ case pitch::Variable: nSpacing = FC_PROPORTIONAL;break;
default:
break;
}
@@ -1128,15 +965,9 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
const FcChar8* pTargetNameUtf8 = (FcChar8*)aTargetName.getStr();
rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 );
+ const FcChar8* pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr();
if( rLangAttrib.getLength() )
- {
- const FcChar8* pLangAttribUtf8;
- if (rLangAttrib.equalsIgnoreAsciiCase(OString(RTL_CONSTASCII_STRINGPARAM("pa-in"))))
- pLangAttribUtf8 = (FcChar8*)"pa";
- else
- pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr();
rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 );
- }
// Add required Unicode characters, if any
if ( rMissingCodes.getLength() )
@@ -1185,7 +1016,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
if( eFileRes == FcResultMatch )
{
OString sFamily((sal_Char*)family);
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontNameToLocalized.find(sFamily);
+ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontNameToLocalized.find(sFamily);
if (aI != rWrapper.m_aFontNameToLocalized.end())
sFamily = aI->second;
aName = rtl::OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 );
@@ -1228,47 +1059,23 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
return aName;
}
-class FontConfigFontOptions : public ImplFontOptions
-{
-public:
- FontConfigFontOptions() : mpPattern(0) {}
- ~FontConfigFontOptions()
- {
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( rWrapper.isValid() )
- rWrapper.FcPatternDestroy( mpPattern );
- }
- virtual void *GetPattern(void * face, bool bEmbolden) const
- {
- FontCfgWrapper& rWrapper = FontCfgWrapper::get();
- if( rWrapper.isValid() )
- {
- rWrapper.FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast<FT_Face>(face));
- rWrapper.FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse);
- }
- return mpPattern;
- }
- FcPattern* mpPattern;
-};
-
-ImplFontOptions* PrintFontManager::getFontOptions(
- const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const
+bool PrintFontManager::getFontOptions(
+ const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*),
+ ImplFontOptions& rOptions) const
{
#ifndef ENABLE_FONTCONFIG
- (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
- return NULL;
+ return false;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
if( ! rWrapper.isValid() )
- return NULL;
+ return false;
- FontConfigFontOptions* pOptions = NULL;
FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
FcPattern* pPattern = rWrapper.FcPatternCreate();
OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aLocalizedToCanonical.find(sFamily);
+ std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aLocalizedToCanonical.find(sFamily);
if (aI != rWrapper.m_aLocalizedToCanonical.end())
sFamily = aI->second;
if( sFamily.getLength() )
@@ -1289,43 +1096,49 @@ ImplFontOptions* PrintFontManager::getFontOptions(
FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
if( pResult )
{
- FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pResult,
- FC_EMBEDDED_BITMAP, 0, &embitmap);
- FcResult eAntialias = rWrapper.FcPatternGetBool(pResult,
- FC_ANTIALIAS, 0, &antialias);
- FcResult eAutoHint = rWrapper.FcPatternGetBool(pResult,
- FC_AUTOHINT, 0, &autohint);
- FcResult eHinting = rWrapper.FcPatternGetBool(pResult,
- FC_HINTING, 0, &hinting);
- /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger(pResult,
- FC_HINT_STYLE, 0, &hintstyle);
-
- pOptions = new FontConfigFontOptions;
-
- pOptions->mpPattern = pResult;
-
- if( eEmbeddedBitmap == FcResultMatch )
- pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
- if( eAntialias == FcResultMatch )
- pOptions->meAntiAlias = antialias ? ANTIALIAS_TRUE : ANTIALIAS_FALSE;
- if( eAutoHint == FcResultMatch )
- pOptions->meAutoHint = autohint ? AUTOHINT_TRUE : AUTOHINT_FALSE;
- if( eHinting == FcResultMatch )
- pOptions->meHinting = hinting ? HINTING_TRUE : HINTING_FALSE;
- switch (hintstyle)
+ FcFontSet* pSet = rWrapper.FcFontSetCreate();
+ rWrapper.FcFontSetAdd( pSet, pResult );
+ if( pSet->nfont > 0 )
{
- case FC_HINT_NONE: pOptions->meHintStyle = HINT_NONE; break;
- case FC_HINT_SLIGHT: pOptions->meHintStyle = HINT_SLIGHT; break;
- case FC_HINT_MEDIUM: pOptions->meHintStyle = HINT_MEDIUM; break;
- default: // fall through
- case FC_HINT_FULL: pOptions->meHintStyle = HINT_FULL; break;
+ FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pSet->fonts[0],
+ FC_EMBEDDED_BITMAP, 0, &embitmap);
+ FcResult eAntialias = rWrapper.FcPatternGetBool(pSet->fonts[0],
+ FC_ANTIALIAS, 0, &antialias);
+ FcResult eAutoHint = rWrapper.FcPatternGetBool(pSet->fonts[0],
+ FC_AUTOHINT, 0, &autohint);
+ FcResult eHinting = rWrapper.FcPatternGetBool(pSet->fonts[0],
+ FC_HINTING, 0, &hinting);
+ /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger( pSet->fonts[0],
+ FC_HINT_STYLE, 0, &hintstyle);
+
+ if( eEmbeddedBitmap == FcResultMatch )
+ rOptions.meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
+ if( eAntialias == FcResultMatch )
+ rOptions.meAntiAlias = antialias ? ANTIALIAS_TRUE : ANTIALIAS_FALSE;
+ if( eAutoHint == FcResultMatch )
+ rOptions.meAutoHint = autohint ? AUTOHINT_TRUE : AUTOHINT_FALSE;
+ if( eHinting == FcResultMatch )
+ rOptions.meHinting = hinting ? HINTING_TRUE : HINTING_FALSE;
+ switch (hintstyle)
+ {
+ case FC_HINT_NONE: rOptions.meHintStyle = HINT_NONE; break;
+ case FC_HINT_SLIGHT: rOptions.meHintStyle = HINT_SLIGHT; break;
+ case FC_HINT_MEDIUM: rOptions.meHintStyle = HINT_MEDIUM; break;
+ default: // fall through
+ case FC_HINT_FULL: rOptions.meHintStyle = HINT_FULL; break;
+ }
}
+ // info: destroying the pSet destroys pResult implicitly
+ // since pResult was "added" to pSet
+ rWrapper.FcFontSetDestroy( pSet );
}
// cleanup
rWrapper.FcPatternDestroy( pPattern );
- return pOptions;
+ // TODO: return true only if non-default font options are set
+ const bool bOK = (pResult != NULL);
+ return bOK;
#endif
}
@@ -1403,7 +1216,7 @@ bool PrintFontManager::initFontconfig()
return false;
}
-int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& )
+int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl::OStringHash>& )
{
return 0;
}
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index cd5fbda449e0..3bc8a1ea3298 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -75,7 +75,7 @@
#include "sal/alloca.h"
#include <set>
-#include <boost/unordered_set.hpp>
+#include <hash_set>
#include <algorithm>
#include "adobeenc.tab" // get encoding table for AFM metrics
@@ -90,29 +90,15 @@
#define PRINTER_METRICDIR "fontmetric"
-namespace {
-
-namespace css = com::sun::star;
-
-}
-
using namespace vcl;
using namespace utl;
using namespace psp;
using namespace osl;
+using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OStringHash;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringBuffer;
-using ::rtl::OUStringHash;
-using ::rtl::OStringToOUString;
-using ::rtl::OUStringToOString;
-
/*
* static helpers
*/
@@ -392,10 +378,10 @@ PrintFontManager::Type1FontFile::~Type1FontFile()
// -------------------------------------------------------------------------
PrintFontManager::TrueTypeFontFile::TrueTypeFontFile()
-: PrintFont( fonttype::TrueType )
-, m_nDirectory( 0 )
-, m_nCollectionEntry(-1)
-, m_nTypeFlags( TYPEFLAG_INVALID )
+: PrintFont( fonttype::TrueType )
+, m_nDirectory( 0 )
+, m_nCollectionEntry(-1)
+, m_nTypeFlags( TYPEFLAG_INVALID )
{}
// -------------------------------------------------------------------------
@@ -501,8 +487,8 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
if( pImplTTFont->nkern && pImplTTFont->kerntype == KT_MICROSOFT )
{
// create a glyph -> character mapping
- ::boost::unordered_map< sal_uInt16, sal_Unicode > aGlyphMap;
- ::boost::unordered_map< sal_uInt16, sal_Unicode >::iterator left, right;
+ ::std::hash_map< sal_uInt16, sal_Unicode > aGlyphMap;
+ ::std::hash_map< sal_uInt16, sal_Unicode >::iterator left, right;
for( i = 21; i < 0xfffd; i++ )
{
sal_uInt16 nGlyph = MapChar( pTTFont, (sal_Unicode)i, 0 ); // kerning for horz only
@@ -601,21 +587,21 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
if( pImplTTFont->nkern && pImplTTFont->kerntype == KT_APPLE_NEW )
{
// create a glyph -> character mapping
- ::boost::unordered_map< sal_uInt16, sal_Unicode > aGlyphMap;
- ::boost::unordered_map< sal_uInt16, sal_Unicode >::iterator left, right;
+ ::std::hash_map< sal_uInt16, sal_Unicode > aGlyphMap;
+ ::std::hash_map< sal_uInt16, sal_Unicode >::iterator left, right;
for( i = 21; i < 0xfffd; i++ )
{
sal_uInt16 nGlyph = MapChar( pTTFont, (sal_Unicode)i, 0 ); // kerning for horz only
if( nGlyph != 0 )
aGlyphMap[ nGlyph ] = (sal_Unicode)i;
}
-
+
// Loop through each of the 'kern' subtables
KernPair aPair;
for( i = 0; (unsigned int)i < pImplTTFont->nkern; i++ )
{
const sal_uInt8* pTable = pImplTTFont->kerntables[i];
-
+
/*sal_uInt32 nLength =*/ getUInt32BE( pTable );
sal_uInt16 nCoverage = getUInt16BE( pTable );
/*sal_uInt16 nTupleIndex =*/ getUInt16BE( pTable );
@@ -627,7 +613,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
// Kerning sub-table format, 0 through 3
sal_uInt8 nSubTableFormat = nCoverage & 0x00FF;
-
+
aPair.kern_x = 0;
aPair.kern_y = 0;
switch( nSubTableFormat )
@@ -668,7 +654,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
case 0:
aPair.kern_y = (int)nKern * 1000 / pImplTTFont->unitsPerEm;
m_pMetrics->m_aYKernPairs.push_back( aPair );
- break;
+ break;
}
*/
}
@@ -704,7 +690,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
case 0:
aPair.kern_y = (int)nKern * 1000 / pImplTTFont->unitsPerEm;
m_pMetrics->m_aYKernPairs.push_back( aPair );
- break;
+ break;
}
}
}
@@ -719,7 +705,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
}
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "found %" SAL_PRI_SIZET "u/%" SAL_PRI_SIZET "u kern pairs for %s\n",
+ fprintf( stderr, "found %d/%d kern pairs for %s\n",
m_pMetrics->m_aXKernPairs.size(),
m_pMetrics->m_aYKernPairs.size(),
OUStringToOString( pProvider->getString( ATOM_FAMILYNAME, m_nFamilyName ), RTL_TEXTENCODING_MS_1252 ).getStr() );
@@ -745,7 +731,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
*/
static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyName )
{
- static boost::unordered_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 );
+ static std::hash_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 );
if( aPSNameToFamily.empty() ) // initialization
{
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow" ) ) ] =
@@ -757,7 +743,7 @@ static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyNa
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow-Oblique" ) ) ] =
OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) );
}
- boost::unordered_map<OUString,OUString,OUStringHash>::const_iterator it =
+ std::hash_map<OUString,OUString,OUStringHash>::const_iterator it =
aPSNameToFamily.find( i_rPSname );
bool bReplaced = (it != aPSNameToFamily.end() );
if( bReplaced )
@@ -769,6 +755,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
{
PrintFontManager& rManager( PrintFontManager::get() );
+ int i;
FontInfo* pInfo = NULL;
parseFile( rFileName.getStr(), &pInfo, P_ALL );
if( ! pInfo || ! pInfo->numOfChars )
@@ -801,7 +788,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
}
else
aFamily = pProvider->getString( ATOM_FAMILYNAME, m_nFamilyName );
-
+
// style name: if fullname begins with family name
// interpret the rest of fullname as style
if( ! m_aStyleName.getLength() && pInfo->gfi->fullName && *pInfo->gfi->fullName )
@@ -845,7 +832,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
if( m_aEncoding == RTL_TEXTENCODING_DONTKNOW )
m_aEncoding = nAdobeEncoding == 1 ?
- RTL_TEXTENCODING_ADOBE_STANDARD : RTL_TEXTENCODING_SYMBOL;
+ RTL_TEXTENCODING_ADOBE_STANDARD : RTL_TEXTENCODING_SYMBOL;
}
else if( m_aEncoding == RTL_TEXTENCODING_DONTKNOW )
m_aEncoding = RTL_TEXTENCODING_ADOBE_STANDARD;
@@ -940,7 +927,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
bFillEncodingvector = false; // will be filled anyway, don't do the work twice
}
}
-
+
// ascend
m_nAscend = pInfo->gfi->fontBBox.ury;
@@ -977,13 +964,12 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
if( bFillEncodingvector || !bOnlyGlobalAttributes )
{
// fill in character metrics
-
+
// first transform the character codes to unicode
// note: this only works with single byte encodings
sal_Unicode* pUnicodes = (sal_Unicode*)alloca( pInfo->numOfChars * sizeof(sal_Unicode));
CharMetricInfo* pChar = pInfo->cmi;
- int i;
-
+
for( i = 0; i < pInfo->numOfChars; i++, pChar++ )
{
if( nAdobeEncoding == 4 )
@@ -1014,13 +1000,13 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
m_aEncodingVector[ pUnicodes[i] ] = pChar->code;
continue;
}
-
+
if( m_aEncoding == RTL_TEXTENCODING_UNICODE )
{
pUnicodes[i] = (sal_Unicode)pChar->code;
continue;
}
-
+
ByteString aTranslate;
if( pChar->code & 0xff000000 )
aTranslate += (char)(pChar->code >> 24 );
@@ -1035,7 +1021,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
else
pUnicodes[i] = 0;
}
-
+
// now fill in the character metrics
// parseAFM.cxx effectively only supports direction 0 (horizontal)
pChar = pInfo->cmi;
@@ -1044,7 +1030,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
{
if( pChar->code == -1 && ! pChar->name )
continue;
-
+
if( bFillEncodingvector && pChar->name )
{
std::list< sal_Unicode > aCodes = rManager.getUnicodeFromAdobeName( pChar->name );
@@ -1058,13 +1044,13 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
}
}
}
-
+
aMetric.width = pChar->wx ? pChar->wx : pChar->charBBox.urx;
aMetric.height = pChar->wy ? pChar->wy : pChar->charBBox.ury - pChar->charBBox.lly;
if( aMetric.width == 0 && aMetric.height == 0 )
// guess something for e.g. space
aMetric.width = m_aGlobalMetricX.width/4;
-
+
if( ( nAdobeEncoding == 0 ) ||
( ( nAdobeEncoding == 3 ) && ( m_aEncoding != RTL_TEXTENCODING_SYMBOL ) ) )
{
@@ -1097,8 +1083,8 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
}
else if( pChar->code != -1 )
{
- ::std::pair< ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator,
- ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator >
+ ::std::pair< ::std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator,
+ ::std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator >
aCodes = rManager.getUnicodeFromAdobeCode( pChar->code );
while( aCodes.first != aCodes.second )
{
@@ -1124,10 +1110,10 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
}
}
}
-
+
m_pMetrics->m_aXKernPairs.clear();
m_pMetrics->m_aYKernPairs.clear();
-
+
// now fill in the kern pairs
// parseAFM.cxx effectively only supports direction 0 (horizontal)
PairKernData* pKern = pInfo->pkd;
@@ -1137,7 +1123,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
// #i37703# broken kern table
if( ! pKern->name1 || ! pKern->name2 )
continue;
-
+
aPair.first = 0;
aPair.second = 0;
// currently we have to find the adobe character names
@@ -1181,14 +1167,13 @@ OString PrintFontManager::s_aEmptyOString;
*/
PrintFontManager& PrintFontManager::get()
{
- static PrintFontManager* pManager = NULL;
- if( ! pManager )
+ static PrintFontManager* theManager = NULL;
+ if( ! theManager )
{
- static PrintFontManager theManager;
- pManager = &theManager;
- pManager->initialize();
+ theManager = new PrintFontManager();
+ theManager->initialize();
}
- return *pManager;
+ return *theManager;
}
// -------------------------------------------------------------------------
@@ -1206,12 +1191,12 @@ PrintFontManager::PrintFontManager() :
{
for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAdobeCodes ); i++ )
{
- m_aUnicodeToAdobename.insert( ::boost::unordered_multimap< sal_Unicode, ::rtl::OString >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].pAdobename ) );
- m_aAdobenameToUnicode.insert( ::boost::unordered_multimap< ::rtl::OString, sal_Unicode, ::rtl::OStringHash >::value_type( aAdobeCodes[i].pAdobename, aAdobeCodes[i].aUnicode ) );
+ m_aUnicodeToAdobename.insert( ::std::hash_multimap< sal_Unicode, ::rtl::OString >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].pAdobename ) );
+ m_aAdobenameToUnicode.insert( ::std::hash_multimap< ::rtl::OString, sal_Unicode, ::rtl::OStringHash >::value_type( aAdobeCodes[i].pAdobename, aAdobeCodes[i].aUnicode ) );
if( aAdobeCodes[i].aAdobeStandardCode )
{
- m_aUnicodeToAdobecode.insert( ::boost::unordered_multimap< sal_Unicode, sal_uInt8 >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].aAdobeStandardCode ) );
- m_aAdobecodeToUnicode.insert( ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::value_type( aAdobeCodes[i].aAdobeStandardCode, aAdobeCodes[i].aUnicode ) );
+ m_aUnicodeToAdobecode.insert( ::std::hash_multimap< sal_Unicode, sal_uInt8 >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].aAdobeStandardCode ) );
+ m_aAdobecodeToUnicode.insert( ::std::hash_multimap< sal_uInt8, sal_Unicode >::value_type( aAdobeCodes[i].aAdobeStandardCode, aAdobeCodes[i].aUnicode ) );
}
}
}
@@ -1221,7 +1206,7 @@ PrintFontManager::PrintFontManager() :
PrintFontManager::~PrintFontManager()
{
deinitFontconfig();
- for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
+ for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
delete (*it).second;
delete m_pAtoms;
if( m_pFontCache )
@@ -1232,7 +1217,7 @@ PrintFontManager::~PrintFontManager()
const OString& PrintFontManager::getDirectory( int nAtom ) const
{
- ::boost::unordered_map< int, OString >::const_iterator it( m_aAtomToDir.find( nAtom ) );
+ ::std::hash_map< int, OString >::const_iterator it( m_aAtomToDir.find( nAtom ) );
return it != m_aAtomToDir.end() ? it->second : s_aEmptyOString;
}
@@ -1241,7 +1226,7 @@ const OString& PrintFontManager::getDirectory( int nAtom ) const
int PrintFontManager::getDirectoryAtom( const OString& rDirectory, bool bCreate )
{
int nAtom = 0;
- ::boost::unordered_map< OString, int, OStringHash >::const_iterator it
+ ::std::hash_map< OString, int, OStringHash >::const_iterator it
( m_aDirToAtom.find( rDirectory ) );
if( it != m_aDirToAtom.end() )
nAtom = it->second;
@@ -1304,13 +1289,13 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
// check for corresponding afm metric
// first look for an adjacent file
static const char* pSuffix[] = { ".afm", ".AFM" };
-
+
for( unsigned int i = 0; i < SAL_N_ELEMENTS(pSuffix); i++ )
{
ByteString aName( rFontFile );
aName.Erase( aName.Len()-4 );
aName.Append( pSuffix[i] );
-
+
ByteString aFilePath( aDir );
aFilePath.Append( '/' );
aFilePath.Append( aName );
@@ -1322,7 +1307,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
aFilePath = aDir;
aFilePath.Append( "/afm/" );
aFilePath.Append( aName );
-
+
if( ! access( aFilePath.GetBuffer(), R_OK ) )
{
aAfmFile = "afm/";
@@ -1336,10 +1321,10 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
{
Type1FontFile* pFont = new Type1FontFile();
pFont->m_nDirectory = nDirID;
-
+
pFont->m_aFontFile = rFontFile;
pFont->m_aMetricFile = aAfmFile;
-
+
if( ! pFont->readAfmMetrics( getAfmFile( pFont ), m_pAtoms, false, true ) )
{
delete pFont;
@@ -1359,8 +1344,8 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
aFilePath.Append( '/' );
aFilePath.Append( ByteString( rFontFile ) );
BuiltinFont* pFont = new BuiltinFont();
- pFont->m_nDirectory = nDirID;
- pFont->m_aMetricFile = rFontFile;
+ pFont->m_nDirectory = nDirID;
+ pFont->m_aMetricFile = rFontFile;
if( pFont->readAfmMetrics( aFilePath, m_pAtoms, false, true ) )
rNewFonts.push_back( pFont );
else
@@ -1425,7 +1410,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
fontID PrintFontManager::findFontBuiltinID( int nPSNameAtom ) const
{
fontID nID = 0;
- ::boost::unordered_map< fontID, PrintFont* >::const_iterator it;
+ ::std::hash_map< fontID, PrintFont* >::const_iterator it;
for( it = m_aFonts.begin(); nID == 0 && it != m_aFonts.end(); ++it )
{
if( it->second->m_eType == fonttype::Builtin &&
@@ -1441,12 +1426,12 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile )
{
fontID nID = 0;
- ::boost::unordered_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile );
+ ::std::hash_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile );
if( set_it != m_aFontFileToFontID.end() )
{
for( ::std::set< fontID >::const_iterator font_it = set_it->second.begin(); font_it != set_it->second.end() && ! nID; ++font_it )
{
- ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it );
+ ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it );
if( it != m_aFonts.end() )
{
switch( it->second->m_eType )
@@ -1486,23 +1471,23 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile )
bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
{
sal_Int32 nIndex = 0;
- OString aFoundry = WhitespaceToSpace( rXLFD.getToken( 1, '-', nIndex ) );
+ OString aFoundry = WhitespaceToSpace( rXLFD.getToken( 1, '-', nIndex ) );
if( nIndex < 0 ) return false;
- OString aFamilyXLFD = WhitespaceToSpace( rXLFD.getToken( 0, '-', nIndex ) );
+ OString aFamilyXLFD = WhitespaceToSpace( rXLFD.getToken( 0, '-', nIndex ) );
if( nIndex < 0 ) return false;
- OString aWeight = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
+ OString aWeight = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
if( nIndex < 0 ) return false;
- OString aSlant = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
+ OString aSlant = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
if( nIndex < 0 ) return false;
- OString aWidth = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
+ OString aWidth = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
if( nIndex < 0 ) return false;
- OString aAddStyle = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
+ OString aAddStyle = rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase();
if( nIndex < 0 ) return false;
- OString aPitch = rXLFD.getToken( 4, '-', nIndex ).toAsciiLowerCase();
+ OString aPitch = rXLFD.getToken( 4, '-', nIndex ).toAsciiLowerCase();
if( nIndex < 0 ) return false;
- OString aRegEnc = WhitespaceToSpace( rXLFD.getToken( 1, '-', nIndex ).toAsciiLowerCase() );
+ OString aRegEnc = WhitespaceToSpace( rXLFD.getToken( 1, '-', nIndex ).toAsciiLowerCase() );
if( nIndex < 0 ) return false;
- OString aEnc = WhitespaceToSpace( rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase() );
+ OString aEnc = WhitespaceToSpace( rXLFD.getToken( 0, '-', nIndex ).toAsciiLowerCase() );
// capitalize words
sal_Int32 nFamIndex = 0;
@@ -1521,22 +1506,22 @@ bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
aFamilyName.append( aNewToken.makeStringAndClear() );
}
- rEntry.aFoundry = aFoundry;
- rEntry.aFamily = aFamilyName.makeStringAndClear();
- rEntry.aAddStyle = aAddStyle;
+ rEntry.aFoundry = aFoundry;
+ rEntry.aFamily = aFamilyName.makeStringAndClear();
+ rEntry.aAddStyle = aAddStyle;
// evaluate weight
rEntry.eWeight = parseWeight( aWeight );
// evaluate slant
rEntry.eItalic = parseItalic( aSlant );
// evaluate width
rEntry.eWidth = parseWidth( aWidth );
-
+
// evaluate pitch
if( aPitch.toChar() == 'c' || aPitch.toChar() == 'm' )
rEntry.ePitch = pitch::Fixed;
else
rEntry.ePitch = pitch::Variable;
-
+
OString aToken = aEnc.toAsciiLowerCase();
// get encoding
if( aAddStyle.indexOf( "symbol" ) != -1 )
@@ -1554,17 +1539,17 @@ bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
rEntry.aEncoding = rtl_getTextEncodingFromUnixCharset( aCharset.getStr() );
}
}
-
+
// set correct mask flags
rEntry.nMask = 0;
- if( rEntry.aFoundry != "*" ) rEntry.nMask |= XLFDEntry::MaskFoundry;
- if( rEntry.aFamily != "*" ) rEntry.nMask |= XLFDEntry::MaskFamily;
- if( rEntry.aAddStyle != "*" ) rEntry.nMask |= XLFDEntry::MaskAddStyle;
- if( aWeight != "*" ) rEntry.nMask |= XLFDEntry::MaskWeight;
- if( aSlant != "*" ) rEntry.nMask |= XLFDEntry::MaskItalic;
- if( aWidth != "*" ) rEntry.nMask |= XLFDEntry::MaskWidth;
- if( aPitch != "*" ) rEntry.nMask |= XLFDEntry::MaskPitch;
- if( aRegEnc != "*" && aEnc != "*" ) rEntry.nMask |= XLFDEntry::MaskEncoding;
+ if( rEntry.aFoundry != "*" ) rEntry.nMask |= XLFDEntry::MaskFoundry;
+ if( rEntry.aFamily != "*" ) rEntry.nMask |= XLFDEntry::MaskFamily;
+ if( rEntry.aAddStyle != "*" ) rEntry.nMask |= XLFDEntry::MaskAddStyle;
+ if( aWeight != "*" ) rEntry.nMask |= XLFDEntry::MaskWeight;
+ if( aSlant != "*" ) rEntry.nMask |= XLFDEntry::MaskItalic;
+ if( aWidth != "*" ) rEntry.nMask |= XLFDEntry::MaskWidth;
+ if( aPitch != "*" ) rEntry.nMask |= XLFDEntry::MaskPitch;
+ if( aRegEnc != "*" && aEnc != "*" ) rEntry.nMask |= XLFDEntry::MaskEncoding;
return true;
}
@@ -1597,12 +1582,12 @@ void PrintFontManager::getFontAttributesFromXLFD( PrintFont* pFont, const std::l
std::list< XLFDEntry > aXLFDs;
parseXLFD_appendAliases( rXLFDs, aXLFDs );
-
+
for( std::list< XLFDEntry >::const_iterator it = aXLFDs.begin();
it != aXLFDs.end(); ++it )
{
// set family name or alias
- int nFam =
+ int nFam =
m_pAtoms->getAtom( ATOM_FAMILYNAME,
OStringToOUString( it->aFamily, it->aAddStyle.indexOf( "utf8" ) != -1 ? RTL_TEXTENCODING_UTF8 : RTL_TEXTENCODING_ISO_8859_1 ),
sal_True );
@@ -1632,7 +1617,7 @@ void PrintFontManager::getFontAttributesFromXLFD( PrintFont* pFont, const std::l
;
if( al_it == pFont->m_aAliases.end() )
pFont->m_aAliases.push_back( nFam );
-
+
}
// for the rest of the attributes there can only be one value;
// we'll trust the first one
@@ -1640,15 +1625,15 @@ void PrintFontManager::getFontAttributesFromXLFD( PrintFont* pFont, const std::l
}
// fill in weight
- pFont->m_eWeight = it->eWeight;
+ pFont->m_eWeight = it->eWeight;
// fill in slant
- pFont->m_eItalic = it->eItalic;
+ pFont->m_eItalic = it->eItalic;
// fill in width
- pFont->m_eWidth = it->eWidth;
+ pFont->m_eWidth = it->eWidth;
// fill in pitch
- pFont->m_ePitch = it->ePitch;
+ pFont->m_ePitch = it->ePitch;
// fill in encoding
- pFont->m_aEncoding = it->aEncoding;
+ pFont->m_aEncoding = it->aEncoding;
}
// handle iso8859-1 as ms1252 to fill the "gap" starting at 0x80
@@ -1808,29 +1793,6 @@ OUString PrintFontManager::convertTrueTypeName( void* pRecord ) const
return aValue;
}
-//fdo#33349.There exists an archaic Berling Antiqua font which has a "Times New
-//Roman" name field in it. We don't want the "Times New Roman" name to take
-//precedence in this case. We take Berling Antiqua as a higher priority name,
-//and erase the "Times New Roman" name
-namespace
-{
- bool isBadTNR(const OUString &rName, ::std::set< OUString >& rSet)
- {
- bool bRet = false;
- if (rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Berling Antiqua")))
- {
- ::std::set< OUString >::iterator aEnd = rSet.end();
- ::std::set< OUString >::iterator aI = rSet.find(OUString(RTL_CONSTASCII_USTRINGPARAM("Times New Roman")));
- if (aI != aEnd)
- {
- bRet = true;
- rSet.erase(aI);
- }
- }
- return bRet;
- }
-}
-
// -------------------------------------------------------------------------
void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OUString >& rNames ) const
@@ -1868,7 +1830,7 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
}
OUString aName = convertTrueTypeName( pNameRecords + i );
aSet.insert( aName );
- if( nMatch > nLastMatch || isBadTNR(aName, aSet) )
+ if( nMatch > nLastMatch )
{
nLastMatch = nMatch;
aFamily = aName;
@@ -2062,18 +2024,18 @@ void PrintFontManager::initFontsAlias()
aStream.ReadLine( aLine );
// get the alias and the pattern it gets translated to
- ByteString aAlias = GetCommandLineToken( 0, aLine );
- ByteString aMap = GetCommandLineToken( 1, aLine );
-
+ ByteString aAlias = GetCommandLineToken( 0, aLine );
+ ByteString aMap = GetCommandLineToken( 1, aLine );
+
// remove eventual quotes
aAlias.EraseLeadingChars( '"' );
aAlias.EraseTrailingChars( '"' );
aMap.EraseLeadingChars( '"' );
aMap.EraseTrailingChars( '"' );
-
+
XLFDEntry aAliasEntry, aMapEntry;
parseXLFD( aAlias, aAliasEntry );
- parseXLFD( aMap, aMapEntry );
+ parseXLFD( aMap, aMapEntry );
if( aAliasEntry.nMask && aMapEntry.nMask )
m_aXLFD_Aliases[ aMapEntry ].push_back( aAliasEntry );
@@ -2097,7 +2059,7 @@ static bool AreFCSubstitutionsEnabled()
{
//
if( (*pEnvStr >= '0') && (*pEnvStr <= '9') )
- nDisableBits = (*pEnvStr - '0');
+ nDisableBits = (*pEnvStr - '0');
else
nDisableBits = ~0U; // no specific bits set: disable all
}
@@ -2111,7 +2073,7 @@ void PrintFontManager::initialize()
CALLGRIND_TOGGLE_COLLECT();
CALLGRIND_ZERO_STATS();
#endif
-
+
long aDirEntBuffer[ (sizeof(struct dirent)+_PC_NAME_MAX)+1 ];
if( ! m_pFontCache )
@@ -2131,7 +2093,7 @@ void PrintFontManager::initialize()
// initialize may be called twice in the future
{
- for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
+ for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
delete (*it).second;
m_nNextFontID = 1;
m_aFonts.clear();
@@ -2147,7 +2109,7 @@ void PrintFontManager::initialize()
clock_t aStep3;
int nBuiltinFonts = 0;
int nCached = 0;
-
+
struct tms tms;
aStart = times( &tms );
@@ -2173,7 +2135,7 @@ void PrintFontManager::initialize()
normPath( aToken );
// if registering an app-specific fontdir with fontconfig fails
// and fontconfig-based substitutions are enabled
- // then trying to use these app-specific fonts doesn't make sense
+ // then trying to use these app-specific fonts doesn't make sense
if( m_bFontconfigSuccess && !addFontconfigDir( aToken ) )
if( bAreFCSubstitutionsEnabled )
continue;
@@ -2183,7 +2145,7 @@ void PrintFontManager::initialize()
}
// protect against duplicate paths
- boost::unordered_map< OString, int, OStringHash > visited_dirs;
+ std::hash_map< OString, int, OStringHash > visited_dirs;
// now that all global and local font dirs are known to fontconfig
// check that there are fonts actually managed by fontconfig
@@ -2249,7 +2211,7 @@ void PrintFontManager::initialize()
if( pDIR )
{
// read fonts.dir if possible
- ::boost::unordered_map< OString, ::std::list<OString>, OStringHash > aFontsDir;
+ ::std::hash_map< OString, ::std::list<OString>, OStringHash > aFontsDir;
int nDirID = getDirectoryAtom( aPath, true );
// #i38367# no fonts.dir in our own directories anymore
std::list< int >::const_iterator priv_dir;
@@ -2257,7 +2219,7 @@ void PrintFontManager::initialize()
priv_dir != m_aPrivateFontDirectories.end() && *priv_dir != nDirID;
++priv_dir )
;
-
+
if( priv_dir == m_aPrivateFontDirectories.end() )
{
ByteString aGccDummy( aPath );
@@ -2277,7 +2239,7 @@ void PrintFontManager::initialize()
}
}
}
-
+
int nDirFonts = 0;
while( ! readdir_r( pDIR, (struct dirent*)aDirEntBuffer, &pEntry ) && pEntry )
{
@@ -2297,7 +2259,7 @@ void PrintFontManager::initialize()
if( findFontFileID( nDirID, aFileName ) == 0 )
{
::std::list<OString> aXLFDs;
- ::boost::unordered_map< OString, ::std::list<OString>, OStringHash >::const_iterator it =
+ ::std::hash_map< OString, ::std::list<OString>, OStringHash >::const_iterator it =
aFontsDir.find( aFileName );
if( it != aFontsDir.end() )
aXLFDs = (*it).second;
@@ -2346,7 +2308,7 @@ void PrintFontManager::initialize()
// ask the font cache whether it handles this directory
std::list< PrintFont* > aCacheFonts;
-
+
if( m_pFontCache->listDirectory( aDir, aCacheFonts ) )
{
#if OSL_DEBUG_LEVEL > 1
@@ -2428,10 +2390,10 @@ void PrintFontManager::initialize()
#endif
// part three - fill in family styles
- ::boost::unordered_map< fontID, PrintFont* >::iterator font_it;
+ ::std::hash_map< fontID, PrintFont* >::iterator font_it;
for (font_it = m_aFonts.begin(); font_it != m_aFonts.end(); ++font_it)
{
- ::boost::unordered_map< int, family::type >::const_iterator it =
+ ::std::hash_map< int, family::type >::const_iterator it =
m_aFamilyTypes.find( font_it->second->m_nFamilyName );
if (it != m_aFamilyTypes.end())
continue;
@@ -2443,7 +2405,7 @@ void PrintFontManager::initialize()
#if OSL_DEBUG_LEVEL > 1
aStep3 = times( &tms );
- fprintf( stderr, "PrintFontManager::initialize: collected %" SAL_PRI_SIZET "u fonts (%d builtin, %d cached)\n", m_aFonts.size(), nBuiltinFonts, nCached );
+ fprintf( stderr, "PrintFontManager::initialize: collected %d fonts (%d builtin, %d cached)\n", m_aFonts.size(), nBuiltinFonts, nCached );
double fTick = (double)sysconf( _SC_CLK_TCK );
fprintf( stderr, "Step 1 took %lf seconds\n", (double)(aStep1 - aStart)/fTick );
fprintf( stderr, "Step 2 took %lf seconds\n", (double)(aStep2 - aStep1)/fTick );
@@ -2451,7 +2413,7 @@ void PrintFontManager::initialize()
#endif
m_pFontCache->flush();
-
+
#ifdef CALLGRIND_COMPILE
CALLGRIND_DUMP_STATS();
CALLGRIND_TOGGLE_COLLECT();
@@ -2494,7 +2456,7 @@ namespace {
weight::type eWeight;
pitch::type ePitch;
rtl_TextEncoding aEncoding;
-
+
BuiltinFontIdentifier( const OUString& rFam,
italic::type eIt,
weight::type eWg,
@@ -2506,7 +2468,7 @@ namespace {
ePitch( ePt ),
aEncoding( enc )
{}
-
+
bool operator==( const BuiltinFontIdentifier& rRight ) const
{
return equalItalic( eItalic, rRight.eItalic ) &&
@@ -2516,7 +2478,7 @@ namespace {
aFamily.equalsIgnoreAsciiCase( rRight.aFamily );
}
};
-
+
struct BuiltinFontIdentifierHash
{
size_t operator()( const BuiltinFontIdentifier& rFont ) const
@@ -2529,8 +2491,8 @@ namespace {
void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDParser* pParser, bool bUseOverrideMetrics )
{
rFontIDs.clear();
- boost::unordered_map< fontID, PrintFont* >::const_iterator it;
-
+ std::hash_map< fontID, PrintFont* >::const_iterator it;
+
/*
* Note: there are two easy steps making this faster:
* first: insert the printer builtins first, then the not builtins,
@@ -2546,12 +2508,12 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa
* Until getFontList for a printer becomes a performance issue (which is
* currently not the case), best stay with the current algorithm.
*/
-
+
// fill sets of printer supported fonts
if( pParser )
{
std::set<int> aBuiltinPSNames;
- boost::unordered_set< BuiltinFontIdentifier,
+ std::hash_set< BuiltinFontIdentifier,
BuiltinFontIdentifierHash
> aBuiltinFonts;
@@ -2562,13 +2524,13 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa
for( std::vector<fontID>::const_iterator over = m_aOverrideFonts.begin();
over != m_aOverrideFonts.end(); ++over )
{
- boost::unordered_map<fontID,PrintFont*>::const_iterator font_it = m_aFonts.find( *over );
+ std::hash_map<fontID,PrintFont*>::const_iterator font_it = m_aFonts.find( *over );
DBG_ASSERT( font_it != m_aFonts.end(), "override to nonexistant font" );
if( font_it != m_aFonts.end() )
aOverridePSNames[ font_it->second->m_nPSName ] = *over;
}
}
-
+
int nFonts = pParser->getFonts();
for( int i = 0; i < nFonts; i++ )
aBuiltinPSNames.insert( m_pAtoms->getAtom( ATOM_PSNAME, pParser->getFont( i ) ) );
@@ -2652,7 +2614,7 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa
void PrintFontManager::fillPrintFontInfo( PrintFont* pFont, FastPrintFontInfo& rInfo ) const
{
- ::boost::unordered_map< int, family::type >::const_iterator style_it =
+ ::std::hash_map< int, family::type >::const_iterator style_it =
m_aFamilyTypes.find( pFont->m_nFamilyName );
rInfo.m_eType = pFont->m_eType;
rInfo.m_aFamilyName = m_pAtoms->getString( ATOM_FAMILYNAME, pFont->m_nFamilyName );
@@ -2869,7 +2831,7 @@ family::type PrintFontManager::getFontFamilyType( fontID nFontID ) const
if( !pFont )
return family::Unknown;
- ::boost::unordered_map< int, family::type >::const_iterator it =
+ ::std::hash_map< int, family::type >::const_iterator it =
m_aFamilyTypes.find( pFont->m_nFamilyName );
return (it != m_aFamilyTypes.end()) ? it->second : family::Unknown;
}
@@ -2923,7 +2885,7 @@ OString PrintFontManager::getFontFile( PrintFont* pFont ) const
if( pFont && pFont->m_eType == fonttype::Type1 )
{
Type1FontFile* pPSFont = static_cast< Type1FontFile* >(pFont);
- ::boost::unordered_map< int, OString >::const_iterator it = m_aAtomToDir.find( pPSFont->m_nDirectory );
+ ::std::hash_map< int, OString >::const_iterator it = m_aAtomToDir.find( pPSFont->m_nDirectory );
aPath = it->second;
aPath += "/";
aPath += pPSFont->m_aFontFile;
@@ -2931,7 +2893,7 @@ OString PrintFontManager::getFontFile( PrintFont* pFont ) const
else if( pFont && pFont->m_eType == fonttype::TrueType )
{
TrueTypeFontFile* pTTFont = static_cast< TrueTypeFontFile* >(pFont);
- ::boost::unordered_map< int, OString >::const_iterator it = m_aAtomToDir.find( pTTFont->m_nDirectory );
+ ::std::hash_map< int, OString >::const_iterator it = m_aAtomToDir.find( pTTFont->m_nDirectory );
aPath = it->second;
aPath += "/";
aPath += pTTFont->m_aFontFile;
@@ -3045,7 +3007,7 @@ void PrintFontManager::hasVerticalSubstitutions( fontID nFontID,
if( ! pFont->m_pMetrics ||
! ( pFont->m_pMetrics->m_aPages[ code >> 11 ] & ( 1 << ( ( code >> 8 ) & 7 ) ) ) )
pFont->queryMetricPage( code >> 8, m_pAtoms );
- ::boost::unordered_map< sal_Unicode, bool >::const_iterator it = pFont->m_pMetrics->m_bVerticalSubstitutions.find( code );
+ ::std::hash_map< sal_Unicode, bool >::const_iterator it = pFont->m_pMetrics->m_bVerticalSubstitutions.find( code );
pHasSubst[i] = it != pFont->m_pMetrics->m_bVerticalSubstitutions.end();
}
}
@@ -3150,7 +3112,7 @@ bool PrintFontManager::getMetrics( fontID nFontID, const sal_Unicode* pString, i
{
int effectiveCode = pString[i];
effectiveCode |= bVertical ? 1 << 16 : 0;
- ::boost::unordered_map< int, CharacterMetric >::const_iterator it =
+ ::std::hash_map< int, CharacterMetric >::const_iterator it =
pFont->m_pMetrics->m_aMetrics.find( effectiveCode );
// if no vertical metrics are available assume rotated horizontal metrics
if( bVertical && (it == pFont->m_pMetrics->m_aMetrics.end()) )
@@ -3195,7 +3157,7 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal
{
int effectiveCode = code;
effectiveCode |= bVertical ? 1 << 16 : 0;
- ::boost::unordered_map< int, CharacterMetric >::const_iterator it =
+ ::std::hash_map< int, CharacterMetric >::const_iterator it =
pFont->m_pMetrics->m_aMetrics.find( effectiveCode );
// if no vertical metrics are available assume rotated horizontal metrics
if( bVertical && (it == pFont->m_pMetrics->m_aMetrics.end()) )
@@ -3205,7 +3167,7 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal
pArray[ code - minCharacter ] = it->second;
}
} while( code++ != maxCharacter );
-
+
return true;
}
@@ -3312,9 +3274,9 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL
OUString aFromPath, aToPath;
if( bLinkOnly )
{
- ByteString aLinkFromPath( String(aFromAfm.PathToFileName()),
+ ByteString aLinkFromPath( String(aFromAfm.PathToFileName()),
aEncoding );
- ByteString aLinkToPath( String(aToAfm.PathToFileName()),
+ ByteString aLinkToPath( String(aToAfm.PathToFileName()),
aEncoding );
nError = (FileBase::RC)symlink( aLinkFromPath.GetBuffer(), aLinkToPath.GetBuffer() );
}
@@ -3330,10 +3292,10 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL
}
if( bLinkOnly )
{
- ByteString aFromPath( String(aFrom.PathToFileName()),
+ ByteString aFromPath( String(aFrom.PathToFileName()),
aEncoding );
ByteString aToPath( String(aTo.PathToFileName()), aEncoding );
- nError = (FileBase::RC)symlink( aFromPath.GetBuffer(),
+ nError = (FileBase::RC)symlink( aFromPath.GetBuffer(),
aToPath.GetBuffer() );
}
else
@@ -3354,7 +3316,7 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL
{
// remove all fonts for the same file
// discarding their font ids
- ::boost::unordered_map< fontID, PrintFont* >::iterator current, next;
+ ::std::hash_map< fontID, PrintFont* >::iterator current, next;
current = m_aFonts.begin();
OString aFileName( OUStringToOString( aTo.GetName(), aEncoding ) );
while( current != m_aFonts.end() )
@@ -3459,7 +3421,7 @@ bool PrintFontManager::changeFontProperties( fontID nFontID, const ::rtl::OUStri
getFontAttributesFromXLFD( pFont, aDummyList );
pFont->m_bUserOverride = true;
m_pFontCache->updateFontCacheEntry( pFont, true );
-
+
return true;
}
@@ -3510,7 +3472,7 @@ bool PrintFontManager::getFileDuplicates( fontID nFont, ::std::list< fontID >& r
if( ! aFile.getLength() )
return false;
- for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
+ for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
{
if( nFont != it->first )
{
@@ -3533,7 +3495,7 @@ bool PrintFontManager::removeFonts( const ::std::list< fontID >& rFonts )
::std::list< fontID > aDuplicates;
for( ::std::list< fontID >::const_iterator it = rFonts.begin(); it != rFonts.end(); ++it )
{
- ::boost::unordered_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it );
+ ::std::hash_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it );
if( haveFont == m_aFonts.end() )
continue;
@@ -3761,8 +3723,8 @@ bool PrintFontManager::createFontSubset(
int xMin, yMin, xMax, yMax;
getFontBoundingBox( nFont, xMin, yMin, xMax, yMax );
- rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
- rInfo.m_nCapHeight = yMax; // Well ...
+ rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
+ rInfo.m_nCapHeight = yMax; // Well ...
// fill in glyph advance widths
TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics( pTTFont,
@@ -3869,7 +3831,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
rUnicodeEnc.clear();
rWidths.clear();
rWidths.reserve( pFont->m_pMetrics->m_aMetrics.size() );
- for( boost::unordered_map< int, CharacterMetric >::const_iterator it =
+ for( std::hash_map< int, CharacterMetric >::const_iterator it =
pFont->m_pMetrics->m_aMetrics.begin();
it != pFont->m_pMetrics->m_aMetrics.end(); ++it )
{
@@ -3906,8 +3868,8 @@ const std::map< sal_Unicode, sal_Int32 >* PrintFontManager::getEncodingMap( font
std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aChar ) const
{
- std::pair< boost::unordered_multimap< sal_Unicode, rtl::OString >::const_iterator,
- boost::unordered_multimap< sal_Unicode, rtl::OString >::const_iterator > range
+ std::pair< std::hash_multimap< sal_Unicode, rtl::OString >::const_iterator,
+ std::hash_multimap< sal_Unicode, rtl::OString >::const_iterator > range
= m_aUnicodeToAdobename.equal_range( aChar );
std::list< OString > aRet;
@@ -3927,8 +3889,8 @@ std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aCha
// -------------------------------------------------------------------------
std::list< sal_Unicode > PrintFontManager::getUnicodeFromAdobeName( const rtl::OString& rName ) const
{
- std::pair< boost::unordered_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator,
- boost::unordered_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator > range
+ std::pair< std::hash_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator,
+ std::hash_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator > range
= m_aAdobenameToUnicode.equal_range( rName );
std::list< sal_Unicode > aRet;
@@ -3974,15 +3936,15 @@ bool PrintFontManager::readOverrideMetrics()
if( ! m_aOverrideFonts.empty() )
return false;
- css::uno::Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
+ Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
if( !xFact.is() )
return false;
- css::uno::Reference< XMaterialHolder > xMat(
+ Reference< XMaterialHolder > xMat(
xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ),
UNO_QUERY );
if( !xMat.is() )
return false;
-
+
Any aAny( xMat->getMaterial() );
Sequence< Any > aOverrideFonts;
if( ! (aAny >>= aOverrideFonts ) )
@@ -4003,53 +3965,53 @@ bool PrintFontManager::readOverrideMetrics()
const NamedValue* pProps = aMetrics.getConstArray();
for( sal_Int32 n = 0; n < nProps; n++ )
{
- if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FamilyName" ) ) )
+ if( pProps[n].Name.equalsAscii( "FamilyName" ) )
pFont->m_nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME,
getString(pProps[n].Value),
sal_True );
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PSName" ) ) )
+ else if( pProps[n].Name.equalsAscii( "PSName" ) )
pFont->m_nPSName = m_pAtoms->getAtom( ATOM_PSNAME,
getString(pProps[n].Value),
sal_True );
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StyleName" ) ) )
+ else if( pProps[n].Name.equalsAscii( "StyleName" ) )
pFont->m_aStyleName = getString(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Italic" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Italic" ) )
pFont->m_eItalic = static_cast<italic::type>(getInt(pProps[n].Value));
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Width" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Width" ) )
pFont->m_eWidth = static_cast<width::type>(getInt(pProps[n].Value));
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Weight" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Weight" ) )
pFont->m_eWeight = static_cast<weight::type>(getInt(pProps[n].Value));
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Pitch" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Pitch" ) )
pFont->m_ePitch = static_cast<pitch::type>(getInt(pProps[n].Value));
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encoding" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Encoding" ) )
pFont->m_aEncoding = static_cast<rtl_TextEncoding>(getInt(pProps[n].Value));
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FontEncodingOnly" ) ) )
+ else if( pProps[n].Name.equalsAscii( "FontEncodingOnly" ) )
pFont->m_bFontEncodingOnly = getBool(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GlobalMetricXWidth" ) ) )
+ else if( pProps[n].Name.equalsAscii( "GlobalMetricXWidth" ) )
pFont->m_aGlobalMetricX.width = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GlobalMetricXHeight" ) ) )
+ else if( pProps[n].Name.equalsAscii( "GlobalMetricXHeight" ) )
pFont->m_aGlobalMetricX.height = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GlobalMetricYWidth" ) ) )
+ else if( pProps[n].Name.equalsAscii( "GlobalMetricYWidth" ) )
pFont->m_aGlobalMetricY.width = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GlobalMetricYHeight" ) ) )
+ else if( pProps[n].Name.equalsAscii( "GlobalMetricYHeight" ) )
pFont->m_aGlobalMetricY.height = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Ascend" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Ascend" ) )
pFont->m_nAscend = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Descend" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Descend" ) )
pFont->m_nDescend = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Leading" ) ) )
+ else if( pProps[n].Name.equalsAscii( "Leading" ) )
pFont->m_nLeading = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "XMin" ) ) )
+ else if( pProps[n].Name.equalsAscii( "XMin" ) )
pFont->m_nXMin = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "YMin" ) ) )
+ else if( pProps[n].Name.equalsAscii( "YMin" ) )
pFont->m_nYMin = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "XMax" ) ) )
+ else if( pProps[n].Name.equalsAscii( "XMax" ) )
pFont->m_nXMax = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "YMax" ) ) )
+ else if( pProps[n].Name.equalsAscii( "YMax" ) )
pFont->m_nYMax = getInt(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VerticalSubstitutes" ) ) )
+ else if( pProps[n].Name.equalsAscii( "VerticalSubstitutes" ) )
pFont->m_bHaveVerticalSubstitutedGlyphs = getBool(pProps[n].Value);
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EncodingVector" ) ) )
+ else if( pProps[n].Name.equalsAscii( "EncodingVector" ) )
{
Sequence< NamedValue > aEncoding;
pProps[n].Value >>= aEncoding;
@@ -4062,7 +4024,7 @@ bool PrintFontManager::readOverrideMetrics()
pFont->m_aEncodingVector[ cCode ] = nGlyph;
}
}
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "NonEncoded" ) ) )
+ else if( pProps[n].Name.equalsAscii( "NonEncoded" ) )
{
Sequence< NamedValue > aEncoding;
pProps[n].Value >>= aEncoding;
@@ -4075,7 +4037,7 @@ bool PrintFontManager::readOverrideMetrics()
pFont->m_aNonEncoded[ cCode ] = OUStringToOString(aGlyphName,RTL_TEXTENCODING_ASCII_US);
}
}
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CharacterMetrics" ) ) )
+ else if( pProps[n].Name.equalsAscii( "CharacterMetrics" ) )
{
// fill pFont->m_pMetrics->m_aMetrics
// expect triples of int: int -> CharacterMetric.{ width, height }
@@ -4089,7 +4051,7 @@ bool PrintFontManager::readOverrideMetrics()
pFont->m_pMetrics->m_aMetrics[ pInts[m] ].height = static_cast<short int>(pInts[m+2]);
}
}
- else if( pProps[n].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "XKernPairs" ) ) )
+ else if( pProps[n].Name.equalsAscii( "XKernPairs" ) )
{
// fill pFont->m_pMetrics->m_aXKernPairs
// expection name: <unicode1><unicode2> value: ((height << 16)| width)
@@ -4118,7 +4080,7 @@ bool PrintFontManager::readOverrideMetrics()
! pFont->m_pMetrics->m_aMetrics.empty() )
{
m_aOverrideFonts.push_back( m_nNextFontID );
- m_aFonts[ m_nNextFontID++ ] = pFont;
+ m_aFonts[ m_nNextFontID++ ] = pFont;
}
else
{
@@ -4126,7 +4088,7 @@ bool PrintFontManager::readOverrideMetrics()
delete pFont;
}
}
-
+
return true;
}
diff --git a/vcl/unx/source/fontmanager/helper.cxx b/vcl/unx/source/fontmanager/helper.cxx
index 4b0d327a9a03..155998472bdd 100644
--- a/vcl/unx/source/fontmanager/helper.cxx
+++ b/vcl/unx/source/fontmanager/helper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,12 +42,7 @@
#include "osl/process.h"
#include "rtl/bootstrap.hxx"
-using ::rtl::Bootstrap;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OString;
-using ::rtl::OStringToOUString;
-using ::rtl::OUStringToOString;
+using namespace rtl;
namespace psp {
@@ -112,7 +107,7 @@ OUString getOfficePath( enum whichOfficePath ePath )
static OString getEnvironmentPath( const char* pKey )
{
OString aPath;
-
+
const char* pValue = getenv( pKey );
if( pValue && *pValue )
{
@@ -127,9 +122,9 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub
{
rPathList.clear();
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-
+
OUStringBuffer aPathBuffer( 256 );
-
+
// append net path
aPathBuffer.append( getOfficePath( psp::NetPath ) );
if( aPathBuffer.getLength() )
@@ -174,7 +169,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub
rPathList.push_back( OStringToOUString( aDir, aEncoding ) );
} while( nIndex != -1 );
-
+
#ifdef SYSTEM_PPD_DIR
if( pSubDir && rtl_str_compare( pSubDir, PRINTER_PPDDIR ) == 0 )
{
@@ -207,7 +202,7 @@ OUString psp::getFontPath()
if( ! aPath.getLength() )
{
OUStringBuffer aPathBuffer( 512 );
-
+
OUString aConfigPath( getOfficePath( psp::ConfigPath ) );
OUString aNetPath( getOfficePath( psp::NetPath ) );
OUString aUserPath( getOfficePath( psp::UserPath ) );
@@ -282,11 +277,11 @@ bool psp::convertPfbToPfa( ::osl::File& rInFile, ::osl::File& rOutFile )
if( buffer[0] != 0x80 ) // test for pfb m_agic number
{
// this migt be a pfa font already
+ sal_uInt64 nWrite = 0;
if( ! rInFile.read( buffer+6, 9, nRead ) && nRead == 9 &&
( ! std::strncmp( (char*)buffer, "%!FontType1-", 12 ) ||
! std::strncmp( (char*)buffer, "%!PS-AdobeFont-", 15 ) ) )
{
- sal_uInt64 nWrite = 0;
if( rOutFile.write( buffer, 15, nWrite ) || nWrite != 15 )
bSuccess = false;
while( bSuccess &&
@@ -374,7 +369,7 @@ void psp::normPath( OString& rPath )
char buf[PATH_MAX];
ByteString aPath( rPath );
-
+
// double slashes and slash at end are probably
// removed by realpath anyway, but since this runs
// on many different platforms let's play it safe
diff --git a/vcl/unx/source/fontmanager/parseAFM.cxx b/vcl/unx/source/fontmanager/parseAFM.cxx
index 242537c8e699..bc35b290875a 100644
--- a/vcl/unx/source/fontmanager/parseAFM.cxx
+++ b/vcl/unx/source/fontmanager/parseAFM.cxx
@@ -3,20 +3,20 @@
* (C) 1988, 1989, 1990 by Adobe Systems Incorporated. All rights reserved.
*
* This file may be freely copied and redistributed as long as:
- * 1) This entire notice continues to be included in the file,
+ * 1) This entire notice continues to be included in the file,
* 2) If the file has been modified in any way, a notice of such
* modification is conspicuously indicated.
*
* PostScript, Display PostScript, and Adobe are registered trademarks of
* Adobe Systems Incorporated.
- *
+ *
* ************************************************************************
* THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
* NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
- * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
- * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
- * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
- * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
+ * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
+ * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
+ * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
+ * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* ************************************************************************
*/
@@ -47,13 +47,13 @@
#include "precompiled_vcl.hxx"
/* parseAFM.c
- *
+ *
* This file is used in conjuction with the parseAFM.h header file.
* This file contains several procedures that are used to parse AFM
* files. It is intended to work with an application program that needs
* font metric information. The program can be used as is by making a
* procedure call to "parseFile" (passing in the expected parameters)
- * and having it fill in a data structure with the data from the
+ * and having it fill in a data structure with the data from the
* AFM file, or an application developer may wish to customize this
* code.
*
@@ -108,7 +108,7 @@ class FileInputStream
public:
FileInputStream( const char* pFilename );
~FileInputStream();
-
+
int getChar() { return (m_nPos < m_nLen) ? int(m_pMemory[m_nPos++]) : -1; }
void ungetChar()
{
@@ -149,18 +149,18 @@ FileInputStream::~FileInputStream()
}
/*************************** GLOBALS ***********************/
-/* "shorts" for fast case statement
+/* "shorts" for fast case statement
* The values of each of these enumerated items correspond to an entry in the
- * table of strings defined below. Therefore, if you add a new string as
+ * table of strings defined below. Therefore, if you add a new string as
* new keyword into the keyStrings table, you must also add a corresponding
* parseKey AND it MUST be in the same position!
*
* IMPORTANT: since the sorting algorithm is a binary search, the strings of
- * keywords must be placed in lexicographical order, below. [Therefore, the
- * enumerated items are not necessarily in lexicographical order, depending
- * on the name chosen. BUT, they must be placed in the same position as the
- * corresponding key string.] The NOPE shall remain in the last position,
- * since it does not correspond to any key string, and it is used in the
+ * keywords must be placed in lexicographical order, below. [Therefore, the
+ * enumerated items are not necessarily in lexicographical order, depending
+ * on the name chosen. BUT, they must be placed in the same position as the
+ * corresponding key string.] The NOPE shall remain in the last position,
+ * since it does not correspond to any key string, and it is used in the
* "recognize" procedure to calculate how many possible keys there are.
*/
@@ -180,16 +180,16 @@ enum parseKey {
NOPE
};
-/*************************** PARSING ROUTINES **************/
-
+/*************************** PARSING ROUTINES **************/
+
/*************************** token *************************/
/* A "AFM file Conventions" tokenizer. That means that it will
* return the next token delimited by white space. See also
- * the `linetoken' routine, which does a similar thing but
+ * the `linetoken' routine, which does a similar thing but
* reads all tokens until the next end-of-line.
*/
-
+
// token white space is ' ', '\n', '\r', ',', '\t', ';'
static const bool is_white_Array[ 256 ] =
{ false, false, false, false, false, false, false, false, // 0-7
@@ -200,7 +200,7 @@ static const bool is_white_Array[ 256 ] =
false, false, false, false, true, false, false, false, // 40-47
false, false, false, false, false, false, false, false, // 48-55
false, false, false, true, false, false, false, false, // 56-63
-
+
false, false, false, false, false, false, false, false, // 64 -
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
@@ -209,7 +209,7 @@ static const bool is_white_Array[ 256 ] =
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, // 127
-
+
false, false, false, false, false, false, false, false, // 128 -
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
@@ -238,7 +238,7 @@ static const bool is_delimiter_Array[ 256 ] =
false, false, false, false, false, false, false, false, // 40-47
false, false, false, false, false, false, false, false, // 48-55
false, false, true, true, false, false, false, false, // 56-63
-
+
false, false, false, false, false, false, false, false, // 64 -
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
@@ -247,7 +247,7 @@ static const bool is_delimiter_Array[ 256 ] =
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, // 127
-
+
false, false, false, false, false, false, false, false, // 128 -
false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false,
@@ -276,7 +276,7 @@ static char *token( FileInputStream* stream, int& rLen )
// relies on EOF = -1
while( is_white_Array[ (ch = stream->getChar()) & 255 ] )
;
-
+
idx = 0;
while( ch != -1 && ! is_delimiter_Array[ ch & 255 ] && idx < MAX_NAME-1 )
{
@@ -289,7 +289,7 @@ static char *token( FileInputStream* stream, int& rLen )
if (idx < 1 ) ident[idx++] = ch; /* single-character token */
ident[idx] = 0;
rLen = idx;
-
+
return(ident); /* returns pointer to the token */
} /* token */
@@ -307,15 +307,15 @@ static char *linetoken( FileInputStream* stream )
static char ident[MAX_NAME]; /* storage buffer for keywords */
int ch, idx;
- while ((ch = stream->getChar()) == ' ' || ch == '\t' ) ;
-
+ while ((ch = stream->getChar()) == ' ' || ch == '\t' ) ;
+
idx = 0;
- while (ch != -1 && ch != lineterm && ch != '\r' && idx < MAX_NAME-1 )
+ while (ch != -1 && ch != lineterm && ch != '\r' && idx < MAX_NAME-1 )
{
ident[idx++] = ch;
ch = stream->getChar();
} /* while */
-
+
stream->ungetChar();
ident[idx] = 0;
@@ -327,7 +327,7 @@ static char *linetoken( FileInputStream* stream )
/*************************** recognize *************************/
/* This function tries to match a string to a known list of
- * valid AFM entries (check the keyStrings array above).
+ * valid AFM entries (check the keyStrings array above).
* "ident" contains everything from white space through the
* next space, tab, or ":" character.
*
@@ -339,7 +339,7 @@ static inline enum parseKey recognize( register char* ident, int len)
{
const hash_entry* pEntry = AfmKeywordHash::in_word_set( ident, len );
return pEntry ? pEntry->eKey : NOPE;
-
+
} /* recognize */
@@ -348,34 +348,34 @@ static inline enum parseKey recognize( register char* ident, int len)
/* This function is called by "parseFile". It will parse the AFM file
* up to the "StartCharMetrics" keyword, which essentially marks the
* end of the Global Font Information and the beginning of the character
- * metrics information.
+ * metrics information.
*
* If the caller of "parseFile" specified that it wanted the Global
* Font Information (as defined by the "AFM file Specification"
- * document), then that information will be stored in the returned
+ * document), then that information will be stored in the returned
* data structure.
*
- * Any Global Font Information entries that are not found in a
+ * Any Global Font Information entries that are not found in a
* given file, will have the usual default initialization value
* for its type (i.e. entries of type int will be 0, etc).
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
-{
+{
bool cont = true, save = (gfi != NULL);
int error = ok;
register char *keyword;
int direction = -1;
int tokenlen;
-
+
while (cont)
{
keyword = token(fp, tokenlen);
-
+
if (keyword == NULL)
/* Have reached an early and unexpected EOF. */
/* Set flag and stop parsing */
@@ -383,15 +383,15 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
error = earlyEOF;
break; /* get out of loop */
}
- if (!save)
+ if (!save)
/* get tokens until the end of the Global Font info section */
/* without saving any of the data */
- switch (recognize(keyword, tokenlen))
- {
+ switch (recognize(keyword, tokenlen))
+ {
case STARTCHARMETRICS:
cont = false;
break;
- case ENDFONTMETRICS:
+ case ENDFONTMETRICS:
cont = false;
error = normalEOF;
break;
@@ -417,15 +417,15 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
case ENCODINGSCHEME:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->encodingScheme = strdup( keyword );
- break;
+ break;
case FULLNAME:
if ((keyword = linetoken(fp)) != NULL)
gfi->fullName = strdup( keyword );
- break;
- case FAMILYNAME:
+ break;
+ case FAMILYNAME:
if ((keyword = linetoken(fp)) != NULL)
gfi->familyName = strdup( keyword );
- break;
+ break;
case WEIGHT:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->weight = strdup( keyword );
@@ -439,14 +439,14 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
{
if (MATCH(keyword, False))
gfi->isFixedPitch = 0;
- else
+ else
gfi->isFixedPitch = 1;
}
- break;
+ break;
case UNDERLINEPOSITION:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->underlinePosition = atoi(keyword);
- break;
+ break;
case UNDERLINETHICKNESS:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->underlineThickness = atoi(keyword);
@@ -454,11 +454,11 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
case VERSION:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->version = strdup( keyword );
- break;
+ break;
case NOTICE:
if ((keyword = linetoken(fp)) != NULL)
gfi->notice = strdup( keyword );
- break;
+ break;
case FONTBBOX:
if ((keyword = token(fp,tokenlen)) != NULL)
gfi->fontBBox.llx = atoi(keyword);
@@ -533,7 +533,7 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
}
keyword = token(fp,tokenlen);
/* ignore y-width for now */
- break;
+ break;
case METRICSSETS:
keyword = token(fp,tokenlen);
break; /* ignore this for now */
@@ -543,38 +543,38 @@ static int parseGlobals( FileInputStream* fp, register GlobalFontInfo* gfi )
break;
} /* switch */
} /* while */
-
+
return(error);
-
-} /* parseGlobals */
+
+} /* parseGlobals */
/************************* parseCharWidths **************************/
/* This function is called by "parseFile". It will parse the AFM file
- * up to the "EndCharMetrics" keyword. It will save the character
+ * up to the "EndCharMetrics" keyword. It will save the character
* width info (as opposed to all of the character metric information)
* if requested by the caller of parseFile. Otherwise, it will just
* parse through the section without saving any information.
*
- * If data is to be saved, parseCharWidths is passed in a pointer
+ * If data is to be saved, parseCharWidths is passed in a pointer
* to an array of widths that has already been initialized by the
* standard value for unmapped character codes. This function parses
* the Character Metrics section only storing the width information
* for the encoded characters into the array using the character code
* as the index into that array.
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parseCharWidths( FileInputStream* fp, register int* cwi)
-{
+{
bool cont = true, save = (cwi != NULL);
int pos = 0, error = ok, tokenlen;
register char *keyword;
-
+
while (cont)
{
keyword = token(fp,tokenlen);
@@ -585,19 +585,19 @@ static int parseCharWidths( FileInputStream* fp, register int* cwi)
error = earlyEOF;
break; /* get out of loop */
}
- if (!save)
+ if (!save)
/* get tokens until the end of the Char Metrics section without */
/* saving any of the data*/
- switch (recognize(keyword,tokenlen))
- {
+ switch (recognize(keyword,tokenlen))
+ {
case ENDCHARMETRICS:
cont = false;
- break;
+ break;
case ENDFONTMETRICS:
cont = false;
error = normalEOF;
break;
- default:
+ default:
break;
} /* switch */
else
@@ -631,15 +631,15 @@ static int parseCharWidths( FileInputStream* fp, register int* cwi)
break;
case ENDCHARMETRICS:
cont = false;
- break;
+ break;
case ENDFONTMETRICS:
cont = false;
error = normalEOF;
break;
case CHARNAME: /* eat values (so doesn't cause parseError) */
- keyword = token(fp,tokenlen);
+ keyword = token(fp,tokenlen);
break;
- case CHARBBOX:
+ case CHARBBOX:
keyword = token(fp,tokenlen); keyword = token(fp,tokenlen);
keyword = token(fp,tokenlen); keyword = token(fp,tokenlen);
break;
@@ -651,21 +651,21 @@ static int parseCharWidths( FileInputStream* fp, register int* cwi)
keyword = token(fp,tokenlen);
break;
case NOPE:
- default:
+ default:
error = parseError;
break;
} /* switch */
} /* while */
-
+
return(error);
-
-} /* parseCharWidths */
+
+} /* parseCharWidths */
/*
* number of char metrics is almost allways inaccurate, so be gentle and try to
* adapt our internal storage by adjusting the allocated list
- */
+ */
static int
reallocFontMetrics( void **pp_fontmetrics, int *p_oldcount, int n_newcount, unsigned int n_size )
@@ -684,7 +684,7 @@ reallocFontMetrics( void **pp_fontmetrics, int *p_oldcount, int n_newcount, unsi
if ( n_newcount > *p_oldcount )
{
- char *p_inimetrics = p_tmpmetrics + n_size * *p_oldcount;
+ char *p_inimetrics = p_tmpmetrics + n_size * *p_oldcount;
int n_inimetrics = n_size * (n_newcount - *p_oldcount);
memset( p_inimetrics, 0, n_inimetrics );
}
@@ -702,7 +702,7 @@ enlargeCount( unsigned int n_oldcount )
if (n_oldcount == n_newcount )
n_newcount = n_oldcount + 5;
- return n_newcount;
+ return n_newcount;
}
/************************* parseCharMetrics ************************/
@@ -714,21 +714,21 @@ enlargeCount( unsigned int n_oldcount )
* parseCharMetrics is passed in a pointer to an array of records
* to hold information on a per character basis. This function
* parses the Character Metrics section storing all character
- * metric information for the ALL characters (mapped and unmapped)
+ * metric information for the ALL characters (mapped and unmapped)
* into the array.
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
-{
+{
bool cont = true, firstTime = true;
int error = ok, count = 0, tokenlen;
register CharMetricInfo *temp = fi->cmi;
register char *keyword;
-
+
while (cont)
{
keyword = token(fp,tokenlen);
@@ -741,17 +741,17 @@ static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
{
case COMMENT:
keyword = linetoken(fp);
- break;
+ break;
case CODE:
if (!(count < fi->numOfChars))
{
- reallocFontMetrics( (void**)&(fi->cmi),
- &(fi->numOfChars), enlargeCount(fi->numOfChars),
+ reallocFontMetrics( (void**)&(fi->cmi),
+ &(fi->numOfChars), enlargeCount(fi->numOfChars),
sizeof(CharMetricInfo) );
temp = &(fi->cmi[ count - 1 ]);
}
if (count < fi->numOfChars)
- {
+ {
if (firstTime) firstTime = false;
else temp++;
if ((keyword = token(fp,tokenlen)) != NULL)
@@ -769,8 +769,8 @@ static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
case CODEHEX:
if (!(count < fi->numOfChars ))
{
- reallocFontMetrics( (void**)&(fi->cmi),
- &(fi->numOfChars), enlargeCount(fi->numOfChars),
+ reallocFontMetrics( (void**)&(fi->cmi),
+ &(fi->numOfChars), enlargeCount(fi->numOfChars),
sizeof(CharMetricInfo) );
temp = &(fi->cmi[ count - 1 ]);
}
@@ -795,20 +795,20 @@ static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
temp->wx = atoi(keyword);
if ((keyword = token(fp,tokenlen)) != NULL)
temp->wy = atoi(keyword);
- break;
+ break;
case X0WIDTH:
if ((keyword = token(fp,tokenlen)) != NULL)
temp->wx = atoi(keyword);
break;
- case XWIDTH:
+ case XWIDTH:
if ((keyword = token(fp,tokenlen)) != NULL)
temp->wx = atoi(keyword);
break;
- case CHARNAME:
+ case CHARNAME:
if ((keyword = token(fp,tokenlen)) != NULL)
temp->name = (char *)strdup(keyword);
- break;
- case CHARBBOX:
+ break;
+ case CHARBBOX:
if ((keyword = token(fp,tokenlen)) != NULL)
temp->charBBox.llx = atoi(keyword);
if ((keyword = token(fp,tokenlen)) != NULL)
@@ -821,14 +821,14 @@ static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
case LIGATURE: {
Ligature **tail = &(temp->ligs);
Ligature *node = *tail;
-
+
if (*tail != NULL)
{
while (node->next != NULL)
node = node->next;
- tail = &(node->next);
+ tail = &(node->next);
}
-
+
*tail = (Ligature *) calloc(1, sizeof(Ligature));
if ((keyword = token(fp,tokenlen)) != NULL)
(*tail)->succ = (char *)strdup(keyword);
@@ -837,60 +837,60 @@ static int parseCharMetrics( FileInputStream* fp, register FontInfo* fi)
break; }
case ENDCHARMETRICS:
cont = false;;
- break;
- case ENDFONTMETRICS:
+ break;
+ case ENDFONTMETRICS:
cont = false;
error = normalEOF;
- break;
+ break;
case VVECTOR:
keyword = token(fp,tokenlen);
keyword = token(fp,tokenlen);
break;
case NOPE:
default:
- error = parseError;
- break;
+ error = parseError;
+ break;
} /* switch */
} /* while */
-
- if ((error == ok) && (count != fi->numOfChars))
- error = reallocFontMetrics( (void**)&(fi->cmi), &(fi->numOfChars),
+
+ if ((error == ok) && (count != fi->numOfChars))
+ error = reallocFontMetrics( (void**)&(fi->cmi), &(fi->numOfChars),
count, sizeof(CharMetricInfo) );
if ((error == ok) && (count != fi->numOfChars))
error = parseError;
-
+
return(error);
-
-} /* parseCharMetrics */
+
+} /* parseCharMetrics */
/************************* parseTrackKernData ***********************/
-/* This function is called by "parseFile". It will parse the AFM file
+/* This function is called by "parseFile". It will parse the AFM file
* up to the "EndTrackKern" or "EndKernData" keywords. It will save the
* track kerning data if requested by the caller of parseFile.
*
* parseTrackKernData is passed in a pointer to the FontInfo record.
- * If data is to be saved, the FontInfo record will already contain
+ * If data is to be saved, the FontInfo record will already contain
* a valid pointer to storage for the track kerning data.
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parseTrackKernData( FileInputStream* fp, register FontInfo* fi)
-{
+{
bool cont = true, save = (fi->tkd != NULL);
int pos = 0, error = ok, tcount = 0, tokenlen;
register char *keyword;
-
+
while (cont)
{
keyword = token(fp,tokenlen);
-
+
if (keyword == NULL)
{
error = earlyEOF;
@@ -923,7 +923,7 @@ static int parseTrackKernData( FileInputStream* fp, register FontInfo* fi)
case TRACKKERN:
if (!(tcount < fi->numOfTracks))
{
- reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks),
+ reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks),
enlargeCount(fi->numOfTracks), sizeof(TrackKernData) );
}
@@ -961,44 +961,44 @@ static int parseTrackKernData( FileInputStream* fp, register FontInfo* fi)
break;
} /* switch */
} /* while */
-
+
if (error == ok && tcount != fi->numOfTracks)
- error = reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks),
+ error = reallocFontMetrics( (void**)&(fi->tkd), &(fi->numOfTracks),
tcount, sizeof(TrackKernData) );
if (error == ok && tcount != fi->numOfTracks)
error = parseError;
-
+
return(error);
-
-} /* parseTrackKernData */
+
+} /* parseTrackKernData */
/************************* parsePairKernData ************************/
-/* This function is called by "parseFile". It will parse the AFM file
+/* This function is called by "parseFile". It will parse the AFM file
* up to the "EndKernPairs" or "EndKernData" keywords. It will save
* the pair kerning data if requested by the caller of parseFile.
*
* parsePairKernData is passed in a pointer to the FontInfo record.
- * If data is to be saved, the FontInfo record will already contain
+ * If data is to be saved, the FontInfo record will already contain
* a valid pointer to storage for the pair kerning data.
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parsePairKernData( FileInputStream* fp, register FontInfo* fi)
-{
+{
bool cont = true, save = (fi->pkd != NULL);
int pos = 0, error = ok, pcount = 0, tokenlen;
register char *keyword;
-
+
while (cont)
{
keyword = token(fp,tokenlen);
-
+
if (keyword == NULL)
{
error = earlyEOF;
@@ -1031,7 +1031,7 @@ static int parsePairKernData( FileInputStream* fp, register FontInfo* fi)
case KERNPAIR:
if (!(pcount < fi->numOfPairs))
{
- reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
+ reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
enlargeCount(fi->numOfPairs), sizeof(PairKernData) );
}
if (pcount < fi->numOfPairs)
@@ -1055,7 +1055,7 @@ static int parsePairKernData( FileInputStream* fp, register FontInfo* fi)
case KERNPAIRXAMT:
if (!(pcount < fi->numOfPairs))
{
- reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
+ reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
enlargeCount(fi->numOfPairs), sizeof(PairKernData) );
}
if (pcount < fi->numOfPairs)
@@ -1088,43 +1088,43 @@ static int parsePairKernData( FileInputStream* fp, register FontInfo* fi)
break;
} /* switch */
} /* while */
-
- if ((error == ok) && (pcount != fi->numOfPairs))
- error = reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
+
+ if ((error == ok) && (pcount != fi->numOfPairs))
+ error = reallocFontMetrics( (void**)&(fi->pkd), &(fi->numOfPairs),
pcount, sizeof(PairKernData) );
if (error == ok && pcount != fi->numOfPairs)
error = parseError;
-
+
return(error);
-
-} /* parsePairKernData */
+
+} /* parsePairKernData */
/************************* parseCompCharData **************************/
-/* This function is called by "parseFile". It will parse the AFM file
- * up to the "EndComposites" keyword. It will save the composite
+/* This function is called by "parseFile". It will parse the AFM file
+ * up to the "EndComposites" keyword. It will save the composite
* character data if requested by the caller of parseFile.
*
- * parseCompCharData is passed in a pointer to the FontInfo record, and
+ * parseCompCharData is passed in a pointer to the FontInfo record, and
* a boolean representing if the data should be saved.
*
* This function will create the appropriate amount of storage for
* the composite character data and store a pointer to the storage
* in the FontInfo record.
*
- * This function returns an error code specifying whether there was
- * a premature EOF or a parsing error. This return value is used by
+ * This function returns an error code specifying whether there was
+ * a premature EOF or a parsing error. This return value is used by
* parseFile to determine if there is more file to parse.
*/
-
+
static int parseCompCharData( FileInputStream* fp, register FontInfo* fi)
-{
+{
bool cont = true, firstTime = true, save = (fi->ccd != NULL);
int pos = 0, j = 0, error = ok, ccount = 0, pcount = 0, tokenlen;
register char *keyword;
-
+
while (cont)
{
keyword = token(fp,tokenlen);
@@ -1137,7 +1137,7 @@ static int parseCompCharData( FileInputStream* fp, register FontInfo* fi)
}
if (ccount > fi->numOfComps)
{
- reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
+ reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
enlargeCount(fi->numOfComps), sizeof(CompCharData) );
}
if (ccount > fi->numOfComps)
@@ -1175,7 +1175,7 @@ static int parseCompCharData( FileInputStream* fp, register FontInfo* fi)
case COMPCHAR:
if (!(ccount < fi->numOfComps))
{
- reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
+ reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
enlargeCount(fi->numOfComps), sizeof(CompCharData) );
}
if (ccount < fi->numOfComps)
@@ -1227,27 +1227,27 @@ static int parseCompCharData( FileInputStream* fp, register FontInfo* fi)
break;
} /* switch */
} /* while */
-
+
if (error == ok && ccount != fi->numOfComps)
- reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
+ reallocFontMetrics( (void**)&(fi->ccd), &(fi->numOfComps),
ccount, sizeof(CompCharData) );
if (error == ok && ccount != fi->numOfComps)
error = parseError;
-
+
return(error);
-
-} /* parseCompCharData */
+
+} /* parseCompCharData */
-/*************************** 'PUBLIC' FUNCTION ********************/
+/*************************** 'PUBLIC' FUNCTION ********************/
/*************************** parseFile *****************************/
-/* parseFile is the only 'public' procedure available. It is called
+/* parseFile is the only 'public' procedure available. It is called
* from an application wishing to get information from an AFM file.
* The caller of this function is responsible for locating and opening
* an AFM file and handling all errors associated with that task.
@@ -1257,41 +1257,41 @@ static int parseCompCharData( FileInputStream* fp, register FontInfo* fi)
* the data requested filled in), and a mask specifying which
* data from the AFM file should be saved in the FontInfo structure.
*
- * The file will be parsed and the requested data will be stored in
+ * The file will be parsed and the requested data will be stored in
* a record of type FontInfo (refer to ParseAFM.h).
*
- * parseFile returns an error code as defined in parseAFM.h.
+ * parseFile returns an error code as defined in parseAFM.h.
*
- * The position of the read/write pointer associated with the file
+ * The position of the read/write pointer associated with the file
* pointer upon return of this function is undefined.
*/
int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
{
FileInputStream aFile( pFilename );
-
+
int code = ok; /* return code from each of the parsing routines */
int error = ok; /* used as the return code from this function */
int tokenlen;
-
- register char *keyword; /* used to store a token */
-
+
+ register char *keyword; /* used to store a token */
+
(*fi) = (FontInfo *) calloc(1, sizeof(FontInfo));
- if ((*fi) == NULL) {error = storageProblem; return(error);}
-
- if (flags & P_G)
+ if ((*fi) == NULL) {error = storageProblem; return(error);}
+
+ if (flags & P_G)
{
(*fi)->gfi = (GlobalFontInfo *) calloc(1, sizeof(GlobalFontInfo));
- if ((*fi)->gfi == NULL) {error = storageProblem; return(error);}
+ if ((*fi)->gfi == NULL) {error = storageProblem; return(error);}
}
-
+
/* The AFM file begins with Global Font Information. This section */
- /* will be parsed whether or not information should be saved. */
- code = parseGlobals(&aFile, (*fi)->gfi);
-
+ /* will be parsed whether or not information should be saved. */
+ code = parseGlobals(&aFile, (*fi)->gfi);
+
if (code < 0) error = code;
-
+
/* The Global Font Information is followed by the Character Metrics */
/* section. Which procedure is used to parse this section depends on */
/* how much information should be saved. If all of the metrics info */
@@ -1299,26 +1299,26 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
/* is wanted, parseCharWidths is called. parseCharWidths will also */
/* be called in the case that no character data is to be saved, just */
/* to parse through the section. */
-
+
if ((code != normalEOF) && (code != earlyEOF))
{
if ((keyword = token(&aFile,tokenlen)) != NULL)
(*fi)->numOfChars = atoi(keyword);
if (flags & (P_M ^ P_W))
{
- (*fi)->cmi = (CharMetricInfo *)
+ (*fi)->cmi = (CharMetricInfo *)
calloc((*fi)->numOfChars, sizeof(CharMetricInfo));
if ((*fi)->cmi == NULL) {error = storageProblem; return(error);}
- code = parseCharMetrics(&aFile, *fi);
+ code = parseCharMetrics(&aFile, *fi);
}
else
{
if (flags & P_W)
- {
- (*fi)->cwi = (int *) calloc(256, sizeof(int));
- if ((*fi)->cwi == NULL)
+ {
+ (*fi)->cwi = (int *) calloc(256, sizeof(int));
+ if ((*fi)->cwi == NULL)
{
- error = storageProblem;
+ error = storageProblem;
return(error);
}
}
@@ -1326,15 +1326,15 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
code = parseCharWidths(&aFile, (*fi)->cwi);
} /* else */
} /* if */
-
+
if ((error != earlyEOF) && (code < 0)) error = code;
-
+
/* The remaining sections of the AFM are optional. This code will */
/* look at the next keyword in the file to determine what section */
/* is next, and then allocate the appropriate amount of storage */
/* for the data (if the data is to be saved) and call the */
/* appropriate parsing routine to parse the section. */
-
+
while ((code != normalEOF) && (code != earlyEOF))
{
keyword = token(&aFile,tokenlen);
@@ -1356,11 +1356,11 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
if ((flags & P_T) && keyword)
{
(*fi)->numOfTracks = atoi(keyword);
- (*fi)->tkd = (TrackKernData *)
+ (*fi)->tkd = (TrackKernData *)
calloc((*fi)->numOfTracks, sizeof(TrackKernData));
- if ((*fi)->tkd == NULL)
+ if ((*fi)->tkd == NULL)
{
- error = storageProblem;
+ error = storageProblem;
return(error);
}
} /* if */
@@ -1371,11 +1371,11 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
if ((flags & P_P) && keyword)
{
(*fi)->numOfPairs = atoi(keyword);
- (*fi)->pkd = (PairKernData *)
+ (*fi)->pkd = (PairKernData *)
calloc((*fi)->numOfPairs, sizeof(PairKernData));
- if ((*fi)->pkd == NULL)
+ if ((*fi)->pkd == NULL)
{
- error = storageProblem;
+ error = storageProblem;
return(error);
}
} /* if */
@@ -1384,18 +1384,18 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
case STARTCOMPOSITES:
keyword = token(&aFile,tokenlen);
if ((flags & P_C) && keyword)
- {
+ {
(*fi)->numOfComps = atoi(keyword);
- (*fi)->ccd = (CompCharData *)
+ (*fi)->ccd = (CompCharData *)
calloc((*fi)->numOfComps, sizeof(CompCharData));
- if ((*fi)->ccd == NULL)
+ if ((*fi)->ccd == NULL)
{
- error = storageProblem;
+ error = storageProblem;
return(error);
}
} /* if */
- code = parseCompCharData(&aFile, *fi);
- break;
+ code = parseCompCharData(&aFile, *fi);
+ break;
case ENDFONTMETRICS:
code = normalEOF;
break;
@@ -1407,21 +1407,21 @@ int parseFile( const char* pFilename, FontInfo** fi, FLAGS flags)
code = parseError;
break;
} /* switch */
-
+
if ((error != earlyEOF) && (code < 0)) error = code;
-
+
} /* while */
-
+
if ((error != earlyEOF) && (code < 0)) error = code;
-
+
return(error);
-
+
} /* parseFile */
void
freeFontInfo (FontInfo *fi)
{
- int i;
+ int i, j;
if (fi->gfi)
{
@@ -1475,7 +1475,6 @@ freeFontInfo (FontInfo *fi)
for (i = 0; i < fi->numOfComps; i++)
{
free (fi->ccd[i].ccName);
- int j;
for (j = 0; j < fi->ccd[i].numOfPieces; j++)
free (fi->ccd[i].pieces[j].pccName);
diff --git a/vcl/unx/source/fontmanager/parseAFM.hxx b/vcl/unx/source/fontmanager/parseAFM.hxx
index 0c390bd8cf8d..11abc82d45b6 100644
--- a/vcl/unx/source/fontmanager/parseAFM.hxx
+++ b/vcl/unx/source/fontmanager/parseAFM.hxx
@@ -3,20 +3,20 @@
* (C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.
*
* This file may be freely copied and redistributed as long as:
- * 1) This entire notice continues to be included in the file,
+ * 1) This entire notice continues to be included in the file,
* 2) If the file has been modified in any way, a notice of such
* modification is conspicuously indicated.
*
* PostScript, Display PostScript, and Adobe are registered trademarks of
* Adobe Systems Incorporated.
- *
+ *
* ************************************************************************
* THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
* NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
- * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
- * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
- * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
- * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
+ * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
+ * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
+ * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
+ * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* ************************************************************************
*/
@@ -41,23 +41,23 @@
* Together these files provide the functionality to parse Adobe Font
* Metrics files and store the information in predefined data structures.
* It is intended to work with an application program that needs font metric
- * information. The program can be used as is by making a procedure call to
+ * information. The program can be used as is by making a procedure call to
* parse an AFM file and have the data stored, or an application developer
- * may wish to customize the code.
+ * may wish to customize the code.
*
- * This header file defines the data structures used as well as the key
+ * This header file defines the data structures used as well as the key
* strings that are currently recognized by this version of the AFM parser.
- * This program is based on the document "Adobe Font Metrics Files,
+ * This program is based on the document "Adobe Font Metrics Files,
* Specification Version 2.0".
*
* AFM files are separated into distinct sections of different data. Because
* of this, the parseAFM program can parse a specified file to only save
- * certain sections of information based on the application's needs. A record
+ * certain sections of information based on the application's needs. A record
* containing the requested information will be returned to the application.
- *
+ *
* AFM files are divided into five sections of data:
* 1) The Global Font Information
- * 2) The Character Metrics Information
+ * 2) The Character Metrics Information
* 3) The Track Kerning Data
* 4) The Pair-Wise Kerning Data
* 5) The Composite Character Data
@@ -66,22 +66,22 @@
* of what other sections are requested. In addition, in recognizing that
* many applications will want ONLY the x-width of characters and not all
* of the other character metrics information, there is a way to receive
- * only the width information so as not to pay the storage cost for the
- * unwanted data. An application should never request both the
- * "quick and dirty" char metrics (widths only) and the Character Metrics
- * Information since the Character Metrics Information will contain all
+ * only the width information so as not to pay the storage cost for the
+ * unwanted data. An application should never request both the
+ * "quick and dirty" char metrics (widths only) and the Character Metrics
+ * Information since the Character Metrics Information will contain all
* of the character widths as well.
- *
- * There is a procedure in parseAFM.c, called parseFile, that can be
+ *
+ * There is a procedure in parseAFM.c, called parseFile, that can be
* called from any application wishing to get information from the AFM File.
* This procedure expects 3 parameters: a vaild file descriptor, a pointer
- * to a (FontInfo *) variable (for which space will be allocated and then
+ * to a (FontInfo *) variable (for which space will be allocated and then
* will be filled in with the data requested), and a mask specifying
* which data from the AFM File should be saved in the FontInfo structure.
- *
+ *
* The flags that can be used to set the appropriate mask are defined below.
- * In addition, several commonly used masks have already been defined.
- *
+ * In addition, several commonly used masks have already been defined.
+ *
* History:
* original: DSM Thu Oct 20 17:39:59 PDT 1988
* modified: DSM Mon Jul 3 14:17:50 PDT 1989
@@ -113,27 +113,27 @@ namespace psp {
/* Commonly used flags
*/
-#define P_GW (P_G | P_W)
+#define P_GW (P_G | P_W)
#define P_GM (P_G | P_M)
#define P_GMP (P_G | P_M | P_P)
-#define P_GMK (P_G | P_M | P_P | P_T)
+#define P_GMK (P_G | P_M | P_P | P_T)
#define P_ALL (P_G | P_M | P_P | P_T | P_C)
/* Possible return codes from the parseFile procedure.
- *
+ *
* ok means there were no problems parsing the file.
*
* parseError means that there was some kind of parsing error, but the
* parser went on. This could include problems like the count for any given
* section does not add up to how many entries there actually were, or
* there was a key that was not recognized. The return record may contain
- * vaild data or it may not.
+ * vaild data or it may not.
*
* earlyEOF means that an End of File was encountered before expected. This
* may mean that the AFM file had been truncated, or improperly formed.
- *
+ *
* storageProblem means that there were problems allocating storage for
* the data structures that would have contained the AFM data.
*/
@@ -143,16 +143,16 @@ enum afmError { ok = 0, parseError = -1, earlyEOF = -2, storageProblem = -3 };
/************************* TYPES *********************************/
/* Below are all of the data structure definitions. These structures
- * try to map as closely as possible to grouping and naming of data
+ * try to map as closely as possible to grouping and naming of data
* in the AFM Files.
*/
-/* Bounding box definition. Used for the Font BBox as well as the
+/* Bounding box definition. Used for the Font BBox as well as the
* Character BBox.
*/
typedef struct
-{
+{
int llx; /* lower left x-position */
int lly; /* lower left y-position */
int urx; /* upper right x-position */
@@ -161,12 +161,12 @@ typedef struct
/* Global Font information.
- * The key that each field is associated with is in comments. For an
+ * The key that each field is associated with is in comments. For an
* explanation about each key and its value please refer to the AFM
- * documentation (full title & version given above).
+ * documentation (full title & version given above).
*/
typedef struct
-{
+{
char *afmVersion; /* key: StartFontMetrics */
char *fontName; /* key: FontName */
char *fullName; /* key: FullName */
@@ -198,15 +198,15 @@ typedef struct _t_ligature
} Ligature;
-/* Character Metric Information. This structure is used only if ALL
+/* Character Metric Information. This structure is used only if ALL
* character metric information is requested. If only the character
* widths is requested, then only an array of the character x-widths
* is returned.
*
- * The key that each field is associated with is in comments. For an
- * explanation about each key and its value please refer to the
+ * The key that each field is associated with is in comments. For an
+ * explanation about each key and its value please refer to the
* Character Metrics section of the AFM documentation (full title
- * & version given above).
+ * & version given above).
*/
typedef struct
{
@@ -221,19 +221,19 @@ typedef struct
/* Track kerning data structure.
- * The fields of this record are the five values associated with every
+ * The fields of this record are the five values associated with every
* TrackKern entry.
- *
- * For an explanation about each value please refer to the
+ *
+ * For an explanation about each value please refer to the
* Track Kerning section of the AFM documentation (full title
- * & version given above).
+ * & version given above).
*/
-typedef struct
+typedef struct
{
- int degree;
- float minPtSize,
- minKernAmt,
- maxPtSize,
+ int degree;
+ float minPtSize,
+ minKernAmt,
+ maxPtSize,
maxKernAmt;
} TrackKernData;
@@ -242,11 +242,11 @@ typedef struct
* The fields of this record are the four values associated with every
* KP entry. For KPX entries, the yamt will be zero.
*
- * For an explanation about each value please refer to the
+ * For an explanation about each value please refer to the
* Pair Kerning section of the AFM documentation (full title
- * & version given above).
+ * & version given above).
*/
-typedef struct
+typedef struct
{
char *name1;
char *name2;
@@ -258,10 +258,10 @@ typedef struct
/* PCC is a piece of a composite character. This is a sub structure of a
* compCharData described below.
* These fields will be filled in with the values from the key PCC.
- *
- * For an explanation about each key and its value please refer to the
+ *
+ * For an explanation about each key and its value please refer to the
* Composite Character section of the AFM documentation (full title
- * & version given above).
+ * & version given above).
*/
typedef struct
{
@@ -271,15 +271,15 @@ typedef struct
} Pcc;
-/* Composite Character Information data structure.
+/* Composite Character Information data structure.
* The fields ccName and numOfPieces are filled with the values associated
* with the key CC. The field pieces points to an array (size = numOfPieces)
* of information about each of the parts of the composite character. That
* array is filled in with the values from the key PCC.
- *
- * For an explanation about each key and its value please refer to the
+ *
+ * For an explanation about each key and its value please refer to the
* Composite Character section of the AFM documentation (full title
- * & version given above).
+ * & version given above).
*/
typedef struct
{
@@ -296,9 +296,9 @@ typedef struct
* parseFile function.
*/
typedef struct
-{
+{
GlobalFontInfo *gfi; /* ptr to a GlobalFontInfo record */
- int *cwi; /* ptr to 256 element array of just char widths */
+ int *cwi; /* ptr to 256 element array of just char widths */
int numOfChars; /* number of entries in char metrics array */
CharMetricInfo *cmi; /* ptr to char metrics array */
int numOfTracks; /* number to entries in track kerning array */
@@ -317,7 +317,7 @@ typedef struct
*
* "fp" should be a valid file pointer to an AFM file.
*
- * "fi" is a pointer to a pointer to a FontInfo record sturcture
+ * "fi" is a pointer to a pointer to a FontInfo record sturcture
* (defined above). Storage for the FontInfo structure will be
* allocated in parseFile and the structure will be filled in
* with the requested data from the AFM File.
@@ -329,7 +329,7 @@ typedef struct
* The possible return codes from parseFile are defined above.
*/
-int parseFile( const char* pFilename, FontInfo **fi, FLAGS flags );
+int parseFile( const char* pFilename, FontInfo **fi, FLAGS flags );
void freeFontInfo(FontInfo *fi);
} // namespace
diff --git a/vcl/unx/source/gdi/cdeint.cxx b/vcl/unx/source/gdi/cdeint.cxx
index fd81e05c0644..a1b43fe74803 100644
--- a/vcl/unx/source/gdi/cdeint.cxx
+++ b/vcl/unx/source/gdi/cdeint.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -73,9 +73,10 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
int nStringCount;
XTextProperty aTextProperty;
aTextProperty.value = 0;
-
+ int i;
+
static Atom nResMgrAtom = XInternAtom( mpDisplay, "RESOURCE_MANAGER", False );
-
+
if( XGetTextProperty( mpDisplay,
RootWindow( mpDisplay, 0 ),
&aTextProperty,
@@ -88,7 +89,6 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
// *n*ColorPalette: palettefile
ByteString aLines;
- int i;
for( i=0; i < nStringCount; i++ )
aLines += ppStringList[i];
for( i = aLines.GetTokenCount( '\n' )-1; i >= 0; i-- )
@@ -124,8 +124,8 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
for( ; nPos >= 0 && aLine.GetChar( nPos ) != '*'; nPos-- )
;
int nNumber = aLine.Copy( ++nPos ).ToInt32();
-
- OSL_TRACE( "found palette %d in resource \"%s\"", nNumber, aLine.GetBuffer() );
+
+ DBG_TRACE2( "found palette %d in resource \"%s\"", nNumber, aLine.GetBuffer() );
// found no documentation what this number actually means;
// might be the screen number. 0 seems to be the right one
@@ -133,8 +133,8 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
if( nNumber )
continue;
- OSL_TRACE( "Palette file is \"%s\".\n", aPaletteFile.GetBuffer() );
-
+ DBG_TRACE1( "Palette file is \"%s\".\n", aPaletteFile.GetBuffer() );
+
String aPath( aHomeDir );
aPath.AppendAscii( "/.dt/palettes/" );
aPath += String( aPaletteFile, gsl_getSystemTextEncoding() );
@@ -155,7 +155,7 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
aStream.ReadLine( aBuffer );
// format is "#RRRRGGGGBBBB"
- OSL_TRACE( "\t\"%s\".\n", aBuffer.GetBuffer() );
+ DBG_TRACE1( "\t\"%s\".\n", aBuffer.GetBuffer() );
if( aBuffer.Len() )
{
@@ -163,13 +163,13 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
aColors[nIndex] = Color(
getHexDigit( pArr[1] )
| ( getHexDigit( pArr[0] ) << 4 ),
- getHexDigit( pArr[5] )
+ getHexDigit( pArr[5] )
| ( getHexDigit( pArr[4] ) << 4 ),
getHexDigit( pArr[9] )
| ( getHexDigit( pArr[8] ) << 4 )
);
-
- OSL_TRACE( "\t\t%lx\n", aColors[nIndex].GetColor() );
+
+ DBG_TRACE1( "\t\t%lx\n", aColors[nIndex].GetColor() );
}
}
@@ -178,14 +178,14 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
}
}
}
-
+
if( ppStringList )
XFreeStringList( ppStringList );
if( aTextProperty.value )
XFree( aTextProperty.value );
}
-
+
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
// #i48001# set a default blink rate
aStyleSettings.SetCursorBlinkTime( 500 );
@@ -200,13 +200,13 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
aStyleSettings.SetDeactiveBorderColor( aColors[0] );
Color aActive =
- aColors[ 0 ].GetBlue() < 128 ||
- aColors[ 0 ].GetGreen() < 128 ||
+ aColors[ 0 ].GetBlue() < 128 ||
+ aColors[ 0 ].GetGreen() < 128 ||
aColors[ 0 ].GetRed() < 128
? Color( COL_WHITE ) : Color( COL_BLACK );
Color aDeactive =
- aColors[ 1 ].GetBlue() < 128 ||
- aColors[ 1 ].GetGreen() < 128 ||
+ aColors[ 1 ].GetBlue() < 128 ||
+ aColors[ 1 ].GetGreen() < 128 ||
aColors[ 1 ].GetRed() < 128
? Color( COL_WHITE ) : Color( COL_BLACK );
aStyleSettings.SetActiveTextColor( aActive );
@@ -232,9 +232,9 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
{
// calculate Checked color
Color aColor2 = aStyleSettings.GetLightColor();
- 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);
+ 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);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
}
diff --git a/vcl/unx/source/gdi/dtint.cxx b/vcl/unx/source/gdi/dtint.cxx
index 704e4b977450..0eb07fbc9a13 100644
--- a/vcl/unx/source/gdi/dtint.cxx
+++ b/vcl/unx/source/gdi/dtint.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -64,10 +64,9 @@
#endif
+using namespace rtl;
using namespace vcl_sal;
-using ::rtl::OUString;
-
String DtIntegrator::aHomeDir;
DtIntegrator::DtIntegrator() :
diff --git a/vcl/unx/source/gdi/dtsetenum.hxx b/vcl/unx/source/gdi/dtsetenum.hxx
index 7973758d9f0d..eb5f8f5bc86f 100644
--- a/vcl/unx/source/gdi/dtsetenum.hxx
+++ b/vcl/unx/source/gdi/dtsetenum.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx
index 8cbf67ffe6dc..750687b4e2bb 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -153,7 +153,7 @@ void X11GlyphPeer::InitAntialiasing()
enum { INFO_EMPTY=0, INFO_PIXMAP, INFO_XRENDER, INFO_RAWBMP, INFO_MULTISCREEN };
static const Glyph NO_GLYPHID = 0;
-static RawBitmap* const NO_RAWBMP = NULL;
+static RawBitmap* const NO_RAWBMP = NULL;
static const Pixmap NO_PIXMAP = ~0;
// ---------------------------------------------------------------------------
@@ -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
- sal_uLong nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
+ ULONG nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth );
rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) );
rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset );
- const sal_uLong nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
+ const ULONG nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
if( nBytes > 0 )
{
// conversion table LSB<->MSB (for XCreatePixmapFromData)
@@ -517,7 +517,7 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR
*pTemp = lsb2msb[ *pTemp ];
// often a glyph pixmap is only needed on the default screen
- // => optimize for this common case
+ // => optimize for this common case
int nMinScreen = 0;
int nEndScreen = mnMaxScreens;
if( nReqScreen == mnDefaultScreen ) {
@@ -622,7 +622,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex )
GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 );
aGlyphId = nGlyphIndex & 0x00FFFFFF;
- const sal_uLong nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
+ const ULONG nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId,
aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes );
mnBytesUsed += nBytes;
@@ -643,7 +643,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex )
// ===========================================================================
X11GlyphCache::X11GlyphCache( X11GlyphPeer& rPeer )
-: GlyphCache( rPeer )
+: GlyphCache( rPeer )
{
}
diff --git a/vcl/unx/source/gdi/gcach_xpeer.hxx b/vcl/unx/source/gdi/gcach_xpeer.hxx
index b634659876bd..84fe101214e2 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.hxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk
index ef5a8726fedc..65d775bf6b23 100644
--- a/vcl/unx/source/gdi/makefile.mk
+++ b/vcl/unx/source/gdi/makefile.mk
@@ -47,25 +47,41 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)$/salgdi2.obj \
- $(SLO)$/salbmp.obj \
- $(SLO)$/salgdi.obj \
- $(SLO)$/salvd.obj \
$(SLO)$/dtint.obj \
+ $(SLO)$/gcach_xpeer.obj \
+ $(SLO)$/pspgraphics.obj \
+ $(SLO)$/salbmp.obj \
$(SLO)$/salcvt.obj \
+ $(SLO)$/salgdi.obj \
+ $(SLO)$/salgdi2.obj \
$(SLO)$/salgdi3.obj \
- $(SLO)$/gcach_xpeer.obj \
- $(SLO)$/xrender_peer.obj \
- $(SLO)$/pspgraphics.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)$/salgdi.obj \
+ $(SLO)$/dtint.obj \
+ $(SLO)$/gcach_xpeer.obj \
+ $(SLO)$/pspgraphics.obj \
$(SLO)$/salbmp.obj \
+ $(SLO)$/salcvt.obj \
+ $(SLO)$/salgdi.obj \
+ $(SLO)$/salgdi2.obj \
$(SLO)$/salgdi3.obj \
- $(SLO)$/salcvt.obj
+ $(SLO)$/salvd.obj \
+ $(SLO)$/xfont.obj \
+ $(SLO)$/xlfd_extd.obj
+.IF "$(USE_XPRINT)" == "TRUE"
+CFLAGS+=-D_USE_PRINT_EXTENSION_=1
+SLOFILES+=$(SLO)$/xprintext.obj
+.ELSE
SLOFILES+=$(SLO)$/salprnpsp.obj
EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj
+.ENDIF
.IF "$(OS)"=="SOLARIS"
SLOFILES+=$(SLO)$/cdeint.obj
@@ -78,9 +94,6 @@ CFLAGS+=-DXRENDER_LINK
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
CFLAGS+=-DENABLE_GRAPHITE
-.IF "$(SYSTEM_GRAPHITE)" != "YES"
-CDEFS+=-DGR2_STATIC
-.ENDIF
.ENDIF
.ENDIF # "$(GUIBASE)"!="unx"
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index a4289496fa14..c25e065a143d 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,7 +42,6 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
-#include "vcl/region.h"
#include <stdlib.h>
#include <unistd.h>
@@ -57,38 +56,36 @@
#endif
using namespace psp;
-
-using ::rtl::OUString;
-using ::rtl::OString;
+using namespace rtl;
// ----- Implementation of PrinterBmp by means of SalBitmap/BitmapBuffer ---------------
class SalPrinterBmp : public psp::PrinterBmp
{
private:
- BitmapBuffer* mpBmpBuffer;
+ BitmapBuffer* mpBmpBuffer;
- FncGetPixel mpFncGetPixel;
- Scanline mpScanAccess;
- sal_PtrDiff mnScanOffset;
+ FncGetPixel mpFncGetPixel;
+ Scanline mpScanAccess;
+ sal_PtrDiff mnScanOffset;
- sal_uInt32 ColorOf (BitmapColor& rColor) const;
- sal_uInt8 GrayOf (BitmapColor& rColor) const;
+ sal_uInt32 ColorOf (BitmapColor& rColor) const;
+ sal_uInt8 GrayOf (BitmapColor& rColor) const;
SalPrinterBmp ();
public:
SalPrinterBmp (BitmapBuffer* pBitmap);
- virtual ~SalPrinterBmp ();
- virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const;
- virtual sal_uInt32 GetPaletteEntryCount () const;
- virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const;
- virtual sal_uInt32 GetWidth () const;
- virtual sal_uInt32 GetHeight() const;
- virtual sal_uInt32 GetDepth () const;
+ virtual ~SalPrinterBmp ();
+ virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const;
+ virtual sal_uInt32 GetPaletteEntryCount () const;
+ virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt32 GetWidth () const;
+ virtual sal_uInt32 GetHeight() const;
+ virtual sal_uInt32 GetDepth () const;
};
SalPrinterBmp::SalPrinterBmp (BitmapBuffer* pBuffer) :
@@ -113,17 +110,17 @@ SalPrinterBmp::SalPrinterBmp (BitmapBuffer* pBuffer) :
switch( BMP_SCANLINE_FORMAT( mpBmpBuffer->mnFormat ) )
{
case BMP_FORMAT_1BIT_MSB_PAL:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL; break;
case BMP_FORMAT_1BIT_LSB_PAL:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_LSB_PAL; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_LSB_PAL; break;
case BMP_FORMAT_4BIT_MSN_PAL:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_MSN_PAL; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_MSN_PAL; break;
case BMP_FORMAT_4BIT_LSN_PAL:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_LSN_PAL; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_LSN_PAL; break;
case BMP_FORMAT_8BIT_PAL:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_PAL; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_PAL; break;
case BMP_FORMAT_8BIT_TC_MASK:
- mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_TC_MASK; break;
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_TC_MASK; break;
case BMP_FORMAT_16BIT_TC_MSB_MASK:
mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_MSB_MASK; break;
case BMP_FORMAT_16BIT_TC_LSB_MASK:
@@ -146,7 +143,7 @@ SalPrinterBmp::SalPrinterBmp (BitmapBuffer* pBuffer) :
mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_MASK; break;
default:
- OSL_FAIL("Error: SalPrinterBmp::SalPrinterBmp() unknown bitmap format");
+ DBG_ERROR("Error: SalPrinterBmp::SalPrinterBmp() unknown bitmap format");
break;
}
}
@@ -191,7 +188,7 @@ SalPrinterBmp::GetDepth () const
default:
nDepth = 1;
- OSL_FAIL("Error: unsupported bitmap depth in SalPrinterBmp::GetDepth()");
+ DBG_ERROR ("Error: unsupported bitmap depth in SalPrinterBmp::GetDepth()");
break;
}
@@ -204,7 +201,7 @@ SalPrinterBmp::ColorOf (BitmapColor& rColor) const
if (rColor.IsIndex())
return ColorOf (mpBmpBuffer->maPalette[rColor.GetIndex()]);
else
- return ((rColor.GetBlue()) & 0x000000ff)
+ return ((rColor.GetBlue()) & 0x000000ff)
| ((rColor.GetGreen() << 8) & 0x0000ff00)
| ((rColor.GetRed() << 16) & 0x00ff0000);
}
@@ -282,7 +279,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-sal_uInt16 PspGraphics::GetBitCount() const
+USHORT PspGraphics::GetBitCount()
{
return m_pPrinterGfx->GetBitCount();
}
@@ -294,27 +291,28 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion();
+ m_pPrinterGfx->ResetClipRegion ();
}
-bool PspGraphics::setClipRegion( const Region& i_rClip )
+void PspGraphics::BeginSetClipRegion( ULONG n )
{
- // TODO: support polygonal clipregions here
- m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
+ m_pPrinterGfx->BeginSetClipRegion(n);
+}
- 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;
+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;
+}
+
+void PspGraphics::EndSetClipRegion()
+{
+ m_pPrinterGfx->EndSetClipRegion ();
}
void PspGraphics::SetLineColor()
@@ -382,18 +380,18 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
+void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32 *pPoints,
PCONSTSALPOINT *pPtAry )
{
@@ -412,13 +410,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -427,20 +425,20 @@ sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtA
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const sal_uInt8* const* pFlgAry )
+ const BYTE* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
return sal_True;
}
-void PspGraphics::invert( sal_uLong,
+void PspGraphics::invert( ULONG,
const SalPoint*,
SalInvert )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
+BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -448,12 +446,12 @@ sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void
void PspGraphics::copyBits( const SalTwoRect*,
SalGraphics* )
{
- OSL_FAIL( "Error: PrinterGfx::CopyBits() not implemented" );
+ DBG_ERROR( "Error: PrinterGfx::CopyBits() not implemented" );
}
-void PspGraphics::copyArea ( long,long,long,long,long,long,sal_uInt16 )
+void PspGraphics::copyArea ( long,long,long,long,long,long,USHORT )
{
- OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
+ DBG_ERROR( "Error: PrinterGfx::CopyArea() not implemented" );
}
void PspGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
@@ -475,21 +473,21 @@ void PspGraphics::drawBitmap( const SalTwoRect*,
const SalBitmap&,
const SalBitmap& )
{
- OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent bitmap");
+ DBG_ERROR("Error: no PrinterGfx::DrawBitmap() for transparent bitmap");
}
void PspGraphics::drawBitmap( const SalTwoRect*,
const SalBitmap&,
SalColor )
{
- OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent color");
+ DBG_ERROR("Error: no PrinterGfx::DrawBitmap() for transparent color");
}
void PspGraphics::drawMask( const SalTwoRect*,
const SalBitmap &,
SalColor )
{
- OSL_FAIL("Error: PrinterGfx::DrawMask() not implemented");
+ DBG_ERROR("Error: PrinterGfx::DrawMask() not implemented");
}
SalBitmap* PspGraphics::getBitmap( long, long, long, long )
@@ -500,13 +498,13 @@ SalBitmap* PspGraphics::getBitmap( long, long, long, long )
SalColor PspGraphics::getPixel( long, long )
{
- OSL_FAIL("Warning: PrinterGfx::GetPixel() not implemented");
+ DBG_ERROR ("Warning: PrinterGfx::GetPixel() not implemented");
return 0;
}
void PspGraphics::invert(long,long,long,long,SalInvert)
{
- OSL_FAIL("Warning: PrinterGfx::Invert() not implemented");
+ DBG_ERROR ("Warning: PrinterGfx::Invert() not implemented");
}
//==========================================================================
@@ -568,8 +566,8 @@ PspFontLayout::PspFontLayout( ::psp::PrinterGfx& rGfx )
mnFontHeight = mrPrinterGfx.GetFontHeight();
mnFontWidth = mrPrinterGfx.GetFontWidth();
mbVertical = mrPrinterGfx.GetFontVertical();
- mbArtItalic = mrPrinterGfx.GetArtificialItalic();
- mbArtBold = mrPrinterGfx.GetArtificialBold();
+ mbArtItalic = mrPrinterGfx.GetArtificialItalic();
+ mbArtBold = mrPrinterGfx.GetArtificialBold();
}
//--------------------------------------------------------------------------
@@ -657,19 +655,19 @@ public:
PspServerFontLayout( psp::PrinterGfx&, ServerFont& rFont, const ImplLayoutArgs& rArgs );
virtual void InitFont() const;
- const sal_Unicode* getTextPtr() const { return maText.getStr() - mnMinCharPos; }
- int getMinCharPos() const { return mnMinCharPos; }
- int getMaxCharPos() const { return mnMinCharPos+maText.getLength()-1; }
+ const sal_Unicode* getTextPtr() const { return maText.getStr() - mnMinCharPos; }
+ int getMinCharPos() const { return mnMinCharPos; }
+ int getMaxCharPos() const { return mnMinCharPos+maText.getLength()-1; }
private:
::psp::PrinterGfx& mrPrinterGfx;
sal_IntPtr mnFontID;
int mnFontHeight;
int mnFontWidth;
bool mbVertical;
- bool mbArtItalic;
- bool mbArtBold;
- rtl::OUString maText;
- int mnMinCharPos;
+ bool mbArtItalic;
+ bool mbArtBold;
+ rtl::OUString maText;
+ int mnMinCharPos;
};
PspServerFontLayout::PspServerFontLayout( ::psp::PrinterGfx& rGfx, ServerFont& rFont, const ImplLayoutArgs& rArgs )
@@ -680,9 +678,9 @@ PspServerFontLayout::PspServerFontLayout( ::psp::PrinterGfx& rGfx, ServerFont& r
mnFontHeight = mrPrinterGfx.GetFontHeight();
mnFontWidth = mrPrinterGfx.GetFontWidth();
mbVertical = mrPrinterGfx.GetFontVertical();
- mbArtItalic = mrPrinterGfx.GetArtificialItalic();
- mbArtBold = mrPrinterGfx.GetArtificialBold();
- maText = OUString( rArgs.mpStr + rArgs.mnMinCharPos, rArgs.mnEndCharPos - rArgs.mnMinCharPos+1 );
+ mbArtItalic = mrPrinterGfx.GetArtificialItalic();
+ mbArtBold = mrPrinterGfx.GetArtificialBold();
+ maText = OUString( rArgs.mpStr + rArgs.mnMinCharPos, rArgs.mnEndCharPos - rArgs.mnMinCharPos+1 );
mnMinCharPos = rArgs.mnMinCharPos;
}
@@ -701,7 +699,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
sal_Int32 aWidthAry[ nMaxGlyphs ];
sal_Int32 aIdxAry [ nMaxGlyphs ];
sal_Unicode aUnicodes[ nMaxGlyphs ];
- int aCharPosAry [ nMaxGlyphs ];
+ int aCharPosAry [ nMaxGlyphs ];
Point aPos;
long nUnitsPerPixel = rLayout.GetUnitsPerPixel();
@@ -770,23 +768,19 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
+ // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
- return pIFCMap;
-}
-
-bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if (!m_pServerFont[0])
- return false;
- return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
+ CmapResult aCmapResult;
+ if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
+ return NULL;
+ return new ImplFontCharMap( aCmapResult );
}
-sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -802,7 +796,7 @@ sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel
// return early if there is no new font
if( !pEntry )
return 0;
-
+
sal_IntPtr nID = pEntry->mpFontData ? pEntry->mpFontData->GetFontId() : 0;
// determine which font attributes need to be emulated
@@ -884,7 +878,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
const psp::PrinterInfo& rInfo = psp::PrinterInfoManager::get().getPrinterInfo( m_pJobData->m_aPrinterName );
if( rInfo.m_bPerformFontSubstitution )
{
- for( boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator it = rInfo.m_aFontSubstitutes.begin(); it != rInfo.m_aFontSubstitutes.end(); ++it )
+ for( std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator it = rInfo.m_aFontSubstitutes.begin(); it != rInfo.m_aFontSubstitutes.end(); ++it )
pOutDev->ImplAddDevFontSubstitute( it->first, it->second, FONT_SUBSTITUTE_ALWAYS );
}
}
@@ -901,26 +895,26 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
pMetric->mbDevice = aDFA.mbDevice;
pMetric->mbScalableFont = true;
- pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
- pMetric->mnSlant = 0;
+ pMetric->mnOrientation = m_pPrinterGfx->GetFontAngle();
+ pMetric->mnSlant = 0;
- sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight();
- sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth();
+ sal_Int32 nTextHeight = m_pPrinterGfx->GetFontHeight();
+ sal_Int32 nTextWidth = m_pPrinterGfx->GetFontWidth();
if( ! nTextWidth )
nTextWidth = nTextHeight;
- pMetric->mnWidth = nTextWidth;
- pMetric->mnAscent = ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000;
- pMetric->mnDescent = ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000;
- pMetric->mnIntLeading = ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000;
- pMetric->mnExtLeading = 0;
+ pMetric->mnWidth = nTextWidth;
+ pMetric->mnAscent = ( aInfo.m_nAscend * nTextHeight + 500 ) / 1000;
+ pMetric->mnDescent = ( aInfo.m_nDescend * nTextHeight + 500 ) / 1000;
+ pMetric->mnIntLeading = ( aInfo.m_nLeading * nTextHeight + 500 ) / 1000;
+ pMetric->mnExtLeading = 0;
}
}
-sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
+ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- sal_uLong nHavePairs = rPairs.size();
+ ULONG nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -930,47 +924,47 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa
nTextScale = m_pPrinterGfx->GetFontHeight();
for( i = 0, it = rPairs.begin(); i < nPairs && i < nHavePairs; i++, ++it )
{
- pKernPairs[i].mnChar1 = it->first;
- pKernPairs[i].mnChar2 = it->second;
- pKernPairs[i].mnKern = it->kern_x * nTextScale / 1000;
+ pKernPairs[i].mnChar1 = it->first;
+ pKernPairs[i].mnChar2 = it->second;
+ pKernPairs[i].mnKern = it->kern_x * nTextScale / 1000;
}
}
return nHavePairs;
}
-sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return sal_True;
+ return TRUE;
}
-sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
+BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -989,9 +983,13 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
{
#ifdef ENABLE_GRAPHITE
// Is this a Graphite font?
- if (GraphiteServerFontLayout::IsGraphiteEnabledFont(m_pServerFont[nFallbackLevel]))
+ if (GraphiteFontAdaptor::IsGraphiteEnabledFont(*m_pServerFont[nFallbackLevel]))
{
- pLayout = new GraphiteServerFontLayout(*m_pServerFont[nFallbackLevel]);
+ sal_Int32 xdpi, ydpi;
+ GetResolution(xdpi, ydpi);
+ GraphiteFontAdaptor * pGrfont = new GraphiteFontAdaptor( *m_pServerFont[nFallbackLevel], xdpi, ydpi);
+ if (!pGrfont) return NULL;
+ pLayout = new GraphiteServerFontLayout(pGrfont);
}
else
#endif
@@ -1005,7 +1003,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-sal_Bool PspGraphics::CreateFontSubset(
+BOOL PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1094,9 +1092,9 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
return NULL;
// fill in font info
- rInfo.m_nAscent = aFontInfo.m_nAscend;
- rInfo.m_nDescent = aFontInfo.m_nDescend;
- rInfo.m_aPSName = rMgr.getPSName( aFont );
+ rInfo.m_nAscent = aFontInfo.m_nAscend;
+ rInfo.m_nDescent = aFontInfo.m_nDescend;
+ rInfo.m_aPSName = rMgr.getPSName( aFont );
int xMin, yMin, xMax, yMax;
rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax );
@@ -1126,8 +1124,8 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico
*pDataLen = aStat.st_size;
- rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
- rInfo.m_nCapHeight = yMax; // Well ...
+ rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) );
+ rInfo.m_nCapHeight = yMax; // Well ...
for( int i = 0; i < 256; i++ )
pWidths[i] = (aMetrics[i].width > 0 ? aMetrics[i].width : 0);
@@ -1186,16 +1184,16 @@ FontWidth PspGraphics::ToFontWidth (psp::width::type eWidth)
{
case psp::width::UltraCondensed: return WIDTH_ULTRA_CONDENSED;
case psp::width::ExtraCondensed: return WIDTH_EXTRA_CONDENSED;
- case psp::width::Condensed: return WIDTH_CONDENSED;
- case psp::width::SemiCondensed: return WIDTH_SEMI_CONDENSED;
- case psp::width::Normal: return WIDTH_NORMAL;
- case psp::width::SemiExpanded: return WIDTH_SEMI_EXPANDED;
- case psp::width::Expanded: return WIDTH_EXPANDED;
- case psp::width::ExtraExpanded: return WIDTH_EXTRA_EXPANDED;
- case psp::width::UltraExpanded: return WIDTH_ULTRA_EXPANDED;
+ case psp::width::Condensed: return WIDTH_CONDENSED;
+ case psp::width::SemiCondensed: return WIDTH_SEMI_CONDENSED;
+ case psp::width::Normal: return WIDTH_NORMAL;
+ case psp::width::SemiExpanded: return WIDTH_SEMI_EXPANDED;
+ case psp::width::Expanded: return WIDTH_EXPANDED;
+ case psp::width::ExtraExpanded: return WIDTH_EXTRA_EXPANDED;
+ case psp::width::UltraExpanded: return WIDTH_ULTRA_EXPANDED;
case psp::width::Unknown: return WIDTH_DONTKNOW;
default:
- OSL_FAIL( "unknown width mapping" );
+ DBG_ERROR( "unknown width mapping" );
break;
}
return WIDTH_DONTKNOW;
@@ -1205,19 +1203,19 @@ FontWeight PspGraphics::ToFontWeight (psp::weight::type eWeight)
{
switch (eWeight)
{
- case psp::weight::Thin: return WEIGHT_THIN;
+ case psp::weight::Thin: return WEIGHT_THIN;
case psp::weight::UltraLight: return WEIGHT_ULTRALIGHT;
- case psp::weight::Light: return WEIGHT_LIGHT;
+ case psp::weight::Light: return WEIGHT_LIGHT;
case psp::weight::SemiLight: return WEIGHT_SEMILIGHT;
- case psp::weight::Normal: return WEIGHT_NORMAL;
- case psp::weight::Medium: return WEIGHT_MEDIUM;
- case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
- case psp::weight::Bold: return WEIGHT_BOLD;
+ case psp::weight::Normal: return WEIGHT_NORMAL;
+ case psp::weight::Medium: return WEIGHT_MEDIUM;
+ case psp::weight::SemiBold: return WEIGHT_SEMIBOLD;
+ case psp::weight::Bold: return WEIGHT_BOLD;
case psp::weight::UltraBold: return WEIGHT_ULTRABOLD;
- case psp::weight::Black: return WEIGHT_BLACK;
- case psp::weight::Unknown: return WEIGHT_DONTKNOW;
+ case psp::weight::Black: return WEIGHT_BLACK;
+ case psp::weight::Unknown: return WEIGHT_DONTKNOW;
default:
- OSL_FAIL( "unknown weight mapping" );
+ DBG_ERROR( "unknown weight mapping" );
break;
}
return WEIGHT_DONTKNOW;
@@ -1227,11 +1225,11 @@ FontPitch PspGraphics::ToFontPitch (psp::pitch::type ePitch)
{
switch (ePitch)
{
- case psp::pitch::Fixed: return PITCH_FIXED;
- case psp::pitch::Variable: return PITCH_VARIABLE;
- case psp::pitch::Unknown: return PITCH_DONTKNOW;
+ case psp::pitch::Fixed: return PITCH_FIXED;
+ case psp::pitch::Variable: return PITCH_VARIABLE;
+ case psp::pitch::Unknown: return PITCH_DONTKNOW;
default:
- OSL_FAIL( "unknown pitch mapping" );
+ DBG_ERROR( "unknown pitch mapping" );
break;
}
return PITCH_DONTKNOW;
@@ -1241,12 +1239,12 @@ FontItalic PspGraphics::ToFontItalic (psp::italic::type eItalic)
{
switch (eItalic)
{
- case psp::italic::Upright: return ITALIC_NONE;
- case psp::italic::Oblique: return ITALIC_OBLIQUE;
- case psp::italic::Italic: return ITALIC_NORMAL;
- case psp::italic::Unknown: return ITALIC_DONTKNOW;
+ case psp::italic::Upright: return ITALIC_NONE;
+ case psp::italic::Oblique: return ITALIC_OBLIQUE;
+ case psp::italic::Italic: return ITALIC_NORMAL;
+ case psp::italic::Unknown: return ITALIC_DONTKNOW;
default:
- OSL_FAIL( "unknown italic mapping" );
+ DBG_ERROR( "unknown italic mapping" );
break;
}
return ITALIC_DONTKNOW;
@@ -1257,14 +1255,14 @@ FontFamily PspGraphics::ToFontFamily (psp::family::type eFamily)
switch (eFamily)
{
case psp::family::Decorative: return FAMILY_DECORATIVE;
- case psp::family::Modern: return FAMILY_MODERN;
- case psp::family::Roman: return FAMILY_ROMAN;
- case psp::family::Script: return FAMILY_SCRIPT;
- case psp::family::Swiss: return FAMILY_SWISS;
- case psp::family::System: return FAMILY_SYSTEM;
- case psp::family::Unknown: return FAMILY_DONTKNOW;
+ case psp::family::Modern: return FAMILY_MODERN;
+ case psp::family::Roman: return FAMILY_ROMAN;
+ case psp::family::Script: return FAMILY_SCRIPT;
+ case psp::family::Swiss: return FAMILY_SWISS;
+ case psp::family::System: return FAMILY_SYSTEM;
+ case psp::family::Unknown: return FAMILY_DONTKNOW;
default:
- OSL_FAIL( "unknown family mapping" );
+ DBG_ERROR( "unknown family mapping" );
break;
}
return FAMILY_DONTKNOW;
@@ -1400,9 +1398,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- sal_uInt16 nPos;
- sal_uInt16 nStart = 0;
- sal_uInt16 nStop = rLen;
+ USHORT nPos;
+ USHORT nStart = 0;
+ USHORT nStop = rLen;
String aPhone = rOrig.Copy( nIndex, rLen );
if( ! m_bPhoneCollectionActive )
@@ -1484,7 +1482,7 @@ SystemFontData PspGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
-
+
aSysFontData.nSize = sizeof( SystemFontData );
aSysFontData.nFontId = 0;
aSysFontData.nFontFlags = 0;
diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx
index c60192b8466e..7c14c7221892 100644
--- a/vcl/unx/source/gdi/salbmp.cxx
+++ b/vcl/unx/source/gdi/salbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -65,8 +65,8 @@ SalBitmap* X11SalInstance::CreateSalBitmap()
return new X11SalBitmap();
}
-ImplSalBitmapCache* X11SalBitmap::mpCache = NULL;
-sal_uLong X11SalBitmap::mnCacheInstCount = 0;
+ImplSalBitmapCache* X11SalBitmap::mpCache = NULL;
+ULONG X11SalBitmap::mnCacheInstCount = 0;
// -----------------------------------------------------------------------------
@@ -112,7 +112,7 @@ void X11SalBitmap::ImplRemovedFromCache()
// -----------------------------------------------------------------------------
-BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
+BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT 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, sal_uInt16 nBitCou
if( pDIB )
{
- const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
+ const USHORT nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
pDIB->mnFormat = BMP_FORMAT_BOTTOM_UP;
@@ -141,13 +141,13 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCou
case( 4 ): pDIB->mnFormat |= BMP_FORMAT_4BIT_MSN_PAL; break;
case( 8 ): pDIB->mnFormat |= BMP_FORMAT_8BIT_PAL; break;
#ifdef OSL_BIGENDIAN
- case(16 ):
- pDIB->mnFormat|= BMP_FORMAT_16BIT_TC_MSB_MASK;
+ case(16 ):
+ pDIB->mnFormat|= BMP_FORMAT_16BIT_TC_MSB_MASK;
pDIB->maColorMask = ColorMask( 0xf800, 0x07e0, 0x001f );
break;
#else
- case(16 ):
- pDIB->mnFormat|= BMP_FORMAT_16BIT_TC_LSB_MASK;
+ case(16 ):
+ pDIB->mnFormat|= BMP_FORMAT_16BIT_TC_LSB_MASK;
pDIB->maColorMask = ColorMask( 0xf800, 0x07e0, 0x001f );
break;
#endif
@@ -172,7 +172,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCou
try
{
- pDIB->mpBits = new sal_uInt8[ pDIB->mnScanlineSize * pDIB->mnHeight ];
+ pDIB->mpBits = new BYTE[ pDIB->mnScanlineSize * pDIB->mnHeight ];
}
catch(std::bad_alloc&)
{
@@ -200,9 +200,9 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
if( aDrawable && nWidth && nHeight && nDrawableDepth )
{
- SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- SalXLib* pXLib = pSalDisp->GetXLib();
- Display* pXDisp = pSalDisp->GetDisplay();
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+ SalXLib* pXLib = pSalDisp->GetXLib();
+ Display* pXDisp = pSalDisp->GetDisplay();
// do not die on XError here
// alternatively one could check the coordinates for being offscreen
@@ -210,23 +210,23 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
// defaults even if the rectangle is offscreen
// so better catch the XError
pXLib->PushXErrorLevel( true );
- XImage* pImage = XGetImage( pXDisp, aDrawable, nX, nY, nWidth, nHeight, AllPlanes, ZPixmap );
- bool bWasError = pXLib->HasXErrorOccurred() && pXLib->GetLastXErrorRequestCode() == X_GetImage;
+ XImage* pImage = XGetImage( pXDisp, aDrawable, nX, nY, nWidth, nHeight, AllPlanes, ZPixmap );
+ bool bWasError = pXLib->HasXErrorOccured() && pXLib->GetLastXErrorRequestCode() == X_GetImage;
pXLib->PopXErrorLevel();
if( ! bWasError && pImage && pImage->data )
{
- const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight };
- BitmapBuffer aSrcBuf;
- sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP;
- const BitmapPalette* pDstPal = NULL;
+ const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight };
+ BitmapBuffer aSrcBuf;
+ ULONG nDstFormat = BMP_FORMAT_BOTTOM_UP;
+ const BitmapPalette* pDstPal = NULL;
aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN;
aSrcBuf.mnWidth = nWidth;
aSrcBuf.mnHeight = nHeight;
aSrcBuf.mnBitCount = pImage->bits_per_pixel;
aSrcBuf.mnScanlineSize = pImage->bytes_per_line;
- aSrcBuf.mpBits = (sal_uInt8*) pImage->data;
+ aSrcBuf.mpBits = (BYTE*) pImage->data;
pImage->red_mask = pSalDisp->GetVisual( nScreen ).red_mask;
pImage->green_mask = pSalDisp->GetVisual( nScreen ).green_mask;
@@ -310,9 +310,9 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
rPal.SetEntryCount( 256 );
pDstPal = &rPal;
- for( sal_uInt16 i = 0; i < 256; i++ )
+ for( USHORT i = 0; i < 256; i++ )
{
- BitmapColor& rBmpCol = rPal[ i ];
+ BitmapColor& rBmpCol = rPal[ i ];
rBmpCol.SetRed( i );
rBmpCol.SetGreen( i );
@@ -323,15 +323,15 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
else if( aSrcBuf.mnBitCount <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) );
+ const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << nDrawableDepth) );
rPal.SetEntryCount( nCols );
pDstPal = &rPal;
- for( sal_uInt16 i = 0; i < nCols; i++ )
+ for( USHORT i = 0; i < nCols; i++ )
{
- const SalColor nColor( rColMap.GetColor( i ) );
- BitmapColor& rBmpCol = rPal[ i ];
+ const SalColor nColor( rColMap.GetColor( i ) );
+ BitmapColor& rBmpCol = rPal[ i ];
rBmpCol.SetRed( SALCOLOR_RED( nColor ) );
rBmpCol.SetGreen( SALCOLOR_GREEN( nColor ) );
@@ -351,7 +351,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
// -----------------------------------------------------------------------------
-XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
+XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
XImage* pImage = NULL;
@@ -361,17 +361,17 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
ImplCreateDIB( mpDDB->ImplGetPixmap(),
mpDDB->ImplGetScreen(),
mpDDB->ImplGetDepth(),
- 0, 0,
- mpDDB->ImplGetWidth(),
+ 0, 0,
+ mpDDB->ImplGetWidth(),
mpDDB->ImplGetHeight(),
mbGrey );
}
if( mpDIB && mpDIB->mnWidth && mpDIB->mnHeight )
{
- Display* pXDisp = pSalDisp->GetDisplay();
- long nWidth = rTwoRect.mnDestWidth;
- long nHeight = rTwoRect.mnDestHeight;
+ Display* pXDisp = pSalDisp->GetDisplay();
+ long nWidth = rTwoRect.mnDestWidth;
+ long nHeight = rTwoRect.mnDestHeight;
if( 1 == GetBitCount() )
nDepth = 1;
@@ -382,10 +382,10 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
if( pImage )
{
- BitmapBuffer* pDstBuf;
- sal_uLong nDstFormat = BMP_FORMAT_TOP_DOWN;
- BitmapPalette* pPal = NULL;
- ColorMask* pMask = NULL;
+ BitmapBuffer* pDstBuf;
+ ULONG nDstFormat = BMP_FORMAT_TOP_DOWN;
+ BitmapPalette* pPal = NULL;
+ ColorMask* pMask = NULL;
switch( pImage->bits_per_pixel )
{
@@ -451,9 +451,9 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
{
pPal = new BitmapPalette( 256 );
- for( sal_uInt16 i = 0; i < 256; i++ )
+ for( USHORT i = 0; i < 256; i++ )
{
- BitmapColor& rBmpCol = (*pPal)[ i ];
+ BitmapColor& rBmpCol = (*pPal)[ i ];
rBmpCol.SetRed( i );
rBmpCol.SetGreen( i );
@@ -464,14 +464,14 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
else if( pImage->depth <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) );
+ const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << pImage->depth) );
pPal = new BitmapPalette( nCols );
- for( sal_uInt16 i = 0; i < nCols; i++ )
+ for( USHORT i = 0; i < nCols; i++ )
{
- const SalColor nColor( rColMap.GetColor( i ) );
- BitmapColor& rBmpCol = (*pPal)[ i ];
+ const SalColor nColor( rColMap.GetColor( i ) );
+ BitmapColor& rBmpCol = (*pPal)[ i ];
rBmpCol.SetRed( SALCOLOR_RED( nColor ) );
rBmpCol.SetGreen( SALCOLOR_GREEN( nColor ) );
@@ -504,7 +504,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
// -----------------------------------------------------------------------------
bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable,
- int nScreen, long nDrawableDepth,
+ int nScreen, long nDrawableDepth,
long nX, long nY, long nWidth, long nHeight )
{
Destroy();
@@ -578,7 +578,7 @@ X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
if ((width > 0) && (height > 0))
{
- XImage* pImage = XGetImage( pDisplay, aAttribute.root,
+ XImage* pImage = XGetImage( pDisplay, aAttribute.root,
x, y, width, height, AllPlanes, ZPixmap );
bool bSnapShot = ImplCreateFromXImage( pDisplay,
aAttribute.root,
@@ -595,22 +595,22 @@ X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
return False;
}
-bool
+bool
X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage)
{
Destroy();
if (pImage != NULL && pImage->width != 0 && pImage->height != 0 && pImage->depth != 0)
{
- mpDDB = new ImplSalDDB (pDisplay, hWindow, nScreen, pImage);
+ mpDDB = new ImplSalDDB (pDisplay, hWindow, nScreen, pImage);
return True;
}
return False;
}
ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
+ int nScreen,
+ long nDrawableDepth,
const SalTwoRect& rTwoRect ) const
{
if( !mpDDB || !mpDDB->ImplMatches( nScreen, nDrawableDepth, rTwoRect ) )
@@ -623,8 +623,8 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
const_cast<X11SalBitmap*>(this)->mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(),
mpDDB->ImplGetScreen(),
mpDDB->ImplGetDepth(),
- 0, 0,
- mpDDB->ImplGetWidth(),
+ 0, 0,
+ mpDDB->ImplGetWidth(),
mpDDB->ImplGetHeight(),
mbGrey );
}
@@ -686,7 +686,7 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
}
}
- XImage* pImage = ImplCreateXImage( GetX11SalData()->GetDisplay(), nScreen,
+ XImage* pImage = ImplCreateXImage( GetX11SalData()->GetDisplay(), nScreen,
nDrawableDepth, aTwoRect );
if( pImage )
@@ -706,9 +706,9 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable,
// -----------------------------------------------------------------------------
void X11SalBitmap::ImplDraw( Drawable aDrawable,
- int nScreen,
- long nDrawableDepth,
- const SalTwoRect& rTwoRect,
+ int nScreen,
+ long nDrawableDepth,
+ const SalTwoRect& rTwoRect,
const GC& rGC ) const
{
ImplGetDDB( aDrawable, nScreen, nDrawableDepth, rTwoRect );
@@ -718,7 +718,7 @@ void X11SalBitmap::ImplDraw( Drawable aDrawable,
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
+bool X11SalBitmap::Create( const Size& rSize, USHORT 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 sal_uInt8[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
+ mpDIB->mpBits = new BYTE[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
}
catch( std::bad_alloc& )
{
@@ -755,7 +755,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
else if( rSalBmp.mpDDB )
ImplCreateFromDrawable( rSalBmp.mpDDB->ImplGetPixmap(),
rSalBmp.mpDDB->ImplGetScreen(),
- rSalBmp.mpDDB->ImplGetDepth(),
+ rSalBmp.mpDDB->ImplGetDepth(),
0, 0, rSalBmp.mpDDB->ImplGetWidth(), rSalBmp.mpDDB->ImplGetHeight() );
return( ( !rSalBmp.mpDIB && !rSalBmp.mpDDB ) ||
@@ -767,14 +767,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 )
+bool X11SalBitmap::Create( const SalBitmap&, USHORT )
{
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------------
@@ -783,11 +783,11 @@ bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::s
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY );
if( xFastPropertySet.get() ) {
+ long pixmapHandle;
sal_Int32 depth;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args;
if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) {
- long pixmapHandle;
if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) {
mbGrey = bMask;
@@ -837,9 +837,9 @@ Size X11SalBitmap::GetSize() const
// -----------------------------------------------------------------------------
-sal_uInt16 X11SalBitmap::GetBitCount() const
+USHORT X11SalBitmap::GetBitCount() const
{
- sal_uInt16 nBitCount;
+ USHORT nBitCount;
if( mpDIB )
nBitCount = mpDIB->mnBitCount;
@@ -903,19 +903,19 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData )
// --------------
ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) :
- maPixmap ( 0 ),
- maTwoRect ( rTwoRect ),
- mnDepth ( pImage->depth ),
+ maPixmap ( 0 ),
+ maTwoRect ( rTwoRect ),
+ mnDepth ( pImage->depth ),
mnScreen ( nScreen )
{
- SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- Display* pXDisp = pSalDisp->GetDisplay();
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+ Display* pXDisp = pSalDisp->GetDisplay();
if( (maPixmap = XCreatePixmap( pXDisp, aDrawable, ImplGetWidth(), ImplGetHeight(), ImplGetDepth() )) )
{
- XGCValues aValues;
- GC aGC;
- int nValues = GCFunction;
+ XGCValues aValues;
+ GC aGC;
+ int nValues = GCFunction;
aValues.function = GXcopy;
@@ -940,9 +940,9 @@ ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XIm
maPixmap = XCreatePixmap (pDisplay, hWindow, pImage->width, pImage->height, pImage->depth);
if (maPixmap != 0)
{
- XGCValues aValues;
- GC aGC;
- int nValues = GCFunction;
+ XGCValues aValues;
+ GC aGC;
+ int nValues = GCFunction;
aValues.function = GXcopy;
@@ -976,14 +976,14 @@ ImplSalDDB::ImplSalDDB( Drawable aDrawable, int nScreen, long nDrawableDepth, lo
mnDepth( nDrawableDepth ),
mnScreen( nScreen )
{
- SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- Display* pXDisp = pSalDisp->GetDisplay();
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+ Display* pXDisp = pSalDisp->GetDisplay();
if( (maPixmap = XCreatePixmap( pXDisp, aDrawable, nWidth, nHeight, nDrawableDepth )) )
{
- XGCValues aValues;
- GC aGC;
- int nValues = GCFunction;
+ XGCValues aValues;
+ GC aGC;
+ int nValues = GCFunction;
aValues.function = GXcopy;
@@ -1016,7 +1016,7 @@ ImplSalDDB::~ImplSalDDB()
bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
- bool bRet = sal_False;
+ bool bRet = 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 = sal_True;
+ bRet = 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 = sal_True;
+ bRet = TRUE;
}
}
@@ -1044,7 +1044,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const
{
- ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth,
+ ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth,
rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY,
rTwoRect.mnDestWidth, rTwoRect.mnDestHeight,
rTwoRect.mnDestX, rTwoRect.mnDestY, rGC );
@@ -1054,12 +1054,12 @@ void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwo
void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
Drawable aDstDrawable, long,
- long nSrcX, long nSrcY,
- long nDestWidth, long nDestHeight,
+ long nSrcX, long nSrcY,
+ long nDestWidth, long nDestHeight,
long nDestX, long nDestY, const GC& rGC )
{
- SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- Display* pXDisp = pSalDisp->GetDisplay();
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+ Display* pXDisp = pSalDisp->GetDisplay();
if( 1 == nSrcDrawableDepth )
{
@@ -1079,11 +1079,11 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
struct ImplBmpObj
{
- X11SalBitmap* mpBmp;
- sal_uLong mnMemSize;
- sal_uLong mnFlags;
+ X11SalBitmap* mpBmp;
+ ULONG mnMemSize;
+ ULONG mnFlags;
- ImplBmpObj( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) :
+ ImplBmpObj( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags ) :
mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {}
};
@@ -1103,14 +1103,14 @@ ImplSalBitmapCache::~ImplSalBitmapCache()
// -----------------------------------------------------------------------------
-void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags )
+void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags )
{
ImplBmpObj* pObj;
- bool bFound = sal_False;
+ bool bFound = FALSE;
for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() )
if( pObj->mpBmp == pBmp )
- bFound = sal_True;
+ bFound = TRUE;
mnTotalSize += nMemSize;
diff --git a/vcl/unx/source/gdi/salcvt.cxx b/vcl/unx/source/gdi/salcvt.cxx
index f757f3fc0ab3..ca8deb058b90 100644
--- a/vcl/unx/source/gdi/salcvt.cxx
+++ b/vcl/unx/source/gdi/salcvt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,7 +53,7 @@ SalConverterCache::~SalConverterCache()
#include <stdio.h>
// <---
-rtl_UnicodeToTextConverter
+rtl_UnicodeToTextConverter
SalConverterCache::GetU2TConverter( rtl_TextEncoding nEncoding )
{
if( rtl_isOctetTextEncoding( nEncoding ) )
@@ -61,7 +61,7 @@ SalConverterCache::GetU2TConverter( rtl_TextEncoding nEncoding )
ConverterT& rConverter( m_aConverters[ nEncoding ] );
if ( rConverter.mpU2T == NULL )
{
- rConverter.mpU2T =
+ rConverter.mpU2T =
rtl_createUnicodeToTextConverter( nEncoding );
// ---> FIXME
if ( rConverter.mpU2T == NULL )
@@ -73,7 +73,7 @@ if ( rConverter.mpU2T == NULL )
return NULL;
}
-rtl_TextToUnicodeConverter
+rtl_TextToUnicodeConverter
SalConverterCache::GetT2UConverter( rtl_TextEncoding nEncoding )
{
if( rtl_isOctetTextEncoding( nEncoding ) )
@@ -81,7 +81,7 @@ SalConverterCache::GetT2UConverter( rtl_TextEncoding nEncoding )
ConverterT& rConverter( m_aConverters[ nEncoding ] );
if ( rConverter.mpT2U == NULL )
{
- rConverter.mpT2U =
+ rConverter.mpT2U =
rtl_createTextToUnicodeConverter( nEncoding );
// ---> FIXME
if ( rConverter.mpT2U == NULL )
@@ -107,15 +107,15 @@ SalConverterCache::IsSingleByteEncoding( rtl_TextEncoding nEncoding )
aTextEncInfo.StructSize = sizeof( aTextEncInfo );
rtl_getTextEncodingInfo( nEncoding, &aTextEncInfo );
- if ( aTextEncInfo.MinimumCharSize == aTextEncInfo.MaximumCharSize
+ if ( aTextEncInfo.MinimumCharSize == aTextEncInfo.MaximumCharSize
&& aTextEncInfo.MinimumCharSize == 1)
rConverter.mbSingleByteEncoding = True;
else
rConverter.mbSingleByteEncoding = False;
}
-
+
return rConverter.mbSingleByteEncoding;
- }
+ }
return False;
}
@@ -123,7 +123,7 @@ SalConverterCache::IsSingleByteEncoding( rtl_TextEncoding nEncoding )
// code point nChar. This list has been compiled from the according
// ttmap files in /usr/openwin/lib/X11/fonts/TrueType/ttmap/
Bool
-SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
+SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
sal_Unicode nChar )
{
Bool bMatch = False;
@@ -141,120 +141,120 @@ SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
// handle them also like ms1252
// this is due to the fact that so many X fonts say they are iso8859-1
// but have the other glyphs anyway because they are really ms1252
- bMatch = ( /*nChar >= 0x0000 &&*/ nChar <= 0x00ff )
- || ( nChar == 0x20ac )
- || ( nChar == 0x201a )
- || ( nChar == 0x0192 )
- || ( nChar == 0x201e )
- || ( nChar == 0x2026 )
- || ( nChar == 0x2020 )
- || ( nChar == 0x2021 )
- || ( nChar == 0x02c6 )
- || ( nChar == 0x2030 )
- || ( nChar == 0x0160 )
- || ( nChar == 0x2039 )
- || ( nChar == 0x0152 )
- || ( nChar == 0x017d )
- || ( nChar == 0x2018 )
- || ( nChar == 0x2019 )
- || ( nChar == 0x201c )
- || ( nChar == 0x201d )
- || ( nChar == 0x2022 )
- || ( nChar == 0x2013 )
- || ( nChar == 0x2014 )
- || ( nChar == 0x02dc )
- || ( nChar == 0x2122 )
- || ( nChar == 0x0161 )
- || ( nChar == 0x203a )
- || ( nChar == 0x0153 )
- || ( nChar == 0x017e )
- || ( nChar == 0x0178 )
+ bMatch = ( /*nChar >= 0x0000 &&*/ nChar <= 0x00ff )
+ || ( nChar == 0x20ac )
+ || ( nChar == 0x201a )
+ || ( nChar == 0x0192 )
+ || ( nChar == 0x201e )
+ || ( nChar == 0x2026 )
+ || ( nChar == 0x2020 )
+ || ( nChar == 0x2021 )
+ || ( nChar == 0x02c6 )
+ || ( nChar == 0x2030 )
+ || ( nChar == 0x0160 )
+ || ( nChar == 0x2039 )
+ || ( nChar == 0x0152 )
+ || ( nChar == 0x017d )
+ || ( nChar == 0x2018 )
+ || ( nChar == 0x2019 )
+ || ( nChar == 0x201c )
+ || ( nChar == 0x201d )
+ || ( nChar == 0x2022 )
+ || ( nChar == 0x2013 )
+ || ( nChar == 0x2014 )
+ || ( nChar == 0x02dc )
+ || ( nChar == 0x2122 )
+ || ( nChar == 0x0161 )
+ || ( nChar == 0x203a )
+ || ( nChar == 0x0153 )
+ || ( nChar == 0x017e )
+ || ( nChar == 0x0178 )
;
break;
case RTL_TEXTENCODING_ISO_8859_2:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x017e )
- || ( nChar >= 0x02c7 && nChar <= 0x02dd );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x017e )
+ || ( nChar >= 0x02c7 && nChar <= 0x02dd );
break;
-
+
case RTL_TEXTENCODING_ISO_8859_4:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x017e )
- || ( nChar >= 0x02c7 && nChar <= 0x02db );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x017e )
+ || ( nChar >= 0x02c7 && nChar <= 0x02db );
break;
case RTL_TEXTENCODING_ISO_8859_5:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00ad )
- || ( nChar >= 0x0401 && nChar <= 0x045f )
- || ( nChar == 0x2116 );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00ad )
+ || ( nChar >= 0x0401 && nChar <= 0x045f )
+ || ( nChar == 0x2116 );
break;
case RTL_TEXTENCODING_ISO_8859_6:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x0600 && nChar <= 0x06ff )
- || ( nChar >= 0xfb50 && nChar <= 0xfffe );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x0600 && nChar <= 0x06ff )
+ || ( nChar >= 0xfb50 && nChar <= 0xfffe );
break;
case RTL_TEXTENCODING_ISO_8859_7:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00bd )
- || ( nChar == 0x02bd )
- || ( nChar >= 0x0384 && nChar <= 0x03ce )
- || ( nChar >= 0x2014 && nChar <= 0x2019 );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00bd )
+ || ( nChar == 0x02bd )
+ || ( nChar >= 0x0384 && nChar <= 0x03ce )
+ || ( nChar >= 0x2014 && nChar <= 0x2019 );
break;
case RTL_TEXTENCODING_ISO_8859_8:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00f7 )
- || ( nChar >= 0x05d0 && nChar <= 0x05ea )
- || ( nChar == 0x2017 );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00f7 )
+ || ( nChar >= 0x05d0 && nChar <= 0x05ea )
+ || ( nChar == 0x2017 );
break;
case RTL_TEXTENCODING_ISO_8859_9:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x015f );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x015f );
break;
case RTL_TEXTENCODING_ISO_8859_13:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x017e )
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x017e )
|| ( nChar >= 0x2019 && nChar <= 0x201e );
break;
/* real case for RTL_TEXTENCODING_ISO_8859_15
case RTL_TEXTENCODING_ISO_8859_15:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00ff )
- || ( nChar >= 0x0152 && nChar <= 0x017e )
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00ff )
+ || ( nChar >= 0x0152 && nChar <= 0x017e )
|| ( nChar == 0x20ac );
break;
*/
case RTL_TEXTENCODING_JIS_X_0201:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0xff61 && nChar <= 0xff9f );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0xff61 && nChar <= 0xff9f );
break;
case RTL_TEXTENCODING_MS_1251:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00bb )
- || ( nChar >= 0x0401 && nChar <= 0x045f )
- || ( nChar >= 0x0490 && nChar <= 0x0491 )
- || ( nChar >= 0x2013 && nChar <= 0x203a )
- || ( nChar >= 0x2116 && nChar <= 0x2122 );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00bb )
+ || ( nChar >= 0x0401 && nChar <= 0x045f )
+ || ( nChar >= 0x0490 && nChar <= 0x0491 )
+ || ( nChar >= 0x2013 && nChar <= 0x203a )
+ || ( nChar >= 0x2116 && nChar <= 0x2122 );
break;
case RTL_TEXTENCODING_KOI8_R:
- bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
- || ( nChar >= 0x00a0 && nChar <= 0x00b7 )
- || ( nChar == 0x00f7 )
- || ( nChar >= 0x0401 && nChar <= 0x0451 )
- || ( nChar >= 0x2219 && nChar <= 0x221a )
- || ( nChar >= 0x2248 && nChar <= 0x2265 )
- || ( nChar >= 0x2320 && nChar <= 0x2321 )
- || ( nChar >= 0x2500 && nChar <= 0x25a0 );
+ bMatch = ( nChar >= 0x0020 && nChar <= 0x007e )
+ || ( nChar >= 0x00a0 && nChar <= 0x00b7 )
+ || ( nChar == 0x00f7 )
+ || ( nChar >= 0x0401 && nChar <= 0x0451 )
+ || ( nChar >= 0x2219 && nChar <= 0x221a )
+ || ( nChar >= 0x2248 && nChar <= 0x2265 )
+ || ( nChar >= 0x2320 && nChar <= 0x2321 )
+ || ( nChar >= 0x2500 && nChar <= 0x25a0 );
break;
case RTL_TEXTENCODING_UNICODE:
@@ -268,7 +268,7 @@ SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
case RTL_TEXTENCODING_MS_1361:
case RTL_TEXTENCODING_JIS_X_0208:
- // XXX Big5 and Korean EUC contain Ascii chars, but Solaris
+ // XXX Big5 and Korean EUC contain Ascii chars, but Solaris
// *-big5-1 and *-ksc5601.1992-3 fonts dont, in general CJK fonts
// are monospaced, so dont trust them for latin chars
if (nChar <= 0xFF)
@@ -278,7 +278,7 @@ SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
}
default:
- // XXX really convert the unicode char into the encoding
+ // XXX really convert the unicode char into the encoding
// and check for conversion errors, this is expensive !
rtl_UnicodeToTextConverter aConverter;
rtl_UnicodeToTextContext aContext;
@@ -296,27 +296,27 @@ SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding,
sal_Size nConvertedChars;
sal_Size nSize;
- nSize = rtl_convertUnicodeToText( aConverter, aContext,
- &nChar, 1, pConversionBuffer, sizeof(pConversionBuffer),
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+ nSize = rtl_convertUnicodeToText( aConverter, aContext,
+ &nChar, 1, pConversionBuffer, sizeof(pConversionBuffer),
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR,
&nConversionInfo, &nConvertedChars );
rtl_destroyUnicodeToTextContext( aConverter, aContext );
bMatch = (nConvertedChars == 1)
- && (nSize == 1 || nSize == 2) // XXX Fix me this is a hack
+ && (nSize == 1 || nSize == 2) // XXX Fix me this is a hack
&& ((nConversionInfo & RTL_UNICODETOTEXT_INFO_ERROR) == 0);
break;
}
- return bMatch;
+ return bMatch;
}
// wrapper for rtl_convertUnicodeToText that handles the usual cases for
// textconversion in drawtext and gettextwidth routines
sal_Size
-SalConverterCache::ConvertStringUTF16( const sal_Unicode *pText, int nTextLen,
+SalConverterCache::ConvertStringUTF16( const sal_Unicode *pText, int nTextLen,
sal_Char *pBuffer, sal_Size nBufferSize, rtl_TextEncoding nEncoding )
{
rtl_UnicodeToTextConverter aConverter = GetU2TConverter(nEncoding);
@@ -328,10 +328,10 @@ SalConverterCache::ConvertStringUTF16( const sal_Unicode *pText, int nTextLen,
sal_uInt32 nCvtInfo;
sal_Size nCvtChars;
- rtl_UnicodeToTextContext aContext =
+ rtl_UnicodeToTextContext aContext =
rtl_createUnicodeToTextContext( aConverter );
- sal_Size nSize = rtl_convertUnicodeToText( aConverter, aContext,
+ sal_Size nSize = rtl_convertUnicodeToText( aConverter, aContext,
pText, nTextLen, pBuffer, nBufferSize,
nCvtFlags, &nCvtInfo, &nCvtChars );
diff --git a/vcl/unx/source/gdi/salcvt.hxx b/vcl/unx/source/gdi/salcvt.hxx
index 0c4b1bd3f953..7689ffeedd94 100644
--- a/vcl/unx/source/gdi/salcvt.hxx
+++ b/vcl/unx/source/gdi/salcvt.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,40 +34,40 @@
#include <map>
-extern "C" const char*
+extern "C" const char*
pGetEncodingName( rtl_TextEncoding nEncoding );
//
// Cache TextToUnicode and UnicodeToText converter and conversion info which is
// used in DrawXYZ routines and in the Event loop
-//
+//
class SalConverterCache {
public:
SalConverterCache();
~SalConverterCache();
- Bool EncodingHasChar(
+ Bool EncodingHasChar(
rtl_TextEncoding nEncoding, sal_Unicode nChar );
- rtl_UnicodeToTextConverter
+ rtl_UnicodeToTextConverter
GetU2TConverter( rtl_TextEncoding nEncoding );
- rtl_TextToUnicodeConverter
+ rtl_TextToUnicodeConverter
GetT2UConverter( rtl_TextEncoding nEncoding );
- Bool IsSingleByteEncoding( rtl_TextEncoding nEncoding );
- sal_Size ConvertStringUTF16( const sal_Unicode *pText, int nTextLen,
- sal_Char *pBuffer, sal_Size nBufferSize,
+ Bool IsSingleByteEncoding( rtl_TextEncoding nEncoding );
+ sal_Size ConvertStringUTF16( const sal_Unicode *pText, int nTextLen,
+ sal_Char *pBuffer, sal_Size nBufferSize,
rtl_TextEncoding nEncoding);
- static SalConverterCache*
- GetInstance ();
+ static SalConverterCache*
+ GetInstance ();
private:
struct ConverterT {
- rtl_UnicodeToTextConverter mpU2T;
- rtl_TextToUnicodeConverter mpT2U;
- Bool mbSingleByteEncoding;
- Bool mbValid;
+ rtl_UnicodeToTextConverter mpU2T;
+ rtl_TextToUnicodeConverter mpT2U;
+ Bool mbSingleByteEncoding;
+ Bool mbValid;
ConverterT() :
mpU2T( NULL ),
mpT2U( NULL ),
@@ -84,7 +84,7 @@ class SalConverterCache {
}
};
- std::map< rtl_TextEncoding, ConverterT > m_aConverters;
+ std::map< rtl_TextEncoding, ConverterT > m_aConverters;
};
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 044c5b950d54..2b803a206881 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,7 +41,6 @@
#include "vcl/printergfx.hxx"
#include "vcl/jobdata.hxx"
-#include "vcl/region.h"
#include "tools/debug.hxx"
@@ -66,24 +65,24 @@
class SalPolyLine
{
- XPoint Points_[STATIC_POINTS];
- XPoint *pFirst_;
+ XPoint Points_[STATIC_POINTS];
+ XPoint *pFirst_;
public:
- inline SalPolyLine( sal_uLong nPoints );
- inline SalPolyLine( sal_uLong nPoints, const SalPoint *p );
- inline ~SalPolyLine();
- inline XPoint &operator [] ( sal_uLong n ) const
+ inline SalPolyLine( ULONG nPoints );
+ inline SalPolyLine( ULONG nPoints, const SalPoint *p );
+ inline ~SalPolyLine();
+ inline XPoint &operator [] ( ULONG n ) const
{ return pFirst_[n]; }
};
-inline SalPolyLine::SalPolyLine( sal_uLong nPoints )
+inline SalPolyLine::SalPolyLine( ULONG nPoints )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{}
-inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p )
+inline SalPolyLine::SalPolyLine( ULONG nPoints, const SalPoint *p )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{
- for( sal_uLong i = 0; i < nPoints; i++ )
+ for( ULONG i = 0; i < nPoints; i++ )
{
pFirst_[i].x = (short)p[i].mnX;
pFirst_[i].y = (short)p[i].mnY;
@@ -99,60 +98,63 @@ inline SalPolyLine::~SalPolyLine()
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
X11SalGraphics::X11SalGraphics()
{
- m_pFrame = NULL;
- m_pVDev = NULL;
- m_pDeleteColormap = NULL;
- hDrawable_ = None;
+ m_pFrame = NULL;
+ m_pVDev = NULL;
+ m_pDeleteColormap = NULL;
+ hDrawable_ = None;
m_aXRenderPicture = 0;
m_pXRenderFormat = NULL;
- mpClipRegion = NULL;
- pPaintRegion_ = NULL;
+ pClipRegion_ = NULL;
+ pPaintRegion_ = NULL;
- pPenGC_ = NULL;
- nPenPixel_ = 0;
- nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
+ pPenGC_ = NULL;
+ nPenPixel_ = 0;
+ nPenColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
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
+ nTextPixel_ = 0;
+ nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
#ifdef ENABLE_GRAPHITE
// check if graphite fonts have been disabled
static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" );
- bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : sal_False;
+ bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : FALSE;
#endif
- pBrushGC_ = NULL;
- nBrushPixel_ = 0;
- nBrushColor_ = MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ); // White
- hBrush_ = None;
-
- pMonoGC_ = NULL;
- pCopyGC_ = NULL;
- pMaskGC_ = NULL;
- pInvertGC_ = NULL;
- pInvert50GC_ = NULL;
- pStippleGC_ = NULL;
- pTrackingGC_ = NULL;
-
- 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;
+ pBrushGC_ = NULL;
+ nBrushPixel_ = 0;
+ nBrushColor_ = MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ); // White
+ hBrush_ = None;
+
+ pMonoGC_ = NULL;
+ pCopyGC_ = NULL;
+ pMaskGC_ = NULL;
+ pInvertGC_ = NULL;
+ pInvert50GC_ = NULL;
+ 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;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -167,21 +169,21 @@ X11SalGraphics::~X11SalGraphics()
void X11SalGraphics::freeResources()
{
Display *pDisplay = GetXDisplay();
-
+
DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" );
- if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None;
-
- if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
- if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
- if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None;
- if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None;
- if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None;
- if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None;
- if( pMaskGC_ ) XFreeGC( pDisplay, pMaskGC_ ), pMaskGC_ = None;
- if( pInvertGC_ ) XFreeGC( pDisplay, pInvertGC_ ), pInvertGC_ = None;
- if( pInvert50GC_ ) XFreeGC( pDisplay, pInvert50GC_ ), pInvert50GC_ = None;
- if( pStippleGC_ ) XFreeGC( pDisplay, pStippleGC_ ), pStippleGC_ = None;
- if( pTrackingGC_ ) XFreeGC( pDisplay, pTrackingGC_ ), pTrackingGC_ = None;
+ if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None;
+
+ if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
+ if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
+ if( pFontGC_ ) XFreeGC( pDisplay, pFontGC_ ), pFontGC_ = None;
+ if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None;
+ if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None;
+ if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None;
+ if( pMaskGC_ ) XFreeGC( pDisplay, pMaskGC_ ), pMaskGC_ = None;
+ if( pInvertGC_ ) XFreeGC( pDisplay, pInvertGC_ ), pInvertGC_ = None;
+ if( pInvert50GC_ ) XFreeGC( pDisplay, pInvert50GC_ ), pInvert50GC_ = None;
+ if( pStippleGC_ ) XFreeGC( pDisplay, pStippleGC_ ), pStippleGC_ = None;
+ if( pTrackingGC_ ) XFreeGC( pDisplay, pTrackingGC_ ), pTrackingGC_ = None;
if( m_pDeleteColormap )
delete m_pDeleteColormap, m_pColormap = m_pDeleteColormap = NULL;
@@ -215,22 +217,22 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen )
if( hDrawable_ )
{
- nPenPixel_ = GetPixel( nPenColor_ );
- nTextPixel_ = GetPixel( nTextColor_ );
- nBrushPixel_ = GetPixel( nBrushColor_ );
+ nPenPixel_ = GetPixel( nPenColor_ );
+ nTextPixel_ = GetPixel( nTextColor_ );
+ nBrushPixel_ = GetPixel( nBrushColor_ );
}
}
void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen )
{
- m_pColormap = &GetX11SalData()->GetDisplay()->GetColormap(nScreen);
+ m_pColormap = &GetX11SalData()->GetDisplay()->GetColormap(nScreen);
m_nScreen = nScreen;
SetDrawable( aTarget, nScreen );
- bWindow_ = sal_True;
- m_pFrame = pFrame;
- m_pVDev = NULL;
+ bWindow_ = TRUE;
+ m_pFrame = pFrame;
+ m_pVDev = NULL;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -247,8 +249,10 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
int n = 0;
XLIB_Region Regions[3];
- if( mpClipRegion )
- Regions[n++] = mpClipRegion;
+ if( pClipRegion_ /* && !XEmptyRegion( pClipRegion_ ) */ )
+ Regions[n++] = pClipRegion_;
+// if( pPaintRegion_ /* && !XEmptyRegion( pPaintRegion_ ) */ )
+// Regions[n++] = pPaintRegion_;
if( pXReg && !XEmptyRegion( pXReg ) )
Regions[n++] = pXReg;
@@ -261,7 +265,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
{
XLIB_Region pTmpRegion = XCreateRegion();
XIntersectRegion( Regions[0], Regions[1], pTmpRegion );
-
+// if( 3 == n )
+// XIntersectRegion( Regions[2], pTmpRegion, pTmpRegion );
XSetRegion( pDisplay, pGC, pTmpRegion );
XDestroyRegion( pTmpRegion );
}
@@ -275,9 +280,9 @@ GC X11SalGraphics::SelectPen()
if( !pPenGC_ )
{
XGCValues values;
- values.subwindow_mode = ClipByChildren;
- values.fill_rule = EvenOddRule; // Pict import/ Gradient
- values.graphics_exposures = False;
+ values.subwindow_mode = ClipByChildren;
+ values.fill_rule = EvenOddRule; // Pict import/ Gradient
+ values.graphics_exposures = False;
pPenGC_ = XCreateGC( pDisplay, hDrawable_,
GCSubwindowMode | GCFillRule | GCGraphicsExposures,
@@ -290,7 +295,7 @@ GC X11SalGraphics::SelectPen()
XSetForeground( pDisplay, pPenGC_, nPenPixel_ );
XSetFunction ( pDisplay, pPenGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pPenGC_ );
- bPenGC_ = sal_True;
+ bPenGC_ = TRUE;
}
return pPenGC_;
@@ -306,9 +311,10 @@ GC X11SalGraphics::SelectBrush()
if( !pBrushGC_ )
{
XGCValues values;
- values.subwindow_mode = ClipByChildren;
- values.fill_rule = EvenOddRule; // Pict import/ Gradient
- values.graphics_exposures = False;
+ // values.subwindow_mode = IncludeInferiors;
+ values.subwindow_mode = ClipByChildren;
+ values.fill_rule = EvenOddRule; // Pict import/ Gradient
+ values.graphics_exposures = False;
pBrushGC_ = XCreateGC( pDisplay, hDrawable_,
GCSubwindowMode | GCFillRule | GCGraphicsExposures,
@@ -321,8 +327,13 @@ 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
{
@@ -337,7 +348,7 @@ GC X11SalGraphics::SelectBrush()
XSetFunction ( pDisplay, pBrushGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pBrushGC_ );
- bBrushGC_ = sal_True;
+ bBrushGC_ = TRUE;
}
return pBrushGC_;
@@ -357,7 +368,7 @@ GC X11SalGraphics::GetTrackingGC()
^ m_pColormap->GetWhitePixel();
values.function = GXxor;
values.line_width = 1;
- values.line_style = LineOnOffDash;
+ values.line_style = LineOnOffDash;
pTrackingGC_ = XCreateGC( GetXDisplay(), GetDrawable(),
GCGraphicsExposures | GCForeground | GCFunction
@@ -369,26 +380,26 @@ GC X11SalGraphics::GetTrackingGC()
if( !bTrackingGC_ )
{
SetClipRegion( pTrackingGC_ );
- bTrackingGC_ = sal_True;
+ bTrackingGC_ = TRUE;
}
return pTrackingGC_;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::DrawLines( sal_uLong nPoints,
+void X11SalGraphics::DrawLines( ULONG nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
)
{
// errechne wie viele Linien XWindow auf einmal zeichnen kann
- sal_uLong nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
+ ULONG nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
/ sizeof(xPoint);
if( nMaxLines > nPoints ) nMaxLines = nPoints;
// gebe alle Linien aus, die XWindows zeichnen kann.
- sal_uLong n;
+ ULONG n;
for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 )
XDrawLines( GetXDisplay(),
GetDrawable(),
@@ -413,8 +424,8 @@ void X11SalGraphics::DrawLines( sal_uLong nPoints,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Dithern: Calculate a dither-pixmap and make a brush of it
-#define P_DELTA 51
-#define DMAP( v, m ) ((v % P_DELTA) > m ? (v / P_DELTA) + 1 : (v / P_DELTA))
+#define P_DELTA 51
+#define DMAP( v, m ) ((v % P_DELTA) > m ? (v / P_DELTA) + 1 : (v / P_DELTA))
BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
{
@@ -432,24 +443,24 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
// test for correct depth (8bit)
if( GetColormap().GetVisual().GetDepth() != 8 )
- return sal_False;
+ return FALSE;
char pBits[64];
char *pBitsPtr = pBits;
// Set the pallette-entries for the dithering tile
- sal_uInt8 nSalColorRed = SALCOLOR_RED ( nSalColor );
- sal_uInt8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
- sal_uInt8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
+ UINT8 nSalColorRed = SALCOLOR_RED ( nSalColor );
+ UINT8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
+ UINT8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
for( int nY = 0; nY < 8; nY++ )
{
for( int nX = 0; nX < 8; nX++ )
{
short nMagic = nOrdDither8Bit[nY][nX];
- sal_uInt8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
- sal_uInt8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
- sal_uInt8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
+ UINT8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
+ UINT8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
+ UINT8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
*pBitsPtr++ = GetColormap().GetPixel( MAKE_SALCOLOR( nR, nG, nB ) );
}
@@ -460,11 +471,11 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
GetColormap().GetXVisual(),
8,
ZPixmap,
- 0, // offset
- pBits, // data
- 8, 8, // width & height
- 8, // bitmap_pad
- 0 ); // (default) bytes_per_line
+ 0, // offset
+ pBits, // data
+ 8, 8, // width & height
+ 8, // bitmap_pad
+ 0 ); // (default) bytes_per_line
if ( GetDisplay()->GetProperties() & PROPERTY_BUG_Tile )
{
@@ -481,22 +492,22 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
hBrush_,
GetDisplay()->GetCopyGC( m_nScreen ),
pImage,
- 0, 0, // Source
- 0, 0, // Destination
- 8, 8 ); // width & height
+ 0, 0, // Source
+ 0, 0, // Destination
+ 8, 8 ); // width & height
// destroy image-frame but not palette-data
pImage->data = NULL;
XDestroyImage( pImage );
- return sal_True;
+ return TRUE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // const
{
const SalDisplay *pDisplay = GetDisplay();
-
+
rDPIX = pDisplay->GetResolution().A();
rDPIY = pDisplay->GetResolution().B();
if( !pDisplay->GetExactResolution() && rDPIY < 96 )
@@ -509,22 +520,25 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons
rDPIX = Divide( rDPIX * 200, rDPIY );
rDPIY = 200;
}
-
+
// #i12705# equalize x- and y-resolution if they are close enough
if( rDPIX != rDPIY )
{
// different x- and y- resolutions are usually artifacts of
- // a wrongly calculated screen size.
+ // a wrongly calculated screen size.
+ //if( (13*rDPIX >= 10*rDPIY) && (13*rDPIY >= 10*rDPIX) ) //+-30%
+ {
#ifdef DEBUG
- printf("Forcing Resolution from %" SAL_PRIdINT32 "x%" SAL_PRIdINT32 " to %" SAL_PRIdINT32 "x%" SAL_PRIdINT32 "\n",
- rDPIX,rDPIY,rDPIY,rDPIY);
+ printf("Forcing Resolution from %" SAL_PRIdINT32 "x%" SAL_PRIdINT32 " to %" SAL_PRIdINT32 "x%" SAL_PRIdINT32 "\n",
+ rDPIX,rDPIY,rDPIY,rDPIY);
#endif
- rDPIX = rDPIY; // y-resolution is more trustworthy
+ rDPIX = rDPIY; // y-resolution is more trustworthy
+ }
}
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_uInt16 X11SalGraphics::GetBitCount() const
+USHORT X11SalGraphics::GetBitCount() // const
{
return GetVisual().GetDepth();
}
@@ -554,64 +568,73 @@ long X11SalGraphics::GetGraphicsHeight() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::ResetClipRegion()
{
- if( mpClipRegion )
+ if( pClipRegion_ )
{
- 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;
+ bPenGC_ = FALSE;
+ bFontGC_ = FALSE;
+ bBrushGC_ = FALSE;
+ bMonoGC_ = FALSE;
+ bCopyGC_ = FALSE;
+ bInvertGC_ = FALSE;
+ bInvert50GC_ = FALSE;
+ bStippleGC_ = FALSE;
+ bTrackingGC_ = FALSE;
+
+ XDestroyRegion( pClipRegion_ );
+ pClipRegion_ = NULL;
}
}
-bool X11SalGraphics::setClipRegion( const Region& i_rClip )
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+void X11SalGraphics::BeginSetClipRegion( ULONG )
{
- 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;
+ if( pClipRegion_ )
+ XDestroyRegion( pClipRegion_ );
+ pClipRegion_ = XCreateRegion();
+}
- XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion );
- }
- bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
- }
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
+{
+ 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;
+}
- // 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 ) )
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
+{
+ // TODO: implement and advertise OutDevSupport_B2DClip support
+ return false;
+}
+
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+void X11SalGraphics::EndSetClipRegion()
+{
+ bPenGC_ = FALSE;
+ bFontGC_ = FALSE;
+ bBrushGC_ = FALSE;
+ bMonoGC_ = FALSE;
+ bCopyGC_ = FALSE;
+ bInvertGC_ = FALSE;
+ bInvert50GC_ = FALSE;
+ bStippleGC_ = FALSE;
+ bTrackingGC_ = FALSE;
+
+ if( XEmptyRegion( pClipRegion_ ) )
{
- XDestroyRegion( mpClipRegion );
- mpClipRegion= NULL;
+ XDestroyRegion( pClipRegion_ );
+ pClipRegion_= NULL;
}
- return true;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -619,8 +642,8 @@ void X11SalGraphics::SetLineColor()
{
if( nPenColor_ != SALCOLOR_NONE )
{
- nPenColor_ = SALCOLOR_NONE;
- bPenGC_ = sal_False;
+ nPenColor_ = SALCOLOR_NONE;
+ bPenGC_ = FALSE;
}
}
@@ -629,9 +652,9 @@ void X11SalGraphics::SetLineColor( SalColor nSalColor )
{
if( nPenColor_ != nSalColor )
{
- nPenColor_ = nSalColor;
- nPenPixel_ = GetPixel( nSalColor );
- bPenGC_ = sal_False;
+ nPenColor_ = nSalColor;
+ nPenPixel_ = GetPixel( nSalColor );
+ bPenGC_ = FALSE;
}
}
@@ -640,9 +663,9 @@ void X11SalGraphics::SetFillColor()
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- bDitherBrush_ = sal_False;
- nBrushColor_ = SALCOLOR_NONE;
- bBrushGC_ = sal_False;
+ bDitherBrush_ = FALSE;
+ nBrushColor_ = SALCOLOR_NONE;
+ bBrushGC_ = FALSE;
}
}
@@ -651,9 +674,9 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
{
if( nBrushColor_ != nSalColor )
{
- bDitherBrush_ = sal_False;
- nBrushColor_ = nSalColor;
- nBrushPixel_ = GetPixel( nSalColor );
+ bDitherBrush_ = FALSE;
+ nBrushColor_ = nSalColor;
+ nBrushPixel_ = GetPixel( nSalColor );
if( TrueColor != GetColormap().GetVisual().GetClass()
&& GetColormap().GetColor( nBrushPixel_ ) != nBrushColor_
&& nSalColor != MAKE_SALCOLOR( 0x00, 0x00, 0x00 ) // black
@@ -673,7 +696,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0x00 ) // light brown
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ) )
bDitherBrush_ = GetDitherPixmap(nSalColor);
- bBrushGC_ = sal_False;
+ bBrushGC_ = FALSE;
}
}
@@ -692,8 +715,8 @@ void X11SalGraphics::SetROPLineColor( SalROPColor nROPColor )
nPenPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1;
break;
}
- nPenColor_ = GetColormap().GetColor( nPenPixel_ );
- bPenGC_ = sal_False;
+ nPenColor_ = GetColormap().GetColor( nPenPixel_ );
+ bPenGC_ = FALSE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -711,9 +734,9 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor )
nBrushPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1;
break;
}
- bDitherBrush_ = sal_False;
- nBrushColor_ = GetColormap().GetColor( nBrushPixel_ );
- bBrushGC_ = sal_False;
+ bDitherBrush_ = FALSE;
+ nBrushColor_ = GetColormap().GetColor( nBrushPixel_ );
+ bBrushGC_ = FALSE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -721,16 +744,15 @@ void X11SalGraphics::SetXORMode( bool bSet, bool )
{
if( !bXORMode_ == bSet )
{
- bXORMode_ = bSet;
- 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_ = bSet;
+ bPenGC_ = FALSE;
+ bBrushGC_ = FALSE;
+ bMonoGC_ = FALSE;
+ bCopyGC_ = FALSE;
+ bInvertGC_ = FALSE;
+ bInvert50GC_ = FALSE;
+ bStippleGC_ = FALSE;
+ bTrackingGC_ = FALSE;
}
}
@@ -746,7 +768,7 @@ void X11SalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
if( nSalColor != SALCOLOR_NONE )
{
Display *pDisplay = GetXDisplay();
-
+
if( (nPenColor_ == SALCOLOR_NONE) && !bPenGC_ )
{
SetLineColor( nSalColor );
@@ -757,12 +779,12 @@ void X11SalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
else
{
GC pGC = SelectPen();
-
+
if( nSalColor != nPenColor_ )
XSetForeground( pDisplay, pGC, GetPixel( nSalColor ) );
-
+
XDrawPoint( pDisplay, GetDrawable(), pGC, nX, nY );
-
+
if( nSalColor != nPenColor_ )
XSetForeground( pDisplay, pGC, nPenPixel_ );
}
@@ -806,28 +828,28 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
{
drawPolyLine( nPoints, pPtAry, false );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry, bool bClose )
+void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool bClose )
{
if( nPenColor_ != 0xFFFFFFFF )
{
SalPolyLine Points( nPoints, pPtAry );
-
+
DrawLines( nPoints, Points, SelectPen(), bClose );
}
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+void X11SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
{
if( nPoints == 0 )
return;
-
+
if( nPoints < 3 )
{
if( !bXORMode_ )
@@ -840,9 +862,9 @@ void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
}
return;
}
-
+
SalPolyLine Points( nPoints, pPtAry );
-
+
nPoints++;
/* WORKAROUND: some Xservers (Xorg, VIA chipset in this case)
@@ -876,29 +898,29 @@ void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
if( Points[i].x < 0 )
Points[i].x = 0;
}
- }
-
+ }
+
if( nBrushColor_ != SALCOLOR_NONE )
XFillPolygon( GetXDisplay(),
GetDrawable(),
SelectBrush(),
&Points[0], nPoints,
Complex, CoordModeOrigin );
-
+
if( nPenColor_ != 0xFFFFFFFF )
DrawLines( nPoints, Points, SelectPen(), true );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
- const sal_uInt32 *pPoints,
+void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
+ const sal_uInt32 *pPoints,
PCONSTSALPOINT *pPtAry )
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- sal_uInt32 i, n;
- XLIB_Region pXRegA = NULL;
-
+ ULONG i, n;
+ XLIB_Region pXRegA = NULL;
+
for( i = 0; i < nPoly; i++ ) {
n = pPoints[i];
SalPolyLine Points( n, pPtAry[i] );
@@ -914,39 +936,39 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
}
}
}
-
+
if( pXRegA )
{
XRectangle aXRect;
XClipBox( pXRegA, &aXRect );
-
+
GC pGC = SelectBrush();
SetClipRegion( pGC, pXRegA ); // ??? doppelt
XDestroyRegion( pXRegA );
- bBrushGC_ = sal_False;
-
+ bBrushGC_ = FALSE;
+
XFillRectangle( GetXDisplay(),
GetDrawable(),
pGC,
aXRect.x, aXRect.y, aXRect.width, aXRect.height );
}
}
-
+
if( nPenColor_ != SALCOLOR_NONE )
- for( sal_uInt32 i = 0; i < nPoly; i++ )
+ for( ULONG i = 0; i < nPoly; i++ )
drawPolyLine( pPoints[i], pPtAry[i], true );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolyLineBezier( ULONG, const SalPoint*, const BYTE* )
{
return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolygonBezier( ULONG, const SalPoint*, const BYTE* )
{
return sal_False;
}
@@ -961,12 +983,12 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::invert( sal_uLong nPoints,
+void X11SalGraphics::invert( ULONG nPoints,
const SalPoint* pPtAry,
SalInvert nFlags )
{
SalPolyLine Points ( nPoints, pPtAry );
-
+
GC pGC;
if( SAL_INVERT_50 & nFlags )
pGC = GetInvert50GC();
@@ -975,7 +997,7 @@ void X11SalGraphics::invert( sal_uLong nPoints,
pGC = GetTrackingGC();
else
pGC = GetInvertGC();
-
+
if( SAL_INVERT_TRACKFRAME & nFlags )
DrawLines ( nPoints, Points, pGC, true );
else
@@ -988,9 +1010,9 @@ void X11SalGraphics::invert( sal_uLong nPoints,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uLong )
+BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG )
{
- return sal_False;
+ return FALSE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1036,10 +1058,10 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const
aRes.nSize = sizeof(aRes);
aRes.pDisplay = GetXDisplay();
aRes.hDrawable = hDrawable_;
- aRes.pVisual = GetVisual().visual;
+ aRes.pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
aRes.nScreen = m_nScreen;
- aRes.nDepth = GetBitCount();
- aRes.aColormap = GetColormap().GetXColormap();
+ aRes.nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
+ aRes.aColormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
aRes.pXRenderFormat = m_pXRenderFormat;
return aRes;
}
@@ -1052,22 +1074,22 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly
// nothing to do for empty polypolygons
const int nOrigPolyCount = rOrigPolyPoly.count();
if( nOrigPolyCount <= 0 )
- return sal_True;
+ return TRUE;
// nothing to do if everything is transparent
if( (nBrushColor_ == SALCOLOR_NONE)
&& (nPenColor_ == SALCOLOR_NONE) )
- return sal_True;
+ return TRUE;
// cannot handle pencolor!=brushcolor yet
if( (nPenColor_ != SALCOLOR_NONE)
&& (nPenColor_ != nBrushColor_) )
- return sal_False;
+ return FALSE;
// TODO: remove the env-variable when no longer needed
static const char* pRenderEnv = getenv( "SAL_DISABLE_RENDER_POLY" );
if( pRenderEnv )
- return sal_False;
+ return FALSE;
// snap to raster if requested
basegfx::B2DPolyPolygon aPolyPoly = rOrigPolyPoly;
@@ -1150,8 +1172,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
// set clipping
// TODO: move into GetXRenderPicture?
- if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
+ if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
// render the trapezoids
const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
@@ -1190,7 +1212,6 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
aPolygon.transform( basegfx::tools::createTranslateB2DHomMatrix(+fHalfWidth,+fHalfWidth) );
// shortcut for hairline drawing to improve performance
- bool bDrawnOk = true;
if( bIsHairline )
{
// hairlines can benefit from a simplified tesselation
@@ -1200,12 +1221,13 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
// draw tesselation result
const int nTrapCount = aB2DTrapVector.size();
- if( nTrapCount > 0 )
- bDrawnOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
+ if( !nTrapCount )
+ return true;
+ const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
// restore the original brush GC
nBrushColor_ = aKeepBrushColor;
- return bDrawnOk;
+ return bDrawOk;
}
// get the area polygon for the line polygon
@@ -1228,18 +1250,19 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
// draw each area polypolygon component individually
// to emulate the polypolygon winding rule "non-zero"
+ bool bDrawOk = true;
const int nPolyCount = aAreaPolyPoly.count();
for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
{
const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) );
- bDrawnOk = drawPolyPolygon( aOnePoly, fTransparency );
- if( !bDrawnOk )
+ bDrawOk = drawPolyPolygon( aOnePoly, fTransparency );
+ if( !bDrawOk )
break;
}
// restore the original brush GC
nBrushColor_ = aKeepBrushColor;
- return bDrawnOk;
+ return bDrawOk;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index a2736cf5c5f9..7ce8c39836d5 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,6 @@
#include "vcl/salbtype.hxx"
#include "vcl/printergfx.hxx"
#include "vcl/bmpacc.hxx"
-#include "vcl/outdata.hxx"
#undef SALGDI2_TESTTRANS
@@ -54,12 +53,12 @@
// -----------------------------------------------------------------------------
#if (OSL_DEBUG_LEVEL > 1) && defined SALGDI2_TESTTRANS
-#define DBG_TESTTRANS( _def_drawable ) \
-{ \
- XCopyArea( pXDisp, _def_drawable, aDrawable, GetCopyGC(), \
- 0, 0, \
- pPosAry->mnDestWidth, pPosAry->mnDestHeight, \
- 0, 0 ); \
+#define DBG_TESTTRANS( _def_drawable ) \
+{ \
+ XCopyArea( pXDisp, _def_drawable, aDrawable, GetCopyGC(), \
+ 0, 0, \
+ pPosAry->mnDestWidth, pPosAry->mnDestHeight, \
+ 0, 0 ); \
}
#else // (OSL_DEBUG_LEVEL > 1) && defined SALGDI2_TESTTRANS
#define DBG_TESTTRANS( _def_drawable )
@@ -116,14 +115,14 @@ GC X11SalGraphics::CreateGC( Drawable hDrawable, unsigned long nMask )
{
XGCValues values;
- values.graphics_exposures = False;
- values.foreground = m_pColormap->GetBlackPixel()
+ values.graphics_exposures = False;
+ values.foreground = m_pColormap->GetBlackPixel()
^ m_pColormap->GetWhitePixel();
- values.function = GXxor;
- values.line_width = 1;
- values.fill_style = FillStippled;
- values.stipple = GetDisplay()->GetInvert50( m_nScreen );
- values.subwindow_mode = ClipByChildren;
+ values.function = GXxor;
+ values.line_width = 1;
+ values.fill_style = FillStippled;
+ values.stipple = GetDisplay()->GetInvert50( m_nScreen );
+ values.subwindow_mode = ClipByChildren;
return XCreateGC( GetXDisplay(), hDrawable, nMask | GCSubwindowMode, &values );
}
@@ -137,7 +136,7 @@ inline GC X11SalGraphics::GetMonoGC( Pixmap hPixmap )
if( !bMonoGC_ )
{
SetClipRegion( pMonoGC_ );
- bMonoGC_ = sal_True;
+ bMonoGC_ = TRUE;
}
return pMonoGC_;
@@ -154,7 +153,7 @@ inline GC X11SalGraphics::GetCopyGC()
if( !bCopyGC_ )
{
SetClipRegion( pCopyGC_ );
- bCopyGC_ = sal_True;
+ bCopyGC_ = TRUE;
}
return pCopyGC_;
}
@@ -172,7 +171,7 @@ GC X11SalGraphics::GetInvertGC()
if( !bInvertGC_ )
{
SetClipRegion( pInvertGC_ );
- bInvertGC_ = sal_True;
+ bInvertGC_ = TRUE;
}
return pInvertGC_;
}
@@ -184,12 +183,12 @@ GC X11SalGraphics::GetInvert50GC()
{
XGCValues values;
- values.graphics_exposures = False;
- values.foreground = m_pColormap->GetWhitePixel();
- values.background = m_pColormap->GetBlackPixel();
- values.function = GXinvert;
- values.line_width = 1;
- values.line_style = LineSolid;
+ values.graphics_exposures = False;
+ values.foreground = m_pColormap->GetWhitePixel();
+ values.background = m_pColormap->GetBlackPixel();
+ values.function = GXinvert;
+ values.line_width = 1;
+ values.line_style = LineSolid;
unsigned long nValueMask =
GCGraphicsExposures
| GCForeground
@@ -208,8 +207,8 @@ GC X11SalGraphics::GetInvert50GC()
}
else
{
- values.fill_style = FillStippled;
- values.stipple = GetDisplay()->GetInvert50( m_nScreen );
+ values.fill_style = FillStippled;
+ values.stipple = GetDisplay()->GetInvert50( m_nScreen );
}
pInvert50GC_ = XCreateGC( GetXDisplay(), GetDrawable(),
@@ -220,7 +219,7 @@ GC X11SalGraphics::GetInvert50GC()
if( !bInvert50GC_ )
{
SetClipRegion( pInvert50GC_ );
- bInvert50GC_ = sal_True;
+ bInvert50GC_ = TRUE;
}
return pInvert50GC_;
}
@@ -238,7 +237,7 @@ inline GC X11SalGraphics::GetStippleGC()
{
XSetFunction( GetXDisplay(), pStippleGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pStippleGC_ );
- bStippleGC_ = sal_True;
+ bStippleGC_ = TRUE;
}
return pStippleGC_;
@@ -295,8 +294,8 @@ int X11SalGraphics::Clip( int &nX,
&& RectangleOut == Clip( pPaintRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
- if( mpClipRegion
- && RectangleOut == Clip( mpClipRegion, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
+ if( pClipRegion_
+ && RectangleOut == Clip( pClipRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
int nPaint;
@@ -310,9 +309,9 @@ int X11SalGraphics::Clip( int &nX,
nPaint = RectangleIn;
int nClip;
- if( mpClipRegion )
+ if( pClipRegion_ )
{
- nClip = XRectInRegion( mpClipRegion, nX, nY, nDX, nDY );
+ nClip = XRectInRegion( pClipRegion_, nX, nY, nDX, nDY );
if( RectangleOut == nClip )
return RectangleOut;
}
@@ -350,7 +349,7 @@ GC X11SalGraphics::SetMask( int &nX,
}
// - - - - create alternate clip pixmap for region clipping - - - -
- Pixmap hPixmap = XCreatePixmap( pDisplay, hClipMask, nDX, nDY, 1 );
+ Pixmap hPixmap = XCreatePixmap( pDisplay, hClipMask, nDX, nDY, 1 );
if( !hPixmap )
{
@@ -371,12 +370,12 @@ GC X11SalGraphics::SetMask( int &nX,
GC pMonoGC = GetMonoGC( hPixmap );
XSetClipOrigin( pDisplay, pMonoGC, -nX, -nY );
XCopyArea( pDisplay,
- hClipMask, // Source
- hPixmap, // Destination
+ hClipMask, // Source
+ hPixmap, // Destination
pMonoGC,
- nSrcX, nSrcY, // Source
- nDX, nDY, // Width & Height
- 0, 0 ); // Destination
+ nSrcX, nSrcY, // Source
+ nDX, nDY, // Width & Height
+ 0, 0 ); // Destination
XSetClipMask( pDisplay, pMaskGC_, hPixmap );
XSetClipOrigin( pDisplay, pMaskGC_, nX, nY );
@@ -388,7 +387,7 @@ GC X11SalGraphics::SetMask( int &nX,
// -=-= SalGraphics =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-extern "C"
+extern "C"
{
static Bool GraphicsExposePredicate( Display*, XEvent* pEvent, XPointer pFrameWindow )
{
@@ -447,12 +446,12 @@ void X11SalGraphics::YieldGraphicsExpose()
}
void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
- SalGraphics *pSSrcGraphics )
+ SalGraphics *pSSrcGraphics )
{
X11SalGraphics* pSrcGraphics = pSSrcGraphics
? static_cast<X11SalGraphics*>(pSSrcGraphics)
: this;
-
+
if( pPosAry->mnSrcWidth <= 0
|| pPosAry->mnSrcHeight <= 0
|| pPosAry->mnDestWidth <= 0
@@ -460,7 +459,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
{
return;
}
-
+
int n;
if( pSrcGraphics == this )
{
@@ -487,9 +486,9 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
}
else
n = 0;
-
+
if( n == 2
- && pPosAry->mnSrcWidth == pPosAry->mnDestWidth
+ && pPosAry->mnSrcWidth == pPosAry->mnDestWidth
&& pPosAry->mnSrcHeight == pPosAry->mnDestHeight
)
{
@@ -497,7 +496,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
// obscured areas beneath overlapping windows), src and dest
// are the same window.
const bool bNeedGraphicsExposures( pSrcGraphics == this &&
- !bVirDev_ &&
+ !bVirDev_ &&
pSrcGraphics->bWindow_ );
GC pCopyGC;
@@ -507,7 +506,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
&& (GetDisplay()->GetProperties() & PROPERTY_BUG_XCopyArea_GXxor) )
{
Pixmap hPixmap = XCreatePixmap( GetXDisplay(),
- pSrcGraphics->GetDrawable(), // source
+ pSrcGraphics->GetDrawable(), // source
pPosAry->mnSrcWidth, pPosAry->mnSrcHeight,
pSrcGraphics->GetBitCount() );
@@ -519,17 +518,17 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
True );
XCopyArea( GetXDisplay(),
- pSrcGraphics->GetDrawable(), // source
- hPixmap, // destination
- pCopyGC, // no clipping
+ pSrcGraphics->GetDrawable(), // source
+ hPixmap, // destination
+ pCopyGC, // no clipping
pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcWidth, pPosAry->mnSrcHeight,
- 0, 0 ); // destination
+ 0, 0 ); // destination
XCopyArea( GetXDisplay(),
- hPixmap, // source
- GetDrawable(), // destination
- GetInvertGC(), // destination clipping
- 0, 0, // source
+ hPixmap, // source
+ GetDrawable(), // destination
+ GetInvertGC(), // destination clipping
+ 0, 0, // source
pPosAry->mnSrcWidth, pPosAry->mnSrcHeight,
pPosAry->mnDestX, pPosAry->mnDestY );
XFreePixmap( GetXDisplay(), hPixmap );
@@ -537,16 +536,16 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
else
{
pCopyGC = GetCopyGC();
-
+
if( bNeedGraphicsExposures )
XSetGraphicsExposures( GetXDisplay(),
pCopyGC,
True );
XCopyArea( GetXDisplay(),
- pSrcGraphics->GetDrawable(), // source
- GetDrawable(), // destination
- pCopyGC, // destination clipping
+ pSrcGraphics->GetDrawable(), // source
+ GetDrawable(), // destination
+ pCopyGC, // destination clipping
pPosAry->mnSrcX, pPosAry->mnSrcY,
pPosAry->mnSrcWidth, pPosAry->mnSrcHeight,
pPosAry->mnDestX, pPosAry->mnDestY );
@@ -571,18 +570,18 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
pPosAry->mnSrcY,
pPosAry->mnSrcWidth,
pPosAry->mnSrcHeight );
-
+
if( !pDDB )
{
stderr0( "SalGraphics::CopyBits !pSrcGraphics->GetBitmap()\n" );
return;
}
-
+
SalTwoRect aPosAry( *pPosAry );
-
- aPosAry.mnSrcX = 0, aPosAry.mnSrcY = 0;
+
+ aPosAry.mnSrcX = 0, aPosAry.mnSrcY = 0;
drawBitmap( &aPosAry, *pDDB );
-
+
delete pDDB;
}
else {
@@ -595,20 +594,20 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
void X11SalGraphics::copyArea ( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- sal_uInt16 )
+ USHORT )
{
SalTwoRect aPosAry;
-
+
aPosAry.mnDestX = nDestX;
aPosAry.mnDestY = nDestY;
aPosAry.mnDestWidth = nSrcWidth;
aPosAry.mnDestHeight = nSrcHeight;
-
+
aPosAry.mnSrcX = nSrcX;
aPosAry.mnSrcY = nSrcY;
aPosAry.mnSrcWidth = nSrcWidth;
aPosAry.mnSrcHeight = nSrcHeight;
-
+
copyBits ( &aPosAry, 0 );
}
@@ -616,39 +615,24 @@ void X11SalGraphics::copyArea ( long nDestX, long nDestY,
void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
{
const SalDisplay* pSalDisp = GetDisplay();
- Display* pXDisp = pSalDisp->GetDisplay();
- const Drawable aDrawable( GetDrawable() );
- const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen );
- const long nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
- GC aGC( GetCopyGC() );
- XGCValues aOldVal, aNewVal;
- int nValues = GCForeground | GCBackground;
-
+ Display* pXDisp = pSalDisp->GetDisplay();
+ const Drawable aDrawable( GetDrawable() );
+ const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen );
+ const long nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
+ GC aGC( GetCopyGC() );
+ XGCValues aOldVal, aNewVal;
+ int nValues = GCForeground | GCBackground;
+
if( rSalBitmap.GetBitCount() == 1 )
{
// set foreground/background values for 1Bit bitmaps
XGetGCValues( pXDisp, aGC, nValues, &aOldVal );
-
- aNewVal.foreground = rColMap.GetWhitePixel();
- aNewVal.background = rColMap.GetBlackPixel();
-
- //fdo#33455 handle 1 bit depth pngs with palette entries
- //to set fore/back colors
- if (const BitmapBuffer* pBitmapBuffer = const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(true))
- {
- const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
- if (rPalette.GetEntryCount() == 2)
- {
- aNewVal.foreground = rColMap.GetPixel(ImplColorToSal(rPalette[0]));
- aNewVal.background = rColMap.GetPixel(ImplColorToSal(rPalette[1]));
- }
- }
-
+ aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel();
XChangeGC( pXDisp, aGC, nValues, &aNewVal );
}
-
+
static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aDrawable, m_nScreen, nDepth, *pPosAry, aGC );
-
+
if( rSalBitmap.GetBitCount() == 1 )
XChangeGC( pXDisp, aGC, nValues, &aOldVal );
XFlush( pXDisp );
@@ -663,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( sal_True );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( TRUE );
if( pAlphaBuffer != NULL )
{
int nMaskFormat = pAlphaBuffer->mnFormat;
- const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, sal_True );
+ const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE );
if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap );
}
@@ -688,23 +672,23 @@ 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 sal_uInt16 nDepth( m_pVDev ?
+ const USHORT nDepth( m_pVDev ?
m_pVDev->GetDepth() :
pSalDisp->GetVisual( m_nScreen ).GetDepth() );
- Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
+ Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
pPosAry->mnDestHeight, nDepth ) );
- Pixmap aBG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
+ Pixmap aBG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
pPosAry->mnDestHeight, nDepth ) );
-
+
if( aFG && aBG )
{
- GC aTmpGC;
- XGCValues aValues;
- const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen );
- const int nBlack = rColMap.GetBlackPixel(), nWhite = rColMap.GetWhitePixel();
- const int nValues = GCFunction | GCForeground | GCBackground;
- SalTwoRect aTmpRect( *pPosAry ); aTmpRect.mnDestX = aTmpRect.mnDestY = 0;
-
+ GC aTmpGC;
+ XGCValues aValues;
+ const SalColormap& rColMap = pSalDisp->GetColormap( m_nScreen );
+ const int nBlack = rColMap.GetBlackPixel(), nWhite = rColMap.GetWhitePixel();
+ const int nValues = GCFunction | GCForeground | GCBackground;
+ SalTwoRect aTmpRect( *pPosAry ); aTmpRect.mnDestX = aTmpRect.mnDestY = 0;
+
// draw paint bitmap in pixmap #1
aValues.function = GXcopy, aValues.foreground = nWhite, aValues.background = nBlack;
aTmpGC = XCreateGC( pXDisp, aFG, nValues, &aValues );
@@ -718,14 +702,14 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
0, 0 );
DBG_TESTTRANS( aBG );
-
+
// mask out paint bitmap in pixmap #1 (transparent areas 0)
aValues.function = GXand, aValues.foreground = 0x00000000, aValues.background = 0xffffffff;
XChangeGC( pXDisp, aTmpGC, nValues, &aValues );
static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aFG, m_nScreen, 1, aTmpRect, aTmpGC );
-
+
DBG_TESTTRANS( aFG );
-
+
// #105055# For XOR mode, keep background behind bitmap intact
if( !bXORMode_ )
{
@@ -733,10 +717,10 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
aValues.function = GXand, aValues.foreground = 0xffffffff, aValues.background = 0x00000000;
XChangeGC( pXDisp, aTmpGC, nValues, &aValues );
static_cast<const X11SalBitmap&>(rTransBitmap).ImplDraw( aBG, m_nScreen, 1, aTmpRect, aTmpGC );
-
+
DBG_TESTTRANS( aBG );
}
-
+
// merge pixmap #1 and pixmap #2 in pixmap #2
aValues.function = GXxor, aValues.foreground = 0xffffffff, aValues.background = 0x00000000;
XChangeGC( pXDisp, aTmpGC, nValues, &aValues );
@@ -745,30 +729,30 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
pPosAry->mnDestWidth, pPosAry->mnDestHeight,
0, 0 );
DBG_TESTTRANS( aBG );
-
+
// #105055# Disable XOR temporarily
- sal_Bool bOldXORMode( bXORMode_ );
- bXORMode_ = sal_False;
-
+ BOOL bOldXORMode( bXORMode_ );
+ bXORMode_ = FALSE;
+
// copy pixmap #2 (result) to background
XCopyArea( pXDisp, aBG, aDrawable, GetCopyGC(),
0, 0,
pPosAry->mnDestWidth, pPosAry->mnDestHeight,
pPosAry->mnDestX, pPosAry->mnDestY );
-
+
DBG_TESTTRANS( aBG );
-
+
bXORMode_ = bOldXORMode;
-
+
XFreeGC( pXDisp, aTmpGC );
XFlush( pXDisp );
}
else
drawBitmap( pPosAry, rSalBitmap );
-
+
if( aFG )
XFreePixmap( pXDisp, aFG );
-
+
if( aBG )
XFreePixmap( pXDisp, aBG );
}
@@ -784,7 +768,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
// horizontal mirroring not implemented yet
if( rTR.mnDestWidth < 0 )
return false;
-
+
// stretched conversion is not implemented yet
if( rTR.mnDestWidth != rTR.mnSrcWidth )
return false;
@@ -836,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( sal_True );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( TRUE );
// an XImage needs its data top_down
// TODO: avoid wrongly oriented images in upper layers!
@@ -881,7 +865,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
if( pAlphaBits != (char*)pAlphaBuffer->mpBits )
delete[] pAlphaBits;
- const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, sal_True );
+ const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE );
XRenderPictureAttributes aAttr;
aAttr.repeat = true;
@@ -890,9 +874,9 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
return false;
// set clipping
- if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
- rPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
-
+ if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ rPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+
// paint source * mask over destination picture
rPeer.CompositePicture( PictOpOver, aSrcPic, aAlphaPic, aDstPic,
rTR.mnSrcX, rTR.mnSrcY, 0, 0,
@@ -906,29 +890,29 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
+bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
if( ! m_pFrame && ! m_pVDev )
return false;
-
+
if( bPenGC_ || !bBrushGC_ || bXORMode_ )
return false; // can only perform solid fills without XOR.
-
+
if( m_pVDev && m_pVDev->GetDepth() < 8 )
return false;
XRenderPeer& rPeer = XRenderPeer::GetInstance();
if( rPeer.GetVersion() < 0x02 ) // TODO: replace with better test
return false;
-
+
Picture aDstPic = GetXRenderPicture();
if( !aDstPic )
return false;
const double fTransparency = (100 - nTransparency) * (1.0/100);
const XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency);
-
+
rPeer.FillRectangle( PictOpOver,
aDstPic,
&aRenderColor,
@@ -943,7 +927,7 @@ void X11SalGraphics::drawBitmap( const SalTwoRect*,
const SalBitmap&,
SalColor )
{
- OSL_FAIL( "::DrawBitmap with transparent color not supported" );
+ DBG_ERROR( "::DrawBitmap with transparent color not supported" );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -952,30 +936,30 @@ void X11SalGraphics::drawMask( const SalTwoRect* pPosAry,
SalColor nMaskColor )
{
const SalDisplay* pSalDisp = GetDisplay();
- Display* pXDisp = pSalDisp->GetDisplay();
+ Display* pXDisp = pSalDisp->GetDisplay();
Drawable aDrawable( GetDrawable() );
Pixmap aStipple( XCreatePixmap( pXDisp, aDrawable,
pPosAry->mnDestWidth,
pPosAry->mnDestHeight, 1 ) );
-
+
if( aStipple )
{
- SalTwoRect aTwoRect( *pPosAry ); aTwoRect.mnDestX = aTwoRect.mnDestY = 0;
- GC aTmpGC;
- XGCValues aValues;
-
+ SalTwoRect aTwoRect( *pPosAry ); aTwoRect.mnDestX = aTwoRect.mnDestY = 0;
+ GC aTmpGC;
+ XGCValues aValues;
+
// create a stipple bitmap first (set bits are changed to unset bits and vice versa)
aValues.function = GXcopyInverted;
aValues.foreground = 1, aValues.background = 0;
aTmpGC = XCreateGC( pXDisp, aStipple, GCFunction | GCForeground | GCBackground, &aValues );
static_cast<const X11SalBitmap&>(rSalBitmap).ImplDraw( aStipple, m_nScreen, 1, aTwoRect, aTmpGC );
-
+
XFreeGC( pXDisp, aTmpGC );
-
+
// Set stipple and draw rectangle
- GC aStippleGC( GetStippleGC() );
- int nX = pPosAry->mnDestX, nY = pPosAry->mnDestY;
-
+ GC aStippleGC( GetStippleGC() );
+ int nX = pPosAry->mnDestX, nY = pPosAry->mnDestY;
+
XSetStipple( pXDisp, aStippleGC, aStipple );
XSetTSOrigin( pXDisp, aStippleGC, nX, nY );
XSetForeground( pXDisp, aStippleGC, GetPixel( nMaskColor ) );
@@ -994,7 +978,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
{
if( bPrinter_ && !bVirDev_ )
return NULL;
-
+
bool bFakeWindowBG = false;
// normalize
@@ -1010,9 +994,9 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
}
if( bWindow_ && !bVirDev_ )
- {
+ {
XWindowAttributes aAttrib;
-
+
XGetWindowAttributes( GetXDisplay(), GetDrawable(), &aAttrib );
if( aAttrib.map_state != IsViewable )
bFakeWindowBG = true;
@@ -1035,7 +1019,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
nDX = aAttrib.width - nX;
if( nY + nDY > aAttrib.height )
nDY = aAttrib.height - nY;
-
+
// inside ?
if( nDX <= 0 || nDY <= 0 )
{
@@ -1045,13 +1029,13 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
}
}
}
-
- X11SalBitmap* pSalBitmap = new X11SalBitmap;
- sal_uInt16 nBitCount = GetBitCount();
-
+
+ X11SalBitmap* pSalBitmap = new X11SalBitmap;
+ USHORT nBitCount = GetBitCount();
+
if( &GetDisplay()->GetColormap( m_nScreen ) != &GetColormap() )
nBitCount = 1;
-
+
if( ! bFakeWindowBG )
pSalBitmap->ImplCreateFromDrawable( GetDrawable(), m_nScreen, nBitCount, nX, nY, nDX, nDY );
else
@@ -1066,7 +1050,7 @@ SalColor X11SalGraphics::getPixel( long nX, long nY )
if( bWindow_ && !bVirDev_ )
{
XWindowAttributes aAttrib;
-
+
XGetWindowAttributes( GetXDisplay(), GetDrawable(), &aAttrib );
if( aAttrib.map_state != IsViewable )
{
@@ -1074,7 +1058,7 @@ SalColor X11SalGraphics::getPixel( long nX, long nY )
return 0;
}
}
-
+
XImage *pXImage = XGetImage( GetXDisplay(),
GetDrawable(),
nX, nY,
@@ -1086,21 +1070,21 @@ SalColor X11SalGraphics::getPixel( long nX, long nY )
stderr0( "X11SalGraphics::GetPixel !XGetImage()\n" );
return 0;
}
-
+
XColor aXColor;
-
+
aXColor.pixel = XGetPixel( pXImage, 0, 0 );
XDestroyImage( pXImage );
-
+
return GetColormap().GetColor( aXColor.pixel );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::invert( long nX,
- long nY,
- long nDX,
- long nDY,
- SalInvert nFlags )
+void X11SalGraphics::invert( long nX,
+ long nY,
+ long nDX,
+ long nDY,
+ SalInvert nFlags )
{
GC pGC;
if( SAL_INVERT_50 & nFlags )
@@ -1133,10 +1117,10 @@ bool X11SalGraphics::supportsOperation( OutDevSupportType eType ) const
{
XRenderPeer& rPeer = XRenderPeer::GetInstance();
if( rPeer.GetVersion() >= 0x02 )
- {
+ {
const SalDisplay* pSalDisp = GetDisplay();
const SalVisual& rSalVis = pSalDisp->GetVisual( m_nScreen );
-
+
Visual* pDstXVisual = rSalVis.GetVisual();
XRenderPictFormat* pDstVisFmt = rPeer.FindVisualFormat( pDstXVisual );
if( pDstVisFmt )
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 6d77f66662e4..767c91d8ecb3 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,7 +47,11 @@
#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"
@@ -74,7 +78,7 @@
#include "i18npool/mslangid.hxx"
-#include <boost/unordered_set.hpp>
+#include <hash_set>
#ifdef ENABLE_GRAPHITE
#include <vcl/graphite_layout.hxx>
@@ -107,7 +111,393 @@ struct _XRegion
BOX *rects;
BOX extents;
};
-using ::rtl::OUString;
+using namespace rtl;
+
+// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+// ----------------------------------------------------------------------------
+//
+// manage X11 fonts and self rastered fonts
+//
+// ----------------------------------------------------------------------------
+
+#ifndef _USE_PRINT_EXTENSION_
+
+class FontLookup
+{
+ public:
+
+ struct hash;
+ struct equal;
+ typedef ::std::hash_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( 64, 64, 16 ); // ???
+ }
+ else
+ {
+ ExtendedFontStruct *pItem;
+ for ( pItem = m_pFontCache->First();
+ pItem != NULL;
+ pItem = m_pFontCache->Next() )
+ {
+ if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) )
+ {
+ if( m_pFontCache->GetCurPos() )
+ {
+ m_pFontCache->Remove( pItem );
+ m_pFontCache->Insert( pItem, 0UL );
+ }
+ return pItem;
+ }
+ }
+ }
+
+ // before we expand the cache, we look for very old and unused items
+ if( m_pFontCache->Count() >= 64 )
+ {
+ ExtendedFontStruct *pItem;
+ for ( pItem = m_pFontCache->Last();
+ pItem != NULL;
+ pItem = m_pFontCache->Prev() )
+ {
+ if( 1 == pItem->GetRefCount() )
+ {
+ m_pFontCache->Remove( pItem );
+ pItem->ReleaseRef();
+ if( m_pFontCache->Count() < 64 )
+ break;
+ }
+ }
+ }
+
+ ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(),
+ rPixelSize, bVertical,
+ const_cast<ExtendedXlfd*>(pRequestedFont) );
+ m_pFontCache->Insert( pItem, 0UL );
+ pItem->AddRef();
+
+ return pItem;
+}
+
+// ---------------------------------------------------------------------------
+
+void
+SalDisplay::DestroyFontCache()
+{
+ if( m_pFontCache )
+ {
+ ExtendedFontStruct *pItem = m_pFontCache->First();
+ while( pItem )
+ {
+ delete pItem;
+ pItem = m_pFontCache->Next();
+ }
+ delete m_pFontCache;
+ }
+ 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#)
@@ -132,6 +522,8 @@ void PspKernInfo::Initialize() const
if( rKernPairs.empty() )
return;
+ // feed psprint's kerning list into a lookup-friendly container
+ maUnicodeKernPairs.resize( rKernPairs.size() );
PspKernPairs::const_iterator it = rKernPairs.begin();
for(; it != rKernPairs.end(); ++it )
{
@@ -147,27 +539,35 @@ void PspKernInfo::Initialize() const
// ----------------------------------------------------------------------------
GC
-X11SalGraphics::GetFontGC()
+X11SalGraphics::SelectFont()
{
Display *pDisplay = GetXDisplay();
if( !pFontGC_ )
{
XGCValues values;
- values.subwindow_mode = ClipByChildren;
- values.fill_rule = EvenOddRule; // Pict import/ Gradient
- values.graphics_exposures = False;
- values.foreground = nTextPixel_;
+ values.subwindow_mode = ClipByChildren;
+ 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_ = sal_True;
+ bFontGC_ = TRUE;
}
return pFontGC_;
@@ -177,9 +577,26 @@ X11SalGraphics::GetFontGC()
bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLevel )
{
+#ifdef HDU_DEBUG
+ ByteString aReqName( "NULL" );
+ if( pEntry )
+ aReqName = ByteString( pEntry->maName, RTL_TEXTENCODING_UTF8 );
+ ByteString aUseName( "NULL" );
+ if( pEntry && pEntry->mpFontData )
+ aUseName = ByteString( pEntry->mpFontData->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
+ fprintf( stderr, "SetFont(lvl=%d,\"%s\", %d*%d, naa=%d,b=%d,i=%d) => \"%s\"\n",
+ nFallbackLevel, aReqName.GetBuffer(),
+ !pEntry?-1:pEntry->mnWidth, !pEntry?-1:pEntry->mnHeight,
+ !pEntry?-1:pEntry->mbNonAntialiased,
+ !pEntry?-1:pEntry->meWeight, !pEntry?-1:pEntry->meItalic,
+ aUseName.GetBuffer() );
+#endif
+
// 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
@@ -198,6 +615,18 @@ 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 )
@@ -212,7 +641,7 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
// register to use the font
mpServerFont[ nFallbackLevel ] = pServerFont;
- // apply font specific-hint settings if needed
+ // apply font specific-hint settings if needed
// TODO: also disable it for reference devices
if( !bPrinter_ )
{
@@ -226,32 +655,110 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
return false;
}
-ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize);
-
void ImplServerFontEntry::HandleFontOptions( void )
{
+ bool GetFCFontOptions( const ImplFontAttributes&, int nSize, ImplFontOptions& );
+
if( !mpServerFont )
return;
if( !mbGotFontOptions )
{
// get and cache the font options
mbGotFontOptions = true;
- mpFontOptions.reset(GetFCFontOptions( *maFontSelData.mpFontData,
- maFontSelData.mnHeight ));
+ mbValidFontOptions = GetFCFontOptions( *maFontSelData.mpFontData,
+ maFontSelData.mnHeight, maFontOptions );
}
// apply the font options
- mpServerFont->SetFontOptions( mpFontOptions );
+ if( mbValidFontOptions )
+ mpServerFont->SetFontOptions( maFontOptions );
}
//--------------------------------------------------------------------------
+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
{
private:
oslModule mpCairoLib;
-
+
cairo_surface_t* (*mp_xlib_surface_create_with_xrender_format)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int );
void (*mp_surface_destroy)(cairo_surface_t *);
cairo_t* (*mp_create)(cairo_surface_t *);
@@ -259,7 +766,6 @@ private:
void (*mp_clip)(cairo_t*);
void (*mp_rectangle)(cairo_t*, double, double, double, double);
cairo_font_face_t * (*mp_ft_font_face_create_for_ft_face)(FT_Face, int);
- cairo_font_face_t * (*mp_ft_font_face_create_for_pattern)(void*);
void (*mp_set_font_face)(cairo_t *, cairo_font_face_t *);
void (*mp_font_face_destroy)(cairo_font_face_t *);
void (*mp_matrix_init_identity)(cairo_matrix_t *);
@@ -271,7 +777,7 @@ private:
void (*mp_set_font_options)(cairo_t *, const void *);
void (*mp_ft_font_options_substitute)(const void*, void*);
- bool canEmbolden() const { return mp_ft_font_face_create_for_pattern != NULL; }
+ bool canEmbolden() const { return false; }
CairoWrapper();
public:
@@ -285,16 +791,10 @@ public:
cairo_t* create(cairo_surface_t *surface) { return (*mp_create)(surface); }
void destroy(cairo_t *cr) { (*mp_destroy)(cr); }
void clip(cairo_t *cr) { (*mp_clip)(cr); }
- void rectangle(cairo_t *cr, double x, double y, double width, double height)
+ void rectangle(cairo_t *cr, double x, double y, double width, double height)
{ (*mp_rectangle)(cr, x, y, width, height); }
cairo_font_face_t* ft_font_face_create_for_ft_face(FT_Face face, int load_flags)
{ return (*mp_ft_font_face_create_for_ft_face)(face, load_flags); }
- cairo_font_face_t* ft_font_face_create_for_pattern(void *pattern)
- {
- return mp_ft_font_face_create_for_pattern
- ? (*mp_ft_font_face_create_for_pattern)(pattern)
- : NULL;
- }
void set_font_face(cairo_t *cr, cairo_font_face_t *font_face)
{ (*mp_set_font_face)(cr, font_face); }
void font_face_destroy(cairo_font_face_t *font_face)
@@ -332,7 +832,7 @@ CairoWrapper::CairoWrapper()
static const char* pDisableCairoText = getenv( "SAL_DISABLE_CAIROTEXT" );
if( pDisableCairoText && (pDisableCairoText[0] != '0') )
return;
-
+
int nDummy;
if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) )
return;
@@ -341,7 +841,7 @@ CairoWrapper::CairoWrapper()
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" ));
#else
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" ));
-#endif
+#endif
mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT );
if( !mpCairoLib )
return;
@@ -354,11 +854,11 @@ CairoWrapper::CairoWrapper()
fprintf( stderr, "CAIRO version=%d\n", nVersion );
#endif
- mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int ))
+ mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int ))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_xlib_surface_create_with_xrender_format" );
- mp_surface_destroy = (void(*)(cairo_surface_t*))
+ mp_surface_destroy = (void(*)(cairo_surface_t*))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" );
- mp_create = (cairo_t*(*)(cairo_surface_t*))
+ mp_create = (cairo_t*(*)(cairo_surface_t*))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" );
mp_destroy = (void(*)(cairo_t*))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" );
@@ -368,8 +868,6 @@ CairoWrapper::CairoWrapper()
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_rectangle" );
mp_ft_font_face_create_for_ft_face = (cairo_font_face_t * (*)(FT_Face, int))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_ft_face" );
- mp_ft_font_face_create_for_pattern = (cairo_font_face_t * (*)(void*))
- osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_pattern" );
mp_set_font_face = (void (*)(cairo_t *, cairo_font_face_t *))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_face" );
mp_font_face_destroy = (void (*)(cairo_font_face_t *))
@@ -391,7 +889,7 @@ CairoWrapper::CairoWrapper()
mp_ft_font_options_substitute = (void (*)(const void *, void *))
osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_options_substitute" );
- if( !(
+ if( !(
mp_xlib_surface_create_with_xrender_format &&
mp_surface_destroy &&
mp_create &&
@@ -447,9 +945,9 @@ CairoFontsCache::~CairoFontsCache()
}
}
-void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId)
+void CairoFontsCache::CacheFont(void *pFont, void* pId)
{
- maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );
+ maLRUFonts.push_front( std::pair<void*, void *>(pFont, pId) );
if (maLRUFonts.size() > 8)
{
CairoWrapper &rCairo = CairoWrapper::get();
@@ -458,11 +956,11 @@ void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId
}
}
-void* CairoFontsCache::FindCachedFont(const CairoFontsCache::CacheId &rId)
+void* CairoFontsCache::FindCachedFont(void *pId)
{
LRUFonts::iterator aEnd = maLRUFonts.end();
for (LRUFonts::iterator aI = maLRUFonts.begin(); aI != aEnd; ++aI)
- if (aI->second == rId)
+ if (aI->second == pId)
return aI->first;
return NULL;
}
@@ -471,7 +969,7 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
{
std::vector<cairo_glyph_t> cairo_glyphs;
cairo_glyphs.reserve( 256 );
-
+
Point aPos;
sal_GlyphId aGlyphId;
for( int nStart = 0; rLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
@@ -511,21 +1009,21 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
rCairo.set_font_options( cr, pOptions);
- if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
{
- for (long i = 0; i < mpClipRegion->numRects; ++i)
- {
- rCairo.rectangle(cr,
- mpClipRegion->rects[i].x1,
- mpClipRegion->rects[i].y1,
- mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
- mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
- }
+ for (long i = 0; i < pClipRegion_->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);
+ }
rCairo.clip(cr);
}
- rCairo.set_source_rgb(cr,
- SALCOLOR_RED(nTextColor_)/255.0,
+ rCairo.set_source_rgb(cr,
+ SALCOLOR_RED(nTextColor_)/255.0,
SALCOLOR_GREEN(nTextColor_)/255.0,
SALCOLOR_BLUE(nTextColor_)/255.0);
@@ -533,21 +1031,12 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
cairo_font_face_t* font_face = NULL;
- void* pFace = rFont.GetFtFace();
- CairoFontsCache::CacheId aId;
- aId.mpFace = pFace;
- aId.mpOptions = rFont.GetFontOptions().get();
- aId.mbEmbolden = rFont.NeedsArtificialBold();
- font_face = (cairo_font_face_t*)m_aCairoFontsCache.FindCachedFont(aId);
+ void *pId = rFont.GetFtFace();
+ font_face = (cairo_font_face_t*)m_aCairoFontsCache.FindCachedFont(pId);
if (!font_face)
{
- const ImplFontOptions *pOptions = rFont.GetFontOptions().get();
- void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden) : NULL;
- if (pPattern)
- font_face = rCairo.ft_font_face_create_for_pattern(pPattern);
- if (!font_face)
- font_face = rCairo.ft_font_face_create_for_ft_face(pFace, rFont.GetLoadFlags());
- m_aCairoFontsCache.CacheFont(font_face, aId);
+ font_face = rCairo.ft_font_face_create_for_ft_face(pId, rFont.GetLoadFlags());
+ m_aCairoFontsCache.CacheFont(font_face, pId);
}
rCairo.set_font_face(cr, font_face);
@@ -610,11 +1099,11 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout )
// set font foreground color and opacity
XRenderColor aRenderColor = GetXRenderColor( nTextColor_ );
rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 );
-
+
// set clipping
// TODO: move into GetXRenderPicture()?
- if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
+ if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
ServerFont& rFont = rLayout.GetServerFont();
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
@@ -697,10 +1186,10 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
else if( m_pVDev )
nWidth = m_pVDev->GetWidth(), nHeight = m_pVDev->GetHeight();
- if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
{
// get bounding box
- XClipBox( mpClipRegion, &aXRect );
+ XClipBox( pClipRegion_, &aXRect );
// clip with window
if( aXRect.x < 0 ) aXRect.x = 0;
@@ -793,7 +1282,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
}
// prepare context
- GC nGC = GetFontGC();
+ GC nGC = SelectFont();
XGCValues aGCVal;
XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal );
@@ -880,7 +1369,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
Display* pDisplay = GetXDisplay();
- GC nGC = GetFontGC();
+ GC nGC = SelectFont();
XGCValues aGCVal;
aGCVal.fill_style = FillStippled;
@@ -943,20 +1432,71 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
//--------------------------------------------------------------------------
-const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
+void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
+ const Point& rPoint, const sal_Unicode* pStr, int nLength )
{
- if( !mpServerFont[0] )
- return NULL;
+ 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;
+ }
- const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
- return pIFCMap;
+ XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem );
+ }
}
-bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFontCapabilities) const
+//--------------------------------------------------------------------------
+
+ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
{
- if (!mpServerFont[0])
- return false;
- return mpServerFont[0]->GetFontCapabilities(rGetImplFontCapabilities);
+ // TODO: get ImplFontCharMap directly from fonts
+ if( !mpServerFont[0] )
+ return NULL;
+
+ CmapResult aCmapResult;
+ if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) )
+ return NULL;
+ return new ImplFontCharMap( aCmapResult );
}
// ----------------------------------------------------------------------------
@@ -965,9 +1505,9 @@ bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFont
//
// ----------------------------------------------------------------------------
-sal_uInt16 X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+USHORT X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
- sal_uInt16 nRetVal = 0;
+ USHORT nRetVal = 0;
if( !setFont( pEntry, nFallbackLevel ) )
nRetVal |= SAL_SETFONT_BADFONT;
if( bPrinter_ || (mpServerFont[ nFallbackLevel ] != NULL) )
@@ -980,11 +1520,11 @@ sal_uInt16 X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLev
void
X11SalGraphics::SetTextColor( SalColor nSalColor )
{
- if( nTextColor_ != nSalColor )
+ if( nTextColor_ != nSalColor )
{
nTextColor_ = nSalColor;
nTextPixel_ = GetPixel( nSalColor );
- bFontGC_ = sal_False;
+ bFontGC_ = FALSE;
}
}
@@ -1031,6 +1571,15 @@ 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();
@@ -1073,7 +1622,7 @@ void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
// register platform specific font substitutions if available
if( rMgr.hasFontconfig() )
RegisterFontSubstitutors( pList );
-
+
ImplGetSVData()->maGDIData.mbNativeFontConfig = rMgr.hasFontconfig();
}
@@ -1098,7 +1647,8 @@ void cairosubcallback( void* pPattern )
rCairo.ft_font_options_substitute( pFontOptions, pPattern );
}
-ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize)
+bool GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize,
+ ImplFontOptions& rFontOptions)
{
// TODO: get rid of these insane enum-conversions
// e.g. by using the classic vclenum values inside VCL
@@ -1195,7 +1745,8 @@ ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, in
}
const psp::PrintFontManager& rPFM = psp::PrintFontManager::get();
- return rPFM.getFontOptions(aInfo, nSize, cairosubcallback);
+ bool bOK = rPFM.getFontOptions( aInfo, nSize, cairosubcallback, rFontOptions);
+ return bOK;
}
// ----------------------------------------------------------------------------
@@ -1211,19 +1762,25 @@ 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;
+ }
}
// ---------------------------------------------------------------------------
-sal_uLong
-X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
+ULONG
+X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
{
if( ! bPrinter_ )
{
if( mpServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs;
- sal_uLong nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
+ ULONG nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
@@ -1235,40 +1792,40 @@ X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
// ---------------------------------------------------------------------------
-sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+BOOL X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
- if( nLevel < 0 || nLevel >= MAX_FALLBACK )
- return sal_False;
+ if( nLevel >= MAX_FALLBACK )
+ return FALSE;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return sal_True;
+ return TRUE;
}
// ---------------------------------------------------------------------------
-sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
+BOOL X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return sal_False;
+ return FALSE;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return sal_False;
+ return FALSE;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return sal_True;
+ return TRUE;
- return sal_False;
+ return FALSE;
}
//--------------------------------------------------------------------------
@@ -1283,14 +1840,25 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
#ifdef ENABLE_GRAPHITE
// Is this a Graphite font?
if (!bDisableGraphite_ &&
- GraphiteServerFontLayout::IsGraphiteEnabledFont(mpServerFont[nFallbackLevel]))
+ GraphiteFontAdaptor::IsGraphiteEnabledFont(*mpServerFont[nFallbackLevel]))
{
- pLayout = new GraphiteServerFontLayout(*mpServerFont[nFallbackLevel]);
+ sal_Int32 xdpi, ydpi;
+
+ xdpi = GetDisplay()->GetResolution().A();
+ ydpi = GetDisplay()->GetResolution().B();
+
+ GraphiteFontAdaptor * pGrfont = new GraphiteFontAdaptor( *mpServerFont[nFallbackLevel], xdpi, ydpi);
+ if (!pGrfont) return NULL;
+ pLayout = new GraphiteServerFontLayout(pGrfont);
}
else
#endif
pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
}
+ else if( mXFont[ nFallbackLevel ] )
+ pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] );
+ else
+ pLayout = NULL;
return pLayout;
}
@@ -1305,7 +1873,7 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
-
+
if (mpServerFont[nFallbacklevel] != NULL)
{
ServerFont* rFont = mpServerFont[nFallbacklevel];
@@ -1316,13 +1884,13 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const
aSysFontData.bAntialias = rFont->GetAntialiasAdvice();
aSysFontData.bVerticalCharacterType = rFont->GetFontSelData().mbVertical;
}
-
+
return aSysFontData;
}
//--------------------------------------------------------------------------
-sal_Bool X11SalGraphics::CreateFontSubset(
+BOOL X11SalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1354,6 +1922,7 @@ sal_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
@@ -1361,19 +1930,25 @@ 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
@@ -1381,6 +1956,9 @@ 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
}
//--------------------------------------------------------------------------
@@ -1409,7 +1987,7 @@ public:
bool FindFontSubstitute( ImplFontSelectData& ) const;
private:
- typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >
+ typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >
CachedFontMapType;
mutable CachedFontMapType maCachedFontMap;
};
@@ -1434,7 +2012,7 @@ void RegisterFontSubstitutors( ImplDevFontList* pList )
if( pEnvStr )
{
if( (*pEnvStr >= '0') && (*pEnvStr <= '9') )
- nDisableBits = (*pEnvStr - '0');
+ nDisableBits = (*pEnvStr - '0');
else
nDisableBits = ~0U; // no specific bits set: disable all
}
@@ -1480,16 +2058,16 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
{
switch( rFontSelData.GetWeight() )
{
- case WEIGHT_THIN: eWeight = psp::weight::Thin; break;
- case WEIGHT_ULTRALIGHT: eWeight = psp::weight::UltraLight; break;
- case WEIGHT_LIGHT: eWeight = psp::weight::Light; break;
- case WEIGHT_SEMILIGHT: eWeight = psp::weight::SemiLight; break;
- case WEIGHT_NORMAL: eWeight = psp::weight::Normal; break;
- case WEIGHT_MEDIUM: eWeight = psp::weight::Medium; break;
- case WEIGHT_SEMIBOLD: eWeight = psp::weight::SemiBold; break;
- case WEIGHT_BOLD: eWeight = psp::weight::Bold; break;
- case WEIGHT_ULTRABOLD: eWeight = psp::weight::UltraBold; break;
- case WEIGHT_BLACK: eWeight = psp::weight::Black; break;
+ case WEIGHT_THIN: eWeight = psp::weight::Thin; break;
+ case WEIGHT_ULTRALIGHT: eWeight = psp::weight::UltraLight; break;
+ case WEIGHT_LIGHT: eWeight = psp::weight::Light; break;
+ case WEIGHT_SEMILIGHT: eWeight = psp::weight::SemiLight; break;
+ case WEIGHT_NORMAL: eWeight = psp::weight::Normal; break;
+ case WEIGHT_MEDIUM: eWeight = psp::weight::Medium; break;
+ case WEIGHT_SEMIBOLD: eWeight = psp::weight::SemiBold; break;
+ case WEIGHT_BOLD: eWeight = psp::weight::Bold; break;
+ case WEIGHT_ULTRABOLD: eWeight = psp::weight::UltraBold; break;
+ case WEIGHT_BLACK: eWeight = psp::weight::Black; break;
default:
break;
}
@@ -1500,15 +2078,15 @@ static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData
{
switch( rFontSelData.GetWidthType() )
{
- case WIDTH_ULTRA_CONDENSED: eWidth = psp::width::UltraCondensed; break;
+ case WIDTH_ULTRA_CONDENSED: eWidth = psp::width::UltraCondensed; break;
case WIDTH_EXTRA_CONDENSED: eWidth = psp::width::ExtraCondensed; break;
- case WIDTH_CONDENSED: eWidth = psp::width::Condensed; break;
- case WIDTH_SEMI_CONDENSED: eWidth = psp::width::SemiCondensed; break;
- case WIDTH_NORMAL: eWidth = psp::width::Normal; break;
- case WIDTH_SEMI_EXPANDED: eWidth = psp::width::SemiExpanded; break;
- case WIDTH_EXPANDED: eWidth = psp::width::Expanded; break;
- case WIDTH_EXTRA_EXPANDED: eWidth = psp::width::ExtraExpanded; break;
- case WIDTH_ULTRA_EXPANDED: eWidth = psp::width::UltraExpanded; break;
+ case WIDTH_CONDENSED: eWidth = psp::width::Condensed; break;
+ case WIDTH_SEMI_CONDENSED: eWidth = psp::width::SemiCondensed; break;
+ case WIDTH_NORMAL: eWidth = psp::width::Normal; break;
+ case WIDTH_SEMI_EXPANDED: eWidth = psp::width::SemiExpanded; break;
+ case WIDTH_EXPANDED: eWidth = psp::width::Expanded; break;
+ case WIDTH_EXTRA_EXPANDED: eWidth = psp::width::ExtraExpanded; break;
+ case WIDTH_ULTRA_EXPANDED: eWidth = psp::width::UltraExpanded; break;
default:
break;
}
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 9951367d2e70..f1fcabb9ec23 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -55,8 +55,6 @@
#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"
@@ -64,22 +62,16 @@
#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;
-using ::rtl::OUStringToOString;
+using namespace rtl;
/*
- * static helpers
+ * static helpers
*/
#include "rtsname.hxx"
-static oslModule driverLib = NULL;
+static oslModule driverLib = NULL;
extern "C"
{
typedef int(*setupFunction)(PrinterInfo&);
@@ -112,16 +104,16 @@ static void getPaLib()
if( ! driverLib )
{
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ) );
- driverLib = osl_loadModuleRelative( (oslGenericFunction)getPaLib, aLibName.pData, SAL_LOADMODULE_DEFAULT );
+ driverLib = osl_loadModuleRelative( (oslGenericFunction)getPaLib, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( !driverLib )
{
return;
}
-
- pSetupFunction = (setupFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_SetupPrinterDriver" );
+
+ pSetupFunction = (setupFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_SetupPrinterDriver" );
if ( !pSetupFunction )
fprintf( stderr, "could not resolve Sal_SetupPrinterDriver\n" );
-
+
pFaxNrFunction = (faxFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_queryFaxNumber" );
if ( !pFaxNrFunction )
fprintf( stderr, "could not resolve Sal_queryFaxNumber\n" );
@@ -134,31 +126,31 @@ inline int TenMuToPt( int nUnits ) { return (int)((((double)nUnits)/35.27777778)
static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
{
- pJobSetup->meOrientation = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
+ pJobSetup->meOrientation = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
// copy page size
String aPaper;
int width, height;
rData.m_aContext.getPageSize( aPaper, width, height );
- pJobSetup->mePaperFormat = PaperInfo::fromPSName(OUStringToOString( aPaper, RTL_TEXTENCODING_ISO_8859_1 ));
+ pJobSetup->mePaperFormat = PaperInfo::fromPSName(OUStringToOString( aPaper, RTL_TEXTENCODING_ISO_8859_1 ));
- pJobSetup->mnPaperWidth = 0;
- pJobSetup->mnPaperHeight = 0;
+ pJobSetup->mnPaperWidth = 0;
+ pJobSetup->mnPaperHeight = 0;
if( pJobSetup->mePaperFormat == PAPER_USER )
{
// transform to 100dth mm
- width = PtTo10Mu( width );
- height = PtTo10Mu( height );
+ width = PtTo10Mu( width );
+ height = PtTo10Mu( height );
if( rData.m_eOrientation == psp::orientation::Portrait )
{
- pJobSetup->mnPaperWidth = width;
+ pJobSetup->mnPaperWidth = width;
pJobSetup->mnPaperHeight= height;
}
else
{
- pJobSetup->mnPaperWidth = height;
+ pJobSetup->mnPaperWidth = height;
pJobSetup->mnPaperHeight= width;
}
}
@@ -169,9 +161,9 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->mnPaperBin = 0;
if( rData.m_pParser )
- pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
if( pKey )
- pValue = rData.m_aContext.getValue( pKey );
+ pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue )
{
for( pJobSetup->mnPaperBin = 0;
@@ -182,11 +174,11 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( pJobSetup->mnPaperBin >= pKey->countValues() )
pJobSetup->mnPaperBin = 0;
}
-
+
// copy duplex
pKey = NULL;
pValue = NULL;
-
+
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser )
pKey = rData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) );
@@ -219,7 +211,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
+ pJobSetup->mpDriverData = (BYTE*)pBuffer;
}
else
{
@@ -377,13 +369,13 @@ static bool createPdf( const String& rToFile, const String& rFromFile, const Str
}
/*
- * SalInstance
+ * SalInstance
*/
// -----------------------------------------------------------------------
-SalInfoPrinter* X11SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
- ImplJobSetup* pJobSetup )
+SalInfoPrinter* X11SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ ImplJobSetup* pJobSetup )
{
mbPrinterInit = true;
// create and initialize SalInfoPrinter
@@ -399,16 +391,16 @@ SalInfoPrinter* X11SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
if( pJobSetup->mpDriverData )
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aInfo );
- pJobSetup->mnSystem = JOBSETUP_SYSTEM_UNIX;
- pJobSetup->maPrinterName = pQueueInfo->maPrinterName;
- pJobSetup->maDriver = aInfo.m_aDriverName;
+ pJobSetup->mnSystem = JOBSETUP_SYSTEM_UNIX;
+ pJobSetup->maPrinterName = pQueueInfo->maPrinterName;
+ pJobSetup->maDriver = aInfo.m_aDriverName;
copyJobDataToJobSetup( pJobSetup, aInfo );
-
+
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
- boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
-
+
if( compat_it != pJobSetup->maValueMap.end() )
{
if( compat_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
@@ -467,11 +459,11 @@ void X11SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
const PrinterInfo& rInfo( rManager.getPrinterInfo( *it ) );
// Neuen Eintrag anlegen
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
- pInfo->maPrinterName = *it;
- pInfo->maDriver = rInfo.m_aDriverName;
- pInfo->maLocation = rInfo.m_aLocation;
- pInfo->maComment = rInfo.m_aComment;
- pInfo->mpSysData = NULL;
+ pInfo->maPrinterName = *it;
+ pInfo->maDriver = rInfo.m_aDriverName;
+ pInfo->maLocation = rInfo.m_aLocation;
+ pInfo->maComment = rInfo.m_aComment;
+ pInfo->mpSysData = NULL;
sal_Int32 nIndex = 0;
while( nIndex != -1 )
@@ -594,15 +586,15 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
+BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
{
if( ! pFrame || ! pJobSetup )
- return sal_False;
+ return FALSE;
getPaLib();
if( ! pSetupFunction )
- return sal_False;
+ return FALSE;
PrinterInfoManager& rManager = PrinterInfoManager::get();
@@ -612,7 +604,7 @@ sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
SetData( ~0, pJobSetup );
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aInfo );
}
-
+
if( pSetupFunction( aInfo ) )
{
rtl_freeMemory( pJobSetup->mpDriverData );
@@ -621,15 +613,15 @@ sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
int nBytes;
void* pBuffer = NULL;
aInfo.getStreamBuffer( pBuffer, nBytes );
- pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
+ pJobSetup->mnDriverDataLen = nBytes;
+ pJobSetup->mpDriverData = (BYTE*)pBuffer;
// copy everything to job setup
copyJobDataToJobSetup( pJobSetup, aInfo );
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -639,11 +631,11 @@ sal_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
-sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
+BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
{
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
- boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
if( compat_it != pJobSetup->maValueMap.end() )
@@ -657,8 +649,8 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
return SetData( ~0, pJobSetup );
copyJobDataToJobSetup( pJobSetup, m_aJobData );
-
- return sal_True;
+
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -667,8 +659,8 @@ sal_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
-sal_Bool PspSalInfoPrinter::SetData(
- sal_uLong nSetDataFlags,
+BOOL PspSalInfoPrinter::SetData(
+ ULONG nSetDataFlags,
ImplJobSetup* pJobSetup )
{
JobData aData;
@@ -682,6 +674,17 @@ sal_Bool PspSalInfoPrinter::SetData(
// merge papersize if necessary
if( nSetDataFlags & SAL_JOBSET_PAPERSIZE )
{
+ int nWidth, nHeight;
+ if( pJobSetup->meOrientation == ORIENTATION_PORTRAIT )
+ {
+ nWidth = pJobSetup->mnPaperWidth;
+ nHeight = pJobSetup->mnPaperHeight;
+ }
+ else
+ {
+ nWidth = pJobSetup->mnPaperHeight;
+ nHeight = pJobSetup->mnPaperWidth;
+ }
String aPaper;
if( pJobSetup->mePaperFormat == PAPER_USER )
@@ -693,7 +696,7 @@ sal_Bool PspSalInfoPrinter::SetData(
pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
-
+
// some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5)
// try to find the correct paper anyway using the size
if( pKey && ! pValue && pJobSetup->mePaperFormat != PAPER_USER )
@@ -704,9 +707,9 @@ sal_Bool PspSalInfoPrinter::SetData(
TenMuToPt( aInfo.getHeight() ) );
pValue = pKey->getValueCaseInsensitive( aPaper );
}
-
+
if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) )
- return sal_False;
+ return FALSE;
}
// merge paperbin if necessary
@@ -766,10 +769,10 @@ sal_Bool PspSalInfoPrinter::SetData(
m_aJobData = aData;
copyJobDataToJobSetup( pJobSetup, aData );
- return sal_True;
+ return TRUE;
}
- return sal_False;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -807,18 +810,18 @@ void PspSalInfoPrinter::GetPageInfo(
aData.m_pParser->getMargins( aPaper, top, bottom, right, left );
}
- rPageWidth = width * nDPI / 72;
- rPageHeight = height * nDPI / 72;
- rPageOffX = left * nDPI / 72;
- rPageOffY = top * nDPI / 72;
- rOutWidth = ( width - left - right ) * nDPI / 72;
- rOutHeight = ( height - top - bottom ) * nDPI / 72;
+ rPageWidth = width * nDPI / 72;
+ rPageHeight = height * nDPI / 72;
+ rPageOffX = left * nDPI / 72;
+ rPageOffY = top * nDPI / 72;
+ rOutWidth = ( width - left - right ) * nDPI / 72;
+ rOutHeight = ( height - top - bottom ) * nDPI / 72;
}
}
// -----------------------------------------------------------------------
-sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
+ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
{
if( ! pJobSetup )
return 0;
@@ -832,7 +835,7 @@ sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
// -----------------------------------------------------------------------
-String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin )
+String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin )
{
JobData aData;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
@@ -841,7 +844,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uL
if( aData.m_pParser )
{
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
- if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() )
+ if( ! pKey || nPaperBin >= (ULONG)pKey->countValues() )
aRet = aData.m_pParser->getDefaultInputSlot();
else
{
@@ -856,7 +859,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uL
// -----------------------------------------------------------------------
-sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType )
+ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType )
{
switch( nType )
{
@@ -890,26 +893,9 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
case PRINTER_CAPABILITIES_FAX:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
- 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;
- }
+ return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 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;
@@ -918,14 +904,13 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
// =======================================================================
/*
- * SalPrinter
+ * SalPrinter
*/
PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter )
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
- m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
m_bCollate( false ),
@@ -950,22 +935,22 @@ static String getTmpName()
return aSys;
}
-sal_Bool PspSalPrinter::StartJob(
+BOOL PspSalPrinter::StartJob(
const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- sal_uLong nCopies,
+ ULONG nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pJobSetup )
{
- GetSalData()->m_pInstance->jobStartedPrinterUpdate();
+ vcl_sal::PrinterUpdate::jobStarted();
- m_bFax = false;
- m_bPdf = false;
- m_aFileName = pFileName ? *pFileName : String();
- m_aTmpFile = String();
- m_nCopies = nCopies;
+ m_bFax = false;
+ m_bPdf = false;
+ m_aFileName = pFileName ? *pFileName : String();
+ m_aTmpFile = String();
+ m_nCopies = nCopies;
m_bCollate = bCollate;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
@@ -990,8 +975,8 @@ sal_Bool PspSalPrinter::StartJob(
m_aTmpFile = getTmpName();
nMode = S_IRUSR | S_IWUSR;
- ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
- it = pJobSetup->maValueMap.find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAX#")) );
+ ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ it = pJobSetup->maValueMap.find( ::rtl::OUString::createFromAscii( "FAX#" ) );
if( it != pJobSetup->maValueMap.end() )
m_aFaxNr = it->second;
@@ -1017,10 +1002,10 @@ sal_Bool PspSalPrinter::StartJob(
}
}
m_aPrinterGfx.Init( m_aJobData );
-
+
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
- boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
+ std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
if( compat_it != pJobSetup->maValueMap.end() )
@@ -1030,53 +1015,47 @@ sal_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 ) ? sal_True : sal_False;
+ return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
-sal_Bool PspSalPrinter::EndJob()
+BOOL PspSalPrinter::EndJob()
{
- sal_Bool bSuccess = sal_False;
- if( m_bIsPDFWriterJob )
- bSuccess = sal_True;
- else
- {
- bSuccess = m_aPrintJob.EndJob();
+ BOOL bSuccess = m_aPrintJob.EndJob();
- if( bSuccess )
+ if( bSuccess )
+ {
+ // check for fax
+ if( m_bFax )
{
- // 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 );
- }
+ 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();
+ vcl_sal::PrinterUpdate::jobEnded();
return bSuccess;
}
// -----------------------------------------------------------------------
-sal_Bool PspSalPrinter::AbortJob()
+BOOL PspSalPrinter::AbortJob()
{
- sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False;
- GetSalData()->m_pInstance->jobEndedPrinterUpdate();
+ BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE;
+ vcl_sal::PrinterUpdate::jobEnded();
return bAbort;
}
// -----------------------------------------------------------------------
-SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool )
+SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, 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 );
@@ -1097,310 +1076,28 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool )
// -----------------------------------------------------------------------
-sal_Bool PspSalPrinter::EndPage()
+BOOL PspSalPrinter::EndPage()
{
sal_Bool bResult = m_aPrintJob.EndPage();
m_aPrinterGfx.Clear();
- return bResult ? sal_True : sal_False;
+ return bResult ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
-sal_uLong PspSalPrinter::GetErrorCode()
+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
- {
- static Timer* pPrinterUpdateTimer;
- static int nActiveJobs;
-
- static void doUpdate();
- DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* );
- public:
- static void update(X11SalInstance &rInstance);
- static void jobStarted() { nActiveJobs++; }
- static void jobEnded();
- };
-}
-
/*
- * x11::PrinterUpdate
+ * vcl::PrinterUpdate
*/
-Timer* x11::PrinterUpdate::pPrinterUpdateTimer = NULL;
-int x11::PrinterUpdate::nActiveJobs = 0;
+Timer* vcl_sal::PrinterUpdate::pPrinterUpdateTimer = NULL;
+int vcl_sal::PrinterUpdate::nActiveJobs = 0;
-void x11::PrinterUpdate::doUpdate()
+void vcl_sal::PrinterUpdate::doUpdate()
{
::psp::PrinterInfoManager& rManager( ::psp::PrinterInfoManager::get() );
if( rManager.checkPrintersChanged( false ) )
@@ -1415,7 +1112,7 @@ void x11::PrinterUpdate::doUpdate()
// -----------------------------------------------------------------------
-IMPL_STATIC_LINK_NOINSTANCE( x11::PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG )
+IMPL_STATIC_LINK_NOINSTANCE( vcl_sal::PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG )
{
if( nActiveJobs < 1 )
{
@@ -1431,42 +1128,32 @@ IMPL_STATIC_LINK_NOINSTANCE( x11::PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG
// -----------------------------------------------------------------------
-void x11::PrinterUpdate::update(X11SalInstance &rInstance)
+void vcl_sal::PrinterUpdate::update()
{
if( Application::GetSettings().GetMiscSettings().GetDisablePrinting() )
return;
-
- if( ! rInstance.isPrinterInit() )
+
+ if( ! static_cast< X11SalInstance* >(GetSalData()->m_pInstance)->isPrinterInit() )
{
// #i45389# start background printer detection
psp::PrinterInfoManager::get();
return;
}
-
+
if( nActiveJobs < 1 )
doUpdate();
else if( ! pPrinterUpdateTimer )
{
pPrinterUpdateTimer = new Timer();
pPrinterUpdateTimer->SetTimeout( 500 );
- pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, x11::PrinterUpdate, UpdateTimerHdl ) );
+ pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, vcl_sal::PrinterUpdate, UpdateTimerHdl ) );
pPrinterUpdateTimer->Start();
}
}
-void X11SalInstance::updatePrinterUpdate()
-{
- x11::PrinterUpdate::update(*this);
-}
-
-void X11SalInstance::jobStartedPrinterUpdate()
-{
- x11::PrinterUpdate::jobStarted();
-}
-
// -----------------------------------------------------------------------
-void x11::PrinterUpdate::jobEnded()
+void vcl_sal::PrinterUpdate::jobEnded()
{
nActiveJobs--;
if( nActiveJobs < 1 )
@@ -1481,9 +1168,4 @@ void x11::PrinterUpdate::jobEnded()
}
}
-void X11SalInstance::jobEndedPrinterUpdate()
-{
- x11::PrinterUpdate::jobEnded();
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx
index c6797cc6418c..dc8b4b103eaa 100644
--- a/vcl/unx/source/gdi/salvd.cxx
+++ b/vcl/unx/source/gdi/salvd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,7 +45,7 @@
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData )
+ USHORT nBitCount, const SystemGraphicsData *pData )
{
X11SalVirtualDevice *pVDev = new X11SalVirtualDevice();
if( !nBitCount && pGraphics )
@@ -100,7 +100,7 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap,
SalDisplay *pDisplay = pDevice->GetDisplay();
m_nScreen = pDevice->GetScreenNumber();
-
+
int nVisualDepth = pDisplay->GetColormap( m_nScreen ).GetVisual().GetDepth();
int nDeviceDepth = pDevice->GetDepth();
@@ -113,28 +113,28 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap,
else
if( nDeviceDepth == nVisualDepth )
m_pColormap = &pDisplay->GetColormap( m_nScreen );
- else
+ else
if( nDeviceDepth == 1 )
m_pColormap = m_pDeleteColormap = new SalColormap();
-
+
if (m_pDeleteColormap != pOrigDeleteColormap)
delete pOrigDeleteColormap;
const Drawable aVdevDrawable = pDevice->GetDrawable();
SetDrawable( aVdevDrawable, m_nScreen );
- m_pVDev = pDevice;
- m_pFrame = NULL;
+ m_pVDev = pDevice;
+ m_pFrame = NULL;
bWindow_ = pDisplay->IsDisplay();
- bVirDev_ = sal_True;
+ bVirDev_ = TRUE;
}
// -=-= SalVirDevData / SalVirtualDevice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay,
+BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
long nDX, long nDY,
- sal_uInt16 nBitCount,
+ USHORT nBitCount,
int nScreen,
Pixmap hDrawable,
XRenderPictFormat* pXRenderFormat )
@@ -143,7 +143,7 @@ sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay,
bool bDeleteColormap = false;
pDisplay_ = pDisplay;
- pGraphics_ = new X11SalGraphics();
+ pGraphics_ = new X11SalGraphics();
m_nScreen = nScreen;
if( pXRenderFormat ) {
pGraphics_->SetXRenderFormat( pXRenderFormat );
@@ -171,12 +171,12 @@ sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay,
else
{
hDrawable_ = hDrawable;
- bExternPixmap_ = sal_True;
+ bExternPixmap_ = TRUE;
}
pGraphics_->Init( this, pColormap, bDeleteColormap );
- return hDrawable_ != None ? sal_True : sal_False;
+ return hDrawable_ != None ? TRUE : FALSE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -188,8 +188,8 @@ X11SalVirtualDevice::X11SalVirtualDevice()
nDX_ = 0;
nDY_ = 0;
nDepth_ = 0;
- bGraphics_ = sal_False;
- bExternPixmap_ = sal_False;
+ bGraphics_ = FALSE;
+ bExternPixmap_ = FALSE;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -209,19 +209,19 @@ SalGraphics* X11SalVirtualDevice::GetGraphics()
return NULL;
if( pGraphics_ )
- bGraphics_ = sal_True;
+ bGraphics_ = TRUE;
return pGraphics_;
}
void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* )
-{ bGraphics_ = sal_False; }
+{ bGraphics_ = FALSE; }
-sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
+BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
{
if( bExternPixmap_ )
- return sal_False;
-
+ return FALSE;
+
// #144688#
// the X protocol request CreatePixmap puts an upper bound
// of 16 bit to the size. Beyond that there may be implementation
@@ -230,7 +230,7 @@ sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
// 16 bit truncation here without noticing.
if( nDX < 0 || nDX > 65535 ||
nDY < 0 || nDY > 65535 )
- return sal_False;
+ return FALSE;
if( !nDX ) nDX = 1;
if( !nDY ) nDY = 1;
@@ -249,7 +249,7 @@ sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
nDX_ = 1;
nDY_ = 1;
}
- return sal_False;
+ return FALSE;
}
if( GetDrawable() )
@@ -261,8 +261,8 @@ sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
if( pGraphics_ )
InitGraphics( this );
-
- return sal_True;
+
+ return TRUE;
}
void X11SalVirtualDevice::GetSize( long& rWidth, long& rHeight )
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
new file mode 100644
index 000000000000..a999eaf7213b
--- /dev/null
+++ b/vcl/unx/source/gdi/xfont.cxx
@@ -0,0 +1,767 @@
+/* -*- 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);
+
+#ifdef HDU_DEBUG
+ fprintf( stderr, "XLoadFont \"%s\" => %d\n", pFontName, (pFont!= NULL) );
+#endif
+ 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
+ // see BugId #44528# FontWork (-> #45038#) and as well Bug #47127#
+ 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
new file mode 100644
index 000000000000..787832e5978c
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_attr.cxx
@@ -0,0 +1,688 @@
+/* -*- 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 <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;
+ mpList = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) );
+ }
+}
+
+// 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
new file mode 100644
index 000000000000..dbeed8228cd7
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_attr.hxx
@@ -0,0 +1,230 @@
+/* -*- 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
new file mode 100644
index 000000000000..1629d132d669
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_extd.cxx
@@ -0,0 +1,1002 @@
+/* -*- 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
new file mode 100644
index 000000000000..70b661ec19ef
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_extd.hxx
@@ -0,0 +1,271 @@
+/* -*- 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
new file mode 100644
index 000000000000..f03eb38d63d2
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_smpl.cxx
@@ -0,0 +1,270 @@
+/* -*- 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
new file mode 100644
index 000000000000..636e1b85a370
--- /dev/null
+++ b/vcl/unx/source/gdi/xlfd_smpl.hxx
@@ -0,0 +1,94 @@
+/* -*- 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/gdi/xrender_peer.cxx b/vcl/unx/source/gdi/xrender_peer.cxx
index 6ad312bef70b..7558a81e1d1b 100644
--- a/vcl/unx/source/gdi/xrender_peer.cxx
+++ b/vcl/unx/source/gdi/xrender_peer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,8 +33,8 @@
#include <rtl/ustring.hxx>
#include <osl/module.h>
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
+using namespace rtl;
+
#include <xrender_peer.hxx>
#include <salunx.h>
@@ -88,7 +88,7 @@ void XRenderPeer::InitRenderLib()
if( !mpRenderLib ) {
#ifdef DEBUG
fprintf( stderr, "Display can do XRender, but no %s installed.\n"
- "Please install for improved display performance\n", OUStringToOString( aLibName.getStr(),
+ "Please install for improved display performance\n", OUStringToOString( aLibName.getStr(),
osl_getThreadTextEncoding() ).getStr() );
#endif
return;
diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx
index f9417bb2be95..2a168ab4d28a 100644
--- a/vcl/unx/source/gdi/xrender_peer.hxx
+++ b/vcl/unx/source/gdi/xrender_peer.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@ public:
int GetVersion() const;
sal_uInt32 InitRenderText();
-
+
protected:
XRenderPeer();
~XRenderPeer();
@@ -282,7 +282,7 @@ inline void XRenderPeer::FreeGlyph( GlyphSet aGS, Glyph nGlyphId ) const
inline void XRenderPeer::CompositeString32( Picture aSrc, Picture aDst,
GlyphSet aGlyphSet, int nDstX, int nDstY,
- const unsigned* pText, int nTextLen ) const
+ const unsigned* pText, int nTextLen ) const
{
#ifdef XRENDER_LINK
XRenderCompositeString32( mpDisplay, PictOpOver, aSrc, aDst, NULL,
diff --git a/vcl/unx/source/inc/airbrush_curs.h b/vcl/unx/source/inc/airbrush_curs.h
index a78666bb243d..c70a0cd4f39f 100644
--- a/vcl/unx/source/inc/airbrush_curs.h
+++ b/vcl/unx/source/inc/airbrush_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define airbrush_curs_height 32
#define airbrush_curs_x_hot 5
#define airbrush_curs_y_hot 22
-static unsigned char airbrush_curs_bits[] = {
+static char airbrush_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
0x7c,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x1f,0x00,0x00,0x98,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/airbrush_mask.h b/vcl/unx/source/inc/airbrush_mask.h
index 82d70f05bbb7..38d50e81b94a 100644
--- a/vcl/unx/source/inc/airbrush_mask.h
+++ b/vcl/unx/source/inc/airbrush_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define airbrush_mask_height 32
#define airbrush_mask_x_hot 5
#define airbrush_mask_y_hot 22
-static unsigned char airbrush_mask_bits[] = {
+static char airbrush_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
0x7c,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x1f,0x00,0x00,0x98,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/ase_curs.h b/vcl/unx/source/inc/ase_curs.h
index 0a7c9bfd29c2..5bf1472a7a5e 100644
--- a/vcl/unx/source/inc/ase_curs.h
+++ b/vcl/unx/source/inc/ase_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define ase_curs_height 32
#define ase_curs_x_hot 19
#define ase_curs_y_hot 16
-static unsigned char ase_curs_bits[] = {
+static char ase_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/ase_mask.h b/vcl/unx/source/inc/ase_mask.h
index 4ded0773a72a..2d83538505b1 100644
--- a/vcl/unx/source/inc/ase_mask.h
+++ b/vcl/unx/source/inc/ase_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,9 +27,9 @@
************************************************************************/
#define ase_mask_width 32
#define ase_mask_height 32
-#define ase_mask_x_hot 19
+#define ase_mask_x_hot 19
#define ase_mask_y_hot 16
-static unsigned char ase_mask_bits[] = {
+static char ase_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asn_curs.h b/vcl/unx/source/inc/asn_curs.h
index 68ab521de1a5..322ec226dff1 100644
--- a/vcl/unx/source/inc/asn_curs.h
+++ b/vcl/unx/source/inc/asn_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asn_curs_height 32
#define asn_curs_x_hot 16
#define asn_curs_y_hot 12
-static unsigned char asn_curs_bits[] = {
+static char asn_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x03,
0x00,0x00,0xc0,0x07,0x00,0x00,0xc0,0x07,0x00,0x00,0xe0,0x0f,0x00,0x00,0x20,
0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,
diff --git a/vcl/unx/source/inc/asn_mask.h b/vcl/unx/source/inc/asn_mask.h
index 0e7a30e5a190..ebdd59e136a7 100644
--- a/vcl/unx/source/inc/asn_mask.h
+++ b/vcl/unx/source/inc/asn_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asn_mask_height 32
#define asn_mask_x_hot 16
#define asn_mask_y_hot 12
-static unsigned char asn_mask_bits[] = {
+static char asn_mask_bits[] = {
0x00,0x00,0x01,0x00,0x00,0x80,0x03,0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,
0x00,0x00,0xe0,0x0f,0x00,0x00,0xe0,0x0f,0x00,0x00,0xf0,0x1f,0x00,0x00,0xf0,
0x1f,0x00,0x00,0x20,0x08,0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,0x00,0x00,
diff --git a/vcl/unx/source/inc/asne_curs.h b/vcl/unx/source/inc/asne_curs.h
index 8ba58f9639e2..a5cdbe5a019a 100644
--- a/vcl/unx/source/inc/asne_curs.h
+++ b/vcl/unx/source/inc/asne_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asne_curs_height 32
#define asne_curs_x_hot 21
#define asne_curs_y_hot 10
-static unsigned char asne_curs_bits[] = {
+static char asne_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x80,
0x3f,0x00,0x00,0xc0,0x3f,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x1c,0x00,0x00,
0x00,0x1c,0x00,0x00,0x70,0x18,0x00,0x00,0xf8,0x08,0x00,0x00,0xf8,0x00,0x00,
diff --git a/vcl/unx/source/inc/asne_mask.h b/vcl/unx/source/inc/asne_mask.h
index 6408f127b1f4..2761eac9d684 100644
--- a/vcl/unx/source/inc/asne_mask.h
+++ b/vcl/unx/source/inc/asne_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asne_mask_height 32
#define asne_mask_x_hot 21
#define asne_mask_y_hot 10
-static unsigned char asne_mask_bits[] = {
+static char asne_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x80,0x7f,0x00,0x00,0xc0,
0x7f,0x00,0x00,0xe0,0x7f,0x00,0x00,0xc0,0x7f,0x00,0x00,0x00,0x3f,0x00,0x00,
0x70,0x3e,0x00,0x00,0xf8,0x3c,0x00,0x00,0xfc,0x1d,0x00,0x00,0xfc,0x09,0x00,
diff --git a/vcl/unx/source/inc/asns_curs.h b/vcl/unx/source/inc/asns_curs.h
index 3e039241ba61..8f102f2f8ba2 100644
--- a/vcl/unx/source/inc/asns_curs.h
+++ b/vcl/unx/source/inc/asns_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asns_curs_height 32
#define asns_curs_x_hot 15
#define asns_curs_y_hot 15
-static unsigned char asns_curs_bits[] = {
+static char asns_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0xe0,
0x03,0x00,0x00,0xe0,0x03,0x00,0x00,0xf0,0x07,0x00,0x00,0x10,0x04,0x00,0x00,
diff --git a/vcl/unx/source/inc/asns_mask.h b/vcl/unx/source/inc/asns_mask.h
index 2a753501bc9d..674b37a2d1c5 100644
--- a/vcl/unx/source/inc/asns_mask.h
+++ b/vcl/unx/source/inc/asns_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asns_mask_height 32
#define asns_mask_x_hot 15
#define asns_mask_y_hot 15
-static unsigned char asns_mask_bits[] = {
+static char asns_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,
0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xe0,0x03,0x00,0x00,0xf0,
0x07,0x00,0x00,0xf0,0x07,0x00,0x00,0xf8,0x0f,0x00,0x00,0xf8,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/asnswe_curs.h b/vcl/unx/source/inc/asnswe_curs.h
index 599511e1d433..773b68b9d3d0 100644
--- a/vcl/unx/source/inc/asnswe_curs.h
+++ b/vcl/unx/source/inc/asnswe_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asnswe_curs_height 32
#define asnswe_curs_x_hot 15
#define asnswe_curs_y_hot 15
-static unsigned char asnswe_curs_bits[] = {
+static char asnswe_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0xe0,
0x03,0x00,0x00,0xe0,0x03,0x00,0x00,0xf0,0x07,0x00,0x00,0x10,0x04,0x00,0x00,
diff --git a/vcl/unx/source/inc/asnswe_mask.h b/vcl/unx/source/inc/asnswe_mask.h
index a0bcb3c5310e..42071557d712 100644
--- a/vcl/unx/source/inc/asnswe_mask.h
+++ b/vcl/unx/source/inc/asnswe_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asnswe_mask_height 32
#define asnswe_mask_x_hot 15
#define asnswe_mask_y_hot 15
-static unsigned char asnswe_mask_bits[] = {
+static char asnswe_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,
0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xe0,0x03,0x00,0x00,0xf0,
0x07,0x00,0x00,0xf0,0x07,0x00,0x00,0xf8,0x0f,0x00,0x00,0xf8,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/asnw_curs.h b/vcl/unx/source/inc/asnw_curs.h
index 139cd4e2ea5e..6bcb38e67209 100644
--- a/vcl/unx/source/inc/asnw_curs.h
+++ b/vcl/unx/source/inc/asnw_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asnw_curs_height 32
#define asnw_curs_x_hot 10
#define asnw_curs_y_hot 10
-static unsigned char asnw_curs_bits[] = {
+static char asnw_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0xfc,0x01,0x00,
0x00,0xfc,0x03,0x00,0x00,0xfc,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x38,0x00,
0x00,0x00,0x18,0x0e,0x00,0x00,0x10,0x1f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asnw_mask.h b/vcl/unx/source/inc/asnw_mask.h
index 6f7da9a88661..5a55eb990475 100644
--- a/vcl/unx/source/inc/asnw_mask.h
+++ b/vcl/unx/source/inc/asnw_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asnw_mask_height 32
#define asnw_mask_x_hot 10
#define asnw_mask_y_hot 10
-static unsigned char asnw_mask_bits[] = {
+static char asnw_mask_bits[] = {
0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0xfe,0x01,0x00,0x00,0xfe,0x03,0x00,
0x00,0xfe,0x07,0x00,0x00,0xfe,0x03,0x00,0x00,0xfc,0x00,0x00,0x00,0x7c,0x0e,
0x00,0x00,0x3c,0x1f,0x00,0x00,0xb8,0x3f,0x00,0x00,0x90,0x3f,0x00,0x00,0x80,
diff --git a/vcl/unx/source/inc/ass_curs.h b/vcl/unx/source/inc/ass_curs.h
index ea98bf5b0404..583c6c32cb47 100644
--- a/vcl/unx/source/inc/ass_curs.h
+++ b/vcl/unx/source/inc/ass_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define ass_curs_height 32
#define ass_curs_x_hot 15
#define ass_curs_y_hot 19
-static unsigned char ass_curs_bits[] = {
+static char ass_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/ass_mask.h b/vcl/unx/source/inc/ass_mask.h
index ccb91615d34a..18131ff1532d 100644
--- a/vcl/unx/source/inc/ass_mask.h
+++ b/vcl/unx/source/inc/ass_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define ass_mask_height 32
#define ass_mask_x_hot 15
#define ass_mask_y_hot 19
-static unsigned char ass_mask_bits[] = {
+static char ass_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asse_curs.h b/vcl/unx/source/inc/asse_curs.h
index 0df55658c10a..d1b1342d2340 100644
--- a/vcl/unx/source/inc/asse_curs.h
+++ b/vcl/unx/source/inc/asse_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asse_curs_height 32
#define asse_curs_x_hot 21
#define asse_curs_y_hot 21
-static unsigned char asse_curs_bits[] = {
+static char asse_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asse_mask.h b/vcl/unx/source/inc/asse_mask.h
index 1835e939f275..7e03b04cd700 100644
--- a/vcl/unx/source/inc/asse_mask.h
+++ b/vcl/unx/source/inc/asse_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asse_mask_height 32
#define asse_mask_x_hot 21
#define asse_mask_y_hot 21
-static unsigned char asse_mask_bits[] = {
+static char asse_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/assw_curs.h b/vcl/unx/source/inc/assw_curs.h
index 5956aa5bf40b..d3a833a44747 100644
--- a/vcl/unx/source/inc/assw_curs.h
+++ b/vcl/unx/source/inc/assw_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define assw_curs_height 32
#define assw_curs_x_hot 21
#define assw_curs_y_hot 21
-static unsigned char assw_curs_bits[] = {
+static char assw_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/assw_mask.h b/vcl/unx/source/inc/assw_mask.h
index 3023b2a6061f..c6ea8944492c 100644
--- a/vcl/unx/source/inc/assw_mask.h
+++ b/vcl/unx/source/inc/assw_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define assw_mask_height 32
#define assw_mask_x_hot 21
#define assw_mask_y_hot 21
-static unsigned char assw_mask_bits[] = {
+static char assw_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asw_curs.h b/vcl/unx/source/inc/asw_curs.h
index 8064570cb8fe..996f65930a71 100644
--- a/vcl/unx/source/inc/asw_curs.h
+++ b/vcl/unx/source/inc/asw_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asw_curs_height 32
#define asw_curs_x_hot 12
#define asw_curs_y_hot 15
-static unsigned char asw_curs_bits[] = {
+static char asw_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/asw_mask.h b/vcl/unx/source/inc/asw_mask.h
index 245c42e7d790..54629e5af5fb 100644
--- a/vcl/unx/source/inc/asw_mask.h
+++ b/vcl/unx/source/inc/asw_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define asw_mask_height 32
#define asw_mask_x_hot 12
#define asw_mask_y_hot 15
-static unsigned char asw_mask_bits[] = {
+static char asw_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
diff --git a/vcl/unx/source/inc/aswe_curs.h b/vcl/unx/source/inc/aswe_curs.h
index ed83d450c269..7e897617f55e 100644
--- a/vcl/unx/source/inc/aswe_curs.h
+++ b/vcl/unx/source/inc/aswe_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define aswe_curs_height 32
#define aswe_curs_x_hot 15
#define aswe_curs_y_hot 15
-static unsigned char aswe_curs_bits[] = {
+static char aswe_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/aswe_mask.h b/vcl/unx/source/inc/aswe_mask.h
index d2a97d7fa4c8..6b67f2a98ed1 100644
--- a/vcl/unx/source/inc/aswe_mask.h
+++ b/vcl/unx/source/inc/aswe_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define aswe_mask_height 32
#define aswe_mask_x_hot 15
#define aswe_mask_y_hot 15
-static unsigned char aswe_mask_bits[] = {
+static char aswe_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/chain_curs.h b/vcl/unx/source/inc/chain_curs.h
index ea319fb6b128..ecc5c8dd5135 100644
--- a/vcl/unx/source/inc/chain_curs.h
+++ b/vcl/unx/source/inc/chain_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define chain_curs_height 32
#define chain_curs_x_hot 0
#define chain_curs_y_hot 2
-static unsigned char chain_curs_bits[] = {
+static char chain_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,
0x00,0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x21,0x00,
0x00,0x00,0x41,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x01,
diff --git a/vcl/unx/source/inc/chain_mask.h b/vcl/unx/source/inc/chain_mask.h
index 688835ecbd3e..f34a2ae4409e 100644
--- a/vcl/unx/source/inc/chain_mask.h
+++ b/vcl/unx/source/inc/chain_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define chain_mask_width 32
#define chain_mask_height 32
-static unsigned char chain_mask_bits[] = {
+static char chain_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3f,0x00,
0x00,0x00,0x7f,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x01,0x00,0x00,0xff,
diff --git a/vcl/unx/source/inc/chainnot_curs.h b/vcl/unx/source/inc/chainnot_curs.h
index e327586e3110..de93553e8ec6 100644
--- a/vcl/unx/source/inc/chainnot_curs.h
+++ b/vcl/unx/source/inc/chainnot_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define chainnot_curs_height 32
#define chainnot_curs_x_hot 2
#define chainnot_curs_y_hot 2
-static unsigned char chainnot_curs_bits[] = {
+static char chainnot_curs_bits[] = {
0x00,0x00,0x00,0x00,0x80,0x1f,0x00,0x00,0xe0,0x7f,0x00,0x00,0xf0,0xf0,0x00,
0x00,0x38,0xc0,0x01,0x00,0x7c,0x80,0x03,0x00,0xec,0x00,0x03,0x00,0xce,0x01,
0x07,0x00,0x86,0x03,0x06,0x00,0x06,0x07,0x06,0x00,0x06,0x0e,0x06,0x00,0x06,
diff --git a/vcl/unx/source/inc/chainnot_mask.h b/vcl/unx/source/inc/chainnot_mask.h
index 6666599ad64c..5e5841e4032a 100644
--- a/vcl/unx/source/inc/chainnot_mask.h
+++ b/vcl/unx/source/inc/chainnot_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define chainnot_mask_width 32
#define chainnot_mask_height 32
-static unsigned char chainnot_mask_bits[] = {
+static char chainnot_mask_bits[] = {
0x80,0x1f,0x00,0x00,0xe0,0x7f,0x00,0x00,0xf0,0xff,0x00,0x00,0xf8,0xff,0x01,
0x00,0xfc,0xf0,0x03,0x00,0xfe,0xc0,0x07,0x00,0xfe,0x81,0x07,0x00,0xff,0x83,
0x0f,0x00,0xcf,0x07,0x0f,0x00,0x8f,0x0f,0x0f,0x00,0x0f,0x1f,0x0f,0x00,0x0f,
diff --git a/vcl/unx/source/inc/chart_curs.h b/vcl/unx/source/inc/chart_curs.h
index f1fbd5557ad4..73ce584c67fc 100644
--- a/vcl/unx/source/inc/chart_curs.h
+++ b/vcl/unx/source/inc/chart_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define chart_curs_height 32
#define chart_curs_x_hot 15
#define chart_curs_y_hot 16
-static unsigned char chart_curs_bits[] = {
+static char chart_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
diff --git a/vcl/unx/source/inc/chart_mask.h b/vcl/unx/source/inc/chart_mask.h
index 53f4ae125bda..8059d16dd15e 100644
--- a/vcl/unx/source/inc/chart_mask.h
+++ b/vcl/unx/source/inc/chart_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define chart_mask_height 32
#define chart_mask_x_hot 15
#define chart_mask_y_hot 16
-static unsigned char chart_mask_bits[] = {
+static char chart_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,
diff --git a/vcl/unx/source/inc/copydata_curs.h b/vcl/unx/source/inc/copydata_curs.h
index a882a541a6d7..3f2bb060d56c 100644
--- a/vcl/unx/source/inc/copydata_curs.h
+++ b/vcl/unx/source/inc/copydata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydata_curs_height 32
#define copydata_curs_x_hot 1
#define copydata_curs_y_hot 1
-static unsigned char copydata_curs_bits[] = {
+static char copydata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copydata_mask.h b/vcl/unx/source/inc/copydata_mask.h
index 9cd73b08d106..3f2009d72322 100644
--- a/vcl/unx/source/inc/copydata_mask.h
+++ b/vcl/unx/source/inc/copydata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydata_mask_height 32
#define copydata_mask_x_hot 1
#define copydata_mask_y_hot 1
-static unsigned char copydata_mask_bits[] = {
+static char copydata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copydlnk_curs.h b/vcl/unx/source/inc/copydlnk_curs.h
index 353297212083..449d51f1f676 100644
--- a/vcl/unx/source/inc/copydlnk_curs.h
+++ b/vcl/unx/source/inc/copydlnk_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydlnk_curs_height 32
#define copydlnk_curs_x_hot 1
#define copydlnk_curs_y_hot 1
-static unsigned char copydlnk_curs_bits[] = {
+static char copydlnk_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copydlnk_mask.h b/vcl/unx/source/inc/copydlnk_mask.h
index b6ac40003814..9c8a260cbfe6 100644
--- a/vcl/unx/source/inc/copydlnk_mask.h
+++ b/vcl/unx/source/inc/copydlnk_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copydlnk_mask_height 32
#define copydlnk_mask_x_hot 1
#define copydlnk_mask_y_hot 1
-static unsigned char copydlnk_mask_bits[] = {
+static char copydlnk_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyfile_curs.h b/vcl/unx/source/inc/copyfile_curs.h
index da1366c71c6c..14f544f433bf 100644
--- a/vcl/unx/source/inc/copyfile_curs.h
+++ b/vcl/unx/source/inc/copyfile_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyfile_curs_height 32
#define copyfile_curs_x_hot 9
#define copyfile_curs_y_hot 9
-static unsigned char copyfile_curs_bits[] = {
+static char copyfile_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyfile_mask.h b/vcl/unx/source/inc/copyfile_mask.h
index 5679ee8c2da8..c0c083f878bd 100644
--- a/vcl/unx/source/inc/copyfile_mask.h
+++ b/vcl/unx/source/inc/copyfile_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyfile_mask_height 32
#define copyfile_mask_x_hot 9
#define copyfile_mask_y_hot 9
-static unsigned char copyfile_mask_bits[] = {
+static char copyfile_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyfiles_curs.h b/vcl/unx/source/inc/copyfiles_curs.h
index c761f67ae370..5921ebaf6678 100644
--- a/vcl/unx/source/inc/copyfiles_curs.h
+++ b/vcl/unx/source/inc/copyfiles_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyfiles_curs_height 32
#define copyfiles_curs_x_hot 8
#define copyfiles_curs_y_hot 9
-static unsigned char copyfiles_curs_bits[] = {
+static char copyfiles_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xe0, 0x2f, 0x00, 0x00,
0xe8, 0x0f, 0x00, 0x00, 0xe8, 0x7f, 0x00, 0x00, 0xea, 0x7f, 0x00, 0x00,
0xea, 0x7f, 0x00, 0x00, 0xea, 0x7f, 0x00, 0x00, 0x6a, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyfiles_mask.h b/vcl/unx/source/inc/copyfiles_mask.h
index e6be0c5f105d..cdbc70bc710c 100644
--- a/vcl/unx/source/inc/copyfiles_mask.h
+++ b/vcl/unx/source/inc/copyfiles_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyfiles_mask_height 32
#define copyfiles_mask_x_hot 8
#define copyfiles_mask_y_hot 9
-static unsigned char copyfiles_mask_bits[] = {
+static char copyfiles_mask_bits[] = {
0xf0, 0x1f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00,
0xfc, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyflnk_curs.h b/vcl/unx/source/inc/copyflnk_curs.h
index 9fdf78685365..e5f5bd341729 100644
--- a/vcl/unx/source/inc/copyflnk_curs.h
+++ b/vcl/unx/source/inc/copyflnk_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyflnk_curs_height 32
#define copyflnk_curs_x_hot 9
#define copyflnk_curs_y_hot 9
-static unsigned char copyflnk_curs_bits[] = {
+static char copyflnk_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/copyflnk_mask.h b/vcl/unx/source/inc/copyflnk_mask.h
index 3b678164e0c6..8ccb93b2433b 100644
--- a/vcl/unx/source/inc/copyflnk_mask.h
+++ b/vcl/unx/source/inc/copyflnk_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define copyflnk_mask_height 32
#define copyflnk_mask_x_hot 9
#define copyflnk_mask_y_hot 9
-static unsigned char copyflnk_mask_bits[] = {
+static char copyflnk_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/crook_curs.h b/vcl/unx/source/inc/crook_curs.h
index 97db1feaa394..25d61a366296 100644
--- a/vcl/unx/source/inc/crook_curs.h
+++ b/vcl/unx/source/inc/crook_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define crook_curs_height 32
#define crook_curs_x_hot 15
#define crook_curs_y_hot 14
-static unsigned char crook_curs_bits[] = {
+static char crook_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7c, 0x3e, 0xff, 0x7f, 0xbb, 0xdd, 0xfe,
diff --git a/vcl/unx/source/inc/crook_mask.h b/vcl/unx/source/inc/crook_mask.h
index 534ad6da53fd..b1c099e6979c 100644
--- a/vcl/unx/source/inc/crook_mask.h
+++ b/vcl/unx/source/inc/crook_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define crook_mask_width 32
#define crook_mask_height 32
-static unsigned char crook_mask_bits[] = {
+static char crook_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x83, 0xc1, 0x00, 0x80, 0xc7, 0xe3, 0x01, 0xc0, 0xef, 0xf7, 0x03,
diff --git a/vcl/unx/source/inc/crop_curs.h b/vcl/unx/source/inc/crop_curs.h
index 5647de80b196..d1e07fd7aaa7 100644
--- a/vcl/unx/source/inc/crop_curs.h
+++ b/vcl/unx/source/inc/crop_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define crop_curs_height 32
#define crop_curs_x_hot 9
#define crop_curs_y_hot 9
-static unsigned char crop_curs_bits[] = {
+static char crop_curs_bits[] = {
0xff, 0x0f, 0xff, 0xff, 0xff, 0x6f, 0xff, 0xff, 0xff, 0x6f, 0xff, 0xff,
0x07, 0x60, 0xf8, 0xff, 0xf7, 0x6f, 0xfb, 0xff, 0xf7, 0x6f, 0xfb, 0xff,
0x37, 0x60, 0xf8, 0xff, 0xb7, 0x6f, 0xff, 0xff, 0xb7, 0x6f, 0xff, 0xff,
diff --git a/vcl/unx/source/inc/crop_mask.h b/vcl/unx/source/inc/crop_mask.h
index f7d3c87201c3..b416c7731999 100644
--- a/vcl/unx/source/inc/crop_mask.h
+++ b/vcl/unx/source/inc/crop_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define crop_mask_width 32
#define crop_mask_height 32
-static unsigned char crop_mask_bits[] = {
+static char crop_mask_bits[] = {
0x00, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0xfc, 0xff, 0x0f, 0x00,
0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00,
0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xf8, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/detective_curs.h b/vcl/unx/source/inc/detective_curs.h
index b2e3e2a375b9..d84592854ae3 100644
--- a/vcl/unx/source/inc/detective_curs.h
+++ b/vcl/unx/source/inc/detective_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define detective_curs_height 32
#define detective_curs_x_hot 12
#define detective_curs_y_hot 13
-static unsigned char detective_curs_bits[] = {
+static char detective_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x38,0x00,
0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,
0x00,0x00,0x00,0x83,0x01,0x00,0x80,0x00,0x02,0x00,0x80,0x10,0x02,0x00,0x40,
diff --git a/vcl/unx/source/inc/detective_mask.h b/vcl/unx/source/inc/detective_mask.h
index e731aff3c989..ec314697324b 100644
--- a/vcl/unx/source/inc/detective_mask.h
+++ b/vcl/unx/source/inc/detective_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define detective_mask_height 32
#define detective_mask_x_hot 12
#define detective_mask_y_hot 13
-static unsigned char detective_mask_bits[] = {
+static char detective_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x38,0x00,
0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,
0x00,0x00,0x00,0xff,0x01,0x00,0x80,0xff,0x03,0x00,0x80,0xff,0x03,0x00,0xc0,
diff --git a/vcl/unx/source/inc/drawarc_curs.h b/vcl/unx/source/inc/drawarc_curs.h
index 08a3e324dae6..48562f6a2b8d 100644
--- a/vcl/unx/source/inc/drawarc_curs.h
+++ b/vcl/unx/source/inc/drawarc_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawarc_curs_height 32
#define drawarc_curs_x_hot 7
#define drawarc_curs_y_hot 7
-static unsigned char drawarc_curs_bits[] = {
+static char drawarc_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawarc_mask.h b/vcl/unx/source/inc/drawarc_mask.h
index b4e42dc824c6..f811c864ae26 100644
--- a/vcl/unx/source/inc/drawarc_mask.h
+++ b/vcl/unx/source/inc/drawarc_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawarc_mask_width 32
#define drawarc_mask_height 32
-static unsigned char drawarc_mask_bits[] = {
+static char drawarc_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawbezier_curs.h b/vcl/unx/source/inc/drawbezier_curs.h
index a84a2da70333..5ee9d146e49c 100644
--- a/vcl/unx/source/inc/drawbezier_curs.h
+++ b/vcl/unx/source/inc/drawbezier_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawbezier_curs_height 32
#define drawbezier_curs_x_hot 7
#define drawbezier_curs_y_hot 7
-static unsigned char drawbezier_curs_bits[] = {
+static char drawbezier_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawbezier_mask.h b/vcl/unx/source/inc/drawbezier_mask.h
index 13bac21a4594..b71477f1c366 100644
--- a/vcl/unx/source/inc/drawbezier_mask.h
+++ b/vcl/unx/source/inc/drawbezier_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawbezier_mask_width 32
#define drawbezier_mask_height 32
-static unsigned char drawbezier_mask_bits[] = {
+static char drawbezier_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawcaption_curs.h b/vcl/unx/source/inc/drawcaption_curs.h
index 9905c240002d..8ab9c97569ac 100644
--- a/vcl/unx/source/inc/drawcaption_curs.h
+++ b/vcl/unx/source/inc/drawcaption_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawcaption_curs_height 32
#define drawcaption_curs_x_hot 8
#define drawcaption_curs_y_hot 8
-static unsigned char drawcaption_curs_bits[] = {
+static char drawcaption_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff,
0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff,
0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0x02, 0xff, 0xff,
diff --git a/vcl/unx/source/inc/drawcaption_mask.h b/vcl/unx/source/inc/drawcaption_mask.h
index 98c0bc5aaf38..f0c01d40531f 100644
--- a/vcl/unx/source/inc/drawcaption_mask.h
+++ b/vcl/unx/source/inc/drawcaption_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawcaption_mask_width 32
#define drawcaption_mask_height 32
-static unsigned char drawcaption_mask_bits[] = {
+static char drawcaption_mask_bits[] = {
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/drawcirclecut_curs.h b/vcl/unx/source/inc/drawcirclecut_curs.h
index c36720ad659e..6d01943f2ecf 100644
--- a/vcl/unx/source/inc/drawcirclecut_curs.h
+++ b/vcl/unx/source/inc/drawcirclecut_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawcirclecut_curs_height 32
#define drawcirclecut_curs_x_hot 7
#define drawcirclecut_curs_y_hot 7
-static unsigned char drawcirclecut_curs_bits[] = {
+static char drawcirclecut_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawcirclecut_mask.h b/vcl/unx/source/inc/drawcirclecut_mask.h
index 885c210bda34..34c0c246c885 100644
--- a/vcl/unx/source/inc/drawcirclecut_mask.h
+++ b/vcl/unx/source/inc/drawcirclecut_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawcirclecut_mask_width 32
#define drawcirclecut_mask_height 32
-static unsigned char drawcirclecut_mask_bits[] = {
+static char drawcirclecut_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawconnect_curs.h b/vcl/unx/source/inc/drawconnect_curs.h
index 40f4e6dc3905..d8167c259958 100644
--- a/vcl/unx/source/inc/drawconnect_curs.h
+++ b/vcl/unx/source/inc/drawconnect_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawconnect_curs_height 32
#define drawconnect_curs_x_hot 7
#define drawconnect_curs_y_hot 7
-static unsigned char drawconnect_curs_bits[] = {
+static char drawconnect_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawconnect_mask.h b/vcl/unx/source/inc/drawconnect_mask.h
index 270cdbac3fe6..8538c130f4c7 100644
--- a/vcl/unx/source/inc/drawconnect_mask.h
+++ b/vcl/unx/source/inc/drawconnect_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawconnect_mask_width 32
#define drawconnect_mask_height 32
-static unsigned char drawconnect_mask_bits[] = {
+static char drawconnect_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawcrook_curs.h b/vcl/unx/source/inc/drawcrook_curs.h
index e89e91322432..8f51e4259549 100644
--- a/vcl/unx/source/inc/drawcrook_curs.h
+++ b/vcl/unx/source/inc/drawcrook_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawcrook_curs_height 32
#define drawcrook_curs_x_hot 15
#define drawcrook_curs_y_hot 14
-static unsigned char drawcrook_curs_bits[] = {
+static char drawcrook_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7c, 0x3e, 0xff, 0x7f, 0xbb, 0xdd, 0xfe,
diff --git a/vcl/unx/source/inc/drawcrook_mask.h b/vcl/unx/source/inc/drawcrook_mask.h
index b42d2591d123..35dd1f0025c4 100644
--- a/vcl/unx/source/inc/drawcrook_mask.h
+++ b/vcl/unx/source/inc/drawcrook_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawcrook_mask_width 32
#define drawcrook_mask_height 32
-static unsigned char drawcrook_mask_bits[] = {
+static char drawcrook_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x83, 0xc1, 0x00, 0x80, 0xc7, 0xe3, 0x01, 0xc0, 0xef, 0xf7, 0x03,
diff --git a/vcl/unx/source/inc/drawcrop_curs.h b/vcl/unx/source/inc/drawcrop_curs.h
index 903c5b314418..f391767f5956 100644
--- a/vcl/unx/source/inc/drawcrop_curs.h
+++ b/vcl/unx/source/inc/drawcrop_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawcrop_curs_height 32
#define drawcrop_curs_x_hot 9
#define drawcrop_curs_y_hot 9
-static unsigned char drawcrop_curs_bits[] = {
+static char drawcrop_curs_bits[] = {
0xff, 0x0f, 0xff, 0xff, 0xff, 0x6f, 0xff, 0xff, 0xff, 0x6f, 0xff, 0xff,
0x07, 0x60, 0xf8, 0xff, 0xf7, 0x6f, 0xfb, 0xff, 0xf7, 0x6f, 0xfb, 0xff,
0x37, 0x60, 0xf8, 0xff, 0xb7, 0x6f, 0xff, 0xff, 0xb7, 0x6f, 0xff, 0xff,
diff --git a/vcl/unx/source/inc/drawcrop_mask.h b/vcl/unx/source/inc/drawcrop_mask.h
index eea6b4448146..df92dc936936 100644
--- a/vcl/unx/source/inc/drawcrop_mask.h
+++ b/vcl/unx/source/inc/drawcrop_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawcrop_mask_width 32
#define drawcrop_mask_height 32
-static unsigned char drawcrop_mask_bits[] = {
+static char drawcrop_mask_bits[] = {
0x00, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0xfc, 0xff, 0x0f, 0x00,
0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00,
0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xf8, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/drawellipse_curs.h b/vcl/unx/source/inc/drawellipse_curs.h
index 5928139b81f3..d74629025340 100644
--- a/vcl/unx/source/inc/drawellipse_curs.h
+++ b/vcl/unx/source/inc/drawellipse_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawellipse_curs_height 32
#define drawellipse_curs_x_hot 7
#define drawellipse_curs_y_hot 7
-static unsigned char drawellipse_curs_bits[] = {
+static char drawellipse_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawellipse_mask.h b/vcl/unx/source/inc/drawellipse_mask.h
index 72ceedfb57ee..317a2555adad 100644
--- a/vcl/unx/source/inc/drawellipse_mask.h
+++ b/vcl/unx/source/inc/drawellipse_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawellipse_mask_width 32
#define drawellipse_mask_height 32
-static unsigned char drawellipse_mask_bits[] = {
+static char drawellipse_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawfreehand_curs.h b/vcl/unx/source/inc/drawfreehand_curs.h
index 644d5bbb639d..9951b6f019b7 100644
--- a/vcl/unx/source/inc/drawfreehand_curs.h
+++ b/vcl/unx/source/inc/drawfreehand_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawfreehand_curs_height 32
#define drawfreehand_curs_x_hot 8
#define drawfreehand_curs_y_hot 8
-static unsigned char drawfreehand_curs_bits[] = {
+static char drawfreehand_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xfd, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawfreehand_mask.h b/vcl/unx/source/inc/drawfreehand_mask.h
index 959a54e827fe..f816c3d26d4d 100644
--- a/vcl/unx/source/inc/drawfreehand_mask.h
+++ b/vcl/unx/source/inc/drawfreehand_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawfreehand_mask_width 32
#define drawfreehand_mask_height 32
-static unsigned char drawfreehand_mask_bits[] = {
+static char drawfreehand_mask_bits[] = {
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/drawline_curs.h b/vcl/unx/source/inc/drawline_curs.h
index 84f78ccec876..d9eb9818c40f 100644
--- a/vcl/unx/source/inc/drawline_curs.h
+++ b/vcl/unx/source/inc/drawline_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawline_curs_height 32
#define drawline_curs_x_hot 7
#define drawline_curs_y_hot 7
-static unsigned char drawline_curs_bits[] = {
+static char drawline_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawline_mask.h b/vcl/unx/source/inc/drawline_mask.h
index 80784ca860b6..6a35aad09b07 100644
--- a/vcl/unx/source/inc/drawline_mask.h
+++ b/vcl/unx/source/inc/drawline_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawline_mask_width 32
#define drawline_mask_height 32
-static unsigned char drawline_mask_bits[] = {
+static char drawline_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0xfe, 0x00, 0x00, 0xbf, 0xfe, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawmirror_curs.h b/vcl/unx/source/inc/drawmirror_curs.h
index b68907138e42..ce9c4a2f5507 100644
--- a/vcl/unx/source/inc/drawmirror_curs.h
+++ b/vcl/unx/source/inc/drawmirror_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawmirror_curs_height 32
#define drawmirror_curs_x_hot 14
#define drawmirror_curs_y_hot 12
-static unsigned char drawmirror_curs_bits[] = {
+static char drawmirror_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0x03, 0xf8, 0xf5, 0xff,
0xfb, 0xfb, 0xee, 0xff, 0x0b, 0xfa, 0xf5, 0xff, 0xeb, 0xfa, 0xfa, 0xff,
0xeb, 0xfa, 0xfa, 0xff, 0xeb, 0x7a, 0xfd, 0xff, 0xeb, 0x7a, 0xfd, 0xff,
diff --git a/vcl/unx/source/inc/drawmirror_mask.h b/vcl/unx/source/inc/drawmirror_mask.h
index 231f109a24ae..d95ca93d59f1 100644
--- a/vcl/unx/source/inc/drawmirror_mask.h
+++ b/vcl/unx/source/inc/drawmirror_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawmirror_mask_width 32
#define drawmirror_mask_height 32
-static unsigned char drawmirror_mask_bits[] = {
+static char drawmirror_mask_bits[] = {
0x00, 0x00, 0x04, 0x00, 0xfe, 0x0f, 0x0e, 0x00, 0xfe, 0x0f, 0x1f, 0x00,
0xfe, 0x8f, 0x3f, 0x00, 0xfe, 0x0f, 0x1f, 0x00, 0xfe, 0x8f, 0x0f, 0x00,
0xbe, 0x8f, 0x0f, 0x00, 0xbe, 0xcf, 0x07, 0x00, 0xbe, 0xcf, 0x87, 0x00,
diff --git a/vcl/unx/source/inc/drawpie_curs.h b/vcl/unx/source/inc/drawpie_curs.h
index 1cc5933c88b3..7162700fd417 100644
--- a/vcl/unx/source/inc/drawpie_curs.h
+++ b/vcl/unx/source/inc/drawpie_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawpie_curs_height 32
#define drawpie_curs_x_hot 7
#define drawpie_curs_y_hot 7
-static unsigned char drawpie_curs_bits[] = {
+static char drawpie_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawpie_mask.h b/vcl/unx/source/inc/drawpie_mask.h
index 880be6043497..dad908d943be 100644
--- a/vcl/unx/source/inc/drawpie_mask.h
+++ b/vcl/unx/source/inc/drawpie_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawpie_mask_width 32
#define drawpie_mask_height 32
-static unsigned char drawpie_mask_bits[] = {
+static char drawpie_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawpolygon_curs.h b/vcl/unx/source/inc/drawpolygon_curs.h
index a101b1bff576..38eb036d8b13 100644
--- a/vcl/unx/source/inc/drawpolygon_curs.h
+++ b/vcl/unx/source/inc/drawpolygon_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawpolygon_curs_height 32
#define drawpolygon_curs_x_hot 7
#define drawpolygon_curs_y_hot 7
-static unsigned char drawpolygon_curs_bits[] = {
+static char drawpolygon_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawpolygon_mask.h b/vcl/unx/source/inc/drawpolygon_mask.h
index 660bee287c09..a1346d8c8cb6 100644
--- a/vcl/unx/source/inc/drawpolygon_mask.h
+++ b/vcl/unx/source/inc/drawpolygon_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawpolygon_mask_width 32
#define drawpolygon_mask_height 32
-static unsigned char drawpolygon_mask_bits[] = {
+static char drawpolygon_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawrect_curs.h b/vcl/unx/source/inc/drawrect_curs.h
index 553df540aa29..0b2b0b7e39d4 100644
--- a/vcl/unx/source/inc/drawrect_curs.h
+++ b/vcl/unx/source/inc/drawrect_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawrect_curs_height 32
#define drawrect_curs_x_hot 7
#define drawrect_curs_y_hot 7
-static unsigned char drawrect_curs_bits[] = {
+static char drawrect_curs_bits[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawrect_mask.h b/vcl/unx/source/inc/drawrect_mask.h
index 3bb39e1d98a8..d6e6d70f80c2 100644
--- a/vcl/unx/source/inc/drawrect_mask.h
+++ b/vcl/unx/source/inc/drawrect_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawrect_mask_width 32
#define drawrect_mask_height 32
-static unsigned char drawrect_mask_bits[] = {
+static char drawrect_mask_bits[] = {
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
0x3f, 0x7e, 0x00, 0x00, 0xbf, 0x7e, 0x00, 0x00, 0x3f, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawtext_curs.h b/vcl/unx/source/inc/drawtext_curs.h
index 67726d6e5a2d..645dcd51a660 100644
--- a/vcl/unx/source/inc/drawtext_curs.h
+++ b/vcl/unx/source/inc/drawtext_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define drawtext_curs_height 32
#define drawtext_curs_x_hot 8
#define drawtext_curs_y_hot 8
-static unsigned char drawtext_curs_bits[] = {
+static char drawtext_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xfd, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/drawtext_mask.h b/vcl/unx/source/inc/drawtext_mask.h
index ce1fc2c41053..50e42a0dda24 100644
--- a/vcl/unx/source/inc/drawtext_mask.h
+++ b/vcl/unx/source/inc/drawtext_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define drawtext_mask_width 32
#define drawtext_mask_height 32
-static unsigned char drawtext_mask_bits[] = {
+static char drawtext_mask_bits[] = {
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/fill_curs.h b/vcl/unx/source/inc/fill_curs.h
index c8dfbb274f13..fe01c07c4045 100644
--- a/vcl/unx/source/inc/fill_curs.h
+++ b/vcl/unx/source/inc/fill_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define fill_curs_height 32
#define fill_curs_x_hot 10
#define fill_curs_y_hot 22
-static unsigned char fill_curs_bits[] = {
+static char fill_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x80,0x02,0x00,0x00,0x5c,0x0c,0x00,0x00,
diff --git a/vcl/unx/source/inc/fill_mask.h b/vcl/unx/source/inc/fill_mask.h
index 32b25ae67660..233a506976b4 100644
--- a/vcl/unx/source/inc/fill_mask.h
+++ b/vcl/unx/source/inc/fill_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define fill_mask_height 32
#define fill_mask_x_hot 10
#define fill_mask_y_hot 22
-static unsigned char fill_mask_bits[] = {
+static char fill_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x80,0x03,0x00,0x00,0xdc,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/hshear_curs.h b/vcl/unx/source/inc/hshear_curs.h
index edaa9fe7958b..4d6ca8c27a93 100644
--- a/vcl/unx/source/inc/hshear_curs.h
+++ b/vcl/unx/source/inc/hshear_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define hshear_curs_height 32
#define hshear_curs_x_hot 15
#define hshear_curs_y_hot 15
-static unsigned char hshear_curs_bits[] = {
+static char hshear_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/hshear_mask.h b/vcl/unx/source/inc/hshear_mask.h
index 5c6f9a017e5a..30318acf0e49 100644
--- a/vcl/unx/source/inc/hshear_mask.h
+++ b/vcl/unx/source/inc/hshear_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define hshear_mask_width 32
#define hshear_mask_height 32
-static unsigned char hshear_mask_bits[] = {
+static char hshear_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/invert50.h b/vcl/unx/source/inc/invert50.h
index b1f4c1e86d18..cac73ae30923 100644
--- a/vcl/unx/source/inc/invert50.h
+++ b/vcl/unx/source/inc/invert50.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define invert50_width 32
#define invert50_height 32
-static unsigned char invert50_bits[] = {
+static char invert50_bits[] = {
#if 1
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
diff --git a/vcl/unx/source/inc/linkdata_curs.h b/vcl/unx/source/inc/linkdata_curs.h
index 054ef55ef2bb..5c0feab91cbd 100644
--- a/vcl/unx/source/inc/linkdata_curs.h
+++ b/vcl/unx/source/inc/linkdata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkdata_curs_height 32
#define linkdata_curs_x_hot 1
#define linkdata_curs_y_hot 1
-static unsigned char linkdata_curs_bits[] = {
+static char linkdata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/linkdata_mask.h b/vcl/unx/source/inc/linkdata_mask.h
index 429c603066dc..a84059c079c7 100644
--- a/vcl/unx/source/inc/linkdata_mask.h
+++ b/vcl/unx/source/inc/linkdata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkdata_mask_height 32
#define linkdata_mask_x_hot 1
#define linkdata_mask_y_hot 1
-static unsigned char linkdata_mask_bits[] = {
+static char linkdata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/linkfile_curs.h b/vcl/unx/source/inc/linkfile_curs.h
index 5f68af135810..3f8cd201fead 100644
--- a/vcl/unx/source/inc/linkfile_curs.h
+++ b/vcl/unx/source/inc/linkfile_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkfile_curs_height 32
#define linkfile_curs_x_hot 9
#define linkfile_curs_y_hot 9
-static unsigned char linkfile_curs_bits[] = {
+static char linkfile_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/linkfile_mask.h b/vcl/unx/source/inc/linkfile_mask.h
index fad8d6ad7624..84469d8e0120 100644
--- a/vcl/unx/source/inc/linkfile_mask.h
+++ b/vcl/unx/source/inc/linkfile_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define linkfile_mask_height 32
#define linkfile_mask_x_hot 9
#define linkfile_mask_y_hot 9
-static unsigned char linkfile_mask_bits[] = {
+static char linkfile_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/magnify_curs.h b/vcl/unx/source/inc/magnify_curs.h
index 4db8bb382b15..a830af41ed4e 100644
--- a/vcl/unx/source/inc/magnify_curs.h
+++ b/vcl/unx/source/inc/magnify_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define magnify_curs_height 32
#define magnify_curs_x_hot 12
#define magnify_curs_y_hot 13
-static unsigned char magnify_curs_bits[] = {
+static char magnify_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x83,
0x01,0x00,0x80,0x00,0x02,0x00,0x40,0x00,0x04,0x00,0x40,0x00,0x04,0x00,0x20,
diff --git a/vcl/unx/source/inc/magnify_mask.h b/vcl/unx/source/inc/magnify_mask.h
index a7b5b027362d..8dc4956bac4a 100644
--- a/vcl/unx/source/inc/magnify_mask.h
+++ b/vcl/unx/source/inc/magnify_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define magnify_mask_width 32
#define magnify_mask_height 32
-static unsigned char magnify_mask_bits[] = {
+static char magnify_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
0x00, 0xff, 0x01, 0x00, 0x80, 0xff, 0x03, 0x00, 0xc0, 0x83, 0x07, 0x00,
diff --git a/vcl/unx/source/inc/mirror_curs.h b/vcl/unx/source/inc/mirror_curs.h
index c2488a6fd725..c5fc1099846f 100644
--- a/vcl/unx/source/inc/mirror_curs.h
+++ b/vcl/unx/source/inc/mirror_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define mirror_curs_height 32
#define mirror_curs_x_hot 14
#define mirror_curs_y_hot 12
-static unsigned char mirror_curs_bits[] = {
+static char mirror_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0x03, 0xf8, 0xf5, 0xff,
0xfb, 0xfb, 0xee, 0xff, 0x0b, 0xfa, 0xf5, 0xff, 0xeb, 0xfa, 0xfa, 0xff,
0xeb, 0xfa, 0xfa, 0xff, 0xeb, 0x7a, 0xfd, 0xff, 0xeb, 0x7a, 0xfd, 0xff,
diff --git a/vcl/unx/source/inc/mirror_mask.h b/vcl/unx/source/inc/mirror_mask.h
index 60e8f1593b2b..031614243b7a 100644
--- a/vcl/unx/source/inc/mirror_mask.h
+++ b/vcl/unx/source/inc/mirror_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define mirror_mask_width 32
#define mirror_mask_height 32
-static unsigned char mirror_mask_bits[] = {
+static char mirror_mask_bits[] = {
0x00, 0x00, 0x04, 0x00, 0xfe, 0x0f, 0x0e, 0x00, 0xfe, 0x0f, 0x1f, 0x00,
0xfe, 0x8f, 0x3f, 0x00, 0xfe, 0x0f, 0x1f, 0x00, 0xfe, 0x8f, 0x0f, 0x00,
0xbe, 0x8f, 0x0f, 0x00, 0xbe, 0xcf, 0x07, 0x00, 0xbe, 0xcf, 0x87, 0x00,
diff --git a/vcl/unx/source/inc/movebezierweight_curs.h b/vcl/unx/source/inc/movebezierweight_curs.h
index df99aab7ea0f..e26fdd00fc71 100644
--- a/vcl/unx/source/inc/movebezierweight_curs.h
+++ b/vcl/unx/source/inc/movebezierweight_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movebezierweight_curs_height 32
#define movebezierweight_curs_x_hot 0
#define movebezierweight_curs_y_hot 0
-static unsigned char movebezierweight_curs_bits[] = {
+static char movebezierweight_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff,
0xf1, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff,
0x81, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff,
diff --git a/vcl/unx/source/inc/movebezierweight_mask.h b/vcl/unx/source/inc/movebezierweight_mask.h
index 831f427a9086..7f7223c4d0fc 100644
--- a/vcl/unx/source/inc/movebezierweight_mask.h
+++ b/vcl/unx/source/inc/movebezierweight_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define movebezierweight_mask_width 32
#define movebezierweight_mask_height 32
-static unsigned char movebezierweight_mask_bits[] = {
+static char movebezierweight_mask_bits[] = {
0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movedata_curs.h b/vcl/unx/source/inc/movedata_curs.h
index 642bbd176e4b..cdbc15d948b9 100644
--- a/vcl/unx/source/inc/movedata_curs.h
+++ b/vcl/unx/source/inc/movedata_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedata_curs_height 32
#define movedata_curs_x_hot 1
#define movedata_curs_y_hot 1
-static unsigned char movedata_curs_bits[] = {
+static char movedata_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movedata_mask.h b/vcl/unx/source/inc/movedata_mask.h
index f06c80f1728c..a10d7eab5f51 100644
--- a/vcl/unx/source/inc/movedata_mask.h
+++ b/vcl/unx/source/inc/movedata_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedata_mask_height 32
#define movedata_mask_x_hot 1
#define movedata_mask_y_hot 1
-static unsigned char movedata_mask_bits[] = {
+static char movedata_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movedlnk_curs.h b/vcl/unx/source/inc/movedlnk_curs.h
index c163488d8d26..416f0727e3b8 100644
--- a/vcl/unx/source/inc/movedlnk_curs.h
+++ b/vcl/unx/source/inc/movedlnk_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedlnk_curs_height 32
#define movedlnk_curs_x_hot 1
#define movedlnk_curs_y_hot 1
-static unsigned char movedlnk_curs_bits[] = {
+static char movedlnk_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movedlnk_mask.h b/vcl/unx/source/inc/movedlnk_mask.h
index 8f3fa3cb92f6..7c33bb10fc71 100644
--- a/vcl/unx/source/inc/movedlnk_mask.h
+++ b/vcl/unx/source/inc/movedlnk_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movedlnk_mask_height 32
#define movedlnk_mask_x_hot 1
#define movedlnk_mask_y_hot 1
-static unsigned char movedlnk_mask_bits[] = {
+static char movedlnk_mask_bits[] = {
0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movefile_curs.h b/vcl/unx/source/inc/movefile_curs.h
index 54c3ce91df96..36af625a342f 100644
--- a/vcl/unx/source/inc/movefile_curs.h
+++ b/vcl/unx/source/inc/movefile_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movefile_curs_height 32
#define movefile_curs_x_hot 9
#define movefile_curs_y_hot 9
-static unsigned char movefile_curs_bits[] = {
+static char movefile_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movefile_mask.h b/vcl/unx/source/inc/movefile_mask.h
index 566b3fdeb8de..a7954819e330 100644
--- a/vcl/unx/source/inc/movefile_mask.h
+++ b/vcl/unx/source/inc/movefile_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movefile_mask_height 32
#define movefile_mask_x_hot 9
#define movefile_mask_y_hot 9
-static unsigned char movefile_mask_bits[] = {
+static char movefile_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movefiles_curs.h b/vcl/unx/source/inc/movefiles_curs.h
index 95ec95bd8302..200c178f3897 100644
--- a/vcl/unx/source/inc/movefiles_curs.h
+++ b/vcl/unx/source/inc/movefiles_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movefiles_curs_height 32
#define movefiles_curs_x_hot 8
#define movefiles_curs_y_hot 9
-static unsigned char movefiles_curs_bits[] = {
+static char movefiles_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xe0, 0x2f, 0x00, 0x00,
0xe8, 0x0f, 0x00, 0x00, 0xe8, 0x7f, 0x00, 0x00, 0xea, 0x7f, 0x00, 0x00,
0xea, 0x7f, 0x00, 0x00, 0xea, 0x7f, 0x00, 0x00, 0x6a, 0x7e, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movefiles_mask.h b/vcl/unx/source/inc/movefiles_mask.h
index 03a56a169218..f544029308ef 100644
--- a/vcl/unx/source/inc/movefiles_mask.h
+++ b/vcl/unx/source/inc/movefiles_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movefiles_mask_height 32
#define movefiles_mask_x_hot 8
#define movefiles_mask_y_hot 9
-static unsigned char movefiles_mask_bits[] = {
+static char movefiles_mask_bits[] = {
0xf0, 0x1f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00,
0xfc, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/moveflnk_curs.h b/vcl/unx/source/inc/moveflnk_curs.h
index 1f1fea56dead..2b1071a6203c 100644
--- a/vcl/unx/source/inc/moveflnk_curs.h
+++ b/vcl/unx/source/inc/moveflnk_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define moveflnk_curs_height 32
#define moveflnk_curs_x_hot 9
#define moveflnk_curs_y_hot 9
-static unsigned char moveflnk_curs_bits[] = {
+static char moveflnk_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x00,
0xfe, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00,
0xfe, 0x07, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/moveflnk_mask.h b/vcl/unx/source/inc/moveflnk_mask.h
index f8312aba525e..124e7eb2f674 100644
--- a/vcl/unx/source/inc/moveflnk_mask.h
+++ b/vcl/unx/source/inc/moveflnk_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define moveflnk_mask_height 32
#define moveflnk_mask_x_hot 9
#define moveflnk_mask_y_hot 9
-static unsigned char moveflnk_mask_bits[] = {
+static char moveflnk_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/movepoint_curs.h b/vcl/unx/source/inc/movepoint_curs.h
index 8ccf2d581455..9dcb3a11f135 100644
--- a/vcl/unx/source/inc/movepoint_curs.h
+++ b/vcl/unx/source/inc/movepoint_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define movepoint_curs_height 32
#define movepoint_curs_x_hot 0
#define movepoint_curs_y_hot 0
-static unsigned char movepoint_curs_bits[] = {
+static char movepoint_curs_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff,
0xf1, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff,
0x81, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff,
diff --git a/vcl/unx/source/inc/movepoint_mask.h b/vcl/unx/source/inc/movepoint_mask.h
index 547dfb03a87e..8e535d6970ed 100644
--- a/vcl/unx/source/inc/movepoint_mask.h
+++ b/vcl/unx/source/inc/movepoint_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define movepoint_mask_width 32
#define movepoint_mask_height 32
-static unsigned char movepoint_mask_bits[] = {
+static char movepoint_mask_bits[] = {
0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/nodrop_curs.h b/vcl/unx/source/inc/nodrop_curs.h
index 5c501d3876c4..82efb546d2f0 100644
--- a/vcl/unx/source/inc/nodrop_curs.h
+++ b/vcl/unx/source/inc/nodrop_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define nodrop_curs_height 32
#define nodrop_curs_x_hot 9
#define nodrop_curs_y_hot 9
-static unsigned char nodrop_curs_bits[] = {
+static char nodrop_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
0xf8, 0x7f, 0x00, 0x00, 0x7c, 0xf8, 0x00, 0x00, 0x1c, 0xfc, 0x00, 0x00,
0x1e, 0xfe, 0x01, 0x00, 0x0e, 0xdf, 0x01, 0x00, 0x8e, 0xcf, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/nodrop_mask.h b/vcl/unx/source/inc/nodrop_mask.h
index bd315dc28df1..c3fa9cda4af4 100644
--- a/vcl/unx/source/inc/nodrop_mask.h
+++ b/vcl/unx/source/inc/nodrop_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define nodrop_mask_height 32
#define nodrop_mask_x_hot 9
#define nodrop_mask_y_hot 9
-static unsigned char nodrop_mask_bits[] = {
+static char nodrop_mask_bits[] = {
0xc0, 0x0f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,
0xfc, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x7e, 0xfe, 0x01, 0x00,
0x3f, 0xff, 0x03, 0x00, 0x9f, 0xff, 0x03, 0x00, 0xdf, 0xff, 0x03, 0x00,
diff --git a/vcl/unx/source/inc/null_curs.h b/vcl/unx/source/inc/null_curs.h
index 1f5687cbcf61..33463804df50 100644
--- a/vcl/unx/source/inc/null_curs.h
+++ b/vcl/unx/source/inc/null_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,8 +27,8 @@
************************************************************************/
#define nullcurs_width 4
#define nullcurs_height 4
-#define nullcurs_x_hot 2
+#define nullcurs_x_hot 2
#define nullcurs_y_hot 2
-static unsigned char nullcurs_bits[] = { 0x00, 0x00 };
+static char nullcurs_bits[] = { 0x00, 0x00 };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/inc/null_mask.h b/vcl/unx/source/inc/null_mask.h
index e7ff46805d41..bb268b4101eb 100644
--- a/vcl/unx/source/inc/null_mask.h
+++ b/vcl/unx/source/inc/null_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,6 +27,6 @@
************************************************************************/
#define nullmask_width 4
#define nullmask_height 4
-static unsigned char nullmask_bits[] = { 0x00, 0x00 };
+static char nullmask_bits[] = { 0x00, 0x00 };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/inc/paintbrush_curs.h b/vcl/unx/source/inc/paintbrush_curs.h
index 1e3cef066ddc..ccdbd42e3cb1 100644
--- a/vcl/unx/source/inc/paintbrush_curs.h
+++ b/vcl/unx/source/inc/paintbrush_curs.h
@@ -3,7 +3,7 @@
#define paintbrush_curs_height 16
#define paintbrush_curs_x_hot 0
#define paintbrush_curs_y_hot 10
-static unsigned char paintbrush_curs_bits[] = {
+static char paintbrush_curs_bits[] = {
0x00, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x90, 0x80, 0xcb, 0x60, 0x64,
0x90, 0x34, 0x08, 0x19, 0x06, 0x22, 0x11, 0x24, 0x09, 0x18, 0x46, 0x14,
0x24, 0x0a, 0x18, 0x05, 0x90, 0x02, 0xe0, 0x01 };
diff --git a/vcl/unx/source/inc/paintbrush_mask.h b/vcl/unx/source/inc/paintbrush_mask.h
index 4e3000d3b981..2b644a19aa09 100644
--- a/vcl/unx/source/inc/paintbrush_mask.h
+++ b/vcl/unx/source/inc/paintbrush_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define paintbrush_mask_width 16
#define paintbrush_mask_height 16
-static unsigned char paintbrush_mask_bits[] = {
+static char paintbrush_mask_bits[] = {
0x00, 0x80, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x80, 0xfb, 0xe0, 0x7f,
0xf0, 0x3f, 0xf8, 0x1f, 0xfe, 0x3f, 0xff, 0x3f, 0xff, 0x1f, 0xfe, 0x1f,
0xfc, 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01 };
diff --git a/vcl/unx/source/inc/pivotcol_curs.h b/vcl/unx/source/inc/pivotcol_curs.h
index dcd7e321fd2e..edbab88c1670 100644
--- a/vcl/unx/source/inc/pivotcol_curs.h
+++ b/vcl/unx/source/inc/pivotcol_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotcol_curs_height 32
#define pivotcol_curs_x_hot 7
#define pivotcol_curs_y_hot 5
-static unsigned char pivotcol_curs_bits[] = {
+static char pivotcol_curs_bits[] = {
0xff, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00,
0x29, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00,
0x95, 0x01, 0x00, 0x00, 0xa9, 0x02, 0x00, 0x00, 0x95, 0x04, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/pivotcol_mask.h b/vcl/unx/source/inc/pivotcol_mask.h
index b5537c03ec9f..8641f8ad1600 100644
--- a/vcl/unx/source/inc/pivotcol_mask.h
+++ b/vcl/unx/source/inc/pivotcol_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotcol_mask_height 32
#define pivotcol_mask_x_hot 7
#define pivotcol_mask_y_hot 5
-static unsigned char pivotcol_mask_bits[] = {
+static char pivotcol_mask_bits[] = {
0xff, 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00,
0xff, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/pivotdel_curs.h b/vcl/unx/source/inc/pivotdel_curs.h
index 18348b9e21df..b748cf44f546 100644
--- a/vcl/unx/source/inc/pivotdel_curs.h
+++ b/vcl/unx/source/inc/pivotdel_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotdel_curs_height 32
#define pivotdel_curs_x_hot 9
#define pivotdel_curs_y_hot 8
-static unsigned char pivotdel_curs_bits[] = {
+static char pivotdel_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00,
0x3c, 0xc0, 0x00, 0x00, 0x73, 0x6f, 0x07, 0x00, 0xe1, 0x30, 0x04, 0x00,
0xc1, 0x1d, 0x04, 0x00, 0x81, 0x0f, 0x04, 0x00, 0x01, 0x07, 0x04, 0x00,
diff --git a/vcl/unx/source/inc/pivotdel_mask.h b/vcl/unx/source/inc/pivotdel_mask.h
index bf2e2379f194..1ec977c4ff2e 100644
--- a/vcl/unx/source/inc/pivotdel_mask.h
+++ b/vcl/unx/source/inc/pivotdel_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotdel_mask_height 32
#define pivotdel_mask_x_hot 9
#define pivotdel_mask_y_hot 8
-static unsigned char pivotdel_mask_bits[] = {
+static char pivotdel_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00,
0x3c, 0xc0, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
diff --git a/vcl/unx/source/inc/pivotfld_curs.h b/vcl/unx/source/inc/pivotfld_curs.h
index 424179cbfe16..e6ab497e76ee 100644
--- a/vcl/unx/source/inc/pivotfld_curs.h
+++ b/vcl/unx/source/inc/pivotfld_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotfld_curs_height 32
#define pivotfld_curs_x_hot 8
#define pivotfld_curs_y_hot 7
-static unsigned char pivotfld_curs_bits[] = {
+static char pivotfld_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00,
0x01, 0x00, 0x04, 0x00, 0x01, 0x01, 0x04, 0x00, 0x01, 0x03, 0x04, 0x00,
diff --git a/vcl/unx/source/inc/pivotfld_mask.h b/vcl/unx/source/inc/pivotfld_mask.h
index e768b4b26889..78d14156ed8d 100644
--- a/vcl/unx/source/inc/pivotfld_mask.h
+++ b/vcl/unx/source/inc/pivotfld_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotfld_mask_height 32
#define pivotfld_mask_x_hot 8
#define pivotfld_mask_y_hot 7
-static unsigned char pivotfld_mask_bits[] = {
+static char pivotfld_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
diff --git a/vcl/unx/source/inc/pivotrow_curs.h b/vcl/unx/source/inc/pivotrow_curs.h
index 1b6060ea5b8b..9e141b8613f7 100644
--- a/vcl/unx/source/inc/pivotrow_curs.h
+++ b/vcl/unx/source/inc/pivotrow_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotrow_curs_height 32
#define pivotrow_curs_x_hot 8
#define pivotrow_curs_y_hot 7
-static unsigned char pivotrow_curs_bits[] = {
+static char pivotrow_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0x01, 0x00, 0x04, 0x00, 0x55, 0x55, 0x07, 0x00, 0xa9, 0xaa, 0x06, 0x00,
0x55, 0x54, 0x07, 0x00, 0x29, 0xa9, 0x06, 0x00, 0x55, 0x53, 0x07, 0x00,
diff --git a/vcl/unx/source/inc/pivotrow_mask.h b/vcl/unx/source/inc/pivotrow_mask.h
index f6ea09498aa0..8b47ce25c0a3 100644
--- a/vcl/unx/source/inc/pivotrow_mask.h
+++ b/vcl/unx/source/inc/pivotrow_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define pivotrow_mask_height 32
#define pivotrow_curs_x_hot 8
#define pivotrow_curs_y_hot 7
-static unsigned char pivotrow_mask_bits[] = {
+static char pivotrow_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,
diff --git a/vcl/unx/source/inc/rotate_curs.h b/vcl/unx/source/inc/rotate_curs.h
index c6550475c989..e748c0bd7ef2 100644
--- a/vcl/unx/source/inc/rotate_curs.h
+++ b/vcl/unx/source/inc/rotate_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define rotate_curs_height 32
#define rotate_curs_x_hot 15
#define rotate_curs_y_hot 15
-static unsigned char rotate_curs_bits[] = {
+static char rotate_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0xc0, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xd8, 0x00, 0x00,
diff --git a/vcl/unx/source/inc/rotate_mask.h b/vcl/unx/source/inc/rotate_mask.h
index 12790cca4beb..0bcf316a0988 100644
--- a/vcl/unx/source/inc/rotate_mask.h
+++ b/vcl/unx/source/inc/rotate_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define rotate_mask_width 32
#define rotate_mask_height 32
-static unsigned char rotate_mask_bits[] = {
+static char rotate_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
0x00, 0xe0, 0x01, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xfc, 0x01, 0x00,
diff --git a/vcl/unx/source/inc/salcursors.h b/vcl/unx/source/inc/salcursors.h
index 997b94c90054..1aeaa5b317bd 100644
--- a/vcl/unx/source/inc/salcursors.h
+++ b/vcl/unx/source/inc/salcursors.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/unx/source/inc/tblsele_curs.h b/vcl/unx/source/inc/tblsele_curs.h
index 21bcfd1fdd9f..40b14520f7d6 100644
--- a/vcl/unx/source/inc/tblsele_curs.h
+++ b/vcl/unx/source/inc/tblsele_curs.h
@@ -3,7 +3,7 @@
#define tblsele_curs_height 16
#define tblsele_curs_x_hot 14
#define tblsele_curs_y_hot 8
-static unsigned char tblsele_curs_bits[] = {
+static char tblsele_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c,
0x00, 0x1c, 0xfc, 0x3f, 0xfc, 0x7f, 0xfc, 0x3f, 0x00, 0x1c, 0x00, 0x0c,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblsele_mask.h b/vcl/unx/source/inc/tblsele_mask.h
index 2a555e83d884..28d5e8b6e003 100644
--- a/vcl/unx/source/inc/tblsele_mask.h
+++ b/vcl/unx/source/inc/tblsele_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define tblsele_mask_width 16
#define tblsele_mask_height 16
-static unsigned char tblsele_mask_bits[] = {
+static char tblsele_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x1e,
0xfe, 0x3f, 0xfe, 0x7f, 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0x00, 0x1e,
0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblsels_curs.h b/vcl/unx/source/inc/tblsels_curs.h
index fb739951e9f4..2e4be684d8db 100644
--- a/vcl/unx/source/inc/tblsels_curs.h
+++ b/vcl/unx/source/inc/tblsels_curs.h
@@ -3,7 +3,7 @@
#define tblsels_curs_height 16
#define tblsels_curs_x_hot 7
#define tblsels_curs_y_hot 14
-static unsigned char tblsels_curs_bits[] = {
+static char tblsels_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xf8, 0x0f, 0xf0, 0x07,
0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblsels_mask.h b/vcl/unx/source/inc/tblsels_mask.h
index 5a75aabe4c51..ad41a0b4377c 100644
--- a/vcl/unx/source/inc/tblsels_mask.h
+++ b/vcl/unx/source/inc/tblsels_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define tblsels_mask_width 16
#define tblsels_mask_height 16
-static unsigned char tblsels_mask_bits[] = {
+static char tblsels_mask_bits[] = {
0x00, 0x00, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03,
0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f, 0xf8, 0x0f,
0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00 };
diff --git a/vcl/unx/source/inc/tblselse_curs.h b/vcl/unx/source/inc/tblselse_curs.h
index fb34ff02b574..9a8d3b9d423d 100644
--- a/vcl/unx/source/inc/tblselse_curs.h
+++ b/vcl/unx/source/inc/tblselse_curs.h
@@ -3,7 +3,7 @@
#define tblselse_curs_height 16
#define tblselse_curs_x_hot 14
#define tblselse_curs_y_hot 14
-static unsigned char tblselse_curs_bits[] = {
+static char tblselse_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xf0, 0x00,
0xf0, 0x01, 0xe0, 0x03, 0xc0, 0x47, 0x80, 0x6f, 0x00, 0x7f, 0x00, 0x7e,
0x00, 0x7c, 0x00, 0x7e, 0x00, 0x7f, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblselse_mask.h b/vcl/unx/source/inc/tblselse_mask.h
index fc289854e3ea..32087f1cc30b 100644
--- a/vcl/unx/source/inc/tblselse_mask.h
+++ b/vcl/unx/source/inc/tblselse_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define tblselse_mask_width 16
#define tblselse_mask_height 16
-static unsigned char tblselse_mask_bits[] = {
+static char tblselse_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xf0, 0x00, 0xf8, 0x01,
0xf8, 0x03, 0xf0, 0xc7, 0xe0, 0xef, 0xc0, 0xff, 0x80, 0xff, 0x00, 0xff,
0x00, 0xfe, 0x00, 0xff, 0x80, 0xff, 0x80, 0xff };
diff --git a/vcl/unx/source/inc/tblselsw_curs.h b/vcl/unx/source/inc/tblselsw_curs.h
index a421a18b815d..1bade5674398 100644
--- a/vcl/unx/source/inc/tblselsw_curs.h
+++ b/vcl/unx/source/inc/tblselsw_curs.h
@@ -3,7 +3,7 @@
#define tblselsw_curs_height 16
#define tblselsw_curs_x_hot 1
#define tblselsw_curs_y_hot 14
-static unsigned char tblselsw_curs_bits[] = {
+static char tblselsw_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0f,
0x80, 0x0f, 0xc0, 0x07, 0xe2, 0x03, 0xf6, 0x01, 0xfe, 0x00, 0x7e, 0x00,
0x3e, 0x00, 0x7e, 0x00, 0xfe, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblselsw_mask.h b/vcl/unx/source/inc/tblselsw_mask.h
index 14b49a9863fb..49fb462c878e 100644
--- a/vcl/unx/source/inc/tblselsw_mask.h
+++ b/vcl/unx/source/inc/tblselsw_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define tblselsw_mask_width 16
#define tblselsw_mask_height 16
-static unsigned char tblselsw_mask_bits[] = {
+static char tblselsw_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0f, 0x80, 0x1f,
0xc0, 0x1f, 0xe3, 0x0f, 0xf7, 0x07, 0xff, 0x03, 0xff, 0x01, 0xff, 0x00,
0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x01 };
diff --git a/vcl/unx/source/inc/tblselw_curs.h b/vcl/unx/source/inc/tblselw_curs.h
index 2ee9a0d4af20..2a7e325a2098 100644
--- a/vcl/unx/source/inc/tblselw_curs.h
+++ b/vcl/unx/source/inc/tblselw_curs.h
@@ -3,7 +3,7 @@
#define tblselw_curs_height 16
#define tblselw_curs_x_hot 1
#define tblselw_curs_y_hot 8
-static unsigned char tblselw_curs_bits[] = {
+static char tblselw_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x30, 0x00,
0x38, 0x00, 0xfc, 0x3f, 0xfe, 0x3f, 0xfc, 0x3f, 0x38, 0x00, 0x30, 0x00,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/tblselw_mask.h b/vcl/unx/source/inc/tblselw_mask.h
index 8fa5be7c724a..8f600a85a752 100644
--- a/vcl/unx/source/inc/tblselw_mask.h
+++ b/vcl/unx/source/inc/tblselw_mask.h
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define tblselw_mask_width 16
#define tblselw_mask_height 16
-static unsigned char tblselw_mask_bits[] = {
+static char tblselw_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00,
0xfc, 0x7f, 0xfe, 0x7f, 0xff, 0x7f, 0xfe, 0x7f, 0xfc, 0x7f, 0x78, 0x00,
0x70, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/vcl/unx/source/inc/timemove_curs.h b/vcl/unx/source/inc/timemove_curs.h
index ce5e2b6914b5..86f0991c5c84 100644
--- a/vcl/unx/source/inc/timemove_curs.h
+++ b/vcl/unx/source/inc/timemove_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define timemove_curs_height 32
#define timemove_curs_x_hot 16
#define timemove_curs_y_hot 16
-static unsigned char timemove_curs_bits[] = {
+static char timemove_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,0x00,0x00,
diff --git a/vcl/unx/source/inc/timemove_mask.h b/vcl/unx/source/inc/timemove_mask.h
index 42664e6998fb..b3a38cd9ecdd 100644
--- a/vcl/unx/source/inc/timemove_mask.h
+++ b/vcl/unx/source/inc/timemove_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define timemove_mask_height 32
#define timemove_mask_x_hot 16
#define timemove_mask_y_hot 16
-static unsigned char timemove_mask_bits[] = {
+static char timemove_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,0x00,0x00,0xe0,0x0f,0x00,0x00,
diff --git a/vcl/unx/source/inc/timesize_curs.h b/vcl/unx/source/inc/timesize_curs.h
index 99c75d4affb1..b9aa36dd0e18 100644
--- a/vcl/unx/source/inc/timesize_curs.h
+++ b/vcl/unx/source/inc/timesize_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define timesize_curs_height 32
#define timesize_curs_x_hot 16
#define timesize_curs_y_hot 16
-static unsigned char timesize_curs_bits[] = {
+static char timesize_curs_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xff,0xff,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
diff --git a/vcl/unx/source/inc/timesize_mask.h b/vcl/unx/source/inc/timesize_mask.h
index 68d03c95057f..b20150507e71 100644
--- a/vcl/unx/source/inc/timesize_mask.h
+++ b/vcl/unx/source/inc/timesize_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define timesize_mask_height 32
#define timesize_mask_x_hot 16
#define timesize_mask_y_hot 16
-static unsigned char timesize_mask_bits[] = {
+static char timesize_mask_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
0xff,0x03,0x80,0xff,0xff,0x03,0x80,0xff,0xff,0x03,0x80,0xff,0xff,0x03,0x80,
diff --git a/vcl/unx/source/inc/vertcurs_curs.h b/vcl/unx/source/inc/vertcurs_curs.h
index 5f8cfde93a8d..ebe103bf139d 100644
--- a/vcl/unx/source/inc/vertcurs_curs.h
+++ b/vcl/unx/source/inc/vertcurs_curs.h
@@ -1,9 +1,9 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define vertcurs_curs_width 16
#define vertcurs_curs_height 16
-#define vertcurs_curs_x_hot 8
+#define vertcurs_curs_x_hot 8
#define vertcurs_curs_y_hot 8
-static unsigned char vertcurs_curs_bits[] = {
+static char vertcurs_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x02, 0x40,
0x06, 0x60, 0xfc, 0x3f, 0x06, 0x60, 0x02, 0x40, 0x02, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/vcl/unx/source/inc/vertcurs_mask.h b/vcl/unx/source/inc/vertcurs_mask.h
index 05ac8246e52e..e472f367659e 100644
--- a/vcl/unx/source/inc/vertcurs_mask.h
+++ b/vcl/unx/source/inc/vertcurs_mask.h
@@ -1,9 +1,9 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#define vertcurs_mask_width 16
#define vertcurs_mask_height 16
-#define vertcurs_mask_x_hot 8
+#define vertcurs_mask_x_hot 8
#define vertcurs_mask_y_hot 8
-static unsigned char vertcurs_mask_bits[] = {
+static char vertcurs_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xf0,
0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0x0f, 0xf0, 0x07, 0xe0, 0x07, 0xe0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/vcl/unx/source/inc/vshear_curs.h b/vcl/unx/source/inc/vshear_curs.h
index c8f0f7dd4b8b..f9dc82f207f5 100644
--- a/vcl/unx/source/inc/vshear_curs.h
+++ b/vcl/unx/source/inc/vshear_curs.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#define vshear_curs_height 32
#define vshear_curs_x_hot 15
#define vshear_curs_y_hot 15
-static unsigned char vshear_curs_bits[] = {
+static char vshear_curs_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00,
diff --git a/vcl/unx/source/inc/vshear_mask.h b/vcl/unx/source/inc/vshear_mask.h
index 70b777a18d2f..5991a8b582b1 100644
--- a/vcl/unx/source/inc/vshear_mask.h
+++ b/vcl/unx/source/inc/vshear_mask.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
#define vshear_mask_width 32
#define vshear_mask_height 32
-static unsigned char vshear_mask_bits[] = {
+static char vshear_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x70, 0x0e, 0x00,
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index 1852b9550f2b..54f9752b56bc 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,13 +37,12 @@
#include "vcl/salinst.hxx"
#include "saldata.hxx"
-#include "vcl/printerinfomanager.hxx"
#include <cstdio>
#include <unistd.h>
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+using namespace rtl;
+
extern "C" {
typedef SalInstance*(*salFactoryProc)( oslModule pModule);
}
@@ -64,7 +63,7 @@ static const char * desktop_strings[] = { "none", "unknown", "GNOME", "KDE", "KD
static SalInstance* tryInstance( const OUString& rModuleBase )
{
SalInstance* pInst = NULL;
-
+
OUStringBuffer aModName( 128 );
aModName.appendAscii( SAL_DLLPREFIX"vclplug_" );
aModName.append( rModuleBase );
@@ -82,7 +81,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
{
pInst = aProc( aMod );
#if OSL_DEBUG_LEVEL > 1
- std::fprintf( stderr, "sal plugin %s produced instance %p\n",
+ std::fprintf( stderr, "sal plugin %s produced instance %p\n",
OUStringToOString( aModule, RTL_TEXTENCODING_ASCII_US ).getStr(),
pInst );
#endif
@@ -91,12 +90,12 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
pCloseModule = aMod;
/*
- * Recent GTK+ versions load their modules with RTLD_LOCAL, so we can
- * not access the 'gnome_accessibility_module_shutdown' anymore.
- * So make sure libgtk+ & co are still mapped into memory when
+ * Recent GTK+ versions load their modules with RTLD_LOCAL, so we can
+ * not access the 'gnome_accessibility_module_shutdown' anymore.
+ * So make sure libgtk+ & co are still mapped into memory when
* atk-bridge's atexit handler gets called.
*/
- if( rModuleBase.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("gtk")) )
+ if( rModuleBase.equalsAscii("gtk") )
{
pCloseModule = NULL;
}
@@ -104,11 +103,11 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
* #i109007# KDE3 seems to have the same problem; an atexit cleanup
* handler, which cannot be resolved anymore if the plugin is already unloaded.
*/
- else if( rModuleBase.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("kde")) )
+ else if( rModuleBase.equalsAscii("kde") )
{
pCloseModule = NULL;
}
-
+
GetSalData()->m_pPlugin = aMod;
}
else
@@ -128,7 +127,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
else
std::fprintf( stderr, "could not load shared object %s\n",
OUStringToOString( aModule, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
+#endif
return pInst;
}
@@ -143,7 +142,7 @@ static const rtl::OUString& get_desktop_environment()
aModName.appendAscii( SAL_DLLPOSTFIX );
aModName.appendAscii( SAL_DLLEXTENSION );
OUString aModule = aModName.makeStringAndClear();
-
+
oslModule aMod = osl_loadModuleRelative(
reinterpret_cast< oslGenericFunction >( &tryInstance ), aModule.pData,
SAL_LOADMODULE_DEFAULT );
@@ -165,12 +164,12 @@ static SalInstance* autodetect_plugin()
{
"kde4", "kde", "gtk", "gen", 0
};
-
+
static const char* pStandardFallbackList[] =
{
"gtk", "gen", 0
};
-
+
static const char* pHeadlessFallbackList[] =
{
"svp", 0
@@ -179,7 +178,7 @@ static SalInstance* autodetect_plugin()
const rtl::OUString& desktop( get_desktop_environment() );
const char ** pList = pStandardFallbackList;
int nListEntry = 0;
-
+
// no server at all: dummy plugin
if ( desktop.equalsAscii( desktop_strings[DESKTOP_NONE] ) )
pList = pHeadlessFallbackList;
@@ -192,12 +191,12 @@ static SalInstance* autodetect_plugin()
}
else if( desktop.equalsAscii( desktop_strings[DESKTOP_KDE4] ) )
pList = pKDEFallbackList;
-
+
SalInstance* pInst = NULL;
while( pList[nListEntry] && pInst == NULL )
{
- rtl::OUString aTry( rtl::OUString::createFromAscii( pList[nListEntry] ) );
- pInst = tryInstance( aTry );
+ rtl::OUString aTry( rtl::OUString::createFromAscii( pList[nListEntry] ) );
+ pInst = tryInstance( aTry );
#if OSL_DEBUG_LEVEL > 1
if( pInst )
std::fprintf( stderr, "plugin autodetection: %s\n", pList[nListEntry] );
@@ -215,18 +214,15 @@ static SalInstance* check_headless_plugin()
for( int i = 0; i < nParams; i++ )
{
osl_getCommandArg( i, &aParam.pData );
- if( aParam.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("-headless")) ||
- aParam.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("--headless")) )
- {
+ if( aParam.equalsAscii( "-headless" ) )
return tryInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "svp" ) ) );
- }
}
return NULL;
}
SalInstance *CreateSalInstance()
{
- SalInstance* pInst = NULL;
+ SalInstance* pInst = NULL;
static const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" );
@@ -234,10 +230,10 @@ SalInstance *CreateSalInstance()
pInst = check_headless_plugin();
else
pInst = tryInstance( OUString::createFromAscii( pUsePlugin ) );
-
+
if( ! pInst )
pInst = autodetect_plugin();
-
+
// fallback, try everything
const char* pPlugin[] = { "gtk", "kde", "gen", 0 };
@@ -252,7 +248,7 @@ SalInstance *CreateSalInstance()
// acquire SolarMutex
pInst->AcquireYieldMutex( 1 );
-
+
return pInst;
}
@@ -288,7 +284,7 @@ void SalAbort( const XubString& rErrorText )
std::fprintf( stderr, "Application Error" );
else
std::fprintf( stderr, "%s", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
- exit(-1);
+ abort();
}
const OUString& SalGetDesktopEnvironment()
@@ -298,14 +294,12 @@ const OUString& SalGetDesktopEnvironment()
SalData::SalData() :
m_pInstance(NULL),
- m_pPlugin(NULL),
- m_pPIManager(NULL)
+ m_pPlugin(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 655181294190..26cf81d276c7 100644
--- a/vcl/unx/source/printer/cupsmgr.cxx
+++ b/vcl/unx/source/printer/cupsmgr.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,24 +59,24 @@ namespace psp
{
class CUPSWrapper
{
- oslModule m_pLib;
- osl::Mutex m_aGetPPDMutex;
+ oslModule m_pLib;
+ osl::Mutex m_aGetPPDMutex;
bool m_bPPDThreadRunning;
- int (*m_pcupsPrintFile)(const char*, const char*, const char*, int, cups_option_t*);
- int (*m_pcupsGetDests)(cups_dest_t**);
- void (*m_pcupsSetDests)(int,cups_dest_t*);
- void (*m_pcupsFreeDests)(int,cups_dest_t*);
- const char* (*m_pcupsGetPPD)(const char*);
- int (*m_pcupsMarkOptions)(ppd_file_t*,int,cups_option_t*);
- int (*m_pcupsAddOption)(const char*,const char*,int,cups_option_t**);
- void (*m_pcupsFreeOptions)(int,cups_option_t*);
- ppd_file_t* (*m_pppdOpenFile)(const char* pFile);
- void (*m_pppdClose)(ppd_file_t*);
- const char* (*m_pcupsServer)();
- void (*m_pcupsSetPasswordCB)(const char*(cb)(const char*));
- const char* (*m_pcupsUser)();
- void (*m_pcupsSetUser)(const char*);
+ int (*m_pcupsPrintFile)(const char*, const char*, const char*, int, cups_option_t*);
+ int (*m_pcupsGetDests)(cups_dest_t**);
+ void (*m_pcupsSetDests)(int,cups_dest_t*);
+ void (*m_pcupsFreeDests)(int,cups_dest_t*);
+ const char* (*m_pcupsGetPPD)(const char*);
+ int (*m_pcupsMarkOptions)(ppd_file_t*,int,cups_option_t*);
+ int (*m_pcupsAddOption)(const char*,const char*,int,cups_option_t**);
+ void (*m_pcupsFreeOptions)(int,cups_option_t*);
+ ppd_file_t* (*m_pppdOpenFile)(const char* pFile);
+ void (*m_pppdClose)(ppd_file_t*);
+ const char* (*m_pcupsServer)();
+ void (*m_pcupsSetPasswordCB)(const char*(cb)(const char*));
+ const char* (*m_pcupsUser)();
+ void (*m_pcupsSetUser)(const char*);
const char* (*m_pcupsGetOption)(const char*,int,cups_option_t*);
oslGenericFunction loadSymbol( const char* );
@@ -119,33 +119,27 @@ public:
void ppdClose( ppd_file_t* pPPD )
{ m_pppdClose( pPPD ); }
- const char *cupsServer(void)
+ const char *cupsServer(void)
{ return m_pcupsServer(); }
- const char *cupsUser(void)
+ const char *cupsUser(void)
{ return m_pcupsUser(); }
-
+
void cupsSetPasswordCB(const char *(*cb)(const char *))
{ m_pcupsSetPasswordCB( cb ); }
void cupsSetUser(const char *user)
{ m_pcupsSetUser( user ); }
-
+
const char* cupsGetOption(const char* name, int num_options, cups_option_t* options)
{ return m_pcupsGetOption( name, num_options, options ); }
-
+
};
}
using namespace psp;
using namespace osl;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OUStringToOString;
-using ::rtl::OStringToOUString;
-using ::rtl::OUStringHash;
-using ::rtl::OString;
+using namespace rtl;
/*
* CUPSWrapper class
@@ -161,7 +155,7 @@ oslGenericFunction CUPSWrapper::loadSymbol( const char* pSymbol )
return pSym;
}
-CUPSWrapper::CUPSWrapper()
+CUPSWrapper::CUPSWrapper()
: m_pLib( NULL ),
m_bPPDThreadRunning( false )
{
@@ -183,51 +177,51 @@ CUPSWrapper::CUPSWrapper()
return;
}
- m_pcupsPrintFile = (int(*)(const char*,const char*,const char*,int,cups_option_t*))
+ m_pcupsPrintFile = (int(*)(const char*,const char*,const char*,int,cups_option_t*))
loadSymbol( "cupsPrintFile" );
- m_pcupsGetDests = (int(*)(cups_dest_t**))
+ m_pcupsGetDests = (int(*)(cups_dest_t**))
loadSymbol( "cupsGetDests" );
- m_pcupsSetDests = (void(*)(int,cups_dest_t*))
+ m_pcupsSetDests = (void(*)(int,cups_dest_t*))
loadSymbol( "cupsSetDests" );
- m_pcupsFreeDests = (void(*)(int,cups_dest_t*))
+ m_pcupsFreeDests = (void(*)(int,cups_dest_t*))
loadSymbol( "cupsFreeDests" );
- m_pcupsGetPPD = (const char*(*)(const char*))
+ m_pcupsGetPPD = (const char*(*)(const char*))
loadSymbol( "cupsGetPPD" );
- m_pcupsMarkOptions = (int(*)(ppd_file_t*,int,cups_option_t*))
+ m_pcupsMarkOptions = (int(*)(ppd_file_t*,int,cups_option_t*))
loadSymbol( "cupsMarkOptions" );
- m_pcupsAddOption = (int(*)(const char*,const char*,int,cups_option_t**))
+ m_pcupsAddOption = (int(*)(const char*,const char*,int,cups_option_t**))
loadSymbol( "cupsAddOption" );
- m_pcupsFreeOptions = (void(*)(int,cups_option_t*))
+ m_pcupsFreeOptions = (void(*)(int,cups_option_t*))
loadSymbol( "cupsFreeOptions" );
- m_pppdOpenFile = (ppd_file_t*(*)(const char*))
+ m_pppdOpenFile = (ppd_file_t*(*)(const char*))
loadSymbol( "ppdOpenFile" );
- m_pppdClose = (void(*)(ppd_file_t*))
+ m_pppdClose = (void(*)(ppd_file_t*))
loadSymbol( "ppdClose" );
- m_pcupsServer = (const char*(*)())
+ m_pcupsServer = (const char*(*)())
loadSymbol( "cupsServer" );
- m_pcupsUser = (const char*(*)())
+ m_pcupsUser = (const char*(*)())
loadSymbol( "cupsUser" );
- m_pcupsSetPasswordCB = (void(*)(const char*(*)(const char*)))
+ m_pcupsSetPasswordCB = (void(*)(const char*(*)(const char*)))
loadSymbol( "cupsSetPasswordCB" );
- m_pcupsSetUser = (void(*)(const char*))
+ m_pcupsSetUser = (void(*)(const char*))
loadSymbol( "cupsSetUser" );
m_pcupsGetOption = (const char*(*)(const char*,int,cups_option_t*))
loadSymbol( "cupsGetOption" );
if( ! (
- m_pcupsPrintFile &&
- m_pcupsGetDests &&
- m_pcupsSetDests &&
- m_pcupsFreeDests &&
- m_pcupsGetPPD &&
- m_pcupsMarkOptions &&
- m_pcupsAddOption &&
- m_pcupsServer &&
- m_pcupsUser &&
- m_pcupsSetPasswordCB &&
- m_pcupsSetUser &&
- m_pcupsFreeOptions &&
- m_pppdOpenFile &&
+ m_pcupsPrintFile &&
+ m_pcupsGetDests &&
+ m_pcupsSetDests &&
+ m_pcupsFreeDests &&
+ m_pcupsGetPPD &&
+ m_pcupsMarkOptions &&
+ m_pcupsAddOption &&
+ m_pcupsServer &&
+ m_pcupsUser &&
+ m_pcupsSetPasswordCB &&
+ m_pcupsSetUser &&
+ m_pcupsFreeOptions &&
+ m_pppdOpenFile &&
m_pppdClose &&
m_pcupsGetOption
) )
@@ -252,14 +246,14 @@ typedef const char*(*PPDFunction)(const char*);
struct GetPPDAttribs
{
PPDFunction m_pFunction;
- osl::Condition m_aCondition;
- OString m_aParameter;
- OString m_aResult;
- oslThread m_aThread;
+ osl::Condition m_aCondition;
+ OString m_aParameter;
+ OString m_aResult;
+ oslThread m_aThread;
int m_nRefs;
bool* m_pResetRunning;
osl::Mutex* m_pSyncMutex;
-
+
GetPPDAttribs( PPDFunction pFn, const char * m_pParameter,
bool* pResetRunning, osl::Mutex* pSyncMutex )
: m_pFunction( pFn ),
@@ -270,13 +264,13 @@ struct GetPPDAttribs
m_nRefs = 2;
m_aCondition.reset();
}
-
+
~GetPPDAttribs()
{
if( m_aResult.getLength() )
unlink( m_aResult.getStr() );
}
-
+
void unref()
{
if( --m_nRefs == 0 )
@@ -285,7 +279,7 @@ struct GetPPDAttribs
delete this;
}
}
-
+
void executeCall()
{
// This CUPS method is not at all thread-safe we need
@@ -296,11 +290,11 @@ struct GetPPDAttribs
m_aCondition.set();
unref();
}
-
+
OString waitResult( TimeValue *pDelay )
{
m_pSyncMutex->release();
-
+
if (m_aCondition.wait( pDelay ) != Condition::result_ok
)
{
@@ -311,11 +305,11 @@ struct GetPPDAttribs
#endif
}
m_pSyncMutex->acquire();
-
+
OString aRetval = m_aResult;
m_aResult = OString();
unref();
-
+
return aRetval;
}
};
@@ -341,7 +335,7 @@ OString CUPSWrapper::cupsGetPPD( const char* pPrinter )
pPrinter,
&m_bPPDThreadRunning,
&m_aGetPPDMutex );
-
+
oslThread aThread = osl_createThread( getPPDWorker, pAttribs );
TimeValue aValue;
@@ -361,7 +355,7 @@ OString CUPSWrapper::cupsGetPPD( const char* pPrinter )
static const char* setPasswordCallback( const char* pIn )
{
const char* pRet = NULL;
-
+
PrinterInfoManager& rMgr = PrinterInfoManager::get();
if( rMgr.getType() == PrinterInfoManager::CUPS ) // sanity check
pRet = static_cast<CUPSManager&>(rMgr).authenticateUser( pIn );
@@ -378,7 +372,7 @@ CUPSManager* CUPSManager::tryLoadCUPS()
CUPSManager* pManager = NULL;
#ifdef ENABLE_CUPS
static const char* pEnv = getenv( "SAL_DISABLE_CUPS" );
-
+
if( ! pEnv || ! *pEnv )
{
// try to load CUPS
@@ -446,10 +440,11 @@ void CUPSManager::runDests()
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "starting cupsGetDests\n" );
#endif
+ int nDests = 0;
cups_dest_t* pDests = NULL;
// #i86306# prepare against really broken CUPS installations / missing servers
-
+
// install signal handler for SEGV, BUS and ABRT
struct sigaction act;
struct sigaction oact[3];
@@ -457,7 +452,7 @@ void CUPSManager::runDests()
act.sa_handler = lcl_signal_action;
act.sa_flags = 0;
sigemptyset(&(act.sa_mask));
-
+
int nSegvSignalInstalled = sigaction(SIGSEGV, &act, &oact[0]);
int nBusSignalInstalled = sigaction(SIGBUS, &act, &oact[1]);
int nAbortSignalInstalled = sigaction(SIGABRT, &act, &oact[2]);
@@ -465,11 +460,11 @@ void CUPSManager::runDests()
// prepare against a signal during FcInit or FcConfigGetCurrent
if( sigsetjmp( aViolationBuffer, ~0 ) == 0 )
{
- int nDests = m_pCUPSWrapper->cupsGetDests( &pDests );
+ nDests = m_pCUPSWrapper->cupsGetDests( &pDests );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "came out of cupsGetDests\n" );
#endif
-
+
osl::MutexGuard aGuard( m_aCUPSMutex );
m_nDests = nDests;
m_pDests = pDests;
@@ -484,7 +479,7 @@ void CUPSManager::runDests()
fprintf( stderr, "cupsGetDests crashed, not using CUPS\n" );
#endif
}
-
+
// restore old signal handlers
if( nSegvSignalInstalled == 0 )
sigaction( SIGSEGV, &oact[0], NULL );
@@ -498,12 +493,12 @@ void CUPSManager::initialize()
{
// get normal printers, clear printer list
PrinterInfoManager::initialize();
-
+
#ifdef ENABLE_CUPS
// check whether thread has completed
// if not behave like old printing system
osl::MutexGuard aGuard( m_aCUPSMutex );
-
+
if( ! m_bNewDests )
return;
@@ -521,7 +516,7 @@ void CUPSManager::initialize()
if( ! (m_nDests && m_pDests ) )
return;
-
+
if( isCUPSDisabled() )
return;
@@ -530,18 +525,12 @@ 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
@@ -549,7 +538,7 @@ void CUPSManager::initialize()
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
int nPrinter = m_nDests;
-
+
// reset global default PPD options; these are queried on demand from CUPS
m_aGlobalDefaults.m_pParser = NULL;
m_aGlobalDefaults.m_aContext = PPDContext();
@@ -599,14 +588,12 @@ void CUPSManager::initialize()
// behaviour
aPrinter.m_aInfo.m_pParser = NULL;
aPrinter.m_aInfo.m_aContext.setParser( NULL );
- boost::unordered_map< OUString, PPDContext, OUStringHash >::const_iterator c_it = m_aDefaultContexts.find( aPrinterName );
+ std::hash_map< OUString, PPDContext, OUStringHash >::const_iterator c_it = m_aDefaultContexts.find( aPrinterName );
if( c_it != m_aDefaultContexts.end() )
{
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;
@@ -617,7 +604,7 @@ void CUPSManager::initialize()
// remove everything that is not a CUPS printer and not
// a special purpose printer (PDF, Fax)
std::list< OUString > aRemovePrinters;
- for( boost::unordered_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.begin();
+ for( std::hash_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.begin();
it != m_aPrinters.end(); ++it )
{
if( m_aCUPSDestMap.find( it->first ) != m_aCUPSDestMap.end() )
@@ -661,8 +648,8 @@ static void updatePrinterContextInfo( ppd_group_t* pPPDGroup, PPDContext& rConte
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "key %s is set to %s\n", pOption->keyword, pChoice->choice );
#endif
-
- }
+
+ }
#if OSL_DEBUG_LEVEL > 1
else
fprintf( stderr, "key %s is defaulted to %s\n", pOption->keyword, pChoice->choice );
@@ -704,7 +691,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
{
if( m_nDests && m_pDests && ! isCUPSDisabled() )
{
- boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
+ std::hash_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( aPrinter );
if( dest_it != m_aCUPSDestMap.end() )
{
@@ -725,7 +712,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
PPDParser* pCUPSParser = new PPDParser( aFileName );
pCUPSParser->m_aFile = rPrinter;
pNewParser = pCUPSParser;
-
+
/*int nConflicts =*/ m_pCUPSWrapper->cupsMarkOptions( pPPD, pDest->num_options, pDest->options );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "processing the following options for printer %s (instance %s):\n",
@@ -736,7 +723,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
pDest->options[k].value );
#endif
PrinterInfo& rInfo = m_aPrinters[ aPrinter ].m_aInfo;
-
+
// remember the default context for later use
PPDContext& rContext = m_aDefaultContexts[ aPrinter ];
rContext.setParser( pNewParser );
@@ -745,18 +732,18 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
setDefaultPaper( rContext );
for( int i = 0; i < pPPD->num_groups; i++ )
updatePrinterContextInfo( pPPD->groups + i, rContext );
-
+
rInfo.m_pParser = pNewParser;
rInfo.m_aContext = rContext;
-
+
// clean up the mess
- m_pCUPSWrapper->ppdClose( pPPD );
+ m_pCUPSWrapper->ppdClose( pPPD );
}
#if OSL_DEBUG_LEVEL > 1
else
fprintf( stderr, "ppdOpenFile failed, falling back to generic driver\n" );
#endif
-
+
// remove temporary PPD file
unlink( aPPDFile.getStr() );
}
@@ -782,9 +769,9 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter )
{
// get the default PPD
pNewParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) );
-
+
PrinterInfo& rInfo = m_aPrinters[ aPrinter ].m_aInfo;
-
+
rInfo.m_pParser = pNewParser;
rInfo.m_aContext.setParser( pNewParser );
}
@@ -800,13 +787,13 @@ void CUPSManager::setupJobContextData(
)
{
#ifdef ENABLE_CUPS
- boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
+ std::hash_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rData.m_aPrinterName );
if( dest_it == m_aCUPSDestMap.end() )
return PrinterInfoManager::setupJobContextData( rData );
- boost::unordered_map< OUString, Printer, OUStringHash >::iterator p_it =
+ std::hash_map< OUString, Printer, OUStringHash >::iterator p_it =
m_aPrinters.find( rData.m_aPrinterName );
if( p_it == m_aPrinters.end() ) // huh ?
{
@@ -833,23 +820,16 @@ void CUPSManager::setupJobContextData(
p_it->second.m_aInfo.m_aContext = m_aDefaultContexts[ aPrinter ];
}
- rData.m_pParser = p_it->second.m_aInfo.m_pParser;
- rData.m_aContext = p_it->second.m_aInfo.m_aContext;
+ rData.m_pParser = p_it->second.m_aInfo.m_pParser;
+ rData.m_aContext = p_it->second.m_aInfo.m_aContext;
#endif
}
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;
osl_createTempFile( NULL, NULL, &aTmpURL.pData );
@@ -858,7 +838,7 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand
FILE* fp = fopen( aSysFile.getStr(), "w" );
if( fp )
m_aSpoolFiles[fp] = aSysFile;
-
+
return fp;
#else
return NULL;
@@ -867,14 +847,15 @@ FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand
struct less_ppd_key : public ::std::binary_function<double, double, bool>
{
- bool operator()(const PPDKey* left, const PPDKey* right)
+ bool operator()(const PPDKey* left, const PPDKey* right)
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
-void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const
+void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const
{
rNumOptions = 0;
*rOptions = NULL;
+ int i;
// emit features ordered to OrderDependency
// ignore features that are set to default
@@ -882,7 +863,6 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
// sanity check
if( rJob.m_pParser == rJob.m_aContext.getParser() && rJob.m_pParser )
{
- int i;
int nKeys = rJob.m_aContext.countValuesModified();
::std::vector< const PPDKey* > aKeys( nKeys );
for( i = 0; i < nKeys; i++ )
@@ -901,49 +881,30 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
}
}
}
-
- 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, bool bBanner )
+int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData )
{
- 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 );
-
- boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
+
+ std::hash_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rPrintername );
if( dest_it == m_aCUPSDestMap.end() )
- {
- OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
- }
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData );
#ifdef ENABLE_CUPS
- boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
+ std::hash_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
if( it != m_aSpoolFiles.end() )
{
fclose( pFile );
rtl_TextEncoding aEnc = osl_getThreadTextEncoding();
-
+
// setup cups options
int nNumOptions = 0;
cups_option_t* pOptions = NULL;
- getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
+ getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions );
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name,
@@ -966,7 +927,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
aCmd = aCmd + OString( " $HOME/cupsprint.ps" );
system( aCmd.getStr() );
#endif
-
+
unlink( it->second.getStr() );
m_aSpoolFiles.erase( pFile );
if( pOptions )
@@ -1009,7 +970,7 @@ bool CUPSManager::checkPrintersChanged( bool bWait )
// where the user can set SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION
// (see vcl/unx/source/gdi/salprnpsp.cxx)
// so that checkPrintersChanged( true ) will never be called
-
+
// there is no way to query CUPS whether the printer list has changed
// so get the dest list anew
if( m_nDests && m_pDests )
@@ -1032,7 +993,7 @@ bool CUPSManager::checkPrintersChanged( bool bWait )
if( bChanged )
m_bNewDests = true;
}
-
+
if( bChanged )
initialize();
@@ -1061,7 +1022,7 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName )
{
bool bSuccess = false;
#ifdef ENABLE_CUPS
- boost::unordered_map< OUString, int, OUStringHash >::iterator nit =
+ std::hash_map< OUString, int, OUStringHash >::iterator nit =
m_aCUPSDestMap.find( rName );
if( nit != m_aCUPSDestMap.end() && m_aCUPSMutex.tryToAcquire() )
{
@@ -1077,7 +1038,7 @@ bool CUPSManager::setDefaultPrinter( const OUString& rName )
else
#endif
bSuccess = PrinterInfoManager::setDefaultPrinter( rName );
-
+
return bSuccess;
}
@@ -1087,14 +1048,14 @@ bool CUPSManager::writePrinterConfig()
bool bDestModified = false;
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
- for( boost::unordered_map< OUString, Printer, OUStringHash >::iterator prt =
+ for( std::hash_map< OUString, Printer, OUStringHash >::iterator prt =
m_aPrinters.begin(); prt != m_aPrinters.end(); ++prt )
{
- boost::unordered_map< OUString, int, OUStringHash >::iterator nit =
+ std::hash_map< OUString, int, OUStringHash >::iterator nit =
m_aCUPSDestMap.find( prt->first );
if( nit == m_aCUPSDestMap.end() )
continue;
-
+
if( ! prt->second.m_bModified )
continue;
@@ -1106,7 +1067,7 @@ bool CUPSManager::writePrinterConfig()
// create new option list
int nNewOptions = 0;
- cups_option_t* pNewOptions = NULL;
+ cups_option_t* pNewOptions = NULL;
int nValues = rInfo.m_aContext.countValuesModified();
for( int i = 0; i < nValues; i++ )
{
@@ -1148,7 +1109,7 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
const char* pRet = NULL;
#ifdef ENABLE_CUPS
- OUString aLib(RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ));
+ OUString aLib = OUString::createFromAscii( _XSALSET_LIBNAME );
oslModule pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY );
if( pLib )
{
@@ -1163,12 +1124,12 @@ const char* CUPSManager::authenticateUser( const char* /*pIn*/ )
OString aServer = m_pCUPSWrapper->cupsServer();
OString aPassword;
if( getpw( aServer, aUser, aPassword ) )
- {
+ {
m_aPassword = aPassword;
m_aUser = aUser;
m_pCUPSWrapper->cupsSetUser( m_aUser.getStr() );
pRet = m_aPassword.getStr();
- }
+ }
}
osl_unloadModule( pLib );
}
diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx
index 0982b219bade..a10d49ad8fdc 100644
--- a/vcl/unx/source/printer/jobdata.cxx
+++ b/vcl/unx/source/printer/jobdata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,22 +37,22 @@
#include "sal/alloca.h"
using namespace psp;
+using namespace rtl;
JobData& JobData::operator=(const JobData& rRight)
{
- m_nCopies = rRight.m_nCopies;
- m_nLeftMarginAdjust = rRight.m_nLeftMarginAdjust;
- m_nRightMarginAdjust = rRight.m_nRightMarginAdjust;
- m_nTopMarginAdjust = rRight.m_nTopMarginAdjust;
- m_nBottomMarginAdjust = rRight.m_nBottomMarginAdjust;
- m_nColorDepth = rRight.m_nColorDepth;
- m_eOrientation = rRight.m_eOrientation;
- m_aPrinterName = rRight.m_aPrinterName;
- 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;
+ m_nCopies = rRight.m_nCopies;
+ m_nLeftMarginAdjust = rRight.m_nLeftMarginAdjust;
+ m_nRightMarginAdjust = rRight.m_nRightMarginAdjust;
+ m_nTopMarginAdjust = rRight.m_nTopMarginAdjust;
+ m_nBottomMarginAdjust = rRight.m_nBottomMarginAdjust;
+ m_nColorDepth = rRight.m_nColorDepth;
+ m_eOrientation = rRight.m_eOrientation;
+ m_aPrinterName = rRight.m_aPrinterName;
+ m_pParser = rRight.m_pParser;
+ m_aContext = rRight.m_aContext;
+ m_nPSLevel = rRight.m_nPSLevel;
+ m_nColorDevice = rRight.m_nColorDevice;
if( ! m_pParser && m_aPrinterName.getLength() )
{
@@ -84,34 +84,6 @@ 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
@@ -157,17 +129,13 @@ 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" );
- sal_uLong nBytes;
+ ULONG nBytes;
void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes );
if( nBytes )
aStream.Write( pContextBuffer, nBytes );
@@ -191,7 +159,6 @@ 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 );
@@ -236,11 +203,6 @@ 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 )
@@ -261,7 +223,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && 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 30d4598568d2..2c589b44a9e8 100644
--- a/vcl/unx/source/printer/ppdparser.cxx
+++ b/vcl/unx/source/printer/ppdparser.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <stdio.h>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include "vcl/ppdparser.hxx"
#include "vcl/strhelper.hxx"
@@ -49,7 +49,6 @@
#include "osl/thread.h"
#include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx"
-#include "rtl/instance.hxx"
#include <sal/macros.h>
#include "com/sun/star/lang/Locale.hpp"
@@ -72,23 +71,23 @@ namespace psp
struct LocaleHash
{
size_t operator()(const com::sun::star::lang::Locale& rLocale) const
- { return
+ { return
(size_t)rLocale.Language.hashCode()
^ (size_t)rLocale.Country.hashCode()
^ (size_t)rLocale.Variant.hashCode()
;
}
};
-
- typedef boost::unordered_map< com::sun::star::lang::Locale, rtl::OUString, LocaleHash, LocaleEqual > translation_map;
- typedef boost::unordered_map< rtl::OUString, translation_map, rtl::OUStringHash > key_translation_map;
-
+
+ typedef std::hash_map< com::sun::star::lang::Locale, rtl::OUString, LocaleHash, LocaleEqual > translation_map;
+ typedef std::hash_map< rtl::OUString, translation_map, rtl::OUStringHash > key_translation_map;
+
key_translation_map m_aTranslations;
public:
PPDTranslator() {}
~PPDTranslator() {}
-
-
+
+
void insertValue(
const rtl::OUString& i_rKey,
const rtl::OUString& i_rOption,
@@ -96,7 +95,7 @@ namespace psp
const rtl::OUString& i_rTranslation,
const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale()
);
-
+
void insertOption( const rtl::OUString& i_rKey,
const rtl::OUString& i_rOption,
const rtl::OUString& i_rTranslation,
@@ -104,14 +103,14 @@ namespace psp
{
insertValue( i_rKey, i_rOption, rtl::OUString(), i_rTranslation, i_rLocale );
}
-
+
void insertKey( const rtl::OUString& i_rKey,
const rtl::OUString& i_rTranslation,
const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() )
{
insertValue( i_rKey, rtl::OUString(), rtl::OUString(), i_rTranslation, i_rLocale );
}
-
+
rtl::OUString translateValue(
const rtl::OUString& i_rKey,
const rtl::OUString& i_rOption,
@@ -132,7 +131,7 @@ namespace psp
return translateValue( i_rKey, rtl::OUString(), rtl::OUString(), i_rLocale );
}
};
-
+
static com::sun::star::lang::Locale normalizeInputLocale(
const com::sun::star::lang::Locale& i_rLocale,
bool bInsertDefault = false
@@ -162,7 +161,7 @@ namespace psp
aLoc.Language = aLoc.Language.toAsciiLowerCase();
aLoc.Country = aLoc.Country.toAsciiUpperCase();
aLoc.Variant = aLoc.Variant.toAsciiUpperCase();
-
+
return aLoc;
}
@@ -196,7 +195,7 @@ namespace psp
m_aTranslations[ aK ][ aLoc ] = i_rTranslation;
}
}
-
+
rtl::OUString PPDTranslator::translateValue(
const rtl::OUString& i_rKey,
const rtl::OUString& i_rOption,
@@ -205,7 +204,7 @@ namespace psp
) const
{
rtl::OUString aResult;
-
+
rtl::OUStringBuffer aKey( i_rKey.getLength() + i_rOption.getLength() + i_rValue.getLength() + 2 );
aKey.append( i_rKey );
if( i_rOption.getLength() || i_rValue.getLength() )
@@ -225,7 +224,7 @@ namespace psp
if( it != m_aTranslations.end() )
{
const translation_map& rMap( it->second );
-
+
com::sun::star::lang::Locale aLoc( normalizeInputLocale( i_rLocale, true ) );
for( int nTry = 0; nTry < 4; nTry++ )
{
@@ -246,34 +245,10 @@ namespace psp
}
return aResult;
}
-
- class PPDCache
- {
- public:
- std::list< PPDParser* > aAllParsers;
- boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >* pAllPPDFiles;
- PPDCache()
- : pAllPPDFiles(NULL)
- {}
- ~PPDCache()
- {
- while( aAllParsers.begin() != aAllParsers.end() )
- {
- delete aAllParsers.front();
- aAllParsers.pop_front();
- }
- delete pAllPPDFiles;
- pAllPPDFiles = NULL;
- }
- };
}
using namespace psp;
-
-using ::rtl::OUString;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringHash;
-
+using namespace rtl;
#undef DBG_ASSERT
#if defined DBG_UTIL || (OSL_DEBUG_LEVEL > 1)
@@ -283,25 +258,23 @@ using ::rtl::OUStringHash;
#define DBG_ASSERT( x, y )
#endif
-namespace
-{
- struct thePPDCache : public rtl::Static<PPDCache, thePPDCache> {};
-}
+std::list< PPDParser* > PPDParser::aAllParsers;
+std::hash_map< OUString, OUString, OUStringHash >* PPDParser::pAllPPDFiles = NULL;
class PPDDecompressStream
{
SvFileStream* mpFileStream;
SvMemoryStream* mpMemStream;
rtl::OUString maFileName;
-
+
// forbid copying
PPDDecompressStream( const PPDDecompressStream& );
PPDDecompressStream& operator=(const PPDDecompressStream& );
-
+
public:
PPDDecompressStream( const rtl::OUString& rFile );
~PPDDecompressStream();
-
+
bool IsOpen() const;
bool IsEof() const;
void ReadLine( ByteString& o_rLine);
@@ -328,7 +301,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile )
mpFileStream = new SvFileStream( i_rFile, STREAM_READ );
maFileName = mpFileStream->GetFileName();
-
+
if( ! mpFileStream->IsOpen() )
{
Close();
@@ -338,9 +311,9 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile )
ByteString aLine;
mpFileStream->ReadLine( aLine );
mpFileStream->Seek( 0 );
-
+
// check for compress'ed or gzip'ed file
- sal_uLong nCompressMethod = 0;
+ 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
@@ -398,7 +371,7 @@ static osl::FileBase::RC resolveLink( const rtl::OUString& i_rURL, rtl::OUString
{
osl::DirectoryItem aLinkItem;
osl::FileBase::RC aRet = osl::FileBase::E_None;
-
+
if( ( aRet = osl::DirectoryItem::get( i_rURL, aLinkItem ) ) == osl::FileBase::E_None )
{
osl::FileStatus aStatus( FileStatusMask_FileName | FileStatusMask_Type | FileStatusMask_LinkTargetURL );
@@ -433,65 +406,60 @@ void PPDParser::scanPPDDir( const String& rDir )
const int nSuffixes = SAL_N_ELEMENTS(pSuffixes);
- PPDCache &rPPDCache = thePPDCache::get();
-
osl::Directory aDir( rDir );
- if ( aDir.open() == osl::FileBase::E_None )
- {
- osl::DirectoryItem aItem;
+ aDir.open();
+ osl::DirectoryItem aItem;
- INetURLObject aPPDDir(rDir);
- while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ INetURLObject aPPDDir(rDir);
+ while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ {
+ osl::FileStatus aStatus( FileStatusMask_FileName );
+ if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
{
- 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;
+
+ if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == 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;
-
- if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
+ if( eType == osl::FileStatus::Regular )
{
- if( eType == osl::FileStatus::Regular )
+ INetURLObject aPPDFile = aPPDDir;
+ aPPDFile.Append( aFileName );
+
+ // match extension
+ for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
{
- INetURLObject aPPDFile = aPPDDir;
- aPPDFile.Append( aFileName );
-
- // match extension
- for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
+ if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
{
- if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
+ if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, 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;
- }
+ (*pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
+ break;
}
}
}
- else if( eType == osl::FileStatus::Directory )
- {
- scanPPDDir( aFileURL );
- }
+ }
+ else if( eType == osl::FileStatus::Directory )
+ {
+ scanPPDDir( aFileURL );
}
}
}
- aDir.close();
}
+ aDir.close();
}
void PPDParser::initPPDFiles()
{
- PPDCache &rPPDCache = thePPDCache::get();
- if( rPPDCache.pAllPPDFiles )
+ if( pAllPPDFiles )
return;
- rPPDCache.pAllPPDFiles = new boost::unordered_map< OUString, OUString, OUStringHash >();
+ pAllPPDFiles = new std::hash_map< OUString, OUString, OUStringHash >();
// check installation directories
std::list< OUString > aPathList;
@@ -501,7 +469,7 @@ void PPDParser::initPPDFiles()
INetURLObject aPPDDir( *ppd_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
scanPPDDir( aPPDDir.GetMainURL( INetURLObject::NO_DECODE ) );
}
- if( rPPDCache.pAllPPDFiles->find( OUString( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ) == rPPDCache.pAllPPDFiles->end() )
+ if( pAllPPDFiles->find( OUString( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ) == pAllPPDFiles->end() )
{
// last try: search in directory of executable (mainly for setup)
OUString aExe;
@@ -514,7 +482,7 @@ void PPDParser::initPPDFiles()
#endif
scanPPDDir( aDir.GetMainURL( INetURLObject::NO_DECODE ) );
#ifdef DEBUG
- fprintf( stderr, "SGENPRT %s\n", rPPDCache.pAllPPDFiles->find( OUString( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ) == rPPDCache.pAllPPDFiles->end() ? "not found" : "found" );
+ fprintf( stderr, "SGENPRT %s\n", pAllPPDFiles->find( OUString( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ) == pAllPPDFiles->end() ? "not found" : "found" );
#endif
}
}
@@ -522,19 +490,17 @@ void PPDParser::initPPDFiles()
void PPDParser::getKnownPPDDrivers( std::list< rtl::OUString >& o_rDrivers, bool bRefresh )
{
- PPDCache &rPPDCache = thePPDCache::get();
-
if( bRefresh )
{
- delete rPPDCache.pAllPPDFiles;
- rPPDCache.pAllPPDFiles = NULL;
+ delete pAllPPDFiles;
+ pAllPPDFiles = NULL;
}
initPPDFiles();
o_rDrivers.clear();
-
- boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it;
- for( it = rPPDCache.pAllPPDFiles->begin(); it != rPPDCache.pAllPPDFiles->end(); ++it )
+
+ std::hash_map< OUString, OUString, OUStringHash >::const_iterator it;
+ for( it = pAllPPDFiles->begin(); it != pAllPPDFiles->end(); ++it )
o_rDrivers.push_back( it->first );
}
@@ -545,9 +511,8 @@ String PPDParser::getPPDFile( const String& rFile )
PPDDecompressStream aStream( aPPD.PathToFileName() );
if( ! aStream.IsOpen() )
{
- boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it;
- PPDCache &rPPDCache = thePPDCache::get();
-
+ std::hash_map< OUString, OUString, OUStringHash >::const_iterator it;
+
bool bRetry = true;
do
{
@@ -560,23 +525,23 @@ String PPDParser::getPPDFile( const String& rFile )
aBase = aBase.copy( nLastIndex+1 );
do
{
- it = rPPDCache.pAllPPDFiles->find( aBase );
+ it = pAllPPDFiles->find( aBase );
nLastIndex = aBase.lastIndexOf( sal_Unicode( '.' ) );
if( nLastIndex > 0 )
aBase = aBase.copy( 0, nLastIndex );
- } while( it == rPPDCache.pAllPPDFiles->end() && nLastIndex > 0 );
-
- if( it == rPPDCache.pAllPPDFiles->end() && bRetry )
+ } while( it == pAllPPDFiles->end() && nLastIndex > 0 );
+
+ if( it == pAllPPDFiles->end() && bRetry )
{
// a new file ? rehash
- delete rPPDCache.pAllPPDFiles; rPPDCache.pAllPPDFiles = NULL;
+ delete pAllPPDFiles; pAllPPDFiles = NULL;
bRetry = false;
// note this is optimized for office start where
// no new files occur and initPPDFiles is called only once
}
- } while( ! rPPDCache.pAllPPDFiles );
-
- if( it != rPPDCache.pAllPPDFiles->end() )
+ } while( ! pAllPPDFiles );
+
+ if( it != pAllPPDFiles->end() )
aStream.Open( it->second );
}
@@ -660,8 +625,7 @@ const PPDParser* PPDParser::getParser( const String& rFile )
return NULL;
}
- PPDCache &rPPDCache = thePPDCache::get();
- for( ::std::list< PPDParser* >::const_iterator it = rPPDCache.aAllParsers.begin(); it != rPPDCache.aAllParsers.end(); ++it )
+ for( ::std::list< PPDParser* >::const_iterator it = aAllParsers.begin(); it != aAllParsers.end(); ++it )
if( (*it)->m_aFile == aFile )
return *it;
@@ -680,13 +644,24 @@ const PPDParser* PPDParser::getParser( const String& rFile )
{
// this may actually be the SGENPRT parser,
// so ensure uniquness here
- rPPDCache.aAllParsers.remove( pNewParser );
+ aAllParsers.remove( pNewParser );
// insert new parser to list
- rPPDCache.aAllParsers.push_front( pNewParser );
+ aAllParsers.push_front( pNewParser );
}
return pNewParser;
}
+void PPDParser::freeAll()
+{
+ while( aAllParsers.begin() != aAllParsers.end() )
+ {
+ delete aAllParsers.front();
+ aAllParsers.pop_front();
+ }
+ delete pAllPPDFiles;
+ pAllPPDFiles = NULL;
+}
+
PPDParser::PPDParser( const String& rFile ) :
m_aFile( rFile ),
m_bType42Capable( false ),
@@ -775,8 +750,9 @@ PPDParser::PPDParser( const String& rFile ) :
case PPDKey::AnySetup: pSetupType = "AnySetup";break;
default: break;
};
- fprintf( stderr, "\t\"%s\" (%d values) OrderDependency: %d %s\n",
+ fprintf( stderr, "\t\"%s\" (\"%s\") (%d values) OrderDependency: %d %s\n",
BSTRING( pKey->getKey() ).GetBuffer(),
+ BSTRING( pKey->m_aUITranslation ).GetBuffer(),
pKey->countValues(),
pKey->m_nOrderDependency,
pSetupType );
@@ -796,10 +772,12 @@ PPDParser::PPDParser( const String& rFile ) :
case eNo: pVType = "no";break;
default: break;
};
- fprintf( stderr, "option: \"%s\", value: type %s \"%s\"\n",
+ fprintf( stderr, "option: \"%s\" (\"%s\"), value: type %s \"%s\" (\"%s\")\n",
BSTRING( pValue->m_aOption ).GetBuffer(),
+ BSTRING( pValue->m_aOptionTranslation ).GetBuffer(),
pVType,
- BSTRING( pValue->m_aValue ).GetBuffer() );
+ BSTRING( pValue->m_aValue ).GetBuffer(),
+ BSTRING( pValue->m_aValueTranslation ).GetBuffer() );
}
}
fprintf( stderr, "constraints: (%d found)\n", m_aConstraints.size() );
@@ -972,7 +950,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
// default values are parsed in pass 2
if( aKey.CompareTo( "Default", 7 ) == COMPARE_EQUAL )
continue;
-
+
bool bQuery = false;
if( aKey.GetChar( 0 ) == '?' )
{
@@ -1000,7 +978,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
}
bIsGlobalizedLine = true;
}
-
+
String aOption;
nPos = aCurrentLine.Search( ':' );
if( nPos != STRING_NOTFOUND )
@@ -1024,7 +1002,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
int nTransPos = aLine.Search( '/' );
if( nTransPos != STRING_NOTFOUND )
aOptionTranslation = handleTranslation( aLine.Copy( nTransPos+1 ), bIsGlobalizedLine );
-
+
// read in more lines if necessary for multiline values
aLine = aCurrentLine.Copy( nPos+1 );
if( aLine.Len() )
@@ -1041,7 +1019,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
}
}
aLine = WhitespaceToSpace( aLine );
-
+
// #i100644# handle a missing value (actually a broken PPD)
if( ! aLine.Len() )
{
@@ -1088,7 +1066,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
eType = eString;
}
}
-
+
// handle globalized PPD entries
if( bIsGlobalizedLine )
{
@@ -1125,14 +1103,14 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
continue;
pValue->m_eType = eType;
pValue->m_aValue = aValue;
-
+
if( aOptionTranslation.getLength() )
m_pTranslator->insertOption( aUniKey, aOption, aOptionTranslation, aTransLocale );
if( aValueTranslation.getLength() )
m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale );
// eventually update query and remove from option list
- if( bQuery && pKey->m_bQueryValue == sal_False )
+ if( bQuery && pKey->m_bQueryValue == FALSE )
{
pKey->m_aQueryValue = *pValue;
pKey->m_bQueryValue = true;
@@ -1147,7 +1125,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
if( aLine.CompareTo( "*Default", 8 ) == COMPARE_EQUAL )
{
String aKey( aLine.Copy( 8 ), RTL_TEXTENCODING_MS_1252 );
- sal_uInt16 nPos = aKey.Search( ':' );
+ USHORT nPos = aKey.Search( ':' );
if( nPos != STRING_NOTFOUND )
{
aKey.Erase( nPos );
@@ -1292,7 +1270,7 @@ void PPDParser::parseConstraint( const ByteString& rLine )
}
else
// constraint for nonexistent keys; this happens
- // e.g. in HP4PLUS3
+ // e.g. in HP4PLUS3 (#75636#)
bFailed = true;
}
}
@@ -1340,9 +1318,13 @@ bool PPDParser::getMargins(
ImLLy = StringToDouble( GetCommandLineToken( 1, aArea ) );
ImURx = StringToDouble( GetCommandLineToken( 2, aArea ) );
ImURy = StringToDouble( GetCommandLineToken( 3, aArea ) );
+// sscanf( m_pImageableAreas->getValue( nImArea )->m_aValue.GetStr(),
+// "%lg%lg%lg%lg", &ImLLx, &ImLLy, &ImURx, &ImURy );
aArea = m_pPaperDimensions->getValue( nPDim )->m_aValue;
PDWidth = StringToDouble( GetCommandLineToken( 0, aArea ) );
PDHeight = StringToDouble( GetCommandLineToken( 1, aArea ) );
+// sscanf( m_pPaperDimensions->getValue( nPDim )->m_aValue.GetStr(),
+// "%lg%lg", &PDWidth, &PDHeight );
rLeft = (int)(ImLLx + 0.5);
rLower = (int)(ImLLy + 0.5);
rUpper = (int)(PDHeight - ImURy + 0.5);
@@ -1435,7 +1417,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( (sal_uLong)0 )->m_aOption;
+ return m_pInputSlots->getValue( (ULONG)0 )->m_aOption;
return String();
}
@@ -1448,7 +1430,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( (sal_uLong)0 )->m_aValue;
+ return m_pInputSlots->getValue( (ULONG)0 )->m_aValue;
return String();
}
@@ -1475,7 +1457,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( (sal_uLong)0 )->m_aOption;
+ return m_pPaperDimensions->getValue( (ULONG)0 )->m_aOption;
return String();
}
@@ -1488,7 +1470,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( (sal_uLong)0 )->m_aValue;
+ return m_pPaperDimensions->getValue( (ULONG)0 )->m_aValue;
return String();
}
@@ -1511,14 +1493,13 @@ void PPDParser::getResolutionFromString(
const String& rString,
int& rXRes, int& rYRes ) const
{
- int nDPIPos;
+ int nPos = 0, nDPIPos;
rXRes = rYRes = 300;
nDPIPos = rString.SearchAscii( "dpi" );
if( nDPIPos != STRING_NOTFOUND )
{
- int nPos = 0;
if( ( nPos = rString.Search( 'x' ) ) != STRING_NOTFOUND )
{
rXRes = rString.Copy( 0, nPos ).ToInt32();
@@ -1597,7 +1578,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( (sal_uLong)0 )->m_aOption;
+ return m_pDuplexTypes->getValue( (ULONG)0 )->m_aOption;
return String();
}
@@ -1610,7 +1591,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( (sal_uLong)0 )->m_aValue;
+ return m_pDuplexTypes->getValue( (ULONG)0 )->m_aValue;
return String();
}
@@ -1743,7 +1724,7 @@ const PPDValue* PPDKey::getValueCaseInsensitive( const String& rOption ) const
if( m_aOrderedValues[n]->m_aOption.EqualsIgnoreCaseAscii( rOption ) )
pValue = m_aOrderedValues[n];
}
-
+
return pValue;
}
@@ -2052,7 +2033,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const
// -------------------------------------------------------------------
-void* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
+void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const
{
rBytes = 0;
if( ! m_aCurrentValues.size() )
@@ -2098,7 +2079,7 @@ void* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
// -------------------------------------------------------------------
-void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes )
+void PPDContext::rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes )
{
if( ! m_pParser )
return;
diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx
index e4634ab0c8b5..c71088fb03a5 100644
--- a/vcl/unx/source/printer/printerinfomanager.cxx
+++ b/vcl/unx/source/printer/printerinfomanager.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -36,7 +36,6 @@
#include "cupsmgr.hxx"
#include "vcl/fontmanager.hxx"
#include "vcl/strhelper.hxx"
-#include "saldata.hxx"
#include "tools/urlobj.hxx"
#include "tools/stream.hxx"
@@ -52,23 +51,17 @@
#include "osl/mutex.hxx"
#include "osl/process.h"
-#include <boost/scoped_ptr.hpp>
-
// filename of configuration files
#define PRINT_FILENAME "psprint.conf"
// the group of the global defaults
#define GLOBAL_DEFAULTS_GROUP "__Global_Printer_Defaults__"
-#include <boost/unordered_set.hpp>
+#include <hash_set>
using namespace psp;
+using namespace rtl;
using namespace osl;
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OStringToOUString;
-using ::rtl::OUStringHash;
-
namespace psp
{
class SystemQueueInfo : public Thread
@@ -78,16 +71,16 @@ namespace psp
std::list< PrinterInfoManager::SystemPrintQueue >
m_aQueues;
OUString m_aCommand;
-
+
virtual void run();
-
+
public:
SystemQueueInfo();
~SystemQueueInfo();
-
+
bool hasChanged() const;
OUString getCommand() const;
-
+
// sets changed status to false; therefore not const
void getSystemQueues( std::list< PrinterInfoManager::SystemPrintQueue >& rQueues );
};
@@ -101,28 +94,22 @@ namespace psp
PrinterInfoManager& PrinterInfoManager::get()
{
- SalData* pSalData = GetSalData();
-
- if( ! pSalData->m_pPIManager )
+ static PrinterInfoManager* pManager = NULL;
+
+ if( ! pManager )
{
- 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
+ pManager = CUPSManager::tryLoadCUPS();
+ if( ! pManager )
+ pManager = new PrinterInfoManager();
+
+ if( pManager )
+ pManager->initialize();
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pManager->getType() );
+ #endif
}
-
- return *pSalData->m_pPIManager;
-}
-
-void PrinterInfoManager::release()
-{
- SalData* pSalData = GetSalData();
- delete pSalData->m_pPIManager;
- pSalData->m_pPIManager = NULL;
+
+ return *pManager;
}
// -----------------------------------------------------------------
@@ -145,9 +132,6 @@ 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
}
// -----------------------------------------------------------------
@@ -205,7 +189,7 @@ bool PrinterInfoManager::checkPrintersChanged( bool bWait )
}
}
}
-
+
if( bWait && m_pQueueInfo )
{
#if OSL_DEBUG_LEVEL > 1
@@ -216,14 +200,14 @@ bool PrinterInfoManager::checkPrintersChanged( bool bWait )
fprintf( stderr, "done: syncing printer discovery thread\n" );
#endif
}
-
+
if( ! bChanged && m_pQueueInfo )
bChanged = m_pQueueInfo->hasChanged();
if( bChanged )
{
initialize();
}
-
+
return bChanged;
}
@@ -236,19 +220,19 @@ void PrinterInfoManager::initialize()
m_aPrinters.clear();
m_aWatchFiles.clear();
OUString aDefaultPrinter;
-
+
// first initialize the global defaults
// have to iterate over all possible files
// there should be only one global setup section in all
// available config files
m_aGlobalDefaults = PrinterInfo();
-
+
// need a parser for the PPDContext. generic printer should do.
m_aGlobalDefaults.m_pParser = PPDParser::getParser( String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) );
m_aGlobalDefaults.m_aContext.setParser( m_aGlobalDefaults.m_pParser );
m_aGlobalDefaults.m_bPerformFontSubstitution = true;
m_bDisableCUPS = false;
-
+
if( ! m_aGlobalDefaults.m_pParser )
{
#if OSL_DEBUG_LEVEL > 1
@@ -256,7 +240,7 @@ void PrinterInfoManager::initialize()
#endif
return;
}
-
+
std::list< OUString > aDirList;
psp::getPrinterPathList( aDirList, NULL );
std::list< OUString >::const_iterator print_dir_it;
@@ -271,15 +255,15 @@ void PrinterInfoManager::initialize()
fprintf( stderr, "found global defaults in %s\n", OUStringToOString( aFile.PathToFileName(), RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
#endif
aConfig.SetGroup( GLOBAL_DEFAULTS_GROUP );
-
+
ByteString aValue( aConfig.ReadKey( "Copies" ) );
if( aValue.Len() )
m_aGlobalDefaults.m_nCopies = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "Orientation" );
if( aValue.Len() )
m_aGlobalDefaults.m_eOrientation = aValue.EqualsIgnoreCaseAscii( "Landscape" ) ? orientation::Landscape : orientation::Portrait;
-
+
aValue = aConfig.ReadKey( "MarginAdjust" );
if( aValue.Len() )
{
@@ -288,23 +272,19 @@ void PrinterInfoManager::initialize()
m_aGlobalDefaults.m_nTopMarginAdjust = aValue.GetToken( 2, ',' ).ToInt32();
m_aGlobalDefaults.m_nBottomMarginAdjust = aValue.GetToken( 3, ',' ).ToInt32();
}
-
+
aValue = aConfig.ReadKey( "ColorDepth", "24" );
if( aValue.Len() )
m_aGlobalDefaults.m_nColorDepth = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "ColorDevice" );
if( aValue.Len() )
m_aGlobalDefaults.m_nColorDevice = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "PSLevel" );
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() )
{
@@ -313,7 +293,7 @@ void PrinterInfoManager::initialize()
else
m_aGlobalDefaults.m_bPerformFontSubstitution = false;
}
-
+
aValue = aConfig.ReadKey( "DisableCUPS" );
if( aValue.Len() )
{
@@ -322,7 +302,7 @@ void PrinterInfoManager::initialize()
else
m_bDisableCUPS = false;
}
-
+
// get the PPDContext of global JobData
for( int nKey = 0; nKey < aConfig.GetKeyCount(); nKey++ )
{
@@ -336,7 +316,7 @@ void PrinterInfoManager::initialize()
m_aGlobalDefaults.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- sal_True );
+ TRUE );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -346,20 +326,20 @@ void PrinterInfoManager::initialize()
}
}
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "global settings: fontsubst = %s, %" SAL_PRI_SIZET "u substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", m_aGlobalDefaults.m_aFontSubstitutes.size() );
+ fprintf( stderr, "global settings: fontsubst = %s, %d substitutes\n", m_aGlobalDefaults.m_bPerformFontSubstitution ? "true" : "false", m_aGlobalDefaults.m_aFontSubstitutes.size() );
#endif
}
}
setDefaultPaper( m_aGlobalDefaults.m_aContext );
fillFontSubstitutions( m_aGlobalDefaults );
-
+
// now collect all available printers
for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it )
{
INetURLObject aDir( *print_dir_it, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
INetURLObject aFile( aDir );
aFile.Append( String( RTL_CONSTASCII_USTRINGPARAM( PRINT_FILENAME ) ) );
-
+
// check directory validity
OUString aUniPath;
FileBase::getFileURLFromSystemPath( aDir.PathToFileName(), aUniPath );
@@ -367,12 +347,12 @@ void PrinterInfoManager::initialize()
if( aDirectory.open() )
continue;
aDirectory.close();
-
-
+
+
FileBase::getFileURLFromSystemPath( aFile.PathToFileName(), aUniPath );
FileStatus aStatus( FileStatusMask_ModifyTime );
DirectoryItem aItem;
-
+
// setup WatchFile list
WatchFile aWatchFile;
aWatchFile.m_aFilePath = aUniPath;
@@ -387,7 +367,7 @@ void PrinterInfoManager::initialize()
aWatchFile.m_aModified.Nanosec = 0;
}
m_aWatchFiles.push_back( aWatchFile );
-
+
Config aConfig( aFile.PathToFileName() );
for( int nGroup = 0; nGroup < aConfig.GetGroupCount(); nGroup++ )
{
@@ -396,12 +376,12 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
{
OUString aPrinterName;
-
+
int nNamePos = aValue.Search( '/' );
// check for valid value of "Printer"
if( nNamePos == STRING_NOTFOUND )
continue;
-
+
Printer aPrinter;
// initialize to global defaults
aPrinter.m_aInfo = m_aGlobalDefaults;
@@ -410,11 +390,11 @@ void PrinterInfoManager::initialize()
// newly created printers
aPrinter.m_aInfo.m_aFontSubstitutes.clear();
aPrinter.m_aInfo.m_aFontSubstitutions.clear();
-
+
aPrinterName = String( aValue.Copy( nNamePos+1 ), RTL_TEXTENCODING_UTF8 );
aPrinter.m_aInfo.m_aPrinterName = aPrinterName;
aPrinter.m_aInfo.m_aDriverName = String( aValue.Copy( 0, nNamePos ), RTL_TEXTENCODING_UTF8 );
-
+
// set parser, merge settings
// don't do this for CUPS printers as this is done
// by the CUPS system itself
@@ -423,11 +403,11 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_pParser = PPDParser::getParser( aPrinter.m_aInfo.m_aDriverName );
aPrinter.m_aInfo.m_aContext.setParser( aPrinter.m_aInfo.m_pParser );
// note: setParser also purges the context
-
+
// ignore this printer if its driver is not found
if( ! aPrinter.m_aInfo.m_pParser )
continue;
-
+
// merge the ppd context keys if the printer has the same keys and values
// this is a bit tricky, since it involves mixing two PPDs
// without constraints which might end up badly
@@ -452,7 +432,7 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aContext.setValue( pPrinterKey, NULL );
}
}
-
+
aValue = aConfig.ReadKey( "Command" );
// no printer without a command
if( ! aValue.Len() )
@@ -469,32 +449,32 @@ void PrinterInfoManager::initialize()
}
aPrinter.m_aInfo.m_aCommand = String( aValue, RTL_TEXTENCODING_UTF8 );
}
-
+
aValue = aConfig.ReadKey( "QuickCommand" );
aPrinter.m_aInfo.m_aQuickCommand = String( aValue, RTL_TEXTENCODING_UTF8 );
-
+
aValue = aConfig.ReadKey( "Features" );
aPrinter.m_aInfo.m_aFeatures = String( aValue, RTL_TEXTENCODING_UTF8 );
-
+
// override the settings in m_aGlobalDefaults if keys exist
aValue = aConfig.ReadKey( "DefaultPrinter" );
if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) )
aDefaultPrinter = aPrinterName;
-
+
aValue = aConfig.ReadKey( "Location" );
aPrinter.m_aInfo.m_aLocation = String( aValue, RTL_TEXTENCODING_UTF8 );
-
+
aValue = aConfig.ReadKey( "Comment" );
aPrinter.m_aInfo.m_aComment = String( aValue, RTL_TEXTENCODING_UTF8 );
-
+
aValue = aConfig.ReadKey( "Copies" );
if( aValue.Len() )
aPrinter.m_aInfo.m_nCopies = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "Orientation" );
if( aValue.Len() )
aPrinter.m_aInfo.m_eOrientation = aValue.EqualsIgnoreCaseAscii( "Landscape" ) ? orientation::Landscape : orientation::Portrait;
-
+
aValue = aConfig.ReadKey( "MarginAdjust" );
if( aValue.Len() )
{
@@ -503,29 +483,25 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_nTopMarginAdjust = aValue.GetToken( 2, ',' ).ToInt32();
aPrinter.m_aInfo.m_nBottomMarginAdjust = aValue.GetToken( 3, ',' ).ToInt32();
}
-
+
aValue = aConfig.ReadKey( "ColorDepth" );
if( aValue.Len() )
aPrinter.m_aInfo.m_nColorDepth = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "ColorDevice" );
if( aValue.Len() )
aPrinter.m_aInfo.m_nColorDevice = aValue.ToInt32();
-
+
aValue = aConfig.ReadKey( "PSLevel" );
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;
else
aPrinter.m_aInfo.m_bPerformFontSubstitution = false;
-
+
// now iterate over all keys to extract multi key information:
// 1. PPDContext information
// 2. Font substitution table
@@ -541,7 +517,7 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- sal_True );
+ TRUE );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -550,15 +526,15 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aFontSubstitutes[ OStringToOUString( aKey.Copy( 10 ), RTL_TEXTENCODING_ISO_8859_1 ) ] = OStringToOUString( aValue, RTL_TEXTENCODING_ISO_8859_1 );
}
}
-
+
setDefaultPaper( aPrinter.m_aInfo.m_aContext );
fillFontSubstitutions( aPrinter.m_aInfo );
-
+
// finally insert printer
FileBase::getFileURLFromSystemPath( aFile.PathToFileName(), aPrinter.m_aFile );
aPrinter.m_bModified = false;
aPrinter.m_aGroup = aConfig.GetGroupName( nGroup );
- boost::unordered_map< OUString, Printer, OUStringHash >::const_iterator find_it =
+ std::hash_map< OUString, Printer, OUStringHash >::const_iterator find_it =
m_aPrinters.find( aPrinterName );
if( find_it != m_aPrinters.end() )
{
@@ -569,7 +545,7 @@ void PrinterInfoManager::initialize()
}
}
}
-
+
// set default printer
if( m_aPrinters.size() )
{
@@ -579,23 +555,23 @@ void PrinterInfoManager::initialize()
else
aDefaultPrinter = OUString();
m_aDefaultPrinter = aDefaultPrinter;
-
+
if( m_eType != Default )
return;
-
+
// add a default printer for every available print queue
// merge paper and font substitution from default printer,
// all else from global defaults
PrinterInfo aMergeInfo( m_aGlobalDefaults );
aMergeInfo.m_aDriverName = String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) );
aMergeInfo.m_aFeatures = String( RTL_CONSTASCII_USTRINGPARAM( "autoqueue" ) );
-
+
if( m_aDefaultPrinter.getLength() )
{
PrinterInfo aDefaultInfo( getPrinterInfo( m_aDefaultPrinter ) );
aMergeInfo.m_bPerformFontSubstitution = aDefaultInfo.m_bPerformFontSubstitution;
fillFontSubstitutions( aMergeInfo );
-
+
const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
const PPDValue* pDefValue = aDefaultInfo.m_aContext.getValue( pDefKey );
@@ -603,23 +579,23 @@ void PrinterInfoManager::initialize()
if( pMergeKey && pMergeValue )
aMergeInfo.m_aContext.setValue( pMergeKey, pMergeValue );
}
-
+
getSystemPrintQueues();
for( ::std::list< SystemPrintQueue >::iterator it = m_aSystemPrintQueues.begin(); it != m_aSystemPrintQueues.end(); ++it )
{
String aPrinterName( RTL_CONSTASCII_USTRINGPARAM( "<" ) );
aPrinterName += String( it->m_aQueue );
aPrinterName.Append( '>' );
-
+
if( m_aPrinters.find( aPrinterName ) != m_aPrinters.end() )
// probably user made this one permanent in padmin
continue;
-
+
String aCmd( m_aSystemPrintCommand );
aCmd.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) ), it->m_aQueue );
-
+
Printer aPrinter;
-
+
// initialize to merged defaults
aPrinter.m_aInfo = aMergeInfo;
aPrinter.m_aInfo.m_aPrinterName = aPrinterName;
@@ -628,7 +604,7 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aLocation = it->m_aLocation;
aPrinter.m_bModified = false;
aPrinter.m_aGroup = ByteString( aPrinterName, aEncoding ); //provide group name in case user makes this one permanent in padmin
-
+
m_aPrinters[ aPrinterName ] = aPrinter;
}
}
@@ -637,7 +613,7 @@ void PrinterInfoManager::initialize()
void PrinterInfoManager::listPrinters( ::std::list< OUString >& rList ) const
{
- ::boost::unordered_map< OUString, Printer, OUStringHash >::const_iterator it;
+ ::std::hash_map< OUString, Printer, OUStringHash >::const_iterator it;
rList.clear();
for( it = m_aPrinters.begin(); it != m_aPrinters.end(); ++it )
rList.push_back( it->first );
@@ -648,10 +624,10 @@ void PrinterInfoManager::listPrinters( ::std::list< OUString >& rList ) const
const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter ) const
{
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 nonexistent printers" );
-
+ ::std::hash_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" );
+
return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo;
}
@@ -659,10 +635,10 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter
void PrinterInfoManager::changePrinterInfo( const OUString& rPrinter, const PrinterInfo& rNewInfo )
{
- ::boost::unordered_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinter );
-
+ ::std::hash_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinter );
+
DBG_ASSERT( it != m_aPrinters.end(), "Do not change nonexistant printers" );
-
+
if( it != m_aPrinters.end() )
{
it->second.m_aInfo = rNewInfo;
@@ -690,10 +666,10 @@ static bool checkWriteability( const OUString& rUniPath )
bool PrinterInfoManager::writePrinterConfig()
{
// find at least one writeable config
- ::boost::unordered_map< OUString, Config*, OUStringHash > files;
- ::boost::unordered_map< OUString, int, OUStringHash > rofiles;
- ::boost::unordered_map< OUString, Config*, OUStringHash >::iterator file_it;
-
+ ::std::hash_map< OUString, Config*, OUStringHash > files;
+ ::std::hash_map< OUString, int, OUStringHash > rofiles;
+ ::std::hash_map< OUString, Config*, OUStringHash >::iterator file_it;
+
for( ::std::list< WatchFile >::const_iterator wit = m_aWatchFiles.begin(); wit != m_aWatchFiles.end(); ++wit )
{
if( checkWriteability( wit->m_aFilePath ) )
@@ -702,21 +678,21 @@ bool PrinterInfoManager::writePrinterConfig()
break;
}
}
-
+
if( files.empty() )
return false;
-
+
Config* pGlobal = files.begin()->second;
pGlobal->SetGroup( GLOBAL_DEFAULTS_GROUP );
pGlobal->WriteKey( "DisableCUPS", m_bDisableCUPS ? "true" : "false" );
-
- ::boost::unordered_map< OUString, Printer, OUStringHash >::iterator it;
+
+ ::std::hash_map< OUString, Printer, OUStringHash >::iterator it;
for( it = m_aPrinters.begin(); it != m_aPrinters.end(); ++it )
{
if( ! it->second.m_bModified )
// printer was not changed, do nothing
continue;
-
+
// don't save autoqueue printers
sal_Int32 nIndex = 0;
bool bAutoQueue = false;
@@ -728,7 +704,7 @@ bool PrinterInfoManager::writePrinterConfig()
}
if( bAutoQueue )
continue;
-
+
if( it->second.m_aFile.getLength() )
{
// check if file is writable
@@ -761,16 +737,16 @@ bool PrinterInfoManager::writePrinterConfig()
}
else // a new printer, write it to the first file available
it->second.m_aFile = files.begin()->first;
-
+
if( ! it->second.m_aGroup.getLength() ) // probably a new printer
it->second.m_aGroup = OString( it->first.getStr(), it->first.getLength(), RTL_TEXTENCODING_UTF8 );
-
+
if( files.find( it->second.m_aFile ) != files.end() )
{
Config* pConfig = files[ it->second.m_aFile ];
pConfig->DeleteGroup( it->second.m_aGroup ); // else some old keys may remain
pConfig->SetGroup( it->second.m_aGroup );
-
+
ByteString aValue( String( it->second.m_aInfo.m_aDriverName ), RTL_TEXTENCODING_UTF8 );
aValue += '/';
aValue += ByteString( String( it->first ), RTL_TEXTENCODING_UTF8 );
@@ -784,7 +760,6 @@ 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 );
@@ -795,7 +770,7 @@ bool PrinterInfoManager::writePrinterConfig()
aValue += ',';
aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nBottomMarginAdjust );
pConfig->WriteKey( "MarginAdjust", aValue );
-
+
if( it->second.m_aInfo.m_aDriverName.compareToAscii( "CUPS:", 5 ) != 0 )
{
// write PPDContext (not for CUPS)
@@ -804,16 +779,16 @@ bool PrinterInfoManager::writePrinterConfig()
const PPDKey* pKey = it->second.m_aInfo.m_aContext.getModifiedKey( i );
ByteString aKey( "PPD_" );
aKey += ByteString( pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1 );
-
+
const PPDValue* pValue = it->second.m_aInfo.m_aContext.getValue( pKey );
aValue = pValue ? ByteString( pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ) : ByteString( "*nil" );
pConfig->WriteKey( aKey, aValue );
}
}
-
+
// write font substitution table
pConfig->WriteKey( "PerformFontSubstitution", it->second.m_aInfo.m_bPerformFontSubstitution ? "true" : "false" );
- for( ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator subst = it->second.m_aInfo.m_aFontSubstitutes.begin();
+ for( ::std::hash_map< OUString, OUString, OUStringHash >::const_iterator subst = it->second.m_aInfo.m_aFontSubstitutes.begin();
subst != it->second.m_aInfo.m_aFontSubstitutes.end(); ++subst )
{
ByteString aKey( "SubstFont_" );
@@ -822,11 +797,11 @@ bool PrinterInfoManager::writePrinterConfig()
}
}
}
-
+
// get rid of Config objects. this also writes any changes
for( file_it = files.begin(); file_it != files.end(); ++file_it )
delete file_it->second;
-
+
return true;
}
@@ -835,7 +810,7 @@ bool PrinterInfoManager::writePrinterConfig()
bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUString& rDriverName )
{
bool bSuccess = false;
-
+
const PPDParser* pParser = NULL;
if( m_aPrinters.find( rPrinterName ) == m_aPrinters.end() && ( pParser = PPDParser::getParser( rDriverName ) ) )
{
@@ -846,7 +821,7 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
aPrinter.m_aInfo.m_pParser = pParser;
aPrinter.m_aInfo.m_aContext.setParser( pParser );
aPrinter.m_aInfo.m_aPrinterName = rPrinterName;
-
+
fillFontSubstitutions( aPrinter.m_aInfo );
// merge PPD values with global defaults
for( int nPPDValueModified = 0; nPPDValueModified < m_aGlobalDefaults.m_aContext.countValuesModified(); nPPDValueModified++ )
@@ -868,14 +843,13 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
aPrinter.m_aInfo.m_aContext.setValue( pPrinterKey, NULL );
}
}
-
+
m_aPrinters[ rPrinterName ] = aPrinter;
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
+ fprintf( stderr, "new printer %s, level = %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
@@ -892,15 +866,15 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
bool PrinterInfoManager::removePrinter( const OUString& rPrinterName, bool bCheckOnly )
{
bool bSuccess = true;
-
- ::boost::unordered_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinterName );
+
+ ::std::hash_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinterName );
if( it != m_aPrinters.end() )
{
if( it->second.m_aFile.getLength() )
{
// this printer already exists in a config file
-
-
+
+
// check writeability of config file(s)
if( ! checkWriteability( it->second.m_aFile ) )
bSuccess = false;
@@ -915,7 +889,7 @@ bool PrinterInfoManager::removePrinter( const OUString& rPrinterName, bool bChec
}
if( bSuccess && ! bCheckOnly )
{
-
+
Config aConfig( it->second.m_aFile );
aConfig.DeleteGroup( it->second.m_aGroup );
aConfig.Flush();
@@ -946,8 +920,8 @@ bool PrinterInfoManager::removePrinter( const OUString& rPrinterName, bool bChec
bool PrinterInfoManager::setDefaultPrinter( const OUString& rPrinterName )
{
bool bSuccess = false;
-
- ::boost::unordered_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinterName );
+
+ ::std::hash_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinterName );
if( it != m_aPrinters.end() )
{
bSuccess = true;
@@ -972,24 +946,24 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const
{
PrintFontManager& rFontManager( PrintFontManager::get() );
rInfo.m_aFontSubstitutions.clear();
-
+
if( ! rInfo.m_bPerformFontSubstitution ||
! rInfo.m_aFontSubstitutes.size() )
return;
-
+
::std::list< FastPrintFontInfo > aFonts;
- ::boost::unordered_map< OUString, ::std::list< FastPrintFontInfo >, OUStringHash > aPrinterFonts;
+ ::std::hash_map< OUString, ::std::list< FastPrintFontInfo >, OUStringHash > aPrinterFonts;
rFontManager.getFontListWithFastInfo( aFonts, rInfo.m_pParser );
-
+
// get builtin fonts
::std::list< FastPrintFontInfo >::const_iterator it;
for( it = aFonts.begin(); it != aFonts.end(); ++it )
if( it->m_eType == fonttype::Builtin )
aPrinterFonts[ it->m_aFamilyName.toAsciiLowerCase() ].push_back( *it );
-
+
// map lower case, so build a local copy of the font substitutions
- ::boost::unordered_map< OUString, OUString, OUStringHash > aSubstitutions;
- ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator subst;
+ ::std::hash_map< OUString, OUString, OUStringHash > aSubstitutions;
+ ::std::hash_map< OUString, OUString, OUStringHash >::const_iterator subst;
for( subst = rInfo.m_aFontSubstitutes.begin(); subst != rInfo.m_aFontSubstitutes.end(); ++subst )
{
OUString aFamily( subst->first.toAsciiLowerCase() );
@@ -1000,8 +974,8 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const
else
aSubstitutions[ aFamily ] = subst->second.toAsciiLowerCase();
}
-
-
+
+
// now find substitutions
for( it = aFonts.begin(); it != aFonts.end(); ++it )
{
@@ -1022,15 +996,15 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const
int nDiff;
if( builtin->m_eItalic == it->m_eItalic )
nMatch += 8000;
-
+
nDiff = builtin->m_eWeight - it->m_eWeight;
nDiff = nDiff < 0 ? -nDiff : nDiff;
nMatch += 4000 - 1000*nDiff;
-
+
nDiff = builtin->m_eWidth - it->m_eWidth;
nDiff = nDiff < 0 ? -nDiff : nDiff;
nMatch += 2000 - 500*nDiff;
-
+
if( nMatch > nLastMatch )
{
nLastMatch = nMatch;
@@ -1050,7 +1024,7 @@ void PrinterInfoManager::fillFontSubstitutions( PrinterInfo& rInfo ) const
it->m_eItalic == italic::Upright ? "r" : it->m_eItalic == italic::Oblique ? "o" : it->m_eItalic == italic::Italic ? "i" : "u",
it->m_eWeight,
it->m_eWidth,
-
+
OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
aInfo.m_eItalic == italic::Upright ? "r" : aInfo.m_eItalic == italic::Oblique ? "o" : aInfo.m_eItalic == italic::Italic ? "i" : "u",
aInfo.m_eWeight,
@@ -1073,7 +1047,7 @@ void PrinterInfoManager::getSystemPrintCommands( std::list< OUString >& rCommand
m_pQueueInfo->getSystemQueues( m_aSystemPrintQueues );
delete m_pQueueInfo, m_pQueueInfo = NULL;
}
-
+
std::list< SystemPrintQueue >::const_iterator it;
rCommands.clear();
String aPrinterConst( RTL_CONSTASCII_USTRINGPARAM( "(PRINTER)" ) );
@@ -1093,7 +1067,7 @@ const std::list< PrinterInfoManager::SystemPrintQueue >& PrinterInfoManager::get
m_pQueueInfo->getSystemQueues( m_aSystemPrintQueues );
delete m_pQueueInfo, m_pQueueInfo = NULL;
}
-
+
return m_aSystemPrintQueues;
}
@@ -1119,18 +1093,18 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
rPrinterInfo.m_aQuickCommand : rPrinterInfo.m_aCommand;
rtl::OString aShellCommand = OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1);
aShellCommand += rtl::OString( " 2>/dev/null" );
-
+
return popen (aShellCommand.getStr(), "w");
}
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ )
{
return (0 == pclose( pFile ));
}
void PrinterInfoManager::setupJobContextData( JobData& rData )
{
- boost::unordered_map< OUString, Printer, OUStringHash >::iterator it =
+ std::hash_map< OUString, Printer, OUStringHash >::iterator it =
m_aPrinters.find( rData.m_aPrinterName );
if( it != m_aPrinters.end() )
{
@@ -1143,16 +1117,16 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const
{
if( ! rContext.getParser() )
return;
-
+
const PPDKey* pPageSizeKey = rContext.getParser()->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
if( ! pPageSizeKey )
return;
-
+
int nModified = rContext.countValuesModified();
while( nModified-- &&
rContext.getModifiedKey( nModified ) != pPageSizeKey )
;
-
+
if( nModified >= 0 ) // paper was set already, do not modify
{
#if OSL_DEBUG_LEVEL > 1
@@ -1161,7 +1135,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const
#endif
return;
}
-
+
// paper not set, fill in default value
const PPDValue* pPaperVal = NULL;
int nValues = pPageSizeKey->countValues();
@@ -1194,11 +1168,7 @@ SystemQueueInfo::SystemQueueInfo() :
SystemQueueInfo::~SystemQueueInfo()
{
- static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" );
- if( ! pNoSyncDetection || !*pNoSyncDetection )
- join();
- else
- terminate();
+ terminate();
}
bool SystemQueueInfo::hasChanged() const
@@ -1244,14 +1214,14 @@ static void lpgetSysQueueTokenHandler(
const SystemCommandParameters* )
{
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
- boost::unordered_set< OUString, OUStringHash > aUniqueSet;
- boost::unordered_set< OUString, OUStringHash > aOnlySet;
+ std::hash_set< OUString, OUStringHash > aUniqueSet;
+ std::hash_set< OUString, OUStringHash > aOnlySet;
aUniqueSet.insert( OUString( RTL_CONSTASCII_USTRINGPARAM( "_all" ) ) );
aUniqueSet.insert( OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) );
-
+
// the eventual "all" attribute of the "_all" queue tells us, which
// printers are to be used for this user at all
-
+
// find _all: line
rtl::OString aAllLine( "_all:" );
rtl::OString aAllAttr( "all=" );
@@ -1281,7 +1251,7 @@ static void lpgetSysQueueTokenHandler(
break;
}
}
-
+
bool bInsertAttribute = false;
rtl::OString aDescrStr( "description=" );
rtl::OString aLocStr( "location=" );
@@ -1341,7 +1311,7 @@ static void standardSysQueueTokenHandler(
const SystemCommandParameters* i_pParms)
{
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
- boost::unordered_set< OUString, OUStringHash > aUniqueSet;
+ std::hash_set< OUString, OUStringHash > aUniqueSet;
rtl::OString aForeToken( i_pParms->pForeToken );
rtl::OString aAftToken( i_pParms->pAftToken );
/* Normal Unix print queue discovery, also used for Darwin 5 LPR printing
@@ -1350,7 +1320,7 @@ static void standardSysQueueTokenHandler(
it != i_rLines.end(); ++it )
{
sal_Int32 nPos = 0;
-
+
// search for a line describing a printer:
// find if there are enough tokens before the name
for( unsigned int i = 0; i < i_pParms->nForeTokenCount && nPos != -1; i++ )
@@ -1399,7 +1369,7 @@ void SystemQueueInfo::run()
char pBuffer[1024];
FILE *pPipe;
std::list< rtl::OString > aLines;
-
+
/* Discover which command we can use to get a list of all printer queues */
for( unsigned int i = 0; i < SAL_N_ELEMENTS(aParms); i++ )
{
@@ -1409,7 +1379,7 @@ void SystemQueueInfo::run()
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "trying print queue command \"%s\" ... ", aParms[i].pQueueCommand );
#endif
- aCmdLine.append( " 2>/dev/null" );
+ aCmdLine.append( " 2>/dev/null" );
if( (pPipe = popen( aCmdLine.getStr(), "r" )) )
{
while( fgets( pBuffer, 1024, pPipe ) )
@@ -1431,7 +1401,7 @@ void SystemQueueInfo::run()
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "failed\n" );
#endif
- }
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/printergfx/bitmap_gfx.cxx b/vcl/unx/source/printergfx/bitmap_gfx.cxx
index c33e11122c51..c7bdd33f7137 100644
--- a/vcl/unx/source/printergfx/bitmap_gfx.cxx
+++ b/vcl/unx/source/printergfx/bitmap_gfx.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,7 +40,7 @@ const sal_uInt32 nLineLength = 80;
const sal_uInt32 nBufferSize = 16384;
/*
- *
+ *
* Bitmap compression / Hex encoding / Ascii85 Encoding
*
*/
@@ -50,7 +50,7 @@ PrinterBmp::~PrinterBmp ()
/* virtual base class */
-class ByteEncoder
+class ByteEncoder
{
private:
@@ -98,7 +98,7 @@ HexEncoder::~HexEncoder ()
WritePS (mpFile, "\n");
}
-void
+void
HexEncoder::WriteAscii (sal_uInt8 nByte)
{
sal_uInt32 nOff = psp::getHexValueOf (nByte, mpFileBuffer + mnOffset);
@@ -114,10 +114,10 @@ HexEncoder::WriteAscii (sal_uInt8 nByte)
FlushLine ();
}
-void
+void
HexEncoder::EncodeByte (sal_uInt8 nByte)
{
- WriteAscii (nByte);
+ WriteAscii (nByte);
}
void
@@ -130,7 +130,7 @@ HexEncoder::FlushLine ()
}
}
-/* Ascii85 encoder, is abi compatible with HexEncoder but writes a ~> to
+/* Ascii85 encoder, is abi compatible with HexEncoder but writes a ~> to
indicate end of data EOD */
class Ascii85Encoder : public ByteEncoder
@@ -219,7 +219,7 @@ Ascii85Encoder::ConvertToAscii85 ()
{
sal_uInt32 nEolOff = mnColumn - nLineLength;
sal_uInt32 nBufOff = mnOffset - nEolOff;
-
+
std::memmove (mpFileBuffer + nBufOff + 1, mpFileBuffer + nBufOff, nEolOff);
mpFileBuffer[ nBufOff ] = '\n';
@@ -303,7 +303,7 @@ public:
LZWEncoder (osl::File* pOutputFile);
~LZWEncoder ();
-
+
virtual void EncodeByte (sal_uInt8 nByte);
};
@@ -345,7 +345,7 @@ LZWEncoder::~LZWEncoder()
delete[] mpTable;
}
-void
+void
LZWEncoder::WriteBits (sal_uInt16 nCode, sal_uInt16 nCodeLen)
{
mdwShift |= (nCode << (mnOffset - nCodeLen));
@@ -360,7 +360,7 @@ LZWEncoder::WriteBits (sal_uInt16 nCode, sal_uInt16 nCodeLen)
WriteAscii ((sal_uInt8)(mdwShift >> 24));
}
-void
+void
LZWEncoder::EncodeByte (sal_uInt8 nByte )
{
LZWCTreeNode* p;
@@ -422,7 +422,7 @@ LZWEncoder::EncodeByte (sal_uInt8 nByte )
*/
void
-PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
+PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp& rBitmap)
{
double fScaleX = (double)rDest.GetWidth() / (double)rSrc.GetWidth();
@@ -445,7 +445,7 @@ PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
// image to save diskspace. This is important for printing transparent
// bitmaps that are disassembled into small pieces
sal_Int32 nImageSz = rSrc.GetWidth() * rSrc.GetHeight();
- sal_Int32 nPaletteSz = rBitmap.GetPaletteEntryCount();
+ sal_Int32 nPaletteSz = rBitmap.GetPaletteEntryCount();
if ((nImageSz < nPaletteSz) || (nImageSz < 24) )
DrawPS2TrueColorImage (rBitmap, rSrc);
else
@@ -456,7 +456,7 @@ PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
{
DrawPS2TrueColorImage (rBitmap, rSrc);
}
- else
+ else
{
DrawPS2GrayImage (rBitmap, rSrc);
}
@@ -471,7 +471,7 @@ PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
/* XXX does not work XXX */
void
-PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
+PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp& /*rBitmap*/, const PrinterBmp& /*rTransBitmap*/)
{
double fScaleX = (double)rDest.GetWidth() / (double)rSrc.GetWidth();
@@ -479,13 +479,13 @@ PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
PSGSave ();
PSTranslate (rDest.BottomLeft());
- PSScale (fScaleX, fScaleY);
+ PSScale (fScaleX, fScaleY);
PSGRestore ();
}
/* XXX does not work XXX */
void
-PrinterGfx::DrawMask (const Rectangle& rDest, const Rectangle& rSrc,
+PrinterGfx::DrawMask (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp &/*rBitmap*/, PrinterColor& /*rMaskColor*/)
{
double fScaleX = (double)rDest.GetWidth() / (double)rSrc.GetWidth();
@@ -493,7 +493,7 @@ PrinterGfx::DrawMask (const Rectangle& rDest, const Rectangle& rSrc,
PSGSave ();
PSTranslate (rDest.BottomLeft());
- PSScale (fScaleX, fScaleY);
+ PSScale (fScaleX, fScaleY);
PSGRestore ();
}
@@ -539,7 +539,7 @@ PrinterGfx::DrawPS1GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
}
}
- delete pEncoder;
+ delete pEncoder;
WritePS (mpPageBody, "\n");
}
@@ -550,7 +550,7 @@ PrinterGfx::DrawPS1GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
*
*/
-void
+void
PrinterGfx::writePS2ImageHeader (const Rectangle& rArea, psp::ImageType nType)
{
sal_Int32 nChar = 0;
@@ -594,7 +594,7 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType)
WritePS (mpPageBody, "/DeviceRGB setcolorspace\n");
break;
- case psp::MonochromeImage:
+ case psp::MonochromeImage:
case psp::PaletteImage:
{
@@ -611,7 +611,7 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType)
nChar += psp::appendStr ("\npsp_ascii85string\n", pImage + nChar);
WritePS (mpPageBody, pImage);
- ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
+ ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
: new Ascii85Encoder(mpPageBody);
for (sal_uInt32 i = 0; i < nSize; i++)
{
@@ -622,7 +622,7 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType)
pEncoder->EncodeByte (aColor.GetBlue());
}
delete pEncoder;
-
+
WritePS (mpPageBody, "pop ] setcolorspace\n");
}
break;
@@ -634,9 +634,9 @@ void
PrinterGfx::DrawPS2GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
{
writePS2Colorspace(rBitmap, psp::GrayScaleImage);
- writePS2ImageHeader(rArea, psp::GrayScaleImage);
+ writePS2ImageHeader(rArea, psp::GrayScaleImage);
- ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
+ ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
: new Ascii85Encoder(mpPageBody);
for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++)
@@ -657,20 +657,20 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp& rBitmap, const Rectangle& rArea)
writePS2Colorspace(rBitmap, psp::MonochromeImage);
writePS2ImageHeader(rArea, psp::MonochromeImage);
- ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
+ ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
: new Ascii85Encoder(mpPageBody);
for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++)
{
long nBitPos = 0;
- sal_uChar nBit = 0;
+ sal_uChar nBit = 0;
sal_uChar nByte = 0;
for (long nColumn = rArea.Left(); nColumn <= rArea.Right(); nColumn++)
{
nBit = rBitmap.GetPixelIdx (nRow, nColumn);
nByte |= nBit << (7 - nBitPos);
-
+
if (++nBitPos == 8)
{
pEncoder->EncodeByte (nByte);
@@ -692,7 +692,7 @@ PrinterGfx::DrawPS2PaletteImage (const PrinterBmp& rBitmap, const Rectangle& rAr
writePS2Colorspace(rBitmap, psp::PaletteImage);
writePS2ImageHeader(rArea, psp::PaletteImage);
- ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
+ ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
: new Ascii85Encoder(mpPageBody);
for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++)
@@ -713,7 +713,7 @@ PrinterGfx::DrawPS2TrueColorImage (const PrinterBmp& rBitmap, const Rectangle& r
writePS2Colorspace(rBitmap, psp::TrueColorImage);
writePS2ImageHeader(rArea, psp::TrueColorImage);
- ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
+ ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody)
: new Ascii85Encoder(mpPageBody);
for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++)
diff --git a/vcl/unx/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx
index fc366aab838f..abeacdd5bd6c 100644
--- a/vcl/unx/source/printergfx/common_gfx.cxx
+++ b/vcl/unx/source/printergfx/common_gfx.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@
using namespace psp ;
-static const sal_Int32 nMaxTextColumn = 80;
+static const sal_Int32 nMaxTextColumn = 80;
GraphicsStatus::GraphicsStatus() :
mbArtItalic( false ),
@@ -67,14 +67,14 @@ PrinterGfx::Init (PrinterJob &rPrinterJob)
mnDepth = rPrinterJob.GetDepth ();
mnPSLevel = rPrinterJob.GetPostscriptLevel ();
mbColor = rPrinterJob.IsColorPrinter ();
-
+
mnDpi = rPrinterJob.GetResolution();
rPrinterJob.GetScale (mfScaleX, mfScaleY);
const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( rPrinterJob.GetPrinterName() ) );
if( mpFontSubstitutes )
- delete const_cast< ::boost::unordered_map<fontID,fontID>* >(mpFontSubstitutes);
+ delete const_cast< ::std::hash_map<fontID,fontID>* >(mpFontSubstitutes);
if( rInfo.m_bPerformFontSubstitution )
- mpFontSubstitutes = new ::boost::unordered_map< fontID, fontID >( rInfo.m_aFontSubstitutions );
+ mpFontSubstitutes = new ::std::hash_map< fontID, fontID >( rInfo.m_aFontSubstitutions );
else
mpFontSubstitutes = NULL;
mbUploadPS42Fonts = rInfo.m_pParser ? ( rInfo.m_pParser->isType42Capable() ? sal_True : sal_False ) : sal_False;
@@ -96,13 +96,13 @@ PrinterGfx::Init (const JobData& rData)
mfScaleY = (double)72.0 / (double)mnDpi;
const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( rData.m_aPrinterName ) );
if( mpFontSubstitutes )
- delete const_cast< ::boost::unordered_map<fontID,fontID>* >(mpFontSubstitutes);
+ delete const_cast< ::std::hash_map<fontID,fontID>* >(mpFontSubstitutes);
if( rInfo.m_bPerformFontSubstitution )
- mpFontSubstitutes = new ::boost::unordered_map< fontID, fontID >( rInfo.m_aFontSubstitutions );
+ mpFontSubstitutes = new ::std::hash_map< fontID, fontID >( rInfo.m_aFontSubstitutions );
else
mpFontSubstitutes = NULL;
mbUploadPS42Fonts = rInfo.m_pParser ? ( rInfo.m_pParser->isType42Capable() ? sal_True : sal_False ) : sal_False;
-
+
return sal_True;
}
@@ -119,7 +119,7 @@ PrinterGfx::GetBitCount ()
return mnDepth;
}
-PrinterGfx::PrinterGfx() :
+PrinterGfx::PrinterGfx() :
mpPageHeader (NULL),
mpPageBody (NULL),
mnFontID (0),
@@ -144,7 +144,7 @@ PrinterGfx::PrinterGfx() :
PrinterGfx::~PrinterGfx()
{
/*
- * the original reasoning why mpFontSubstitutes is a pointer was
+ * #95810# the original reasoning why mpFontSubstitutes is a pointer was
* that applications should release all PrinterGfx when printers change
* because they are really invalid; the corresponding printers may have
* changed their settings or even not exist anymore.
@@ -152,7 +152,7 @@ PrinterGfx::~PrinterGfx()
* Alas, this is not always done real time. So we keep a local copy of
* the font substitutes now in case of bad timing.
*/
- delete const_cast< ::boost::unordered_map<fontID,fontID>* >(mpFontSubstitutes);
+ delete const_cast< ::std::hash_map<fontID,fontID>* >(mpFontSubstitutes);
}
void
@@ -217,7 +217,7 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
nextit = it;
++nextit;
std::list< Point > leftside, rightside;
-
+
Rectangle aLastRect( *it );
leftside.push_back( Point( it->Left(), it->Top() ) );
rightside.push_back( Point( it->Right()+1, it->Top() ) );
@@ -227,7 +227,7 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
++tempit;
if( nextit->Top() == aLastRect.Bottom()+1 )
{
- if(
+ if(
( nextit->Left() >= aLastRect.Left() && nextit->Left() <= aLastRect.Right() ) // left endpoint touches last rectangle
||
( nextit->Right() >= aLastRect.Left() && nextit->Right() <= aLastRect.Right() ) // right endpoint touches last rectangle
@@ -390,7 +390,7 @@ PrinterGfx::DrawLine (const Point& rFrom, const Point& rTo)
PSSetColor (maLineColor);
PSSetColor ();
PSSetLineWidth ();
-
+
PSMoveTo (rFrom);
PSLineTo (rTo);
WritePS (mpPageBody, "stroke\n" );
@@ -423,9 +423,9 @@ PrinterGfx::DrawPolyLine (sal_uInt32 nPoints, const Point* pPath)
PSSetLineWidth ();
PSBinCurrentPath (nPoints, pPath);
-
+
WritePS (mpPageBody, "stroke\n" );
- }
+ }
}
void
@@ -438,7 +438,7 @@ PrinterGfx::DrawPolygon (sal_uInt32 nPoints, const Point* pPath)
// setup closed path
Point aPoint( 0, 0 );
sal_Int32 nColumn( 0 );
-
+
PSBinStartPath();
PSBinMoveTo( pPath[0], aPoint, nColumn );
for( unsigned int n = 1; n < nPoints; n++ )
@@ -487,7 +487,7 @@ PrinterGfx::DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32* pSizes, const P
{
Point aPoint( 0, 0 );
sal_Int32 nColumn( 0 );
-
+
PSBinStartPath();
PSBinMoveTo( pPaths[i][0], aPoint, nColumn );
for( unsigned int n = 1; n < pSizes[i]; n++ )
@@ -528,11 +528,11 @@ PrinterGfx::DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32* pSizes, const P
*/
void
-PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
+PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
{
- const sal_uInt32 nBezString= 1024;
+ const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
-
+
if ( nPoints > 1 && maLineColor.Is() && pPath )
{
PSSetColor (maLineColor);
@@ -541,8 +541,8 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sa
snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
WritePS(mpPageBody, pString);
-
- // Handle the drawing of mixed lines mixed with curves
+
+ // Handle the drawing of mixed lines mixed with curves
// - a normal point followed by a normal point is a line
// - a normal point followed by 2 control points and a normal point is a curve
for (unsigned int i=1; i<nPoints;)
@@ -554,19 +554,19 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sa
}
else //Otherwise we're drawing a spline
{
- if (i+2 >= nPoints)
+ if (i+2 >= nPoints)
return; //Error: wrong sequence of contol/normal points somehow
if ((pFlgAry[i] == POLY_CONTROL) && (pFlgAry[i+1] == POLY_CONTROL) &&
(pFlgAry[i+2] != POLY_CONTROL))
{
snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPath[i].X(), pPath[i].Y(),
- pPath[i+1].X(), pPath[i+1].Y(),
+ pPath[i].X(), pPath[i].Y(),
+ pPath[i+1].X(), pPath[i+1].Y(),
pPath[i+2].X(), pPath[i+2].Y());
}
else
{
- OSL_FAIL( "PrinterGfx::DrawPolyLineBezier: Strange output" );
+ DBG_ERROR( "PrinterGfx::DrawPolyLineBezier: Strange output" );
}
i+=3;
}
@@ -579,17 +579,17 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sa
}
void
-PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
+PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
// premature end of operation
if (!(nPoints > 1) || (pPath == NULL) || !(maFillColor.Is() || maLineColor.Is()))
return;
-
+
snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
WritePS(mpPageBody, pString); //Move to the starting point for the PolyPoygon
- for (unsigned int i=1; i < nPoints;)
+ for (unsigned int i=1; i < nPoints;)
{
if (pFlgAry[i] != POLY_CONTROL)
{
@@ -599,20 +599,20 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal
}
else
{
- if (i+2 >= nPoints)
+ if (i+2 >= nPoints)
return; //Error: wrong sequence of contol/normal points somehow
if ((pFlgAry[i] == POLY_CONTROL) && (pFlgAry[i+1] == POLY_CONTROL) &&
(pFlgAry[i+2] != POLY_CONTROL))
{
snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPath[i].X(), pPath[i].Y(),
- pPath[i+1].X(), pPath[i+1].Y(),
+ pPath[i].X(), pPath[i].Y(),
+ pPath[i+1].X(), pPath[i+1].Y(),
pPath[i+2].X(), pPath[i+2].Y());
WritePS(mpPageBody, pString);
}
else
{
- OSL_FAIL( "PrinterGfx::DrawPolygonBezier: Strange output" );
+ DBG_ERROR( "PrinterGfx::DrawPolygonBezier: Strange output" );
}
i+=3;
}
@@ -631,25 +631,25 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal
// restore the current path
if( maFillColor.Is() && maLineColor.Is())
- PSGRestore();
+ PSGRestore();
}
void
-PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const sal_uInt8* const* pFlgAry)
+PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const BYTE* const* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
if ( !nPoly || !pPtAry || !pPoints || !(maFillColor.Is() || maLineColor.Is()))
return;
-
-
+
+
for (unsigned int i=0; i<nPoly;i++)
{
sal_uInt32 nPoints = pPoints[i];
- // sanity check
+ // #112689# sanity check
if( nPoints == 0 || pPtAry[i] == NULL )
continue;
-
+
snprintf(pString, nBezString, "%li %li moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point
WritePS(mpPageBody, pString);
for (unsigned int j=1; j < nPoints;)
@@ -669,20 +669,20 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
if ((pFlgAry[i][j] == POLY_CONTROL) && (pFlgAry[i][j+1] == POLY_CONTROL) && (pFlgAry[i][j+2] != POLY_CONTROL))
{
snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPtAry[i][j].X(), pPtAry[i][j].Y(),
- pPtAry[i][j+1].X(), pPtAry[i][j+1].Y(),
+ pPtAry[i][j].X(), pPtAry[i][j].Y(),
+ pPtAry[i][j+1].X(), pPtAry[i][j+1].Y(),
pPtAry[i][j+2].X(), pPtAry[i][j+2].Y());
WritePS(mpPageBody, pString);
}
else
{
- OSL_FAIL( "PrinterGfx::DrawPolyPolygonBezier: Strange output" );
+ DBG_ERROR( "PrinterGfx::DrawPolyPolygonBezier: Strange output" );
}
j+=3;
}
}
}
-
+
// if fill and stroke, save the current path
if( maFillColor.Is() && maLineColor.Is())
PSGSave();
@@ -696,7 +696,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
// restore the current path
if( maFillColor.Is() && maLineColor.Is())
- PSGRestore();
+ PSGRestore();
}
@@ -751,14 +751,14 @@ PrinterGfx::PSSetColor ()
sal_Int32 nChar = 0;
if( mbColor )
- {
- nChar = psp::getValueOfDouble (pBuffer,
+ {
+ nChar = psp::getValueOfDouble (pBuffer,
(double)rColor.GetRed() / 255.0, 5);
nChar += psp::appendStr (" ", pBuffer + nChar);
- nChar += psp::getValueOfDouble (pBuffer + nChar,
- (double)rColor.GetGreen() / 255.0, 5);
+ nChar += psp::getValueOfDouble (pBuffer + nChar,
+ (double)rColor.GetGreen() / 255.0, 5);
nChar += psp::appendStr (" ", pBuffer + nChar);
- nChar += psp::getValueOfDouble (pBuffer + nChar,
+ nChar += psp::getValueOfDouble (pBuffer + nChar,
(double)rColor.GetBlue() / 255.0, 5);
nChar += psp::appendStr (" setrgbcolor\n", pBuffer + nChar );
}
@@ -778,53 +778,53 @@ void
PrinterGfx::PSSetFont ()
{
GraphicsStatus& rCurrent( currentState() );
- if( maVirtualStatus.maFont != rCurrent.maFont ||
- maVirtualStatus.mnTextHeight != rCurrent.mnTextHeight ||
- maVirtualStatus.maEncoding != rCurrent.maEncoding ||
- maVirtualStatus.mnTextWidth != rCurrent.mnTextWidth ||
- maVirtualStatus.mbArtBold != rCurrent.mbArtBold ||
- maVirtualStatus.mbArtItalic != rCurrent.mbArtItalic
+ if( maVirtualStatus.maFont != rCurrent.maFont ||
+ maVirtualStatus.mnTextHeight != rCurrent.mnTextHeight ||
+ maVirtualStatus.maEncoding != rCurrent.maEncoding ||
+ maVirtualStatus.mnTextWidth != rCurrent.mnTextWidth ||
+ maVirtualStatus.mbArtBold != rCurrent.mbArtBold ||
+ maVirtualStatus.mbArtItalic != rCurrent.mbArtItalic
)
{
rCurrent.maFont = maVirtualStatus.maFont;
rCurrent.maEncoding = maVirtualStatus.maEncoding;
rCurrent.mnTextWidth = maVirtualStatus.mnTextWidth;
rCurrent.mnTextHeight = maVirtualStatus.mnTextHeight;
- rCurrent.mbArtItalic = maVirtualStatus.mbArtItalic;
- rCurrent.mbArtBold = maVirtualStatus.mbArtBold;
+ rCurrent.mbArtItalic = maVirtualStatus.mbArtItalic;
+ rCurrent.mbArtBold = maVirtualStatus.mbArtBold;
sal_Int32 nTextHeight = rCurrent.mnTextHeight;
- sal_Int32 nTextWidth = rCurrent.mnTextWidth ? rCurrent.mnTextWidth
+ sal_Int32 nTextWidth = rCurrent.mnTextWidth ? rCurrent.mnTextWidth
: rCurrent.mnTextHeight;
-
+
sal_Char pSetFont [256];
sal_Int32 nChar = 0;
- // postscript based fonts need reencoding
- if ( ( rCurrent.maEncoding == RTL_TEXTENCODING_MS_1252)
+ // postscript based fonts need reencoding
+ if ( ( rCurrent.maEncoding == RTL_TEXTENCODING_MS_1252)
|| ( rCurrent.maEncoding == RTL_TEXTENCODING_ISO_8859_1)
- || ( rCurrent.maEncoding >= RTL_TEXTENCODING_USER_START
+ || ( rCurrent.maEncoding >= RTL_TEXTENCODING_USER_START
&& rCurrent.maEncoding <= RTL_TEXTENCODING_USER_END)
)
{
- rtl::OString aReencodedFont =
- psp::GlyphSet::GetReencodedFontName (rCurrent.maEncoding,
+ rtl::OString aReencodedFont =
+ psp::GlyphSet::GetReencodedFontName (rCurrent.maEncoding,
rCurrent.maFont);
- nChar += psp::appendStr ("(", pSetFont + nChar);
- nChar += psp::appendStr (aReencodedFont.getStr(),
+ nChar += psp::appendStr ("(", pSetFont + nChar);
+ nChar += psp::appendStr (aReencodedFont.getStr(),
pSetFont + nChar);
nChar += psp::appendStr (") cvn findfont ",
- pSetFont + nChar);
+ pSetFont + nChar);
}
else
// tt based fonts mustn't reencode, the encoding is implied by the fontname
// same for symbol type1 fonts, dont try to touch them
{
- nChar += psp::appendStr ("(", pSetFont + nChar);
- nChar += psp::appendStr (rCurrent.maFont.getStr(),
+ nChar += psp::appendStr ("(", pSetFont + nChar);
+ nChar += psp::appendStr (rCurrent.maFont.getStr(),
pSetFont + nChar);
- nChar += psp::appendStr (") cvn findfont ",
+ nChar += psp::appendStr (") cvn findfont ",
pSetFont + nChar);
}
@@ -837,13 +837,13 @@ PrinterGfx::PSSetFont ()
}
else // skew 15 degrees to right
{
- nChar += psp::appendStr ( " [", pSetFont + nChar);
- nChar += psp::getValueOf (nTextWidth, pSetFont + nChar);
+ nChar += psp::appendStr ( " [", pSetFont + nChar);
+ nChar += psp::getValueOf (nTextWidth, pSetFont + nChar);
nChar += psp::appendStr (" 0 ", pSetFont + nChar);
nChar += psp::getValueOfDouble (pSetFont + nChar, 0.27*(double)nTextWidth, 3 );
- nChar += psp::appendStr ( " ", pSetFont + nChar);
+ nChar += psp::appendStr ( " ", pSetFont + nChar);
nChar += psp::getValueOf (-nTextHeight, pSetFont + nChar);
-
+
nChar += psp::appendStr (" 0 0] makefont setfont\n", pSetFont + nChar);
}
@@ -940,7 +940,7 @@ PrinterGfx::PSBinMoveTo (const Point& rCurrent, Point& rOld, sal_Int32& nColumn)
#else
PSBinPath (rCurrent, rOld, moveto, nColumn);
#endif
-}
+}
void
PrinterGfx::PSBinStartPath ()
@@ -977,7 +977,7 @@ PrinterGfx::PSBinCurrentPath (sal_uInt32 nPoints, const Point* pPath)
}
void
-PrinterGfx::PSBinPath (const Point& rCurrent, Point& rOld,
+PrinterGfx::PSBinPath (const Point& rCurrent, Point& rOld,
pspath_t eType, sal_Int32& nColumn)
{
sal_Char pPath[48];
@@ -989,7 +989,7 @@ PrinterGfx::PSBinPath (const Point& rCurrent, Point& rOld,
sal_Int32 nYPrec = getAlignedHexValueOf (rCurrent.Y() - rOld.Y(), pPath + 1 + nXPrec);
pPath [ 1 + nXPrec + nYPrec ] = 0;
- // build the command, it is a char with bit represention 000cxxyy
+ // build the command, it is a char with bit represention 000cxxyy
// c represents the char, xx and yy repr. the field width of the dx and dy shift,
// dx and dy represent the number of bytes to read after the opcode
sal_Char cCmd = (eType == lineto ? (sal_Char)0x00 : (sal_Char)0x10);
@@ -999,7 +999,7 @@ PrinterGfx::PSBinPath (const Point& rCurrent, Point& rOld,
case 4: cCmd |= 0x01; break;
case 6: cCmd |= 0x02; break;
case 8: cCmd |= 0x03; break;
- default: OSL_FAIL("invalid x precision in binary path");
+ default: DBG_ERROR ("invalid x precision in binary path");
}
switch (nXPrec)
{
@@ -1007,13 +1007,13 @@ PrinterGfx::PSBinPath (const Point& rCurrent, Point& rOld,
case 4: cCmd |= 0x04; break;
case 6: cCmd |= 0x08; break;
case 8: cCmd |= 0x0c; break;
- default: OSL_FAIL("invalid y precision in binary path");
+ default: DBG_ERROR ("invalid y precision in binary path");
}
cCmd += 'A';
pPath[0] = cCmd;
- // write the command to file,
- // line breaking at column nMaxTextColumn (80)
+ // write the command to file,
+ // line breaking at column nMaxTextColumn (80)
nChar = 1 + nXPrec + nYPrec;
if ((nColumn + nChar) > nMaxTextColumn)
{
@@ -1078,9 +1078,9 @@ PrinterGfx::PSDeltaArray (const sal_Int32 *pArray, sal_Int16 nEntries)
{
sal_Char pPSArray [128];
sal_Int32 nChar = 0;
-
+
nChar = psp::appendStr ("[", pPSArray + nChar);
- nChar += psp::getValueOf (pArray[0], pPSArray + nChar);
+ nChar += psp::getValueOf (pArray[0], pPSArray + nChar);
for (int i = 1; i < nEntries; i++)
{
@@ -1092,7 +1092,7 @@ PrinterGfx::PSDeltaArray (const sal_Int32 *pArray, sal_Int16 nEntries)
}
nChar += psp::appendStr (" ", pPSArray + nChar);
- nChar += psp::getValueOf (pArray[i] - pArray[i-1], pPSArray + nChar);
+ nChar += psp::getValueOf (pArray[i] - pArray[i-1], pPSArray + nChar);
}
nChar += psp::appendStr (" 0]\n", pPSArray + nChar);
@@ -1130,7 +1130,7 @@ PrinterGfx::PSShowText (const sal_uChar* pStr, sal_Int16 nGlyphs, sal_Int16 nByt
if (pDeltaArray == NULL)
{
PSHexString (pStr, nBytes);
-
+
if( maVirtualStatus.mbArtBold )
{
WritePS( mpPageBody, pBuffer );
@@ -1152,7 +1152,7 @@ PrinterGfx::PSShowText (const sal_uChar* pStr, sal_Int16 nGlyphs, sal_Int16 nByt
WritePS (mpPageBody, "xshow\n");
}
- // restore the user coordinate system
+ // restore the user coordinate system
if (mnTextAngle != 0)
PSGRestore ();
}
diff --git a/vcl/unx/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx
index 189d8419f4ec..98fb2b9a6f4b 100644
--- a/vcl/unx/source/printergfx/glyphset.cxx
+++ b/vcl/unx/source/printergfx/glyphset.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,33 +51,29 @@
using namespace vcl;
using namespace psp;
+using namespace rtl;
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringToOString;
-
-GlyphSet::GlyphSet ()
+GlyphSet::GlyphSet ()
: mnFontID (-1),
mbVertical (0),
mbUseFontEncoding (false)
{}
-GlyphSet::GlyphSet (sal_Int32 nFontID, sal_Bool bVertical)
+GlyphSet::GlyphSet (sal_Int32 nFontID, sal_Bool bVertical)
: mnFontID (nFontID),
mbVertical (bVertical)
{
PrintFontManager &rMgr = PrintFontManager::get();
- meBaseType = rMgr.getFontType (mnFontID);
- maBaseName = OUStringToOString (rMgr.getPSName(mnFontID),
+ meBaseType = rMgr.getFontType (mnFontID);
+ maBaseName = OUStringToOString (rMgr.getPSName(mnFontID),
RTL_TEXTENCODING_ASCII_US);
- mnBaseEncoding = rMgr.getFontEncoding(mnFontID);
- mbUseFontEncoding = rMgr.getUseOnlyFontEncoding(mnFontID);
+ mnBaseEncoding = rMgr.getFontEncoding(mnFontID);
+ mbUseFontEncoding = rMgr.getUseOnlyFontEncoding(mnFontID);
}
GlyphSet::~GlyphSet ()
{
- /* FIXME delete the glyphlist ??? */
+ /* FIXME delete the glyphlist ??? */
}
sal_Int32
@@ -103,29 +99,29 @@ GlyphSet::SetFont (sal_Int32 nFontID, sal_Bool bVertical)
{
if (mnFontID != -1)
return sal_False;
-
+
mnFontID = nFontID;
mbVertical = bVertical;
PrintFontManager &rMgr = PrintFontManager::get();
meBaseType = rMgr.getFontType (mnFontID);
- maBaseName = OUStringToOString (rMgr.getPSName(mnFontID),
+ maBaseName = OUStringToOString (rMgr.getPSName(mnFontID),
RTL_TEXTENCODING_ASCII_US);
mnBaseEncoding = rMgr.getFontEncoding(mnFontID);
- mbUseFontEncoding = rMgr.getUseOnlyFontEncoding(mnFontID);
+ mbUseFontEncoding = rMgr.getUseOnlyFontEncoding(mnFontID);
return sal_True;
}
sal_Bool
GlyphSet::GetCharID (
- sal_Unicode nChar,
+ sal_Unicode nChar,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID
)
{
return LookupCharID (nChar, nOutGlyphID, nOutGlyphSetID)
- || AddCharID (nChar, nOutGlyphID, nOutGlyphSetID);
+ || AddCharID (nChar, nOutGlyphID, nOutGlyphSetID);
}
sal_Bool
@@ -137,22 +133,22 @@ GlyphSet::GetGlyphID (
)
{
return LookupGlyphID (nGlyph, nOutGlyphID, nOutGlyphSetID)
- || AddGlyphID (nGlyph, nUnicode, nOutGlyphID, nOutGlyphSetID);
+ || AddGlyphID (nGlyph, nUnicode, nOutGlyphID, nOutGlyphSetID);
}
sal_Bool
GlyphSet::LookupCharID (
- sal_Unicode nChar,
+ sal_Unicode nChar,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID
)
{
char_list_t::iterator aGlyphSet;
- sal_Int32 nGlyphSetID;
+ sal_Int32 nGlyphSetID;
// loop thru all the font subsets
- for (aGlyphSet = maCharList.begin(), nGlyphSetID = 1;
- aGlyphSet != maCharList.end();
+ for (aGlyphSet = maCharList.begin(), nGlyphSetID = 1;
+ aGlyphSet != maCharList.end();
++aGlyphSet, nGlyphSetID++)
{
// check every subset if it contains the queried unicode char
@@ -173,17 +169,17 @@ GlyphSet::LookupCharID (
sal_Bool
GlyphSet::LookupGlyphID (
- sal_uInt32 nGlyph,
+ sal_uInt32 nGlyph,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID
)
{
glyph_list_t::iterator aGlyphSet;
- sal_Int32 nGlyphSetID;
+ sal_Int32 nGlyphSetID;
// loop thru all the font subsets
- for (aGlyphSet = maGlyphList.begin(), nGlyphSetID = 1;
- aGlyphSet != maGlyphList.end();
+ for (aGlyphSet = maGlyphList.begin(), nGlyphSetID = 1;
+ aGlyphSet != maGlyphList.end();
++aGlyphSet, nGlyphSetID++)
{
// check every subset if it contains the queried unicode char
@@ -205,9 +201,9 @@ GlyphSet::LookupGlyphID (
sal_uChar
GlyphSet::GetAnsiMapping (sal_Unicode nUnicodeChar)
{
- static rtl_UnicodeToTextConverter aConverter =
+ static rtl_UnicodeToTextConverter aConverter =
rtl_createUnicodeToTextConverter(RTL_TEXTENCODING_MS_1252);
- static rtl_UnicodeToTextContext aContext =
+ static rtl_UnicodeToTextContext aContext =
rtl_createUnicodeToTextContext( aConverter );
sal_Char nAnsiChar;
@@ -216,8 +212,8 @@ GlyphSet::GetAnsiMapping (sal_Unicode nUnicodeChar)
const sal_uInt32 nCvtFlags = RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
- sal_Size nSize = rtl_convertUnicodeToText( aConverter, aContext,
- &nUnicodeChar, 1, &nAnsiChar, 1,
+ sal_Size nSize = rtl_convertUnicodeToText( aConverter, aContext,
+ &nUnicodeChar, 1, &nAnsiChar, 1,
nCvtFlags, &nCvtInfo, &nCvtChars );
return nSize == 1 ? (sal_uChar)nAnsiChar : (sal_uChar)0;
@@ -249,12 +245,12 @@ GlyphSet::AddNotdef (glyph_map_t &rGlyphMap)
}
sal_Bool
GlyphSet::AddCharID (
- sal_Unicode nChar,
+ sal_Unicode nChar,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID
)
{
- sal_uChar nMappedChar;
+ sal_uChar nMappedChar;
// XXX important: avoid to reencode type1 symbol fonts
if (mnBaseEncoding == RTL_TEXTENCODING_SYMBOL)
@@ -277,15 +273,15 @@ GlyphSet::AddCharID (
char_map_t aMap;
maCharList.push_back (aMap);
}
-
+
// insert a new glyph in the font subset
if (nMappedChar)
{
// always put iso1252 chars into the first map, map them on itself
char_map_t& aGlyphSet = maCharList.front();
AddNotdef (aGlyphSet);
-
- aGlyphSet [nChar] = nMappedChar;
+
+ aGlyphSet [nChar] = nMappedChar;
*nOutGlyphSetID = 1;
*nOutGlyphID = nMappedChar;
}
@@ -301,7 +297,7 @@ GlyphSet::AddCharID (
*nOutGlyphSetID = maCharList.size();
*nOutGlyphID = aGlyphSet [nChar];
}
-
+
return sal_True;
}
@@ -313,7 +309,7 @@ GlyphSet::AddGlyphID (
sal_Int32* nOutGlyphSetID
)
{
- sal_uChar nMappedChar;
+ sal_uChar nMappedChar;
// XXX important: avoid to reencode type1 symbol fonts
if (mnBaseEncoding == RTL_TEXTENCODING_SYMBOL)
@@ -336,15 +332,15 @@ GlyphSet::AddGlyphID (
glyph_map_t aMap;
maGlyphList.push_back (aMap);
}
-
+
// insert a new glyph in the font subset
if (nMappedChar)
{
// always put iso1252 chars into the first map, map them on itself
glyph_map_t& aGlyphSet = maGlyphList.front();
AddNotdef (aGlyphSet);
-
- aGlyphSet [nGlyph] = nMappedChar;
+
+ aGlyphSet [nGlyph] = nMappedChar;
*nOutGlyphSetID = 1;
*nOutGlyphID = nMappedChar;
}
@@ -360,7 +356,7 @@ GlyphSet::AddGlyphID (
*nOutGlyphSetID = maGlyphList.size();
*nOutGlyphID = aGlyphSet [nGlyph];
}
-
+
return sal_True;
}
@@ -415,7 +411,7 @@ GlyphSet::GetGlyphSetEncoding (sal_Int32 nGlyphSetID)
if (mnBaseEncoding == RTL_TEXTENCODING_SYMBOL)
return RTL_TEXTENCODING_SYMBOL;
else
- return nGlyphSetID == 1 ? RTL_TEXTENCODING_MS_1252
+ return nGlyphSetID == 1 ? RTL_TEXTENCODING_MS_1252
: RTL_TEXTENCODING_USER_START + nGlyphSetID;
}
}
@@ -431,8 +427,8 @@ GlyphSet::GetGlyphSetEncodingName (rtl_TextEncoding nEnc, const OString &rFontNa
else
if (nEnc >= RTL_TEXTENCODING_USER_START && nEnc <= RTL_TEXTENCODING_USER_END)
{
- return rFontName
- + OString("Enc")
+ return rFontName
+ + OString("Enc")
+ OString::valueOf ((sal_Int32)(nEnc - RTL_TEXTENCODING_USER_START));
}
else
@@ -456,17 +452,17 @@ GlyphSet::PSDefineReencodedFont (osl::File* pOutFile, sal_Int32 nGlyphSetID)
sal_Char pEncodingVector [256];
sal_Int32 nSize = 0;
-
+
nSize += psp::appendStr ("(", pEncodingVector + nSize);
- nSize += psp::appendStr (GetReencodedFontName(nGlyphSetID),
+ nSize += psp::appendStr (GetReencodedFontName(nGlyphSetID),
pEncodingVector + nSize);
nSize += psp::appendStr (") cvn (", pEncodingVector + nSize);
- nSize += psp::appendStr (maBaseName.getStr(),
+ nSize += psp::appendStr (maBaseName.getStr(),
pEncodingVector + nSize);
nSize += psp::appendStr (") cvn ", pEncodingVector + nSize);
- nSize += psp::appendStr (GetGlyphSetEncodingName(nGlyphSetID),
+ nSize += psp::appendStr (GetGlyphSetEncodingName(nGlyphSetID),
pEncodingVector + nSize);
- nSize += psp::appendStr (" psp_definefont\n",
+ nSize += psp::appendStr (" psp_definefont\n",
pEncodingVector + nSize);
psp::WritePS (pOutFile, pEncodingVector);
@@ -478,14 +474,14 @@ GlyphSet::GetReencodedFontName (rtl_TextEncoding nEnc, const OString &rFontName)
if ( nEnc == RTL_TEXTENCODING_MS_1252
|| nEnc == RTL_TEXTENCODING_ISO_8859_1)
{
- return rFontName
+ return rFontName
+ OString("-iso1252");
}
else
if (nEnc >= RTL_TEXTENCODING_USER_START && nEnc <= RTL_TEXTENCODING_USER_END)
{
- return rFontName
- + OString("-enc")
+ return rFontName
+ + OString("-enc")
+ OString::valueOf ((sal_Int32)(nEnc - RTL_TEXTENCODING_USER_START));
}
else
@@ -516,14 +512,14 @@ void GlyphSet::DrawGlyphs(
for (int nChar = 0; nChar < nLen; nChar++)
{
GetGlyphID (pGlyphIds[nChar], pUnicodes[nChar], pGlyphID + nChar, pGlyphSetID + nChar);
- aGlyphSet.insert (pGlyphSetID[nChar]);
+ aGlyphSet.insert (pGlyphSetID[nChar]);
}
// loop over all glyph sets to detect substrings that can be xshown together
// without changing the postscript font
sal_Int32 *pDeltaSubset = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
sal_uChar *pGlyphSubset = (sal_uChar*)alloca (nLen * sizeof(sal_uChar));
-
+
std::set< sal_Int32 >::iterator aSet;
for (aSet = aGlyphSet.begin(); aSet != aGlyphSet.end(); ++aSet)
{
@@ -532,13 +528,13 @@ void GlyphSet::DrawGlyphs(
sal_Int32 nGlyphs = 0;
sal_Int32 nChar;
- // get offset to first glyph
+ // get offset to first glyph
for (nChar = 0; (nChar < nLen) && (pGlyphSetID[nChar] != *aSet); nChar++)
{
nOffset = pDeltaArray [nChar];
}
-
- // loop over all chars to extract those that share the current glyph set
+
+ // loop over all chars to extract those that share the current glyph set
for (nChar = 0; nChar < nLen; nChar++)
{
if (pGlyphSetID[nChar] == *aSet)
@@ -567,14 +563,14 @@ void GlyphSet::DrawGlyphs(
rGfx.PSSetFont (aGlyphSetName, GetGlyphSetEncoding(*aSet));
rGfx.PSMoveTo (aPoint);
rGfx.PSShowText (pGlyphSubset, nGlyphs, nGlyphs, nGlyphs > 1 ? pDeltaSubset : NULL);
- }
+ }
}
void
-GlyphSet::DrawText (PrinterGfx &rGfx, const Point& rPoint,
+GlyphSet::DrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen, const sal_Int32* pDeltaArray)
{
- // dispatch to the impl method
+ // dispatch to the impl method
if (pDeltaArray == NULL)
ImplDrawText (rGfx, rPoint, pStr, nLen);
else
@@ -582,7 +578,7 @@ GlyphSet::DrawText (PrinterGfx &rGfx, const Point& rPoint,
}
void
-GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
+GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen)
{
rGfx.PSMoveTo (rPoint);
@@ -599,11 +595,11 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
int nChar;
sal_uChar *pGlyphID = (sal_uChar*)alloca (nLen * sizeof(sal_uChar));
sal_Int32 *pGlyphSetID = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
-
+
// convert unicode to glyph id and char set (font subset)
for (nChar = 0; nChar < nLen; nChar++)
GetCharID (pStr[nChar], pGlyphID + nChar, pGlyphSetID + nChar);
-
+
// loop over the string to draw subsequent pieces of chars
// with the same postscript font
for (nChar = 0; nChar < nLen; /* atend */)
@@ -617,18 +613,18 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
else
break;
}
-
+
// show the text using the PrinterGfx text api
OString aGlyphSetName(GetCharSetName(nGlyphSetID));
rGfx.PSSetFont (aGlyphSetName, GetGlyphSetEncoding(nGlyphSetID));
rGfx.PSShowText (pGlyphID + nChar, nGlyphs, nGlyphs);
-
- nChar += nGlyphs;
+
+ nChar += nGlyphs;
}
}
void
-GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
+GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen, const sal_Int32* pDeltaArray)
{
if( mbUseFontEncoding )
@@ -649,14 +645,14 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
for (int nChar = 0; nChar < nLen; nChar++)
{
GetCharID (pStr[nChar], pGlyphID + nChar, pGlyphSetID + nChar);
- aGlyphSet.insert (pGlyphSetID[nChar]);
+ aGlyphSet.insert (pGlyphSetID[nChar]);
}
// loop over all glyph sets to detect substrings that can be xshown together
// without changing the postscript font
sal_Int32 *pDeltaSubset = (sal_Int32*)alloca (nLen * sizeof(sal_Int32));
sal_uChar *pGlyphSubset = (sal_uChar*)alloca (nLen * sizeof(sal_uChar));
-
+
std::set< sal_Int32 >::iterator aSet;
for (aSet = aGlyphSet.begin(); aSet != aGlyphSet.end(); ++aSet)
{
@@ -665,13 +661,13 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
sal_Int32 nGlyphs = 0;
sal_Int32 nChar;
- // get offset to first glyph
+ // get offset to first glyph
for (nChar = 0; (nChar < nLen) && (pGlyphSetID[nChar] != *aSet); nChar++)
{
nOffset = pDeltaArray [nChar];
}
-
- // loop over all chars to extract those that share the current glyph set
+
+ // loop over all chars to extract those that share the current glyph set
for (nChar = 0; nChar < nLen; nChar++)
{
if (pGlyphSetID[nChar] == *aSet)
@@ -700,7 +696,7 @@ GlyphSet::ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
rGfx.PSSetFont (aGlyphSetName, GetGlyphSetEncoding(*aSet));
rGfx.PSMoveTo (aPoint);
rGfx.PSShowText (pGlyphSubset, nGlyphs, nGlyphs, nGlyphs > 1 ? pDeltaSubset : NULL);
- }
+ }
}
sal_Bool
@@ -717,12 +713,12 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
// loop thru all the font subsets
sal_Int32 nGlyphSetID = 0;
char_list_t::iterator aGlyphSet;
- for (aGlyphSet = maCharList.begin(); aGlyphSet != maCharList.end(); ++aGlyphSet)
+ for (aGlyphSet = maCharList.begin(); aGlyphSet != maCharList.end(); aGlyphSet++)
{
++nGlyphSetID;
if (nGlyphSetID == 1) // latin1 page uses global reencoding table
- {
+ {
PSDefineReencodedFont (pOutFile, nGlyphSetID);
continue;
}
@@ -735,13 +731,13 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
sal_Char pEncodingVector [256];
sal_Int32 nSize = 0;
-
- nSize += psp::appendStr ("/",
- pEncodingVector + nSize);
- nSize += psp::appendStr (GetGlyphSetEncodingName(nGlyphSetID),
- pEncodingVector + nSize);
- nSize += psp::appendStr (" [ ",
+
+ nSize += psp::appendStr ("/",
+ pEncodingVector + nSize);
+ nSize += psp::appendStr (GetGlyphSetEncodingName(nGlyphSetID),
pEncodingVector + nSize);
+ nSize += psp::appendStr (" [ ",
+ pEncodingVector + nSize);
// need a list of glyphs, sorted by glyphid
typedef std::map< sal_uInt8, sal_Unicode > ps_mapping_t;
@@ -749,21 +745,21 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
ps_mapping_t aSortedGlyphSet;
char_map_t::const_iterator aUnsortedGlyph;
- for (aUnsortedGlyph = (*aGlyphSet).begin();
- aUnsortedGlyph != (*aGlyphSet).end();
+ for (aUnsortedGlyph = (*aGlyphSet).begin();
+ aUnsortedGlyph != (*aGlyphSet).end();
++aUnsortedGlyph)
{
- aSortedGlyphSet.insert(ps_value_t((*aUnsortedGlyph).second,
+ aSortedGlyphSet.insert(ps_value_t((*aUnsortedGlyph).second,
(*aUnsortedGlyph).first));
}
-
+
ps_mapping_t::const_iterator aSortedGlyph;
// loop thru all the glyphs in the subset
- for (aSortedGlyph = (aSortedGlyphSet).begin();
- aSortedGlyph != (aSortedGlyphSet).end();
+ for (aSortedGlyph = (aSortedGlyphSet).begin();
+ aSortedGlyph != (aSortedGlyphSet).end();
++aSortedGlyph)
{
- nSize += psp::appendStr ("/",
+ nSize += psp::appendStr ("/",
pEncodingVector + nSize);
std::list< OString > aName( rMgr.getAdobeNameFromUnicode((*aSortedGlyph).second) );
@@ -781,7 +777,7 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
nSize = 0;
}
}
-
+
nSize += psp::appendStr ("] def\n", pEncodingVector + nSize);
psp::WritePS (pOutFile, pEncodingVector);
@@ -795,13 +791,13 @@ struct EncEntry
{
sal_uChar aEnc;
long aGID;
-
+
EncEntry() : aEnc( 0 ), aGID( 0 ) {}
-
+
bool operator<( const EncEntry& rRight ) const
{ return aEnc < rRight.aEnc; }
};
-
+
static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
const char* pGlyphSetName, int nGlyphCount,
/*const*/ sal_uInt16* pRequestedGlyphs, /*const*/ sal_uChar* pEncoding,
@@ -812,16 +808,16 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
int nTargetMask = FontSubsetInfo::TYPE1_PFA | FontSubsetInfo::TYPE3_FONT;
if( bAllowType42 )
nTargetMask |= FontSubsetInfo::TYPE42_FONT;
-
+
std::vector< EncEntry > aSorted( nGlyphCount, EncEntry() );
for( int i = 0; i < nGlyphCount; i++ )
{
aSorted[i].aEnc = pEncoding[i];
aSorted[i].aGID = pRequestedGlyphs[i];
}
-
+
std::stable_sort( aSorted.begin(), aSorted.end() );
-
+
std::vector< sal_uChar > aEncoding( nGlyphCount );
std::vector< long > aRequestedGlyphs( nGlyphCount );
@@ -830,7 +826,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
aEncoding[i] = aSorted[i].aEnc;
aRequestedGlyphs[i] = aSorted[i].aGID;
}
-
+
FontSubsetInfo aInfo;
aInfo.LoadFont( pSrcFont );
@@ -845,7 +841,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
if (meBaseType != fonttype::TrueType)
return sal_False;
- TrueTypeFont *pTTFont;
+ TrueTypeFont *pTTFont;
OString aTTFileName (rGfx.GetFontMgr().getFontFileSysPath(mnFontID));
int nFace = rGfx.GetFontMgr().getFontFaceNumber(mnFontID);
sal_Int32 nSuccess = OpenTTFontFile(aTTFileName.getStr(), nFace < 0 ? 0 : nFace, &pTTFont);
@@ -867,8 +863,8 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
// loop thru all the font subsets
sal_Int32 nCharSetID;
char_list_t::iterator aCharSet;
- for (aCharSet = maCharList.begin(), nCharSetID = 1;
- aCharSet != maCharList.end();
+ for (aCharSet = maCharList.begin(), nCharSetID = 1;
+ aCharSet != maCharList.end();
++aCharSet, nCharSetID++)
{
if ((*aCharSet).size() == 0)
@@ -877,13 +873,13 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
// loop thru all the chars in the subset
char_map_t::const_iterator aChar;
sal_Int32 n = 0;
- for (aChar = (*aCharSet).begin(); aChar != (*aCharSet).end(); ++aChar)
+ for (aChar = (*aCharSet).begin(); aChar != (*aCharSet).end(); aChar++)
{
pUChars [n] = (*aChar).first;
pEncoding [n] = (*aChar).second;
- n++;
+ n++;
}
- // create a mapping from the unicode chars to the char encoding in
+ // create a mapping from the unicode chars to the char encoding in
// source TrueType font
MapString (pTTFont, pUChars, (*aCharSet).size(), pTTGlyphMapping, mbVertical);
@@ -899,7 +895,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
// loop thru all the font glyph subsets
sal_Int32 nGlyphSetID;
glyph_list_t::iterator aGlyphSet;
- for (aGlyphSet = maGlyphList.begin(), nGlyphSetID = 1;
+ for (aGlyphSet = maGlyphList.begin(), nGlyphSetID = 1;
aGlyphSet != maGlyphList.end();
++aGlyphSet, nGlyphSetID++)
{
@@ -909,11 +905,11 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
// loop thru all the glyphs in the subset
glyph_map_t::const_iterator aGlyph;
sal_Int32 n = 0;
- for (aGlyph = (*aGlyphSet).begin(); aGlyph != (*aGlyphSet).end(); ++aGlyph)
+ for (aGlyph = (*aGlyphSet).begin(); aGlyph != (*aGlyphSet).end(); aGlyph++)
{
pTTGlyphMapping [n] = (*aGlyph).first;
- pEncoding [n] = (*aGlyph).second;
- n++;
+ pEncoding [n] = (*aGlyph).second;
+ n++;
}
// create the current subset
@@ -925,7 +921,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
rSuppliedFonts.push_back( aGlyphSetName );
}
- // copy the file into the page header
+ // copy the file into the page header
rewind(pTmpFile);
fflush(pTmpFile);
diff --git a/vcl/unx/source/printergfx/glyphset.hxx b/vcl/unx/source/printergfx/glyphset.hxx
index c8b009c91155..ec7fd39162ce 100644
--- a/vcl/unx/source/printergfx/glyphset.hxx
+++ b/vcl/unx/source/printergfx/glyphset.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,7 +38,7 @@
#include "tools/gen.hxx"
#include <list>
-#include <boost/unordered_map.hpp>
+#include <hash_map>
namespace psp {
@@ -49,42 +49,42 @@ class GlyphSet
{
private:
- sal_Int32 mnFontID;
- sal_Bool mbVertical;
- rtl::OString maBaseName;
+ sal_Int32 mnFontID;
+ sal_Bool mbVertical;
+ rtl::OString maBaseName;
fonttype::type meBaseType;
rtl_TextEncoding mnBaseEncoding;
- bool mbUseFontEncoding;
+ bool mbUseFontEncoding;
- typedef boost::unordered_map< sal_Unicode, sal_uInt8 > char_map_t;
+ typedef std::hash_map< sal_Unicode, sal_uInt8 > char_map_t;
typedef std::list< char_map_t > char_list_t;
- typedef boost::unordered_map< sal_uInt32, sal_uInt8 > glyph_map_t;
+ typedef std::hash_map< sal_uInt32, sal_uInt8 > glyph_map_t;
typedef std::list< glyph_map_t > glyph_list_t;
- char_list_t maCharList;
- glyph_list_t maGlyphList;
+ char_list_t maCharList;
+ glyph_list_t maGlyphList;
- rtl::OString GetGlyphSetName (sal_Int32 nGlyphSetID);
- rtl::OString GetCharSetName (sal_Int32 nGlyphSetID);
+ rtl::OString GetGlyphSetName (sal_Int32 nGlyphSetID);
+ rtl::OString GetCharSetName (sal_Int32 nGlyphSetID);
sal_Int32 GetGlyphSetEncoding (sal_Int32 nGlyphSetID);
rtl::OString GetGlyphSetEncodingName (sal_Int32 nGlyphSetID);
rtl::OString GetReencodedFontName (sal_Int32 nGlyphSetID);
- void PSDefineReencodedFont (osl::File* pOutFile,
+ void PSDefineReencodedFont (osl::File* pOutFile,
sal_Int32 nGlyphSetID);
- sal_Bool GetCharID (sal_Unicode nChar,
+ sal_Bool GetCharID (sal_Unicode nChar,
sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
- sal_Bool LookupCharID (sal_Unicode nChar,
+ sal_Bool LookupCharID (sal_Unicode nChar,
sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
- sal_Bool AddCharID (sal_Unicode nChar,
+ sal_Bool AddCharID (sal_Unicode nChar,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID);
- sal_Bool GetGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
+ sal_Bool GetGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
- sal_Bool LookupGlyphID (sal_uInt32 nGlyph,
+ sal_Bool LookupGlyphID (sal_uInt32 nGlyph,
sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
- sal_Bool AddGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
+ sal_Bool AddGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
sal_uChar* nOutGlyphID,
sal_Int32* nOutGlyphSetID);
void AddNotdef (char_map_t &rCharMap);
@@ -92,9 +92,9 @@ private:
sal_uChar GetAnsiMapping (sal_Unicode nUnicodeChar);
sal_uChar GetSymbolMapping (sal_Unicode nUnicodeChar);
- void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
+ void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen);
- void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
+ void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen,
const sal_Int32* pDeltaArray);
@@ -104,29 +104,29 @@ public:
GlyphSet (sal_Int32 nFontID, sal_Bool bVertical);
~GlyphSet ();
- sal_Int32 GetFontID ();
+ sal_Int32 GetFontID ();
fonttype::type GetFontType ();
- static rtl::OString
- GetReencodedFontName (rtl_TextEncoding nEnc,
+ static rtl::OString
+ GetReencodedFontName (rtl_TextEncoding nEnc,
const rtl::OString &rFontName);
static rtl::OString
- GetGlyphSetEncodingName (rtl_TextEncoding nEnc,
+ GetGlyphSetEncodingName (rtl_TextEncoding nEnc,
const rtl::OString &rFontName);
- sal_Bool IsVertical ();
-
- sal_Bool SetFont (sal_Int32 nFontID, sal_Bool bVertical);
+ sal_Bool IsVertical ();
- void DrawText (PrinterGfx &rGfx, const Point& rPoint,
+ sal_Bool SetFont (sal_Int32 nFontID, sal_Bool bVertical);
+
+ void DrawText (PrinterGfx &rGfx, const Point& rPoint,
const sal_Unicode* pStr, sal_Int16 nLen,
const sal_Int32* pDeltaArray = NULL);
- void DrawGlyphs (PrinterGfx& rGfx,
+ void DrawGlyphs (PrinterGfx& rGfx,
const Point& rPoint,
const sal_uInt32* pGlyphIds,
const sal_Unicode* pUnicodes,
sal_Int16 nLen,
const sal_Int32* pDeltaArray );
sal_Bool PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx);
- sal_Bool PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAsType42, std::list< rtl::OString >& rSuppliedFonts );
+ sal_Bool PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAsType42, std::list< rtl::OString >& rSuppliedFonts );
};
diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx
index 7df531975c57..8c7c710f8e6c 100644
--- a/vcl/unx/source/printergfx/printerjob.cxx
+++ b/vcl/unx/source/printergfx/printerjob.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -57,21 +57,17 @@
#include <vector>
using namespace psp;
-
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
+using namespace rtl;
// forward declaration
#define nBLOCKSIZE 0x2000
-namespace psp
+namespace psp
{
sal_Bool
-AppendPS (FILE* pDst, osl::File* pSrc, sal_uChar* pBuffer,
+AppendPS (FILE* pDst, osl::File* pSrc, sal_uChar* pBuffer,
sal_uInt32 nBlockSize = nBLOCKSIZE)
{
if ((pDst == NULL) || (pSrc == NULL))
@@ -96,7 +92,7 @@ AppendPS (FILE* pDst, osl::File* pSrc, sal_uChar* pBuffer,
return sal_True;
}
-
+
} // namespace psp
/*
@@ -114,17 +110,17 @@ PrinterJob::CreateSpoolFile (const rtl::OUString& rName, const rtl::OUString& rE
nError = osl::File::getFileURLFromSystemPath( aFile, aFileURL );
if (nError != osl::File::E_None)
return NULL;
- aFileURL = maSpoolDirName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("/")) + aFileURL;
+ aFileURL = maSpoolDirName + rtl::OUString::createFromAscii ("/") + aFileURL;
pFile = new osl::File (aFileURL);
- nError = pFile->open (osl_File_OpenFlag_Read | osl_File_OpenFlag_Write | osl_File_OpenFlag_Create);
+ nError = pFile->open (OpenFlag_Read | OpenFlag_Write | OpenFlag_Create);
if (nError != osl::File::E_None)
{
delete pFile;
return NULL;
}
- pFile->setAttributes (aFileURL,
+ pFile->setAttributes (aFileURL,
osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnRead);
return pFile;
}
@@ -150,7 +146,7 @@ PrinterJob::GetDepth () const
}
sal_uInt16
-PrinterJob::GetPostscriptLevel (const JobData *pJobData) const
+PrinterJob::GetPostscriptLevel (const JobData *pJobData) const
{
sal_uInt16 nPSLevel = 2;
@@ -159,7 +155,7 @@ PrinterJob::GetPostscriptLevel (const JobData *pJobData) const
if( pJobData->m_nPSLevel )
nPSLevel = pJobData->m_nPSLevel;
- else
+ else
if( pJobData->m_pParser )
nPSLevel = pJobData->m_pParser->getLanguageLevel();
@@ -205,7 +201,7 @@ PrinterJob::GetCurrentPageBody ()
/*
* public methods of PrinterJob: the actual job / spool handling
- */
+ */
PrinterJob::PrinterJob () :
mpJobHeader( NULL ),
@@ -217,7 +213,7 @@ PrinterJob::PrinterJob () :
namespace psp
{
-/* check whether the given name points to a directory which is
+/* check whether the given name points to a directory which is
usable for the user */
sal_Bool
existsTmpDir (const char* pName)
@@ -231,14 +227,14 @@ existsTmpDir (const char* pName)
if (! S_ISDIR(aFileStatus.st_mode))
return sal_False;
- return access(pName, W_OK | R_OK) == 0 ? sal_True : sal_False;
+ return access(pName, W_OK | R_OK) == 0 ? sal_True : sal_False;
}
/* return the username in the given buffer */
sal_Bool
getUserName (char* pName, int nSize)
{
- struct passwd *pPWEntry;
+ struct passwd *pPWEntry;
struct passwd aPWEntry;
sal_Char pPWBuffer[256];
@@ -258,7 +254,7 @@ getUserName (char* pName, int nSize)
{
memcpy (pName, pPWEntry->pw_name, nLen);
pName[nLen] = '\0';
-
+
bSuccess = sal_True;
}
}
@@ -279,19 +275,19 @@ removeSpoolDir (const rtl::OUString& rSpoolDir)
{
// Conversion did not work, as this is quite a dangerous action,
// we should abort here ....
- OSL_FAIL( "psprint: couldn't remove spool directory" );
+ OSL_ENSURE( 0, "psprint: couldn't remove spool directory" );
return;
}
- rtl::OString aSysPathByte =
+ rtl::OString aSysPathByte =
rtl::OUStringToOString (aSysPath, osl_getThreadTextEncoding());
sal_Char pSystem [128];
sal_Int32 nChar = 0;
- nChar = psp::appendStr ("rm -rf ", pSystem);
+ nChar = psp::appendStr ("rm -rf ", pSystem);
nChar += psp::appendStr (aSysPathByte.getStr(), pSystem + nChar);
if (system (pSystem) == -1)
- OSL_FAIL( "psprint: couldn't remove spool directory" );
+ OSL_ENSURE( 0, "psprint: couldn't remove spool directory" );
}
/* creates a spool directory with a "pidgin random" value based on
@@ -302,10 +298,10 @@ createSpoolDir ()
TimeValue aCur;
osl_getSystemTime( &aCur );
sal_Int32 nRand = aCur.Seconds ^ (aCur.Nanosec/1000);
-
+
rtl::OUString aTmpDir;
osl_getTempDirURL( &aTmpDir.pData );
-
+
do
{
rtl::OUStringBuffer aDir( aTmpDir.getLength() + 16 );
@@ -331,12 +327,12 @@ createSpoolDir ()
PrinterJob::~PrinterJob ()
{
std::list< osl::File* >::iterator pPage;
- for (pPage = maPageList.begin(); pPage != maPageList.end(); ++pPage)
+ for (pPage = maPageList.begin(); pPage != maPageList.end(); pPage++)
{
//(*pPage)->remove();
delete *pPage;
}
- for (pPage = maHeaderList.begin(); pPage != maHeaderList.end(); ++pPage)
+ for (pPage = maHeaderList.begin(); pPage != maHeaderList.end(); pPage++)
{
//(*pPage)->remove();
delete *pPage;
@@ -347,8 +343,7 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- if( maSpoolDirName.getLength() )
- removeSpoolDir (maSpoolDirName);
+ removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
}
@@ -384,7 +379,7 @@ PrinterJob::StartJob (
const rtl::OUString& rFileName,
int nMode,
const rtl::OUString& rJobName,
- const rtl::OUString& rAppName,
+ const rtl::OUString& rAppName,
const JobData& rSetupData,
PrinterGfx* pGraphics,
bool bIsQuickJob
@@ -402,9 +397,9 @@ PrinterJob::StartJob (
maSpoolDirName = createSpoolDir ();
maJobTitle = rJobName;
- rtl::OUString aExt(RTL_CONSTASCII_USTRINGPARAM (".ps"));
- mpJobHeader = CreateSpoolFile (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("psp_head")), aExt);
- mpJobTrailer = CreateSpoolFile (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("psp_tail")), aExt);
+ rtl::OUString aExt = rtl::OUString::createFromAscii (".ps");
+ mpJobHeader = CreateSpoolFile (rtl::OUString::createFromAscii("psp_head"), aExt);
+ mpJobTrailer = CreateSpoolFile (rtl::OUString::createFromAscii("psp_tail"), aExt);
if( ! (mpJobHeader && mpJobTrailer) ) // existing files are removed in destructor
return sal_False;
@@ -414,11 +409,11 @@ PrinterJob::StartJob (
"%%BoundingBox: (atend)\n" );
rtl::OUString aFilterWS;
-
+
// Creator (this application)
- aFilterWS = WhitespaceToSpace( rAppName, sal_False );
- WritePS (mpJobHeader, "%%Creator: (");
- WritePS (mpJobHeader, aFilterWS);
+ aFilterWS = WhitespaceToSpace( rAppName, FALSE );
+ WritePS (mpJobHeader, "%%Creator: (");
+ WritePS (mpJobHeader, aFilterWS);
WritePS (mpJobHeader, ")\n");
// For (user name)
@@ -454,22 +449,22 @@ PrinterJob::StartJob (
* use the filename, if it contains only ascii
* else omit %%Title
*/
- aFilterWS = WhitespaceToSpace( rJobName, sal_False );
+ aFilterWS = WhitespaceToSpace( rJobName, FALSE );
rtl::OUString aTitle( aFilterWS );
if( ! isAscii( aTitle ) )
{
sal_Int32 nIndex = 0;
while( nIndex != -1 )
aTitle = rFileName.getToken( 0, '/', nIndex );
- aTitle = WhitespaceToSpace( aTitle, sal_False );
+ aTitle = WhitespaceToSpace( aTitle, FALSE );
if( ! isAscii( aTitle ) )
aTitle = rtl::OUString();
}
-
+
maJobTitle = aFilterWS;
if( aTitle.getLength() )
{
- WritePS (mpJobHeader, "%%Title: (");
+ WritePS (mpJobHeader, "%%Title: (");
WritePS (mpJobHeader, aTitle);
WritePS (mpJobHeader, ")\n");
}
@@ -502,10 +497,6 @@ 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 )
@@ -531,7 +522,7 @@ PrinterJob::EndJob ()
WritePS (mpJobTrailer, aTrailer.getStr());
/*
- * spool the set of files to their final destination, this is U**X dependent
+ * spool the set of files to their final destination, this is U**X dependent
*/
FILE* pDestFILE = NULL;
@@ -540,7 +531,7 @@ PrinterJob::EndJob ()
sal_Bool bSpoolToFile = maFileName.getLength() > 0 ? sal_True : sal_False;
if (bSpoolToFile)
{
- const rtl::OString aFileName = rtl::OUStringToOString (maFileName,
+ const rtl::OString aFileName = rtl::OUStringToOString (maFileName,
osl_getThreadTextEncoding());
if( mnFileMode )
{
@@ -556,7 +547,7 @@ PrinterJob::EndJob ()
}
}
else
- chmod( aFileName.getStr(), mnFileMode );
+ chmod( aFileName.getStr(), mnFileMode );
}
if (pDestFILE == NULL)
pDestFILE = fopen (aFileName.getStr(), "w");
@@ -583,12 +574,12 @@ PrinterJob::EndJob ()
std::list< osl::File* >::iterator pPageBody;
std::list< osl::File* >::iterator pPageHead;
for (pPageBody = maPageList.begin(), pPageHead = maHeaderList.begin();
- pPageBody != maPageList.end() && pPageHead != maHeaderList.end();
- ++pPageBody, ++pPageHead)
+ pPageBody != maPageList.end() && pPageHead != maHeaderList.end();
+ pPageBody++, pPageHead++)
{
if( *pPageHead )
{
- osl::File::RC nError = (*pPageHead)->open(osl_File_OpenFlag_Read);
+ osl::File::RC nError = (*pPageHead)->open(OpenFlag_Read);
if (nError == osl::File::E_None)
{
AppendPS (pDestFILE, *pPageHead, pBuffer);
@@ -599,7 +590,7 @@ PrinterJob::EndJob ()
bSuccess = sal_False;
if( *pPageBody )
{
- osl::File::RC nError = (*pPageBody)->open(osl_File_OpenFlag_Read);
+ osl::File::RC nError = (*pPageBody)->open(OpenFlag_Read);
if (nError == osl::File::E_None)
{
AppendPS (pDestFILE, *pPageBody, pBuffer);
@@ -609,7 +600,7 @@ PrinterJob::EndJob ()
else
bSuccess = sal_False;
}
-
+
AppendPS (pDestFILE, mpJobTrailer, pBuffer);
mpJobTrailer->close();
@@ -620,8 +611,8 @@ PrinterJob::EndJob ()
else
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
- if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData, true ))
+ if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
+ maJobTitle, pDestFILE, m_aDocumentJobData ))
{
bSuccess = sal_False;
}
@@ -651,7 +642,7 @@ PrinterJob::InitPaperSize (const JobData& rJobSetup)
if (pParser != NULL)
pParser->getMargins (aPaper, nLeft, nRight, nUpper, nLower);
- mnResolution = nRes;
+ mnResolution = nRes;
mnWidthPt = nWidth;
mnHeightPt = nHeight;
@@ -677,12 +668,12 @@ PrinterJob::StartPage (const JobData& rJobSetup)
InitPaperSize (rJobSetup);
rtl::OUString aPageNo = rtl::OUString::valueOf ((sal_Int32)maPageList.size()+1); // sequential page number must start with 1
- rtl::OUString aExt = aPageNo + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM (".ps"));
-
+ rtl::OUString aExt = aPageNo + rtl::OUString::createFromAscii (".ps");
+
osl::File* pPageHeader = CreateSpoolFile (
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("psp_pghead")), aExt);
+ rtl::OUString::createFromAscii("psp_pghead"), aExt);
osl::File* pPageBody = CreateSpoolFile (
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("psp_pgbody")), aExt);
+ rtl::OUString::createFromAscii("psp_pgbody"), aExt);
maHeaderList.push_back (pPageHeader);
maPageList.push_back (pPageBody);
@@ -692,7 +683,7 @@ PrinterJob::StartPage (const JobData& rJobSetup)
// write page header according to Document Structuring Conventions (DSC)
WritePS (pPageHeader, "%%Page: ");
- WritePS (pPageHeader, aPageNo);
+ WritePS (pPageHeader, aPageNo);
WritePS (pPageHeader, " ");
WritePS (pPageHeader, aPageNo);
WritePS (pPageHeader, "\n");
@@ -711,7 +702,7 @@ PrinterJob::StartPage (const JobData& rJobSetup)
sal_Char pBBox [256];
sal_Int32 nChar = 0;
- nChar = psp::appendStr ("%%PageBoundingBox: ", pBBox);
+ nChar = psp::appendStr ("%%PageBoundingBox: ", pBBox);
nChar += psp::getValueOf (mnLMarginPt, pBBox + nChar);
nChar += psp::appendStr (" ", pBBox + nChar);
nChar += psp::getValueOf (mnBMarginPt, pBBox + nChar);
@@ -727,7 +718,7 @@ PrinterJob::StartPage (const JobData& rJobSetup)
* (to %%Begin(End)Setup, instead of %%Begin(End)PageSetup)
* don't do this in StartJob since the jobsetup there may be
* different.
- */
+ */
bool bWriteFeatures = true;
if( 1 == maPageList.size() )
{
@@ -740,7 +731,7 @@ PrinterJob::StartPage (const JobData& rJobSetup)
m_aLastJobData = rJobSetup;
return true;
}
-
+
return false;
}
@@ -764,7 +755,7 @@ PrinterJob::EndPage ()
nChar += psp::appendStr ("%%PageTrailer\n\n", pTrailer + nChar);
WritePS (pPageBody, pTrailer);
- // this page is done for now, close it to avoid having too many open fd's
+ // this page is done for now, close it to avoid having too many open fd's
pPageHeader->close();
pPageBody->close();
@@ -781,7 +772,7 @@ PrinterJob::GetErrorCode ()
struct less_ppd_key : public ::std::binary_function<double, double, bool>
{
- bool operator()(const PPDKey* left, const PPDKey* right)
+ bool operator()(const PPDKey* left, const PPDKey* right)
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
@@ -808,13 +799,14 @@ static bool writeFeature( osl::File* pFile, const PPDKey* pKey, const PPDValue*
}
aFeature.append( "\n} stopped cleartomark\n" );
sal_uInt64 nWritten = 0;
- return pFile->write( aFeature.getStr(), aFeature.getLength(), nWritten )
+ return pFile->write( aFeature.getStr(), aFeature.getLength(), nWritten )
|| nWritten != (sal_uInt64)aFeature.getLength() ? false : true;
}
bool PrinterJob::writeFeatureList( osl::File* pFile, const JobData& rJob, bool bDocumentSetup )
{
bool bSuccess = true;
+ int i;
// emit features ordered to OrderDependency
// ignore features that are set to default
@@ -825,7 +817,6 @@ bool PrinterJob::writeFeatureList( osl::File* pFile, const JobData& rJob, bool b
( m_aLastJobData.m_pParser == rJob.m_pParser || m_aLastJobData.m_pParser == NULL )
)
{
- int i;
int nKeys = rJob.m_aContext.countValuesModified();
::std::vector< const PPDKey* > aKeys( nKeys );
for( i = 0; i < nKeys; i++ )
@@ -847,9 +838,9 @@ bool PrinterJob::writeFeatureList( osl::File* pFile, const JobData& rJob, bool b
if( bEmit )
{
const PPDValue* pValue = rJob.m_aContext.getValue( pKey );
- if( pValue
+ if( pValue
&& pValue->m_eType == eInvocation
- && ( m_aLastJobData.m_pParser == NULL
+ && ( m_aLastJobData.m_pParser == NULL
|| m_aLastJobData.m_aContext.getValue( pKey ) != pValue
|| bDocumentSetup
)
@@ -890,13 +881,13 @@ bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob, bool bWr
if( rJob.m_eOrientation == orientation::Portrait )
{
- nChar = psp::appendStr ("gsave\n[", pTranslate);
+ nChar = psp::appendStr ("gsave\n[", pTranslate);
nChar += psp::getValueOfDouble ( pTranslate + nChar, mfXScale, 5);
nChar += psp::appendStr (" 0 0 ", pTranslate + nChar);
nChar += psp::getValueOfDouble ( pTranslate + nChar, mfYScale, 5);
nChar += psp::appendStr (" ", pTranslate + nChar);
nChar += psp::getValueOf (mnRMarginPt, pTranslate + nChar);
- nChar += psp::appendStr (" ", pTranslate + nChar);
+ nChar += psp::appendStr (" ", pTranslate + nChar);
nChar += psp::getValueOf (mnHeightPt-mnTMarginPt,
pTranslate + nChar);
nChar += psp::appendStr ("] concat\ngsave\n",
@@ -904,8 +895,8 @@ bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob, bool bWr
}
else
{
- nChar = psp::appendStr ("gsave\n", pTranslate);
- nChar += psp::appendStr ("[ 0 ", pTranslate + nChar);
+ nChar = psp::appendStr ("gsave\n", pTranslate);
+ nChar += psp::appendStr ("[ 0 ", pTranslate + nChar);
nChar += psp::getValueOfDouble ( pTranslate + nChar, -mfYScale, 5);
nChar += psp::appendStr (" ", pTranslate + nChar);
nChar += psp::getValueOfDouble ( pTranslate + nChar, mfXScale, 5);
@@ -928,12 +919,12 @@ void PrinterJob::writeJobPatch( osl::File* pFile, const JobData& rJobData )
return;
const PPDKey* pKey = NULL;
-
+
if( rJobData.m_pParser )
pKey = rJobData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "JobPatchFile" ) ) );
if( ! pKey )
return;
-
+
// order the patch files
// according to PPD spec the JobPatchFile options must be int
// and should be emitted in order
@@ -1010,7 +1001,7 @@ bool PrinterJob::writeProlog (osl::File* pFile, const JobData& rJobData )
"/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] def\n"
"\n"
"/psp_definefont { exch dup findfont dup length dict begin { 1 index /FID ne\n"
- "{ def } { pop pop } ifelse } forall /Encoding 3 -1 roll def\n"
+ "{ def } { pop pop } ifelse } forall /Encoding 3 -1 roll def\n"
"currentdict end exch pop definefont pop } def\n"
"\n"
"/pathdict dup 8 dict def load begin\n"
@@ -1097,7 +1088,7 @@ bool PrinterJob::writeProlog (osl::File* pFile, const JobData& rJobData )
"/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] def\n"
"\n"
"/psp_definefont { exch dup findfont dup length dict begin { 1 index /FID ne\n"
- "{ def } { pop pop } ifelse } forall /Encoding 3 -1 roll def\n"
+ "{ def } { pop pop } ifelse } forall /Encoding 3 -1 roll def\n"
"currentdict end exch pop definefont pop } def\n"
"\n"
"/pathdict dup 8 dict def load begin\n"
@@ -1195,9 +1186,9 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob )
aLine += ByteString::CreateFromInt32( rJob.m_nCopies );
aLine += " def\n";
sal_uInt64 nWritten = 0;
- bSuccess = pFile->write( aLine.GetBuffer(), aLine.Len(), nWritten )
+ bSuccess = pFile->write( aLine.GetBuffer(), aLine.Len(), nWritten )
|| nWritten != aLine.Len() ? false : true;
-
+
if( bSuccess && GetPostscriptLevel( &rJob ) >= 2 )
WritePS (pFile, "<< /NumCopies null /Policies << /NumCopies 1 >> >> setpagedevice\n" );
}
diff --git a/vcl/unx/source/printergfx/psputil.cxx b/vcl/unx/source/printergfx/psputil.cxx
index 9a5de44960e6..5f4723bc867d 100644
--- a/vcl/unx/source/printergfx/psputil.cxx
+++ b/vcl/unx/source/printergfx/psputil.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,8 +35,8 @@
#include "tools/debug.hxx"
-namespace psp {
-
+namespace psp {
+
/*
* string convenience routines
*/
@@ -44,8 +44,8 @@ namespace psp {
sal_Int32
getHexValueOf (sal_Int32 nValue, sal_Char* pBuffer)
{
- const static sal_Char pHex [0x10] = {
- '0', '1', '2', '3', '4', '5', '6', '7',
+ const static sal_Char pHex [0x10] = {
+ '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
pBuffer[0] = pHex [(nValue & 0xF0) >> 4];
@@ -60,14 +60,14 @@ getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer)
// get sign
sal_Bool bNegative = nValue < 0;
nValue = bNegative ? -nValue : nValue;
-
+
// get required buffer size, must be a multiple of two
sal_Int32 nPrecision;
if (nValue < 0x80)
nPrecision = 2;
else
if (nValue < 0x8000)
- nPrecision = 4;
+ nPrecision = 4;
else
if (nValue < 0x800000)
nPrecision = 6;
@@ -95,8 +95,8 @@ getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer)
case '5' : pBuffer[0] = 'D'; break;
case '6' : pBuffer[0] = 'E'; break;
case '7' : pBuffer[0] = 'F'; break;
- default: OSL_FAIL("Already a signed value");
- }
+ default: DBG_ERROR("Already a signed value");
+ }
}
// report precision
@@ -121,7 +121,7 @@ getValueOf (sal_Int32 nValue, sal_Char* pBuffer)
}
sal_Char pInvBuffer [32];
- sal_Int32 nInvChar = 0;
+ sal_Int32 nInvChar = 0;
while (nValue > 0)
{
pInvBuffer [nInvChar++] = '0' + nValue % 10;
@@ -131,14 +131,14 @@ getValueOf (sal_Int32 nValue, sal_Char* pBuffer)
{
pBuffer [nChar++] = pInvBuffer [--nInvChar];
}
-
+
return nChar;
}
sal_Int32
appendStr (const sal_Char* pSrc, sal_Char* pDst)
{
- sal_Int32 nBytes = strlen (pSrc);
+ sal_Int32 nBytes = strlen (pSrc);
strncpy (pDst, pSrc, nBytes + 1);
return nBytes;
@@ -148,7 +148,7 @@ sal_Int32
appendStr (const sal_Char* pSrc, sal_Char* pDst, sal_Int32 nBytes)
{
strncpy (pDst, pSrc, nBytes);
- pDst [nBytes] = '\0';
+ pDst [nBytes] = '\0';
return nBytes;
}
@@ -161,7 +161,7 @@ WritePS (osl::File* pFile, const sal_Char* pString)
{
sal_uInt64 nInLength = rtl_str_getLength (pString);
sal_uInt64 nOutLength = 0;
-
+
if (nInLength > 0 && pFile)
pFile->write (pString, nInLength, nOutLength);
@@ -172,7 +172,7 @@ sal_Bool
WritePS (osl::File* pFile, const sal_Char* pString, sal_uInt64 nInLength)
{
sal_uInt64 nOutLength = 0;
-
+
if (nInLength > 0 && pFile)
pFile->write (pString, nInLength, nOutLength);
@@ -184,7 +184,7 @@ WritePS (osl::File* pFile, const rtl::OString &rString)
{
sal_uInt64 nInLength = rString.getLength();
sal_uInt64 nOutLength = 0;
-
+
if (nInLength > 0 && pFile)
pFile->write (rString, nInLength, nOutLength);
@@ -211,7 +211,7 @@ ConverterFactory::~ConverterFactory ()
rtl_destroyUnicodeToTextConverter (it->second);
}
-rtl_UnicodeToTextConverter
+rtl_UnicodeToTextConverter
ConverterFactory::Get (rtl_TextEncoding nEncoding)
{
if (rtl_isOctetTextEncoding( nEncoding ))
@@ -234,7 +234,7 @@ ConverterFactory::Get (rtl_TextEncoding nEncoding)
// wrapper for rtl_convertUnicodeToText that handles the usual cases for
// textconversion in drawtext
sal_Size
-ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen,
+ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen,
sal_uChar *pBuffer, sal_Size nBufferSize, rtl_TextEncoding nEncoding)
{
const sal_uInt32 nCvtFlags = RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK
@@ -245,7 +245,7 @@ ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen,
rtl_UnicodeToTextConverter aConverter = Get (nEncoding);
rtl_UnicodeToTextContext aContext = rtl_createUnicodeToTextContext (aConverter);
- sal_Size nSize = rtl_convertUnicodeToText (aConverter, aContext,
+ sal_Size nSize = rtl_convertUnicodeToText (aConverter, aContext,
pText, nTextLen, (sal_Char*)pBuffer, nBufferSize,
nCvtFlags, &nCvtInfo, &nCvtChars);
diff --git a/vcl/unx/source/printergfx/psputil.hxx b/vcl/unx/source/printergfx/psputil.hxx
index 878fd9c7791a..881e964e5c6e 100644
--- a/vcl/unx/source/printergfx/psputil.hxx
+++ b/vcl/unx/source/printergfx/psputil.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -40,10 +40,10 @@
namespace psp {
-/*
+/*
* string convenience routines
- * sizeof(pBuffer) must be at least 2 Bytes, 0x00 <= nValue <= 0xFF,
- * effective buffer of get*ValueOf() is NOT NULL-terminated
+ * sizeof(pBuffer) must be at least 2 Bytes, 0x00 <= nValue <= 0xFF,
+ * effective buffer of get*ValueOf() is NOT NULL-terminated
*/
sal_Int32 getHexValueOf (sal_Int32 nValue, sal_Char* pBuffer);
sal_Int32 getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer);
@@ -56,7 +56,7 @@ sal_Bool WritePS (osl::File* pFile, const sal_Char* pString, sal_uInt64 nInLe
sal_Bool WritePS (osl::File* pFile, const rtl::OString &rString);
sal_Bool WritePS (osl::File* pFile, const rtl::OUString &rString);
-class ConverterFactory
+class ConverterFactory
{
public:
@@ -64,11 +64,11 @@ public:
~ConverterFactory();
rtl_UnicodeToTextConverter Get (rtl_TextEncoding nEncoding);
sal_Size Convert (const sal_Unicode *pText, int nTextLen,
- sal_uChar *pBuffer, sal_Size nBufferSize,
+ sal_uChar *pBuffer, sal_Size nBufferSize,
rtl_TextEncoding nEncoding);
private:
- std::map< rtl_TextEncoding, rtl_UnicodeToTextConverter > m_aConverters;
+ std::map< rtl_TextEncoding, rtl_UnicodeToTextConverter > m_aConverters;
};
ConverterFactory* GetConverterFactory ();
diff --git a/vcl/unx/source/printergfx/text_gfx.cxx b/vcl/unx/source/printergfx/text_gfx.cxx
index 0b170565de75..349016587af2 100644
--- a/vcl/unx/source/printergfx/text_gfx.cxx
+++ b/vcl/unx/source/printergfx/text_gfx.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -50,7 +50,7 @@ namespace psp {
1st font is the font substitute e.g. helvetica substitutes arial on the printer
2nd is the font itself
3rd is a fallback font, usually a font with unicode glyph repertoir (e.g. andale)
- symbol fonts (adobe-fontspecific) may need special glyphmapping
+ symbol fonts (adobe-fontspecific) may need special glyphmapping
(symbol page vc. latin page)
*/
class Font3
@@ -60,13 +60,13 @@ class Font3
#define Font3Size 3
fontID mpFont [Font3Size];
- bool mbSymbol;
+ bool mbSymbol;
public:
- fontID GetFont (int nIdx) const
+ fontID GetFont (int nIdx) const
{ return nIdx < Font3Size ? mpFont[nIdx] : -1 ; }
- bool IsSymbolFont () const
+ bool IsSymbolFont () const
{ return mbSymbol; }
Font3 (const PrinterGfx &rGfx);
@@ -76,13 +76,13 @@ class Font3
Font3::Font3(const PrinterGfx &rGfx)
{
mpFont[0] = rGfx.getFontSubstitute();
- mpFont[1] = rGfx.GetFontID();
+ mpFont[1] = rGfx.GetFontID();
mpFont[2] = rGfx.getFallbackID();
// mpFont[2] = rGfx.GetFontID();
- PrintFontManager &rMgr = PrintFontManager::get();
- mbSymbol = mpFont[1] != -1 ?
- rMgr.getFontEncoding(mpFont[1]) == RTL_TEXTENCODING_SYMBOL : false;
+ PrintFontManager &rMgr = PrintFontManager::get();
+ mbSymbol = mpFont[1] != -1 ?
+ rMgr.getFontEncoding(mpFont[1]) == RTL_TEXTENCODING_SYMBOL : false;
}
} // namespace psp
@@ -99,7 +99,7 @@ static int getVerticalDeltaAngle( sal_Unicode nChar )
/* #i52932# remember:
nChar == 0x2010 || nChar == 0x2015
nChar == 0x2016 || nChar == 0x2026
-
+
are nAngle = 0 also, but already handled in the first if
*/
if( ( nChar >= 0x3008 && nChar < 0x3019 && nChar != 0x3012 ) ||
@@ -134,7 +134,7 @@ PrinterGfx::PSUploadPS1Font (sal_Int32 nFontID)
* implement text handling printer routines,
*/
-sal_uInt16
+sal_uInt16
PrinterGfx::SetFont(
sal_Int32 nFontID,
sal_Int32 nHeight,
@@ -152,15 +152,15 @@ PrinterGfx::SetFont(
maVirtualStatus.maEncoding = RTL_TEXTENCODING_DONTKNOW;
maVirtualStatus.mnTextHeight = nHeight;
maVirtualStatus.mnTextWidth = nWidth;
- maVirtualStatus.mbArtItalic = bArtItalic;
- maVirtualStatus.mbArtBold = bArtBold;
+ maVirtualStatus.mbArtItalic = bArtItalic;
+ maVirtualStatus.mbArtBold = bArtBold;
mnTextAngle = nAngle;
mbTextVertical = bVertical;
return 0;
}
-sal_uInt16
+sal_uInt16
PrinterGfx::SetFallbackFont ( sal_Int32 nFontID )
{
mnFallbackID = nFontID;
@@ -176,18 +176,18 @@ void PrinterGfx::drawGlyphs(
)
{
- // draw the string
+ // draw the string
// search for a glyph set matching the set font
std::list< GlyphSet >::iterator aIter;
- for (aIter = maPS3Font.begin(); aIter != maPS3Font.end(); ++aIter)
- if ( ((*aIter).GetFontID() == mnFontID)
+ for (aIter = maPS3Font.begin(); aIter != maPS3Font.end(); aIter++)
+ if ( ((*aIter).GetFontID() == mnFontID)
&& ((*aIter).IsVertical() == mbTextVertical))
{
(*aIter).DrawGlyphs (*this, rPoint, pGlyphIds, pUnicodes, nLen, pDeltaArray);
break;
}
-
- // not found ? create a new one
+
+ // not found ? create a new one
if (aIter == maPS3Font.end())
{
maPS3Font.push_back (GlyphSet(mnFontID, mbTextVertical));
@@ -257,10 +257,10 @@ void PrinterGfx::DrawGlyphs(
const sal_GlyphId nRot = pGlyphIds[i] & GF_ROTMASK;
if( nRot == GF_NONE )
{
- pTempUnicodes[nTempLen] = pUnicodes[i];
+ pTempUnicodes[nTempLen] = pUnicodes[i];
pTempGlyphIds[nTempLen] = pGlyphIds[i];
if( nTempLen > 0 )
- pTempDelta[nTempLen-1] = pDeltaArray[i-1]-nTempFirstDelta;
+ pTempDelta[nTempLen-1] = pDeltaArray[i-1]-nTempFirstDelta;
else
{
// the first element in pDeltaArray shows
@@ -293,9 +293,9 @@ void PrinterGfx::DrawGlyphs(
aRotPoint = Point( -nDescend*nTextWidth/nTextHeight, nOffset + nAscend*nTextWidth/nTextHeight );
break;
}
- sal_GlyphId nRotGlyphId = pGlyphIds[i];
- sal_Unicode nRotUnicode = pUnicodes[i];
- sal_Int32 nRotDelta = 0;
+ sal_GlyphId nRotGlyphId = pGlyphIds[i];
+ sal_Unicode nRotUnicode = pUnicodes[i];
+ sal_Int32 nRotDelta = 0;
// transform matrix to new individual direction
PSGSave ();
@@ -340,13 +340,13 @@ void
PrinterGfx::DrawText (
const Point& rPoint,
const sal_Unicode* pStr,
- sal_Int16 nLen,
+ sal_Int16 nLen,
const sal_Int32* pDeltaArray
)
{
fontID nRestoreFont = mnFontID;
- // setup font[substitutes] and map the string into the symbol area in case of
+ // setup font[substitutes] and map the string into the symbol area in case of
// symbol font
Font3 aFont(*this);
sal_Unicode *pEffectiveStr;
@@ -358,7 +358,7 @@ PrinterGfx::DrawText (
}
else
{
- pEffectiveStr = const_cast<sal_Unicode*>(pStr);
+ pEffectiveStr = const_cast<sal_Unicode*>(pStr);
}
fontID *pFontMap = (fontID*) alloca(nLen * sizeof(fontID));
@@ -399,7 +399,7 @@ PrinterGfx::DrawText (
PSTranslate (rPoint);
PSRotate (nCurrentTextAngle);
mnTextAngle = 0;
-
+
nCurrentPointX = 0;
nCurrentPointY = 0;
}
@@ -409,7 +409,7 @@ PrinterGfx::DrawText (
nCurrentPointY = rPoint.Y();
}
- // draw the string
+ // draw the string
sal_Int32 nDelta = 0;
for (int nTo = 0; nTo < nLen; )
{
@@ -423,25 +423,25 @@ PrinterGfx::DrawText (
}
SetFont( nFont,
- maVirtualStatus.mnTextHeight, maVirtualStatus.mnTextWidth,
+ maVirtualStatus.mnTextHeight, maVirtualStatus.mnTextWidth,
mnTextAngle,
mbTextVertical,
maVirtualStatus.mbArtItalic,
maVirtualStatus.mbArtBold
);
-
+
if (mbTextVertical)
{
- drawVerticalizedText(
- Point(nCurrentPointX + nDelta, nCurrentPointY),
- pEffectiveStr + nFrom, nTo - nFrom,
+ drawVerticalizedText(
+ Point(nCurrentPointX + nDelta, nCurrentPointY),
+ pEffectiveStr + nFrom, nTo - nFrom,
pNewDeltaArray + nFrom );
}
else
{
- drawText(
- Point(nCurrentPointX + nDelta, nCurrentPointY),
- pEffectiveStr + nFrom, nTo - nFrom,
+ drawText(
+ Point(nCurrentPointX + nDelta, nCurrentPointY),
+ pEffectiveStr + nFrom, nTo - nFrom,
pDeltaArray == NULL ? NULL : pNewDeltaArray + nFrom );
}
nDelta += pNewDeltaArray[ nTo - 1 ];
@@ -456,7 +456,7 @@ PrinterGfx::DrawText (
// restore the original font settings
SetFont( nRestoreFont,
- maVirtualStatus.mnTextHeight, maVirtualStatus.mnTextWidth,
+ maVirtualStatus.mnTextHeight, maVirtualStatus.mnTextWidth,
mnTextAngle, mbTextVertical,
maVirtualStatus.mbArtItalic,
maVirtualStatus.mbArtBold
@@ -466,7 +466,7 @@ PrinterGfx::DrawText (
void PrinterGfx::drawVerticalizedText(
const Point& rPoint,
const sal_Unicode* pStr,
- sal_Int16 nLen,
+ sal_Int16 nLen,
const sal_Int32* pDeltaArray
)
{
@@ -495,32 +495,32 @@ void PrinterGfx::drawVerticalizedText(
{
for( int n = nLastPos; n < i; n++ )
pDelta[n] = pDeltaArray[n] - (aPoint.X() - rPoint.X() );
-
+
SetFont( mnFontID,
maVirtualStatus.mnTextHeight, maVirtualStatus.mnTextWidth,
nNormalAngle, mbTextVertical,
maVirtualStatus.mbArtItalic,
maVirtualStatus.mbArtBold );
drawText( aPoint, pStr + nLastPos, i - nLastPos, pDelta + nLastPos );
-
+
aPoint.X() = (sal_Int32)(rPoint.X() + ((double)pDeltaArray[i-1] * fCos));
aPoint.Y() = (sal_Int32)(rPoint.Y() + ((double)pDeltaArray[i-1] * fSin));
}
if( i < nLen )
{
- int nOldWidth = maVirtualStatus.mnTextWidth;
- int nOldHeight = maVirtualStatus.mnTextHeight;
+ int nOldWidth = maVirtualStatus.mnTextWidth;
+ int nOldHeight = maVirtualStatus.mnTextHeight;
SetFont( mnFontID,
nTextScale,
maVirtualStatus.mnTextHeight,
- nNormalAngle + nDeltaAngle,
+ nNormalAngle + nDeltaAngle,
mbTextVertical,
maVirtualStatus.mbArtItalic,
maVirtualStatus.mbArtBold );
double nA = nTextScale * aInfo.m_nAscend / 1000.0;
double nD = nTextScale * aInfo.m_nDescend / 1000.0;
- double fStretch = (double)maVirtualStatus.mnTextWidth / maVirtualStatus.mnTextHeight;
+ double fStretch = (double)maVirtualStatus.mnTextWidth / maVirtualStatus.mnTextHeight;
if( !pGsubFlags[i] )
nD *= fStretch;
@@ -547,7 +547,7 @@ void PrinterGfx::drawVerticalizedText(
SetFont( mnFontID,
nOldHeight,
nOldWidth,
- nNormalAngle,
+ nNormalAngle,
mbTextVertical,
maVirtualStatus.mbArtItalic,
maVirtualStatus.mbArtBold );
@@ -558,25 +558,25 @@ void PrinterGfx::drawVerticalizedText(
mnTextAngle = nNormalAngle;
}
-void
+void
PrinterGfx::LicenseWarning(const Point& rPoint, const sal_Unicode* pStr,
sal_Int16 nLen, const sal_Int32* pDeltaArray)
{
- // treat it like a builtin font in case a user has that font also in the
- // printer. This is not so unlikely as it may seem; no print embedding
+ // treat it like a builtin font in case a user has that font also in the
+ // printer. This is not so unlikely as it may seem; no print embedding
// licensed fonts are often used (or so they say) in companies:
- // they are installed on displays and printers, but get not embedded in
- // they are installed on displays and printers, but get not embedded in
- // print files or documents because they are not licensed for use outside
+ // they are installed on displays and printers, but get not embedded in
+ // they are installed on displays and printers, but get not embedded in
+ // print files or documents because they are not licensed for use outside
// the company.
rtl::OString aMessage( "The font " );
- aMessage += rtl::OUStringToOString( mrFontMgr.getPSName(mnFontID),
+ aMessage += rtl::OUStringToOString( mrFontMgr.getPSName(mnFontID),
RTL_TEXTENCODING_ASCII_US );
aMessage += " could not be downloaded\nbecause its license does not allow for that";
PSComment( aMessage.getStr() );
- rtl::OString aFontName = rtl::OUStringToOString(
- mrFontMgr.getPSName(mnFontID),
+ rtl::OString aFontName = rtl::OUStringToOString(
+ mrFontMgr.getPSName(mnFontID),
RTL_TEXTENCODING_ASCII_US);
PSSetFont (aFontName, RTL_TEXTENCODING_ISO_8859_1);
@@ -590,11 +590,11 @@ PrinterGfx::LicenseWarning(const Point& rPoint, const sal_Unicode* pStr,
PSShowText (pBuffer, nLen, nSize, pDeltaArray);
}
-void
+void
PrinterGfx::drawText(
const Point& rPoint,
const sal_Unicode* pStr,
- sal_Int16 nLen,
+ sal_Int16 nLen,
const sal_Int32* pDeltaArray
)
{
@@ -606,7 +606,7 @@ PrinterGfx::drawText(
if (eType == fonttype::Type1)
PSUploadPS1Font (mnFontID);
- if ( eType == fonttype::TrueType
+ if ( eType == fonttype::TrueType
&& !mrFontMgr.isFontDownloadingAllowed(mnFontID))
{
LicenseWarning(rPoint, pStr, nLen, pDeltaArray);
@@ -622,15 +622,15 @@ PrinterGfx::drawText(
// search for a glyph set matching the set font
std::list< GlyphSet >::iterator aIter;
- for (aIter = maPS3Font.begin(); aIter != maPS3Font.end(); ++aIter)
- if ( ((*aIter).GetFontID() == mnFontID)
+ for (aIter = maPS3Font.begin(); aIter != maPS3Font.end(); aIter++)
+ if ( ((*aIter).GetFontID() == mnFontID)
&& ((*aIter).IsVertical() == mbTextVertical))
{
(*aIter).DrawText (*this, rPoint, pStr, nLen, pDeltaArray);
break;
}
- // not found ? create a new one
+ // not found ? create a new one
if (aIter == maPS3Font.end())
{
maPS3Font.push_back (GlyphSet(mnFontID, mbTextVertical));
@@ -643,11 +643,11 @@ PrinterGfx::getCharWidth (sal_Bool b_vert, sal_Unicode n_char, CharacterMetric *
{
b_vert = b_vert && (getVerticalDeltaAngle(n_char) != 0);
int w = b_vert ? p_bbox->height : p_bbox->width;
- w *= maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight;
+ w *= maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight;
return w;
}
-fontID
+fontID
PrinterGfx::getCharMetric (const Font3 &rFont, sal_Unicode n_char, CharacterMetric *p_bbox)
{
p_bbox->width = -1;
@@ -703,7 +703,7 @@ PrinterGfx::getFontSubstitute () const
{
if( mpFontSubstitutes )
{
- ::boost::unordered_map< fontID, fontID >::const_iterator it =
+ ::std::hash_map< fontID, fontID >::const_iterator it =
mpFontSubstitutes->find( mnFontID );
if( it != mpFontSubstitutes->end() )
return it->second;
@@ -715,12 +715,12 @@ PrinterGfx::getFontSubstitute () const
sal_Int32
PrinterGfx::GetCharWidth (sal_Unicode nFrom, sal_Unicode nTo, long *pWidthArray)
{
- Font3 aFont(*this);
+ Font3 aFont(*this);
if (aFont.IsSymbolFont() && (nFrom < 256) && (nTo < 256))
{
nFrom += 0xF000;
nTo += 0xF000;
- }
+ }
for( int n = 0; n < (nTo - nFrom + 1); n++ )
{
@@ -747,7 +747,7 @@ const ::std::list< KernPair >& PrinterGfx::getKernPairs( bool bVertical ) const
fontID nFont = mnFontID;
if( mpFontSubstitutes )
{
- ::boost::unordered_map< fontID, fontID >::const_iterator it =
+ ::std::hash_map< fontID, fontID >::const_iterator it =
mpFontSubstitutes->find( mnFontID );
if( it != mpFontSubstitutes->end() )
nFont = it->second;
@@ -759,21 +759,21 @@ const ::std::list< KernPair >& PrinterGfx::getKernPairs( bool bVertical ) const
* advanced glyph handling
*/
-sal_Bool
+sal_Bool
PrinterGfx::GetGlyphBoundRect (sal_Unicode /*c*/, Rectangle& /*rOutRect*/)
{
return 0;
}
-sal_uInt32
-PrinterGfx::GetGlyphOutline (sal_Unicode /*c*/,
+sal_uInt32
+PrinterGfx::GetGlyphOutline (sal_Unicode /*c*/,
sal_uInt16 **/*ppPolySizes*/, Point **/*ppPoints*/, sal_uInt8 **/*ppFlags*/)
{
return 0;
}
/*
- * spool the converted truetype fonts to the page header after the page body is
+ * spool the converted truetype fonts to the page header after the page body is
* complete
* for Type1 fonts spool additional reencoding vectors that are necessary to access the
* whole font
@@ -810,10 +810,10 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppli
RTL_TEXTENCODING_ASCII_US );
WritePS (pFile, "%%BeginResource: font ");
- WritePS (pFile, aPostScriptName.getStr());
+ WritePS (pFile, aPostScriptName.getStr());
WritePS (pFile, "\n");
- osl::File::RC nError = aFontFile.open(osl_File_OpenFlag_Read);
+ osl::File::RC nError = aFontFile.open (OpenFlag_Read);
if (nError == osl::File::E_None)
{
convertPfbToPfa (aFontFile, *pFile);
@@ -839,7 +839,7 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppli
aIter->PSUploadFont (*pFile, *this, mbUploadPS42Fonts ? true : false, rSuppliedFonts );
}
else
- // ( aIter->GetFontType() == fonttype::Type1
+ // ( aIter->GetFontType() == fonttype::Type1
// || aIter->GetFontType() == fonttype::Builtin )
{
aIter->PSUploadEncoding (pFile, *this);
diff --git a/vcl/unx/source/window/FWS.cxx b/vcl/unx/source/window/FWS.cxx
index a90f76af90c2..cb98a608ae28 100644
--- a/vcl/unx/source/window/FWS.cxx
+++ b/vcl/unx/source/window/FWS.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -191,7 +191,7 @@ WMSupportsFWS (Display *display, int screen)
*
* newHandler() -
*
- * Handle X errors (temporarily) to record the occurrence of BadWindow
+ * Handle X errors (temporarily) to record the occurance of BadWindow
* errors without crashing. Used to detect the FWS_COMM_WINDOW root window
* property containing an old or obsolete window id.
*
diff --git a/vcl/unx/source/window/FWS.hxx b/vcl/unx/source/window/FWS.hxx
index 36b4b16a9214..672f167d15b2 100644
--- a/vcl/unx/source/window/FWS.hxx
+++ b/vcl/unx/source/window/FWS.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,7 +39,7 @@ extern "C" {
* providing FWS extension support.
*/
-Bool
+Bool
WMSupportsFWS (Display *display, int screen);
/* Send a client message to the FWS_COMM_WINDOW indicating the existance
@@ -48,13 +48,13 @@ WMSupportsFWS (Display *display, int screen);
* old/obsolete junk in it.
*/
-Bool
+Bool
RegisterFwsWindow (Display *display, Window window);
/* Add the FWS protocol atoms to the WMProtocols property for the window.
*/
-void
+void
AddFwsProtocols (Display *display, Window window);
#if defined(__cplusplus)
diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk
index c5cd95ba6b1c..808b712903f3 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)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj
.ENDIF # "$(GUIBASE)"!="unx"
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 9a5d149f14fd..4739b736da95 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -86,7 +86,7 @@ using namespace vcl_sal;
using namespace vcl;
// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#define CLIENT_EVENTS StructureNotifyMask \
+#define CLIENT_EVENTS StructureNotifyMask \
| SubstructureNotifyMask \
| KeyPressMask \
| KeyReleaseMask \
@@ -103,9 +103,9 @@ using namespace vcl;
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static XLIB_Window hPresentationWindow = None, hPresFocusWindow = None;
+static XLIB_Window hPresentationWindow = None, hPresFocusWindow = None;
static ::std::list< XLIB_Window > aPresentationReparentList;
-static int nVisibleFloats = 0;
+static int nVisibleFloats = 0;
X11SalFrame* X11SalFrame::s_pSaveYourselfFrame = NULL;
@@ -160,8 +160,8 @@ bool X11SalFrame::IsFloatGrabWindow() const
return
( ( !pDisableGrab || !*pDisableGrab ) &&
(
- (nStyle_ & SAL_FRAME_STYLE_FLOAT) &&
- ! (nStyle_ & SAL_FRAME_STYLE_TOOLTIP) &&
+ (nStyle_ & SAL_FRAME_STYLE_FLOAT) &&
+ ! (nStyle_ & SAL_FRAME_STYLE_TOOLTIP) &&
! (nStyle_ & SAL_FRAME_STYLE_OWNERDRAWDECORATION)
)
);
@@ -188,7 +188,7 @@ void X11SalFrame::setXEmbedInfo()
void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
{
XEvent aEvent;
-
+
rtl_zeroMemory( &aEvent, sizeof(aEvent) );
aEvent.xclient.window = mhForeignParent;
aEvent.xclient.type = ClientMessage;
@@ -199,7 +199,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
aEvent.xclient.data.l[2] = 0;
aEvent.xclient.data.l[3] = 0;
aEvent.xclient.data.l[4] = 0;
-
+
GetDisplay()->GetXLib()->PushXErrorLevel( true );
XSendEvent( pDisplay_->GetDisplay(),
mhForeignParent,
@@ -211,15 +211,15 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
+void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
{
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = GetDisplay()->GetDefaultScreenNumber();
if( mpParent )
nScreen = mpParent->m_nScreen;
-
+
m_nScreen = nScreen;
- nStyle_ = nSalFrameStyle;
+ nStyle_ = nSalFrameStyle;
XWMHints Hints;
Hints.flags = InputHint;
Hints.input = (nSalFrameStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ? False : True;
@@ -235,15 +235,15 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
| CWEventMask
;
Attributes.border_pixel = 0;
- Attributes.background_pixmap = None;
- Attributes.colormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
- Attributes.override_redirect = False;
- Attributes.event_mask = CLIENT_EVENTS;
-
+ Attributes.background_pixmap = None;
+ Attributes.colormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
+ Attributes.override_redirect = False;
+ Attributes.event_mask = CLIENT_EVENTS;
+
const SalVisual& rVis = GetDisplay()->GetVisual( m_nScreen );
XLIB_Window aFrameParent = pParentData ? pParentData->aWindow : GetDisplay()->GetRootWindow( m_nScreen );
XLIB_Window aClientLeader = None;
-
+
if( bUseGeometry )
{
x = maGeometry.nX;
@@ -251,7 +251,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
w = maGeometry.nWidth;
h = maGeometry.nHeight;
}
-
+
if( (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT) &&
! (nSalFrameStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION)
)
@@ -346,7 +346,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
w = 785;
if( aScreenSize.Width() >= 1024 )
w = 920;
-
+
if( aScreenSize.Height() >= 600 )
h = 550;
if( aScreenSize.Height() >= 768 )
@@ -373,7 +373,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
break;
++it;
}
-
+
if( it != rFrames.end() )
{
// set a document position and size
@@ -431,7 +431,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
try
{
bOk=SelectAppIconPixmap( pDisplay_, m_nScreen,
- mnIconID != 1 ? mnIconID :
+ mnIconID != 1 ? mnIconID :
(mpParent ? mpParent->mnIconID : 1), 32,
Hints.icon_pixmap, Hints.icon_mask );
}
@@ -441,9 +441,9 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
}
if( bOk )
{
- Hints.flags |= IconPixmapHint;
+ Hints.flags |= IconPixmapHint;
if( Hints.icon_mask )
- Hints.flags |= IconMaskHint;
+ Hints.flags |= IconMaskHint;
}
}
@@ -474,8 +474,8 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
}
else
{
- Hints.flags |= WindowGroupHint;
- Hints.window_group = pFrame->GetShellWindow();
+ Hints.flags |= WindowGroupHint;
+ Hints.window_group = pFrame->GetShellWindow();
// note: for a normal document window this will produce None
// as the window is not yet created and the shell window is
// initialized to None. This must be corrected after window creation.
@@ -483,10 +483,10 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
}
}
- nShowState_ = SHOWSTATE_UNKNOWN;
- bViewable_ = sal_True;
- bMapped_ = sal_False;
- nVisibility_ = VisibilityFullyObscured;
+ nShowState_ = SHOWSTATE_UNKNOWN;
+ bViewable_ = TRUE;
+ bMapped_ = FALSE;
+ nVisibility_ = VisibilityFullyObscured;
mhWindow = XCreateWindow( GetXDisplay(),
aFrameParent,
x, y,
@@ -498,11 +498,11 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
nAttrMask,
&Attributes );
// FIXME: see above: fake shell window for now to own window
- if( pParentData == NULL )
+ if( /*! IsSysChildWindow() &&*/ pParentData == NULL )
{
mhShellWindow = mhWindow;
- }
-
+ }
+
// correct window group if necessary
if( (Hints.flags & WindowGroupHint) == WindowGroupHint )
{
@@ -510,10 +510,10 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
Hints.window_group = GetShellWindow();
}
- maGeometry.nX = x;
- maGeometry.nY = y;
- maGeometry.nWidth = w;
- maGeometry.nHeight = h;
+ maGeometry.nX = x;
+ maGeometry.nY = y;
+ maGeometry.nWidth = w;
+ maGeometry.nHeight = h;
updateScreenNumber();
XSync( GetXDisplay(), False );
@@ -565,7 +565,7 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
GetShellWindow(),
pHints );
XFree (pHints);
-
+
// set PID and WM_CLIENT_MACHINE
pDisplay_->getWMAdaptor()->setClientMachine( this );
pDisplay_->getWMAdaptor()->setPID( this );
@@ -639,83 +639,84 @@ void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData*
== SAL_FRAME_STYLE_DEFAULT )
pDisplay_->getWMAdaptor()->maximizeFrame( this, true, true );
}
-
+
m_nWorkArea = GetDisplay()->getWMAdaptor()->getCurrentWorkArea();
-
+
// Pointer
SetPointer( POINTER_ARROW );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent )
+X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent )
{
X11SalData* pSalData = GetX11SalData();
// initialize frame geometry
memset( &maGeometry, 0, sizeof(maGeometry) );
- mpParent = static_cast< X11SalFrame* >( pParent );
+ mpParent = static_cast< X11SalFrame* >( pParent );
- mbTransientForRoot = false;
+ mbTransientForRoot = false;
- pDisplay_ = pSalData->GetDisplay();
+ pDisplay_ = pSalData->GetDisplay();
// insert frame in framelist
pDisplay_->registerFrame( this );
- mhWindow = None;
- mhShellWindow = None;
- mhStackingWindow = None;
- mhForeignParent = None;
+ mhWindow = None;
+ mhShellWindow = None;
+ mhStackingWindow = None;
+ mhForeignParent = None;
mhBackgroundPixmap = None;
m_bSetFocusOnMap = false;
- pGraphics_ = NULL;
- pFreeGraphics_ = NULL;
+ pGraphics_ = NULL;
+ pFreeGraphics_ = NULL;
- hCursor_ = None;
- nCaptured_ = 0;
+ hCursor_ = None;
+ nCaptured_ = 0;
- nReleaseTime_ = 0;
- nKeyCode_ = 0;
- nKeyState_ = 0;
- nCompose_ = -1;
- mbSendExtKeyModChange = false;
- mnExtKeyMod = 0;
+ nReleaseTime_ = 0;
+ nKeyCode_ = 0;
+ nKeyState_ = 0;
+ nCompose_ = -1;
+ mbKeyMenu = false;
+ mbSendExtKeyModChange = false;
+ mnExtKeyMod = 0;
- nShowState_ = SHOWSTATE_UNKNOWN;
- nWidth_ = 0;
- nHeight_ = 0;
- nStyle_ = 0;
+ nShowState_ = SHOWSTATE_UNKNOWN;
+ nWidth_ = 0;
+ nHeight_ = 0;
+ nStyle_ = 0;
mnExtStyle = 0;
- bAlwaysOnTop_ = sal_False;
+ bAlwaysOnTop_ = FALSE;
- // set bViewable_ to sal_True: hack GetClientSize to report something
+ // set bViewable_ to TRUE: hack GetClientSize to report something
// different to 0/0 before first map
- bViewable_ = sal_True;
- bMapped_ = sal_False;
- bDefaultPosition_ = sal_True;
- nVisibility_ = VisibilityFullyObscured;
+ bViewable_ = TRUE;
+ bMapped_ = FALSE;
+ bDefaultPosition_ = TRUE;
+ nVisibility_ = VisibilityFullyObscured;
m_nWorkArea = 0;
- mbInShow = sal_False;
+ mbInShow = FALSE;
m_bXEmbed = false;
- nScreenSaversTimeout_ = 0;
+ nScreenSaversTimeout_ = 0;
- mpInputContext = NULL;
- mbInputFocus = False;
+ mpInputContext = NULL;
+ mbInputFocus = False;
maAlwaysOnTopRaiseTimer.SetTimeoutHdl( LINK( this, X11SalFrame, HandleAlwaysOnTopRaise ) );
maAlwaysOnTopRaiseTimer.SetTimeout( 100 );
- meWindowType = WMAdaptor::windowType_Normal;
- mnDecorationFlags = WMAdaptor::decoration_All;
- mbMaximizedVert = false;
- mbMaximizedHorz = false;
- mbShaded = false;
- mbFullScreen = false;
-
- mnIconID = 1; // ICON_DEFAULT
+ meWindowType = WMAdaptor::windowType_Normal;
+ mnDecorationFlags = WMAdaptor::decoration_All;
+ mbMaximizedVert = false;
+ mbMaximizedHorz = false;
+ mbShaded = false;
+ mbFullScreen = false;
+ mnIconID = 1; // ICON_DEFAULT
+
m_pClipRectangles = NULL;
m_nCurClipRect = 0;
m_nMaxClipRect = 0;
@@ -742,9 +743,9 @@ void X11SalFrame::passOnSaveYourSelf()
if( ! ( IsChildWindow() || pFrame->mpParent )
&& pFrame != s_pSaveYourselfFrame )
break;
- ++it;
+ ++it;
}
-
+
s_pSaveYourselfFrame = (it != rFrames.end() ) ? const_cast<X11SalFrame*>(pFrame) : NULL;
if( s_pSaveYourselfFrame )
{
@@ -762,20 +763,20 @@ void X11SalFrame::passOnSaveYourSelf()
X11SalFrame::~X11SalFrame()
{
notifyDelete();
-
+
if( m_pClipRectangles )
{
delete [] m_pClipRectangles;
m_pClipRectangles = NULL;
m_nCurClipRect = m_nMaxClipRect = 0;
}
-
+
if( mhBackgroundPixmap )
{
XSetWindowBackgroundPixmap( GetXDisplay(), GetWindow(), None );
- XFreePixmap( GetXDisplay(), mhBackgroundPixmap );
+ XFreePixmap( GetXDisplay(), mhBackgroundPixmap );
}
-
+
if( mhStackingWindow )
aPresentationReparentList.remove( mhStackingWindow );
@@ -791,10 +792,10 @@ X11SalFrame::~X11SalFrame()
XSelectInput( GetXDisplay(), GetShellWindow(), 0 );
XSelectInput( GetXDisplay(), GetWindow(), 0 );
- ShowFullScreen( sal_False, 0 );
+ ShowFullScreen( FALSE, 0 );
if( bMapped_ )
- Show( sal_False );
+ Show( FALSE );
if( mpInputContext )
{
@@ -895,18 +896,18 @@ void X11SalFrame::SetBackgroundBitmap( SalBitmap* pBitmap )
const SystemChildData* X11SalFrame::GetSystemData() const
{
X11SalFrame *pFrame = const_cast<X11SalFrame*>(this);
- pFrame->maSystemChildData.nSize = sizeof( SystemChildData );
- pFrame->maSystemChildData.pDisplay = GetXDisplay();
- pFrame->maSystemChildData.aWindow = pFrame->GetWindow();
- pFrame->maSystemChildData.pSalFrame = pFrame;
- pFrame->maSystemChildData.pWidget = NULL;
- pFrame->maSystemChildData.pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pFrame->maSystemChildData.nScreen = m_nScreen;
- pFrame->maSystemChildData.nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
- pFrame->maSystemChildData.aColormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
- pFrame->maSystemChildData.pAppContext = NULL;
- pFrame->maSystemChildData.aShellWindow = pFrame->GetShellWindow();
- pFrame->maSystemChildData.pShellWidget = NULL;
+ pFrame->maSystemChildData.nSize = sizeof( SystemChildData );
+ pFrame->maSystemChildData.pDisplay = GetXDisplay();
+ pFrame->maSystemChildData.aWindow = pFrame->GetWindow();
+ pFrame->maSystemChildData.pSalFrame = pFrame;
+ pFrame->maSystemChildData.pWidget = NULL;
+ pFrame->maSystemChildData.pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
+ pFrame->maSystemChildData.nScreen = m_nScreen;
+ pFrame->maSystemChildData.nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
+ pFrame->maSystemChildData.aColormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
+ pFrame->maSystemChildData.pAppContext = NULL;
+ pFrame->maSystemChildData.aShellWindow = pFrame->GetShellWindow();
+ pFrame->maSystemChildData.pShellWidget = NULL;
return &maSystemChildData;
}
@@ -917,8 +918,8 @@ SalGraphics *X11SalFrame::GetGraphics()
if( pFreeGraphics_ )
{
- pGraphics_ = pFreeGraphics_;
- pFreeGraphics_ = NULL;
+ pGraphics_ = pFreeGraphics_;
+ pFreeGraphics_ = NULL;
}
else
{
@@ -936,8 +937,8 @@ void X11SalFrame::ReleaseGraphics( SalGraphics *pGraphics )
if( pGraphics != pGraphics_ )
return;
- pFreeGraphics_ = pGraphics_;
- pGraphics_ = NULL;
+ pFreeGraphics_ = pGraphics_;
+ pGraphics_ = NULL;
}
void X11SalFrame::updateGraphics( bool bClear )
@@ -951,14 +952,14 @@ void X11SalFrame::updateGraphics( bool bClear )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Enable( sal_Bool /*bEnable*/ )
+void X11SalFrame::Enable( BOOL /*bEnable*/ )
{
// NYI: enable/disable frame
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetIcon( sal_uInt16 nIcon )
+void X11SalFrame::SetIcon( USHORT nIcon )
{
if ( ! IsChildWindow() )
{
@@ -1024,7 +1025,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon )
else
{
const String& rWM( pDisplay_->getWMAdaptor()->getWindowManagerName() );
- if( rWM.EqualsAscii( "KWin" ) ) // assume KDE is running
+ if( rWM.EqualsAscii( "KWin" ) ) // assume KDE is running
iconSize = 48;
static bool bGnomeIconSize = false;
static bool bGnomeChecked = false;
@@ -1060,7 +1061,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon )
}
pHints = &Hints;
- sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
+ BOOL bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
nIcon, iconSize,
pHints->icon_pixmap, pHints->icon_mask );
if ( !bOk )
@@ -1072,7 +1073,7 @@ void X11SalFrame::SetIcon( sal_uInt16 nIcon )
}
if( bOk )
{
- pHints->flags |= IconPixmapHint;
+ pHints->flags |= IconPixmapHint;
if( pHints->icon_mask )
pHints->flags |= IconMaskHint;
@@ -1096,8 +1097,8 @@ void X11SalFrame::SetMaxClientSize( long nWidth, long nHeight )
pHints,
&nSupplied
);
- pHints->max_width = nWidth;
- pHints->max_height = nHeight;
+ pHints->max_width = nWidth;
+ pHints->max_height = nHeight;
pHints->flags |= PMaxSize;
XSetWMNormalHints( GetXDisplay(),
GetShellWindow(),
@@ -1120,8 +1121,8 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight )
pHints,
&nSupplied
);
- pHints->min_width = nWidth;
- pHints->min_height = nHeight;
+ pHints->min_width = nWidth;
+ pHints->min_height = nHeight;
pHints->flags |= PMinSize;
XSetWMNormalHints( GetXDisplay(),
GetShellWindow(),
@@ -1133,7 +1134,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight )
// Show + Pos (x,y,z) + Size (width,height)
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
if( ( bVisible && bMapped_ )
|| ( !bVisible && !bMapped_ ) )
@@ -1145,13 +1146,15 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
// so artificially set ABOVE and remove it again on hide
if( mpParent && (mpParent->nStyle_ & SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ) && pDisplay_->getWMAdaptor()->isLegacyPartialFullscreen())
pDisplay_->getWMAdaptor()->enableAlwaysOnTop( this, bVisible );
-
+
bMapped_ = bVisible;
bViewable_ = bVisible;
setXEmbedInfo();
if( bVisible )
{
- mbInShow = sal_True;
+ SessionManagerClient::open(); // will simply return after the first time
+
+ mbInShow = TRUE;
if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) )
{
// hide all INTRO frames
@@ -1163,21 +1166,22 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
if( pFrame->nStyle_ & SAL_FRAME_STYLE_INTRO )
{
if( pFrame->bMapped_ )
- const_cast<X11SalFrame*>(pFrame)->Show( sal_False );
+ const_cast<X11SalFrame*>(pFrame)->Show( FALSE );
}
}
}
-
- // update NET_WM_STATE which may have been deleted due to earlier Show(sal_False)
+
+ // update NET_WM_STATE which may have been deleted due to earlier Show(FALSE)
if( nShowState_ == SHOWSTATE_HIDDEN )
GetDisplay()->getWMAdaptor()->frameIsMapping( this );
/*
+ * #95097#
* Actually this is rather exotic and currently happens only in conjunction
* 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( sal_False ) must
+ * to show our hidden transient frame also. So Show( 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.
*/
@@ -1189,7 +1193,7 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
GetDisplay()->getWMAdaptor()->changeReferenceFrame( this, mpParent );
}
-
+
// #i45160# switch to desktop where a dialog with parent will appear
if( mpParent && mpParent->m_nWorkArea != m_nWorkArea )
GetDisplay()->getWMAdaptor()->switchToWorkArea( mpParent->m_nWorkArea );
@@ -1253,10 +1257,11 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
}
XSync( GetXDisplay(), False );
-
+
if( IsFloatGrabWindow() )
{
/*
+ * #95453#
* Sawfish and twm can be switched to enter-exit focus behaviour. In this case
* we must grab the pointer else the dumb WM will put the focus to the
* override-redirect float window. The application window will be deactivated
@@ -1307,10 +1312,10 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
nShowState_ = SHOWSTATE_NORMAL;
/*
- * plugged windows don't necessarily get the
+ * #98107# 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(sal_True)
+ * to the child on Show(TRUE)
*/
if( (nStyle_ & SAL_FRAME_STYLE_PLUG) && ! m_bXEmbed )
XSetInputFocus( GetXDisplay(),
@@ -1342,7 +1347,7 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
}
else if( ! m_bXEmbed )
XUnmapWindow( GetXDisplay(), GetWindow() );
-
+
nShowState_ = SHOWSTATE_HIDDEN;
if( IsFloatGrabWindow() && nVisibleFloats )
{
@@ -1358,7 +1363,7 @@ void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ToTop( sal_uInt16 nFlags )
+void X11SalFrame::ToTop( USHORT nFlags )
{
if( ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
&& ! ( nStyle_ & SAL_FRAME_STYLE_FLOAT )
@@ -1405,7 +1410,7 @@ void X11SalFrame::GetClientSize( long &rWidth, long &rHeight )
return;
}
- rWidth = maGeometry.nWidth;
+ rWidth = maGeometry.nWidth;
rHeight = maGeometry.nHeight;
if( !rWidth || !rHeight )
@@ -1427,29 +1432,29 @@ void X11SalFrame::SetWindowGravity (int nGravity) const
{
XSizeHints* pHint = XAllocSizeHints();
long nFlag;
-
+
XGetWMNormalHints (GetXDisplay(), GetShellWindow(), pHint, &nFlag);
pHint->flags |= PWinGravity;
pHint->win_gravity = nGravity;
-
+
XSetWMNormalHints (GetXDisplay(), GetShellWindow(), pHint);
XSync (GetXDisplay(), False);
-
+
XFree (pHint);
}
}
void X11SalFrame::Center( )
{
- int nX, nY, nScreenWidth, nScreenHeight;
- int nRealScreenWidth, nRealScreenHeight;
- int nScreenX = 0, nScreenY = 0;
+ int nX, nY, nScreenWidth, nScreenHeight;
+ int nRealScreenWidth, nRealScreenHeight;
+ int nScreenX = 0, nScreenY = 0;
const Size& aScreenSize = GetDisplay()->getDataForScreen( m_nScreen ).m_aSize;
- nScreenWidth = aScreenSize.Width();
- nScreenHeight = aScreenSize.Height();
- nRealScreenWidth = nScreenWidth;
- nRealScreenHeight = nScreenHeight;
+ nScreenWidth = aScreenSize.Width();
+ nScreenHeight = aScreenSize.Height();
+ nRealScreenWidth = nScreenWidth;
+ nRealScreenHeight = nScreenHeight;
if( GetDisplay()->IsXinerama() )
{
@@ -1475,10 +1480,10 @@ void X11SalFrame::Center( )
for( unsigned int i = 0; i < rScreens.size(); i++ )
if( rScreens[i].IsInside( Point( root_x, root_y ) ) )
{
- nScreenX = rScreens[i].Left();
- nScreenY = rScreens[i].Top();
- nRealScreenWidth = rScreens[i].GetWidth();
- nRealScreenHeight = rScreens[i].GetHeight();
+ nScreenX = rScreens[i].Left();
+ nScreenY = rScreens[i].Top();
+ nRealScreenWidth = rScreens[i].GetWidth();
+ nRealScreenHeight = rScreens[i].GetHeight();
break;
}
}
@@ -1492,10 +1497,10 @@ void X11SalFrame::Center( )
{
Rectangle aRect;
pFrame->GetPosSize( aRect );
- pFrame->maGeometry.nX = aRect.Left();
- pFrame->maGeometry.nY = aRect.Top();
- pFrame->maGeometry.nWidth = aRect.GetWidth();
- pFrame->maGeometry.nHeight = aRect.GetHeight();
+ pFrame->maGeometry.nX = aRect.Left();
+ pFrame->maGeometry.nY = aRect.Top();
+ pFrame->maGeometry.nWidth = aRect.GetWidth();
+ pFrame->maGeometry.nHeight = aRect.GetHeight();
}
if( pFrame->nStyle_ & SAL_FRAME_STYLE_PLUG )
@@ -1512,10 +1517,10 @@ void X11SalFrame::Center( )
}
else
{
- nScreenX = pFrame->maGeometry.nX;
- nScreenY = pFrame->maGeometry.nY;
- nScreenWidth = pFrame->maGeometry.nWidth;
- nScreenHeight = pFrame->maGeometry.nHeight;
+ nScreenX = pFrame->maGeometry.nX;
+ nScreenY = pFrame->maGeometry.nY;
+ nScreenWidth = pFrame->maGeometry.nWidth;
+ nScreenHeight = pFrame->maGeometry.nHeight;
}
}
@@ -1530,14 +1535,14 @@ void X11SalFrame::Center( )
else
{
// center the window relative to the top level frame
- nX = (nScreenWidth - (int)maGeometry.nWidth ) / 2 + nScreenX;
+ nX = (nScreenWidth - (int)maGeometry.nWidth ) / 2 + nScreenX;
nY = (nScreenHeight - (int)maGeometry.nHeight) / 2 + nScreenY;
}
}
else
{
// center the window relative to screen
- nX = (nRealScreenWidth - (int)maGeometry.nWidth ) / 2 + nScreenX;
+ nX = (nRealScreenWidth - (int)maGeometry.nWidth ) / 2 + nScreenX;
nY = (nRealScreenHeight - (int)maGeometry.nHeight) / 2 + nScreenY;
}
nX = nX < 0 ? 0 : nX;
@@ -1576,11 +1581,11 @@ void X11SalFrame::updateScreenNumber()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
{
if( nStyle_ & SAL_FRAME_STYLE_PLUG )
return;
-
+
// relative positioning in X11SalFrame::SetPosSize
Rectangle aPosSize( Point( maGeometry.nX, maGeometry.nY ), Size( maGeometry.nWidth, maGeometry.nHeight ) );
aPosSize.Justify();
@@ -1622,7 +1627,7 @@ void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
+void X11SalFrame::SetAlwaysOnTop( BOOL bOnTop )
{
if( ! IsOverrideRedirect() )
{
@@ -1650,7 +1655,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
{
Rectangle aPosSize;
bool bDoAdjust = false;
-
+
/* #i44325#
* if maximized, set restore size and guess maximized size from last time
* in state change below maximize window
@@ -1669,14 +1674,14 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
pHints,
&nSupplied );
pHints->flags |= PPosition | PWinGravity;
- pHints->x = pState->mnX;
- pHints->y = pState->mnY;
- pHints->win_gravity = pDisplay_->getWMAdaptor()->getPositionWinGravity();
+ pHints->x = pState->mnX;
+ pHints->y = pState->mnY;
+ pHints->win_gravity = pDisplay_->getWMAdaptor()->getPositionWinGravity();
XSetWMNormalHints( GetXDisplay(),
GetShellWindow(),
pHints );
XFree( pHints );
-
+
XMoveResizeWindow( GetXDisplay(), GetShellWindow(),
pState->mnX, pState->mnY,
pState->mnWidth, pState->mnHeight );
@@ -1692,7 +1697,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
// initialize with current geometry
if ((pState->mnMask & _FRAMESTATE_MASK_GEOMETRY) != _FRAMESTATE_MASK_GEOMETRY)
GetPosSize (aPosSize);
-
+
// change requested properties
if (pState->mnMask & SAL_FRAMESTATE_MASK_X)
{
@@ -1714,15 +1719,15 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
aPosSize.setHeight (nHeight);
bDoAdjust = true;
}
-
+
const Size& aScreenSize = pDisplay_->getDataForScreen( m_nScreen ).m_aSize;
const WMAdaptor *pWM = GetDisplay()->getWMAdaptor();
-
+
if( bDoAdjust && aPosSize.GetWidth() <= aScreenSize.Width()
&& aPosSize.GetHeight() <= aScreenSize.Height() )
{
SalFrameGeometry aGeom = maGeometry;
-
+
if( ! (nStyle_ & ( SAL_FRAME_STYLE_FLOAT | SAL_FRAME_STYLE_PLUG ) ) &&
mpParent &&
aGeom.nLeftDecoration == 0 &&
@@ -1738,7 +1743,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
aGeom.nBottomDecoration = 5;
}
}
-
+
// adjust position so that frame fits onto screen
if( aPosSize.Right()+(long)aGeom.nRightDecoration > aScreenSize.Width()-1 )
aPosSize.Move( (long)aScreenSize.Width() - (long)aPosSize.Right() - (long)aGeom.nRightDecoration, 0 );
@@ -1749,7 +1754,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
if( aPosSize.Top() < (long)aGeom.nTopDecoration )
aPosSize.Move( 0, (long)aGeom.nTopDecoration - (long)aPosSize.Top() );
}
-
+
// resize with new args
if (pWM->supportsICCCMPos())
{
@@ -1803,7 +1808,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
+BOOL X11SalFrame::GetWindowState( SalFrameState* pState )
{
if( SHOWSTATE_MINIMIZED == nShowState_ )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
@@ -1815,7 +1820,7 @@ sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
GetPosSize( aPosSize );
else
aPosSize = maRestorePosSize;
-
+
if( mbMaximizedHorz )
pState->mnState |= SAL_FRAMESTATE_MAXIMIZED_HORZ;
if( mbMaximizedVert )
@@ -1823,8 +1828,8 @@ sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
if( mbShaded )
pState->mnState |= SAL_FRAMESTATE_ROLLUP;
- pState->mnX = aPosSize.Left();
- pState->mnY = aPosSize.Top();
+ pState->mnX = aPosSize.Left();
+ pState->mnY = aPosSize.Top();
pState->mnWidth = aPosSize.GetWidth();
pState->mnHeight = aPosSize.GetHeight();
@@ -1842,7 +1847,7 @@ sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
pState->mnMask |= _FRAMESTATE_MASK_MAXIMIZED_GEOMETRY;
}
- return sal_True;
+ return TRUE;
}
// ----------------------------------------------------------------------------
@@ -1936,10 +1941,10 @@ void X11SalFrame::SetSize( const Size &rSize )
pHints,
&nSupplied
);
- pHints->min_width = rSize.Width();
- pHints->min_height = rSize.Height();
- pHints->max_width = rSize.Width();
- pHints->max_height = rSize.Height();
+ pHints->min_width = rSize.Width();
+ pHints->min_height = rSize.Height();
+ pHints->max_width = rSize.Width();
+ pHints->max_height = rSize.Height();
pHints->flags |= PMinSize | PMaxSize;
XSetWMNormalHints( GetXDisplay(),
GetShellWindow(),
@@ -1971,10 +1976,10 @@ void X11SalFrame::SetSize( const Size &rSize )
void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
{
XWindowChanges values;
- values.x = rPosSize.Left();
- values.y = rPosSize.Top();
- values.width = rPosSize.GetWidth();
- values.height = rPosSize.GetHeight();
+ values.x = rPosSize.Left();
+ values.y = rPosSize.Top();
+ values.width = rPosSize.GetWidth();
+ values.height = rPosSize.GetHeight();
if( !values.width || !values.height )
return;
@@ -2005,8 +2010,8 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
if( ! ( nStyle_ & ( SAL_FRAME_STYLE_PLUG | SAL_FRAME_STYLE_FLOAT ) )
&& !(pDisplay_->GetProperties() & PROPERTY_SUPPORT_WM_ClientPos) )
{
- values.x -= maGeometry.nLeftDecoration;
- values.y -= maGeometry.nTopDecoration;
+ values.x -= maGeometry.nLeftDecoration;
+ values.y -= maGeometry.nTopDecoration;
}
// do net set WMNormalHints for ..
@@ -2014,7 +2019,7 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
// child windows
! IsChildWindow()
// popups (menu, help window, etc.)
- && (nStyle_ & (SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) != SAL_FRAME_STYLE_FLOAT
+ && (nStyle_ & (SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) != SAL_FRAME_STYLE_FLOAT
// shown, sizeable windows
&& ( nShowState_ == SHOWSTATE_UNKNOWN ||
nShowState_ == SHOWSTATE_HIDDEN ||
@@ -2031,23 +2036,23 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
);
if( ! ( nStyle_ & SAL_FRAME_STYLE_SIZEABLE ) )
{
- pHints->min_width = rPosSize.GetWidth();
- pHints->min_height = rPosSize.GetHeight();
- pHints->max_width = rPosSize.GetWidth();
- pHints->max_height = rPosSize.GetHeight();
+ pHints->min_width = rPosSize.GetWidth();
+ pHints->min_height = rPosSize.GetHeight();
+ pHints->max_width = rPosSize.GetWidth();
+ pHints->max_height = rPosSize.GetHeight();
pHints->flags |= PMinSize | PMaxSize;
}
if( nShowState_ == SHOWSTATE_UNKNOWN || nShowState_ == SHOWSTATE_HIDDEN )
{
pHints->flags |= PPosition | PWinGravity;
- pHints->x = values.x;
- pHints->y = values.y;
- pHints->win_gravity = pDisplay_->getWMAdaptor()->getPositionWinGravity();
+ pHints->x = values.x;
+ pHints->y = values.y;
+ pHints->win_gravity = pDisplay_->getWMAdaptor()->getPositionWinGravity();
}
if( mbFullScreen )
{
- pHints->max_width = 10000;
- pHints->max_height = 10000;
+ pHints->max_width = 10000;
+ pHints->max_height = 10000;
pHints->flags |= PMaxSize;
}
XSetWMNormalHints( GetXDisplay(),
@@ -2063,19 +2068,19 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
XMoveResizeWindow( GetXDisplay(), GetWindow(), 0, 0, values.width, values.height );
else
XMoveResizeWindow( GetXDisplay(), GetWindow(), values.x, values.y, values.width, values.height );
- }
+ }
- maGeometry.nX = values.x;
- maGeometry.nY = values.y;
- maGeometry.nWidth = values.width;
- maGeometry.nHeight = values.height;
+ maGeometry.nX = values.x;
+ maGeometry.nY = values.y;
+ maGeometry.nWidth = values.width;
+ maGeometry.nHeight = values.height;
if( IsSysChildWindow() && mpParent )
{
// translate back to root coordinates
maGeometry.nX += mpParent->maGeometry.nX;
maGeometry.nY += mpParent->maGeometry.nY;
}
-
+
updateScreenNumber();
if( bSized && ! bMoved )
CallCallback( SALEVENT_RESIZE, NULL );
@@ -2094,7 +2099,7 @@ void X11SalFrame::Minimize()
{
if( IsSysChildWindow() )
return;
-
+
if( SHOWSTATE_UNKNOWN == nShowState_ || SHOWSTATE_HIDDEN == nShowState_ )
{
stderr0( "X11SalFrame::Minimize on withdrawn window\n" );
@@ -2112,7 +2117,7 @@ void X11SalFrame::Maximize()
{
if( IsSysChildWindow() )
return;
-
+
if( SHOWSTATE_MINIMIZED == nShowState_ )
{
GetDisplay()->getWMAdaptor()->frameIsMapping( this );
@@ -2128,7 +2133,7 @@ void X11SalFrame::Restore()
{
if( IsSysChildWindow() )
return;
-
+
if( SHOWSTATE_UNKNOWN == nShowState_ || SHOWSTATE_HIDDEN == nShowState_ )
{
stderr0( "X11SalFrame::Restore on withdrawn window\n" );
@@ -2151,32 +2156,32 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen )
{
if( nNewScreen == maGeometry.nScreenNumber )
return;
-
+
if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
{
if( nNewScreen >= GetDisplay()->GetXineramaScreens().size() )
return;
-
+
Rectangle aOldScreenRect( GetDisplay()->GetXineramaScreens()[maGeometry.nScreenNumber] );
Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] );
bool bVisible = bMapped_;
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top());
createNewWindow( None, m_nScreen );
if( bVisible )
- Show( sal_True );
+ Show( TRUE );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() )
{
bool bVisible = bMapped_;
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
createNewWindow( None, nNewScreen );
if( bVisible )
- Show( sal_True );
+ Show( TRUE );
maGeometry.nScreenNumber = nNewScreen;
}
}
@@ -2210,7 +2215,7 @@ void X11SalFrame::updateWMClass()
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
+void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
{
if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
{
@@ -2228,7 +2233,7 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
bool bVisible = bMapped_;
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
maGeometry.nX = aRect.Left();
maGeometry.nY = aRect.Top();
maGeometry.nWidth = aRect.GetWidth();
@@ -2238,10 +2243,10 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
createNewWindow( None, m_nScreen );
if( GetDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
GetDisplay()->getWMAdaptor()->enableAlwaysOnTop( this, true );
- else
+ else
GetDisplay()->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show(sal_True);
+ Show(TRUE);
}
else
@@ -2252,14 +2257,14 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
Rectangle aRect = maRestorePosSize;
maRestorePosSize = Rectangle();
if( bVisible )
- Show( sal_False );
+ Show( 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( sal_True );
+ Show( TRUE );
}
}
else
@@ -2272,16 +2277,16 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, false );
if( bVisible )
- Show( sal_False );
+ Show( FALSE );
createNewWindow( None, nScreen );
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show( sal_True );
+ Show( TRUE );
}
if( mbFullScreen == (bool)bFullScreen )
return;
-
+
pDisplay_->getWMAdaptor()->showFullScreen( this, bFullScreen );
if( IsOverrideRedirect()
&& WMSupportsFWS( GetXDisplay(), GetDisplay()->GetRootWindow( m_nScreen ) ) )
@@ -2301,7 +2306,7 @@ static Bool
IsRunningXAutoLock( Display *p_display, XLIB_Window a_window )
{
const char *p_atomname = "XAUTOLOCK_SEMAPHORE_PID";
- Atom a_pidatom;
+ Atom a_pidatom;
// xautolock interns this atom
a_pidatom = XInternAtom( p_display, p_atomname, True );
@@ -2312,7 +2317,7 @@ IsRunningXAutoLock( Display *p_display, XLIB_Window a_window )
int n_format;
unsigned long n_items;
unsigned long n_bytes_after;
- pid_t *p_pid;
+ pid_t *p_pid;
pid_t n_pid;
// get pid of running xautolock
XGetWindowProperty (p_display, a_window, a_pidatom, 0L, 2L, False,
@@ -2362,7 +2367,7 @@ MessageToXAutoLock( Display *p_display, int n_message )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::StartPresentation( sal_Bool bStart )
+void X11SalFrame::StartPresentation( BOOL bStart )
{
I18NStatus::get().show( !bStart, I18NStatus::presentation );
if ( bStart )
@@ -2373,14 +2378,14 @@ void X11SalFrame::StartPresentation( sal_Bool bStart )
if( ! bStart && hPresentationWindow != None )
doReparentPresentationDialogues( GetDisplay() );
hPresentationWindow = (bStart && IsOverrideRedirect() ) ? GetWindow() : None;
-
-
+
+
// needs static here to save DPMS settings
- int dummy;
+ int dummy;
static bool DPMSExtensionAvailable =
#if !defined(SOLARIS) && !defined(AIX)
(DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0);
- static sal_Bool DPMSEnabled = false;
+ static XLIB_BOOL DPMSEnabled = false;
#else
false;
bool DPMSEnabled = false;
@@ -2390,8 +2395,8 @@ void X11SalFrame::StartPresentation( sal_Bool bStart )
static CARD16 dpms_standby_timeout=0;
static CARD16 dpms_suspend_timeout=0;
static CARD16 dpms_off_timeout=0;
-
-
+
+
if( bStart || nScreenSaversTimeout_ || DPMSEnabled)
{
if( hPresentationWindow )
@@ -2408,20 +2413,20 @@ void X11SalFrame::StartPresentation( sal_Bool bStart )
&interval,
&prefer_blanking,
&allow_exposures );
-
-
+
+
// get the DPMS state right before the start
if (DPMSExtensionAvailable)
{
#if !defined(SOLARIS) && !defined(AIX)
- CARD16 state; // card16 is defined in Xdm.h
- DPMSInfo( GetXDisplay(),
- &state,
+ CARD16 state; // card16 is defined in Xdm.h
+ DPMSInfo( GetXDisplay(),
+ &state,
&DPMSEnabled);
#endif
- }
- if( bStart ) // start show
- {
+ }
+ if( bStart ) // start show
+ {
if ( timeout )
{
nScreenSaversTimeout_ = timeout;
@@ -2430,41 +2435,41 @@ void X11SalFrame::StartPresentation( sal_Bool bStart )
0,
interval,
prefer_blanking,
- allow_exposures );
+ allow_exposures );
}
#if !defined(SOLARIS) && !defined(AIX)
if( DPMSEnabled )
{
if ( DPMSExtensionAvailable )
{
- DPMSGetTimeouts( GetXDisplay(),
- &dpms_standby_timeout,
- &dpms_suspend_timeout,
- &dpms_off_timeout);
- DPMSSetTimeouts(GetXDisplay(), 0,0,0);
+ DPMSGetTimeouts( GetXDisplay(),
+ &dpms_standby_timeout,
+ &dpms_suspend_timeout,
+ &dpms_off_timeout);
+ DPMSSetTimeouts(GetXDisplay(), 0,0,0);
}
}
#endif
- }
- else
+ }
+ else // if( !bStart ) // end of show
{
- if( nScreenSaversTimeout_ )
+ if( nScreenSaversTimeout_ )
{
XSetScreenSaver( GetXDisplay(),
nScreenSaversTimeout_,
interval,
prefer_blanking,
allow_exposures );
- nScreenSaversTimeout_ = 0;
+ nScreenSaversTimeout_ = 0;
}
#if !defined(SOLARIS) && !defined(AIX)
if ( DPMSEnabled )
- {
+ {
if ( DPMSExtensionAvailable )
{
- // restore timeouts
- DPMSSetTimeouts(GetXDisplay(), dpms_standby_timeout,
- dpms_suspend_timeout, dpms_off_timeout);
+ // restore timeouts
+ DPMSSetTimeouts(GetXDisplay(), dpms_standby_timeout,
+ dpms_suspend_timeout, dpms_off_timeout);
}
}
#endif
@@ -2488,7 +2493,7 @@ void X11SalFrame::SetPointer( PointerStyle ePointerStyle )
void X11SalFrame::SetPointerPos(long nX, long nY)
{
- /* when the application tries to center the mouse in the dialog the
+ /* #87921# when the application tries to center the mouse in the dialog the
* window isn't mapped already. So use coordinates relative to the root window.
*/
unsigned int nWindowLeft = maGeometry.nX + nX;
@@ -2504,16 +2509,16 @@ void
X11SalFrame::PostExtTextEvent (sal_uInt16 nExtTextEventType, void *pExtTextEvent)
{
XLIB_Window nFocusWindow = GetWindow();
- Atom nEventAtom = GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::SAL_EXTTEXTEVENT );
+ Atom nEventAtom = GetDisplay()->getWMAdaptor()->getAtom( WMAdaptor::SAL_EXTTEXTEVENT );
XEvent aEvent;
- aEvent.xclient.type = ClientMessage;
- aEvent.xclient.serial = 0;
- aEvent.xclient.send_event = True;
- aEvent.xclient.display = GetXDisplay();
- aEvent.xclient.window = nFocusWindow;
- aEvent.xclient.message_type = nEventAtom;
- aEvent.xclient.format = 32;
+ aEvent.xclient.type = ClientMessage;
+ aEvent.xclient.serial = 0;
+ aEvent.xclient.send_event = True;
+ aEvent.xclient.display = GetXDisplay();
+ aEvent.xclient.window = nFocusWindow;
+ aEvent.xclient.message_type = nEventAtom;
+ aEvent.xclient.format = 32;
#if SAL_TYPES_SIZEOFLONG > 4
aEvent.xclient.data.l[0] = (sal_uInt32)((long)pExtTextEvent & 0xffffffff);
@@ -2559,10 +2564,10 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent)
// PostEvent
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalFrame::PostEvent( void *pData )
+BOOL X11SalFrame::PostEvent( void *pData )
{
GetDisplay()->SendInternalEvent( this, pData );
- return sal_True;
+ return TRUE;
}
// Title
@@ -2634,7 +2639,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags )
+void X11SalFrame::EndExtTextInput( USHORT nFlags )
{
if (mpInputContext != NULL)
mpInputContext->EndExtTextInput( nFlags );
@@ -2642,20 +2647,20 @@ void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-XubString X11SalFrame::GetKeyName( sal_uInt16 nKeyCode )
+XubString X11SalFrame::GetKeyName( USHORT nKeyCode )
{
return GetDisplay()->GetKeyName( nKeyCode );
}
-XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
+XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
{
return GetKeyName( nKeyCode );
}
-sal_Bool X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return sal_False;
+ return FALSE;
}
LanguageType X11SalFrame::GetInputLanguage()
@@ -2683,7 +2688,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings )
pIntegrator->GetSystemLook( rSettings );
}
-void X11SalFrame::CaptureMouse( sal_Bool bCapture )
+void X11SalFrame::CaptureMouse( BOOL bCapture )
{
nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL );
}
@@ -2714,8 +2719,8 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
{
bool bWasVisible = bMapped_;
if( bWasVisible )
- Show( sal_False );
-
+ Show( FALSE );
+
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2770,10 +2775,10 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
// update graphics if necessary
updateGraphics(false);
-
+
if( m_aTitle.Len() )
SetTitle( m_aTitle );
-
+
if( mpParent )
{
if( mpParent->m_nScreen != m_nScreen )
@@ -2783,12 +2788,12 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
}
if( bWasVisible )
- Show( sal_True );
-
+ Show( TRUE );
+
std::list< X11SalFrame* > aChildren = maChildren;
for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it )
(*it)->createNewWindow( None, m_nScreen );
-
+
// FIXME: SalObjects
}
@@ -2819,9 +2824,9 @@ void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported
// Event Handling
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static sal_uInt16 sal_GetCode( int state )
+static USHORT sal_GetCode( int state )
{
- sal_uInt16 nCode = 0;
+ USHORT nCode = 0;
if( state & Button1Mask )
nCode |= MOUSE_LEFT;
@@ -2874,16 +2879,16 @@ SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
return aState;
}
-void X11SalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
+void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
{
- SalMouseEvent aMouseEvt;
- sal_uInt16 nEvent = 0;
- bool bClosePopups = false;
+ SalMouseEvent aMouseEvt;
+ USHORT nEvent = 0;
+ bool bClosePopups = false;
if( nVisibleFloats && pEvent->type == EnterNotify )
return 0;
@@ -2899,7 +2904,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
if ( pEvent->xcrossing.state & Button2Mask )
{
pEvent->xcrossing.state &= ~Button2Mask;
- pEvent->xcrossing.state |= Button3Mask;
+ pEvent->xcrossing.state |= Button3Mask;
}
break;
@@ -2926,6 +2931,8 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
if( LeaveNotify == pEvent->type || EnterNotify == pEvent->type )
{
/*
+ * #89075# #89335#
+ *
* some WMs (and/or) applications have a passive grab on
* mouse buttons (XGrabButton). This leads to enter/leave notifies
* with mouse buttons pressed in the state mask before the actual
@@ -2934,6 +2941,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
* decides that a pressed button in a MouseMove belongs to
* a drag operation which leads to doing things differently.
*
+ * #95901#
* ignore Enter/LeaveNotify resulting from grabs so that
* help windows do not disappear just after appearing
*
@@ -2942,26 +2950,26 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
if( pEvent->xcrossing.mode == NotifyGrab || pEvent->xcrossing.mode == NotifyUngrab )
return 0;
- aMouseEvt.mnX = pEvent->xcrossing.x;
- aMouseEvt.mnY = pEvent->xcrossing.y;
- aMouseEvt.mnTime = pEvent->xcrossing.time;
- aMouseEvt.mnCode = sal_GetCode( pEvent->xcrossing.state );
- aMouseEvt.mnButton = 0;
+ aMouseEvt.mnX = pEvent->xcrossing.x;
+ aMouseEvt.mnY = pEvent->xcrossing.y;
+ aMouseEvt.mnTime = pEvent->xcrossing.time;
+ aMouseEvt.mnCode = sal_GetCode( pEvent->xcrossing.state );
+ aMouseEvt.mnButton = 0;
- nEvent = LeaveNotify == pEvent->type
+ nEvent = LeaveNotify == pEvent->type
? SALEVENT_MOUSELEAVE
: SALEVENT_MOUSEMOVE;
}
else if( pEvent->type == MotionNotify )
{
- aMouseEvt.mnX = pEvent->xmotion.x;
- aMouseEvt.mnY = pEvent->xmotion.y;
- aMouseEvt.mnTime = pEvent->xmotion.time;
- aMouseEvt.mnCode = sal_GetCode( pEvent->xmotion.state );
+ aMouseEvt.mnX = pEvent->xmotion.x;
+ aMouseEvt.mnY = pEvent->xmotion.y;
+ aMouseEvt.mnTime = pEvent->xmotion.time;
+ aMouseEvt.mnCode = sal_GetCode( pEvent->xmotion.state );
- aMouseEvt.mnButton = 0;
+ aMouseEvt.mnButton = 0;
- nEvent = SALEVENT_MOUSEMOVE;
+ nEvent = SALEVENT_MOUSEMOVE;
if( nVisibleFloats > 0 && mpParent )
{
XLIB_Cursor aCursor = mpParent->GetCursor();
@@ -2992,11 +3000,11 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
{
const X11SalFrame* pFrame = static_cast< const X11SalFrame* >(*it);
- if( pFrame->IsFloatGrabWindow() &&
- pFrame->bMapped_ &&
- pEvent->xbutton.x_root >= pFrame->maGeometry.nX &&
- pEvent->xbutton.x_root < pFrame->maGeometry.nX + (int)pFrame->maGeometry.nWidth &&
- pEvent->xbutton.y_root >= pFrame->maGeometry.nY &&
+ if( pFrame->IsFloatGrabWindow() &&
+ pFrame->bMapped_ &&
+ pEvent->xbutton.x_root >= pFrame->maGeometry.nX &&
+ pEvent->xbutton.x_root < pFrame->maGeometry.nX + (int)pFrame->maGeometry.nWidth &&
+ pEvent->xbutton.y_root >= pFrame->maGeometry.nY &&
pEvent->xbutton.y_root < pFrame->maGeometry.nY + (int)pFrame->maGeometry.nHeight )
{
bInside = true;
@@ -3005,7 +3013,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
}
if( ! bInside )
{
- // need not take care of the XUngrabPointer in Show( sal_False )
+ // need not take care of the XUngrabPointer in Show( FALSE )
// because XUngrabPointer does not produce errors if pointer
// is not grabbed
XUngrabPointer( GetXDisplay(), CurrentTime );
@@ -3050,7 +3058,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
}
}
}
-
+
if( m_bXEmbed && pEvent->xbutton.button == Button1 )
askForXEmbedFocus( pEvent->xbutton.time );
@@ -3058,19 +3066,19 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
pEvent->xbutton.button == Button2 ||
pEvent->xbutton.button == Button3 )
{
- aMouseEvt.mnX = pEvent->xbutton.x;
- aMouseEvt.mnY = pEvent->xbutton.y;
- aMouseEvt.mnTime = pEvent->xbutton.time;
- aMouseEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
+ aMouseEvt.mnX = pEvent->xbutton.x;
+ aMouseEvt.mnY = pEvent->xbutton.y;
+ aMouseEvt.mnTime = pEvent->xbutton.time;
+ aMouseEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
if( Button1 == pEvent->xbutton.button )
- aMouseEvt.mnButton = MOUSE_LEFT;
+ aMouseEvt.mnButton = MOUSE_LEFT;
else if( Button2 == pEvent->xbutton.button )
- aMouseEvt.mnButton = MOUSE_MIDDLE;
+ aMouseEvt.mnButton = MOUSE_MIDDLE;
else if( Button3 == pEvent->xbutton.button )
- aMouseEvt.mnButton = MOUSE_RIGHT;
+ aMouseEvt.mnButton = MOUSE_RIGHT;
- nEvent = ButtonPress == pEvent->type
+ nEvent = ButtonPress == pEvent->type
? SALEVENT_MOUSEBUTTONDOWN
: SALEVENT_MOUSEBUTTONUP;
}
@@ -3079,17 +3087,17 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
pEvent->xbutton.button == Button6 ||
pEvent->xbutton.button == Button7 )
{
- const bool bIncrement(
+ const bool bIncrement(
pEvent->xbutton.button == Button4 ||
pEvent->xbutton.button == Button6 );
- const bool bHoriz(
+ const bool bHoriz(
pEvent->xbutton.button == Button6 ||
pEvent->xbutton.button == Button7 );
if( pEvent->type == ButtonRelease )
return 0;
- static sal_uLong nLines = 0;
+ static ULONG nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -3098,15 +3106,15 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
nLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
}
- SalWheelMouseEvent aWheelEvt;
- aWheelEvt.mnTime = pEvent->xbutton.time;
- aWheelEvt.mnX = pEvent->xbutton.x;
- aWheelEvt.mnY = pEvent->xbutton.y;
- aWheelEvt.mnDelta = bIncrement ? 120 : -120;
- aWheelEvt.mnNotchDelta = bIncrement ? 1 : -1;
+ SalWheelMouseEvent aWheelEvt;
+ aWheelEvt.mnTime = pEvent->xbutton.time;
+ aWheelEvt.mnX = pEvent->xbutton.x;
+ aWheelEvt.mnY = pEvent->xbutton.y;
+ aWheelEvt.mnDelta = bIncrement ? 120 : -120;
+ aWheelEvt.mnNotchDelta = bIncrement ? 1 : -1;
aWheelEvt.mnScrollLines = nLines;
- aWheelEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
- aWheelEvt.mbHorz = bHoriz;
+ aWheelEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
+ aWheelEvt.mbHorz = bHoriz;
nEvent = SALEVENT_WHEELMOUSE;
@@ -3151,14 +3159,14 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
// in the independent part.
struct KeyAlternate
{
- sal_uInt16 nKeyCode;
- sal_Unicode nCharCode;
+ USHORT nKeyCode;
+ sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const sal_uInt16 nKeyCode )
+GetAlternateKeyCode( const USHORT nKeyCode )
{
KeyAlternate aAlternate;
@@ -3171,107 +3179,13 @@ GetAlternateKeyCode( const sal_uInt16 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 )
{
- KeySym nKeySym;
+ KeySym nKeySym;
KeySym nUnmodifiedKeySym;
- int nLen = 2048;
- unsigned char *pPrintable = (unsigned char*)alloca( nLen );
+ int nLen = 2048;
+ unsigned char *pPrintable = (unsigned char*)alloca( nLen );
// singlebyte code composed by input method, the new default
if (mpInputContext != NULL && mpInputContext->UseContext())
@@ -3299,9 +3213,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
}
SalKeyEvent aKeyEvt;
- sal_uInt16 nKeyCode;
- sal_uInt16 nModCode = 0;
- char aDummy;
+ USHORT nKeyCode;
+ USHORT nModCode = 0;
+ char aDummy;
if( pEvent->state & ShiftMask )
nModCode |= KEY_SHIFT;
@@ -3310,13 +3224,10 @@ 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
- || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R
+ 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
+ || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R
|| nKeySym == XK_Super_L || nKeySym == XK_Super_R )
{
SalKeyModEvent aModEvt;
@@ -3333,8 +3244,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.
- sal_uInt16 nExtModMask = 0;
- sal_uInt16 nModMask = 0;
+ USHORT nExtModMask = 0;
+ USHORT nModMask = 0;
switch( nKeySym )
{
case XK_Control_L:
@@ -3390,10 +3301,29 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
int nRet = CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
+ // emulate KEY_MENU
+ if ( ( (nKeySym == XK_Alt_L) || (nKeySym == XK_Alt_R) ) &&
+ ( (nModCode & ~(KEY_MOD3|KEY_MOD2)) == 0 ) )
+ {
+ if( pEvent->type == XLIB_KeyPress )
+ mbKeyMenu = true;
+ else if( mbKeyMenu )
+ {
+ // simulate KEY_MENU
+ aKeyEvt.mnCode = KEY_MENU | nModCode;
+ aKeyEvt.mnRepeat = 0;
+ aKeyEvt.mnTime = pEvent->time;
+ aKeyEvt.mnCharCode = 0;
+ nRet = CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
+ nRet = CallCallback( SALEVENT_KEYUP, &aKeyEvt );
+ }
+ }
+ else
+ mbKeyMenu = false;
return nRet;
}
- mbSendExtKeyModChange = false;
+ mbSendExtKeyModChange = mbKeyMenu = false;
// try to figure out the vcl code for the keysym
// #i52338# use the unmodified KeySym if there is none for the real KeySym
@@ -3410,40 +3340,13 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
// information (in et_EE locale: "Compose + Z + <" delivers "," in printable and
// (the desired) Zcaron in KeySym
sal_Unicode nKeyString = 0x0;
- if ( (nLen == 0)
+ if ( (nLen == 0)
|| ((nLen == 1) && (nKeySym > 0)) )
nKeyString = KeysymToUnicode (nKeySym);
// if we have nothing we give up
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() )
@@ -3502,6 +3405,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
nSize = 0;
}
+ DeletionListener aDeleteWatch( this );
+
if ( mpInputContext != NULL
&& mpInputContext->UseContext()
&& KeyRelease != pEvent->type
@@ -3513,9 +3418,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
else
// normal single character keyinput
{
- aKeyEvt.mnCode = nKeyCode | nModCode;
+ aKeyEvt.mnCode = nKeyCode | nModCode;
aKeyEvt.mnRepeat = 0;
- aKeyEvt.mnTime = pEvent->time;
+ aKeyEvt.mnTime = pEvent->time;
aKeyEvt.mnCharCode = pString[ 0 ];
if( KeyRelease == pEvent->type )
@@ -3557,18 +3462,18 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
{
- // ReflectionX in Windows mode changes focus while mouse is grabbed
+ // #107739# ReflectionX in Windows mode changes focus while mouse is grabbed
if( nVisibleFloats > 0 && GetDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii( "ReflectionX Windows" ) )
return 1;
- /* ignore focusout resulting from keyboard grabs
- * we do not grab it and are not interested when
- * someone else does CDE e.g. does a XGrabKey on arrow keys
- * handle focus events with mode NotifyWhileGrabbed
- * because with CDE alt-tab focus changing we do not get
- * normal focus events
- * cast focus event to the input context, otherwise the
- * status window does not follow the application frame
+ /* #55691# ignore focusout resulting from keyboard grabs
+ * we do not grab it and are not interested when
+ * someone else does CDE e.g. does a XGrabKey on arrow keys
+ * #73179# handle focus events with mode NotifyWhileGrabbed
+ * because with CDE alt-tab focus changing we do not get
+ * normal focus events
+ * #71791# cast focus event to the input context, otherwise the
+ * status window does not follow the application frame
*/
if ( mpInputContext != NULL )
@@ -3580,7 +3485,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
/*
* do not unset the IC focuse here because would kill
* a lookup choice windows that might have the focus now
- * mpInputContext->UnsetICFocus( this );
+ * mpInputContext->UnsetICFocus( this );
*/
I18NStatus::get().show( false, I18NStatus::focus );
}
@@ -3596,7 +3501,9 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if( FocusIn == pEvent->type )
{
- GetSalData()->m_pInstance->updatePrinterUpdate();
+#ifndef _USE_PRINT_EXTENSION_
+ vcl_sal::PrinterUpdate::update();
+#endif
mbInputFocus = True;
ImplSVData* pSVData = ImplGetSVData();
@@ -3606,7 +3513,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if ((mpParent != NULL && nStyle_ == 0)
&& pSVData->maWinData.mpFirstFloat )
{
- sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
+ ULONG nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
pSVData->maWinData.mpFirstFloat->SetPopupModeFlags(
nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE));
}
@@ -3615,7 +3522,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
else
{
mbInputFocus = False;
- mbSendExtKeyModChange = false;
+ mbSendExtKeyModChange = mbKeyMenu = false;
mnExtKeyMod = 0;
return CallCallback( SALEVENT_LOSEFOCUS, 0 );
}
@@ -3628,24 +3535,24 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
{
- XRectangle aRect = { 0, 0, 0, 0 };
- sal_uInt16 nCount = 0;
+ XRectangle aRect = { 0, 0, 0, 0 };
+ USHORT nCount = 0;
if( pEvent->type == Expose )
{
- aRect.x = pEvent->xexpose.x;
- aRect.y = pEvent->xexpose.y;
- aRect.width = pEvent->xexpose.width;
- aRect.height = pEvent->xexpose.height;
- nCount = pEvent->xexpose.count;
+ aRect.x = pEvent->xexpose.x;
+ aRect.y = pEvent->xexpose.y;
+ aRect.width = pEvent->xexpose.width;
+ aRect.height = pEvent->xexpose.height;
+ nCount = pEvent->xexpose.count;
}
else if( pEvent->type == GraphicsExpose )
{
- aRect.x = pEvent->xgraphicsexpose.x;
- aRect.y = pEvent->xgraphicsexpose.y;
- aRect.width = pEvent->xgraphicsexpose.width;
- aRect.height = pEvent->xgraphicsexpose.height;
- nCount = pEvent->xgraphicsexpose.count;
+ aRect.x = pEvent->xgraphicsexpose.x;
+ aRect.y = pEvent->xgraphicsexpose.y;
+ aRect.width = pEvent->xgraphicsexpose.width;
+ aRect.height = pEvent->xgraphicsexpose.height;
+ nCount = pEvent->xgraphicsexpose.count;
}
if( IsOverrideRedirect() && mbFullScreen &&
@@ -3695,8 +3602,8 @@ void X11SalFrame::RestackChildren( XLIB_Window* pTopLevelWindows, int nTopLevelW
// if a child is behind its parent, place it above the
// parent (for insane WMs like Dtwm and olwm)
XWindowChanges aCfg;
- aCfg.sibling = GetStackingWindow();
- aCfg.stack_mode = Above;
+ aCfg.sibling = GetStackingWindow();
+ aCfg.stack_mode = Above;
XConfigureWindow( GetXDisplay(), pData->GetStackingWindow(), CWSibling|CWStackMode, &aCfg );
break;
}
@@ -3731,37 +3638,9 @@ void X11SalFrame::RestackChildren()
}
}
-static Bool size_event_predicate( Display*, XEvent* event, XPointer arg )
-{
- if( event->type != ConfigureNotify )
- return False;
- X11SalFrame* frame = reinterpret_cast< X11SalFrame* >( arg );
- XConfigureEvent* pEvent = &event->xconfigure;
- if( pEvent->window != frame->GetShellWindow()
- && pEvent->window != frame->GetWindow()
- && pEvent->window != frame->GetForeignParent()
- && pEvent->window != frame->GetStackingWindow())
- { // ignored at top of HandleSizeEvent()
- return False;
- }
- if( pEvent->window == frame->GetStackingWindow())
- return False; // filtered later in HandleSizeEvent()
- // at this point we know that there is another similar event in the queue
- frame->setPendingSizeEvent();
- return False; // but do not process the new event out of order
-}
-
-void X11SalFrame::setPendingSizeEvent()
-{
- mPendingSizeEvent = true;
-}
-
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent )
{
- // NOTE: if you add more tests in this function, make sure to update size_event_predicate()
- // so that it finds exactly the same events
-
if ( pEvent->window != GetShellWindow()
&& pEvent->window != GetWindow()
&& pEvent->window != GetForeignParent()
@@ -3809,26 +3688,16 @@ long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent )
if( SHOWSTATE_UNKNOWN == nShowState_ && bMapped_ )
nShowState_ = SHOWSTATE_NORMAL;
- // Avoid a race condition where resizing this window to one size and shortly after that
- // to another size generates first size event with the old size and only after that
- // with the new size, temporarily making us think the old size is valid (bnc#674806).
- // So if there is another size event for this window pending, ignore this one.
- mPendingSizeEvent = false;
- XEvent dummy;
- XCheckIfEvent( GetXDisplay(), &dummy, size_event_predicate, reinterpret_cast< XPointer >( this ));
- if( mPendingSizeEvent )
- return 1;
-
- nWidth_ = pEvent->width;
- nHeight_ = pEvent->height;
+ nWidth_ = pEvent->width;
+ nHeight_ = pEvent->height;
bool bMoved = ( pEvent->x != maGeometry.nX || pEvent->y != maGeometry.nY );
bool bSized = ( pEvent->width != (int)maGeometry.nWidth || pEvent->height != (int)maGeometry.nHeight );
- maGeometry.nX = pEvent->x;
- maGeometry.nY = pEvent->y;
- maGeometry.nWidth = pEvent->width;
- maGeometry.nHeight = pEvent->height;
+ maGeometry.nX = pEvent->x;
+ maGeometry.nY = pEvent->y;
+ maGeometry.nWidth = pEvent->width;
+ maGeometry.nHeight = pEvent->height;
updateScreenNumber();
// update children's position
@@ -3854,13 +3723,13 @@ IMPL_LINK( X11SalFrame, HandleAlwaysOnTopRaise, void*, EMPTYARG )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
{
- Display *pDisplay = pEvent->display;
- XLIB_Window hWM_Parent;
- XLIB_Window hRoot, *Children, hDummy;
- unsigned int nChildren;
- sal_Bool bNone = pDisplay_->GetProperties()
+ Display *pDisplay = pEvent->display;
+ XLIB_Window hWM_Parent;
+ XLIB_Window hRoot, *Children, hDummy;
+ unsigned int nChildren;
+ BOOL bNone = pDisplay_->GetProperties()
& PROPERTY_SUPPORT_WM_Parent_Pixmap_None;
- sal_Bool bAccessParentWindow = ! (pDisplay_->GetProperties()
+ BOOL bAccessParentWindow = ! (pDisplay_->GetProperties()
& PROPERTY_FEATURE_TrustedSolaris);
static const char* pDisableStackingCheck = getenv( "SAL_DISABLE_STACKING_CHECK" );
@@ -3868,7 +3737,7 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
GetDisplay()->GetXLib()->PushXErrorLevel( true );
/*
- * don't rely on the new parent from the event.
+ * #89186# don't rely on the new parent from the event.
* the event may be "out of date", that is the window manager
* window may not exist anymore. This can happen if someone
* shows a frame and hides it again quickly (not that that would
@@ -3884,13 +3753,13 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
&hDummy,
&Children,
&nChildren );
- if( GetDisplay()->GetXLib()->HasXErrorOccurred() )
+ if( GetDisplay()->GetXLib()->HasXErrorOccured() )
{
hWM_Parent = GetShellWindow();
break;
}
- /* this sometimes happens if a Show(sal_True) is
- * immediately followed by Show(sal_False) (which is braindead anyway)
+ /* #107048# this sometimes happens if a Show(TRUE) is
+ * immediately followed by Show(FALSE) (which is braindead anyway)
*/
if( hDummy == hWM_Parent )
hDummy = hRoot;
@@ -3915,9 +3784,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
XSelectInput( pDisplay, GetStackingWindow(), StructureNotifyMask );
}
- if( hWM_Parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() )
- || hWM_Parent == GetForeignParent()
- || pEvent->parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() )
+ if( hWM_Parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() )
+ || hWM_Parent == GetForeignParent()
+ || pEvent->parent == pDisplay_->GetRootWindow( pDisplay_->GetDefaultScreenNumber() )
|| ( nStyle_ & SAL_FRAME_STYLE_FLOAT ) )
{
// Reparenting before Destroy
@@ -3966,15 +3835,15 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
&nLeft,
&nTop,
&hDummy );
- maGeometry.nLeftDecoration = nLeft > 0 ? nLeft-1 : 0;
- maGeometry.nTopDecoration = nTop > 0 ? nTop-1 : 0;
+ maGeometry.nLeftDecoration = nLeft > 0 ? nLeft-1 : 0;
+ maGeometry.nTopDecoration = nTop > 0 ? nTop-1 : 0;
/*
* decorations are not symmetric,
* so need real geometries here
* (this will fail with virtual roots ?)
*/
- GetDisplay()->GetXLib()->ResetXErrorOccurred();
+ GetDisplay()->GetXLib()->ResetXErrorOccured();
int xp, yp, x, y;
unsigned int wp, w, hp, h, bw, d;
XGetGeometry( GetXDisplay(),
@@ -3986,18 +3855,18 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
&hRoot,
&xp, &yp, &wp, &hp, &bw, &d );
bool bResized = false;
- if( ! GetDisplay()->GetXLib()->HasXErrorOccurred() )
+ if( ! GetDisplay()->GetXLib()->HasXErrorOccured() )
{
- maGeometry.nRightDecoration = wp - w - maGeometry.nLeftDecoration;
- maGeometry.nBottomDecoration = hp - h - maGeometry.nTopDecoration;
+ maGeometry.nRightDecoration = wp - w - maGeometry.nLeftDecoration;
+ maGeometry.nBottomDecoration = hp - h - maGeometry.nTopDecoration;
/*
* note: this works because hWM_Parent is direct child of root,
* not necessarily parent of GetShellWindow()
*/
- maGeometry.nX = xp + nLeft;
- maGeometry.nY = yp + nTop;
+ maGeometry.nX = xp + nLeft;
+ maGeometry.nY = yp + nTop;
bResized = w != maGeometry.nWidth || h != maGeometry.nHeight;
- maGeometry.nWidth = w;
+ maGeometry.nWidth = w;
maGeometry.nHeight = h;
}
@@ -4013,16 +3882,16 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
int nScreenHeight = aScreenSize.Height();
int nFrameWidth = maGeometry.nWidth + maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
int nFrameHeight = maGeometry.nHeight + maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
-
+
if ((nFrameWidth > nScreenWidth) || (nFrameHeight > nScreenHeight))
{
Size aSize(maGeometry.nWidth, maGeometry.nHeight);
-
+
if (nFrameWidth > nScreenWidth)
aSize.Width() = nScreenWidth - maGeometry.nRightDecoration - maGeometry.nLeftDecoration;
if (nFrameHeight > nScreenHeight)
aSize.Height() = nScreenHeight - maGeometry.nBottomDecoration - maGeometry.nTopDecoration;
-
+
SetSize( aSize );
bResized = false;
}
@@ -4044,18 +3913,18 @@ long X11SalFrame::HandleColormapEvent( XColormapEvent* )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleStateEvent( XPropertyEvent *pEvent )
{
- Atom actual_type;
- int actual_format;
+ Atom actual_type;
+ int actual_format;
unsigned long nitems, bytes_after;
unsigned char *prop = NULL;
if( 0 != XGetWindowProperty( GetXDisplay(),
GetShellWindow(),
- pEvent->atom, // property
- 0, // long_offset (32bit)
- 2, // long_length (32bit)
- False, // delete
- pEvent->atom, // req_type
+ pEvent->atom, // property
+ 0, // long_offset (32bit)
+ 2, // long_length (32bit)
+ False, // delete
+ pEvent->atom, // req_type
&actual_type,
&actual_format,
&nitems,
@@ -4067,8 +3936,8 @@ long X11SalFrame::HandleStateEvent( XPropertyEvent *pEvent )
DBG_ASSERT( actual_type = pEvent->atom
&& 32 == actual_format
- && 2 == nitems
- && 0 == bytes_after, "HandleStateEvent" );
+ && 2 == nitems
+ && 0 == bytes_after, "HandleStateEvent" );
if( *(unsigned long*)prop == NormalState )
nShowState_ = SHOWSTATE_NORMAL;
@@ -4122,15 +3991,15 @@ long X11SalFrame::HandleClientMessage( XClientMessageEvent *pEvent )
else if( (Atom)pEvent->data.l[0] == rWMAdaptor.getAtom( WMAdaptor::WM_SAVE_YOURSELF ) )
{
bool bSession = rWMAdaptor.getWindowManagerName().EqualsAscii( "Dtwm" );
-
+
if( ! bSession )
{
if( this == s_pSaveYourselfFrame )
{
- rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding()));
+ ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() );
const char* argv[2];
argv[0] = "/bin/sh";
- argv[1] = const_cast<char*>(aExec.getStr());
+ argv[1] = const_cast<char*>(aExec.GetBuffer());
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "SaveYourself request, setting command: %s %s\n", argv[0], argv[1] );
#endif
@@ -4175,10 +4044,10 @@ void X11SalFrame::SaveYourselfDone( SalFrame* pSaveFrame )
// session save was done, inform dtwm
if( s_pSaveYourselfFrame && pSaveFrame )
{
- rtl::OString aExec(rtl::OUStringToOString(SessionManagerClient::getExecName(), osl_getThreadTextEncoding()));
+ ByteString aExec( SessionManagerClient::getExecName(), osl_getThreadTextEncoding() );
const char* argv[2];
argv[0] = "/bin/sh";
- argv[1] = const_cast<char*>(aExec.getStr());
+ argv[1] = const_cast<char*>(aExec.GetBuffer());
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "SaveYourself request, setting command: %s %s\n", argv[0], argv[1] );
#endif
@@ -4196,7 +4065,7 @@ void X11SalFrame::SaveYourselfDone( SalFrame* pSaveFrame )
pFrame = static_cast< const X11SalFrame* >(*it);
if( pFrame == pSaveFrame )
break;
- ++it;
+ ++it;
}
if( pFrame == pSaveFrame )
{
@@ -4224,10 +4093,10 @@ Bool X11SalFrame::checkKeyReleaseForRepeat( Display*, XEvent* pCheck, XPointer p
{
X11SalFrame* pThis = (X11SalFrame*)pX11SalFrame;
return
- pCheck->type == XLIB_KeyPress &&
- pCheck->xkey.state == pThis->nKeyState_ &&
- pCheck->xkey.keycode == pThis->nKeyCode_ &&
- pCheck->xkey.time == pThis->nReleaseTime_ ? True : False;
+ pCheck->type == XLIB_KeyPress &&
+ pCheck->xkey.state == pThis->nKeyState_ &&
+ pCheck->xkey.keycode == pThis->nKeyCode_ &&
+ pCheck->xkey.time == pThis->nReleaseTime_ ? True : False;
}
long X11SalFrame::Dispatch( XEvent *pEvent )
@@ -4236,7 +4105,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
if( -1 == nCaptured_ )
{
- CaptureMouse( sal_True );
+ CaptureMouse( TRUE );
#ifdef DBG_UTIL
if( -1 != nCaptured_ )
pDisplay_->PrintEvent( "Captured", pEvent );
@@ -4248,9 +4117,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
switch( pEvent->type )
{
case XLIB_KeyPress:
- nKeyCode_ = pEvent->xkey.keycode;
- nKeyState_ = pEvent->xkey.state;
- nRet = HandleKeyEvent( &pEvent->xkey );
+ nKeyCode_ = pEvent->xkey.keycode;
+ nKeyState_ = pEvent->xkey.state;
+ nRet = HandleKeyEvent( &pEvent->xkey );
break;
case KeyRelease:
@@ -4261,12 +4130,12 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
if( XCheckIfEvent( pEvent->xkey.display, &aEvent, call_checkKeyReleaseForRepeat, (XPointer)this ) )
XPutBackEvent( pEvent->xkey.display, &aEvent );
else
- nRet = HandleKeyEvent( &pEvent->xkey );
+ nRet = HandleKeyEvent( &pEvent->xkey );
}
break;
case ButtonPress:
- // if we loose the focus in presentation mode
+ // #74406# if we loose the focus in presentation mode
// there are good chances that we never get it back
// since the WM ignores us
if( IsOverrideRedirect() )
@@ -4298,7 +4167,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
if( nShowState_ == SHOWSTATE_HIDDEN )
{
/*
- * workaround for (at least) KWin 2.2.2
+ * #95097# workaround for (at least) KWin 2.2.2
* which will map windows that were once transient
* even if they are withdrawn when the respective
* document is mapped.
@@ -4307,9 +4176,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
XUnmapWindow( GetXDisplay(), GetShellWindow() );
break;
}
- bMapped_ = sal_True;
- bViewable_ = sal_True;
- nRet = sal_True;
+ bMapped_ = TRUE;
+ bViewable_ = TRUE;
+ nRet = TRUE;
if ( mpInputContext != NULL )
mpInputContext->Map( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4322,13 +4191,13 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
*/
maPaintRegion.Union( Rectangle( Point( 0, 0 ), Size( maGeometry.nWidth, maGeometry.nHeight ) ) );
XEvent aEvent;
- aEvent.xexpose.type = Expose;
- aEvent.xexpose.display = pDisplay_->GetDisplay();
- aEvent.xexpose.x = 0;
- aEvent.xexpose.y = 0;
- aEvent.xexpose.width = maGeometry.nWidth;
- aEvent.xexpose.height = maGeometry.nHeight;
- aEvent.xexpose.count = 0;
+ aEvent.xexpose.type = Expose;
+ aEvent.xexpose.display = pDisplay_->GetDisplay();
+ aEvent.xexpose.x = 0;
+ aEvent.xexpose.y = 0;
+ aEvent.xexpose.width = maGeometry.nWidth;
+ aEvent.xexpose.height = maGeometry.nHeight;
+ aEvent.xexpose.count = 0;
XSendEvent( pDisplay_->GetDisplay(),
GetWindow(),
True,
@@ -4337,12 +4206,12 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
}
bool bSetFocus = m_bSetFocusOnMap;
- /* another workaround for sawfish: if a transient window for the same parent is shown
+ /* #99570# another workaround for sawfish: if a transient window for the same parent is shown
* sawfish does not set the focus to it. Applies only for click to focus mode.
*/
if( ! (nStyle_ & SAL_FRAME_STYLE_FLOAT ) && mbInShow && GetDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii( "Sawfish" ) )
{
- // don't set the focus into the IME status window
+ // #101775# don't set the focus into the IME status window
// since this will lead to a parent loose-focus, close status,
// reget focus, open status, .... flicker loop
if ( (I18NStatus::get().getStatusFrame() != this) )
@@ -4386,7 +4255,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
CurrentTime );
bSetFocus = false;
}
-
+
if( bSetFocus )
{
XSetInputFocus( GetXDisplay(),
@@ -4394,10 +4263,10 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
RevertToParent,
CurrentTime );
}
-
+
RestackChildren();
- mbInShow = sal_False;
+ mbInShow = FALSE;
m_bSetFocusOnMap = false;
}
break;
@@ -4405,9 +4274,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case UnmapNotify:
if( pEvent->xunmap.window == GetShellWindow() )
{
- bMapped_ = sal_False;
- bViewable_ = sal_False;
- nRet = sal_True;
+ bMapped_ = FALSE;
+ bViewable_ = FALSE;
+ nRet = TRUE;
if ( mpInputContext != NULL )
mpInputContext->Unmap( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4422,7 +4291,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case VisibilityNotify:
nVisibility_ = pEvent->xvisibility.state;
- nRet = sal_True;
+ nRet = TRUE;
if( bAlwaysOnTop_
&& bMapped_
&& ! GetDisplay()->getWMAdaptor()->isAlwaysOnTopOK()
@@ -4493,13 +4362,13 @@ void X11SalFrame::ResetClipRegion()
delete [] m_pClipRectangles;
m_pClipRectangles = NULL;
m_nCurClipRect = m_nMaxClipRect = 0;
-
- const int dest_kind = ShapeBounding;
- const int op = ShapeSet;
- const int ordering = YSorted;
+
+ const int dest_kind = ShapeBounding;
+ const int op = ShapeSet;
+ const int ordering = YSorted;
XWindowAttributes win_attrib;
- XRectangle win_size;
+ XRectangle win_size;
XLIB_Window aShapeWindow = mhShellWindow;
@@ -4507,21 +4376,21 @@ void X11SalFrame::ResetClipRegion()
aShapeWindow,
&win_attrib );
- win_size.x = 0;
- win_size.y = 0;
- win_size.width = win_attrib.width;
+ win_size.x = 0;
+ win_size.y = 0;
+ win_size.width = win_attrib.width;
win_size.height = win_attrib.height;
XShapeCombineRectangles ( GetDisplay()->GetDisplay(),
aShapeWindow,
dest_kind,
- 0, 0, // x_off, y_off
- &win_size, // list of rectangles
- 1, // number of rectangles
+ 0, 0, // x_off, y_off
+ &win_size, // list of rectangles
+ 1, // number of rectangles
op, ordering );
}
-void X11SalFrame::BeginSetClipRegion( sal_uLong nRects )
+void X11SalFrame::BeginSetClipRegion( ULONG nRects )
{
if( m_pClipRectangles )
delete [] m_pClipRectangles;
@@ -4547,9 +4416,9 @@ void X11SalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
void X11SalFrame::EndSetClipRegion()
{
- const int dest_kind = ShapeBounding;
- const int ordering = YSorted;
- const int op = ShapeSet;
+ const int dest_kind = ShapeBounding;
+ const int ordering = YSorted;
+ const int op = ShapeSet;
XLIB_Window aShapeWindow = mhShellWindow;
XShapeCombineRectangles ( GetDisplay()->GetDisplay(),
diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx
new file mode 100644
index 000000000000..d1f62da8b0f3
--- /dev/null
+++ b/vcl/unx/source/window/salmenu.cxx
@@ -0,0 +1,134 @@
+/* -*- 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 07cbcf115d5e..bbe20d294c3a 100644
--- a/vcl/unx/source/window/salobj.cxx
+++ b/vcl/unx/source/window/salobj.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,16 +52,16 @@
// =======================================================================
// SalInstance member to create and destroy a SalObject
-SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
+SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
{
return X11SalObject::CreateObject( pParent, pWindowData, bShow );
}
-X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
+X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
{
int error_base, event_base;
- X11SalObject* pObject = new X11SalObject();
- SystemChildData* pObjData = const_cast<SystemChildData*>(pObject->GetSystemData());
+ X11SalObject* pObject = new X11SalObject();
+ SystemChildData* pObjData = const_cast<SystemChildData*>(pObject->GetSystemData());
if ( ! XShapeQueryExtension( (Display*)pObjData->pDisplay,
&event_base, &error_base ) )
@@ -71,12 +71,12 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
}
pObject->mpParent = pParent;
-
- SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
- const SystemEnvData* pEnv = pParent->GetSystemData();
- Display* pDisp = pSalDisp->GetDisplay();
- XLIB_Window aObjectParent = (XLIB_Window)pEnv->aWindow;
-
+
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+ const SystemEnvData* pEnv = pParent->GetSystemData();
+ Display* pDisp = pSalDisp->GetDisplay();
+ XLIB_Window aObjectParent = (XLIB_Window)pEnv->aWindow;
+
// find out on which screen that window is
XWindowAttributes aParentAttr;
XGetWindowAttributes( pDisp, aObjectParent, &aParentAttr );
@@ -134,7 +134,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pSalDisp->GetXLib()->PushXErrorLevel( true );
// create colormap for visual - there might not be one
- pObject->maColormap = aAttribs.colormap = XCreateColormap(
+ pObject->maColormap = aAttribs.colormap = XCreateColormap(
pDisp,
pSalDisp->GetRootWindow( nScreen ),
pVisual,
@@ -149,7 +149,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pVisual,
CWEventMask|CWColormap, &aAttribs );
XSync( pDisp, False );
- sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccured();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -166,17 +166,17 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
XMapWindow( pDisp, pObject->maPrimary );
}
- pObjData->pDisplay = pDisp;
- pObjData->aWindow = pObject->maSecondary;
- pObjData->pWidget = NULL;
- pObjData->pVisual = pVisual;
- pObjData->nDepth = nDepth;
- pObjData->aColormap = aVisID == pSalDisp->GetVisual( nScreen ).GetVisualId() ?
+ pObjData->pDisplay = pDisp;
+ pObjData->aWindow = pObject->maSecondary;
+ pObjData->pWidget = NULL;
+ pObjData->pVisual = pVisual;
+ pObjData->nDepth = nDepth;
+ pObjData->aColormap = aVisID == pSalDisp->GetVisual( nScreen ).GetVisualId() ?
pSalDisp->GetColormap( nScreen ).GetXColormap() : None;
- pObjData->pAppContext = NULL;
+ pObjData->pAppContext = NULL;
XSync(pDisp, False);
- sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccured();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -216,7 +216,7 @@ SalClipRegion::~SalClipRegion()
void
-SalClipRegion::BeginSetClipRegion( sal_uLong nRects )
+SalClipRegion::BeginSetClipRegion( ULONG nRects )
{
if (ClipRectangleList)
delete [] ClipRectangleList;
@@ -234,8 +234,8 @@ SalClipRegion::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
XRectangle *aRect = ClipRectangleList + numClipRectangles;
- aRect->x = (short) nX;
- aRect->y = (short) nY;
+ aRect->x = (short) nX;
+ aRect->y = (short) nY;
aRect->width = (unsigned short) nWidth;
aRect->height= (unsigned short) nHeight;
@@ -250,19 +250,19 @@ SalClipRegion::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
X11SalObject::X11SalObject()
{
- maSystemChildData.nSize = sizeof( SystemChildData );
- maSystemChildData.pDisplay = GetX11SalData()->GetDisplay()->GetDisplay();
- maSystemChildData.aWindow = None;
- maSystemChildData.pSalFrame = 0;
- maSystemChildData.pWidget = 0;
- maSystemChildData.pVisual = 0;
- maSystemChildData.nDepth = 0;
- maSystemChildData.aColormap = 0;
- maSystemChildData.pAppContext = NULL;
- maSystemChildData.aShellWindow = 0;
- maSystemChildData.pShellWidget = NULL;
- maPrimary = 0;
- maSecondary = 0;
+ maSystemChildData.nSize = sizeof( SystemChildData );
+ maSystemChildData.pDisplay = GetX11SalData()->GetDisplay()->GetDisplay();
+ maSystemChildData.aWindow = None;
+ maSystemChildData.pSalFrame = 0;
+ maSystemChildData.pWidget = 0;
+ maSystemChildData.pVisual = 0;
+ maSystemChildData.nDepth = 0;
+ maSystemChildData.aColormap = 0;
+ maSystemChildData.pAppContext = NULL;
+ maSystemChildData.aShellWindow = 0;
+ maSystemChildData.pShellWidget = NULL;
+ maPrimary = 0;
+ maSecondary = 0;
maColormap = 0;
std::list< SalObject* >& rObjects = GetX11SalData()->GetDisplay()->getSalObjects();
@@ -276,7 +276,7 @@ X11SalObject::~X11SalObject()
rObjects.remove( this );
SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
pSalDisp->GetXLib()->PushXErrorLevel( true );
- if ( maSecondary )
+ if ( maSecondary )
XDestroyWindow( (Display*)maSystemChildData.pDisplay, maSecondary );
if ( maPrimary )
XDestroyWindow( (Display*)maSystemChildData.pDisplay, maPrimary );
@@ -292,12 +292,12 @@ X11SalObject::ResetClipRegion()
{
maClipRegion.ResetClipRegion();
- const int dest_kind = ShapeBounding;
- const int op = ShapeSet;
- const int ordering = YSorted;
+ const int dest_kind = ShapeBounding;
+ const int op = ShapeSet;
+ const int ordering = YSorted;
XWindowAttributes win_attrib;
- XRectangle win_size;
+ XRectangle win_size;
XLIB_Window aShapeWindow = maPrimary;
@@ -305,23 +305,23 @@ X11SalObject::ResetClipRegion()
aShapeWindow,
&win_attrib );
- win_size.x = 0;
- win_size.y = 0;
- win_size.width = win_attrib.width;
+ win_size.x = 0;
+ win_size.y = 0;
+ win_size.width = win_attrib.width;
win_size.height = win_attrib.height;
XShapeCombineRectangles ( (Display*)maSystemChildData.pDisplay,
aShapeWindow,
dest_kind,
- 0, 0, // x_off, y_off
- &win_size, // list of rectangles
- 1, // number of rectangles
+ 0, 0, // x_off, y_off
+ &win_size, // list of rectangles
+ 1, // number of rectangles
op, ordering );
}
void
-X11SalObject::BeginSetClipRegion( sal_uLong nRectCount )
+X11SalObject::BeginSetClipRegion( ULONG nRectCount )
{
maClipRegion.BeginSetClipRegion ( nRectCount );
}
@@ -338,12 +338,12 @@ void
X11SalObject::EndSetClipRegion()
{
XRectangle *pRectangles = maClipRegion.EndSetClipRegion ();
- const int nType = maClipRegion.GetClipRegionType();
- const int nRectangles = maClipRegion.GetRectangleCount();
+ const int nType = maClipRegion.GetClipRegionType();
+ const int nRectangles = maClipRegion.GetRectangleCount();
- const int dest_kind = ShapeBounding;
- const int ordering = YSorted;
- int op;
+ const int dest_kind = ShapeBounding;
+ const int ordering = YSorted;
+ int op;
switch ( nType )
{
@@ -361,7 +361,7 @@ X11SalObject::EndSetClipRegion()
}
XLIB_Window aShapeWindow = maPrimary;
-
+
XShapeCombineRectangles ( (Display*)maSystemChildData.pDisplay,
aShapeWindow,
dest_kind,
@@ -372,7 +372,7 @@ X11SalObject::EndSetClipRegion()
}
-sal_uInt16
+USHORT
X11SalObject::GetClipRegionType()
{
return maClipRegion.GetClipRegionType();
@@ -396,9 +396,9 @@ X11SalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
void
-X11SalObject::Show( sal_Bool bVisible )
+X11SalObject::Show( BOOL bVisible )
{
- if ( ! maSystemChildData.aWindow )
+ if ( ! maSystemChildData.aWindow )
return;
if ( bVisible ) {
@@ -417,7 +417,7 @@ X11SalObject::Show( sal_Bool bVisible )
// -----------------------------------------------------------------------
-void X11SalObject::Enable( sal_Bool )
+void X11SalObject::Enable( BOOL )
{
}
@@ -451,9 +451,9 @@ const SystemChildData* X11SalObject::GetSystemData() const
return &maSystemChildData;
}
-static sal_uInt16 sal_GetCode( int state )
+static USHORT sal_GetCode( int state )
{
- sal_uInt16 nCode = 0;
+ USHORT 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;
- sal_uInt16 nEvent = 0;
+ USHORT 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 = sal_False;
+ pObject->mbVisible = FALSE;
return 1;
case MapNotify:
- pObject->mbVisible = sal_True;
+ pObject->mbVisible = TRUE;
return 1;
case ButtonPress:
pObject->CallCallback( SALOBJ_EVENT_TOTOP, NULL );
@@ -557,10 +557,4 @@ long X11SalObject::Dispatch( XEvent* pEvent )
return 0;
}
-// -----------------------------------------------------------------------
-
-void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/util/hidother.src b/vcl/util/hidother.src
index f966fcded1b3..c213fa267154 100644
--- a/vcl/util/hidother.src
+++ b/vcl/util/hidother.src
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -27,5 +27,5 @@
#include "vcl/svids.hrc"
-hidspecial HID_PRINTDLG { HelpID = HID_PRINTDLG; };
+hidspecial HID_PRINTDLG { HelpID = HID_PRINTDLG; };
diff --git a/vcl/util/linksvp/makefile.mk b/vcl/util/linksvp/makefile.mk
index d11aa2cd51d6..86bbf50bdfb2 100644
--- a/vcl/util/linksvp/makefile.mk
+++ b/vcl/util/linksvp/makefile.mk
@@ -47,12 +47,9 @@ LIB1FILES= $(SLB)$/svpplug.lib \
SHL1TARGET=vclplug_svp$(DLLPOSTFIX)
SHL1IMPLIB=isvpplug
SHL1LIBS=$(LIB1TARGET)
-SHL1DEPN=\
- $(LB)$/libvcl$(DLLPOSTFIX)$(DLLPOST) \
- $(LB)$/libvclplug_gen$(DLLPOSTFIX)$(DLLPOST)
+SHL1DEPN=$(LB)$/libvcl$(DLLPOSTFIX)$(DLLPOST)
SHL1STDLIBS=\
$(VCLLIB)\
- -lvclplug_gen$(DLLPOSTFIX) \
$(I18NPAPERLIB)\
$(BASEBMPLIB)\
$(BASEGFXLIB)\
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 713d28a43846..8f2a61a4751b 100755..100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -125,6 +125,7 @@ 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
@@ -133,6 +134,7 @@ SHL11FILE= $(MISC)$/app.slo
SHL12FILE= $(MISC)$/gdi.slo
SHL13FILE= $(MISC)$/win.slo
SHL14FILE= $(MISC)$/ctrl.slo
+#SHL15FILE= $(MISC)$/ex.slo
SHL16FILE= $(MISC)$/salapp.slo
SHL17FILE= $(MISC)$/salwin.slo
SHL18FILE= $(MISC)$/salgdi.slo
@@ -186,7 +188,7 @@ SHL1STDLIBS+=\
.IF "$(SYSTEM_GRAPHITE)" == "YES"
SHL1STDLIBS+= $(GRAPHITE_LIBS)
.ELSE
-SHL1STDLIBS+= -lgraphite2_off
+SHL1STDLIBS+= $(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)/libgraphite.a
.ENDIF
.ENDIF
.ENDIF
@@ -212,6 +214,11 @@ LIB1FILES+= \
.ENDIF # USE_BUILTIN_RASTERIZER
SHL1LIBS= $(LIB1TARGET)
+.IF "$(GUI)"!="UNX"
+.IF "$(COM)"!="GCC"
+#SHL1OBJS= $(SLO)$/salshl.obj
+.ENDIF
+.ENDIF
.IF "$(GUI)" != "UNX"
SHL1RES= $(RES)$/salsrc.res
@@ -231,10 +238,9 @@ DEFLIB1NAME =vcl
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
.IF "$(COM)" == "GCC"
-SHL1STDLIBS += -Wl,-Bstatic -lgraphite2_off -Wl,-Bdynamic
-#SHL1STDLIBS += -lgraphite2_off
+SHL1STDLIBS += -lgraphite
.ELSE
-SHL1STDLIBS += graphite2_off.lib
+SHL1STDLIBS += graphite_dll.lib
.ENDIF
.ENDIF
@@ -245,8 +251,7 @@ SHL1STDLIBS += $(UWINAPILIB) \
$(WINSPOOLLIB) \
$(OLE32LIB) \
$(SHELL32LIB) \
- $(ADVAPI32LIB) \
- $(VERSIONLIB)
+ $(ADVAPI32LIB)
SHL1STDLIBS += $(IMM32LIB)
@@ -305,7 +310,7 @@ SHL2STDLIBS=\
# prepare linking of Xinerama
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX"
+.IF "$(OS)"=="MACOSX"
XINERAMALIBS=-lXinerama
.ELSE
.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg"
@@ -328,7 +333,7 @@ SHL2STDLIBS+=`pkg-config --libs xrender`
SHL2STDLIBS += -lXext -lSM -lICE -lX11
.IF "$(OS)"!="MACOSX" && "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD" && \
- && "$(OS)"!="OPENBSD" "$(OS)"!="DRAGONFLY"
+ && "$(OS)"!="OPENBSD"
# needed by salprnpsp.cxx
SHL2STDLIBS+= -ldl
.ENDIF
@@ -390,9 +395,6 @@ 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
@@ -454,16 +456,3 @@ 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/makefile2.pmk b/vcl/util/makefile2.pmk
index ce1f2a31bd65..ac2977ca8eab 100644
--- a/vcl/util/makefile2.pmk
+++ b/vcl/util/makefile2.pmk
@@ -32,3 +32,10 @@ VISIBILITY_HIDDEN=TRUE
.IF "$(GUIBASE)"=="aqua"
CFLAGSCXX+=$(OBJCXXFLAGS)
.ENDIF # "$(GUIBASE)"=="aqua"
+
+#building with stlport, but graphite was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_GRAPHITE)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk
index 8ec15475bc90..3144acc4bc05 100644
--- a/vcl/util/target.pmk
+++ b/vcl/util/target.pmk
@@ -37,3 +37,8 @@ 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
deleted file mode 100644
index da20fc916c32..000000000000
--- a/vcl/util/vcl.component
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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
deleted file mode 100644
index 3aabcd8c7050..000000000000
--- a/vcl/util/vcl.macosx.component
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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
deleted file mode 100644
index 72f7ace9f251..000000000000
--- a/vcl/util/vcl.windows.component
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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 9ae4b4bef2ca..988d0a3eade3 100644
--- a/vcl/win/inc/salbmp.h
+++ b/vcl/win/inc/salbmp.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,46 +35,46 @@
#include <vcl/salbmp.hxx>
// --------------
-// - SalBitmap -
+// - SalBitmap -
// --------------
-struct BitmapBuffer;
-class BitmapColor;
-class BitmapPalette;
-class SalGraphics;
+struct BitmapBuffer;
+class BitmapColor;
+class BitmapPalette;
+class SalGraphics;
class WinSalBitmap : public SalBitmap
{
private:
- Size maSize;
- HGLOBAL mhDIB;
- HBITMAP mhDDB;
- sal_uInt16 mnBitCount;
+ Size maSize;
+ HGLOBAL mhDIB;
+ HBITMAP mhDDB;
+ USHORT mnBitCount;
public:
- HGLOBAL ImplGethDIB() const { return mhDIB; }
- HBITMAP ImplGethDDB() const { return mhDDB; }
+ HGLOBAL ImplGethDIB() const { return mhDIB; }
+ HBITMAP ImplGethDDB() const { return mhDDB; }
- static HGLOBAL ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
- static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
- static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
- static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
+ static HGLOBAL ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
+ static USHORT ImplGetDIBColorCount( HGLOBAL hDIB );
+ static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 );
public:
WinSalBitmap();
- virtual ~WinSalBitmap();
+ virtual ~WinSalBitmap();
public:
bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
- virtual bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+ virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmpImpl );
virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmpImpl, sal_uInt16 nNewBitCount );
+ virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -82,9 +82,9 @@ public:
virtual void Destroy();
virtual Size GetSize() const { return maSize; }
- virtual sal_uInt16 GetBitCount() const { return mnBitCount; }
+ virtual USHORT GetBitCount() const { return mnBitCount; }
- virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
+ virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
virtual bool GetSystemData( BitmapSystemData& rData );
};
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index 95aa8f5434f2..7d3729f72146 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,8 +34,6 @@
#include <vcl/salwtype.hxx>
#include <wincomp.hxx>
-#include "osl/module.h"
-
#include <set> // for hMenu validation
#include <map>
@@ -49,8 +47,6 @@ class Font;
struct HDCCache;
struct TempFontItem;
-typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(BOOL*);
-
// --------------------
// - Standard-Defines -
// --------------------
@@ -84,12 +80,12 @@ public:
// native widget framework
void initNWF();
void deInitNWF();
-
+
// fill maVKMap;
void initKeyCodeMap();
-
+
// checks if the menuhandle was created by VCL
- sal_Bool IsKnownMenuHandle( HMENU hMenu );
+ BOOL IsKnownMenuHandle( HMENU hMenu );
public:
HINSTANCE mhInst; // default instance handle
@@ -102,12 +98,12 @@ public:
long* mpDitherDiff; // Dither mapping table
BYTE* mpDitherLow; // Dither mapping table
BYTE* mpDitherHigh; // Dither mapping table
- sal_uLong mnTimerMS; // Current Time (in MS) of the Timer
- sal_uLong mnTimerOrgMS; // Current Original Time (in MS)
- DWORD mnNextTimerTime;
- DWORD mnLastEventTime;
+ ULONG mnTimerMS; // Current Time (in MS) of the Timer
+ ULONG mnTimerOrgMS; // Current Original Time (in MS)
+ DWORD mnNextTimerTime;
+ DWORD mnLastEventTime;
UINT mnTimerId; // windows timer id
- sal_Bool mbInTimerProc; // timer event is currently being dispatched
+ 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
@@ -123,28 +119,25 @@ public:
COLORREF maStockBrushColorAry[MAX_STOCKBRUSH];
HPEN mhStockPenAry[MAX_STOCKPEN];
HBRUSH mhStockBrushAry[MAX_STOCKBRUSH];
- sal_uInt16 mnStockPenCount; // count of static pens
- sal_uInt16 mnStockBrushCount; // count of static brushes
+ USHORT mnStockPenCount; // count of static pens
+ USHORT mnStockBrushCount; // count of static brushes
WPARAM mnSalObjWantKeyEvt; // KeyEvent, welcher vom SalObj-Hook verarbeitet werden soll
BYTE mnCacheDCInUse; // count of CacheDC in use
- sal_Bool mbObjClassInit; // is SALOBJECTCLASS initialised
- sal_Bool mbInPalChange; // is in WM_QUERYNEWPALETTE
+ BOOL mbObjClassInit; // is SALOBJECTCLASS initialised
+ BOOL mbInPalChange; // is in WM_QUERYNEWPALETTE
DWORD mnAppThreadId; // Id from Applikation-Thread
- BOOL mbScrSvrEnabled; // ScreenSaver enabled
+ WIN_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;
- sal_Bool mbThemeChanged; // true if visual theme was changed: throw away theme handles
- sal_Bool mbThemeMenuSupport;
-
+ BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles
+
// 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,sal_uInt16 > maVKMap; // map some dynamic VK_* entries
- oslModule maDwmLib;
- DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
+ std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries
};
inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
@@ -161,8 +154,11 @@ struct SalShlData
UINT mnWheelScrollLines; // WheelScrollLines
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
- BOOL mbWXP; // Windows XP
- BOOL mbWPrinter; // true: use unicode printer functions
+ WORD mnVersion; // System-Version (311 == 3.11)
+ WIN_BOOL mbWNT; // kein W16/W95/W98 sondern ein NT
+ WIN_BOOL mbW40; // Is System-Version >= 4.0
+ WIN_BOOL mbWXP; // Windows XP
+ WIN_BOOL mbWPrinter; // true: use unicode printer functions
// false: use anis compat printer functions
OSVERSIONINFO maVersionInfo;
};
@@ -189,8 +185,8 @@ struct HDCCache
};
void ImplClearHDCCache( SalData* pData );
-HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp = 0 );
-void ImplReleaseCachedDC( sal_uLong nID );
+HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp = 0 );
+void ImplReleaseCachedDC( ULONG nID );
bool ImplAddTempFont( SalData&, const String& rFontFileURL );
void ImplReleaseTempFonts( SalData& );
@@ -201,7 +197,7 @@ void ImplReleaseTempFonts( SalData& );
HCURSOR ImplLoadSalCursor( int nId );
HBITMAP ImplLoadSalBitmap( int nId );
-sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
+BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
// SALGDI.CXX
void ImplInitSalGDI();
@@ -213,12 +209,11 @@ void ImplFreeSalGDI();
// \\WIN\SOURCE\APP\SALINST.CXX
void ImplSalYieldMutexAcquireWithWait();
-sal_Bool ImplSalYieldMutexTryToAcquire();
+BOOL ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
-sal_uLong ImplSalReleaseYieldMutex();
-void ImplSalAcquireYieldMutex( sal_uLong nCount );
-sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg );
+ULONG ImplSalReleaseYieldMutex();
+void ImplSalAcquireYieldMutex( ULONG nCount );
// \\WIN\SOURCE\WINDOW\SALFRAME.CXX
LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
@@ -229,16 +224,16 @@ void CALLBACK SalTimerProc( HWND hWnd, UINT nMsg, UINT_PTR nId, DWORD nTime )
// \WIN\SOURCE\WINDOW\SALFRAME.CXX
void SalTestMouseLeave();
-sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall );
+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 );
-sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
+BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
// \WIN\SOURCE\WINDOW\SALOBJ.CXX
WinSalObject* ImplFindSalObject( HWND hWndChild );
-sal_Bool ImplSalPreDispatchMsg( MSG* pMsg );
+BOOL ImplSalPreDispatchMsg( MSG* pMsg );
void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
// \WIN\SOURCE\GDI\SALGDI3.CXX
@@ -248,7 +243,7 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName );
// \WIN\SOURCE\APP\SALDATA.CXX
rtl_TextEncoding ImplSalGetSystemEncoding();
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName = FALSE );
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName = FALSE );
UniString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen = STRING_LEN );
int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
@@ -298,7 +293,7 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
#define SAL_MSG_RECREATEHWND (WM_USER+122)
// wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd
#define SAL_MSG_RECREATECHILDHWND (WM_USER+123)
-// wParam == 0; lParam == HWND;
+// wParam == 0; lParam == HWND;
#define SAL_MSG_DESTROYHWND (WM_USER+124)
// wParam == 0; lParam == pData
@@ -347,30 +342,32 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
// -----------------
// A/W-Wrapper
-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 ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong );
+LONG ImplGetWindowLong( HWND hWnd, int nIndex );
+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 );
LONG ImplDispatchMessage( CONST MSG *lpMsg );
inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis )
{
- SetWindowLongPtr( hWnd, SAL_FRAME_THIS, (LONG_PTR)pThis );
+ ImplSetWindowLong( hWnd, SAL_FRAME_THIS, (LONG)pThis );
}
inline WinSalFrame* GetWindowPtr( HWND hWnd )
{
- return (WinSalFrame*)GetWindowLongPtrW( hWnd, SAL_FRAME_THIS );
+ return (WinSalFrame*)ImplGetWindowLong( hWnd, SAL_FRAME_THIS );
}
inline void SetSalObjWindowPtr( HWND hWnd, WinSalObject* pThis )
{
- SetWindowLongPtr( hWnd, SAL_OBJECT_THIS, (LONG_PTR)pThis );
+ ImplSetWindowLong( hWnd, SAL_OBJECT_THIS, (LONG)pThis );
}
inline WinSalObject* GetSalObjWindowPtr( HWND hWnd )
{
- return (WinSalObject*)GetWindowLongPtr( hWnd, SAL_OBJECT_THIS );
+ return (WinSalObject*)ImplGetWindowLong( hWnd, SAL_OBJECT_THIS );
}
#endif // _SV_SALDATA_HXX
diff --git a/vcl/win/inc/salframe.h b/vcl/win/inc/salframe.h
index d3e7516f17f3..3db21220e158 100644
--- a/vcl/win/inc/salframe.h
+++ b/vcl/win/inc/salframe.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -63,90 +63,90 @@ public:
int mnFullScreenShowState; // fullscreen restore show state
UINT mnInputLang; // current Input Language
UINT mnInputCodePage; // current Input CodePage
- 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
-
+ 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
+
RGNDATA* mpClipRgnData;
RECT* mpNextClipRect;
- sal_Bool mbFirstClipRect;
- sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor
+ BOOL mbFirstClipRect;
+ sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor
void updateScreenNumber();
public:
WinSalFrame();
virtual ~WinSalFrame();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool PostEvent( void* pData );
- virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( sal_uInt16 nIcon );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual BOOL PostEvent( void* pData );
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT nIcon );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = FALSE );
- virtual void Enable( sal_Bool bEnable );
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( 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, 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 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( sal_Bool bMouse );
- virtual void SetPointerPos( long nX, long nY );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT 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 void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( 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( 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 );
- virtual void Beep( SoundType eSoundType );
- virtual const SystemEnvData* GetSystemData() const;
- virtual SalPointerState GetPointerState();
+ 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 LanguageType GetInputLanguage();
+ virtual SalBitmap* SnapShot();
+ virtual void UpdateSettings( AllSettings& rSettings );
+ virtual void Beep( SoundType eSoundType );
+ virtual const SystemEnvData* GetSystemData() const;
+ virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
- virtual void SetParent( SalFrame* pNewParent );
- virtual bool SetPluginParent( SystemParentData* pNewParent );
+ virtual void SimulateKeyPress( USHORT 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( sal_uIntPtr nRects );
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual void EndSetClipRegion();
+ virtual void ResetClipRegion();
+ virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
+ virtual void EndSetClipRegion();
};
void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect );
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index a23963f81e7b..0ba816c23b22 100644
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -34,14 +34,9 @@
#include <vcl/salgdi.hxx>
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
-#include <vcl/fontcapabilities.hxx>
#include "boost/scoped_ptr.hpp"
-#include <boost/unordered_set.hpp>
-
-#ifdef ENABLE_GRAPHITE
-#include <graphite2/Font.h>
-#endif
+#include <hash_set>
class ImplFontSelectData;
class ImplWinFontEntry;
@@ -51,42 +46,22 @@ class ImplFontAttrCache;
// - Defines -
// -----------
-#define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000)
-#define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff)
+#define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000)
+#define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff)
// win32 platform specific options. Move them to the PMK file?
#define GCP_KERN_HACK
#define GNG_VERT_HACK
-#ifdef ENABLE_GRAPHITE
-class RawFontData;
-class GrFontData
-{
-public:
- GrFontData(HDC hDC);
- ~GrFontData();
- const void * getTable(unsigned int name, size_t *len) const;
- const gr_face * getFace() const { return mpFace; }
- void AddReference() { ++mnRefCount; }
- void DeReference() { if (--mnRefCount == 0) delete this; }
-private:
- GrFontData(GrFontData &) {};
- HDC mhDC;
- mutable std::vector<RawFontData*> mvData;
- gr_face * mpFace;
- unsigned int mnRefCount;
-};
-#endif
-
// win32 specific physically available font face
class ImplWinFontData : public ImplFontData
{
public:
- explicit ImplWinFontData( const ImplDevFontAttributes&,
- int nFontHeight, BYTE eWinCharSet,
- BYTE nPitchAndFamily );
- virtual ~ImplWinFontData();
+ ImplWinFontData( const ImplDevFontAttributes&,
+ int nFontHeight, WIN_BYTE eWinCharSet,
+ WIN_BYTE nPitchAndFamily );
+ ~ImplWinFontData();
virtual ImplFontData* Clone() const;
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
@@ -96,8 +71,8 @@ public:
bool HasChar( sal_uInt32 cChar ) const;
- BYTE GetCharSet() const { return meWinCharSet; }
- BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
+ WIN_BYTE GetCharSet() const { return meWinCharSet; }
+ WIN_BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; }
bool SupportsKorean() const { return mbHasKoreanRange; }
bool SupportsCJK() const { return mbHasCJKSupport; }
@@ -106,11 +81,9 @@ public:
bool AliasSymbolsLow() const { return mbAliasSymbolsLow; }
#ifdef ENABLE_GRAPHITE
bool SupportsGraphite() const { return mbHasGraphiteSupport; }
- const gr_face* GraphiteFace() const;
#endif
- const ImplFontCharMap* GetImplFontCharMap() const;
- bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
+ ImplFontCharMap* GetImplFontCharMap() const;
const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
{
@@ -126,30 +99,27 @@ private:
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
#ifdef ENABLE_GRAPHITE
- mutable GrFontData* mpGraphiteData;
mutable bool mbHasGraphiteSupport;
#endif
mutable bool mbHasArabicSupport;
- mutable bool mbFontCapabilitiesRead;
mutable ImplFontCharMap* mpUnicodeMap;
mutable const Ucs2SIntMap* mpEncodingVector;
- mutable vcl::FontCapabilities maFontCapabilities;
// 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
- BYTE meWinCharSet;
- BYTE mnPitchAndFamily;
+ WIN_BYTE meWinCharSet;
+ WIN_BYTE mnPitchAndFamily;
bool mbAliasSymbolsHigh;
bool mbAliasSymbolsLow;
private:
void ReadCmapTable( HDC ) const;
- void GetFontCapabilities( HDC hDC ) const;
+ void ReadOs2Table( HDC ) const;
#ifdef GNG_VERT_HACK
void ReadGsubTable( HDC ) const;
- typedef boost::unordered_set<sal_UCS4> UcsHashSet;
+ typedef std::hash_set<sal_UCS4> UcsHashSet;
mutable UcsHashSet maGsubTable;
mutable bool mbGsubRead;
public:
@@ -158,49 +128,50 @@ public:
#endif // GNG_VERT_HACK
};
-// ------------------
-// - WinSalGraphics -
-// ------------------
+// -------------------
+// - SalGraphicsData -
+// -------------------
class WinSalGraphics : public SalGraphics
{
public:
- HDC mhDC; // HDC
- HWND mhWnd; // Window-Handle, when Window-Graphics
- HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
+ HDC mhDC; // HDC
+ HWND mhWnd; // Window-Handle, when Window-Graphics
+ HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face
ImplWinFontEntry* mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
- float mfFontScale[ MAX_FALLBACK ]; // allows metrics emulation of huge font sizes
- float mfCurrentFontScale;
- HPEN mhPen; // Pen
- HBRUSH mhBrush; // Brush
- HRGN mhRegion; // Region Handle
- HPEN mhDefPen; // DefaultPen
- HBRUSH mhDefBrush; // DefaultBrush
- HFONT mhDefFont; // DefaultFont
- HPALETTE mhDefPal; // DefaultPalette
- COLORREF mnPenColor; // PenColor
- COLORREF mnBrushColor; // BrushColor
- COLORREF mnTextColor; // TextColor
- RGNDATA* mpClipRgnData; // ClipRegion-Data
- RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
- 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
- sal_Bool mbFontKernInit; // FALSE: FontKerns must be queried
- KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
- sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font
- int mnPenWidth; // Linienbreite
- 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
+ float mfFontScale; // allows metrics emulation of huge font sizes
+ HPEN mhPen; // Pen
+ HBRUSH mhBrush; // Brush
+ HRGN mhRegion; // Region Handle
+ HPEN mhDefPen; // DefaultPen
+ HBRUSH mhDefBrush; // DefaultBrush
+ HFONT mhDefFont; // DefaultFont
+ HPALETTE mhDefPal; // DefaultPalette
+ COLORREF mnPenColor; // PenColor
+ COLORREF mnBrushColor; // BrushColor
+ 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
+ KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
+ ULONG 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
+ bool mbXORMode; // _every_ output with RasterOp XOR
// remember RGB values for SetLineColor/SetFillColor
SalColor maLineColor;
@@ -209,117 +180,121 @@ public:
HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
public:
- explicit WinSalGraphics();
+ WinSalGraphics();
virtual ~WinSalGraphics();
protected:
- virtual bool setClipRegion( const Region& );
+ 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 );
- 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( 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 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( 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( 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 );
+ 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( 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, sal_uInt16 nFlags );
+ virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
+ long nSrcHeight, USHORT nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
+ virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
+ virtual void drawBitmap( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
+ virtual void drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor );
- virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
- virtual SalColor getPixel( long nX, long nY );
+ virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
+ virtual SalColor getPixel( long nX, long nY );
// invert --> ClipRegion (only Windows or VirDevs)
- virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
+ virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
+ virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
// native widget rendering methods that require mirroring
- 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,
+ 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,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
- virtual bool drawAlphaBitmap( const SalTwoRect&,
+ virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap );
- virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
+ virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
public:
// public SalGraphics methods, the interface to teh independent vcl part
// get device resolution
- virtual void GetResolution( long& rDPIX, long& rDPIY );
+ virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual sal_uInt16 GetBitCount() const;
+ virtual USHORT GetBitCount();
// get the width of the device
- virtual long GetGraphicsWidth() const;
+ virtual long GetGraphicsWidth() const;
// set the clip region to empty
- virtual void ResetClipRegion();
+ 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();
+ virtual void SetLineColor();
// set the line color to a specific color
- virtual void SetLineColor( SalColor nSalColor );
+ virtual void SetLineColor( SalColor nSalColor );
// set the fill color to transparent (= don't fill)
- virtual void SetFillColor();
+ virtual void SetFillColor();
// set the fill color to a specific color, shapes will be
// filled accordingly
- virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetFillColor( SalColor nSalColor );
// enable/disable XOR drawing
- virtual void SetXORMode( bool bSet, bool );
+ virtual void SetXORMode( bool bSet, bool );
// set line color for raster operations
- virtual void SetROPLineColor( SalROPColor nROPColor );
+ virtual void SetROPLineColor( SalROPColor nROPColor );
// set fill color for raster operations
- virtual void SetROPFillColor( SalROPColor nROPColor );
+ virtual void SetROPFillColor( SalROPColor nROPColor );
// set the text color to a specific color
- virtual void SetTextColor( SalColor nSalColor );
+ virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual const ImplFontCharMap* GetImplFontCharMap() const;
- // get the layout capabilities of the current font
- virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const;
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
// graphics must fill supplied font list
- virtual void GetDevFontList( ImplDevFontList* );
+ virtual void GetDevFontList( ImplDevFontList* );
// graphics should call ImplAddDevFontSubstitute on supplied
// OutputDevice for all its device specific preferred font substitutions
- virtual void GetDevFontSubstList( OutputDevice* );
- virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
+ virtual void GetDevFontSubstList( OutputDevice* );
+ virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
// 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
@@ -332,7 +307,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
+ virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -357,46 +332,46 @@ public:
// pWidths MUST support at least 256 members;
// rInfo: additional outgoing information
// pDataLen: out parameter, contains the byte length of the returned buffer
- virtual const void* GetEmbedFontData( const ImplFontData*,
+ virtual const void* GetEmbedFontData( const ImplFontData*,
const sal_Ucs* pUnicodes,
sal_Int32* pWidths,
FontSubsetInfo& rInfo,
long* pDataLen );
// frees the font data again
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
+ virtual void FreeEmbedFontData( const void* pData, long nDataLen );
virtual void GetGlyphWidths( const ImplFontData*,
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
virtual int GetMinKashidaWidth();
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
- virtual void DrawServerFontLayout( const ServerFontLayout& );
+ virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
// Init/Deinit Graphics
-void ImplSalInitGraphics( WinSalGraphics* );
-void ImplSalDeInitGraphics( WinSalGraphics* );
-void ImplUpdateSysColorEntries();
-int ImplIsSysColorEntry( SalColor nSalColor );
-void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
+void ImplSalInitGraphics( WinSalGraphics* mpData );
+void ImplSalDeInitGraphics( WinSalGraphics* mpData );
+void ImplUpdateSysColorEntries();
+int ImplIsSysColorEntry( SalColor nSalColor );
+void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*,
LOGFONTW&, bool bTestVerticalAvail );
// -----------
// - Defines -
// -----------
-#define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
+#define MAX_64KSALPOINTS ((((USHORT)0xFFFF)-8)/sizeof(POINTS))
// -----------
// - Inlines -
@@ -423,8 +398,6 @@ 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/salids.hrc b/vcl/win/inc/salids.hrc
index 3049f11b551b..dace5ce658be 100644
--- a/vcl/win/inc/salids.hrc
+++ b/vcl/win/inc/salids.hrc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -29,83 +29,83 @@
#define _SV_SALIDS_HRC
// Cursor
-#define SAL_RESID_POINTER_NULL 10000
+#define SAL_RESID_POINTER_NULL 10000
#ifndef W40ONLY
-#define SAL_RESID_POINTER_HELP 10001
+#define SAL_RESID_POINTER_HELP 10001
#endif
#ifndef WNT
-#define SAL_RESID_POINTER_HSIZE 10002
-#define SAL_RESID_POINTER_VSIZE 10003
-#define SAL_RESID_POINTER_NESWSIZE 10004
-#define SAL_RESID_POINTER_NWSESIZE 10005
+#define SAL_RESID_POINTER_HSIZE 10002
+#define SAL_RESID_POINTER_VSIZE 10003
+#define SAL_RESID_POINTER_NESWSIZE 10004
+#define SAL_RESID_POINTER_NWSESIZE 10005
#endif
-#define SAL_RESID_POINTER_CROSS 10006
-#define SAL_RESID_POINTER_MOVE 10007
-#define SAL_RESID_POINTER_HSPLIT 10008
-#define SAL_RESID_POINTER_VSPLIT 10009
-#define SAL_RESID_POINTER_HSIZEBAR 10010
-#define SAL_RESID_POINTER_VSIZEBAR 10011
-#define SAL_RESID_POINTER_HAND 10012
-#define SAL_RESID_POINTER_REFHAND 10013
-#define SAL_RESID_POINTER_PEN 10014
-#define SAL_RESID_POINTER_MAGNIFY 10015
-#define SAL_RESID_POINTER_FILL 10016
-#define SAL_RESID_POINTER_ROTATE 10017
-#define SAL_RESID_POINTER_HSHEAR 10018
-#define SAL_RESID_POINTER_VSHEAR 10019
-#define SAL_RESID_POINTER_MIRROR 10020
-#define SAL_RESID_POINTER_CROOK 10021
-#define SAL_RESID_POINTER_CROP 10022
-#define SAL_RESID_POINTER_MOVEPOINT 10023
-#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10024
-#define SAL_RESID_POINTER_MOVEDATA 10025
-#define SAL_RESID_POINTER_COPYDATA 10026
-#define SAL_RESID_POINTER_LINKDATA 10027
-#define SAL_RESID_POINTER_MOVEDATALINK 10028
-#define SAL_RESID_POINTER_COPYDATALINK 10029
-#define SAL_RESID_POINTER_MOVEFILE 10030
-#define SAL_RESID_POINTER_COPYFILE 10031
-#define SAL_RESID_POINTER_LINKFILE 10032
-#define SAL_RESID_POINTER_MOVEFILELINK 10033
-#define SAL_RESID_POINTER_COPYFILELINK 10034
-#define SAL_RESID_POINTER_MOVEFILES 10035
-#define SAL_RESID_POINTER_COPYFILES 10036
-#define SAL_RESID_POINTER_NOTALLOWED 10037
-#define SAL_RESID_POINTER_DRAW_LINE 10038
-#define SAL_RESID_POINTER_DRAW_RECT 10039
-#define SAL_RESID_POINTER_DRAW_POLYGON 10040
-#define SAL_RESID_POINTER_DRAW_BEZIER 10041
-#define SAL_RESID_POINTER_DRAW_ARC 10042
-#define SAL_RESID_POINTER_DRAW_PIE 10043
-#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10044
-#define SAL_RESID_POINTER_DRAW_ELLIPSE 10045
-#define SAL_RESID_POINTER_DRAW_FREEHAND 10046
-#define SAL_RESID_POINTER_DRAW_CONNECT 10047
-#define SAL_RESID_POINTER_DRAW_TEXT 10048
-#define SAL_RESID_POINTER_DRAW_CAPTION 10049
+#define SAL_RESID_POINTER_CROSS 10006
+#define SAL_RESID_POINTER_MOVE 10007
+#define SAL_RESID_POINTER_HSPLIT 10008
+#define SAL_RESID_POINTER_VSPLIT 10009
+#define SAL_RESID_POINTER_HSIZEBAR 10010
+#define SAL_RESID_POINTER_VSIZEBAR 10011
+#define SAL_RESID_POINTER_HAND 10012
+#define SAL_RESID_POINTER_REFHAND 10013
+#define SAL_RESID_POINTER_PEN 10014
+#define SAL_RESID_POINTER_MAGNIFY 10015
+#define SAL_RESID_POINTER_FILL 10016
+#define SAL_RESID_POINTER_ROTATE 10017
+#define SAL_RESID_POINTER_HSHEAR 10018
+#define SAL_RESID_POINTER_VSHEAR 10019
+#define SAL_RESID_POINTER_MIRROR 10020
+#define SAL_RESID_POINTER_CROOK 10021
+#define SAL_RESID_POINTER_CROP 10022
+#define SAL_RESID_POINTER_MOVEPOINT 10023
+#define SAL_RESID_POINTER_MOVEBEZIERWEIGHT 10024
+#define SAL_RESID_POINTER_MOVEDATA 10025
+#define SAL_RESID_POINTER_COPYDATA 10026
+#define SAL_RESID_POINTER_LINKDATA 10027
+#define SAL_RESID_POINTER_MOVEDATALINK 10028
+#define SAL_RESID_POINTER_COPYDATALINK 10029
+#define SAL_RESID_POINTER_MOVEFILE 10030
+#define SAL_RESID_POINTER_COPYFILE 10031
+#define SAL_RESID_POINTER_LINKFILE 10032
+#define SAL_RESID_POINTER_MOVEFILELINK 10033
+#define SAL_RESID_POINTER_COPYFILELINK 10034
+#define SAL_RESID_POINTER_MOVEFILES 10035
+#define SAL_RESID_POINTER_COPYFILES 10036
+#define SAL_RESID_POINTER_NOTALLOWED 10037
+#define SAL_RESID_POINTER_DRAW_LINE 10038
+#define SAL_RESID_POINTER_DRAW_RECT 10039
+#define SAL_RESID_POINTER_DRAW_POLYGON 10040
+#define SAL_RESID_POINTER_DRAW_BEZIER 10041
+#define SAL_RESID_POINTER_DRAW_ARC 10042
+#define SAL_RESID_POINTER_DRAW_PIE 10043
+#define SAL_RESID_POINTER_DRAW_CIRCLECUT 10044
+#define SAL_RESID_POINTER_DRAW_ELLIPSE 10045
+#define SAL_RESID_POINTER_DRAW_FREEHAND 10046
+#define SAL_RESID_POINTER_DRAW_CONNECT 10047
+#define SAL_RESID_POINTER_DRAW_TEXT 10048
+#define SAL_RESID_POINTER_DRAW_CAPTION 10049
#define SAL_RESID_POINTER_CHART 10050
-#define SAL_RESID_POINTER_DETECTIVE 10051
-#define SAL_RESID_POINTER_PIVOT_COL 10052
-#define SAL_RESID_POINTER_PIVOT_ROW 10053
-#define SAL_RESID_POINTER_PIVOT_FIELD 10054
+#define SAL_RESID_POINTER_DETECTIVE 10051
+#define SAL_RESID_POINTER_PIVOT_COL 10052
+#define SAL_RESID_POINTER_PIVOT_ROW 10053
+#define SAL_RESID_POINTER_PIVOT_FIELD 10054
#define SAL_RESID_POINTER_CHAIN 10055
-#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10056
-#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10057
-#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10058
-#define SAL_RESID_POINTER_AUTOSCROLL_N 10059
-#define SAL_RESID_POINTER_AUTOSCROLL_S 10060
-#define SAL_RESID_POINTER_AUTOSCROLL_W 10061
-#define SAL_RESID_POINTER_AUTOSCROLL_E 10062
-#define SAL_RESID_POINTER_AUTOSCROLL_NW 10063
-#define SAL_RESID_POINTER_AUTOSCROLL_NE 10064
-#define SAL_RESID_POINTER_AUTOSCROLL_SW 10065
-#define SAL_RESID_POINTER_AUTOSCROLL_SE 10066
-#define SAL_RESID_POINTER_AUTOSCROLL_NS 10067
-#define SAL_RESID_POINTER_AUTOSCROLL_WE 10068
-#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10069
+#define SAL_RESID_POINTER_CHAIN_NOTALLOWED 10056
+#define SAL_RESID_POINTER_TIMEEVENT_MOVE 10057
+#define SAL_RESID_POINTER_TIMEEVENT_SIZE 10058
+#define SAL_RESID_POINTER_AUTOSCROLL_N 10059
+#define SAL_RESID_POINTER_AUTOSCROLL_S 10060
+#define SAL_RESID_POINTER_AUTOSCROLL_W 10061
+#define SAL_RESID_POINTER_AUTOSCROLL_E 10062
+#define SAL_RESID_POINTER_AUTOSCROLL_NW 10063
+#define SAL_RESID_POINTER_AUTOSCROLL_NE 10064
+#define SAL_RESID_POINTER_AUTOSCROLL_SW 10065
+#define SAL_RESID_POINTER_AUTOSCROLL_SE 10066
+#define SAL_RESID_POINTER_AUTOSCROLL_NS 10067
+#define SAL_RESID_POINTER_AUTOSCROLL_WE 10068
+#define SAL_RESID_POINTER_AUTOSCROLL_NSWE 10069
#define SAL_RESID_POINTER_AIRBRUSH 10070
-#define SAL_RESID_POINTER_TEXT_VERTICAL 10071
-#define SAL_RESID_POINTER_PIVOT_DELETE 10072
+#define SAL_RESID_POINTER_TEXT_VERTICAL 10071
+#define SAL_RESID_POINTER_PIVOT_DELETE 10072
#define SAL_RESID_POINTER_TAB_SELECT_S 10073
#define SAL_RESID_POINTER_TAB_SELECT_E 10074
#define SAL_RESID_POINTER_TAB_SELECT_SE 10075
@@ -115,6 +115,6 @@
#define SAL_RESID_BITMAP_50 11000
-#define SAL_RESID_ICON_DEFAULT 1
+#define SAL_RESID_ICON_DEFAULT 1
#endif // _SV_SALIDS_HRC
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h
index 524cf3aca141..515cb1b40cca 100644
--- a/vcl/win/inc/salinst.h
+++ b/vcl/win/inc/salinst.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,51 +41,49 @@ class SalYieldMutex;
class WinSalInstance : public SalInstance
{
public:
- HINSTANCE mhInst; // Instance Handle
- HWND mhComWnd; // window, for communication (between threads and the main thread)
- SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
- osl::Mutex* mpSalWaitMutex; // Sal-Wait-Mutex
- sal_uInt16 mnYieldWaitCount; // Wait-Count
+ HINSTANCE mhInst; // Instance Handle
+ 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
public:
WinSalInstance();
virtual ~WinSalInstance();
- 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, sal_Bool bShow = sal_True );
- virtual void DestroyObject( SalObject* pObject );
- virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual void DestroyFrame( SalFrame* pFrame );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual void DestroyObject( SalObject* pObject );
+ virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData );
- virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
+ USHORT nBitCount, const SystemGraphicsData *pData );
+ virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
+ virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
+ virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter( SalPrinter* pPrinter );
+ virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
virtual String GetDefaultPrinter();
- virtual SalTimer* CreateSalTimer();
- virtual SalI18NImeStatus* CreateI18NImeStatus();
- virtual SalSystem* CreateSalSystem();
- virtual SalBitmap* CreateSalBitmap();
+ virtual SalTimer* CreateSalTimer();
+ virtual SalI18NImeStatus* CreateI18NImeStatus();
+ virtual SalSystem* CreateSalSystem();
+ virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual sal_uIntPtr ReleaseYieldMutex();
- virtual void AcquireYieldMutex( sal_uIntPtr nCount );
- virtual bool CheckYieldMutex();
-
- virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( sal_uInt16 nType );
- virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* );
- virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* );
+ virtual ULONG ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( ULONG nCount );
+ virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
+ 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* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo);
@@ -95,10 +93,10 @@ public:
// - Prototypen -
// --------------
-SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, sal_uIntPtr nSalFrameStyle );
+SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent );
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild );
-void ImplSalStartTimer( sal_uIntPtr nMS, sal_Bool bMutex = sal_False );
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild );
+void ImplSalStartTimer( ULONG nMS, BOOL bMutex = FALSE );
void ImplSalPrinterAbortJobAsync( HDC hPrnDC );
#endif // _SV_SALINST_H
diff --git a/vcl/win/inc/salmenu.h b/vcl/win/inc/salmenu.h
index 59160dc8a8bc..5fce0ffc5f68 100644
--- a/vcl/win/inc/salmenu.h
+++ b/vcl/win/inc/salmenu.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,22 +39,22 @@ class WinSalMenu : public SalMenu
public:
WinSalMenu();
virtual ~WinSalMenu();
- virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual 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, sal_Bool bCheck );
- virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
+ virtual void CheckItem( unsigned nPos, BOOL bCheck );
+ virtual void EnableItem( unsigned nPos, 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
- sal_Bool mbMenuBar; // true for menu bars
+ 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/salnativewidgets.h b/vcl/win/inc/salnativewidgets.h
index 515a4b44d02c..021c213028a9 100644
--- a/vcl/win/inc/salnativewidgets.h
+++ b/vcl/win/inc/salnativewidgets.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -35,7 +35,7 @@
#include <vcl/sv.h>
/* SalControlHandleData:
- *
+ *
* Holds platform specific theming data.
*/
@@ -50,7 +50,7 @@ class SalControlHandleData
};
-#endif /* __cplusplus */
+#endif /* __cplusplus */
#endif
diff --git a/vcl/win/inc/salobj.h b/vcl/win/inc/salobj.h
index d96b5f4a93df..168ec95fbec0 100644
--- a/vcl/win/inc/salobj.h
+++ b/vcl/win/inc/salobj.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -39,34 +39,32 @@
class WinSalObject : public SalObject
{
public:
- HWND mhWnd; // Window handle
- HWND mhWndChild; // Child Window handle
- HWND mhLastFocusWnd; // Child-Window, welches als letztes den Focus hatte
- SystemChildData maSysData; // SystemEnvData
- RGNDATA* mpClipRgnData; // ClipRegion-Data
- RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
- RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- 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
+ HWND mhWnd; // Window handle
+ HWND mhWndChild; // Child Window handle
+ HWND mhLastFocusWnd; // Child-Window, welches als letztes den Focus hatte
+ SystemChildData maSysData; // SystemEnvData
+ RGNDATA* mpClipRgnData; // ClipRegion-Data
+ RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
+ RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
+ BOOL mbFirstClipRect; // Flag for first cliprect to insert
+ WinSalObject* mpNextObject; // pointer to next object
WinSalObject();
virtual ~WinSalObject();
- virtual void ResetClipRegion();
- 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( 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 );
+ virtual void ResetClipRegion();
+ virtual USHORT GetClipRegionType();
+ virtual void BeginSetClipRegion( 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 GrabFocus();
+ virtual void SetBackground();
+ virtual void SetBackground( SalColor nSalColor );
+ virtual const SystemEnvData* GetSystemData() const;
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/win/inc/salprn.h b/vcl/win/inc/salprn.h
index 123af2f79a90..deea9d17e338 100644
--- a/vcl/win/inc/salprn.h
+++ b/vcl/win/inc/salprn.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,18 +37,18 @@
// -----------------
// WNT3
-#define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
-#define SAL_DRIVERDATA_VERSION_A 1
+#define SAL_DRIVERDATA_SYSSIGN ((ULONG)0x574E5433)
+#define SAL_DRIVERDATA_VERSION_A 1
#define SAL_DRIVERDATA_VERSION_W 2
#pragma pack( 1 )
struct SalDriverData
{
- sal_uIntPtr mnSysSignature;
- sal_uInt16 mnVersion;
- sal_uInt16 mnDriverOffset;
- BYTE maDriverData[1];
+ ULONG mnSysSignature;
+ USHORT mnVersion;
+ USHORT mnDriverOffset;
+ BYTE maDriverData[1];
};
#pragma pack()
@@ -62,30 +62,30 @@ class WinSalGraphics;
class WinSalInfoPrinter : public SalInfoPrinter
{
public:
- WinSalGraphics* mpGraphics; // current Printer graphics
- XubString maDriverName; // printer driver name
- XubString maDeviceName; // printer device name
- XubString maPortName; // printer port name
- HDC mhDC; // printer hdc
- sal_Bool mbGraphics; // is Graphics used
+ WinSalGraphics* mpGraphics; // current Printer graphics
+ XubString maDriverName; // printer driver name
+ XubString maDeviceName; // printer device name
+ XubString maPortName; // printer port name
+ HDC mhDC; // printer hdc
+ BOOL mbGraphics; // is Graphics used
public:
WinSalInfoPrinter();
virtual ~WinSalInfoPrinter();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- 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,
+ 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 void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- 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 );
+ virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
+ virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
+ virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
// -----------------
@@ -95,34 +95,34 @@ public:
class WinSalPrinter : public SalPrinter
{
public:
- WinSalGraphics* mpGraphics; // current Printer graphics
- WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
- WinSalPrinter* mpNextPrinter; // next printing printer
- HDC mhDC; // printer hdc
- sal_uIntPtr mnError; // Error Code
- sal_uIntPtr mnCopies; // Kopien
- sal_Bool mbCollate; // Sortierte Kopien
- sal_Bool mbAbort; // Job Aborted
+ WinSalGraphics* mpGraphics; // current Printer graphics
+ 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
bool mbValid;
-
+
public:
WinSalPrinter();
virtual ~WinSalPrinter();
using SalPrinter::StartJob;
- virtual sal_Bool StartJob( const XubString* pFileName,
+ virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- sal_uIntPtr nCopies,
+ ULONG nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- virtual sal_Bool EndJob();
- virtual sal_Bool AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
- virtual sal_Bool EndPage();
- virtual sal_uIntPtr GetErrorCode();
+ virtual BOOL EndJob();
+ virtual BOOL AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
+ virtual BOOL EndPage();
+ virtual ULONG GetErrorCode();
void markInvalid();
bool isValid() const { return mbValid; }
diff --git a/vcl/win/inc/salsys.h b/vcl/win/inc/salsys.h
index 806c6b9df812..cc9b1ea4d328 100644
--- a/vcl/win/inc/salsys.h
+++ b/vcl/win/inc/salsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@ class WinSalSystem : public SalSystem
Rectangle m_aArea;
Rectangle m_aWorkArea;
sal_Int32 m_nStateFlags;
-
+
DisplayMonitor() : m_nStateFlags( 0 ) {}
DisplayMonitor( const rtl::OUString& rName,
const rtl::OUString& rDevName,
@@ -83,8 +83,8 @@ public:
void clearMonitors();
const std::vector<DisplayMonitor>& getMonitors()
{ initMonitors(); return m_aMonitors;}
-
- sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
+
+ 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 41839ad2f0c2..db062224d32f 100644
--- a/vcl/win/inc/saltimer.h
+++ b/vcl/win/inc/saltimer.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -38,8 +38,8 @@ public:
virtual ~WinSalTimer();
// overload all pure virtual methods
- void Start( sal_uIntPtr nMS );
- void Stop();
+ void Start( ULONG nMS );
+ void Stop();
};
#endif
diff --git a/vcl/win/inc/salvd.h b/vcl/win/inc/salvd.h
index 4e7416cf2b97..85f3599efcd0 100644
--- a/vcl/win/inc/salvd.h
+++ b/vcl/win/inc/salvd.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,22 +41,22 @@ class WinSalGraphics;
class WinSalVirtualDevice : public SalVirtualDevice
{
public:
- HDC mhDC; // HDC or 0 for Cache Device
- HBITMAP mhBmp; // Memory Bitmap
- HBITMAP mhDefBmp; // Default Bitmap
- WinSalGraphics* mpGraphics; // current VirDev graphics
- WinSalVirtualDevice* mpNext; // next VirDev
- sal_uInt16 mnBitCount; // BitCount (0 or 1)
- sal_Bool mbGraphics; // is Graphics used
- sal_Bool mbForeignDC; // uses a foreign DC instead of a bitmap
+ HDC mhDC; // HDC or 0 for Cache Device
+ HBITMAP mhBmp; // Memory Bitmap
+ 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
WinSalVirtualDevice();
virtual ~WinSalVirtualDevice();
- virtual SalGraphics* GetGraphics();
- virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual sal_Bool SetSize( long nNewDX, long nNewDY );
- virtual void GetSize( long& rWidth, long& rHeight );
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+ virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual void GetSize( long& rWidth, long& rHeight );
};
#endif // _SV_SALVD_H
diff --git a/vcl/win/inc/svsys.h b/vcl/win/inc/svsys.h
index f7bc87b0c514..9dac2d6c2189 100644
--- a/vcl/win/inc/svsys.h
+++ b/vcl/win/inc/svsys.h
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,10 +29,7 @@
#ifndef _SV_SVSYS_H
#define _SV_SVSYS_H
-#ifdef WNT
-#include <prewin.h>
-#include <postwin.h>
-#endif
+#include <tools/svwin.h>
#endif // _SV_SVSYS_H
diff --git a/vcl/win/inc/wincomp.hxx b/vcl/win/inc/wincomp.hxx
index ab399453884c..d879f7167d15 100644
--- a/vcl/win/inc/wincomp.hxx
+++ b/vcl/win/inc/wincomp.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -128,17 +128,17 @@ inline DWORD GetWindowExStyle( HWND hWnd )
return GetWindowLong( hWnd, GWL_EXSTYLE );
}
-inline BOOL IsMinimized( HWND hWnd )
+inline WIN_BOOL IsMinimized( HWND hWnd )
{
return IsIconic( hWnd );
}
-inline BOOL IsMaximized( HWND hWnd )
+inline WIN_BOOL IsMaximized( HWND hWnd )
{
return IsZoomed( hWnd );
}
-inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw )
+inline void SetWindowFont( HWND hWnd, HFONT hFont, WIN_BOOL bRedraw )
{
SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) );
}
@@ -150,37 +150,37 @@ inline HFONT GetWindowFont( HWND hWnd )
inline void SetClassCursor( HWND hWnd, HCURSOR hCursor )
{
- SetClassLongPtr( hWnd, GCLP_HCURSOR, (LONG_PTR)hCursor );
+ SetClassLong( hWnd, GCL_HCURSOR, (DWORD)hCursor );
}
inline HCURSOR GetClassCursor( HWND hWnd )
{
- return (HCURSOR)GetClassLongPtr( hWnd, GCLP_HCURSOR );
+ return (HCURSOR)GetClassLong( hWnd, GCL_HCURSOR );
}
inline void SetClassIcon( HWND hWnd, HICON hIcon )
{
- SetClassLongPtr( hWnd, GCLP_HICON, (LONG_PTR)hIcon );
+ SetClassLong( hWnd, GCL_HICON, (DWORD)hIcon );
}
inline HICON GetClassIcon( HWND hWnd )
{
- return (HICON)GetClassLongPtr( hWnd, GCLP_HICON );
+ return (HICON)GetClassLong( hWnd, GCL_HICON );
}
inline HBRUSH SetClassBrush( HWND hWnd, HBRUSH hBrush )
{
- return (HBRUSH)SetClassLongPtr( hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hBrush );
+ return (HBRUSH)SetClassLong( hWnd, GCL_HBRBACKGROUND, (DWORD)hBrush );
}
inline HBRUSH GetClassBrush( HWND hWnd )
{
- return (HBRUSH)GetClassLongPtr( hWnd, GCLP_HBRBACKGROUND );
+ return (HBRUSH)GetClassLong( hWnd, GCL_HBRBACKGROUND );
}
inline HINSTANCE GetWindowInstance( HWND hWnd )
{
- return (HINSTANCE)GetWindowLongPtr( hWnd, GWLP_HINSTANCE );
+ return (HINSTANCE)GetWindowLong( hWnd, GWL_HINSTANCE );
}
// ------------------------
@@ -190,7 +190,7 @@ inline HINSTANCE GetWindowInstance( HWND hWnd )
#define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
#define MOUSEZ_CLASSNAME "MouseZ" // wheel window class
-#define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
+#define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
#define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
#define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
@@ -198,19 +198,19 @@ inline HINSTANCE GetWindowInstance( HWND hWnd )
#define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
#ifndef WHEEL_DELTA
-#define WHEEL_DELTA 120
+#define WHEEL_DELTA 120
#endif
#ifndef WM_MOUSEWHEEL
-#define WM_MOUSEWHEEL 0x020A
+#define WM_MOUSEWHEEL 0x020A
#endif
#ifndef SPI_GETWHEELSCROLLLINES
-#define SPI_GETWHEELSCROLLLINES 104
+#define SPI_GETWHEELSCROLLLINES 104
#endif
#ifndef SPI_SETWHEELSCROLLLINES
-#define SPI_SETWHEELSCROLLLINES 105
+#define SPI_SETWHEELSCROLLLINES 105
#endif
#ifndef WHEEL_PAGESCROLL
-#define WHEEL_PAGESCROLL (UINT_MAX)
+#define WHEEL_PAGESCROLL (UINT_MAX)
#endif
@@ -218,9 +218,9 @@ inline HINSTANCE GetWindowInstance( HWND hWnd )
// - SystemAgent Erweiterungen -
// -----------------------------
-#define ENABLE_AGENT 1
-#define DISABLE_AGENT 2
-#define GET_AGENT_STATUS 3
+#define ENABLE_AGENT 1
+#define DISABLE_AGENT 2
+#define GET_AGENT_STATUS 3
typedef int (APIENTRY* SysAgt_Enable_PROC)( int );
// ---------------------
@@ -228,10 +228,10 @@ typedef int (APIENTRY* SysAgt_Enable_PROC)( int );
// ---------------------
#ifndef COLOR_GRADIENTACTIVECAPTION
-#define COLOR_GRADIENTACTIVECAPTION 27
+#define COLOR_GRADIENTACTIVECAPTION 27
#endif
#ifndef COLOR_GRADIENTINACTIVECAPTION
-#define COLOR_GRADIENTINACTIVECAPTION 28
+#define COLOR_GRADIENTINACTIVECAPTION 28
#endif
#ifndef SPI_GETFLATMENU
@@ -241,7 +241,7 @@ typedef int (APIENTRY* SysAgt_Enable_PROC)( int );
#define COLOR_MENUBAR 30
#endif
#ifndef COLOR_MENUHILIGHT
-#define COLOR_MENUHILIGHT 29
+#define COLOR_MENUHILIGHT 29
#endif
#ifndef CS_DROPSHADOW
diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx
index 3d9834a86466..8f9babfc10f8 100644
--- a/vcl/win/source/app/saldata.cxx
+++ b/vcl/win/source/app/saldata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#include "rtl/tencinfo.h"
#include <saldata.hxx>
#include <vcl/svapp.hxx>
@@ -55,7 +55,7 @@ rtl_TextEncoding ImplSalGetSystemEncoding()
// -----------------------------------------------------------------------
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName )
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName )
{
rtl_TextEncoding eEncoding = ImplSalGetSystemEncoding();
if ( bFileName )
@@ -92,9 +92,9 @@ UniString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen )
int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
{
- int nRet;
- wchar_t c1;
- char c2;
+ int nRet;
+ wchar_t c1;
+ char c2;
do
{
// Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
@@ -118,37 +118,75 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
// =======================================================================
-BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+LONG ImplSetWindowLong( HWND hWnd, int nIndex, DWORD dwNewLong )
{
- return PostMessageW( hWnd, nMsg, wParam, lParam );
+ if ( aSalShlData.mbWNT )
+ return SetWindowLongW( hWnd, nIndex, dwNewLong );
+ else
+ return SetWindowLongA( hWnd, nIndex, dwNewLong );
}
// -----------------------------------------------------------------------
-BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+LONG ImplGetWindowLong( HWND hWnd, int nIndex )
{
- return SendMessageW( hWnd, nMsg, wParam, lParam );
+ if ( aSalShlData.mbWNT )
+ return GetWindowLongW( hWnd, nIndex );
+ else
+ return GetWindowLongA( hWnd, nIndex );
}
// -----------------------------------------------------------------------
-BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
+WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
+ if ( aSalShlData.mbWNT )
+ return PostMessageW( hWnd, nMsg, wParam, lParam );
+ else
+ return PostMessageA( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
-BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
+WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
- return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
+ WIN_BOOL bRet;
+ if ( aSalShlData.mbWNT )
+ bRet = SendMessageW( hWnd, nMsg, wParam, lParam );
+ else
+ bRet = SendMessageA( hWnd, nMsg, wParam, lParam );
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
+{
+ if ( aSalShlData.mbWNT )
+ return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
+ else
+ return GetMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
+}
+
+// -----------------------------------------------------------------------
+
+WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
+{
+ if ( aSalShlData.mbWNT )
+ return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
+ else
+ return PeekMessageA( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
}
// -----------------------------------------------------------------------
LONG ImplDispatchMessage( CONST MSG *lpMsg )
{
- return DispatchMessageW( lpMsg );
+ if ( aSalShlData.mbWNT )
+ return DispatchMessageW( lpMsg );
+ else
+ return DispatchMessageA( lpMsg );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx
index 020e555d8498..c95fca611339 100644
--- a/vcl/win/source/app/salinfo.cxx
+++ b/vcl/win/source/app/salinfo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -58,7 +58,7 @@
#include "rtl/ustrbuf.hxx"
-#include <boost/unordered_map.hpp>
+#include <hash_map>
SalSystem* WinSalInstance::CreateSalSystem()
{
@@ -71,7 +71,7 @@ WinSalSystem::~WinSalSystem()
// -----------------------------------------------------------------------
-static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
+static WIN_BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
HDC hDC,
LPRECT lpRect,
LPARAM dwData )
@@ -82,7 +82,7 @@ static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
reinterpret_cast<sal_IntPtr>(lpRect) );
}
-sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
+BOOL WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
{
MONITORINFOEXW aInfo;
aInfo.cbSize = sizeof( aInfo );
@@ -107,7 +107,7 @@ sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, s
m_nPrimary = it->second;
}
}
- return sal_True;
+ return TRUE;
}
void WinSalSystem::clearMonitors()
@@ -120,9 +120,89 @@ bool WinSalSystem::initMonitors()
{
if( m_aMonitors.size() > 0 )
return true;
+
+ bool winVerOk = true;
- int nMonitors = GetSystemMetrics( SM_CMONITORS );
- if( nMonitors == 1 )
+ // multi monitor calls not available on Win95/NT
+ if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
+ {
+ if ( aSalShlData.maVersionInfo.dwMajorVersion <= 4 )
+ winVerOk = false; // NT
+ }
+ else if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
+ {
+ if ( aSalShlData.maVersionInfo.dwMajorVersion == 4 && aSalShlData.maVersionInfo.dwMinorVersion == 0 )
+ winVerOk = false; // Win95
+ }
+ if( winVerOk )
+ {
+ int nMonitors = GetSystemMetrics( SM_CMONITORS );
+ if( nMonitors == 1 )
+ {
+ int w = GetSystemMetrics( SM_CXSCREEN );
+ int h = GetSystemMetrics( SM_CYSCREEN );
+ m_aMonitors.push_back( DisplayMonitor( rtl::OUString(),
+ rtl::OUString(),
+ Rectangle( Point(), Size( w, h ) ),
+ Rectangle( Point(), Size( w, h ) ),
+ 0 ) );
+ m_aDeviceNameToMonitor[ rtl::OUString() ] = 0;
+ m_nPrimary = 0;
+ RECT aWorkRect;
+ if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
+ m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
+ aWorkRect.right, aWorkRect.bottom );
+ }
+ else
+ {
+ DISPLAY_DEVICEW aDev;
+ aDev.cb = sizeof( aDev );
+ DWORD nDevice = 0;
+ std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount;
+ while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) )
+ {
+ if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE)
+ && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors
+ {
+ aDev.DeviceName[31] = 0;
+ aDev.DeviceString[127] = 0;
+ rtl::OUString aDeviceName( reinterpret_cast<const sal_Unicode *>(aDev.DeviceName) );
+ rtl::OUString aDeviceString( reinterpret_cast<const sal_Unicode *>(aDev.DeviceString) );
+ if( aDeviceStringCount.find( aDeviceString ) == aDeviceStringCount.end() )
+ aDeviceStringCount[ aDeviceString ] = 1;
+ else
+ aDeviceStringCount[ aDeviceString ]++;
+ m_aDeviceNameToMonitor[ aDeviceName ] = m_aMonitors.size();
+ m_aMonitors.push_back( DisplayMonitor( aDeviceString,
+ aDeviceName,
+ Rectangle(),
+ Rectangle(),
+ aDev.StateFlags ) );
+ }
+ }
+ HDC aDesktopRC = GetDC( NULL );
+ EnumDisplayMonitors( aDesktopRC, NULL, ImplEnumMonitorProc, reinterpret_cast<LPARAM>(this) );
+
+ // append monitor numbers to name strings
+ std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDevCount( aDeviceStringCount );
+ unsigned int nMonitors = m_aMonitors.size();
+ for( unsigned int i = 0; i < nMonitors; i++ )
+ {
+ const rtl::OUString& rDev( m_aMonitors[i].m_aName );
+ if( aDeviceStringCount[ rDev ] > 1 )
+ {
+ int nInstance = aDeviceStringCount[ rDev ] - (-- aDevCount[ rDev ] );
+ rtl::OUStringBuffer aBuf( rDev.getLength() + 8 );
+ aBuf.append( rDev );
+ aBuf.appendAscii( " (" );
+ aBuf.append( sal_Int32( nInstance ) );
+ aBuf.append( sal_Unicode(')') );
+ m_aMonitors[ i ].m_aName = aBuf.makeStringAndClear();
+ }
+ }
+ }
+ }
+ else
{
int w = GetSystemMetrics( SM_CXSCREEN );
int h = GetSystemMetrics( SM_CYSCREEN );
@@ -138,55 +218,7 @@ bool WinSalSystem::initMonitors()
m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
aWorkRect.right, aWorkRect.bottom );
}
- else
- {
- DISPLAY_DEVICEW aDev;
- aDev.cb = sizeof( aDev );
- DWORD nDevice = 0;
- boost::unordered_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount;
- while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) )
- {
- if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE)
- && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors
- {
- aDev.DeviceName[31] = 0;
- aDev.DeviceString[127] = 0;
- rtl::OUString aDeviceName( reinterpret_cast<const sal_Unicode *>(aDev.DeviceName) );
- rtl::OUString aDeviceString( reinterpret_cast<const sal_Unicode *>(aDev.DeviceString) );
- if( aDeviceStringCount.find( aDeviceString ) == aDeviceStringCount.end() )
- aDeviceStringCount[ aDeviceString ] = 1;
- else
- aDeviceStringCount[ aDeviceString ]++;
- m_aDeviceNameToMonitor[ aDeviceName ] = m_aMonitors.size();
- m_aMonitors.push_back( DisplayMonitor( aDeviceString,
- aDeviceName,
- Rectangle(),
- Rectangle(),
- aDev.StateFlags ) );
- }
- }
- HDC aDesktopRC = GetDC( NULL );
- EnumDisplayMonitors( aDesktopRC, NULL, ImplEnumMonitorProc, reinterpret_cast<LPARAM>(this) );
-
- // append monitor numbers to name strings
- boost::unordered_map< rtl::OUString, int, rtl::OUStringHash > aDevCount( aDeviceStringCount );
- unsigned int nMonitors = m_aMonitors.size();
- for( unsigned int i = 0; i < nMonitors; i++ )
- {
- const rtl::OUString& rDev( m_aMonitors[i].m_aName );
- if( aDeviceStringCount[ rDev ] > 1 )
- {
- int nInstance = aDeviceStringCount[ rDev ] - (-- aDevCount[ rDev ] );
- rtl::OUStringBuffer aBuf( rDev.getLength() + 8 );
- aBuf.append( rDev );
- aBuf.appendAscii( " (" );
- aBuf.append( sal_Int32( nInstance ) );
- aBuf.append( sal_Unicode(')') );
- m_aMonitors[ i ].m_aName = aBuf.makeStringAndClear();
- }
- }
- }
-
+
return m_aMonitors.size() > 0;
}
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 7baa25fd5101..01c0b376326c 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -30,8 +30,8 @@
#include "precompiled_vcl.hxx"
#include <string.h>
+#include <tools/svwin.h>
#ifdef WNT
-#include <svsys.h>
#include <process.h>
#endif
#ifdef __MINGW32__
@@ -48,19 +48,19 @@
#include <salobj.h>
#include <vcl/salsys.hxx>
#include <saltimer.h>
-#include <vcl/apptypes.hxx>
+#include <vcl/salatype.hxx>
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
-#include <wincomp.hxx> // CS_DROPSHADOW
+#include <wincomp.hxx> // CS_DROPSHADOW
#include <tools/solarmutex.hxx>
#include <vcl/solarmutex.hxx>
#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if defined _MSC_VER
@@ -109,7 +109,7 @@ class SalYieldMutex : public vcl::SolarMutexObject
{
public: // for ImplSalYield()
WinSalInstance* mpInstData;
- sal_uLong mnCount;
+ ULONG mnCount;
DWORD mnThreadId;
public:
@@ -119,7 +119,7 @@ public:
virtual void SAL_CALL release();
virtual sal_Bool SAL_CALL tryToAcquire();
- sal_uLong GetAcquireCount( sal_uLong nThreadId );
+ ULONG GetAcquireCount( ULONG nThreadId );
};
// -----------------------------------------------------------------------
@@ -198,7 +198,7 @@ sal_Bool SAL_CALL SalYieldMutex::tryToAcquire()
// -----------------------------------------------------------------------
-sal_uLong SalYieldMutex::GetAcquireCount( sal_uLong nThreadId )
+ULONG SalYieldMutex::GetAcquireCount( ULONG nThreadId )
{
if ( nThreadId == mnThreadId )
return mnCount;
@@ -224,7 +224,7 @@ void ImplSalYieldMutexAcquireWithWait()
{
// Wenn wir den Mutex nicht bekommen, muessen wir solange
// warten, bis wir Ihn bekommen
- sal_Bool bAcquire = FALSE;
+ BOOL bAcquire = FALSE;
do
{
if ( pInst->mpSalYieldMutex->tryToAcquire() )
@@ -257,7 +257,7 @@ void ImplSalYieldMutexAcquireWithWait()
// -----------------------------------------------------------------------
-sal_Bool ImplSalYieldMutexTryToAcquire()
+BOOL ImplSalYieldMutexTryToAcquire()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( pInst )
@@ -289,15 +289,15 @@ void ImplSalYieldMutexRelease()
// -----------------------------------------------------------------------
-sal_uLong ImplSalReleaseYieldMutex()
+ULONG ImplSalReleaseYieldMutex()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
return 0;
SalYieldMutex* pYieldMutex = pInst->mpSalYieldMutex;
- sal_uLong nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
- sal_uLong n = nCount;
+ ULONG nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
+ ULONG n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -309,7 +309,7 @@ sal_uLong ImplSalReleaseYieldMutex()
// -----------------------------------------------------------------------
-void ImplSalAcquireYieldMutex( sal_uLong nCount )
+void ImplSalAcquireYieldMutex( ULONG nCount )
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
@@ -325,9 +325,10 @@ void ImplSalAcquireYieldMutex( sal_uLong nCount )
// -----------------------------------------------------------------------
-bool WinSalInstance::CheckYieldMutex()
+#ifdef DBG_UTIL
+
+void ImplDbgTestSolarMutex()
{
- bool bRet = true;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -337,7 +338,7 @@ bool WinSalInstance::CheckYieldMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- bRet = false;
+ DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
}
}
}
@@ -348,13 +349,14 @@ bool WinSalInstance::CheckYieldMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- bRet = false;
+ DBG_ERROR( "SolarMutex not locked in the main thread" );
}
}
}
- return bRet;
}
+#endif
+
// =======================================================================
void SalData::initKeyCodeMap()
@@ -368,7 +370,7 @@ void SalData::initKeyCodeMap()
initKey( '+', KEY_ADD );
initKey( '-', KEY_SUBTRACT );
initKey( '*', KEY_MULTIPLY );
- initKey( '/', KEY_DIVIDE );
+ initKey( '/', KEY_DIVIDE );
initKey( '.', KEY_POINT );
initKey( ',', KEY_COMMA );
initKey( '<', KEY_LESS );
@@ -439,13 +441,10 @@ 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();
SetSalData( this );
@@ -511,19 +510,27 @@ SalInstance* CreateSalInstance()
SalData* pSalData = GetSalData();
// determine the windows version
+ aSalShlData.mbWNT = 0;
aSalShlData.mbWXP = 0;
aSalShlData.mbWPrinter = 0;
WORD nVer = (WORD)GetVersion();
+ aSalShlData.mnVersion = (((WORD)LOBYTE(nVer)) * 100) + HIBYTE(nVer);
+ if ( aSalShlData.mnVersion >= 400 )
+ aSalShlData.mbW40 = 1;
rtl_zeroMemory( &aSalShlData.maVersionInfo, sizeof(aSalShlData.maVersionInfo) );
aSalShlData.maVersionInfo.dwOSVersionInfoSize = sizeof( aSalShlData.maVersionInfo );
if ( GetVersionEx( &aSalShlData.maVersionInfo ) )
{
- // Windows XP ?
- if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
- ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
- aSalShlData.mbWXP = 1;
- if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 )
- aSalShlData.mbWPrinter = 1;
+ if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
+ {
+ aSalShlData.mbWNT = 1;
+ // Windows XP ?
+ if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
+ ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
+ aSalShlData.mbWXP = 1;
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 )
+ aSalShlData.mbWPrinter = 1;
+ }
}
pSalData->mnAppThreadId = GetCurrentThreadId();
@@ -531,46 +538,90 @@ SalInstance* CreateSalInstance()
// register frame class
if ( !pSalData->mhPrevInst )
{
- WNDCLASSEXW aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = CS_OWNDC;
- aWndClassEx.lpfnWndProc = SalFrameWndProcW;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hCursor = 0;
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEW;
- ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.style |= CS_SAVEBITS;
- aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- // shadow effect for popups on XP
- if( aSalShlData.mbWXP )
- aWndClassEx.style |= CS_DROPSHADOW;
- aWndClassEx.lpszClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalComWndProcW;
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
+ if ( aSalShlData.mbWNT )
+ {
+ WNDCLASSEXW aWndClassEx;
+ aWndClassEx.cbSize = sizeof( aWndClassEx );
+ aWndClassEx.style = CS_OWNDC;
+ aWndClassEx.lpfnWndProc = SalFrameWndProcW;
+ aWndClassEx.cbClsExtra = 0;
+ aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
+ aWndClassEx.hInstance = pSalData->mhInst;
+ aWndClassEx.hCursor = 0;
+ aWndClassEx.hbrBackground = 0;
+ aWndClassEx.lpszMenuName = 0;
+ aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEW;
+ ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.hIcon = 0;
+ aWndClassEx.hIconSm = 0;
+ aWndClassEx.style |= CS_SAVEBITS;
+ aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ // shadow effect for popups on XP
+ if( aSalShlData.mbWXP )
+ aWndClassEx.style |= CS_DROPSHADOW;
+ aWndClassEx.lpszClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.style = 0;
+ aWndClassEx.lpfnWndProc = SalComWndProcW;
+ aWndClassEx.cbWndExtra = 0;
+ aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+ }
+ else
+ {
+ WNDCLASSEXA aWndClassEx;
+ aWndClassEx.cbSize = sizeof( aWndClassEx );
+ aWndClassEx.style = CS_OWNDC;
+ aWndClassEx.lpfnWndProc = SalFrameWndProcA;
+ aWndClassEx.cbClsExtra = 0;
+ aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
+ aWndClassEx.hInstance = pSalData->mhInst;
+ aWndClassEx.hCursor = 0;
+ aWndClassEx.hbrBackground = 0;
+ aWndClassEx.lpszMenuName = 0;
+ aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEA;
+ ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
+ if ( !RegisterClassExA( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.hIcon = 0;
+ aWndClassEx.hIconSm = 0;
+ aWndClassEx.style |= CS_SAVEBITS;
+ aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEA;
+ if ( !RegisterClassExA( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.style = 0;
+ aWndClassEx.lpfnWndProc = SalComWndProcA;
+ aWndClassEx.cbWndExtra = 0;
+ aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEA;
+ if ( !RegisterClassExA( &aWndClassEx ) )
+ return NULL;
+ }
}
- HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
- L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
- pSalData->mhInst, NULL );
+ HWND hComWnd;
+ if ( aSalShlData.mbWNT )
+ {
+ hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
+ pSalData->mhInst, NULL );
+ }
+ else
+ {
+ hComWnd = CreateWindowExA( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEA,
+ "", WS_POPUP, 0, 0, 0, 0, 0, 0,
+ pSalData->mhInst, NULL );
+ }
if ( !hComWnd )
return NULL;
@@ -636,14 +687,14 @@ osl::SolarMutex* WinSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-sal_uLong WinSalInstance::ReleaseYieldMutex()
+ULONG WinSalInstance::ReleaseYieldMutex()
{
return ImplSalReleaseYieldMutex();
}
// -----------------------------------------------------------------------
-void WinSalInstance::AcquireYieldMutex( sal_uLong nCount )
+void WinSalInstance::AcquireYieldMutex( ULONG nCount )
{
ImplSalAcquireYieldMutex( nCount );
}
@@ -665,22 +716,18 @@ static void ImplSalDispatchMessage( MSG* pMsg )
// -----------------------------------------------------------------------
-void ImplSalYield( sal_Bool bWait, sal_Bool bHandleAllCurrentEvents )
+void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
MSG aMsg;
bool bWasMsg = false, bOneEvent = false;
-
+
int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1;
do
{
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
- {
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
- }
-
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
bOneEvent = bWasMsg = true;
}
else
@@ -691,11 +738,8 @@ void ImplSalYield( sal_Bool bWait, sal_Bool bHandleAllCurrentEvents )
{
if ( ImplGetMessage( &aMsg, 0, 0, 0 ) )
{
- if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
- {
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
- }
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
}
}
}
@@ -707,8 +751,8 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
- sal_uLong nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
- sal_uLong n = nCount;
+ ULONG nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
+ ULONG n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -716,7 +760,7 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
}
if ( pSalData->mnAppThreadId != nCurThreadId )
{
- // #97739# A SendMessage call blocks until the called thread (here: the main thread)
+ // #97739# A SendMessage call blocks until the called thread (here: the main thread)
// returns. During a yield however, messages are processed in the main thread that might
// result in a new message loop due to opening a dialog. Thus, SendMessage would not
// return which will block this thread!
@@ -765,7 +809,7 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_THREADYIELD:
- ImplSalYield( (sal_Bool)wParam, (sal_Bool)lParam );
+ ImplSalYield( (BOOL)wParam, (BOOL)lParam );
rDef = FALSE;
break;
// If we get this message, because another GetMessage() call
@@ -780,11 +824,11 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_STARTTIMER:
- ImplSalStartTimer( (sal_uLong) lParam, FALSE );
+ ImplSalStartTimer( (ULONG) lParam, FALSE );
rDef = FALSE;
break;
case SAL_MSG_CREATEFRAME:
- nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (sal_uLong)wParam );
+ nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (ULONG)wParam );
rDef = FALSE;
break;
case SAL_MSG_RECREATEHWND:
@@ -801,10 +845,10 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
break;
case SAL_MSG_DESTROYHWND:
//We only destroy the native window here. We do NOT destroy the SalFrame contained
- //in the structure (GetWindowPtr()).
+ //in the structure (GetWindowPtr()).
if (DestroyWindow((HWND)lParam) == 0)
{
- OSL_FAIL("DestroyWindow failed!");
+ OSL_ENSURE(0, "DestroyWindow failed!");
//Failure: We remove the SalFrame from the window structure. So we avoid that
// the window structure may contain an invalid pointer, once the SalFrame is deleted.
SetWindowPtr((HWND)lParam, 0);
@@ -899,7 +943,7 @@ LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPa
// -----------------------------------------------------------------------
-bool WinSalInstance::AnyInput( sal_uInt16 nType )
+bool WinSalInstance::AnyInput( USHORT nType )
{
MSG aMsg;
@@ -941,7 +985,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
if ( ImplPeekMessage( &aMsg, 0, WM_PAINT, WM_PAINT,
PM_NOREMOVE | PM_NOYIELD ) )
return true;
-
+
if ( ImplPeekMessage( &aMsg, 0, WM_SIZE, WM_SIZE,
PM_NOREMOVE | PM_NOYIELD ) )
return true;
@@ -981,7 +1025,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
// -----------------------------------------------------------------------
-void SalTimer::Start( sal_uLong nMS )
+void SalTimer::Start( ULONG nMS )
{
// Um auf Main-Thread umzuschalten
SalData* pSalData = GetSalData();
@@ -998,7 +1042,7 @@ void SalTimer::Start( sal_uLong nMS )
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
+SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
return (SalFrame*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEFRAME, nSalFrameStyle, (LPARAM)pSystemParentData->hWnd );
@@ -1006,7 +1050,7 @@ SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData,
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
+SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
HWND hWndParent;
@@ -1028,7 +1072,7 @@ void WinSalInstance::DestroyFrame( SalFrame* pFrame )
SalObject* WinSalInstance::CreateObject( SalFrame* pParent,
SystemWindowData* /*pWindowData*/, // SystemWindowData meaningless on Windows
- sal_Bool /*bShow*/ )
+ BOOL /*bShow*/ )
{
// Um auf Main-Thread umzuschalten
return (SalObject*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEOBJECT, 0, (LPARAM)static_cast<WinSalFrame*>(pParent) );
@@ -1053,9 +1097,9 @@ void* WinSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
// -----------------------------------------------------------------------
/** Add a file to the system shells recent document list if there is any.
- This function may have no effect under Unix because there is no
+ This function may have no effect under Unix because there is no
standard API among the different desktop managers.
-
+
@param aFileUrl
The file url of the document.
*/
@@ -1063,11 +1107,11 @@ void WinSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, cons
{
rtl::OUString system_path;
osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL(rFileUrl, system_path);
-
+
OSL_ENSURE(osl::FileBase::E_None == rc, "Invalid file url");
-
+
if (osl::FileBase::E_None == rc)
- SHAddToRecentDocs(SHARD_PATHW, system_path.getStr());
+ SHAddToRecentDocs(SHARD_PATHW, system_path.getStr());
}
// -----------------------------------------------------------------------
@@ -1089,7 +1133,7 @@ class WinImeStatus : public SalI18NImeStatus
public:
WinImeStatus() {}
virtual ~WinImeStatus() {}
-
+
// asks whether there is a status window available
// to toggle into menubar
virtual bool canToggle() { return false; }
diff --git a/vcl/win/source/app/salshl.cxx b/vcl/win/source/app/salshl.cxx
index cdcf89d2224c..6d8ccabf878f 100644
--- a/vcl/win/source/app/salshl.cxx
+++ b/vcl/win/source/app/salshl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#include <saldata.hxx>
#include <tools/debug.hxx>
@@ -44,15 +44,15 @@ extern "C"
{
#ifdef __MINGW32__
-sal_Bool WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+BOOL WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#else
#ifdef ICC
int _CRT_init(void);
#else
-BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
+WIN_BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
#endif
-BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+WIN_BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#endif
{
// Unsere DLL-Initialisierung
@@ -103,7 +103,7 @@ HBITMAP ImplLoadSalBitmap( int nId )
// -----------------------------------------------------------------------
-sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon )
+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 536ca438e458..ac329d9cfb69 100644
--- a/vcl/win/source/app/saltimer.cxx
+++ b/vcl/win/source/app/saltimer.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#ifdef __MINGW32__
#include <excpt.h>
#endif
@@ -39,11 +39,11 @@
// =======================================================================
// Maximale Periode
-#define MAX_SYSPERIOD 65533
+#define MAX_SYSPERIOD 65533
// =======================================================================
-void ImplSalStartTimer( sal_uLong nMS, sal_Bool bMutex )
+void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
{
SalData* pSalData = GetSalData();
@@ -52,7 +52,7 @@ void ImplSalStartTimer( sal_uLong nMS, sal_Bool bMutex )
if ( !bMutex )
pSalData->mnTimerOrgMS = nMS;
- // Periode darf nicht zu gross sein, da Windows mit sal_uInt16 arbeitet
+ // Periode darf nicht zu gross sein, da Windows mit USHORT arbeitet
if ( nMS > MAX_SYSPERIOD )
nMS = MAX_SYSPERIOD;
@@ -71,7 +71,7 @@ WinSalTimer::~WinSalTimer()
{
}
-void WinSalTimer::Start( sal_uLong nMS )
+void WinSalTimer::Start( ULONG nMS )
{
// switch to main thread
SalData* pSalData = GetSalData();
@@ -118,7 +118,7 @@ void CALLBACK SalTimerProc( HWND, UINT, UINT_PTR nId, DWORD )
// Test for MouseLeave
SalTestMouseLeave();
-
+
bool bRecursive = pSalData->mbInTimerProc && (nId != SALTIMERPROC_RECURSIVE);
if ( pSVData->mpSalTimer && ! bRecursive )
{
@@ -133,7 +133,7 @@ void CALLBACK SalTimerProc( HWND, UINT, UINT_PTR nId, DWORD )
pSVData->mpSalTimer->CallCallback();
pSalData->mbInTimerProc = FALSE;
ImplSalYieldMutexRelease();
-
+
// Run the timer in the correct time, if we start this
// with a small timeout, because we don't get the mutex
if ( pSalData->mnTimerId &&
diff --git a/vcl/win/source/gdi/makefile.mk b/vcl/win/source/gdi/MAKEFILE.MK
index 07a8bf52656d..7489be633f2b 100644
--- a/vcl/win/source/gdi/makefile.mk
+++ b/vcl/win/source/gdi/MAKEFILE.MK
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -56,16 +56,12 @@ SLOFILES= $(SLO)$/salgdi.obj \
$(SLO)$/winlayout.obj \
$(SLO)$/wntgdi.obj \
$(SLO)$/salnativewidgets-luna.obj
+
-
-EXCEPTIONSFILES= $(SLO)$/salprn.obj \
- $(SLO)$/salgdi2.obj
+EXCEPTIONSFILES= $(SLO)$/salprn.obj
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
CFLAGS+=-DENABLE_GRAPHITE
-.IF "$(SYSTEM_GRAPHITE)" != "YES"
-CDEFS+=-DGR2_STATIC
-.ENDIF
.ENDIF
# --- Targets ------------------------------------------------------
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 959374699dbb..d05036be29ce 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <vcl/salbtype.hxx>
#include <salgdi.h>
@@ -54,9 +54,9 @@ inline void ImplSetPixel4( const HPBYTE pScanline, long nX, const BYTE cIndex )
// ----------------
WinSalBitmap::WinSalBitmap() :
- mhDIB ( 0 ),
- mhDDB ( 0 ),
- mnBitCount ( 0 )
+ mhDIB ( 0 ),
+ mhDDB ( 0 ),
+ mnBitCount ( 0 )
{
}
@@ -92,7 +92,7 @@ bool WinSalBitmap::Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle )
}
else if( mhDDB )
{
- BITMAP aDDBInfo;
+ BITMAP aDDBInfo;
if( WIN_GetObject( mhDDB, sizeof( BITMAP ), &aDDBInfo ) )
{
@@ -120,7 +120,7 @@ bool WinSalBitmap::Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
+bool WinSalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
{
bool bRet = FALSE;
@@ -176,12 +176,12 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
if( rSalBmp.mhDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( rSalBmp.mhDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
- HDC hDC = pGraphics->mhDC;
- HBITMAP hNewDDB;
- BITMAP aDDBInfo;
- PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( rSalBmp.mhDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ HDC hDC = pGraphics->mhDC;
+ HBITMAP hNewDDB;
+ BITMAP aDDBInfo;
+ PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
ImplGetDIBColorCount( rSalBmp.mhDIB ) * sizeof( RGBQUAD );
if( pBIH->biBitCount == 1 )
@@ -213,7 +213,7 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, sal_uInt16 nNewBitCount )
+bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, USHORT nNewBitCount )
{
bool bRet = FALSE;
@@ -226,12 +226,12 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, sal_uInt16 nNewBitCount )
if( mhDIB )
{
PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
- const int nLines = (int) rSalBmp.maSize.Height();
- HDC hDC = GetDC( 0 );
- PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
+ const int nLines = (int) rSalBmp.maSize.Height();
+ HDC hDC = GetDC( 0 );
+ PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
ImplGetDIBColorCount( mhDIB ) * sizeof( RGBQUAD );
- SalData* pSalData = GetSalData();
- HPALETTE hOldPal = 0;
+ SalData* pSalData = GetSalData();
+ HPALETTE hOldPal = 0;
if ( pSalData->mhDitherPal )
{
@@ -285,21 +285,21 @@ void WinSalBitmap::Destroy()
// ------------------------------------------------------------------
-sal_uInt16 WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
+USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
{
- sal_uInt16 nColors = 0;
+ USHORT nColors = 0;
if( hDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
if ( pBIH->biSize != sizeof( BITMAPCOREHEADER ) )
{
if( pBIH->biBitCount <= 8 )
{
if ( pBIH->biClrUsed )
- nColors = (sal_uInt16) pBIH->biClrUsed;
+ nColors = (USHORT) pBIH->biClrUsed;
else
nColors = 1 << pBIH->biBitCount;
}
@@ -315,7 +315,7 @@ sal_uInt16 WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
// ------------------------------------------------------------------
-HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rPal )
+HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const BitmapPalette& rPal )
{
DBG_ASSERT( nBits == 1 || nBits == 4 || nBits == 8 || nBits == 16 || nBits == 24, "Unsupported BitCount!" );
@@ -323,15 +323,15 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const
if ( rSize.Width() && rSize.Height() )
{
- const sal_uLong nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
- const sal_uInt16 nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
+ const ULONG nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
+ const USHORT nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
hDIB = GlobalAlloc( GHND, sizeof( BITMAPINFOHEADER ) + nColors * sizeof( RGBQUAD ) + nImageSize );
if( hDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
pBIH->biSize = sizeof( BITMAPINFOHEADER );
pBIH->biWidth = rSize.Width();
@@ -347,7 +347,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const
if ( nColors )
{
- const sal_uInt16 nMinCount = Min( nColors, rPal.GetEntryCount() );
+ const USHORT nMinCount = Min( nColors, rPal.GetEntryCount() );
if( nMinCount )
memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof( RGBQUAD ) );
@@ -364,11 +364,11 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const
HANDLE WinSalBitmap::ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB )
{
- HANDLE hCopy = 0;
+ HANDLE hCopy = 0;
if ( bDIB && hHdl )
{
- const sal_uLong nSize = GlobalSize( hHdl );
+ const ULONG nSize = GlobalSize( hHdl );
if ( (hCopy = GlobalAlloc( GHND, nSize )) != 0 )
{
@@ -388,9 +388,9 @@ HANDLE WinSalBitmap::ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB )
// Destination-Bitmap erzeugen
if ( (hCopy = CreateBitmapIndirect( &aBmp )) != 0 )
{
- HDC hBmpDC = CreateCompatibleDC( 0 );
+ HDC hBmpDC = CreateCompatibleDC( 0 );
HBITMAP hBmpOld = (HBITMAP) SelectObject( hBmpDC, hHdl );
- HDC hCopyDC = CreateCompatibleDC( hBmpDC );
+ HDC hCopyDC = CreateCompatibleDC( hBmpDC );
HBITMAP hCopyOld = (HBITMAP) SelectObject( hCopyDC, hCopy );
BitBlt( hCopyDC, 0, 0, aBmp.bmWidth, aBmp.bmHeight, hBmpDC, 0, 0, SRCCOPY );
@@ -414,22 +414,22 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
if( mhDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
if( ( pBIH->biCompression == BI_RLE4 ) || ( pBIH->biCompression == BI_RLE8 ) )
{
- Size aSizePix( pBIH->biWidth, pBIH->biHeight );
+ Size aSizePix( pBIH->biWidth, pBIH->biHeight );
HGLOBAL hNewDIB = ImplCreateDIB( aSizePix, pBIH->biBitCount, BitmapPalette() );
if( hNewDIB )
{
- PBITMAPINFO pNewBI = (PBITMAPINFO) GlobalLock( hNewDIB );
- PBITMAPINFOHEADER pNewBIH = (PBITMAPINFOHEADER) pNewBI;
- 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;
+ PBITMAPINFO pNewBI = (PBITMAPINFO) GlobalLock( hNewDIB );
+ PBITMAPINFOHEADER pNewBIH = (PBITMAPINFOHEADER) pNewBI;
+ const USHORT nColorCount = ImplGetDIBColorCount( hNewDIB );
+ const ULONG nOffset = *(DWORD*) pBI + nColorCount * sizeof( RGBQUAD );
+ BYTE* pOldBits = (PBYTE) pBI + nOffset;
+ BYTE* pNewBits = (PBYTE) pNewBI + nOffset;
memcpy( pNewBI, pBI, nOffset );
pNewBIH->biCompression = 0;
@@ -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 = (sal_uInt16) pBIH->biBitCount;
+ pBuffer->mnBitCount = (USHORT) pBIH->biBitCount;
if( pBuffer->mnBitCount <= 8 )
{
- const sal_uInt16 nPalCount = ImplGetDIBColorCount( mhDIB );
+ const USHORT 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 ) )
{
- sal_uLong nOffset = 0UL;
+ ULONG nOffset = 0UL;
if( pBIH->biCompression == BI_BITFIELDS )
{
@@ -515,10 +515,10 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
{
if( !bReadOnly && !!pBuffer->maPalette )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
- const sal_uInt16 nCount = pBuffer->maPalette.GetEntryCount();
- const sal_uInt16 nDIBColorCount = ImplGetDIBColorCount( mhDIB );
- memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
+ const USHORT nCount = pBuffer->maPalette.GetEntryCount();
+
+ memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), nCount * sizeof( RGBQUAD ) );
GlobalUnlock( mhDIB );
}
@@ -534,17 +534,17 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 )
{
- HPBYTE pRLE = (HPBYTE) pSrcBuf;
- HPBYTE pDIB = (HPBYTE) pDstBuf;
- HPBYTE pRow = (HPBYTE) pDstBuf;
- sal_uLong nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
- HPBYTE pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
- sal_uLong nCountByte;
- sal_uLong nRunByte;
- sal_uLong nX = 0;
- sal_uLong i;
- BYTE cTmp;
- bool bEndDecoding = FALSE;
+ HPBYTE pRLE = (HPBYTE) pSrcBuf;
+ HPBYTE pDIB = (HPBYTE) pDstBuf;
+ HPBYTE pRow = (HPBYTE) pDstBuf;
+ ULONG nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
+ HPBYTE pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
+ ULONG nCountByte;
+ ULONG nRunByte;
+ ULONG nX = 0;
+ ULONG i;
+ BYTE cTmp;
+ bool bEndDecoding = FALSE;
if( pRLE && pDIB )
{
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 727c67298e89..89d54b9580f4 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,19 +31,17 @@
#include <stdio.h>
#include <string.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <saldata.hxx>
#include <salgdi.h>
#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;
+using namespace rtl;
+
// =======================================================================
// comment out to prevent use of beziers on GDI functions
@@ -51,19 +49,19 @@ using ::rtl::OStringBuffer;
// =======================================================================
-#define DITHER_PAL_DELTA 51
-#define DITHER_PAL_STEPS 6
-#define DITHER_PAL_COUNT (DITHER_PAL_STEPS*DITHER_PAL_STEPS*DITHER_PAL_STEPS)
-#define DITHER_MAX_SYSCOLOR 16
-#define DITHER_EXTRA_COLORS 1
-#define DMAP( _def_nVal, _def_nThres ) ((pDitherDiff[_def_nVal]>(_def_nThres))?pDitherHigh[_def_nVal]:pDitherLow[_def_nVal])
+#define DITHER_PAL_DELTA 51
+#define DITHER_PAL_STEPS 6
+#define DITHER_PAL_COUNT (DITHER_PAL_STEPS*DITHER_PAL_STEPS*DITHER_PAL_STEPS)
+#define DITHER_MAX_SYSCOLOR 16
+#define DITHER_EXTRA_COLORS 1
+#define DMAP( _def_nVal, _def_nThres ) ((pDitherDiff[_def_nVal]>(_def_nThres))?pDitherHigh[_def_nVal]:pDitherLow[_def_nVal])
// =======================================================================
struct SysColorEntry
{
- DWORD nRGB;
- SysColorEntry* pNext;
+ DWORD nRGB;
+ SysColorEntry* pNext;
};
// =======================================================================
@@ -83,21 +81,21 @@ static PALETTEENTRY aImplExtraColor1 =
static PALETTEENTRY aImplSalSysPalEntryAry[ DITHER_MAX_SYSCOLOR ] =
{
-{ 0, 0, 0, 0 },
-{ 0, 0, 0x80, 0 },
-{ 0, 0x80, 0, 0 },
-{ 0, 0x80, 0x80, 0 },
-{ 0x80, 0, 0, 0 },
+{ 0, 0, 0, 0 },
+{ 0, 0, 0x80, 0 },
+{ 0, 0x80, 0, 0 },
+{ 0, 0x80, 0x80, 0 },
+{ 0x80, 0, 0, 0 },
{ 0x80, 0, 0x80, 0 },
-{ 0x80, 0x80, 0, 0 },
+{ 0x80, 0x80, 0, 0 },
{ 0x80, 0x80, 0x80, 0 },
{ 0xC0, 0xC0, 0xC0, 0 },
-{ 0, 0, 0xFF, 0 },
-{ 0, 0xFF, 0, 0 },
-{ 0, 0xFF, 0xFF, 0 },
-{ 0xFF, 0, 0, 0 },
+{ 0, 0, 0xFF, 0 },
+{ 0, 0xFF, 0, 0 },
+{ 0, 0xFF, 0xFF, 0 },
+{ 0xFF, 0, 0, 0 },
{ 0xFF, 0, 0xFF, 0 },
-{ 0xFF, 0xFF, 0, 0 },
+{ 0xFF, 0xFF, 0, 0 },
{ 0xFF, 0xFF, 0xFF, 0 }
};
@@ -134,12 +132,12 @@ static BYTE aOrdDither16Bit[8][8] =
// Pens muessen wir mit 1 Pixel-Breite erzeugen, da ansonsten die S3-Karte
// viele Paintprobleme hat, wenn Polygone/PolyLines gezeichnet werden und
// eine komplexe ClipRegion gesetzt ist
-#define GSL_PEN_WIDTH 1
+#define GSL_PEN_WIDTH 1
// =======================================================================
-#define SAL_POLYPOLYCOUNT_STACKBUF 8
-#define SAL_POLYPOLYPOINTS_STACKBUF 64
+#define SAL_POLYPOLYCOUNT_STACKBUF 8
+#define SAL_POLYPOLYPOINTS_STACKBUF 64
// =======================================================================
@@ -148,24 +146,24 @@ void ImplInitSalGDI()
SalData* pSalData = GetSalData();
// init stock brushes
- pSalData->maStockPenColorAry[0] = PALETTERGB( 0, 0, 0 );
- pSalData->maStockPenColorAry[1] = PALETTERGB( 0xFF, 0xFF, 0xFF );
- pSalData->maStockPenColorAry[2] = PALETTERGB( 0xC0, 0xC0, 0xC0 );
- pSalData->maStockPenColorAry[3] = PALETTERGB( 0x80, 0x80, 0x80 );
- pSalData->mhStockPenAry[0] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[0] );
- pSalData->mhStockPenAry[1] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[1] );
- pSalData->mhStockPenAry[2] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[2] );
- pSalData->mhStockPenAry[3] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[3] );
+ pSalData->maStockPenColorAry[0] = PALETTERGB( 0, 0, 0 );
+ pSalData->maStockPenColorAry[1] = PALETTERGB( 0xFF, 0xFF, 0xFF );
+ pSalData->maStockPenColorAry[2] = PALETTERGB( 0xC0, 0xC0, 0xC0 );
+ pSalData->maStockPenColorAry[3] = PALETTERGB( 0x80, 0x80, 0x80 );
+ pSalData->mhStockPenAry[0] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[0] );
+ pSalData->mhStockPenAry[1] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[1] );
+ pSalData->mhStockPenAry[2] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[2] );
+ pSalData->mhStockPenAry[3] = CreatePen( PS_SOLID, GSL_PEN_WIDTH, pSalData->maStockPenColorAry[3] );
pSalData->mnStockPenCount = 4;
- pSalData->maStockBrushColorAry[0] = PALETTERGB( 0, 0, 0 );
- pSalData->maStockBrushColorAry[1] = PALETTERGB( 0xFF, 0xFF, 0xFF );
- pSalData->maStockBrushColorAry[2] = PALETTERGB( 0xC0, 0xC0, 0xC0 );
- pSalData->maStockBrushColorAry[3] = PALETTERGB( 0x80, 0x80, 0x80 );
- pSalData->mhStockBrushAry[0] = CreateSolidBrush( pSalData->maStockBrushColorAry[0] );
- pSalData->mhStockBrushAry[1] = CreateSolidBrush( pSalData->maStockBrushColorAry[1] );
- pSalData->mhStockBrushAry[2] = CreateSolidBrush( pSalData->maStockBrushColorAry[2] );
- pSalData->mhStockBrushAry[3] = CreateSolidBrush( pSalData->maStockBrushColorAry[3] );
+ pSalData->maStockBrushColorAry[0] = PALETTERGB( 0, 0, 0 );
+ pSalData->maStockBrushColorAry[1] = PALETTERGB( 0xFF, 0xFF, 0xFF );
+ pSalData->maStockBrushColorAry[2] = PALETTERGB( 0xC0, 0xC0, 0xC0 );
+ pSalData->maStockBrushColorAry[3] = PALETTERGB( 0x80, 0x80, 0x80 );
+ pSalData->mhStockBrushAry[0] = CreateSolidBrush( pSalData->maStockBrushColorAry[0] );
+ pSalData->mhStockBrushAry[1] = CreateSolidBrush( pSalData->maStockBrushColorAry[1] );
+ pSalData->mhStockBrushAry[2] = CreateSolidBrush( pSalData->maStockBrushColorAry[2] );
+ pSalData->mhStockBrushAry[3] = CreateSolidBrush( pSalData->maStockBrushColorAry[3] );
pSalData->mnStockBrushCount = 4;
// initialize cache of device contexts
@@ -185,12 +183,12 @@ void ImplInitSalGDI()
if ( (nBitCount > 8) && (nBitCount < 24) )
{
// test, if we have to dither
- HDC hMemDC = ::CreateCompatibleDC( hDC );
- HBITMAP hMemBmp = ::CreateCompatibleBitmap( hDC, 8, 8 );
- HBITMAP hBmpOld = (HBITMAP) ::SelectObject( hMemDC, hMemBmp );
- HBRUSH hMemBrush = ::CreateSolidBrush( PALETTERGB( 175, 171, 169 ) );
- HBRUSH hBrushOld = (HBRUSH) ::SelectObject( hMemDC, hMemBrush );
- sal_Bool bDither16 = TRUE;
+ HDC hMemDC = ::CreateCompatibleDC( hDC );
+ HBITMAP hMemBmp = ::CreateCompatibleBitmap( hDC, 8, 8 );
+ HBITMAP hBmpOld = (HBITMAP) ::SelectObject( hMemDC, hMemBmp );
+ HBRUSH hMemBrush = ::CreateSolidBrush( PALETTERGB( 175, 171, 169 ) );
+ HBRUSH hBrushOld = (HBRUSH) ::SelectObject( hMemDC, hMemBrush );
+ BOOL bDither16 = TRUE;
::PatBlt( hMemDC, 0, 0, 8, 8, PATCOPY );
const COLORREF aCol( ::GetPixel( hMemDC, 0, 0 ) );
@@ -237,17 +235,17 @@ void ImplInitSalGDI()
}
else if ( (nRasterCaps & RC_PALETTE) && (nBitCount == 8) )
{
- BYTE nRed, nGreen, nBlue;
- BYTE nR, nG, nB;
- PALETTEENTRY* pPalEntry;
- LOGPALETTE* pLogPal;
- const sal_uInt16 nDitherPalCount = DITHER_PAL_COUNT;
- sal_uLong nTotalCount = DITHER_MAX_SYSCOLOR + nDitherPalCount + DITHER_EXTRA_COLORS;
+ BYTE nRed, nGreen, nBlue;
+ BYTE nR, nG, nB;
+ PALETTEENTRY* pPalEntry;
+ LOGPALETTE* pLogPal;
+ const USHORT nDitherPalCount = DITHER_PAL_COUNT;
+ 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 = (sal_uInt16) nTotalCount;
+ pLogPal->palNumEntries = (USHORT) nTotalCount;
pPalEntry = pLogPal->palPalEntry;
// Standard colors
@@ -291,8 +289,8 @@ void ImplInitSalGDI()
pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) );
memset( pSalData->mpDitherDIB, 0, sizeof( BITMAPINFOHEADER ) );
- BITMAPINFOHEADER* pBIH = (BITMAPINFOHEADER*) pSalData->mpDitherDIB;
- short* pColors = (short*) ( pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) );
+ BITMAPINFOHEADER* pBIH = (BITMAPINFOHEADER*) pSalData->mpDitherDIB;
+ short* pColors = (short*) ( pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) );
pBIH->biSize = sizeof( BITMAPINFOHEADER );
pBIH->biWidth = 8;
@@ -324,10 +322,10 @@ void ImplInitSalGDI()
void ImplFreeSalGDI()
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
// destroy stock objects
- int i;
+ int i;
for ( i = 0; i < pSalData->mnStockPenCount; i++ )
DeletePen( pSalData->mhStockPenAry[i] );
for ( i = 0; i < pSalData->mnStockBrushCount; i++ )
@@ -405,7 +403,7 @@ static int ImplIsPaletteEntry( BYTE nRed, BYTE nGreen, BYTE nBlue )
PALETTEENTRY* pPalEntry = aImplSalSysPalEntryAry;
// standard palette color?
- for ( sal_uInt16 i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
+ for ( USHORT i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
{
if( pPalEntry->peRed == nRed && pPalEntry->peGreen == nGreen && pPalEntry->peBlue == nBlue )
return TRUE;
@@ -426,8 +424,8 @@ static int ImplIsPaletteEntry( BYTE nRed, BYTE nGreen, BYTE nBlue )
int ImplIsSysColorEntry( SalColor nSalColor )
{
- SysColorEntry* pEntry = pFirstSysColor;
- const DWORD nTestRGB = (DWORD)RGB( SALCOLOR_RED( nSalColor ),
+ SysColorEntry* pEntry = pFirstSysColor;
+ const DWORD nTestRGB = (DWORD)RGB( SALCOLOR_RED( nSalColor ),
SALCOLOR_GREEN( nSalColor ),
SALCOLOR_BLUE( nSalColor ) );
@@ -481,8 +479,11 @@ void ImplUpdateSysColorEntries()
// create new sys color list
ImplInsertSysColorEntry( COLOR_ACTIVEBORDER );
ImplInsertSysColorEntry( COLOR_INACTIVEBORDER );
- ImplInsertSysColorEntry( COLOR_GRADIENTACTIVECAPTION );
- ImplInsertSysColorEntry( COLOR_GRADIENTINACTIVECAPTION );
+ if( aSalShlData.mnVersion >= 410 )
+ {
+ ImplInsertSysColorEntry( COLOR_GRADIENTACTIVECAPTION );
+ ImplInsertSysColorEntry( COLOR_GRADIENTINACTIVECAPTION );
+ }
ImplInsertSysColorEntry( COLOR_3DFACE );
ImplInsertSysColorEntry( COLOR_3DHILIGHT );
ImplInsertSysColorEntry( COLOR_3DLIGHT );
@@ -538,9 +539,7 @@ void ImplSalInitGraphics( WinSalGraphics* pData )
void ImplSalDeInitGraphics( WinSalGraphics* pData )
{
- // clear clip region
- SelectClipRgn( pData->mhDC, 0 );
- // select default objects
+ // Default Objekte selektieren
if ( pData->mhDefPen )
SelectPen( pData->mhDC, pData->mhDefPen );
if ( pData->mhDefBrush )
@@ -551,10 +550,10 @@ void ImplSalDeInitGraphics( WinSalGraphics* pData )
// =======================================================================
-HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp )
+HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp )
{
- SalData* pSalData = GetSalData();
- HDCCache* pC = &pSalData->mpHDCCache[ nID ];
+ SalData* pSalData = GetSalData();
+ HDCCache* pC = &pSalData->mpHDCCache[ nID ];
if( !pC->mhDC )
{
@@ -585,10 +584,10 @@ HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp )
// =======================================================================
-void ImplReleaseCachedDC( sal_uLong nID )
+void ImplReleaseCachedDC( ULONG nID )
{
- SalData* pSalData = GetSalData();
- HDCCache* pC = &pSalData->mpHDCCache[ nID ];
+ SalData* pSalData = GetSalData();
+ HDCCache* pC = &pSalData->mpHDCCache[ nID ];
if ( pC->mhActBmp )
SelectObject( pC->mhDC, pC->mhSelBmp );
@@ -598,7 +597,7 @@ void ImplReleaseCachedDC( sal_uLong nID )
void ImplClearHDCCache( SalData* pData )
{
- for( sal_uLong i = 0; i < CACHESIZE_HDC; i++ )
+ for( ULONG i = 0; i < CACHESIZE_HDC; i++ )
{
HDCCache* pC = &pData->mpHDCCache[ i ];
@@ -620,22 +619,22 @@ void ImplClearHDCCache( SalData* pData )
// #100127# Fill point and flag memory from array of points which
// might also contain bezier control points for the PolyDraw() GDI method
// Make sure pWinPointAry and pWinFlagAry are big enough
-void ImplPreparePolyDraw( bool bCloseFigures,
- sal_uLong nPoly,
- const sal_uInt32* pPoints,
- const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry,
- POINT* pWinPointAry,
- BYTE* pWinFlagAry )
+void ImplPreparePolyDraw( bool bCloseFigures,
+ ULONG nPoly,
+ const ULONG* pPoints,
+ const SalPoint* const* pPtAry,
+ const BYTE* const* pFlgAry,
+ POINT* pWinPointAry,
+ BYTE* pWinFlagAry )
{
- sal_uLong nCurrPoly;
+ 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 ULONG nCurrPoints = *pPoints++;
const bool bHaveFlagArray( pCurrFlag );
- sal_uLong nCurrPoint;
+ ULONG nCurrPoint;
if( nCurrPoints )
{
@@ -691,11 +690,11 @@ void ImplPreparePolyDraw( bool bCloseFigures,
// =======================================================================
// #100127# draw an array of points which might also contain bezier control points
-void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+void ImplRenderPath( HDC hdc, ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
if( nPoints )
{
- sal_uInt16 i;
+ USHORT 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
@@ -727,29 +726,28 @@ WinSalGraphics::WinSalGraphics()
mhFonts[ i ] = 0;
mpWinFontData[ i ] = NULL;
mpWinFontEntry[ i ] = NULL;
- mfFontScale[ i ] = 1.0;
}
- mfCurrentFontScale = 1.0;
-
- mhDC = 0;
- mhPen = 0;
- mhBrush = 0;
- mhRegion = 0;
- mhDefPen = 0;
- mhDefBrush = 0;
- mhDefFont = 0;
- mhDefPal = 0;
- mpStdClipRgnData = NULL;
- mpLogFont = NULL;
- mpFontCharSets = NULL;
- mpFontAttrCache = NULL;
- mnFontCharSetCount = 0;
- mpFontKernPairs = NULL;
- mnFontKernPairCount = 0;
- mbFontKernInit = FALSE;
- mbXORMode = FALSE;
- mnPenWidth = GSL_PEN_WIDTH;
+ mfFontScale = 1.0;
+
+ mhDC = 0;
+ mhPen = 0;
+ mhBrush = 0;
+ mhRegion = 0;
+ mhDefPen = 0;
+ mhDefBrush = 0;
+ mhDefFont = 0;
+ mhDefPal = 0;
+ mpStdClipRgnData = NULL;
+ mpLogFont = NULL;
+ mpFontCharSets = NULL;
+ mpFontAttrCache = NULL;
+ mnFontCharSetCount = 0;
+ mpFontKernPairs = NULL;
+ mnFontKernPairCount = 0;
+ mbFontKernInit = FALSE;
+ mbXORMode = FALSE;
+ mnPenWidth = GSL_PEN_WIDTH;
}
// -----------------------------------------------------------------------
@@ -806,9 +804,9 @@ void WinSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
// -----------------------------------------------------------------------
-sal_uInt16 WinSalGraphics::GetBitCount() const
+USHORT WinSalGraphics::GetBitCount()
{
- return (sal_uInt16)GetDeviceCaps( mhDC, BITSPIXEL );
+ return (USHORT)GetDeviceCaps( mhDC, BITSPIXEL );
}
// -----------------------------------------------------------------------
@@ -850,7 +848,7 @@ void WinSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-bool WinSalGraphics::setClipRegion( const Region& i_rClip )
+void WinSalGraphics::BeginSetClipRegion( ULONG nRectCount )
{
if ( mhRegion )
{
@@ -858,143 +856,123 @@ bool WinSalGraphics::setClipRegion( const Region& i_rClip )
mhRegion = 0;
}
- if( i_rClip.HasPolyPolygon() )
+ ULONG nRectBufSize = sizeof(RECT)*nRectCount;
+ if ( nRectCount < SAL_CLIPRECT_COUNT )
{
- // 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 );
- }
+ 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;
+ SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
+ mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ mbFirstClipRect = TRUE;
+}
+
+
+// -----------------------------------------------------------------------
+
+BOOL WinSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
+{
+ if ( nWidth && nHeight )
{
- sal_uLong nRectCount = i_rClip.GetRectCount();
+ RECT* pRect = mpNextClipRect;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ long nRight = nX + nWidth;
+ long nBottom = nY + nHeight;
- sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
- if ( nRectCount < SAL_CLIPRECT_COUNT )
+ if ( mbFirstClipRect )
{
- if ( !mpStdClipRgnData )
- mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
- mpClipRgnData = mpStdClipRgnData;
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
+ mbFirstClipRect = FALSE;
}
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 ( nW && nH )
- {
- long nRight = nX + nW;
- long nBottom = nY + nH;
+ if ( nX < pBoundRect->left )
+ pBoundRect->left = (int)nX;
- 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;
+ if ( nY < pBoundRect->top )
+ pBoundRect->top = (int)nY;
- if ( nY < pBoundRect->top )
- pBoundRect->top = (int)nY;
+ if ( nRight > pBoundRect->right )
+ pBoundRect->right = (int)nRight;
- if ( nRight > pBoundRect->right )
- pBoundRect->right = (int)nRight;
+ if ( nBottom > pBoundRect->bottom )
+ pBoundRect->bottom = (int)nBottom;
+ }
- 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 );
+ }
- 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 )
- {
- RECT* pRect = &(mpClipRgnData->rdh.rcBound);
- mhRegion = CreateRectRgn( pRect->left, pRect->top,
- pRect->right, pRect->bottom );
- }
- else if( mpClipRgnData->rdh.nCount > 1 )
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+bool WinSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
+{
+ // TODO: implement and advertise OutDevSupport_B2DClip support
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
+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 ExtCreateRegion(...) is not supported
+ if( !mhRegion )
{
- sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
- mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
+ RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
- // if ExtCreateRegion(...) is not supported
- if( !mhRegion )
+ if( pHeader->nCount )
{
- RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
+ RECT* pRect = (RECT*) mpClipRgnData->Buffer;
+ mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ pRect++;
- if( pHeader->nCount )
+ for( ULONG n = 1; n < pHeader->nCount; n++, pRect++ )
{
- 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 );
- }
+ 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;
}
- if( mhRegion )
- SelectClipRgn( mhDC, mhRegion );
- return mhRegion != 0;
+ SelectClipRgn( mhDC, mhRegion );
}
// -----------------------------------------------------------------------
@@ -1015,9 +993,9 @@ void WinSalGraphics::SetLineColor()
mhDefPen = hOldPen;
// set new data
- mhPen = hNewPen;
- mbPen = FALSE;
- mbStockPen = TRUE;
+ mhPen = hNewPen;
+ mbPen = FALSE;
+ mbStockPen = TRUE;
}
// -----------------------------------------------------------------------
@@ -1025,18 +1003,18 @@ void WinSalGraphics::SetLineColor()
void WinSalGraphics::SetLineColor( SalColor nSalColor )
{
maLineColor = nSalColor;
- COLORREF nPenColor = PALETTERGB( SALCOLOR_RED( nSalColor ),
+ COLORREF nPenColor = PALETTERGB( SALCOLOR_RED( nSalColor ),
SALCOLOR_GREEN( nSalColor ),
SALCOLOR_BLUE( nSalColor ) );
- HPEN hNewPen = 0;
- sal_Bool bStockPen = FALSE;
+ HPEN hNewPen = 0;
+ BOOL bStockPen = FALSE;
// search for stock pen (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
SalData* pSalData = GetSalData();
- for ( sal_uInt16 i = 0; i < pSalData->mnStockPenCount; i++ )
+ for ( USHORT i = 0; i < pSalData->mnStockPenCount; i++ )
{
if ( nPenColor == pSalData->maStockPenColorAry[i] )
{
@@ -1073,10 +1051,10 @@ void WinSalGraphics::SetLineColor( SalColor nSalColor )
mhDefPen = hOldPen;
// set new data
- mnPenColor = nPenColor;
- mhPen = hNewPen;
- mbPen = TRUE;
- mbStockPen = bStockPen;
+ mnPenColor = nPenColor;
+ mhPen = hNewPen;
+ mbPen = TRUE;
+ mbStockPen = bStockPen;
}
// -----------------------------------------------------------------------
@@ -1097,8 +1075,8 @@ void WinSalGraphics::SetFillColor()
mhDefBrush = hOldBrush;
// set new data
- mhBrush = hNewBrush;
- mbBrush = FALSE;
+ mhBrush = hNewBrush;
+ mbBrush = FALSE;
mbStockBrush = TRUE;
}
@@ -1107,19 +1085,19 @@ void WinSalGraphics::SetFillColor()
void WinSalGraphics::SetFillColor( SalColor nSalColor )
{
maFillColor = nSalColor;
- SalData* pSalData = GetSalData();
- BYTE nRed = SALCOLOR_RED( nSalColor );
- BYTE nGreen = SALCOLOR_GREEN( nSalColor );
- BYTE nBlue = SALCOLOR_BLUE( nSalColor );
- COLORREF nBrushColor = PALETTERGB( nRed, nGreen, nBlue );
- HBRUSH hNewBrush = 0;
- sal_Bool bStockBrush = FALSE;
+ SalData* pSalData = GetSalData();
+ BYTE nRed = SALCOLOR_RED( nSalColor );
+ BYTE nGreen = SALCOLOR_GREEN( nSalColor );
+ BYTE nBlue = SALCOLOR_BLUE( nSalColor );
+ COLORREF nBrushColor = PALETTERGB( nRed, nGreen, nBlue );
+ HBRUSH hNewBrush = 0;
+ BOOL bStockBrush = FALSE;
// search for stock brush (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
- for ( sal_uInt16 i = 0; i < pSalData->mnStockBrushCount; i++ )
+ for ( USHORT i = 0; i < pSalData->mnStockBrushCount; i++ )
{
if ( nBrushColor == pSalData->maStockBrushColorAry[ i ] )
{
@@ -1202,8 +1180,8 @@ void WinSalGraphics::SetFillColor( SalColor nSalColor )
// set new data
mnBrushColor = nBrushColor;
- mhBrush = hNewBrush;
- mbBrush = TRUE;
+ mhBrush = hNewBrush;
+ mbBrush = TRUE;
mbStockBrush = bStockBrush;
}
@@ -1235,8 +1213,8 @@ void WinSalGraphics::drawPixel( long nX, long nY )
{
if ( mbXORMode )
{
- HBRUSH hBrush = CreateSolidBrush( mnPenColor );
- HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
+ HBRUSH hBrush = CreateSolidBrush( mnPenColor );
+ HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
PatBlt( mhDC, (int)nX, (int)nY, (int)1, (int)1, PATINVERT );
SelectBrush( mhDC, hOldBrush );
DeleteBrush( hBrush );
@@ -1260,8 +1238,8 @@ void WinSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
if ( mbXORMode )
{
- HBRUSH hBrush = CreateSolidBrush( nCol );
- HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
+ HBRUSH hBrush = CreateSolidBrush( nCol );
+ HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
PatBlt( mhDC, (int)nX, (int)nY, (int)1, (int)1, PATINVERT );
SelectBrush( mhDC, hOldBrush );
DeleteBrush( hBrush );
@@ -1301,8 +1279,8 @@ void WinSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
{
if ( mbXORMode )
{
- HBRUSH hBrush = CreateSolidBrush( mnPenColor );
- HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
+ HBRUSH hBrush = CreateSolidBrush( mnPenColor );
+ HBRUSH hOldBrush = SelectBrush( mhDC, hBrush );
PatBlt( mhDC, (int)nX2, (int)nY2, (int)1, (int)1, PATINVERT );
SelectBrush( mhDC, hOldBrush );
DeleteBrush( hBrush );
@@ -1326,9 +1304,9 @@ void WinSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
else
{
RECT aWinRect;
- aWinRect.left = nX;
- aWinRect.top = nY;
- aWinRect.right = nX+nWidth;
+ aWinRect.left = nX;
+ aWinRect.top = nY;
+ aWinRect.right = nX+nWidth;
aWinRect.bottom = nY+nHeight;
::FillRect( mhDC, &aWinRect, mhBrush );
}
@@ -1339,7 +1317,7 @@ void WinSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1354,7 +1332,7 @@ void WinSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1372,11 +1350,11 @@ void WinSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry )
{
- UINT aWinPointAry[SAL_POLYPOLYCOUNT_STACKBUF];
- UINT* pWinPointAry;
- UINT nPolyPolyPoints = 0;
- UINT nPoints;
- UINT i;
+ UINT aWinPointAry[SAL_POLYPOLYCOUNT_STACKBUF];
+ UINT* pWinPointAry;
+ UINT nPolyPolyPoints = 0;
+ UINT nPoints;
+ UINT i;
if ( nPoly <= SAL_POLYPOLYCOUNT_STACKBUF )
pWinPointAry = aWinPointAry;
@@ -1400,7 +1378,7 @@ void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphics::DrawPolyPolygon(): POINT != SalPoint" );
const SalPoint* pPolyAry;
- UINT n = 0;
+ UINT n = 0;
for ( i = 0; i < (UINT)nPoly; i++ )
{
nPoints = pWinPointAry[i];
@@ -1438,11 +1416,11 @@ void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint
// -----------------------------------------------------------------------
-#define SAL_POLY_STACKBUF 32
+#define SAL_POLY_STACKBUF 32
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
@@ -1459,17 +1437,17 @@ sal_Bool WinSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint*
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphics::DrawPolygonBezier(): POINT != SalPoint" );
- POINT aStackAry1[SAL_POLY_STACKBUF];
- BYTE aStackAry2[SAL_POLY_STACKBUF];
- POINT* pWinPointAry;
- BYTE* pWinFlagAry;
+ POINT aStackAry1[SAL_POLY_STACKBUF];
+ BYTE aStackAry2[SAL_POLY_STACKBUF];
+ POINT* pWinPointAry;
+ BYTE* pWinFlagAry;
if( nPoints > SAL_POLY_STACKBUF )
{
pWinPointAry = new POINT[ nPoints ];
@@ -1481,8 +1459,7 @@ sal_Bool WinSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* p
pWinFlagAry = aStackAry2;
}
- sal_uInt32 nPoints_i32(nPoints);
- ImplPreparePolyDraw(true, 1, &nPoints_i32, &pPtAry, &pFlgAry, pWinPointAry, pWinFlagAry);
+ ImplPreparePolyDraw(true, 1, &nPoints, &pPtAry, &pFlgAry, pWinPointAry, pWinFlagAry);
sal_Bool bRet( sal_False );
@@ -1519,15 +1496,15 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphics::DrawPolyPolygonBezier(): POINT != SalPoint" );
- sal_uLong nCurrPoly, nTotalPoints;
- const sal_uInt32* pCurrPoints = pPoints;
+ ULONG nCurrPoly, nTotalPoints;
+ const ULONG* pCurrPoints = pPoints;
for( nCurrPoly=0, nTotalPoints=0; nCurrPoly<nPoly; ++nCurrPoly )
nTotalPoints += *pCurrPoints++;
- POINT aStackAry1[SAL_POLY_STACKBUF];
- BYTE aStackAry2[SAL_POLY_STACKBUF];
- POINT* pWinPointAry;
- BYTE* pWinFlagAry;
+ POINT aStackAry1[SAL_POLY_STACKBUF];
+ BYTE aStackAry2[SAL_POLY_STACKBUF];
+ POINT* pWinPointAry;
+ BYTE* pWinFlagAry;
if( nTotalPoints > SAL_POLY_STACKBUF )
{
pWinPointAry = new POINT[ nTotalPoints ];
@@ -1568,15 +1545,15 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
// -----------------------------------------------------------------------
-#define POSTSCRIPT_BUFSIZE 0x4000 // MAXIMUM BUFSIZE EQ 0xFFFF
-#define POSTSCRIPT_BOUNDINGSEARCH 0x1000 // we only try to get the BoundingBox
+#define POSTSCRIPT_BUFSIZE 0x4000 // MAXIMUM BUFSIZE EQ 0xFFFF
+#define POSTSCRIPT_BOUNDINGSEARCH 0x1000 // we only try to get the BoundingBox
// in the first 4096 bytes
-static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, sal_uLong nComp, sal_uLong nSize )
+static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
{
while ( nComp-- >= nSize )
{
- sal_uLong i;
+ ULONG i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -1589,9 +1566,9 @@ static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, sal_uLong nComp, sal_u
return NULL;
}
-static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSize )
+static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
{
- sal_Bool bRetValue = FALSE;
+ BOOL bRetValue = FALSE;
BYTE* pDest = ImplSearchEntry( pSource, (BYTE*)"%%BoundingBox:", nSize, 14 );
if ( pDest )
{
@@ -1600,15 +1577,15 @@ static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSiz
int nSizeLeft = nSize - ( pDest - pSource );
if ( nSizeLeft > 100 )
- nSizeLeft = 100; // only 100 bytes following the bounding box will be checked
+ nSizeLeft = 100; // only 100 bytes following the bounding box will be checked
int i;
for ( i = 0; ( i < 4 ) && nSizeLeft; i++ )
{
- int nDivision = 1;
- sal_Bool bDivision = FALSE;
- sal_Bool bNegative = FALSE;
- sal_Bool bValid = TRUE;
+ int nDivision = 1;
+ BOOL bDivision = FALSE;
+ BOOL bNegative = FALSE;
+ BOOL bValid = TRUE;
while ( ( --nSizeLeft ) && ( *pDest == ' ' ) || ( *pDest == 0x9 ) ) pDest++;
BYTE nByte = *pDest;
@@ -1627,7 +1604,7 @@ static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSiz
break;
default :
if ( ( nByte < '0' ) || ( nByte > '9' ) )
- nSizeLeft = 1; // error parsing the bounding box values
+ nSizeLeft = 1; // error parsing the bounding box values
else if ( bValid )
{
if ( bDivision )
@@ -1651,9 +1628,9 @@ static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSiz
return bRetValue;
}
-sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
+BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
{
- sal_Bool bRetValue = FALSE;
+ BOOL bRetValue = FALSE;
if ( mbPrinter )
{
@@ -1661,13 +1638,13 @@ sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, v
if ( Escape( mhDC, QUERYESCSUPPORT, sizeof( int ), ( LPSTR )&nEscape, 0 ) )
{
- double nBoundingBox[4];
+ double nBoundingBox[4];
if ( ImplGetBoundingBox( nBoundingBox, (BYTE*)pPtr, nSize ) )
{
OStringBuffer aBuf( POSTSCRIPT_BUFSIZE );
- // reserve place for a sal_uInt16
+ // reserve place for a USHORT
aBuf.append( "aa" );
// #107797# Write out EPS encapsulation header
@@ -1745,15 +1722,15 @@ sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, v
// #107797# Write out buffer
// ----------------------------------------------------------------------------------
- *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
+ *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
// #107797# Write out EPS transformation code
// ----------------------------------------------------------------------------------
- double dM11 = nWidth / ( nBoundingBox[2] - nBoundingBox[0] );
- double dM22 = nHeight / (nBoundingBox[1] - nBoundingBox[3] );
- // reserve a sal_uInt16 again
+ double dM11 = nWidth / ( nBoundingBox[2] - nBoundingBox[0] );
+ double dM22 = nHeight / (nBoundingBox[1] - nBoundingBox[3] );
+ // reserve a USHORT again
aBuf.setLength( 2 );
aBuf.append( "\n\n[" );
aBuf.append( dM11 );
@@ -1765,14 +1742,14 @@ sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, v
aBuf.append( nY - ( dM22 * nBoundingBox[3] ) );
aBuf.append( "] concat\n"
"%%BeginDocument:\n" );
- *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
+ *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
// #107797# Write out actual EPS content
// ----------------------------------------------------------------------------------
- sal_uLong nToDo = nSize;
- sal_uLong nDoNow;
+ ULONG nToDo = nSize;
+ ULONG nDoNow;
while ( nToDo )
{
nDoNow = nToDo;
@@ -1780,9 +1757,9 @@ sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, v
nDoNow = POSTSCRIPT_BUFSIZE - 2;
// the following is based on the string buffer allocation
// of size POSTSCRIPT_BUFSIZE at construction time of aBuf
- *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)nDoNow;
+ *((USHORT*)aBuf.getStr()) = (USHORT)nDoNow;
memcpy( (void*)(aBuf.getStr() + 2), (BYTE*)pPtr + nSize - nToDo, nDoNow );
- sal_uLong nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
+ ULONG nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
if (!nResult )
break;
nToDo -= nResult;
@@ -1791,13 +1768,13 @@ sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, v
// #107797# Write out EPS encapsulation footer
// ----------------------------------------------------------------------------------
- // reserve a sal_uInt16 again
+ // reserve a USHORT 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" );
- *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
+ *((USHORT*)aBuf.getStr()) = (USHORT)( 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 447a00686125..e5d438972170 100644
--- a/vcl/win/source/gdi/salgdi2.cxx
+++ b/vcl/win/source/gdi/salgdi2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,7 +31,7 @@
#include <string.h>
#include <stdlib.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#include <tools/debug.hxx>
#include <wincomp.hxx>
#include <salbmp.h>
@@ -40,10 +40,6 @@
#include <salgdi.h>
#include <salframe.h>
-#include "vcl/salbtype.hxx"
-#include "vcl/bmpacc.hxx"
-#include "vcl/outdata.hxx"
-
bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
{
static bool bAllowForTest(true);
@@ -54,9 +50,6 @@ 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;
@@ -68,8 +61,8 @@ bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
void WinSalGraphics::copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics )
{
- HDC hSrcDC;
- DWORD nRop;
+ HDC hSrcDC;
+ DWORD nRop;
if ( pSrcGraphics )
hSrcDC = static_cast<WinSalGraphics*>(pSrcGraphics)->mhDC;
@@ -153,7 +146,7 @@ void ImplCalcOutSideRgn( const RECT& rSrcRect,
void WinSalGraphics::copyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
bool bRestoreClipRgn = false;
HRGN hOldClipRgn = 0;
@@ -166,18 +159,18 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
// compute and invalidate those parts that were either off-screen or covered by other windows
// while performing the above BitBlt
// those regions then have to be invalidated as they contain useless/wrong data
- RECT aSrcRect;
- RECT aClipRect;
- RECT aTempRect;
- RECT aTempRect2;
- HRGN hTempRgn;
- HWND hWnd;
- int nRgnType;
+ RECT aSrcRect;
+ RECT aClipRect;
+ RECT aTempRect;
+ RECT aTempRect2;
+ HRGN hTempRgn;
+ HWND hWnd;
+ int nRgnType;
// restrict srcRect to this window (calc intersection)
- aSrcRect.left = (int)nSrcX;
- aSrcRect.top = (int)nSrcY;
- aSrcRect.right = aSrcRect.left+(int)nSrcWidth;
+ aSrcRect.left = (int)nSrcX;
+ aSrcRect.top = (int)nSrcY;
+ aSrcRect.right = aSrcRect.left+(int)nSrcWidth;
aSrcRect.bottom = aSrcRect.top+(int)nSrcHeight;
GetClientRect( mhWnd, &aClipRect );
if ( IntersectRect( &aSrcRect, &aSrcRect, &aClipRect ) )
@@ -187,9 +180,9 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
aPt.x = 0;
aPt.y = 0;
ClientToScreen( mhWnd, &aPt );
- aSrcRect.left += aPt.x;
- aSrcRect.top += aPt.y;
- aSrcRect.right += aPt.x;
+ aSrcRect.left += aPt.x;
+ aSrcRect.top += aPt.y;
+ aSrcRect.right += aPt.x;
aSrcRect.bottom += aPt.y;
hInvalidateRgn = 0;
@@ -216,8 +209,8 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
aPt2.x = 0;
aPt2.y = 0;
ClientToScreen( hWndTopWindow, &aPt2 );
- aTempRect.left += aPt2.x;
- aTempRect.top += aPt2.y;
+ aTempRect.left += aPt2.x;
+ aTempRect.top += aPt2.y;
aTempRect.right += aPt2.x;
aTempRect.bottom += aPt2.y;
IntersectRect( &aTempRect3, &aTempRect3, &aTempRect );
@@ -335,8 +328,8 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
// MainThread ist, damit es beim Bearbeiten der
// Paint-Message keinen Deadlock gibt, da der
// SolarMutex durch diesen Thread schon gelockt ist
- SalData* pSalData = GetSalData();
- DWORD nCurThreadId = GetCurrentThreadId();
+ SalData* pSalData = GetSalData();
+ DWORD nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId == nCurThreadId )
UpdateWindow( mhWnd );
}
@@ -350,14 +343,14 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
void ImplDrawBitmap( HDC hDC,
const SalTwoRect* pPosAry, const WinSalBitmap& rSalBitmap,
- sal_Bool bPrinter, int nDrawMode )
+ BOOL bPrinter, int nDrawMode )
{
if( hDC )
{
- HGLOBAL hDrawDIB;
- HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
- WinSalBitmap* pTmpSalBmp = NULL;
- sal_Bool bPrintDDB = ( bPrinter && hDrawDDB );
+ HGLOBAL hDrawDIB;
+ HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
+ WinSalBitmap* pTmpSalBmp = NULL;
+ BOOL bPrintDDB = ( bPrinter && hDrawDDB );
if( bPrintDDB )
{
@@ -370,11 +363,11 @@ void ImplDrawBitmap( HDC hDC,
if( hDrawDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDrawDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
- PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDrawDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
rSalBitmap.ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGBQUAD );
- const int nOldStretchMode = SetStretchBltMode( hDC, STRETCH_DELETESCANS );
+ const int nOldStretchMode = SetStretchBltMode( hDC, STRETCH_DELETESCANS );
StretchDIBits( hDC,
(int)pPosAry->mnDestX, (int)pPosAry->mnDestY,
@@ -388,31 +381,15 @@ void ImplDrawBitmap( HDC hDC,
}
else if( hDrawDDB && !bPrintDDB )
{
- HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_DRAW, hDrawDDB );
- COLORREF nOldBkColor = RGB(0xFF,0xFF,0xFF);
- COLORREF nOldTextColor = RGB(0,0,0);
- sal_Bool bMono = ( rSalBitmap.GetBitCount() == 1 );
+ HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_DRAW, hDrawDDB );
+ COLORREF nOldBkColor = RGB(0xFF,0xFF,0xFF);
+ COLORREF nOldTextColor = RGB(0,0,0);
+ BOOL bMono = ( rSalBitmap.GetBitCount() == 1 );
if( bMono )
{
- COLORREF nBkColor = RGB( 0xFF, 0xFF, 0xFF );
- COLORREF nTextColor = RGB( 0x00, 0x00, 0x00 );
- //fdo#33455 handle 1 bit depth pngs with palette entries
- //to set fore/back colors
- if (const BitmapBuffer* pBitmapBuffer = const_cast<WinSalBitmap&>(rSalBitmap).AcquireBuffer(true))
- {
- const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
- if (rPalette.GetEntryCount() == 2)
- {
- SalColor nCol;
- nCol = ImplColorToSal(rPalette[0]);
- nTextColor = RGB( SALCOLOR_RED(nCol), SALCOLOR_GREEN(nCol), SALCOLOR_BLUE(nCol) );
- nCol = ImplColorToSal(rPalette[1]);
- nBkColor = RGB( SALCOLOR_RED(nCol), SALCOLOR_GREEN(nCol), SALCOLOR_BLUE(nCol) );
- }
- }
- nOldBkColor = SetBkColor( hDC, nBkColor );
- nOldTextColor = ::SetTextColor( hDC, nTextColor );
+ nOldBkColor = SetBkColor( hDC, RGB( 0xFF, 0xFF, 0xFF ) );
+ nOldTextColor = ::SetTextColor( hDC, RGB( 0x00, 0x00, 0x00 ) );
}
if ( (pPosAry->mnSrcWidth == pPosAry->mnDestWidth) &&
@@ -474,19 +451,19 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
const WinSalBitmap& rSalBitmap = static_cast<const WinSalBitmap&>(rSSalBitmap);
- WinSalBitmap* pMask = new WinSalBitmap;
+ WinSalBitmap* pMask = new WinSalBitmap;
const Point aPoint;
- const Size aSize( rSalBitmap.GetSize() );
- HBITMAP hMaskBitmap = CreateBitmap( (int) aSize.Width(), (int) aSize.Height(), 1, 1, NULL );
- HDC hMaskDC = ImplGetCachedDC( CACHED_HDC_1, hMaskBitmap );
- const BYTE cRed = SALCOLOR_RED( nTransparentColor );
- const BYTE cGreen = SALCOLOR_GREEN( nTransparentColor );
- const BYTE cBlue = SALCOLOR_BLUE( nTransparentColor );
+ const Size aSize( rSalBitmap.GetSize() );
+ HBITMAP hMaskBitmap = CreateBitmap( (int) aSize.Width(), (int) aSize.Height(), 1, 1, NULL );
+ HDC hMaskDC = ImplGetCachedDC( CACHED_HDC_1, hMaskBitmap );
+ const BYTE cRed = SALCOLOR_RED( nTransparentColor );
+ const BYTE cGreen = SALCOLOR_GREEN( nTransparentColor );
+ const BYTE cBlue = SALCOLOR_BLUE( nTransparentColor );
if( rSalBitmap.ImplGethDDB() )
{
- HDC hSrcDC = ImplGetCachedDC( CACHED_HDC_2, rSalBitmap.ImplGethDDB() );
- COLORREF aOldCol = SetBkColor( hSrcDC, RGB( cRed, cGreen, cBlue ) );
+ HDC hSrcDC = ImplGetCachedDC( CACHED_HDC_2, rSalBitmap.ImplGethDDB() );
+ COLORREF aOldCol = SetBkColor( hSrcDC, RGB( cRed, cGreen, cBlue ) );
BitBlt( hMaskDC, 0, 0, (int) aSize.Width(), (int) aSize.Height(), hSrcDC, 0, 0, SRCCOPY );
@@ -495,12 +472,12 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
}
else
{
- WinSalBitmap* pTmpSalBmp = new WinSalBitmap;
+ WinSalBitmap* pTmpSalBmp = new WinSalBitmap;
if( pTmpSalBmp->Create( rSalBitmap, this ) )
{
- HDC hSrcDC = ImplGetCachedDC( CACHED_HDC_2, pTmpSalBmp->ImplGethDDB() );
- COLORREF aOldCol = SetBkColor( hSrcDC, RGB( cRed, cGreen, cBlue ) );
+ HDC hSrcDC = ImplGetCachedDC( CACHED_HDC_2, pTmpSalBmp->ImplGethDDB() );
+ COLORREF aOldCol = SetBkColor( hSrcDC, RGB( cRed, cGreen, cBlue ) );
BitBlt( hMaskDC, 0, 0, (int) aSize.Width(), (int) aSize.Height(), hSrcDC, 0, 0, SRCCOPY );
@@ -531,14 +508,14 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
const WinSalBitmap& rSalBitmap = static_cast<const WinSalBitmap&>(rSSalBitmap);
const WinSalBitmap& rTransparentBitmap = static_cast<const WinSalBitmap&>(rSTransparentBitmap);
- SalTwoRect aPosAry = *pPosAry;
- int nDstX = (int)aPosAry.mnDestX;
- int nDstY = (int)aPosAry.mnDestY;
- int nDstWidth = (int)aPosAry.mnDestWidth;
- int nDstHeight = (int)aPosAry.mnDestHeight;
- HDC hDC = mhDC;
- HBITMAP hMemBitmap = 0;
- HBITMAP hMaskBitmap = 0;
+ SalTwoRect aPosAry = *pPosAry;
+ int nDstX = (int)aPosAry.mnDestX;
+ int nDstY = (int)aPosAry.mnDestY;
+ int nDstWidth = (int)aPosAry.mnDestWidth;
+ int nDstHeight = (int)aPosAry.mnDestHeight;
+ HDC hDC = mhDC;
+ HBITMAP hMemBitmap = 0;
+ HBITMAP hMaskBitmap = 0;
if( ( nDstWidth > CACHED_HDC_DEFEXT ) || ( nDstHeight > CACHED_HDC_DEFEXT ) )
{
@@ -577,7 +554,7 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
}
else
{
- BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCAND );
+ BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCAND );
// now MemDC contains background with masked-out bitmap area
ImplDrawBitmap( hMaskDC, &aPosAry, rSalBitmap, FALSE, SRCERASE );
// now MaskDC contains the bitmap area with black background
@@ -601,7 +578,7 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
// -----------------------------------------------------------------------
bool WinSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
- const SalBitmap& rSrcBitmap,
+ const SalBitmap& rSrcBitmap,
const SalBitmap& rAlphaBmp )
{
(void)rTR; (void)rSrcBitmap; (void)rAlphaBmp;
@@ -613,7 +590,7 @@ bool WinSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
// -----------------------------------------------------------------------
-bool WinSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
+bool WinSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
if( mbPen || !mbBrush || mbXORMode )
@@ -631,7 +608,7 @@ bool WinSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
// hMemDC contains a 1x1 bitmap of the right color - stretch-blit
// that to dest hdc
- bool bRet = AlphaBlend( mhDC, nX, nY, nWidth, nHeight,
+ bool bRet = AlphaBlend( mhDC, nX, nY, nWidth, nHeight,
hMemDC, 0,0,1,1,
aFunc ) == TRUE;
@@ -650,13 +627,13 @@ void WinSalGraphics::drawMask( const SalTwoRect* pPosAry,
const WinSalBitmap& rSalBitmap = static_cast<const WinSalBitmap&>(rSSalBitmap);
- SalTwoRect aPosAry = *pPosAry;
- const BYTE cRed = SALCOLOR_RED( nMaskColor );
- const BYTE cGreen = SALCOLOR_GREEN( nMaskColor );
- const BYTE cBlue = SALCOLOR_BLUE( nMaskColor );
- HDC hDC = mhDC;
- HBRUSH hMaskBrush = CreateSolidBrush( RGB( cRed, cGreen, cBlue ) );
- HBRUSH hOldBrush = SelectBrush( hDC, hMaskBrush );
+ SalTwoRect aPosAry = *pPosAry;
+ const BYTE cRed = SALCOLOR_RED( nMaskColor );
+ const BYTE cGreen = SALCOLOR_GREEN( nMaskColor );
+ const BYTE cBlue = SALCOLOR_BLUE( nMaskColor );
+ HDC hDC = mhDC;
+ HBRUSH hMaskBrush = CreateSolidBrush( RGB( cRed, cGreen, cBlue ) );
+ HBRUSH hOldBrush = SelectBrush( hDC, hMaskBrush );
// bei Paletten-Displays hat WIN/WNT offenbar ein kleines Problem,
// die Farben der Maske richtig auf die Palette abzubilden,
@@ -686,10 +663,10 @@ SalBitmap* WinSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
nDX = labs( nDX );
nDY = labs( nDY );
- HDC hDC = mhDC;
+ HDC hDC = mhDC;
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
- HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- sal_Bool bRet;
+ HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
+ BOOL bRet;
DWORD err = 0;
bRet = BitBlt( hBmpDC, 0, 0, (int) nDX, (int) nDY, hDC, (int) nX, (int) nY, SRCCOPY ) ? TRUE : FALSE;
@@ -735,10 +712,10 @@ void WinSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
{
if ( nFlags & SAL_INVERT_TRACKFRAME )
{
- HPEN hDotPen = CreatePen( PS_DOT, 0, 0 );
- HPEN hOldPen = SelectPen( mhDC, hDotPen );
- HBRUSH hOldBrush = SelectBrush( mhDC, GetStockBrush( NULL_BRUSH ) );
- int nOldROP = SetROP2( mhDC, R2_NOT );
+ HPEN hDotPen = CreatePen( PS_DOT, 0, 0 );
+ HPEN hOldPen = SelectPen( mhDC, hDotPen );
+ HBRUSH hOldBrush = SelectBrush( mhDC, GetStockBrush( NULL_BRUSH ) );
+ int nOldROP = SetROP2( mhDC, R2_NOT );
WIN_Rectangle( mhDC, (int)nX, (int)nY, (int)(nX+nWidth), (int)(nY+nHeight) );
@@ -766,24 +743,24 @@ void WinSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
else
{
RECT aRect;
- aRect.left = (int)nX;
- aRect.top = (int)nY;
- aRect.right = (int)nX+nWidth;
- aRect.bottom = (int)nY+nHeight;
+ aRect.left = (int)nX;
+ aRect.top = (int)nY;
+ aRect.right = (int)nX+nWidth;
+ aRect.bottom = (int)nY+nHeight;
::InvertRect( mhDC, &aRect );
}
}
// -----------------------------------------------------------------------
-void WinSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void WinSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
- HPEN hPen;
- HPEN hOldPen;
- HBRUSH hBrush;
- HBRUSH hOldBrush = 0;
- COLORREF nOldTextColor RGB(0,0,0);
- int nOldROP = SetROP2( mhDC, R2_NOT );
+ HPEN hPen;
+ HPEN hOldPen;
+ HBRUSH hBrush;
+ HBRUSH hOldBrush = 0;
+ COLORREF nOldTextColor RGB(0,0,0);
+ int nOldROP = SetROP2( mhDC, R2_NOT );
if ( nSalFlags & SAL_INVERT_TRACKFRAME )
hPen = CreatePen( PS_DOT, 0, 0 );
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index f87cfaec386f..ae62c6eb7894 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,8 +32,11 @@
#include <string.h>
#include <malloc.h>
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
#include <vcl/sysdata.hxx>
-#include <svsys.h>
+#include "tools/svwin.h"
#include "wincomp.hxx"
#include "saldata.hxx"
@@ -45,8 +48,8 @@
#include "vcl/fontsubset.hxx"
#include "vcl/sallayout.hxx"
-#include "vcl/outdev.h" // for ImplGlyphFallbackFontSubstitution
-#include "unotools/fontcfg.hxx" // for IMPL_FONT_ATTR_SYMBOL
+#include "vcl/outdev.h" // for ImplGlyphFallbackFontSubstitution
+#include "unotools/fontcfg.hxx" // for IMPL_FONT_ATTR_SYMBOL
#include "rtl/logfile.hxx"
#include "rtl/tencinfo.h"
@@ -76,7 +79,8 @@
#endif
#ifdef ENABLE_GRAPHITE
-#include <graphite2/Font.h>
+#include <graphite/GrClient.h>
+#include <graphite/WinFont.h>
#endif
#include <vector>
@@ -122,13 +126,13 @@ typedef std::map< String, ImplDevFontAttributes > FontAttrMap;
class ImplFontAttrCache
{
private:
- FontAttrMap aFontAttributes;
- rtl::OUString aCacheFileName;
- String aBaseURL;
- sal_Bool bModified;
+ FontAttrMap aFontAttributes;
+ rtl::OUString aCacheFileName;
+ String aBaseURL;
+ BOOL bModified;
protected:
- String OptimizeURL( const String& rURL ) const;
+ String OptimizeURL( const String& rURL ) const;
enum{ MAGIC = 0x12349876 }; // change if fontattrcache format changes
@@ -143,7 +147,7 @@ public:
ImplFontAttrCache::ImplFontAttrCache( const String& rFileNameURL, const String& rBaseURL ) : aBaseURL( rBaseURL )
{
bModified = FALSE;
- aBaseURL.ToLowerAscii(); // Windows only, no problem...
+ aBaseURL.ToLowerAscii(); // Windows only, no problem...
// open the cache file
osl::FileBase::getSystemPathFromFileURL( rFileNameURL, aCacheFileName );
@@ -209,7 +213,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
aCacheFile.WriteByteStringLine( rDFA.maStyleName, RTL_TEXTENCODING_UTF8 );
- ++aIter;
+ aIter++;
}
// EOF Marker
String aEmptyStr;
@@ -221,7 +225,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
String ImplFontAttrCache::OptimizeURL( const String& rURL ) const
{
String aOptimizedFontFileURL( rURL );
- aOptimizedFontFileURL.ToLowerAscii(); // Windows only, no problem...
+ aOptimizedFontFileURL.ToLowerAscii(); // Windows only, no problem...
if ( aOptimizedFontFileURL.CompareTo( aBaseURL, aBaseURL.Len() ) == COMPARE_EQUAL )
aOptimizedFontFileURL = aOptimizedFontFileURL.Copy( aBaseURL.Len() );
return aOptimizedFontFileURL;
@@ -254,20 +258,20 @@ void ImplFontAttrCache::AddFontAttr( const String& rFontFileName, const ImplDevF
class RawFontData
{
public:
- explicit RawFontData( HDC, DWORD nTableTag=0 );
+ explicit RawFontData( HDC, DWORD nTableTag=0 );
~RawFontData() { delete[] mpRawBytes; }
- const unsigned char* get() const { return mpRawBytes; }
- const unsigned char* steal() { unsigned char* p = mpRawBytes; mpRawBytes = NULL; return p; }
- const int size() const { return mnByteCount; }
+ const unsigned char* get() const { return mpRawBytes; }
+ const unsigned char* steal() { unsigned char* p = mpRawBytes; mpRawBytes = NULL; return p; }
+ const int size() const { return mnByteCount; }
private:
- unsigned char* mpRawBytes;
- int mnByteCount;
+ unsigned char* mpRawBytes;
+ int mnByteCount;
};
RawFontData::RawFontData( HDC hDC, DWORD nTableTag )
-: mpRawBytes( NULL )
-, mnByteCount( 0 )
+: mpRawBytes( NULL )
+, mnByteCount( 0 )
{
// get required size in bytes
mnByteCount = ::GetFontData( hDC, nTableTag, 0, NULL, 0 );
@@ -331,77 +335,77 @@ struct Unicode2LangType
// map unicode ranges to languages supported by OOo
// NOTE: due to the binary search used this list must be sorted by mnMinCode
static Unicode2LangType aLangFromCodeChart[]= {
- {0x0000, 0x007F, LANGUAGE_ENGLISH}, // Basic Latin
- {0x0080, 0x024F, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B
- {0x0250, 0x02AF, LANGUAGE_SYSTEM}, // IPA Extensions
- {0x0370, 0x03FF, LANGUAGE_GREEK}, // Greek
- {0x0590, 0x05FF, LANGUAGE_HEBREW}, // Hebrew
- {0x0600, 0x06FF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic
- {0x0900, 0x097F, LANGUAGE_HINDI}, // Devanagari
- {0x0980, 0x09FF, LANGUAGE_BENGALI}, // Bengali
- {0x0A80, 0x0AFF, LANGUAGE_GUJARATI}, // Gujarati
- {0x0B00, 0x0B7F, LANGUAGE_ORIYA}, // Oriya
- {0x0B80, 0x0BFF, LANGUAGE_TAMIL}, // Tamil
- {0x0C00, 0x0C7F, LANGUAGE_TELUGU}, // Telugu
- {0x0C80, 0x0CFF, LANGUAGE_KANNADA}, // Kannada
- {0x0D00, 0x0D7F, LANGUAGE_MALAYALAM}, // Malayalam
- {0x0D80, 0x0D7F, LANGUAGE_SINHALESE_SRI_LANKA}, // Sinhala
- {0x0E00, 0x0E7F, LANGUAGE_THAI}, // Thai
- {0x0E80, 0x0EFF, LANGUAGE_LAO}, // Lao
- {0x0F00, 0x0FFF, LANGUAGE_TIBETAN}, // Tibetan
- {0x1000, 0x109F, LANGUAGE_BURMESE}, // Burmese
- {0x10A0, 0x10FF, LANGUAGE_GEORGIAN}, // Georgian
- {0x1100, 0x11FF, LANGUAGE_KOREAN}, // Hangul Jamo, Korean-specific
-// {0x1200, 0x139F, LANGUAGE_AMHARIC_ETHIOPIA}, // Ethiopic
-// {0x1200, 0x139F, LANGUAGE_TIGRIGNA_ETHIOPIA}, // Ethiopic
+ {0x0000, 0x007F, LANGUAGE_ENGLISH}, // Basic Latin
+ {0x0080, 0x024F, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B
+ {0x0250, 0x02AF, LANGUAGE_SYSTEM}, // IPA Extensions
+ {0x0370, 0x03FF, LANGUAGE_GREEK}, // Greek
+ {0x0590, 0x05FF, LANGUAGE_HEBREW}, // Hebrew
+ {0x0600, 0x06FF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic
+ {0x0900, 0x097F, LANGUAGE_HINDI}, // Devanagari
+ {0x0980, 0x09FF, LANGUAGE_BENGALI}, // Bengali
+ {0x0A80, 0x0AFF, LANGUAGE_GUJARATI}, // Gujarati
+ {0x0B00, 0x0B7F, LANGUAGE_ORIYA}, // Oriya
+ {0x0B80, 0x0BFF, LANGUAGE_TAMIL}, // Tamil
+ {0x0C00, 0x0C7F, LANGUAGE_TELUGU}, // Telugu
+ {0x0C80, 0x0CFF, LANGUAGE_KANNADA}, // Kannada
+ {0x0D00, 0x0D7F, LANGUAGE_MALAYALAM}, // Malayalam
+ {0x0D80, 0x0D7F, LANGUAGE_SINHALESE_SRI_LANKA}, // Sinhala
+ {0x0E00, 0x0E7F, LANGUAGE_THAI}, // Thai
+ {0x0E80, 0x0EFF, LANGUAGE_LAO}, // Lao
+ {0x0F00, 0x0FFF, LANGUAGE_TIBETAN}, // Tibetan
+ {0x1000, 0x109F, LANGUAGE_BURMESE}, // Burmese
+ {0x10A0, 0x10FF, LANGUAGE_GEORGIAN}, // Georgian
+ {0x1100, 0x11FF, LANGUAGE_KOREAN}, // Hangul Jamo, Korean-specific
+// {0x1200, 0x139F, LANGUAGE_AMHARIC_ETHIOPIA}, // Ethiopic
+// {0x1200, 0x139F, LANGUAGE_TIGRIGNA_ETHIOPIA}, // Ethiopic
{0x13A0, 0x13FF, LANGUAGE_CHEROKEE_UNITED_STATES}, // Cherokee
-// {0x1400, 0x167F, LANGUAGE_CANADIAN_ABORIGINAL}, // Canadian Aboriginial Syllabics
-// {0x1680, 0x169F, LANGUAGE_OGHAM}, // Ogham
-// {0x16A0, 0x16F0, LANGUAGE_RUNIC}, // Runic
-// {0x1700, 0x171F, LANGUAGE_TAGALOG}, // Tagalog
-// {0x1720, 0x173F, LANGUAGE_HANUNOO}, // Hanunoo
-// {0x1740, 0x175F, LANGUAGE_BUHID}, // Buhid
-// {0x1760, 0x177F, LANGUAGE_TAGBANWA}, // Tagbanwa
- {0x1780, 0x17FF, LANGUAGE_KHMER}, // Khmer
- {0x18A0, 0x18AF, LANGUAGE_MONGOLIAN}, // Mongolian
-// {0x1900, 0x194F, LANGUAGE_LIMBU}, // Limbu
-// {0x1950, 0x197F, LANGUAGE_TAILE}, // Tai Le
-// {0x1980, 0x19DF, LANGUAGE_TAILUE}, // Tai Lue
- {0x19E0, 0x19FF, LANGUAGE_KHMER}, // Khmer Symbols
-// {0x1A00, 0x1A1F, LANGUAGE_BUGINESE}, // Buginese/Lontara
-// {0x1B00, 0x1B7F, LANGUAGE_BALINESE}, // Balinese
-// {0x1D00, 0x1DFF, LANGUAGE_NONE}, // Phonetic Symbols
- {0x1E00, 0x1EFF, LANGUAGE_ENGLISH}, // Latin Extended Additional
- {0x1F00, 0x1FFF, LANGUAGE_GREEK}, // Greek Extended
- {0x2C60, 0x2C7F, LANGUAGE_ENGLISH}, // Latin Extended-C
- {0x2E80, 0x2FFf, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters
- {0x3000, 0x303F, LANGUAGE_DEFAULT_CJK}, // CJK Symbols and punctuation
- {0x3040, 0x30FF, LANGUAGE_JAPANESE}, // Japanese Hiragana + Katakana
- {0x3100, 0x312F, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo
- {0x3130, 0x318F, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific
- {0x3190, 0x319F, LANGUAGE_JAPANESE}, // Kanbun
- {0x31A0, 0x31BF, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended
- {0x31C0, 0x31EF, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs
- {0x31F0, 0x31FF, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions
- {0x3200, 0x321F, LANGUAGE_KOREAN}, // Parenthesized Hangul
- {0x3220, 0x325F, LANGUAGE_DEFAULT_CJK}, // Parenthesized Ideographs
- {0x3260, 0x327F, LANGUAGE_KOREAN}, // Circled Hangul
- {0x3280, 0x32CF, LANGUAGE_DEFAULT_CJK}, // Circled Ideographs
- {0x32d0, 0x32FF, LANGUAGE_JAPANESE}, // Japanese Circled Katakana
- {0x3400, 0x4DBF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A
- {0x4E00, 0x9FCF, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs
- {0xA720, 0xA7FF, LANGUAGE_ENGLISH}, // Latin Extended-D
- {0xAC00, 0xD7AF, LANGUAGE_KOREAN}, // Hangul Syllables, Korean-specific
- {0xF900, 0xFAFF, LANGUAGE_DEFAULT_CJK}, // CJK Compatibility Ideographs
- {0xFB00, 0xFB4F, LANGUAGE_HEBREW}, // Hebrew Presentation Forms
- {0xFB50, 0xFDFF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A
- {0xFE70, 0xFEFE, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B
- {0xFF65, 0xFF9F, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant
- {0xFFA0, 0xFFDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant
- {0x10140, 0x1018F, LANGUAGE_GREEK}, // Ancient Greak numbers
- {0x1D200, 0x1D24F, LANGUAGE_GREEK}, // Ancient Greek Musical
- {0x20000, 0x2A6DF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension B
- {0x2F800, 0x2FA1F, LANGUAGE_DEFAULT_CJK} // CJK Compatibility Ideographs Supplement
+// {0x1400, 0x167F, LANGUAGE_CANADIAN_ABORIGINAL}, // Canadian Aboriginial Syllabics
+// {0x1680, 0x169F, LANGUAGE_OGHAM}, // Ogham
+// {0x16A0, 0x16F0, LANGUAGE_RUNIC}, // Runic
+// {0x1700, 0x171F, LANGUAGE_TAGALOG}, // Tagalog
+// {0x1720, 0x173F, LANGUAGE_HANUNOO}, // Hanunoo
+// {0x1740, 0x175F, LANGUAGE_BUHID}, // Buhid
+// {0x1760, 0x177F, LANGUAGE_TAGBANWA}, // Tagbanwa
+ {0x1780, 0x17FF, LANGUAGE_KHMER}, // Khmer
+ {0x18A0, 0x18AF, LANGUAGE_MONGOLIAN}, // Mongolian
+// {0x1900, 0x194F, LANGUAGE_LIMBU}, // Limbu
+// {0x1950, 0x197F, LANGUAGE_TAILE}, // Tai Le
+// {0x1980, 0x19DF, LANGUAGE_TAILUE}, // Tai Lue
+ {0x19E0, 0x19FF, LANGUAGE_KHMER}, // Khmer Symbols
+// {0x1A00, 0x1A1F, LANGUAGE_BUGINESE}, // Buginese/Lontara
+// {0x1B00, 0x1B7F, LANGUAGE_BALINESE}, // Balinese
+// {0x1D00, 0x1DFF, LANGUAGE_NONE}, // Phonetic Symbols
+ {0x1E00, 0x1EFF, LANGUAGE_ENGLISH}, // Latin Extended Additional
+ {0x1F00, 0x1FFF, LANGUAGE_GREEK}, // Greek Extended
+ {0x2C60, 0x2C7F, LANGUAGE_ENGLISH}, // Latin Extended-C
+ {0x2E80, 0x2FFf, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters
+ {0x3000, 0x303F, LANGUAGE_DEFAULT_CJK}, // CJK Symbols and punctuation
+ {0x3040, 0x30FF, LANGUAGE_JAPANESE}, // Japanese Hiragana + Katakana
+ {0x3100, 0x312F, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo
+ {0x3130, 0x318F, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific
+ {0x3190, 0x319F, LANGUAGE_JAPANESE}, // Kanbun
+ {0x31A0, 0x31BF, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended
+ {0x31C0, 0x31EF, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs
+ {0x31F0, 0x31FF, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions
+ {0x3200, 0x321F, LANGUAGE_KOREAN}, // Parenthesized Hangul
+ {0x3220, 0x325F, LANGUAGE_DEFAULT_CJK}, // Parenthesized Ideographs
+ {0x3260, 0x327F, LANGUAGE_KOREAN}, // Circled Hangul
+ {0x3280, 0x32CF, LANGUAGE_DEFAULT_CJK}, // Circled Ideographs
+ {0x32d0, 0x32FF, LANGUAGE_JAPANESE}, // Japanese Circled Katakana
+ {0x3400, 0x4DBF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A
+ {0x4E00, 0x9FCF, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs
+ {0xA720, 0xA7FF, LANGUAGE_ENGLISH}, // Latin Extended-D
+ {0xAC00, 0xD7AF, LANGUAGE_KOREAN}, // Hangul Syllables, Korean-specific
+ {0xF900, 0xFAFF, LANGUAGE_DEFAULT_CJK}, // CJK Compatibility Ideographs
+ {0xFB00, 0xFB4F, LANGUAGE_HEBREW}, // Hebrew Presentation Forms
+ {0xFB50, 0xFDFF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A
+ {0xFE70, 0xFEFE, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B
+ {0xFF65, 0xFF9F, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant
+ {0xFFA0, 0xFFDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant
+ {0x10140, 0x1018F, LANGUAGE_GREEK}, // Ancient Greak numbers
+ {0x1D200, 0x1D24F, LANGUAGE_GREEK}, // Ancient Greek Musical
+ {0x20000, 0x2A6DF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension B
+ {0x2F800, 0x2FA1F, LANGUAGE_DEFAULT_CJK} // CJK Compatibility Ideographs Supplement
};
// get language matching to the missing char
@@ -429,7 +433,7 @@ LanguageType MapCharToLanguage( sal_UCS4 uChar )
nDefaultLang = (LanguageType)rtl_str_toInt32( aKeyValBuf, 16 );
// TODO: use the default-CJK language selected in
- // Tools->Options->LangSettings->Languages when it becomes available here
+ // Tools->Options->LangSettings->Languages when it becomes available here
if( !nDefaultLang )
nDefaultLang = Application::GetSettings().GetUILanguage();
@@ -466,7 +470,7 @@ LanguageType MapCharToLanguage( sal_UCS4 uChar )
while( nLow <= nHigh )
{
int nMiddle = (nHigh + nLow) / 2;
- if( uChar < aLangFromCodeChart[ nMiddle].mnMinCode )
+ if( uChar < aLangFromCodeChart[ nMiddle].mnMinCode )
nHigh = nMiddle - 1;
else if( uChar > aLangFromCodeChart[ nMiddle].mnMaxCode )
nLow = nMiddle + 1;
@@ -481,7 +485,7 @@ class WinGlyphFallbackSubstititution
: public ImplGlyphFallbackFontSubstitution
{
public:
- explicit WinGlyphFallbackSubstititution( HDC );
+ explicit WinGlyphFallbackSubstititution( HDC );
bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingChars ) const;
private:
@@ -490,7 +494,7 @@ private:
};
inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC )
-: mhDC( hDC )
+: mhDC( hDC )
{}
void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
@@ -513,7 +517,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
// create HFONT from log font
HFONT hNewFont = ::CreateFontIndirectW( &aLogFont );
- // select the new font into device
+ // select the new font into device
HFONT hOldFont = ::SelectFont( mhDC, hNewFont );
// read CMAP table to update their pCharMap
@@ -530,18 +534,16 @@ 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: tolerate more missing characters?
+ // static const int nMaxMatchCount = 1; // TODO: check more missing characters?
const sal_Int32 nStrLen = rMissingChars.getLength();
for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx )
- {
+ {
const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx );
nMatchCount += pCharMap->HasChar( uChar );
break; // for now
}
- pCharMap->DeReference();
const bool bHasMatches = (nMatchCount > 0);
return bHasMatches;
@@ -553,14 +555,13 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
{
// guess a locale matching to the missing chars
com::sun::star::lang::Locale aLocale;
- LanguageType eLang = LANGUAGE_DONTKNOW;
sal_Int32 nStrIdx = 0;
const sal_Int32 nStrLen = rMissingChars.getLength();
while( nStrIdx < nStrLen )
{
const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx );
- eLang = MapCharToLanguage( uChar );
+ const LanguageType eLang = MapCharToLanguage( uChar );
if( eLang == LANGUAGE_DONTKNOW )
continue;
MsLangId::convertLanguageToLocale( eLang, aLocale );
@@ -568,11 +569,11 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
}
// fall back to default UI locale if the missing characters are inconclusive
- if( eLang == LANGUAGE_DONTKNOW )
+ if( nStrIdx >= nStrLen )
aLocale = Application::GetSettings().GetUILocale();
// first level fallback:
- // try use the locale specific default fonts defined in VCL.xcu
+ // try use the locale specific default fonts defined in VCL.xcu
const ImplDevFontList* pDevFontList = ImplGetSVData()->maGDIData.mpScreenFontList;
/*const*/ ImplDevFontListData* pDevFont = pDevFontList->ImplFindByLocale( aLocale );
if( pDevFont )
@@ -585,7 +586,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
}
}
- // are the missing characters symbols?
+ // are the missing characters symbols?
pDevFont = pDevFontList->ImplFindByAttributes( IMPL_FONT_ATTR_SYMBOL,
rFontSelData.meWeight, rFontSelData.meWidthType,
rFontSelData.meFamily, rFontSelData.meItalic, rFontSelData.maSearchName );
@@ -606,7 +607,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo
int nTestFontCount = pTestFontList->Count();
if( nTestFontCount > MAX_GFBFONT_COUNT )
nTestFontCount = MAX_GFBFONT_COUNT;
-
+
for( int i = 0; i < nTestFontCount; ++i )
{
const ImplFontData* pFace = pTestFontList->Get( i );
@@ -644,7 +645,7 @@ static CharSet ImplCharSetToSal( BYTE nCharSet )
if ( nCharSet == OEM_CHARSET )
{
- UINT nCP = (sal_uInt16)GetOEMCP();
+ UINT nCP = (USHORT)GetOEMCP();
switch ( nCP )
{
// It is unclear why these two (undefined?) code page numbers are
@@ -1091,109 +1092,9 @@ void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont )
}
// =======================================================================
-#ifdef ENABLE_GRAPHITE
-
-#ifdef DEBUG
-static FILE * grLogFile = NULL;
-static FILE * grLog()
-{
-#ifdef WNT
- std::string logFileName(getenv("TEMP"));
- logFileName.append("\\grface.log");
- if (grLogFile == NULL) grLogFile = fopen(logFileName.c_str(),"w");
- else fflush(grLogFile);
- return grLogFile;
-#else
- fflush(stdout);
- return stdout;
-#endif
-}
-#undef NDEBUG
-#endif
-
-const void * getGrTable(const void* appFaceHandle, unsigned int name, size_t *len)
-{
- const GrFontData * fontTables = reinterpret_cast<const GrFontData*>(appFaceHandle);
- return fontTables->getTable(name, len);
-}
-
-GrFontData::GrFontData(HDC hDC) :
- mhDC(hDC), mpFace(NULL), mnRefCount(1)
-{
- // The face options ensure that the tables are all read at construction
- // time so there is no need to keep the hDC uptodate
- static const char* pGraphiteCacheStr = getenv( "SAL_GRAPHITE_CACHE_SIZE" );
- unsigned long graphiteSegCacheSize = pGraphiteCacheStr ? (atoi(pGraphiteCacheStr)) : 0;
- if (graphiteSegCacheSize > 500)
- mpFace = gr_make_face_with_seg_cache(this, getGrTable,
- graphiteSegCacheSize, gr_face_preloadGlyphs | gr_face_cacheCmap);
- else
- mpFace = gr_make_face(this, getGrTable,
- gr_face_preloadGlyphs | gr_face_cacheCmap);
-#ifdef DEBUG
- fprintf(grLog(), "gr_make_face %lx for WinFontData %lx\n", (unsigned long)mpFace,
- (unsigned long)this);
-#endif
- mhDC = NULL;
-}
-
-GrFontData::~GrFontData()
-{
- if (mpFace)
- {
-#ifdef DEBUG
- fprintf(grLog(), "gr_face_destroy %lx for WinFontData %lx\n", (unsigned long)mpFace,
- (unsigned long)this);
-#endif
- gr_face_destroy(mpFace);
- mpFace = NULL;
- }
- std::vector<RawFontData*>::iterator i = mvData.begin();
- while (i != mvData.end())
- {
- delete *i;
- ++i;
- }
- mvData.clear();
-}
-
-const void * GrFontData::getTable(unsigned int name, size_t *len) const
-{
-#ifdef DEBUG
-#undef NDEBUG
-#endif
- assert(mhDC);
- // swap the bytes
- union TtfTag {
- unsigned int i;
- unsigned char c[4];
- };
- TtfTag littleEndianTag;
- littleEndianTag.i = name;
- TtfTag bigEndianTag;
- bigEndianTag.c[0] = littleEndianTag.c[3];
- bigEndianTag.c[1] = littleEndianTag.c[2];
- bigEndianTag.c[2] = littleEndianTag.c[1];
- bigEndianTag.c[3] = littleEndianTag.c[0];
- mvData.push_back(new RawFontData(mhDC, bigEndianTag.i));
- const RawFontData * data = mvData[mvData.size()-1];
- if (data && (data->size() > 0))
- {
- if (len)
- *len = data->size();
- return reinterpret_cast<const void *>(data->get());
- }
- else
- {
- if (len)
- *len = 0;
- return NULL;
- }
-}
-#endif
ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
- int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
+ int nHeight, WIN_BYTE eWinCharSet, WIN_BYTE nPitchAndFamily )
: ImplFontData( rDFS, 0 ),
meWinCharSet( eWinCharSet ),
mnPitchAndFamily( nPitchAndFamily ),
@@ -1207,14 +1108,10 @@ ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
mbHasGraphiteSupport( false ),
#endif
mbHasArabicSupport ( false ),
- mbFontCapabilitiesRead( false ),
mbAliasSymbolsLow( false ),
mbAliasSymbolsHigh( false ),
mnId( 0 ),
mpEncodingVector( NULL )
-#ifdef ENABLE_GRAPHITE
- ,mpGraphiteData(NULL)
-#endif
{
SetBitmapSize( 0, nHeight );
@@ -1238,9 +1135,6 @@ ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
mbAliasSymbolsHigh = true;
}
}
-#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::ImplWinFontData() %lx\n", (unsigned long)this);
-#endif
}
// -----------------------------------------------------------------------
@@ -1251,13 +1145,6 @@ ImplWinFontData::~ImplWinFontData()
if( mpUnicodeMap )
mpUnicodeMap->DeReference();
-#ifdef ENABLE_GRAPHITE
- if (mpGraphiteData)
- mpGraphiteData->DeReference();
-#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::~ImplWinFontData %lx\n", (unsigned long)this);
-#endif
-#endif // ENABLE_GRAPHITE
delete mpEncodingVector;
}
@@ -1270,13 +1157,6 @@ sal_IntPtr ImplWinFontData::GetFontId() const
// -----------------------------------------------------------------------
-static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
-static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
-//static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));}
-static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); }
-
-// -----------------------------------------------------------------------
-
void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
{
// short circuit if already initialized
@@ -1284,31 +1164,12 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
return;
ReadCmapTable( hDC );
- GetFontCapabilities( hDC );
+ ReadOs2Table( hDC );
#ifdef ENABLE_GRAPHITE
static const char* pDisableGraphiteText = getenv( "SAL_DISABLE_GRAPHITE" );
if( !pDisableGraphiteText || (pDisableGraphiteText[0] == '0') )
{
- const DWORD nSilfTag = CalcTag("Silf");
- const RawFontData aRawFontData( hDC, nSilfTag );
- mbHasGraphiteSupport = (aRawFontData.size() > 0);
- if (mbHasGraphiteSupport)
- {
-#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::UpdateFromHDC %lx\n",
- (unsigned long)this);
-#endif
- if (mpGraphiteData == NULL)
- {
- mpGraphiteData = new GrFontData(hDC);
- if (!mpGraphiteData->getFace())
- {
- mbHasGraphiteSupport = false;
- delete mpGraphiteData;
- mpGraphiteData = NULL;
- }
- }
- }
+ mbHasGraphiteSupport = gr::WinFont::FontHasGraphiteTables(hDC);
}
#endif
@@ -1322,17 +1183,6 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
}
-#ifdef ENABLE_GRAPHITE
-const gr_face* ImplWinFontData::GraphiteFace() const
-{
-#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::GraphiteFace %lx has face %lx\n",
- (unsigned long)this, mpGraphiteData? mpGraphiteData->getFace(): 0);
-#endif
- assert((mpGraphiteData == NULL) || (mpGraphiteData->getFontData() == this));
- return (mpGraphiteData)? mpGraphiteData->getFace() : NULL;
-}
-#endif
// -----------------------------------------------------------------------
bool ImplWinFontData::HasGSUBstitutions( HDC hDC ) const
@@ -1351,17 +1201,44 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
// -----------------------------------------------------------------------
-const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
+ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
{
if( !mpUnicodeMap )
return NULL;
+ mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
-bool ImplWinFontData::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
+// -----------------------------------------------------------------------
+
+static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
+static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
+//static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));}
+static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); }
+
+void ImplWinFontData::ReadOs2Table( HDC hDC ) const
{
- rFontCapabilities = maFontCapabilities;
- return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
+ const DWORD Os2Tag = CalcTag( "OS/2" );
+ DWORD nLength = ::GetFontData( hDC, Os2Tag, 0, NULL, 0 );
+ if( (nLength == GDI_ERROR) || !nLength )
+ return;
+ std::vector<unsigned char> aOS2map( nLength );
+ unsigned char* pOS2map = &aOS2map[0];
+ ::GetFontData( hDC, Os2Tag, 0, pOS2map, nLength );
+ sal_uInt32 nVersion = GetUShort( pOS2map );
+ if ( nVersion >= 0x0001 && nLength >= 58 )
+ {
+ // We need at least version 0x0001 (TrueType rev 1.66)
+ // to have access to the needed struct members.
+ sal_uInt32 ulUnicodeRange1 = GetUInt( pOS2map + 42 );
+ sal_uInt32 ulUnicodeRange2 = GetUInt( pOS2map + 46 );
+
+ // Check for CJK capabilities of the current font
+ mbHasCJKSupport = (ulUnicodeRange2 & 0x2DF00000);
+ mbHasKoreanRange= (ulUnicodeRange1 & 0x10000000)
+ | (ulUnicodeRange2 & 0x01100000);
+ mbHasArabicSupport = (ulUnicodeRange1 & 0x00002000);
+ }
}
// -----------------------------------------------------------------------
@@ -1434,51 +1311,6 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( !mpUnicodeMap )
mpUnicodeMap = ImplFontCharMap::GetDefaultMap( bIsSymbolFont );
- mpUnicodeMap->AddReference();
-}
-
-void ImplWinFontData::GetFontCapabilities( HDC hDC ) const
-{
- // read this only once per font
- if( mbFontCapabilitiesRead )
- return;
-
- mbFontCapabilitiesRead = true;
-
- // GSUB table
- DWORD nLength;
- const DWORD GsubTag = CalcTag( "GSUB" );
- nLength = ::GetFontData( hDC, GsubTag, 0, NULL, 0 );
- if( (nLength != GDI_ERROR) && nLength )
- {
- std::vector<unsigned char> aTable( nLength );
- unsigned char* pTable = &aTable[0];
- ::GetFontData( hDC, GsubTag, 0, pTable, nLength );
- vcl::getTTScripts(maFontCapabilities.maGSUBScriptTags, pTable, nLength);
- }
-
- // OS/2 table
- const DWORD OS2Tag = CalcTag( "OS/2" );
- nLength = ::GetFontData( hDC, OS2Tag, 0, NULL, 0 );
- if( (nLength != GDI_ERROR) && nLength )
- {
- std::vector<unsigned char> aTable( nLength );
- unsigned char* pTable = &aTable[0];
- ::GetFontData( hDC, OS2Tag, 0, pTable, nLength );
- if (vcl::getTTCoverage(maFontCapabilities.maUnicodeRange, maFontCapabilities.maCodePageRange, pTable, nLength))
- {
- // Check for CJK capabilities of the current font
- // TODO, we have this info already from getTT, decode bits to
- // a readable dynamic_bitset
- sal_uInt32 ulUnicodeRange1 = GetUInt( pTable + 42 );
- sal_uInt32 ulUnicodeRange2 = GetUInt( pTable + 46 );
-
- mbHasCJKSupport = (ulUnicodeRange2 & 0x2DF00000);
- mbHasKoreanRange= (ulUnicodeRange1 & 0x10000000)
- | (ulUnicodeRange2 & 0x01100000);
- mbHasArabicSupport = (ulUnicodeRange1 & 0x00002000);
- }
- }
}
// =======================================================================
@@ -1511,22 +1343,54 @@ int CALLBACK SalEnumQueryFontProcExW( const ENUMLOGFONTEXW*,
// -----------------------------------------------------------------------
-bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
+int CALLBACK SalEnumQueryFontProcExA( const ENUMLOGFONTEXA*,
+ const NEWTEXTMETRICEXA*,
+ DWORD, LPARAM lParam )
{
- // Test, if Font available
- LOGFONTW aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
+ *((bool*)(void*)lParam) = true;
+ return 0;
+}
- UINT nNameLen = rName.Len();
- if ( nNameLen > (sizeof( aLogFont.lfFaceName )/sizeof( wchar_t ))-1 )
- nNameLen = (sizeof( aLogFont.lfFaceName )/sizeof( wchar_t ))-1;
- memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
- aLogFont.lfFaceName[nNameLen] = 0;
+// -----------------------------------------------------------------------
+bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
+{
bool bAvailable = false;
- EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
- (LPARAM)(void*)&bAvailable, 0 );
+
+ if ( aSalShlData.mbWNT )
+ {
+ // Test, if Font available
+ LOGFONTW aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+
+ UINT nNameLen = rName.Len();
+ if ( nNameLen > (sizeof( aLogFont.lfFaceName )/sizeof( wchar_t ))-1 )
+ nNameLen = (sizeof( aLogFont.lfFaceName )/sizeof( wchar_t ))-1;
+ memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
+ aLogFont.lfFaceName[nNameLen] = 0;
+
+ EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
+ (LPARAM)(void*)&bAvailable, 0 );
+ }
+ else
+ {
+ ByteString aTemp = ImplSalGetWinAnsiString( rName );
+
+ // Test, if Font available
+ LOGFONTA aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+
+ UINT nNameLen = aTemp.Len();
+ if ( nNameLen > sizeof( aLogFont.lfFaceName )-1 )
+ nNameLen = sizeof( aLogFont.lfFaceName )-1;
+ memcpy( aLogFont.lfFaceName, aTemp.GetBuffer(), nNameLen );
+ aLogFont.lfFaceName[nNameLen] = 0;
+
+ EnumFontFamiliesExA( hDC, &aLogFont, (FONTENUMPROCA)SalEnumQueryFontProcExA,
+ (LPARAM)(void*)&bAvailable, 0 );
+ }
return bAvailable;
}
@@ -1606,6 +1470,80 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
// -----------------------------------------------------------------------
+static void ImplGetLogFontFromFontSelect( HDC hDC,
+ const ImplFontSelectData* pFont,
+ LOGFONTA& rLogFont,
+ bool /*bTestVerticalAvail*/ )
+{
+ ByteString aName;
+ if( pFont->mpFontData )
+ aName = ImplSalGetWinAnsiString( pFont->mpFontData->maName );
+ else
+ aName = ImplSalGetWinAnsiString( pFont->maName.GetToken( 0 ) );
+
+ int nNameLen = aName.Len();
+ if( nNameLen > LF_FACESIZE )
+ nNameLen = LF_FACESIZE;
+ memcpy( rLogFont.lfFaceName, aName.GetBuffer(), nNameLen );
+ if( nNameLen < LF_FACESIZE )
+ rLogFont.lfFaceName[nNameLen] = '\0';
+
+ if( !pFont->mpFontData )
+ {
+ rLogFont.lfCharSet = pFont->IsSymbolFont() ? SYMBOL_CHARSET : DEFAULT_CHARSET;
+ rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->mePitch )
+ | ImplFamilyToWin( pFont->meFamily );
+ }
+ else
+ {
+ const ImplWinFontData* pWinFontData = static_cast<const ImplWinFontData*>( pFont->mpFontData );
+ rLogFont.lfCharSet = pWinFontData->GetCharSet();
+ rLogFont.lfPitchAndFamily = pWinFontData->GetPitchAndFamily();
+ }
+
+ rLogFont.lfWeight = ImplWeightToWin( pFont->meWeight );
+ rLogFont.lfHeight = (LONG)-pFont->mnHeight;
+ rLogFont.lfWidth = (LONG)pFont->mnWidth;
+ rLogFont.lfUnderline = 0;
+ rLogFont.lfStrikeOut = 0;
+ rLogFont.lfItalic = (pFont->meItalic) != ITALIC_NONE;
+ rLogFont.lfEscapement = pFont->mnOrientation;
+ rLogFont.lfOrientation = rLogFont.lfEscapement; // ignored by W98
+ rLogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ rLogFont.lfQuality = DEFAULT_QUALITY;
+ rLogFont.lfOutPrecision = OUT_TT_PRECIS;
+ if( pFont->mnOrientation )
+ rLogFont.lfClipPrecision |= CLIP_LH_ANGLES;
+
+ // disable antialiasing if requested
+ if( pFont->mbNonAntialiased )
+ rLogFont.lfQuality = NONANTIALIASED_QUALITY;
+
+ // select vertical mode if requested and available
+ if( pFont->mbVertical && nNameLen )
+ {
+ // vertical fonts start with an '@'
+ memmove( &rLogFont.lfFaceName[1], &rLogFont.lfFaceName[0],
+ sizeof(rLogFont.lfFaceName)-sizeof(rLogFont.lfFaceName[0]) );
+ rLogFont.lfFaceName[0] = '@';
+
+ // check availability of vertical mode for this font
+ bool bAvailable = false;
+ EnumFontFamiliesExA( hDC, &rLogFont, (FONTENUMPROCA)SalEnumQueryFontProcExA,
+ (LPARAM)&bAvailable, 0 );
+
+ if( !bAvailable )
+ {
+ // restore non-vertical name if vertical mode is not supported
+ memcpy( rLogFont.lfFaceName, aName.GetBuffer(), nNameLen );
+ if( nNameLen < LF_FACESIZE )
+ rLogFont.lfFaceName[nNameLen] = '\0';
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont )
{
HFONT hNewFont = 0;
@@ -1615,62 +1553,122 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
// only required for virtual devices, see below for details
hdcScreen = GetDC(0);
- LOGFONTW aLogFont;
- ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
+ if( aSalShlData.mbWNT )
+ {
+ LOGFONTW aLogFont;
+ ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
+
+ // on the display we prefer Courier New when Courier is a
+ // bitmap only font and we need to stretch or rotate it
+ if( mbScreen
+ && (i_pFont->mnWidth != 0
+ || i_pFont->mnOrientation != 0
+ || i_pFont->mpFontData == NULL
+ || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight))
+ && !bImplSalCourierScalable
+ && bImplSalCourierNew
+ && (ImplSalWICompareAscii( aLogFont.lfFaceName, "Courier" ) == 0) )
+ lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
+
+ // #i47675# limit font requests to MAXFONTHEIGHT
+ // TODO: share MAXFONTHEIGHT font instance
+ if( (-aLogFont.lfHeight <= MAXFONTHEIGHT)
+ && (+aLogFont.lfWidth <= MAXFONTHEIGHT) )
+ {
+ o_rFontScale = 1.0;
+ }
+ else if( -aLogFont.lfHeight >= +aLogFont.lfWidth )
+ {
+ o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT;
+ aLogFont.lfHeight = -MAXFONTHEIGHT;
+ aLogFont.lfWidth = FRound( aLogFont.lfWidth / o_rFontScale );
+ }
+ else // #i95867# also limit font widths
+ {
+ o_rFontScale = +aLogFont.lfWidth / (float)MAXFONTHEIGHT;
+ aLogFont.lfWidth = +MAXFONTHEIGHT;
+ aLogFont.lfHeight = FRound( aLogFont.lfHeight / o_rFontScale );
+ }
- // on the display we prefer Courier New when Courier is a
- // bitmap only font and we need to stretch or rotate it
- if( mbScreen
- && (i_pFont->mnWidth != 0
- || i_pFont->mnOrientation != 0
- || i_pFont->mpFontData == NULL
- || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight))
- && !bImplSalCourierScalable
- && bImplSalCourierNew
- && (ImplSalWICompareAscii( aLogFont.lfFaceName, "Courier" ) == 0) )
- lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
+ hNewFont = ::CreateFontIndirectW( &aLogFont );
+ if( hdcScreen )
+ {
+ // select font into screen hdc first to get an antialiased font
+ // see knowledge base article 305290:
+ // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface"
+ SelectFont( hdcScreen, SelectFont( hdcScreen , hNewFont ) );
+ }
+ o_rOldFont = ::SelectFont( mhDC, hNewFont );
- // #i47675# limit font requests to MAXFONTHEIGHT
- // TODO: share MAXFONTHEIGHT font instance
- if( (-aLogFont.lfHeight <= MAXFONTHEIGHT)
- && (+aLogFont.lfWidth <= MAXFONTHEIGHT) )
- {
- o_rFontScale = 1.0;
- }
- else if( -aLogFont.lfHeight >= +aLogFont.lfWidth )
- {
- o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT;
- aLogFont.lfHeight = -MAXFONTHEIGHT;
- aLogFont.lfWidth = FRound( aLogFont.lfWidth / o_rFontScale );
+ TEXTMETRICW aTextMetricW;
+ if( !::GetTextMetricsW( mhDC, &aTextMetricW ) )
+ {
+ // the selected font doesn't work => try a replacement
+ // TODO: use its font fallback instead
+ lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
+ aLogFont.lfPitchAndFamily = FIXED_PITCH;
+ HFONT hNewFont2 = CreateFontIndirectW( &aLogFont );
+ SelectFont( mhDC, hNewFont2 );
+ DeleteFont( hNewFont );
+ hNewFont = hNewFont2;
+ }
}
- else // #i95867# also limit font widths
+ else
{
- o_rFontScale = +aLogFont.lfWidth / (float)MAXFONTHEIGHT;
- aLogFont.lfWidth = +MAXFONTHEIGHT;
- aLogFont.lfHeight = FRound( aLogFont.lfHeight / o_rFontScale );
- }
+ if( !mpLogFont )
+ // mpLogFont is needed for getting the kerning pairs
+ // TODO: get them from somewhere else
+ mpLogFont = new LOGFONTA;
+ LOGFONTA& aLogFont = *mpLogFont;
+ ImplGetLogFontFromFontSelect( mhDC, i_pFont, aLogFont, true );
+
+ // on the display we prefer Courier New when Courier is a
+ // bitmap only font and we need to stretch or rotate it
+ if( mbScreen
+ && (i_pFont->mnWidth != 0
+ || i_pFont->mnOrientation != 0
+ || i_pFont->mpFontData == NULL
+ || (i_pFont->mpFontData->GetHeight() != i_pFont->mnHeight))
+ && !bImplSalCourierScalable
+ && bImplSalCourierNew
+ && (stricmp( aLogFont.lfFaceName, "Courier" ) == 0) )
+ strncpy( aLogFont.lfFaceName, "Courier New", 11 );
+
+ // limit font requests to MAXFONTHEIGHT to work around driver problems
+ // TODO: share MAXFONTHEIGHT font instance
+ if( -aLogFont.lfHeight <= MAXFONTHEIGHT )
+ o_rFontScale = 1.0;
+ else
+ {
+ o_rFontScale = -aLogFont.lfHeight / (float)MAXFONTHEIGHT;
+ aLogFont.lfHeight = -MAXFONTHEIGHT;
+ aLogFont.lfWidth = static_cast<LONG>( aLogFont.lfWidth / o_rFontScale );
+ }
- hNewFont = ::CreateFontIndirectW( &aLogFont );
- if( hdcScreen )
- {
- // select font into screen hdc first to get an antialiased font
- // see knowledge base article 305290:
- // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface"
- SelectFont( hdcScreen, SelectFont( hdcScreen , hNewFont ) );
- }
- o_rOldFont = ::SelectFont( mhDC, hNewFont );
+ hNewFont = ::CreateFontIndirectA( &aLogFont );
+ if( hdcScreen )
+ {
+ // select font into screen hdc first to get an antialiased font
+ // see knowledge base article 305290:
+ // "PRB: Fonts Not Drawn Antialiased on Device Context for DirectDraw Surface"
+ ::SelectFont( hdcScreen, ::SelectFont( hdcScreen , hNewFont ) );
+ }
+ o_rOldFont = ::SelectFont( mhDC, hNewFont );
- TEXTMETRICW aTextMetricW;
- if( !::GetTextMetricsW( mhDC, &aTextMetricW ) )
- {
- // the selected font doesn't work => try a replacement
- // TODO: use its font fallback instead
- lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
- aLogFont.lfPitchAndFamily = FIXED_PITCH;
- HFONT hNewFont2 = CreateFontIndirectW( &aLogFont );
- SelectFont( mhDC, hNewFont2 );
- DeleteFont( hNewFont );
- hNewFont = hNewFont2;
+ TEXTMETRICA aTextMetricA;
+ // when the font doesn't work try a replacement
+ if ( !::GetTextMetricsA( mhDC, &aTextMetricA ) )
+ {
+ // the selected font doesn't work => try a replacement
+ // TODO: use its font fallback instead
+ LOGFONTA aTempLogFont = aLogFont;
+ strncpy( aTempLogFont.lfFaceName, "Courier New", 11 );
+ aTempLogFont.lfPitchAndFamily = FIXED_PITCH;
+ HFONT hNewFont2 = CreateFontIndirectA( &aTempLogFont );
+ ::SelectFont( mhDC, hNewFont2 );
+ ::DeleteFont( hNewFont );
+ hNewFont = hNewFont2;
+ }
}
if( hdcScreen )
@@ -1679,7 +1677,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
return hNewFont;
}
-sal_uInt16 WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
+USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
{
// return early if there is no new font
if( !pFont )
@@ -1687,7 +1685,6 @@ sal_uInt16 WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLeve
// deselect still active font
if( mhDefFont )
::SelectFont( mhDC, mhDefFont );
- mfCurrentFontScale = mfFontScale[nFallbackLevel];
// release no longer referenced font handles
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
{
@@ -1704,8 +1701,7 @@ sal_uInt16 WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLeve
mpWinFontData[ nFallbackLevel ] = static_cast<const ImplWinFontData*>( pFont->mpFontData );
HFONT hOldFont = 0;
- HFONT hNewFont = ImplDoSetFont( pFont, mfFontScale[ nFallbackLevel ], hOldFont );
- mfCurrentFontScale = mfFontScale[nFallbackLevel];
+ HFONT hNewFont = ImplDoSetFont( pFont, mfFontScale, hOldFont );
if( !mhDefFont )
{
@@ -1760,9 +1756,18 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// temporarily change the HDC to the font in the fallback level
HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] );
- wchar_t aFaceName[LF_FACESIZE+60];
- if( ::GetTextFaceW( mhDC, sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) )
- pMetric->maName = reinterpret_cast<const sal_Unicode*>(aFaceName);
+ if ( aSalShlData.mbWNT )
+ {
+ wchar_t aFaceName[LF_FACESIZE+60];
+ if( ::GetTextFaceW( mhDC, sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) )
+ pMetric->maName = reinterpret_cast<const sal_Unicode*>(aFaceName);
+ }
+ else
+ {
+ char aFaceName[LF_FACESIZE+60];
+ if( ::GetTextFaceA( mhDC, sizeof(aFaceName), aFaceName ) )
+ pMetric->maName = ImplSalGetUniString( aFaceName );
+ }
// get the font metric
TEXTMETRICA aWinMetric;
@@ -1799,11 +1804,11 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
}
// transformation dependend font metrics
- pMetric->mnWidth = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth );
- pMetric->mnIntLeading = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading );
- pMetric->mnExtLeading = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading );
- pMetric->mnAscent = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent );
- pMetric->mnDescent = static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent );
+ pMetric->mnWidth = static_cast<int>( mfFontScale * aWinMetric.tmAveCharWidth );
+ pMetric->mnIntLeading = static_cast<int>( mfFontScale * aWinMetric.tmInternalLeading );
+ pMetric->mnExtLeading = static_cast<int>( mfFontScale * aWinMetric.tmExternalLeading );
+ pMetric->mnAscent = static_cast<int>( mfFontScale * aWinMetric.tmAscent );
+ pMetric->mnDescent = static_cast<int>( mfFontScale * aWinMetric.tmDescent );
// #107888# improved metric compatibility for Asian fonts...
// TODO: assess workaround below for CWS >= extleading
@@ -1826,6 +1831,11 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
pMetric->mnAscent += nHalfTmpExtLeading;
pMetric->mnDescent += nOtherHalfTmpExtLeading;
+
+ // #109280# HACK korean only: increase descent for wavelines and impr
+ if( !aSalShlData.mbWNT )
+ if( mpWinFontData[nFallbackLevel]->SupportsKorean() )
+ pMetric->mnDescent += pMetric->mnExtLeading;
}
pMetric->mnMinKashida = GetMinKashidaWidth();
@@ -1868,12 +1878,12 @@ static void ImplGetAllFontCharSets( WinSalGraphics* pData )
static void ImplAddKerningPairs( WinSalGraphics* pData )
{
- sal_uLong nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
+ ULONG nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
if ( !nPairs )
return;
CHARSETINFO aInfo;
- if ( !TranslateCharsetInfo( (DWORD*)(sal_uLong)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
+ if ( !TranslateCharsetInfo( (DWORD*)(ULONG)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
return;
if ( !pData->mpFontKernPairs )
@@ -1888,15 +1898,15 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
}
UINT nCP = aInfo.ciACP;
- sal_uLong nOldPairs = pData->mnFontKernPairCount;
+ ULONG nOldPairs = pData->mnFontKernPairCount;
KERNINGPAIR* pTempPair = pData->mpFontKernPairs+pData->mnFontKernPairCount;
nPairs = ::GetKerningPairsA( pData->mhDC, nPairs, pTempPair );
- for ( sal_uLong i = 0; i < nPairs; i++ )
+ for ( ULONG i = 0; i < nPairs; i++ )
{
unsigned char aBuf[2];
wchar_t nChar;
int nLen;
- sal_Bool bAdd = TRUE;
+ BOOL bAdd = TRUE;
// None-ASCII?, then we must convert the char
if ( (pTempPair->wFirst > 125) || (pTempPair->wFirst == 92) )
@@ -1940,7 +1950,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// TODO: get rid of linear search!
KERNINGPAIR* pTempPair2 = pData->mpFontKernPairs;
- for ( sal_uLong j = 0; j < nOldPairs; j++ )
+ for ( ULONG j = 0; j < nOldPairs; j++ )
{
if ( (pTempPair2->wFirst == pTempPair->wFirst) &&
(pTempPair2->wSecond == pTempPair->wSecond) )
@@ -1965,7 +1975,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// -----------------------------------------------------------------------
-sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
+ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
{
DBG_ASSERT( sizeof( KERNINGPAIR ) == sizeof( ImplKernPairData ),
"WinSalGraphics::GetKernPairs(): KERNINGPAIR != ImplKernPairData" );
@@ -1979,21 +1989,45 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
}
mnFontKernPairCount = 0;
- KERNINGPAIR* pPairs = NULL;
- int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
- if( nCount )
+ if ( aSalShlData.mbWNT )
{
- #ifdef GCP_KERN_HACK
- pPairs = new KERNINGPAIR[ nCount+1 ];
- mpFontKernPairs = pPairs;
- mnFontKernPairCount = nCount;
- ::GetKerningPairsW( mhDC, nCount, pPairs );
- #else // GCP_KERN_HACK
- pPairs = pKernPairs;
- nCount = (nCount < nPairs) : nCount : nPairs;
- ::GetKerningPairsW( mhDC, nCount, pPairs );
- return nCount;
- #endif // GCP_KERN_HACK
+ KERNINGPAIR* pPairs = NULL;
+ int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
+ if( nCount )
+ {
+#ifdef GCP_KERN_HACK
+ pPairs = new KERNINGPAIR[ nCount+1 ];
+ mpFontKernPairs = pPairs;
+ mnFontKernPairCount = nCount;
+ ::GetKerningPairsW( mhDC, nCount, pPairs );
+#else // GCP_KERN_HACK
+ pPairs = pKernPairs;
+ nCount = (nCount < nPairs) : nCount : nPairs;
+ ::GetKerningPairsW( mhDC, nCount, pPairs );
+ return nCount;
+#endif // GCP_KERN_HACK
+ }
+ }
+ else
+ {
+ if ( !mnFontCharSetCount )
+ ImplGetAllFontCharSets( this );
+
+ if ( mnFontCharSetCount <= 1 )
+ ImplAddKerningPairs( this );
+ else
+ {
+ // Query All Kerning Pairs from all possible CharSets
+ for ( BYTE i = 0; i < mnFontCharSetCount; i++ )
+ {
+ mpLogFont->lfCharSet = mpFontCharSets[i];
+ HFONT hNewFont = CreateFontIndirectA( mpLogFont );
+ HFONT hOldFont = SelectFont( mhDC, hNewFont );
+ ImplAddKerningPairs( this );
+ SelectFont( mhDC, hOldFont );
+ DeleteFont( hNewFont );
+ }
+ }
}
mbFontKernInit = FALSE;
@@ -2017,20 +2051,13 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
// -----------------------------------------------------------------------
-const ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
+ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
{
if( !mpWinFontData[0] )
return ImplFontCharMap::GetDefaultMap();
return mpWinFontData[0]->GetImplFontCharMap();
}
-bool WinSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if( !mpWinFontData[0] )
- return false;
- return mpWinFontData[0]->GetImplFontCapabilities(rFontCapabilities);
-}
-
// -----------------------------------------------------------------------
int CALLBACK SalEnumFontsProcExA( const ENUMLOGFONTEXA* pLogFont,
@@ -2151,8 +2178,8 @@ static int WINAPI __AddFontResourceExW( LPCWSTR lpszfileName, DWORD fl, PVOID pd
{
typedef int (WINAPI *AddFontResourceExW_FUNC)(LPCWSTR, DWORD, PVOID );
- static AddFontResourceExW_FUNC pFunc = NULL;
- static HMODULE hmGDI = NULL;
+ static AddFontResourceExW_FUNC pFunc = NULL;
+ static HMODULE hmGDI = NULL;
if ( !pFunc && !hmGDI )
{
@@ -2180,7 +2207,7 @@ bool ImplAddTempFont( SalData& rSalData, const String& rFontFileURL )
#ifdef FR_PRIVATE
nRet = __AddFontResourceExW( reinterpret_cast<LPCWSTR>(aUSytemPath.getStr()), FR_PRIVATE, NULL );
#endif
-
+
if ( !nRet )
{
static int nCounter = 0;
@@ -2232,7 +2259,19 @@ void ImplReleaseTempFonts( SalData& rSalData )
}
else
{
- ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
+ if( aSalShlData.mbWNT )
+ ::RemoveFontResourceW( reinterpret_cast<LPCWSTR>(p->maFontFilePath.getStr()) );
+ else
+ {
+ // poor man's string conversion because converter is gone
+ int nLen = p->maFontFilePath.getLength();
+ char* pNameA = new char[ nLen + 1 ];
+ for( int i = 0; i < nLen; ++i )
+ pNameA[i] = (char)(p->maFontFilePath.getStr())[i];
+ pNameA[ nLen ] = 0;
+ ::RemoveFontResourceA( pNameA );
+ delete[] pNameA;
+ }
}
rSalData.mpTempFontItem = p->mpNextItem;
@@ -2256,7 +2295,7 @@ static bool ImplGetFontAttrFromFile( const String& rFontFileURL,
OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL, aUSytemPath ) );
// get FontAttributes from a *fot file
- // TODO: use GetTTGlobalFontInfo() to access the font directly
+ // TODO: use GetTTGlobalFontInfo() to access the font directly
rDFA.mnQuality = 1000;
rDFA.mbDevice = true;
rDFA.meFamily = FAMILY_DONTKNOW;
@@ -2374,6 +2413,14 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
return false;
UINT nPreferedCharSet = DEFAULT_CHARSET;
+ if ( !aSalShlData.mbWNT )
+ {
+ // for W98 guess charset preference from active codepage
+ CHARSETINFO aCharSetInfo;
+ DWORD nCP = GetACP();
+ if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
+ nPreferedCharSet = aCharSetInfo.ciCharset;
+ }
// create matching FontData struct
aDFA.mbSymbolFlag = false; // TODO: how to know it without accessing the font?
@@ -2393,8 +2440,8 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
*/
ImplWinFontData* pFontData = new ImplWinFontData( aDFA, 0,
- sal::static_int_cast<BYTE>(nPreferedCharSet),
- sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
+ sal::static_int_cast<WIN_BYTE>(nPreferedCharSet),
+ sal::static_int_cast<WIN_BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData) );
pFontList->Add( pFontData );
return true;
@@ -2478,12 +2525,24 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
if ( TranslateCharsetInfo( (DWORD*)nCP, &aCharSetInfo, TCI_SRCCODEPAGE ) )
aInfo.mnPreferedCharSet = aCharSetInfo.ciCharset;
- LOGFONTW aLogFont;
- memset( &aLogFont, 0, sizeof( aLogFont ) );
- aLogFont.lfCharSet = DEFAULT_CHARSET;
- aInfo.mpLogFontW = &aLogFont;
- EnumFontFamiliesExW( mhDC, &aLogFont,
- (FONTENUMPROCW)SalEnumFontsProcExW, (LPARAM)(void*)&aInfo, 0 );
+ if ( aSalShlData.mbWNT )
+ {
+ LOGFONTW aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+ aInfo.mpLogFontW = &aLogFont;
+ EnumFontFamiliesExW( mhDC, &aLogFont,
+ (FONTENUMPROCW)SalEnumFontsProcExW, (LPARAM)(void*)&aInfo, 0 );
+ }
+ else
+ {
+ LOGFONTA aLogFont;
+ memset( &aLogFont, 0, sizeof( aLogFont ) );
+ aLogFont.lfCharSet = DEFAULT_CHARSET;
+ aInfo.mpLogFontA = &aLogFont;
+ EnumFontFamiliesExA( mhDC, &aLogFont,
+ (FONTENUMPROCA)SalEnumFontsProcExA, (LPARAM)(void*)&aInfo, 0 );
+ }
// Feststellen, was es fuer Courier-Schriften auf dem Bildschirm gibt,
// um in SetFont() evt. Courier auf Courier New zu mappen
@@ -2505,7 +2564,7 @@ void WinSalGraphics::GetDevFontSubstList( OutputDevice* )
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
+BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
{
HDC hDC = mhDC;
@@ -2522,26 +2581,32 @@ sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
GLYPHMETRICS aGM;
aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0;
aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0;
- DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
+ DWORD nSize = GDI_ERROR;
+ if ( aSalShlData.mbWNT )
+ nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
+ else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
+ nSize = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
+
if( nSize == GDI_ERROR )
return false;
rRect = Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ),
Size( aGM.gmBlackBoxX, aGM.gmBlackBoxY ) );
- rRect.Left() = static_cast<int>( mfCurrentFontScale * rRect.Left() );
- rRect.Right() = static_cast<int>( mfCurrentFontScale * rRect.Right() );
- rRect.Top() = static_cast<int>( mfCurrentFontScale * rRect.Top() );
- rRect.Bottom() = static_cast<int>( mfCurrentFontScale * rRect.Bottom() );
+ rRect.Left() = static_cast<int>( mfFontScale * rRect.Left() );
+ rRect.Right() = static_cast<int>( mfFontScale * rRect.Right() );
+ rRect.Top() = static_cast<int>( mfFontScale * rRect.Top() );
+ rRect.Bottom() = static_cast<int>( mfFontScale * rRect.Bottom() );
return true;
}
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::GetGlyphOutline( long nIndex,
+BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
rB2DPolyPoly.clear();
+ BOOL bRet = FALSE;
HDC hDC = mhDC;
// use unity matrix
@@ -2555,168 +2620,179 @@ sal_Bool WinSalGraphics::GetGlyphOutline( long nIndex,
nIndex &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
- const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
- if( !nSize1 ) // blank glyphs are ok
- return TRUE;
- else if( nSize1 == GDI_ERROR )
- return FALSE;
+ DWORD nSize1 = GDI_ERROR;
+ if ( aSalShlData.mbWNT )
+ nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
+ else if( (nGGOFlags & GGO_GLYPH_INDEX) || (nIndex <= 255) )
+ nSize1 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
- 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 )
- {
- // only outline data is interesting
- if( pHeader->dwType != TT_POLYGON_TYPE )
- break;
+ if( !nSize1 ) // blank glyphs are ok
+ bRet = TRUE;
+ else if( nSize1 != GDI_ERROR )
+ {
+ BYTE* pData = new BYTE[ nSize1 ];
+ DWORD nSize2;
+ if ( aSalShlData.mbWNT )
+ nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
+ else
+ nSize2 = ::GetGlyphOutlineA( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
- // get start point; next start points are end points
- // of previous segment
- sal_uInt16 nPnt = 0;
+ if( nSize1 == nSize2 )
+ {
+ bRet = TRUE;
- long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
- long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt++ ] = POLY_NORMAL;
+ int nPtSize = 512;
+ Point* pPoints = new Point[ nPtSize ];
+ BYTE* pFlags = new BYTE[ nPtSize ];
- 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 )
+ TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
+ while( (BYTE*)pHeader < pData+nSize2 )
{
- 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 )
+ // 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 )
{
- pPoints[ i ] = pOldPoints[ i ];
- pFlags[ i ] = pOldFlags[ i ];
- }
- delete[] pOldPoints;
- delete[] pOldFlags;
- }
+ 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;
+ }
- 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 )
+ int i = 0;
+ if( TT_PRIM_LINE == pCurve->wType )
{
- // endpoint is either last point in segment => advance
- ++i;
+ 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
+ else if( TT_PRIM_QSPLINE == pCurve->wType )
{
- // 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
+ 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;
+ }
}
- pPoints[ nPnt+2 ] = Point( nX, nY );
- pFlags[ nPnt+2 ] = POLY_NORMAL;
+ // next curve segment
+ pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
+ }
- // 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;
+ // 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];
- nPnt += 3;
+ pPoints[nPnt++] = pPoints[0];
}
- }
- // next curve segment
- pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
- }
+ // convert y-coordinates W32 -> VCL
+ for( int i = 0; i < nPnt; ++i )
+ pPoints[i].Y() = -pPoints[i].Y();
- // 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];
+ // insert into polypolygon
+ Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
+ // convert to B2DPolyPolygon
+ // TODO: get rid of the intermediate PolyPolygon
+ rB2DPolyPoly.append( aPoly.getB2DPolygon() );
+ }
- pPoints[nPnt++] = pPoints[0];
+ delete[] pPoints;
+ delete[] pFlags;
}
- // 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[] pData;
}
- delete[] pPoints;
- delete[] pFlags;
-
- delete[] pData;
-
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
- const double fFactor(mfCurrentFontScale/256);
+ const double fFactor(mfFontScale/256);
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
- return TRUE;
+ return bRet;
}
// -----------------------------------------------------------------------
@@ -2779,7 +2855,7 @@ int ScopedTrueTypeFont::open(void * pBuffer, sal_uInt32 nLen,
return OpenTTFontBuffer(pBuffer, nLen, nFaceNum, &m_pFont);
}
-sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2797,6 +2873,8 @@ sal_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
@@ -2819,10 +2897,6 @@ sal_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 )
{
@@ -2830,15 +2904,13 @@ sal_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 = pCharMap->GetGlyphIndex( nGlyphIdx );
- if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
+ nGlyphIdx = pImplFontCharMap->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() );
@@ -2867,16 +2939,16 @@ sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
::GetTTGlobalFontInfo( aSftTTF.get(), &aTTInfo );
rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF;
rInfo.m_aPSName = ImplSalGetUniString( aTTInfo.psname );
- rInfo.m_nAscent = +aTTInfo.winAscent;
+ rInfo.m_nAscent = +aTTInfo.winAscent;
rInfo.m_nDescent = -aTTInfo.winDescent;
- rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
+ rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ),
Point( aTTInfo.xMax, aTTInfo.yMax ) );
- rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
+ rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
// subset TTF-glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- sal_uInt16 aShortIDs[ 256 ];
+ USHORT aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef=-1, i;
@@ -2896,7 +2968,7 @@ sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical );
}
}
- aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
+ aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2967,7 +3039,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<sal_uInt16>(nFNLen) );
+ rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<USHORT>(nFNLen) );
rInfo.m_nAscent = +aTm.tmAscent;
rInfo.m_nDescent = -aTm.tmDescent;
rInfo.m_aFontBBox = Rectangle( Point( -aTm.tmOverhang, -aTm.tmDescent ),
@@ -2983,7 +3055,7 @@ const void* WinSalGraphics::GetEmbedFontData( const ImplFontData* pFont,
*pDataLen = 0;
pCharWidths[i] = nCharWidth;
}
-
+
if( !*pDataLen )
return NULL;
@@ -3038,11 +3110,11 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
// TODO: much better solution: move SetFont and restoration of old font to caller
ScopedFont aOldFont(*this);
-
+
float fScale = 0.0;
HFONT hOldFont = 0;
ImplDoSetFont( &aIFSD, fScale, hOldFont );
-
+
if( pFont->IsSubsettable() )
{
// get raw font file data
@@ -3054,12 +3126,12 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
sal_uInt32 nFaceNum = 0;
if( !*xRawFontData.get() ) // TTC candidate
nFaceNum = ~0U; // indicate "TTC font extracts only"
-
+
ScopedTrueTypeFont aSftTTF;
int nRC = aSftTTF.open( (void*)xRawFontData.get(), xRawFontData.size(), nFaceNum );
if( nRC != SF_OK )
return;
-
+
int nGlyphs = GetTTGlyphCount( aSftTTF.get() );
if( nGlyphs > 0 )
{
@@ -3079,9 +3151,8 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplWinFontData* pWinFont = static_cast<const ImplWinFontData*>(pFont);
- const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
- pMap->AddReference();
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
@@ -3097,8 +3168,6 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
}
nChar = pMap->GetNextChar( nChar );
}
-
- pMap->DeReference(); // TODO: and and use a RAII object
}
}
else if( pFont->IsEmbeddable() )
@@ -3116,7 +3185,7 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rWidths.push_back( nCharWidth );
}
}
- }
+ }
}
//--------------------------------------------------------------------------
@@ -3132,14 +3201,14 @@ SystemFontData WinSalGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
-
+
aSysFontData.nSize = sizeof( SystemFontData );
- aSysFontData.hFont = mhFonts[nFallbacklevel];
+ aSysFontData.hFont = mhFonts[nFallbacklevel];
aSysFontData.bFakeBold = false;
aSysFontData.bFakeItalic = false;
aSysFontData.bAntialias = true;
aSysFontData.bVerticalCharacterType = false;
-
+
OSL_TRACE("\r\n:WinSalGraphics::GetSysFontData(): FontID: %p, Fallback level: %d",
aSysFontData.hFont,
nFallbacklevel);
diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx
index 22c1b54559b6..9be66be25b76 100644
--- a/vcl/win/source/gdi/salgdi_gdiplus.cxx
+++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,17 +31,17 @@
#include <stdio.h>
#include <string.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <saldata.hxx>
#include <salgdi.h>
#include <tools/debug.hxx>
#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if defined _MSC_VER
@@ -83,7 +83,7 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, con
const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex));
rPath.AddBezier(
- aFCurr,
+ aFCurr,
Gdiplus::PointF(Gdiplus::REAL(aCa.getX()), Gdiplus::REAL(aCa.getY())),
Gdiplus::PointF(Gdiplus::REAL(aCb.getX()), Gdiplus::REAL(aCb.getY())),
aFNext);
@@ -129,7 +129,7 @@ void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath,
const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex));
rPath.AddBezier(
- aICurr,
+ aICurr,
Gdiplus::Point(INT(aCa.getX()), INT(aCa.getY())),
Gdiplus::Point(INT(aCb.getX()), INT(aCb.getY())),
aINext);
@@ -247,7 +247,7 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f
// #i101491# needed to create the correct line joins
aPath.CloseFigure();
}
-
+
if(getAntiAliasB2DDraw())
{
aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index ccd378750580..5f7ebc1dfaf6 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -45,10 +45,9 @@
#include <map>
#include <string>
+using namespace rtl;
using namespace std;
-using ::rtl::OUString;
-
typedef map< wstring, HTHEME > ThemeMap;
static ThemeMap aThemeMap;
@@ -80,7 +79,7 @@ private:
public:
VisualStylesAPI();
~VisualStylesAPI();
- sal_Bool IsAvailable() { return (mhModule != NULL); }
+ BOOL IsAvailable() { return (mhModule != NULL); }
HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );
HRESULT CloseThemeData( HTHEME hTheme );
@@ -167,7 +166,7 @@ HRESULT VisualStylesAPI::GetThemePartSize( HTHEME hTheme, HDC hdc, int iPartId,
/*********************************************************
- * Initialize XP theming and local stuff
+ * Initialize XP theming and local stuff
*********************************************************/
void SalData::initNWF( void )
{
@@ -187,11 +186,9 @@ void SalData::deInitNWF( void )
while( iter != aThemeMap.end() )
{
vsAPI.CloseThemeData(iter->second);
- ++iter;
+ iter++;
}
aThemeMap.clear();
- if( maDwmLib )
- osl_unloadModule( maDwmLib );
}
static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
@@ -219,7 +216,7 @@ static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
* Returns TRUE if the platform supports native
* drawing of the control defined by nPart
*/
-sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
HTHEME hTheme = NULL;
@@ -248,8 +245,8 @@ sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
case CTRL_SPINBOX:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Edit");
- else if( nPart == PART_ALL_BUTTONS ||
- nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN ||
+ else if( nPart == PART_ALL_BUTTONS ||
+ nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN ||
nPart == PART_BUTTON_LEFT|| nPart == PART_BUTTON_RIGHT )
hTheme = getThemeHandle( mhWnd, L"Spin");
break;
@@ -290,22 +287,6 @@ sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
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 )
@@ -335,16 +316,16 @@ sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-sal_Bool WinSalGraphics::hitTestNativeControl( ControlType,
+BOOL WinSalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- sal_Bool& )
+ BOOL& )
{
return FALSE;
}
-sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
+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);
@@ -379,7 +360,7 @@ Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const
// Helper functions
// ----
-void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, const Rectangle& rRect,
+void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, const Rectangle& rRect,
int* pLunaPart, int *pLunaState, RECT *pRect )
{
if( nControlPart == PART_BUTTON_DOWN )
@@ -439,7 +420,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
// ----
-sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
+BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ControlType nType,
ControlPart nPart,
ControlState nState,
@@ -576,7 +557,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- sal_Bool bOk = sal_False;
+ BOOL bOk = FALSE;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -601,7 +582,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- sal_Bool bOk = sal_False;
+ BOOL bOk = FALSE;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -696,7 +677,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
else if( nState & CTRL_STATE_DEFAULT )
iState = PBS_DEFAULTED;
//else if( nState & CTRL_STATE_FOCUSED )
- // iState = PBS_DEFAULTED; // may need to draw focus rect
+ // iState = PBS_DEFAULTED; // may need to draw focus rect
else
iState = PBS_NORMAL;
@@ -706,7 +687,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_RADIOBUTTON )
{
iPart = BP_RADIOBUTTON;
- sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ BOOL bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
if( nState & CTRL_STATE_PRESSED )
iState = bChecked ? RBS_CHECKEDPRESSED : RBS_UNCHECKEDPRESSED;
@@ -718,7 +699,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
iState = bChecked ? RBS_CHECKEDNORMAL : RBS_UNCHECKEDNORMAL;
//if( nState & CTRL_STATE_FOCUSED )
- // iState |= PBS_DEFAULTED; // may need to draw focus rect
+ // iState |= PBS_DEFAULTED; // may need to draw focus rect
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
@@ -729,20 +710,20 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ButtonValue v = aValue.getTristateVal();
if( nState & CTRL_STATE_PRESSED )
- iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDPRESSED :
+ iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDPRESSED :
( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDPRESSED : CBS_MIXEDPRESSED );
else if( !(nState & CTRL_STATE_ENABLED) )
- iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDDISABLED :
+ iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDDISABLED :
( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDDISABLED : CBS_MIXEDDISABLED );
else if( nState & CTRL_STATE_ROLLOVER )
- iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDHOT :
+ iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDHOT :
( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDHOT : CBS_MIXEDHOT );
else
- iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDNORMAL :
+ iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDNORMAL :
( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDNORMAL : CBS_MIXEDNORMAL );
//if( nState & CTRL_STATE_FOCUSED )
- // iState |= PBS_DEFAULTED; // may need to draw focus rect
+ // iState |= PBS_DEFAULTED; // may need to draw focus rect
//SIZE sz;
//THEMESIZE eSize = TS_DRAW; // TS_MIN, TS_TRUE, TS_DRAW
@@ -806,7 +787,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
{
iPart = TABP_TABITEMLEFTEDGE;
rc.bottom--;
-
+
OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM );
const TabitemValue *pValue = static_cast<const TabitemValue*>(&aValue);
@@ -820,7 +801,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
else if( pValue->isRightAligned() )
iPart = TABP_TABITEMRIGHTEDGE;
else iPart = TABP_TABITEM;
-
+
if( !(nState & CTRL_STATE_ENABLED) )
iState = TILES_DISABLED;
else if( nState & CTRL_STATE_SELECTED )
@@ -841,7 +822,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
else if( nState & CTRL_STATE_ROLLOVER )
iState = TILES_HOT;
else if( nState & CTRL_STATE_FOCUSED )
- iState = TILES_FOCUSED; // may need to draw focus rect
+ iState = TILES_FOCUSED; // may need to draw focus rect
else
iState = TILES_NORMAL;
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
@@ -852,23 +833,23 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nPart == PART_BUTTON )
{
iPart = TP_BUTTON;
- sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ 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
// feedback when travelling by keyboard over disabled entries
- iState = TS_HOT;
+ iState = TS_HOT;
else if( nState & CTRL_STATE_PRESSED )
iState = TS_PRESSED;
else if( nState & CTRL_STATE_ROLLOVER )
iState = bChecked ? TS_HOTCHECKED : TS_HOT;
- else
+ else
iState = bChecked ? TS_CHECKED : TS_NORMAL;
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
{
- // the vertical gripper is not supported in most themes and it makes no
+ // the vertical gripper is not supported in most themes and it makes no
// sense to only support horizontal gripper
//iPart = (nPart == PART_THUMB_HORZ) ? RP_GRIPPERVERT : RP_GRIPPER;
//return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
@@ -887,25 +868,17 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_MENUBAR )
{
- if( nPart == PART_ENTIRE_CONTROL )
- {
- 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( nPart != PART_ENTIRE_CONTROL )
+ return FALSE;
+
+ if( aValue.getType() == CTRL_MENUBAR )
{
- 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 );
+ 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);
}
-
+
if( nType == CTRL_PROGRESS )
{
if( nPart != PART_ENTIRE_CONTROL )
@@ -916,7 +889,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
RECT aProgressRect = rc;
if( vsAPI.GetThemeBackgroundContentRect( hTheme, hDC, PP_BAR, iState, &rc, &aProgressRect) != S_OK )
return false;
-
+
long nProgressWidth = aValue.getNumericVal();
nProgressWidth *= (aProgressRect.right - aProgressRect.left);
nProgressWidth /= (rc.right - rc.left);
@@ -927,12 +900,12 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
return ImplDrawTheme( hTheme, hDC, PP_CHUNK, iState, aProgressRect, aCaption );
}
-
+
if( nType == CTRL_SLIDER )
{
iPart = (nPart == PART_TRACK_HORZ_AREA) ? TKP_TRACK : TKP_TRACKVERT;
iState = (nPart == PART_TRACK_HORZ_AREA) ? TRS_NORMAL : TRVS_NORMAL;
-
+
Rectangle aTrackRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, Rectangle() );
RECT aTRect = rc;
if( nPart == PART_TRACK_HORZ_AREA )
@@ -946,9 +919,9 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
long nW = aTrackRect.GetWidth();
aTRect.left += (rc.right - rc.left - nW)/2;
aTRect.right = aTRect.left + nW;
- }
+ }
ImplDrawTheme( hTheme, hDC, iPart, iState, aTRect, aCaption );
-
+
RECT aThumbRect;
OSL_ASSERT( aValue.getType() == CTRL_SLIDER );
const SliderValue* pVal = static_cast<const SliderValue*>(&aValue);
@@ -960,7 +933,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
iState = (nState & CTRL_STATE_ENABLED) ? TUS_NORMAL : TUS_DISABLED;
return ImplDrawTheme( hTheme, hDC, iPart, iState, aThumbRect, aCaption );
}
-
+
if( nType == CTRL_LISTNODE )
{
if( nPart != PART_ENTIRE_CONTROL )
@@ -982,69 +955,6 @@ sal_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;
}
@@ -1053,18 +963,18 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
*
* Draws the requested control described by nPart/nState.
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
+BOOL WinSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption )
{
- sal_Bool bOk = false;
+ BOOL bOk = false;
HTHEME hTheme = NULL;
switch( nType )
@@ -1118,11 +1028,6 @@ sal_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 )
@@ -1136,16 +1041,6 @@ sal_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;
@@ -1171,7 +1066,7 @@ sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
// restore alignment
SetTextAlign( mhDC, ta );
-
+
//GdiFlush();
@@ -1185,11 +1080,11 @@ sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
* OPTIONAL. Draws the requested text for the control described by nPart/nState.
* Used if text not drawn by DrawNativeControl().
*
- * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the complete control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool WinSalGraphics::drawNativeControlText( ControlType,
+BOOL WinSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -1209,11 +1104,11 @@ sal_Bool WinSalGraphics::drawNativeControlText( ControlType,
* within the control that can be safely drawn into without drawing over
* the borders of the control.
*
- * rControlRegion: The bounding region of the control in VCL frame coordinates.
- * aValue: An optional value (tristate/numerical/string)
- * aCaption: A caption or title string (like button text etc)
+ * rControlRegion: The bounding region of the control in VCL frame coordinates.
+ * aValue: An optional value (tristate/numerical/string)
+ * aCaption: A caption or title string (like button text etc)
*/
-sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
+BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1222,7 +1117,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- sal_Bool bRet = FALSE;
+ BOOL bRet = FALSE;
HDC hDC = GetDC( mhWnd );
if( nType == CTRL_TOOLBAR )
@@ -1230,13 +1125,13 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
{
/*
- // the vertical gripper is not supported in most themes and it makes no
+ // the vertical gripper is not supported in most themes and it makes no
// sense to only support horizontal gripper
HTHEME hTheme = getThemeHandle( mhWnd, L"Rebar");
if( hTheme )
{
- Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == PART_THUMB_HORZ ? RP_GRIPPERVERT : RP_GRIPPER,
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == PART_THUMB_HORZ ? RP_GRIPPERVERT : RP_GRIPPER,
0, rControlRegion.GetBoundRect() ) );
if( nPart == PART_THUMB_HORZ && !aRect.IsEmpty() )
{
@@ -1256,7 +1151,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Toolbar");
if( hTheme )
{
- Rectangle aRect( ImplGetThemeRect( hTheme, hDC, TP_SPLITBUTTONDROPDOWN,
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC, TP_SPLITBUTTONDROPDOWN,
TS_HOT, rControlRegion ) );
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
@@ -1270,7 +1165,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Progress");
if( hTheme )
{
- Rectangle aRect( ImplGetThemeRect( hTheme, hDC, PP_BAR,
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC, PP_BAR,
0, rControlRegion ) );
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
@@ -1302,7 +1197,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
if( hTheme )
{
- // get border size
+ // get borderr size
Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
@@ -1314,7 +1209,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
long nFontHeight = aNonClientMetrics.lfMessageFont.lfHeight;
if( nFontHeight < 0 )
nFontHeight = -nFontHeight;
-
+
if( aRect.GetHeight() && nFontHeight )
{
aRect.Bottom() += aRect.GetHeight();
@@ -1331,29 +1226,6 @@ sal_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");
@@ -1394,7 +1266,7 @@ sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
const TabitemValue *pValue = static_cast<const TabitemValue*>(&rControlValue);
if ( pValue->isBothAligned() )
--aControlRect.Right();
-
+
if ( nState & CTRL_STATE_SELECTED )
{
aControlRect.Left() -= 2;
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 929fd8c8a644..d8ec03b0c516 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -32,7 +32,7 @@
#define WINVER 0x0500
#include <string.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#ifdef __MINGW32__
#include <excpt.h>
@@ -67,7 +67,7 @@
if (__builtin_setjmp(jmpbuf) == 0) \
{ \
han.Set(jmpbuf, NULL, (__SEHandler::PF)EXCEPTION_EXECUTE_HANDLER)
-
+
#define CATCH_DRIVER_EX_END(mes, p) \
} \
han.Reset()
@@ -82,23 +82,22 @@
} \
__except(WinSalInstance::WorkaroundExceptionHandlingInUSER32Lib(GetExceptionCode(), GetExceptionInformation()))\
{ \
- OSL_FAIL( mes ); \
+ DBG_ERROR( mes ); \
p->markInvalid(); \
}
#define CATCH_DRIVER_EX_END_2(mes) \
} \
__except(WinSalInstance::WorkaroundExceptionHandlingInUSER32Lib(GetExceptionCode(), GetExceptionInformation()))\
{ \
- OSL_FAIL( mes ); \
+ DBG_ERROR( mes ); \
}
#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;
-using ::rtl::OUString;
+using namespace rtl;
// =======================================================================
@@ -130,9 +129,9 @@ static LPDEVMODEW SAL_DEVMODE_W( const ImplJobSetup* pSetupData )
// =======================================================================
-static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus )
+static ULONG ImplWinQueueStatusToSal( DWORD nWinStatus )
{
- sal_uLong nStatus = 0;
+ ULONG nStatus = 0;
if ( nWinStatus & PRINTER_STATUS_PAUSED )
nStatus |= QUEUE_STATUS_PAUSED;
if ( nWinStatus & PRINTER_STATUS_ERROR )
@@ -190,11 +189,11 @@ static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus )
static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
{
- DWORD i;
- DWORD n;
- DWORD nBytes = 0;
- DWORD nInfoPrn2;
- sal_Bool bFound = FALSE;
+ DWORD i;
+ DWORD n;
+ DWORD nBytes = 0;
+ DWORD nInfoPrn2;
+ BOOL bFound = FALSE;
PRINTER_INFO_2* pWinInfo2 = NULL;
PRINTER_INFO_2* pGetInfo2;
EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoPrn2 );
@@ -208,7 +207,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
{
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
pInfo->maPrinterName = ImplSalGetUniString( pGetInfo2->pPrinterName );
- pInfo->maDriver = ImplSalGetUniString( pGetInfo2->pDriverName );
+ pInfo->maDriver = ImplSalGetUniString( pGetInfo2->pDriverName );
XubString aPortName;
if ( pGetInfo2->pPortName )
aPortName = ImplSalGetUniString( pGetInfo2->pPortName );
@@ -220,9 +219,9 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
// pComment can be 0 (the Windows docu doesn't describe this)
if ( pGetInfo2->pComment )
pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment );
- pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status );
- pInfo->mnJobs = pGetInfo2->cJobs;
- pInfo->mpSysData = new XubString( aPortName );
+ pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status );
+ pInfo->mnJobs = pGetInfo2->cJobs;
+ pInfo->mpSysData = new XubString( aPortName );
pList->Add( pInfo );
pGetInfo2++;
}
@@ -234,9 +233,9 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
// read printers from win.ini
// TODO: MSDN: GetProfileString() should not be called from server
// code because it is just there for WIN16 compatibility
- UINT nSize = 4096;
- char* pBuf = new char[nSize];
- UINT nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize );
+ UINT nSize = 4096;
+ char* pBuf = new char[nSize];
+ UINT nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize );
while ( nRead >= nSize-2 )
{
nSize += 2048;
@@ -249,9 +248,9 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
char* pName = pBuf;
while ( *pName )
{
- char* pPortName;
- char* pTmp;
- char aPortBuf[256];
+ char* pPortName;
+ char* pTmp;
+ char aPortBuf[256];
GetProfileStringA( aImplDevices, pName, "", aPortBuf, sizeof( aPortBuf ) );
pPortName = aPortBuf;
@@ -264,7 +263,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
pTmp = pPortName;
while ( *pTmp != ',' )
pTmp++;
- XubString aDriver( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
+ XubString aDriver( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
pPortName = pTmp;
// get port names
@@ -275,11 +274,11 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
while ( *pTmp && (*pTmp != ',') )
pTmp++;
- String aPortName( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
+ String aPortName( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
// create new entry
// look up if printer was already found in first loop
- sal_Bool bAdd = TRUE;
+ BOOL bAdd = TRUE;
if ( pWinInfo2 )
{
pGetInfo2 = pWinInfo2;
@@ -298,11 +297,11 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
{
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
pInfo->maPrinterName = aName;
- pInfo->maDriver = aDriver;
- pInfo->maLocation = aPortName;
- pInfo->mnStatus = 0;
- pInfo->mnJobs = QUEUE_JOBS_DONTKNOW;
- pInfo->mpSysData = new XubString( aPortName );
+ pInfo->maDriver = aDriver;
+ pInfo->maLocation = aPortName;
+ pInfo->mnStatus = 0;
+ pInfo->mnJobs = QUEUE_JOBS_DONTKNOW;
+ pInfo->mpSysData = new XubString( aPortName );
pList->Add( pInfo );
}
}
@@ -322,9 +321,9 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
getPrinterQueueInfoOldStyle( pList );
return;
}
- DWORD i;
- DWORD nBytes = 0;
- DWORD nInfoPrn4 = 0;
+ DWORD i;
+ DWORD nBytes = 0;
+ DWORD nInfoPrn4 = 0;
PRINTER_INFO_4W* pWinInfo4 = NULL;
EnumPrintersW( PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4, NULL, 0, &nBytes, &nInfoPrn4 );
if ( nBytes )
@@ -336,9 +335,9 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
{
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
pInfo->maPrinterName = UniString( reinterpret_cast< const sal_Unicode* >(pWinInfo4[i].pPrinterName) );
- pInfo->mnStatus = 0;
- pInfo->mnJobs = 0;
- pInfo->mpSysData = NULL;
+ pInfo->mnStatus = 0;
+ pInfo->mnJobs = 0;
+ pInfo->mpSysData = NULL;
pList->Add( pInfo );
}
}
@@ -350,9 +349,9 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
static void getPrinterQueueStateOldStyle( SalPrinterQueueInfo* pInfo )
{
- DWORD nBytes = 0;
- DWORD nInfoRet;
- PRINTER_INFO_2* pWinInfo2;
+ DWORD nBytes = 0;
+ DWORD nInfoRet;
+ PRINTER_INFO_2* pWinInfo2;
EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoRet );
if ( nBytes )
{
@@ -378,10 +377,10 @@ static void getPrinterQueueStateOldStyle( SalPrinterQueueInfo* pInfo )
// pComment can be 0 (the Windows docu doesn't describe this)
if ( pGetInfo2->pComment )
pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment );
- pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status );
- pInfo->mnJobs = pGetInfo2->cJobs;
+ pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status );
+ pInfo->mnJobs = pGetInfo2->cJobs;
if( ! pInfo->mpSysData )
- pInfo->mpSysData = new XubString( aPortName );
+ pInfo->mpSysData = new XubString( aPortName );
break;
}
@@ -400,12 +399,12 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
getPrinterQueueStateOldStyle( pInfo );
return;
}
-
+
HANDLE hPrinter = 0;
LPWSTR pPrnName = reinterpret_cast<LPWSTR>(const_cast<sal_Unicode*>(pInfo->maPrinterName.GetBuffer()));
if( OpenPrinterW( pPrnName, &hPrinter, NULL ) )
{
- DWORD nBytes = 0;
+ DWORD nBytes = 0;
GetPrinterW( hPrinter, 2, NULL, 0, &nBytes );
if( nBytes )
{
@@ -425,10 +424,10 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
// pComment can be 0 (the Windows docu doesn't describe this)
if ( pWinInfo2->pComment )
pInfo->maComment = String( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pComment) );
- pInfo->mnStatus = ImplWinQueueStatusToSal( pWinInfo2->Status );
- pInfo->mnJobs = pWinInfo2->cJobs;
+ pInfo->mnStatus = ImplWinQueueStatusToSal( pWinInfo2->Status );
+ pInfo->mnJobs = pWinInfo2->cJobs;
if( ! pInfo->mpSysData )
- pInfo->mpSysData = new XubString( aPortName );
+ pInfo->mpSysData = new XubString( aPortName );
}
rtl_freeMemory(pWinInfo2);
}
@@ -448,7 +447,7 @@ void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString WinSalInstance::GetDefaultPrinter()
{
static bool bGetDefPrtAPI = true;
- static sal_Bool(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
+ static BOOL(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
// try to use GetDefaultPrinter API (not available prior to W2000)
if( bGetDefPrtAPI )
{
@@ -465,7 +464,7 @@ XubString WinSalInstance::GetDefaultPrinter()
pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData );
}
- pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
+ pGetDefaultPrinter = (BOOL(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
}
}
if( pGetDefaultPrinter )
@@ -514,7 +513,7 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
pDevMode = NULL;
else
pDevMode = SAL_DEVMODE_W( pSetupData );
-
+
return DeviceCapabilitiesW( reinterpret_cast<LPCWSTR>(pPrinter->maDeviceName.GetBuffer()),
reinterpret_cast<LPCWSTR>(pPrinter->maPortName.GetBuffer()),
nCaps, (LPWSTR)pOutput, pDevMode );
@@ -526,7 +525,7 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
pDevMode = NULL;
else
pDevMode = SAL_DEVMODE_A( pSetupData );
-
+
return DeviceCapabilitiesA( ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(),
ImplSalGetWinAnsiString( pPrinter->maPortName, TRUE ).GetBuffer(),
nCaps, (LPSTR)pOutput, pDevMode );
@@ -535,8 +534,8 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
// -----------------------------------------------------------------------
-static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
- ImplJobSetup* pSetupData, sal_Bool bDelete )
+static BOOL ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
+ ImplJobSetup* pSetupData, BOOL bDelete )
{
if ( pSetupData && pSetupData->mpDriverData )
{
@@ -597,7 +596,7 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
(LPSTR)aPrinterNameA.GetBuffer(),
NULL, NULL, 0 );
}
-
+
if( nSysJobSize < 0 )
{
ClosePrinter( hPrn );
@@ -660,8 +659,8 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
// -----------------------------------------------------------------------
-static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
- sal_Bool bIn, WinSalFrame* pVisibleDlgParent )
+static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
+ BOOL bIn, WinSalFrame* pVisibleDlgParent )
{
ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE );
HANDLE hPrn;
@@ -680,12 +679,12 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
if( hPrn == HGDI_ERROR )
return FALSE;
- LONG nRet;
- LONG nSysJobSize = -1;
- HWND hWnd = 0;
- DWORD nMode = DM_OUT_BUFFER;
- sal_uLong nDriverDataLen = 0;
- SalDriverData* pOutBuffer = NULL;
+ LONG nRet;
+ LONG nSysJobSize = -1;
+ HWND hWnd = 0;
+ DWORD nMode = DM_OUT_BUFFER;
+ ULONG nDriverDataLen = 0;
+ SalDriverData* pOutBuffer = NULL;
BYTE* pInBuffer = NULL;
if( aSalShlData.mbWPrinter )
@@ -705,12 +704,12 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
}
// Outputbuffer anlegen
- nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1;
- pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen );
- pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN;
- pOutBuffer->mnVersion = aSalShlData.mbWPrinter ? SAL_DRIVERDATA_VERSION_W : SAL_DRIVERDATA_VERSION_A;
+ nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1;
+ pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen );
+ 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<sal_uInt16>(
+ pOutBuffer->mnDriverOffset = sal::static_int_cast<USHORT>(
(char*)pOutBuffer->maDriverData -
(char*)pOutBuffer );
@@ -729,10 +728,10 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
}
// Release mutex, in the other case we don't get paints and so on
- sal_uLong nMutexCount=0;
+ ULONG nMutexCount=0;
if ( pVisibleDlgParent )
nMutexCount = ImplSalReleaseYieldMutex();
-
+
BYTE* pOutDevMode = (((BYTE*)pOutBuffer) + pOutBuffer->mnDriverOffset);
if( aSalShlData.mbWPrinter )
{
@@ -792,8 +791,8 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
if ( pSetupData->mpDriverData )
rtl_freeMemory( pSetupData->mpDriverData );
pSetupData->mnDriverDataLen = nDriverDataLen;
- pSetupData->mpDriverData = (BYTE*)pOutBuffer;
- pSetupData->mnSystem = JOBSETUP_SYSTEM_WINDOWS;
+ pSetupData->mpDriverData = (BYTE*)pOutBuffer;
+ pSetupData->mnSystem = JOBSETUP_SYSTEM_WINDOWS;
return TRUE;
}
@@ -809,7 +808,7 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
#define CHOOSE_DEVMODE(i)\
(pDevModeW ? pDevModeW->i : pDevModeA->i)
-static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
+static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -828,7 +827,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -837,11 +836,11 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
pSetupData->mnPaperBin = 0;
// search the right bin and assign index to mnPaperBin
- for( sal_uLong i = 0; i < nCount; i++ )
+ for( ULONG i = 0; i < nCount; i++ )
{
if( CHOOSE_DEVMODE(dmDefaultSource) == pBins[ i ] )
{
- pSetupData->mnPaperBin = (sal_uInt16)i;
+ pSetupData->mnPaperBin = (USHORT)i;
break;
}
}
@@ -860,10 +859,10 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
else
{
- sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
- WORD* pPapers = NULL;
- sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
- POINT* pPaperSizes = NULL;
+ ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ WORD* pPapers = NULL;
+ ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ POINT* pPaperSizes = NULL;
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
{
pPapers = (WORD*)rtl_allocateZeroMemory(nPaperCount*sizeof(WORD));
@@ -876,7 +875,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
if( nPaperSizeCount == nPaperCount && pPaperSizes && pPapers )
{
- for( sal_uLong i = 0; i < nPaperCount; i++ )
+ for( ULONG i = 0; i < nPaperCount; i++ )
{
if( pPapers[ i ] == CHOOSE_DEVMODE(dmPaperSize) )
{
@@ -923,14 +922,14 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
//See http://wiki.services.openoffice.org/wiki/DefaultPaperSize
//i.e.
//http://msdn.microsoft.com/en-us/library/dd319099(VS.85).aspx
- //DMPAPER_B4 12 B4 (JIS) 257 x 364 mm
+ //DMPAPER_B4 12 B4 (JIS) 257 x 364 mm
//http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf
//also says that the MS DMPAPER_B4 is JIS, which makes most sense. And
//matches our Excel filter's belief about the matching XlPaperSize
//enumeration.
//
//http://msdn.microsoft.com/en-us/library/ms776398(VS.85).aspx said
- ////"DMPAPER_B4 12 B4 (JIS) 250 x 354"
+ ////"DMPAPER_B4 12 B4 (JIS) 250 x 354"
//which is bogus as it's either JIS 257 × 364 or ISO 250 × 353
//(cmc)
case( DMPAPER_B4 ):
@@ -1058,7 +1057,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
break;
}
}
-
+
if( nFlags & SAL_JOBSET_DUPLEXMODE )
{
DuplexMode eDuplex = DUPLEX_UNKNOWN;
@@ -1077,7 +1076,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// -----------------------------------------------------------------------
-static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
+static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -1097,7 +1096,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -1112,8 +1111,8 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperSize
if ( nFlags & SAL_JOBSET_PAPERSIZE )
{
- CHOOSE_DEVMODE(dmFields) |= DM_PAPERSIZE;
- CHOOSE_DEVMODE(dmPaperWidth) = 0;
+ CHOOSE_DEVMODE(dmFields) |= DM_PAPERSIZE;
+ CHOOSE_DEVMODE(dmPaperWidth) = 0;
CHOOSE_DEVMODE(dmPaperLength) = 0;
switch( pSetupData->mePaperFormat )
@@ -1145,11 +1144,11 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
#if 0
//http://msdn.microsoft.com/en-us/library/ms776398(VS.85).aspx
//DMPAPER_ENV_B6 is documented as:
- //"DMPAPER_ENV_B6 35 Envelope B6 176 x 125 mm"
+ //"DMPAPER_ENV_B6 35 Envelope B6 176 x 125 mm"
//which is the wrong way around, it is surely 125 x 176, i.e.
//compare DMPAPER_ENV_B4 and DMPAPER_ENV_B4 as
- //DMPAPER_ENV_B4 33 Envelope B4 250 x 353 mm
- //DMPAPER_ENV_B5 34 Envelope B5 176 x 250 mm
+ //DMPAPER_ENV_B4 33 Envelope B4 250 x 353 mm
+ //DMPAPER_ENV_B5 34 Envelope B5 176 x 250 mm
case( PAPER_B6_ISO ):
CHOOSE_DEVMODE(dmPaperSize) = DMPAPER_ENV_B6;
break;
@@ -1274,12 +1273,12 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
break;
default:
{
- short nPaper = 0;
- sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
- WORD* pPapers = NULL;
- sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
- POINT* pPaperSizes = NULL;
- DWORD nLandscapeAngle = ImplDeviceCaps( pPrinter, DC_ORIENTATION, NULL, pSetupData );
+ short nPaper = 0;
+ ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ WORD* pPapers = NULL;
+ ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ POINT* pPaperSizes = NULL;
+ DWORD nLandscapeAngle = ImplDeviceCaps( pPrinter, DC_ORIENTATION, NULL, pSetupData );
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
{
pPapers = (WORD*)rtl_allocateZeroMemory(nPaperCount*sizeof(WORD));
@@ -1294,7 +1293,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
{
PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
// compare paper formats and select a good match
- for ( sal_uLong i = 0; i < nPaperCount; i++ )
+ for ( ULONG i = 0; i < nPaperCount; i++ )
{
if ( aInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)))
{
@@ -1309,7 +1308,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
if ( !nPaper && nLandscapeAngle != 0 )
{
PaperInfo aRotatedInfo(pSetupData->mnPaperHeight, pSetupData->mnPaperWidth);
- for ( sal_uLong i = 0; i < nPaperCount; i++ )
+ for ( ULONG i = 0; i < nPaperCount; i++ )
{
if ( aRotatedInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)) )
{
@@ -1325,9 +1324,9 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
if ( !nPaper )
{
- CHOOSE_DEVMODE(dmFields) |= DM_PAPERLENGTH | DM_PAPERWIDTH;
- CHOOSE_DEVMODE(dmPaperSize) = DMPAPER_USER;
- CHOOSE_DEVMODE(dmPaperWidth) = (short)(pSetupData->mnPaperWidth/10);
+ CHOOSE_DEVMODE(dmFields) |= DM_PAPERLENGTH | DM_PAPERWIDTH;
+ CHOOSE_DEVMODE(dmPaperSize) = DMPAPER_USER;
+ CHOOSE_DEVMODE(dmPaperWidth) = (short)(pSetupData->mnPaperWidth/10);
CHOOSE_DEVMODE(dmPaperLength) = (short)(pSetupData->mnPaperHeight/10);
}
@@ -1453,19 +1452,19 @@ static WinSalGraphics* ImplCreateSalPrnGraphics( HDC hDC )
{
WinSalGraphics* pGraphics = new WinSalGraphics;
pGraphics->SetLayout( 0 );
- pGraphics->mhDC = hDC;
- pGraphics->mhWnd = 0;
+ pGraphics->mhDC = hDC;
+ pGraphics->mhWnd = 0;
pGraphics->mbPrinter = TRUE;
- pGraphics->mbVirDev = FALSE;
- pGraphics->mbWindow = FALSE;
- pGraphics->mbScreen = FALSE;
+ pGraphics->mbVirDev = FALSE;
+ pGraphics->mbWindow = FALSE;
+ pGraphics->mbScreen = FALSE;
ImplSalInitGraphics( pGraphics );
return pGraphics;
}
// -----------------------------------------------------------------------
-static sal_Bool ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
+static BOOL ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
{
HDC hNewDC = ImplCreateSalPrnIC( pPrinter, pSetupData );
if ( !hNewDC )
@@ -1479,7 +1478,7 @@ static sal_Bool ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* p
}
pPrinter->mpGraphics = ImplCreateSalPrnGraphics( hNewDC );
- pPrinter->mhDC = hNewDC;
+ pPrinter->mhDC = hNewDC;
return TRUE;
}
@@ -1492,9 +1491,9 @@ SalInfoPrinter* WinSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
WinSalInfoPrinter* pPrinter = new WinSalInfoPrinter;
if( ! pQueueInfo->mpSysData )
GetPrinterQueueState( pQueueInfo );
- pPrinter->maDriverName = pQueueInfo->maDriver;
- pPrinter->maDeviceName = pQueueInfo->maPrinterName;
- pPrinter->maPortName = pQueueInfo->mpSysData ?
+ pPrinter->maDriverName = pQueueInfo->maDriver;
+ pPrinter->maDeviceName = pQueueInfo->maPrinterName;
+ pPrinter->maPortName = pQueueInfo->mpSysData ?
*(String*)(pQueueInfo->mpSysData)
: String();
@@ -1509,7 +1508,7 @@ SalInfoPrinter* WinSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
}
pPrinter->mpGraphics = ImplCreateSalPrnGraphics( hDC );
- pPrinter->mhDC = hDC;
+ pPrinter->mhDC = hDC;
if ( !pSetupData->mpDriverData )
ImplUpdateSalJobSetup( pPrinter, pSetupData, FALSE, NULL );
ImplDevModeToJobSetup( pPrinter, pSetupData, SAL_JOBSET_ALL );
@@ -1625,7 +1624,7 @@ void WinSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-sal_Bool WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
+BOOL WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
{
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, static_cast<WinSalFrame*>(pFrame) ) )
{
@@ -1638,7 +1637,7 @@ sal_Bool WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-sal_Bool WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
+BOOL WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
{
if ( !ImplTestSalJobSetup( this, pSetupData, FALSE ) )
return FALSE;
@@ -1647,7 +1646,7 @@ sal_Bool WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-sal_Bool WinSalInfoPrinter::SetData( sal_uLong nFlags, ImplJobSetup* pSetupData )
+BOOL WinSalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
{
ImplJobSetupToDevMode( this, pSetupData, nFlags );
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, NULL ) )
@@ -1661,7 +1660,7 @@ sal_Bool WinSalInfoPrinter::SetData( sal_uLong nFlags, ImplJobSetup* pSetupData
// -----------------------------------------------------------------------
-sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
+ULONG WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
{
DWORD nRet = ImplDeviceCaps( this, DC_BINS, NULL, pSetupData );
if ( nRet && (nRet != GDI_ERROR) )
@@ -1672,7 +1671,7 @@ sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin )
+XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin )
{
XubString aPaperBinName;
@@ -1702,7 +1701,7 @@ XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sa
// -----------------------------------------------------------------------
-sal_uLong WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType )
+ULONG WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType )
{
DWORD nRet;
@@ -1716,12 +1715,15 @@ sal_uLong WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, sa
return nRet;
return 0;
case PRINTER_CAPABILITIES_COLLATECOPIES:
- nRet = ImplDeviceCaps( this, DC_COLLATE, NULL, pSetupData );
- if ( nRet && (nRet != GDI_ERROR) )
+ if ( aSalShlData.mbW40 )
{
- nRet = ImplDeviceCaps( this, DC_COPIES, NULL, pSetupData );
+ nRet = ImplDeviceCaps( this, DC_COLLATE, NULL, pSetupData );
if ( nRet && (nRet != GDI_ERROR) )
- return nRet;
+ {
+ nRet = ImplDeviceCaps( this, DC_COPIES, NULL, pSetupData );
+ if ( nRet && (nRet != GDI_ERROR) )
+ return nRet;
+ }
}
return 0;
@@ -1757,12 +1759,12 @@ void WinSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
{
HDC hDC = mhDC;
- rOutWidth = GetDeviceCaps( hDC, HORZRES );
- rOutHeight = GetDeviceCaps( hDC, VERTRES );
+ rOutWidth = GetDeviceCaps( hDC, HORZRES );
+ rOutHeight = GetDeviceCaps( hDC, VERTRES );
- rPageOffX = GetDeviceCaps( hDC, PHYSICALOFFSETX );
- rPageOffY = GetDeviceCaps( hDC, PHYSICALOFFSETY );
- rPageWidth = GetDeviceCaps( hDC, PHYSICALWIDTH );
+ rPageOffX = GetDeviceCaps( hDC, PHYSICALOFFSETX );
+ rPageOffY = GetDeviceCaps( hDC, PHYSICALOFFSETY );
+ rPageWidth = GetDeviceCaps( hDC, PHYSICALWIDTH );
rPageHeight = GetDeviceCaps( hDC, PHYSICALHEIGHT );
}
@@ -1784,12 +1786,12 @@ void WinSalInstance::DestroyPrinter( SalPrinter* pPrinter )
// =======================================================================
-BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
+WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter;
- sal_Bool bWhile = TRUE;
- int i = 0;
+ BOOL bWhile = TRUE;
+ int i = 0;
do
{
@@ -1797,11 +1799,8 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
- {
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
- }
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -1828,47 +1827,53 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
// -----------------------------------------------------------------------
-static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, sal_uLong nCopies, sal_Bool bCollate )
+static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, ULONG nCopies, BOOL bCollate )
{
LPDEVMODEA pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEA)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
- pDevMode->dmFields |= DM_COLLATE;
- if ( bCollate )
- pDevMode->dmCollate = DMCOLLATE_TRUE;
- else
- pDevMode->dmCollate = DMCOLLATE_FALSE;
+ pDevMode->dmCopies = (short)(USHORT)nCopies;
+ if ( aSalShlData.mbW40 )
+ {
+ pDevMode->dmFields |= DM_COLLATE;
+ if ( bCollate )
+ pDevMode->dmCollate = DMCOLLATE_TRUE;
+ else
+ pDevMode->dmCollate = DMCOLLATE_FALSE;
+ }
}
return pNewDevMode;
}
-static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, sal_uLong nCopies, sal_Bool bCollate )
+static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, ULONG nCopies, BOOL bCollate )
{
LPDEVMODEW pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEW)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
- pDevMode->dmFields |= DM_COLLATE;
- if ( bCollate )
- pDevMode->dmCollate = DMCOLLATE_TRUE;
- else
- pDevMode->dmCollate = DMCOLLATE_FALSE;
+ pDevMode->dmCopies = (short)(USHORT)nCopies;
+ if ( aSalShlData.mbW40 )
+ {
+ pDevMode->dmFields |= DM_COLLATE;
+ if ( bCollate )
+ pDevMode->dmCollate = DMCOLLATE_TRUE;
+ else
+ pDevMode->dmCollate = DMCOLLATE_FALSE;
+ }
}
return pNewDevMode;
@@ -1956,23 +1961,23 @@ static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt )
return nRet;
}
-sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
+BOOL WinSalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString&,
- sal_uLong nCopies,
+ ULONG nCopies,
bool bCollate,
bool /*bDirect*/,
ImplJobSetup* pSetupData )
{
- mnError = 0;
- mbAbort = FALSE;
- mnCopies = nCopies;
- mbCollate = bCollate;
-
- LPDEVMODEA pOrgDevModeA = NULL;
- LPDEVMODEA pDevModeA = NULL;
- LPDEVMODEW pOrgDevModeW = NULL;
- LPDEVMODEW pDevModeW = NULL;
+ mnError = 0;
+ mbAbort = FALSE;
+ mnCopies = nCopies;
+ mbCollate = bCollate;
+
+ LPDEVMODEA pOrgDevModeA = NULL;
+ LPDEVMODEA pDevModeA = NULL;
+ LPDEVMODEW pOrgDevModeW = NULL;
+ LPDEVMODEW pDevModeW = NULL;
HDC hDC = 0;
if( aSalShlData.mbWPrinter )
{
@@ -1983,7 +1988,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
}
else
pDevModeW = NULL;
-
+
// #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space
sal_Unicode aDrvBuf[4096];
sal_Unicode aDevBuf[4096];
@@ -1993,7 +1998,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
reinterpret_cast<LPCWSTR>(aDevBuf),
NULL,
pDevModeW );
-
+
if ( pDevModeW != pOrgDevModeW )
rtl_freeMemory( pDevModeW );
}
@@ -2006,7 +2011,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
}
else
pDevModeA = NULL;
-
+
// #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space
ByteString aDriver ( ImplSalGetWinAnsiString( mpInfoPrinter->maDriverName, TRUE ) );
ByteString aDevice ( ImplSalGetWinAnsiString( mpInfoPrinter->maDeviceName, TRUE ) );
@@ -2020,10 +2025,10 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
lpszDeviceName,
NULL,
pDevModeA );
-
+
delete [] lpszDriverName;
delete [] lpszDeviceName;
-
+
if ( pDevModeA != pOrgDevModeA )
rtl_freeMemory( pDevModeA );
}
@@ -2042,13 +2047,13 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
return FALSE;
}
- mnError = 0;
- mbAbort = FALSE;
+ mnError = 0;
+ mbAbort = FALSE;
// Wegen Telocom Balloon Fax-Treiber, der uns unsere Messages
// ansonsten oefters schickt, versuchen wir vorher alle
// zu verarbeiten und dann eine Dummy-Message reinstellen
- sal_Bool bWhile = TRUE;
+ BOOL bWhile = TRUE;
int i = 0;
do
{
@@ -2056,12 +2061,8 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
- {
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
- }
-
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -2077,16 +2078,16 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
if( mpInfoPrinter->maPortName.EqualsIgnoreCaseAscii( "FILE:" ) && !(pFileName && pFileName->Len()) )
{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
- uno::Reference< XFilePicker > xFilePicker( xFactory->createInstance(
+ 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" );
- uno::Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- uno::Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
+ Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
+ Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
{
Sequence< Any > aServiceType( 1 );
@@ -2125,10 +2126,10 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
}
else
aInfo.lpszOutput = NULL;
-
+
// start Job
int nRet = lcl_StartDocW( hDC, &aInfo, this );
-
+
if ( nRet <= 0 )
{
long nError = GetLastError();
@@ -2136,7 +2137,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
mnError = SAL_PRINTER_ERROR_ABORT;
else
mnError = SAL_PRINTER_ERROR_GENERALERROR;
- return FALSE;
+ return FALSE;
}
}
else
@@ -2144,7 +2145,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
// Both strings must exist, if StartJob() is called
ByteString aJobName( ImplSalGetWinAnsiString( rJobName, TRUE ) );
ByteString aFileName;
-
+
DOCINFOA aInfo;
memset( &aInfo, 0, sizeof( DOCINFOA ) );
aInfo.cbSize = sizeof( aInfo );
@@ -2161,7 +2162,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
}
else
aInfo.lpszOutput = NULL;
-
+
// start Job
int nRet = lcl_StartDocA( hDC, &aInfo, this );
if ( nRet <= 0 )
@@ -2180,7 +2181,7 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
// -----------------------------------------------------------------------
-sal_Bool WinSalPrinter::EndJob()
+BOOL WinSalPrinter::EndJob()
{
DWORD err = 0;
HDC hDC = mhDC;
@@ -2200,12 +2201,12 @@ sal_Bool WinSalPrinter::EndJob()
// call, however the real solution is supposed to be the threading
// framework yet to come.
SalData* pSalData = GetSalData();
- sal_uLong nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
+ ULONG nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
CATCH_DRIVER_EX_BEGIN;
if( ::EndDoc( hDC ) <= 0 )
err = GetLastError();
CATCH_DRIVER_EX_END( "exception in EndDoc", this );
-
+
pSalData->mpFirstInstance->AcquireYieldMutex( nAcquire );
DeleteDC( hDC );
mhDC = 0;
@@ -2216,7 +2217,7 @@ sal_Bool WinSalPrinter::EndJob()
// -----------------------------------------------------------------------
-sal_Bool WinSalPrinter::AbortJob()
+BOOL WinSalPrinter::AbortJob()
{
mbAbort = TRUE;
@@ -2236,7 +2237,7 @@ sal_Bool WinSalPrinter::AbortJob()
void ImplSalPrinterAbortJobAsync( HDC hPrnDC )
{
- SalData* pSalData = GetSalData();
+ SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter = pSalData->mpFirstPrinter;
// Feststellen, ob Printer noch existiert
@@ -2273,18 +2274,18 @@ void ImplSalPrinterAbortJobAsync( HDC hPrnDC )
// -----------------------------------------------------------------------
-SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData )
+SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData )
{
if( ! isValid() || mhDC == 0 )
return NULL;
-
+
HDC hDC = mhDC;
if ( pSetupData && pSetupData->mpDriverData && bNewJobData )
{
if( aSalShlData.mbWPrinter )
{
- LPDEVMODEW pOrgDevModeW;
- LPDEVMODEW pDevModeW;
+ LPDEVMODEW pOrgDevModeW;
+ LPDEVMODEW pDevModeW;
pOrgDevModeW = SAL_DEVMODE_W( pSetupData );
pDevModeW = ImplSalSetCopies( pOrgDevModeW, mnCopies, mbCollate );
ResetDCW( hDC, pDevModeW );
@@ -2293,8 +2294,8 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo
}
else
{
- LPDEVMODEA pOrgDevModeA;
- LPDEVMODEA pDevModeA;
+ LPDEVMODEA pOrgDevModeA;
+ LPDEVMODEA pDevModeA;
pOrgDevModeA = SAL_DEVMODE_A( pSetupData );
pDevModeA = ImplSalSetCopies( pOrgDevModeA, mnCopies, mbCollate );
ResetDCA( hDC, pDevModeA );
@@ -2306,7 +2307,7 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo
CATCH_DRIVER_EX_BEGIN;
nRet = ::StartPage( hDC );
CATCH_DRIVER_EX_END( "exception in StartPage", this );
-
+
if ( nRet <= 0 )
{
GetLastError();
@@ -2316,8 +2317,8 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo
// Hack to work around old PostScript printer drivers optimizing away empty pages
// TODO: move into ImplCreateSalPrnGraphics()?
- HPEN hTempPen = SelectPen( hDC, GetStockPen( NULL_PEN ) );
- HBRUSH hTempBrush = SelectBrush( hDC, GetStockBrush( NULL_BRUSH ) );
+ HPEN hTempPen = SelectPen( hDC, GetStockPen( NULL_PEN ) );
+ HBRUSH hTempBrush = SelectBrush( hDC, GetStockBrush( NULL_BRUSH ) );
WIN_Rectangle( hDC, -8000, -8000, -7999, -7999 );
SelectPen( hDC, hTempPen );
SelectBrush( hDC, hTempBrush );
@@ -2328,7 +2329,7 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo
// -----------------------------------------------------------------------
-sal_Bool WinSalPrinter::EndPage()
+BOOL WinSalPrinter::EndPage()
{
HDC hDC = mhDC;
if ( hDC && mpGraphics )
@@ -2340,7 +2341,7 @@ sal_Bool WinSalPrinter::EndPage()
if( ! isValid() )
return FALSE;
-
+
int nRet = 0;
CATCH_DRIVER_EX_BEGIN;
nRet = ::EndPage( hDC );
@@ -2358,7 +2359,7 @@ sal_Bool WinSalPrinter::EndPage()
// -----------------------------------------------------------------------
-sal_uLong WinSalPrinter::GetErrorCode()
+ULONG WinSalPrinter::GetErrorCode()
{
return mnError;
}
diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx
index 417c7e1f4952..d69727e9a460 100644
--- a/vcl/win/source/gdi/salvd.cxx
+++ b/vcl/win/source/gdi/salvd.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <saldata.hxx>
#include <salinst.h>
@@ -39,7 +39,7 @@
// =======================================================================
static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
- sal_uInt16 nBitCount )
+ USHORT nBitCount )
{
HBITMAP hBitmap;
@@ -65,9 +65,9 @@ static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
aBitmapInfo.bmiHeader.biYPelsPerMeter = 0;
aBitmapInfo.bmiHeader.biClrUsed = 0;
aBitmapInfo.bmiHeader.biClrImportant = 0;
-
+
void* pDummy;
- hBitmap = CreateDIBSection( hDC, &aBitmapInfo,
+ hBitmap = CreateDIBSection( hDC, &aBitmapInfo,
DIB_RGB_COLORS, &pDummy, NULL,
0 );
}
@@ -79,14 +79,14 @@ static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
long nDX, long nDY,
- sal_uInt16 nBitCount,
+ USHORT nBitCount,
const SystemGraphicsData* pData )
{
WinSalGraphics* pGraphics = static_cast<WinSalGraphics*>(pSGraphics);
- HDC hDC = NULL;
+ HDC hDC = NULL;
HBITMAP hBmp = NULL;
- sal_Bool bOk = FALSE;
+ BOOL bOk = FALSE;
if( pData )
{
@@ -96,11 +96,11 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
}
else
{
- hDC = CreateCompatibleDC( pGraphics->mhDC );
+ hDC = CreateCompatibleDC( pGraphics->mhDC );
if( !hDC )
ImplWriteLastError( GetLastError(), "CreateCompatibleDC in CreateVirtualDevice" );
- hBmp = ImplCreateVirDevBitmap( pGraphics->mhDC,
+ hBmp = ImplCreateVirDevBitmap( pGraphics->mhDC,
nDX, nDY, nBitCount );
if( !hBmp )
ImplWriteLastError( GetLastError(), "ImplCreateVirDevBitmap in CreateVirtualDevice" );
@@ -115,12 +115,12 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
if ( bOk )
{
- WinSalVirtualDevice* pVDev = new WinSalVirtualDevice;
+ WinSalVirtualDevice* pVDev = new WinSalVirtualDevice;
SalData* pSalData = GetSalData();
WinSalGraphics* pVirGraphics = new WinSalGraphics;
pVirGraphics->SetLayout( 0 ); // by default no! mirroring for VirtualDevices, can be enabled with EnableRTL()
- pVirGraphics->mhDC = hDC;
- pVirGraphics->mhWnd = 0;
+ pVirGraphics->mhDC = hDC;
+ pVirGraphics->mhWnd = 0;
pVirGraphics->mbPrinter = FALSE;
pVirGraphics->mbVirDev = TRUE;
pVirGraphics->mbWindow = FALSE;
@@ -132,15 +132,15 @@ SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
}
ImplSalInitGraphics( pVirGraphics );
- pVDev->mhDC = hDC;
- pVDev->mhBmp = hBmp;
+ pVDev->mhDC = hDC;
+ pVDev->mhBmp = hBmp;
if( hBmp )
- pVDev->mhDefBmp = SelectBitmap( hDC, hBmp );
+ pVDev->mhDefBmp = SelectBitmap( hDC, hBmp );
else
pVDev->mhDefBmp = NULL;
- pVDev->mpGraphics = pVirGraphics;
- pVDev->mnBitCount = nBitCount;
- pVDev->mbGraphics = FALSE;
+ pVDev->mpGraphics = pVirGraphics;
+ pVDev->mnBitCount = nBitCount;
+ pVDev->mbGraphics = FALSE;
pVDev->mbForeignDC = (pData != NULL);
// insert VirDev in VirDevList
@@ -170,13 +170,13 @@ void WinSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
WinSalVirtualDevice::WinSalVirtualDevice()
{
- mhDC = (HDC) NULL; // HDC or 0 for Cache Device
- mhBmp = (HBITMAP) NULL; // Memory Bitmap
- mhDefBmp = (HBITMAP) NULL; // Default Bitmap
- mpGraphics = NULL; // current VirDev graphics
- mpNext = NULL; // next VirDev
- mnBitCount = 0; // BitCount (0 or 1)
- mbGraphics = FALSE; // is Graphics used
+ mhDC = (HDC) NULL; // HDC or 0 for Cache Device
+ mhBmp = (HBITMAP) NULL; // Memory Bitmap
+ mhDefBmp = (HBITMAP) NULL; // Default Bitmap
+ mpGraphics = NULL; // current VirDev graphics
+ mpNext = NULL; // next VirDev
+ mnBitCount = 0; // BitCount (0 or 1)
+ mbGraphics = FALSE; // is Graphics used
mbForeignDC = FALSE; // uses a foreign DC instead of a bitmap
}
@@ -227,7 +227,7 @@ void WinSalVirtualDevice::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-sal_Bool WinSalVirtualDevice::SetSize( long nDX, long nDY )
+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 cd66f0f89cd8..0be43f46a84c 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include "tools/svwin.h"
#include "salgdi.h"
#include "saldata.hxx"
@@ -63,24 +63,26 @@
#include <winver.h>
#endif // USE_UNISCRIBE
-#include <boost/unordered_map.hpp>
+#include <hash_map>
#include <set>
-typedef boost::unordered_map<int,int> IntMap;
+typedef std::hash_map<int,int> IntMap;
typedef std::set<int> IntSet;
// Graphite headers
#ifdef ENABLE_GRAPHITE
#include <i18npool/mslangid.hxx>
+#include <graphite/GrClient.h>
+#include <graphite/WinFont.h>
+#include <graphite/Segment.h>
#include <vcl/graphite_layout.hxx>
+#include <vcl/graphite_cache.hxx>
#include <vcl/graphite_features.hxx>
#endif
#define DROPPED_OUTGLYPH 0xFFFF
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OUStringToOString;
+using namespace rtl;
// =======================================================================
@@ -116,14 +118,14 @@ public:
int GetCachedGlyphWidth( int nCharCode ) const;
void CacheGlyphWidth( int nCharCode, int nCharWidth );
- bool InitKashidaHandling( HDC );
- int GetMinKashidaWidth() const { return mnMinKashidaWidth; }
- int GetMinKashidaGlyph() const { return mnMinKashidaGlyph; }
+ bool InitKashidaHandling( HDC );
+ int GetMinKashidaWidth() const { return mnMinKashidaWidth; }
+ int GetMinKashidaGlyph() const { return mnMinKashidaGlyph; }
private:
IntMap maWidthMap;
- mutable int mnMinKashidaWidth;
- mutable int mnMinKashidaGlyph;
+ mutable int mnMinKashidaWidth;
+ mutable int mnMinKashidaGlyph;
};
// -----------------------------------------------------------------------
@@ -243,11 +245,24 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
+ HFONT hHugeFont = 0;
+ if( aSalShlData.mbWNT )
+ {
+ LOGFONTW aLogFont;
+ ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
+ aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
+ aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
+ hHugeFont = ::CreateFontIndirectW( &aLogFont);
+ }
+ else
+ {
+ LOGFONTA aLogFont;
+ ::GetObjectA( mhFont, sizeof(LOGFONTA), &aLogFont);
+ aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
+ aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
+ hHugeFont = ::CreateFontIndirectA( &aLogFont);
+ }
+
if( !hHugeFont )
return 0;
@@ -657,31 +672,57 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #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 )
+ // #108267#, limit the number of glyphs to avoid paint errors
+ UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
+ if( mnDrawOptions || aSalShlData.mbWNT )
+ {
+ // #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 );
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- 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 );
+ 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 );
}
else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ {
+ // #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 ) );
+ }
+ }
+ }
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );
@@ -1210,7 +1251,7 @@ static bool InitUSP()
DWORD nHandle;
DWORD nBufSize = ::GetFileVersionInfoSizeW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), &nHandle );
char* pBuffer = (char*)alloca( nBufSize );
- BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
+ WIN_BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
VS_FIXEDFILEINFO* pFixedFileInfo = NULL;
UINT nFixedFileSize = 0;
if( bRC )
@@ -1917,11 +1958,11 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
}
else
{
- nExtraOfs += nToFillWidth; // at right of cell
- nSubIter = 0; // done with glyph injection
+ nExtraOfs += nToFillWidth; // at right of cell
+ nSubIter = 0; // done with glyph injection
}
if( !bManualCellAlign )
- nExtraOfs -= nExtraWidth; // adjust for right-aligned cells
+ nExtraOfs -= nExtraWidth; // adjust for right-aligned cells
// adjust the draw position for the injected-glyphs case
if( nExtraOfs )
@@ -2031,13 +2072,6 @@ 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;
- }
}
// -----------------------------------------------------------------------
@@ -2057,7 +2091,7 @@ void UniscribeLayout::DropGlyph( int nStartx8 )
if( GetItemSubrange( *pVI, nStart, nDummy ) )
break;
DBG_ASSERT( nStart <= mnGlyphCount, "USPLayout::DropG overflow" );
-
+ int nOffset = 0;
int j = pVI->mnMinGlyphPos;
while (mpOutGlyphs[j] == DROPPED_OUTGLYPH) j++;
if (j == nStart)
@@ -2104,6 +2138,7 @@ void UniscribeLayout::Simplify( bool /*bIsBase*/ )
}
// remove the dropped glyphs
+ const int* pGlyphWidths = mpJustifications ? mpJustifications : mpGlyphAdvances;
for( int nItem = 0; nItem < mnItemCount; ++nItem )
{
VisualItem& rVI = mpVisualItems[ nItem ];
@@ -2124,6 +2159,7 @@ void UniscribeLayout::Simplify( bool /*bIsBase*/ )
i = nMinGlyphPos;
while( (mpOutGlyphs[i] == cDroppedGlyph) && (i < nEndGlyphPos) )
{
+ //rVI.mnXOffset += pGlyphWidths[ i ];
rVI.mnMinGlyphPos = ++i;
}
@@ -2135,7 +2171,7 @@ void UniscribeLayout::Simplify( bool /*bIsBase*/ )
}
// If there are still glyphs in the cluster and mnMinGlyphPos
// has changed then we need to remove the dropped glyphs at start
- // to correct logClusters, which is unsigned and relative to the
+ // to correct logClusters, which is unsigned and relative to the
// item start.
if (rVI.mnMinGlyphPos != nOrigMinGlyphPos)
{
@@ -2197,6 +2233,12 @@ void UniscribeLayout::DrawText( SalGraphics& ) const
else
nBaseGlyphPos = nMinGlyphPos;
+ const int* pGlyphWidths;
+ if( mpJustifications )
+ pGlyphWidths = mpJustifications;
+ else
+ pGlyphWidths = mpGlyphAdvances;
+
int i = mnMinCharPos;
while( (--i >= rVisualItem.mnMinCharPos)
&& (nBaseGlyphPos == mpLogClusters[i]) )
@@ -2318,10 +2360,6 @@ 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 )
@@ -2355,17 +2393,13 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
}
}
- if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
+ // fixup unknown character positions to neighbor
+ for( i = 0; i < nMaxIdx; ++i )
{
- 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;
- }
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
}
}
@@ -2439,9 +2473,9 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs )
if( rVisualItem.IsRTL() )
{
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
- if ( (1U << mpVisualAttrs[i].uJustification) & 0xFF82 ) // any Arabic justification
+ if ( (1U << mpVisualAttrs[i].uJustification) & 0xFF82 ) // any Arabic justification
{ // excluding SCRIPT_JUSTIFY_NONE
- // yes
+ // yes
rVisualItem.mbHasKashidas = true;
// so prepare for kashida handling
InitKashidaHandling();
@@ -2494,7 +2528,7 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs )
{
for( i = nMinGlyphPos; i < nEndGlyphPos; ++i )
nXOffset += mpJustifications[ i ];
-
+
if( rVisualItem.mbHasKashidas )
KashidaItemFix( nMinGlyphPos, nEndGlyphPos );
}
@@ -2525,7 +2559,7 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs )
void UniscribeLayout::InitKashidaHandling()
{
- if( mnMinKashidaGlyph != 0 ) // already initialized
+ if( mnMinKashidaGlyph != 0 ) // already initialized
return;
mrWinFontEntry.InitKashidaHandling( mhDC );
@@ -2542,8 +2576,8 @@ void UniscribeLayout::KashidaItemFix( int nMinGlyphPos, int nEndGlyphPos )
{
// check for vowels
if( (i > nMinGlyphPos && !mpGlyphAdvances[ i-1 ])
- && (1U << mpVisualAttrs[i].uJustification) & 0xFF83 ) // all Arabic justifiction types
- { // including SCRIPT_JUSTIFY_NONE
+ && (1U << mpVisualAttrs[i].uJustification) & 0xFF83 ) // all Arabic justifiction types
+ { // including SCRIPT_JUSTIFY_NONE
// vowel, we do it like ScriptJustify does
// the vowel gets the extra width
long nSpaceAdded = mpJustifications[ i ] - mpGlyphAdvances[ i ];
@@ -2593,7 +2627,7 @@ bool UniscribeLayout::KashidaWordFix ( int nMinGlyphPos, int nEndGlyphPos, int*
if ( nMaxAdded <= 0 )
return false;
// return early if there is not enough space for an extra kashida
- if( 2*nMaxAdded < mnMinKashidaWidth )
+ if( 2*nMaxAdded < mnMinKashidaWidth )
return false;
// redistribute the extra spacing to the kashida position
@@ -2617,7 +2651,7 @@ bool UniscribeLayout::KashidaWordFix ( int nMinGlyphPos, int nEndGlyphPos, int*
// ugly: steal some pixels
long nSteal = 1;
if ( nMaxPos - nMinPos > 0 && ((mnMinKashidaWidth - nSpaceAdded) > (nMaxPos - nMinPos)))
- nSteal = (mnMinKashidaWidth - nSpaceAdded) / (nMaxPos - nMinPos);
+ nSteal = (mnMinKashidaWidth - nSpaceAdded) / (nMaxPos - nMinPos);
for( int i = nMinPos; i <= nMaxPos; ++i )
{
if( i == nKashPos )
@@ -2676,7 +2710,7 @@ void UniscribeLayout::Justify( long nNewWidth )
if( nOldWidth <= 0 )
return;
- nNewWidth *= mnUnitsPerPixel; // convert into font units
+ nNewWidth *= mnUnitsPerPixel; // convert into font units
if( nNewWidth == nOldWidth )
return;
// prepare to distribute the extra width evenly among the visual items
@@ -2689,6 +2723,7 @@ void UniscribeLayout::Justify( long nNewWidth )
// justify stretched script items
long nXOffset = 0;
+ SCRIPT_CACHE& rScriptCache = GetScriptCache();
for( int nItem = 0; nItem < mnItemCount; ++nItem )
{
VisualItem& rVisualItem = mpVisualItems[ nItem ];
@@ -2735,11 +2770,11 @@ bool UniscribeLayout::IsKashidaPosValid ( int nCharPos ) const
}
}
// Invalid char pos or leftmost glyph in visual item
- if ( nMinGlyphIndex == -1 || !mpLogClusters[ nCharPos ] )
+ if ( nMinGlyphIndex == -1 || !mpLogClusters[ nCharPos ] )
return false;
-// This test didn't give the expected results
-/* if( mpLogClusters[ nCharPos+1 ] == mpLogClusters[ nCharPos ])
+// This test didn't give the expected results
+/* if( mpLogClusters[ nCharPos+1 ] == mpLogClusters[ nCharPos ])
// two chars, one glyph
return false;*/
@@ -2749,9 +2784,9 @@ bool UniscribeLayout::IsKashidaPosValid ( int nCharPos ) const
// justification is only allowed if the glyph to the left has not SCRIPT_JUSTIFY_NONE
// and not SCRIPT_JUSTIFY_ARABIC_BLANK
// special case: glyph to the left is vowel (no advance width)
- if ( mpVisualAttrs[ nGlyphPos-1 ].uJustification == SCRIPT_JUSTIFY_ARABIC_BLANK
- || ( mpVisualAttrs[ nGlyphPos-1 ].uJustification == SCRIPT_JUSTIFY_NONE
- && mpGlyphAdvances [ nGlyphPos-1 ] ))
+ if ( mpVisualAttrs[ nGlyphPos-1 ].uJustification == SCRIPT_JUSTIFY_ARABIC_BLANK
+ || ( mpVisualAttrs[ nGlyphPos-1 ].uJustification == SCRIPT_JUSTIFY_NONE
+ && mpGlyphAdvances [ nGlyphPos-1 ] ))
return false;
return true;
}
@@ -2763,9 +2798,9 @@ bool UniscribeLayout::IsKashidaPosValid ( int nCharPos ) const
class GraphiteLayoutWinImpl : public GraphiteLayout
{
public:
- GraphiteLayoutWinImpl(const gr_face * pFace, ImplWinFontEntry & rFont)
+ GraphiteLayoutWinImpl(const gr::Font & font, ImplWinFontEntry & rFont)
throw()
- : GraphiteLayout(pFace), mrFont(rFont) {};
+ : GraphiteLayout(font), mrFont(rFont) {};
virtual ~GraphiteLayoutWinImpl() throw() {};
virtual sal_GlyphId getKashidaGlyph(int & rWidth);
private:
@@ -2784,15 +2819,18 @@ sal_GlyphId GraphiteLayoutWinImpl::getKashidaGlyph(int & rWidth)
class GraphiteWinLayout : public WinLayout
{
private:
- gr_font * mpFont;
+ mutable GraphiteWinFont mpFont;
grutils::GrFeatureParser * mpFeatures;
mutable GraphiteLayoutWinImpl maImpl;
public:
GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE);
+ static bool IsGraphiteEnabledFont(HDC hDC) throw();
+
// used by upper layers
virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout
virtual void AdjustLayout( ImplLayoutArgs& ); // adjusting after fallback etc.
+ // virtual void InitFont() const;
virtual void DrawText( SalGraphics& ) const;
// methods using string indexing
@@ -2809,36 +2847,21 @@ public:
virtual void MoveGlyph( int nStart, long nNewXPos );
virtual void DropGlyph( int nStart );
virtual void Simplify( bool bIsBase );
- ~GraphiteWinLayout()
- {
- delete mpFeatures;
- gr_font_destroy(maImpl.GetFont());
- }
+ ~GraphiteWinLayout() { delete mpFeatures; mpFeatures = NULL; };
+protected:
+ virtual void ReplaceDC(gr::Segment & segment) const;
+ virtual void RestoreDC(gr::Segment & segment) const;
};
-float gr_fontAdvance(const void* appFontHandle, gr_uint16 glyphId)
+bool GraphiteWinLayout::IsGraphiteEnabledFont(HDC hDC) throw()
{
- HDC hDC = reinterpret_cast<HDC>(const_cast<void*>(appFontHandle));
- GLYPHMETRICS gm;
- const MAT2 mat2 = {{0,1}, {0,0}, {0,0}, {0,1}};
- if (GDI_ERROR == ::GetGlyphOutlineW(hDC, glyphId, GGO_GLYPH_INDEX | GGO_METRICS,
- &gm, 0, NULL, &mat2))
- {
- return .0f;
- }
- return gm.gmCellIncX;
+ return gr::WinFont::FontHasGraphiteTables(hDC);
}
GraphiteWinLayout::GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE) throw()
- : WinLayout(hDC, rWFD, rWFE), mpFont(NULL),
- maImpl(rWFD.GraphiteFace(), rWFE)
-{
- // the log font size may differ from the font entry size if scaling is used for large fonts
- LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
- mpFont = gr_make_font_with_advance_fn(static_cast<float>(-aLogFont.lfHeight),
- hDC, gr_fontAdvance, rWFD.GraphiteFace());
- maImpl.SetFont(mpFont);
+ : WinLayout(hDC, rWFD, rWFE), mpFont(hDC),
+ maImpl(mpFont, rWFE)
+{
const rtl::OString aLang = MsLangId::convertLanguageToIsoByteString( rWFE.maFontSelData.meLanguage );
rtl::OString name = rtl::OUStringToOString(
rWFE.maFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 );
@@ -2846,15 +2869,27 @@ GraphiteWinLayout::GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplW
if (nFeat > 0)
{
rtl::OString aFeat = name.copy(nFeat, name.getLength() - nFeat);
- mpFeatures = new grutils::GrFeatureParser(rWFD.GraphiteFace(), aFeat.getStr(), aLang.getStr());
+ mpFeatures = new grutils::GrFeatureParser(mpFont, aFeat.getStr(), aLang.getStr());
}
else
{
- mpFeatures = new grutils::GrFeatureParser(rWFD.GraphiteFace(), aLang.getStr());
+ mpFeatures = new grutils::GrFeatureParser(mpFont, aLang.getStr());
}
maImpl.SetFeatures(mpFeatures);
}
+void GraphiteWinLayout::ReplaceDC(gr::Segment & segment) const
+{
+ COLORREF color = GetTextColor(mhDC);
+ dynamic_cast<gr::WinFont&>(segment.getFont()).replaceDC(mhDC);
+ SetTextColor(mhDC, color);
+}
+
+void GraphiteWinLayout::RestoreDC(gr::Segment & segment) const
+{
+ dynamic_cast<gr::WinFont&>(segment.getFont()).restoreDC();
+}
+
bool GraphiteWinLayout::LayoutText( ImplLayoutArgs & args)
{
if (args.mnMinCharPos >= args.mnEndCharPos)
@@ -2862,7 +2897,7 @@ bool GraphiteWinLayout::LayoutText( ImplLayoutArgs & args)
maImpl.clear();
return true;
}
- HFONT hUnRotatedFont = 0;
+ HFONT hUnRotatedFont;
if (args.mnOrientation)
{
// Graphite gets very confused if the font is rotated
@@ -2874,16 +2909,36 @@ bool GraphiteWinLayout::LayoutText( ImplLayoutArgs & args)
::SelectFont(mhDC, hUnRotatedFont);
}
WinLayout::AdjustLayout(args);
+ mpFont.replaceDC(mhDC);
maImpl.SetFontScale(WinLayout::mfFontScale);
- gr_segment * pSegment = maImpl.CreateSegment(args);
+ //bool succeeded = maImpl.LayoutText(args);
+#ifdef GRCACHE
+ GrSegRecord * pSegRecord = NULL;
+ gr::Segment * pSegment = maImpl.CreateSegment(args, &pSegRecord);
+#else
+ gr::Segment * pSegment = maImpl.CreateSegment(args);
+#endif
bool bSucceeded = false;
if (pSegment)
{
// replace the DC on the font within the segment
+ ReplaceDC(*pSegment);
// create glyph vectors
+#ifdef GRCACHE
+ bSucceeded = maImpl.LayoutGlyphs(args, pSegment, pSegRecord);
+#else
bSucceeded = maImpl.LayoutGlyphs(args, pSegment);
- gr_seg_destroy(pSegment);
+#endif
+ // restore original DC
+ RestoreDC(*pSegment);
+#ifdef GRCACHE
+ if (pSegRecord) pSegRecord->unlock();
+ else delete pSegment;
+#else
+ delete pSegment;
+#endif
}
+ mpFont.restoreDC();
if (args.mnOrientation)
{
// restore the rotated font
@@ -2932,7 +2987,9 @@ void GraphiteWinLayout::DrawText(SalGraphics &sal_graphics) const
int GraphiteWinLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const
{
+ mpFont.replaceDC(mhDC);
int nBreak = maImpl.GetTextBreak(nMaxWidth, nCharExtra, nFactor);
+ mpFont.restoreDC();
return nBreak;
}
@@ -2986,9 +3043,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
{
#ifdef ENABLE_GRAPHITE
if (rFontFace.SupportsGraphite())
- {
pWinLayout = new GraphiteWinLayout(mhDC, rFontFace, rFontInstance);
- }
else
#endif // ENABLE_GRAPHITE
// script complexity is determined in upper layers
@@ -3021,20 +3076,20 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
pWinLayout = new SimpleWinLayout( mhDC, eCharSet, rFontFace, rFontInstance );
}
- if( mfFontScale[nFallbackLevel] != 1.0 )
- pWinLayout->SetFontScale( mfFontScale[nFallbackLevel] );
+ if( mfFontScale != 1.0 )
+ pWinLayout->SetFontScale( mfFontScale );
return pWinLayout;
}
// -----------------------------------------------------------------------
-int WinSalGraphics::GetMinKashidaWidth()
+int WinSalGraphics::GetMinKashidaWidth()
{
if( !mpWinFontEntry[0] )
return 0;
mpWinFontEntry[0]->InitKashidaHandling( mhDC );
- int nMinKashida = static_cast<int>(mfFontScale[0] * mpWinFontEntry[0]->GetMinKashidaWidth());
+ int nMinKashida = static_cast<int>(mfFontScale * mpWinFontEntry[0]->GetMinKashidaWidth());
return nMinKashida;
}
@@ -3045,8 +3100,8 @@ ImplWinFontEntry::ImplWinFontEntry( ImplFontSelectData& rFSD )
, maWidthMap( 512 )
, mpKerningPairs( NULL )
, mnKerningPairs( -1 )
-, mnMinKashidaWidth( -1 )
-, mnMinKashidaGlyph( -1 )
+, mnMinKashidaWidth( -1 )
+, mnMinKashidaGlyph( -1 )
{
#ifdef USE_UNISCRIBE
maScriptCache = NULL;
@@ -3107,17 +3162,17 @@ int ImplWinFontEntry::GetKerning( sal_Unicode cLeft, sal_Unicode cRight ) const
bool ImplWinFontEntry::InitKashidaHandling( HDC hDC )
{
- if( mnMinKashidaWidth >= 0 ) // already cached?
+ if( mnMinKashidaWidth >= 0 ) // already cached?
return mnMinKashidaWidth;
// initialize the kashida width
mnMinKashidaWidth = 0;
mnMinKashidaGlyph = 0;
#ifdef USE_UNISCRIBE
- if (aUspModule || (bUspEnabled && InitUSP()))
+ if (aUspModule || (bUspEnabled && InitUSP()))
{
SCRIPT_FONTPROPERTIES aFontProperties;
- aFontProperties.cBytes = sizeof (aFontProperties);
+ aFontProperties.cBytes = sizeof (aFontProperties);
SCRIPT_CACHE& rScriptCache = GetScriptCache();
HRESULT nRC = (*pScriptGetFontProperties)( hDC, &rScriptCache, &aFontProperties );
if( nRC != 0 )
@@ -3136,10 +3191,6 @@ ImplFontData* ImplWinFontData::Clone() const
{
if( mpUnicodeMap )
mpUnicodeMap->AddReference();
-#ifdef ENABLE_GRAPHITE
- if ( mpGraphiteData )
- mpGraphiteData->AddReference();
-#endif
ImplFontData* pClone = new ImplWinFontData( *this );
return pClone;
}
diff --git a/vcl/win/source/gdi/wntgdi.cxx b/vcl/win/source/gdi/wntgdi.cxx
index 5adc7fe18cf5..b0c470f8d989 100644
--- a/vcl/win/source/gdi/wntgdi.cxx
+++ b/vcl/win/source/gdi/wntgdi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/vcl/win/source/src/ase.cur b/vcl/win/source/src/ase.cur
index 7634a7d34a7b..7634a7d34a7b 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 100644..100755
--- 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 2d4f3d279c3f..46a825b7ab51 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,7 +47,7 @@
#include <stdio.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#ifdef __MINGW32__
#include <excpt.h>
#endif
@@ -96,7 +96,6 @@ 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;
@@ -121,8 +120,8 @@ void MyOutputDebugString( char *s) { OutputDebugString( s ); }
// misssing prototypes and constants for LayeredWindows
extern "C" {
- //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
- typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
+ //WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
+ typedef BOOL ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes;
};
@@ -130,7 +129,7 @@ extern "C" {
const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED");
-sal_Bool WinSalFrame::mbInReparent = FALSE;
+BOOL WinSalFrame::mbInReparent = FALSE;
// =======================================================================
@@ -161,7 +160,7 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
// Position, Groesse und Status fuer GetWindowState() merken
if ( !pFrame->mbFullScreen )
{
- sal_Bool bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
+ BOOL bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
if ( IsIconic( pFrame->mhWnd ) )
{
pFrame->maState.mnState |= SAL_FRAMESTATE_MINIMIZED;
@@ -258,12 +257,12 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
if ( aSalShlData.maVersionInfo.dwMajorVersion <= 4 )
- winVerOk = 0; // NT
+ winVerOk = 0; // NT
}
else if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{
if ( aSalShlData.maVersionInfo.dwMajorVersion == 4 && aSalShlData.maVersionInfo.dwMinorVersion == 0 )
- winVerOk = 0; // Win95
+ winVerOk = 0; // Win95
}
}
@@ -345,13 +344,13 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
// =======================================================================
SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
- HWND hWndParent, sal_uLong nSalFrameStyle )
+ HWND hWndParent, ULONG nSalFrameStyle )
{
WinSalFrame* pFrame = new WinSalFrame;
HWND hWnd;
DWORD nSysStyle = 0;
DWORD nExSysStyle = 0;
- sal_Bool bSubFrame = FALSE;
+ BOOL bSubFrame = FALSE;
if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands
GdiSetBatchLimit( 1 );
@@ -389,7 +388,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
// this breaks SAL_FRAME_STYLE_SYSTEMCHILD handling, which is not
// used currently. Probably SAL_FRAME_STYLE_SYSTEMCHILD should be
// removed again.
-
+
// nSysStyle |= WS_CLIPCHILDREN;
if ( hWndParent )
{
@@ -501,31 +500,45 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
}
// create frame
- LPCWSTR pClassName;
- if ( bSubFrame )
+ if ( aSalShlData.mbWNT )
{
- if ( nSalFrameStyle & (SAL_FRAME_STYLE_MOVEABLE|SAL_FRAME_STYLE_NOSHADOW) ) // check if shadow not wanted
- pClassName = SAL_SUBFRAME_CLASSNAMEW;
+ LPCWSTR pClassName;
+ if ( bSubFrame )
+ {
+ if ( nSalFrameStyle & (SAL_FRAME_STYLE_MOVEABLE|SAL_FRAME_STYLE_NOSHADOW) ) // check if shadow not wanted
+ pClassName = SAL_SUBFRAME_CLASSNAMEW;
+ else
+ pClassName = SAL_TMPSUBFRAME_CLASSNAMEW; // undecorated floaters will get shadow on XP
+ }
else
- pClassName = SAL_TMPSUBFRAME_CLASSNAMEW; // undecorated floaters will get shadow on XP
+ {
+ if ( nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE )
+ pClassName = SAL_FRAME_CLASSNAMEW;
+ else
+ pClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
+ }
+ hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
+ hWndParent, 0, pInst->mhInst, (void*)pFrame );
+ if( !hWnd )
+ ImplWriteLastError( GetLastError(), "CreateWindowEx" );
+#if OSL_DEBUG_LEVEL > 1
+ // set transparency value
+ if( bLayeredAPI == 1 && GetWindowExStyle( hWnd ) & WS_EX_LAYERED )
+ lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ );
+#endif
}
else
{
- if ( nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE )
- pClassName = SAL_FRAME_CLASSNAMEW;
+ LPCSTR pClassName;
+ if ( bSubFrame )
+ pClassName = SAL_SUBFRAME_CLASSNAMEA;
else
- pClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
+ pClassName = SAL_FRAME_CLASSNAMEA;
+ hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
+ hWndParent, 0, pInst->mhInst, (void*)pFrame );
}
- hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, pInst->mhInst, (void*)pFrame );
- if( !hWnd )
- ImplWriteLastError( GetLastError(), "CreateWindowEx" );
-#if OSL_DEBUG_LEVEL > 1
- // set transparency value
- if( bLayeredAPI == 1 && GetWindowExStyle( hWnd ) & WS_EX_LAYERED )
- lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ );
-#endif
if ( !hWnd )
{
delete pFrame;
@@ -584,11 +597,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, sal_Bool bAsChild )
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
{
HINSTANCE hInstance = GetSalData()->mhInst;
- sal_uLong nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
- sal_uLong nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
+ ULONG nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
+ ULONG nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
if( bAsChild )
{
@@ -596,10 +609,22 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild )
nExSysStyle = 0;
}
- LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
- return CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
+ HWND hWnd = NULL;
+ if ( aSalShlData.mbWNT )
+ {
+ LPCWSTR pClassName = SAL_SUBFRAME_CLASSNAMEW;
+ hWnd = CreateWindowExW( nExSysStyle, pClassName, L"", nSysStyle,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
+ hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
+ }
+ else
+ {
+ LPCSTR pClassName = SAL_SUBFRAME_CLASSNAMEA;
+ hWnd = CreateWindowExA( nExSysStyle, pClassName, "", nSysStyle,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
+ hWndParent, 0, hInstance, (void*)GetWindowPtr( oldhWnd ) );
+ }
+ return hWnd;
}
// =======================================================================
@@ -607,7 +632,7 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild )
// Uebersetzungstabelle von System-Keycodes in StarView-Keycodes
#define KEY_TAB_SIZE 146
-static sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] =
+static USHORT aImplTranslateKeyTab[KEY_TAB_SIZE] =
{
// StarView-Code System-Code Index
0, // 0
@@ -864,11 +889,11 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
- 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 );
+ 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 );
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
{
- uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
+ 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 )
{
@@ -904,7 +929,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, sal_Bool bAlways = FALSE )
+static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE )
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
{
@@ -966,7 +991,7 @@ WinSalFrame::WinSalFrame()
mpClipRgnData = NULL;
mbFirstClipRect = TRUE;
mpNextClipRect = NULL;
- mnDisplay = 0;
+ mnDisplay = 0;
memset( &maState, 0, sizeof( SalFrameState ) );
maSysData.nSize = sizeof( SystemEnvData );
@@ -1168,9 +1193,9 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-sal_Bool WinSalFrame::PostEvent( void* pData )
+BOOL WinSalFrame::PostEvent( void* pData )
{
- return (sal_Bool)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
+ return (BOOL)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
}
// -----------------------------------------------------------------------
@@ -1188,7 +1213,7 @@ void WinSalFrame::SetTitle( const XubString& rTitle )
// -----------------------------------------------------------------------
-void WinSalFrame::SetIcon( sal_uInt16 nIcon )
+void WinSalFrame::SetIcon( USHORT nIcon )
{
// If we have a window without an Icon (for example a dialog), ignore this call
if ( mbNoIcon )
@@ -1245,7 +1270,7 @@ SalFrame* WinSalFrame::GetParent() const
// -----------------------------------------------------------------------
-static void ImplSalShow( HWND hWnd, sal_Bool bVisible, sal_Bool bNoActivate )
+static void ImplSalShow( HWND hWnd, BOOL bVisible, BOOL bNoActivate )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
@@ -1317,7 +1342,37 @@ static void ImplSalShow( HWND hWnd, sal_Bool bVisible, sal_Bool bNoActivate )
}
else
{
- ShowWindow( hWnd, SW_HIDE );
+ // See also Bug #91813# and #68467#
+ if ( pFrame->mbFullScreen &&
+ pFrame->mbPresentation &&
+ (aSalShlData.mnVersion < 500) &&
+ !::GetParent( hWnd ) )
+ {
+ // Damit im Impress-Player in der Taskleiste nicht durch
+ // einen Windows-Fehler hin- und wieder mal ein leerer
+ // Button stehen bleibt, muessen wir hier die Taskleiste
+ // etwas austricksen. Denn wenn wir im FullScreenMode sind
+ // und das Fenster hiden kommt Windows anscheinend etwas aus
+ // dem tritt und somit minimieren wir das Fenster damit es
+ // nicht flackert
+ ANIMATIONINFO aInfo;
+ aInfo.cbSize = sizeof( aInfo );
+ SystemParametersInfo( SPI_GETANIMATION, 0, &aInfo, 0 );
+ if ( aInfo.iMinAnimate )
+ {
+ int nOldAni = aInfo.iMinAnimate;
+ aInfo.iMinAnimate = 0;
+ SystemParametersInfo( SPI_SETANIMATION, 0, &aInfo, 0 );
+ ShowWindow( pFrame->mhWnd, SW_SHOWMINNOACTIVE );
+ aInfo.iMinAnimate = nOldAni;
+ SystemParametersInfo( SPI_SETANIMATION, 0, &aInfo, 0 );
+ }
+ else
+ ShowWindow( hWnd, SW_SHOWMINNOACTIVE );
+ ShowWindow( hWnd, SW_HIDE );
+ }
+ else
+ ShowWindow( hWnd, SW_HIDE );
}
}
@@ -1330,7 +1385,7 @@ void WinSalFrame::SetExtendedFrameStyle( SalExtStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
+void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
@@ -1343,7 +1398,7 @@ void WinSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
// -----------------------------------------------------------------------
-void WinSalFrame::Enable( sal_Bool bEnable )
+void WinSalFrame::Enable( BOOL bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -1365,9 +1420,9 @@ void WinSalFrame::SetMaxClientSize( long nWidth, long nHeight )
// -----------------------------------------------------------------------
void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
- sal_uInt16 nFlags )
+ USHORT nFlags )
{
- sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( !bVisible )
{
Window *pClientWin = GetWindow()->ImplGetClientWindow();
@@ -1382,7 +1437,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
ShowWindow( mhWnd, SW_RESTORE );
}
- sal_uInt16 nEvent = 0;
+ USHORT nEvent = 0;
UINT nPosSize = 0;
RECT aClientRect, aWindowRect;
GetClientRect( mhWnd, &aClientRect ); // x,y always 0,0, but width and height without border
@@ -1534,7 +1589,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// Adjust Window in the screen
- sal_Bool bCheckOffScreen = TRUE;
+ 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) )
@@ -1577,7 +1632,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// -----------------------------------------------------------------------
-static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, sal_Bool bAsChild )
+static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAsChild )
{
// save hwnd, will be overwritten in WM_CREATE during createwindow
HWND hWndOld = pThis->mhWnd;
@@ -1610,8 +1665,8 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, sal_Bool
pObject = pObject->mpNextObject;
}
- sal_Bool bNeedGraphics = pThis->mbGraphics;
- sal_Bool bNeedCacheDC = FALSE;
+ BOOL bNeedGraphics = pThis->mbGraphics;
+ BOOL bNeedCacheDC = FALSE;
HFONT hFont = NULL;
HPEN hPen = NULL;
@@ -1851,8 +1906,8 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
GetWindowPlacement( mhWnd, &aPlacement );
// Status setzen
- sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
- sal_Bool bUpdateHiddenFramePos = FALSE;
+ BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ BOOL bUpdateHiddenFramePos = FALSE;
if ( !bVisible )
{
aPlacement.showCmd = SW_HIDE;
@@ -1933,7 +1988,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
// -----------------------------------------------------------------------
-sal_Bool WinSalFrame::GetWindowState( SalFrameState* pState )
+BOOL WinSalFrame::GetWindowState( SalFrameState* pState )
{
if ( maState.mnWidth && maState.mnHeight )
{
@@ -1987,7 +2042,7 @@ void WinSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
+void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
{
if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
return;
@@ -2020,7 +2075,7 @@ void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
// wenn ShowState wieder hergestellt werden muss, hiden wir zuerst
// das Fenster, damit es nicht so sehr flackert
- sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible && (mnShowState != mnFullScreenShowState) )
ShowWindow( mhWnd, SW_HIDE );
@@ -2052,7 +2107,7 @@ void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
// -----------------------------------------------------------------------
-void WinSalFrame::StartPresentation( sal_Bool bStart )
+void WinSalFrame::StartPresentation( BOOL bStart )
{
if ( mbPresentation == bStart )
return;
@@ -2107,7 +2162,7 @@ void WinSalFrame::StartPresentation( sal_Bool bStart )
// -----------------------------------------------------------------------
-void WinSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
+void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
{
HWND hWnd;
if ( bOnTop )
@@ -2119,12 +2174,12 @@ void WinSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
// -----------------------------------------------------------------------
-static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
+static void ImplSalToTop( HWND hWnd, USHORT nFlags )
{
WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
BringWindowToTop( hWnd );
-
+
if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK )
{
// This magic code is necessary to connect the input focus of the
@@ -2175,9 +2230,9 @@ static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::ToTop( sal_uInt16 nFlags )
+void WinSalFrame::ToTop( USHORT nFlags )
{
- nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
+ nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
// We post this message to avoid deadlocks
@@ -2326,7 +2381,7 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::CaptureMouse( sal_Bool bCapture )
+void WinSalFrame::CaptureMouse( BOOL bCapture )
{
// Send this Message to the window, because CaptureMouse() only work
// in the thread of the window, which has create this window
@@ -2368,7 +2423,7 @@ void WinSalFrame::Sync()
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
- sal_Bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
+ BOOL bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
if ( bIME )
{
if ( !pFrame->mbIME )
@@ -2435,7 +2490,7 @@ void WinSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-static void ImplSalFrameEndExtTextInput( HWND hWnd, sal_uInt16 nFlags )
+static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
@@ -2453,7 +2508,7 @@ static void ImplSalFrameEndExtTextInput( HWND hWnd, sal_uInt16 nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::EndExtTextInput( sal_uInt16 nFlags )
+void WinSalFrame::EndExtTextInput( USHORT nFlags )
{
// Must be called in the main thread!
ImplSendMessage( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, (WPARAM)nFlags, 0 );
@@ -2472,23 +2527,52 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
int nKeyLen = 0;
if ( lParam )
{
- nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen );
- // #i12401# the current unicows.dll has a bug in CharUpperBuffW, which corrupts the stack
- // fall back to the ANSI version instead
- DBG_ASSERT( nKeyLen <= nMaxKeyLen, "Invalid key name length!" );
- if( nKeyLen > nMaxKeyLen )
- nKeyLen = 0;
- else if( nKeyLen > 0 )
+ if ( aSalShlData.mbWNT )
{
- // Capitalize just the first letter of key names
- CharLowerBuffW( aKeyBuf, nKeyLen );
+ nKeyLen = GetKeyNameTextW( lParam, aKeyBuf, nMaxKeyLen );
+ // #i12401# the current unicows.dll has a bug in CharUpperBuffW, which corrupts the stack
+ // fall back to the ANSI version instead
+ DBG_ASSERT( nKeyLen <= nMaxKeyLen, "Invalid key name length!" );
+ if( nKeyLen > nMaxKeyLen )
+ nKeyLen = 0;
+ else if( nKeyLen > 0 )
+ {
+ // Capitalize just the first letter of key names
+ CharLowerBuffW( aKeyBuf, nKeyLen );
- bool bUpper = true;
- for( WCHAR *pW=aKeyBuf, *pE=pW+nKeyLen; pW < pE; ++pW )
+ bool bUpper = true;
+ for( WCHAR *pW=aKeyBuf, *pE=pW+nKeyLen; pW < pE; ++pW )
+ {
+ if( bUpper )
+ CharUpperBuffW( pW, 1 );
+ bUpper = (*pW=='+') || (*pW=='-') || (*pW==' ') || (*pW=='.');
+ }
+ }
+ }
+ else // !mbWnt
+ {
+ sal_Char aAnsiKeyBuf[ nMaxKeyLen ];
+ int nAnsiKeyLen = GetKeyNameTextA( lParam, aAnsiKeyBuf, nMaxKeyLen );
+ DBG_ASSERT( nAnsiKeyLen <= nMaxKeyLen, "Invalid key name length!" );
+ if( nAnsiKeyLen > nMaxKeyLen )
+ nAnsiKeyLen = 0;
+ else if( nAnsiKeyLen > 0 )
{
- if( bUpper )
- CharUpperBuffW( pW, 1 );
- bUpper = (*pW=='+') || (*pW=='-') || (*pW==' ') || (*pW=='.');
+ // Capitalize just the first letter of key names
+ // TODO: check MCBS key names
+ CharLowerBuffA( aAnsiKeyBuf, nAnsiKeyLen );
+
+ bool bUpper = true;
+ for( sal_Char *pA=aAnsiKeyBuf, *pE=pA+nAnsiKeyLen; pA < pE; ++pA )
+ {
+ if( bUpper )
+ CharUpperBuffA( pA, 1 );
+ bUpper = (*pA=='+') || (*pA=='-') || (*pA==' ') || (*pA=='.');
+ }
+
+ // Convert to Unicode and copy the data in the Unicode Buffer
+ nKeyLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
+ aAnsiKeyBuf, nAnsiKeyLen, aKeyBuf, nMaxKeyLen );
}
}
}
@@ -2524,7 +2608,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
+XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
{
static const int nMaxKeyLen = 350;
sal_Unicode aKeyBuf[ nMaxKeyLen ];
@@ -2534,26 +2618,26 @@ XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
if ( nKeyCode & KEY_MOD1 )
{
nSysCode = MapVirtualKey( VK_CONTROL, 0 );
- nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
+ nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Ctrl" );
}
if ( nKeyCode & KEY_MOD2 )
{
nSysCode = MapVirtualKey( VK_MENU, 0 );
- nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
+ nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Alt" );
}
if ( nKeyCode & KEY_SHIFT )
{
nSysCode = MapVirtualKey( VK_SHIFT, 0 );
- nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
+ nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Shift" );
}
- sal_uInt16 nCode = nKeyCode & 0x0FFF;
- sal_uLong nSysCode2 = 0;
+ USHORT nCode = nKeyCode & 0x0FFF;
+ ULONG nSysCode2 = 0;
sal_Char* pReplace = NULL;
sal_Unicode cSVCode = 0;
sal_Char aFBuf[4];
@@ -2592,42 +2676,42 @@ XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
case KEY_DOWN:
nSysCode = VK_DOWN;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Down";
break;
case KEY_UP:
nSysCode = VK_UP;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Up";
break;
case KEY_LEFT:
nSysCode = VK_LEFT;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Left";
break;
case KEY_RIGHT:
nSysCode = VK_RIGHT;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Right";
break;
case KEY_HOME:
nSysCode = VK_HOME;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Home";
break;
case KEY_END:
nSysCode = VK_END;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "End";
break;
case KEY_PAGEUP:
nSysCode = VK_PRIOR;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Page Up";
break;
case KEY_PAGEDOWN:
nSysCode = VK_NEXT;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Page Down";
break;
case KEY_RETURN:
@@ -2652,12 +2736,12 @@ XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
break;
case KEY_INSERT:
nSysCode = VK_INSERT;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Insert";
break;
case KEY_DELETE:
nSysCode = VK_DELETE;
- nSysCode2 = (((sal_uLong)1) << 24);
+ nSysCode2 = (((ULONG)1) << 24);
pReplace = "Delete";
break;
@@ -2688,15 +2772,6 @@ XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
case KEY_EQUAL:
cSVCode = '=';
break;
- case KEY_SEMICOLON:
- cSVCode = ';';
- break;
- case KEY_BRACKETLEFT:
- cSVCode = '[';
- break;
- case KEY_BRACKETRIGHT:
- cSVCode = ']';
- break;
}
}
@@ -2721,12 +2796,12 @@ XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
if( !nKeyBufLen )
return XubString();
- return XubString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
+ return XubString( aKeyBuf, sal::static_int_cast< USHORT >(nKeyBufLen) );
}
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
+XubString WinSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -2804,29 +2879,6 @@ 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 )
{
@@ -2852,30 +2904,37 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
- aMouseSettings.SetMenuDelay( (sal_uLong)ImplA2I( aValueBuf ) );
+ aMouseSettings.SetMenuDelay( (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() );
- 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 ) ) );
+ if ( bCompBorder )
+ {
+ aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
+ aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
+ aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
+ if ( aSalShlData.mnVersion >= 410 )
+ {
+ 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 ) ) );
@@ -2897,52 +2956,37 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
-
- 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 )
+ 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 )
{
- 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 );
+ // 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 );
+ }
}
}
- // 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 ) );
@@ -2951,9 +2995,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// Checked-Color berechnen
Color aColor1 = aStyleSettings.GetFaceColor();
Color aColor2 = aStyleSettings.GetLightColor();
- 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);
+ 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);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
@@ -2965,14 +3009,11 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// High contrast
HIGHCONTRAST hc;
hc.cbSize = sizeof( HIGHCONTRAST );
- if( SystemParametersInfo( SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0)
- && (hc.dwFlags & HCF_HIGHCONTRASTON)
- ) {
+ if( SystemParametersInfo( SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0) && (hc.dwFlags & HCF_HIGHCONTRASTON) )
aStyleSettings.SetHighContrastMode( 1 );
- aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
- } else {
+ else
aStyleSettings.SetHighContrastMode( 0 );
- }
+
// Query Fonts
Font aMenuFont = aStyleSettings.GetMenuFont();
@@ -2982,19 +3023,39 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
Font aAppFont = aStyleSettings.GetAppFont();
Font aIconFont = aStyleSettings.GetIconFont();
HDC hDC = GetDC( 0 );
- NONCLIENTMETRICSW aNonClientMetrics;
- aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
- if ( SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
+ if ( aSalShlData.mbWNT )
{
- ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
- ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
- ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
- ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
- ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
-
- LOGFONTW aLogFont;
- if ( SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
- ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont );
+ NONCLIENTMETRICSW aNonClientMetrics;
+ aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
+ if ( SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
+ {
+ ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
+ ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
+ ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
+ ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
+ ImplSalUpdateStyleFontW( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
+
+ LOGFONTW aLogFont;
+ if ( SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
+ ImplSalUpdateStyleFontW( hDC, aLogFont, aIconFont );
+ }
+ }
+ else
+ {
+ NONCLIENTMETRICSA aNonClientMetrics;
+ aNonClientMetrics.cbSize = sizeof( aNonClientMetrics );
+ if ( SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) )
+ {
+ ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMenuFont, aMenuFont );
+ ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfCaptionFont, aTitleFont );
+ ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfSmCaptionFont, aFloatTitleFont );
+ ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfStatusFont, aHelpFont );
+ ImplSalUpdateStyleFontA( hDC, aNonClientMetrics.lfMessageFont, aAppFont );
+
+ LOGFONTA aLogFont;
+ if ( SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, &aLogFont, 0 ) )
+ ImplSalUpdateStyleFontA( hDC, aLogFont, aIconFont );
+ }
}
// get screen font resolution to calculate toolbox item size
@@ -3033,10 +3094,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetInfoFont( aAppFont );
aStyleSettings.SetToolFont( aAppFont );
- BOOL bDragFull;
+ WIN_BOOL bDragFull;
if ( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, &bDragFull, 0 ) )
{
- sal_uLong nDragFullOptions = aStyleSettings.GetDragFullOptions();
+ ULONG nDragFullOptions = aStyleSettings.GetDragFullOptions();
if ( bDragFull )
nDragFullOptions |= DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT;
else
@@ -3059,7 +3120,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
if ( nType == REG_SZ )
{
- nValue = (sal_uLong)ImplA2I( aValueBuf );
+ nValue = (ULONG)ImplA2I( aValueBuf );
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
@@ -3090,7 +3151,7 @@ SalBitmap* WinSalFrame::SnapShot()
HDC hDC = GetWindowDC( mhWnd );
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- sal_Bool bRet;
+ BOOL bRet;
bRet = BitBlt( hBmpDC, 0, 0, nDX, nDY, hDC, 0, 0, SRCCOPY ) ? TRUE : FALSE;
ImplReleaseCachedDC( CACHED_HDC_1 );
@@ -3178,7 +3239,7 @@ SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
return aState;
}
-void WinSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
+void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
{
BYTE nVKey = 0;
switch (nKeyCode)
@@ -3210,19 +3271,19 @@ void WinSalFrame::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalFrame::BeginSetClipRegion( sal_uLong nRects )
+void WinSalFrame::BeginSetClipRegion( ULONG nRects )
{
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
- sal_uLong nRectBufSize = sizeof(RECT)*nRects;
+ ULONG nRectBufSize = sizeof(RECT)*nRects;
mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
- mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
- mpClipRgnData->rdh.iType = RDH_RECTANGLES;
- mpClipRgnData->rdh.nCount = nRects;
+ mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
+ mpClipRgnData->rdh.iType = RDH_RECTANGLES;
+ mpClipRgnData->rdh.nCount = nRects;
mpClipRgnData->rdh.nRgnSize = nRectBufSize;
SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
- mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
- mbFirstClipRect = TRUE;
+ mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ mbFirstClipRect = TRUE;
}
// -----------------------------------------------------------------------
@@ -3232,17 +3293,17 @@ void WinSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
if( ! mpClipRgnData )
return;
- RECT* pRect = mpNextClipRect;
- RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
- long nRight = nX + nWidth;
- long nBottom = nY + nHeight;
+ RECT* pRect = mpNextClipRect;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ long nRight = nX + nWidth;
+ long nBottom = nY + nHeight;
if ( mbFirstClipRect )
{
- pBoundRect->left = nX;
- pBoundRect->top = nY;
- pBoundRect->right = nRight;
- pBoundRect->bottom = nBottom;
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
mbFirstClipRect = FALSE;
}
else
@@ -3260,10 +3321,10 @@ void WinSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
pBoundRect->bottom = (int)nBottom;
}
- pRect->left = (int)nX;
- pRect->top = (int)nY;
- pRect->right = (int)nRight;
- pRect->bottom = (int)nBottom;
+ pRect->left = (int)nX;
+ pRect->top = (int)nY;
+ pRect->right = (int)nRight;
+ pRect->bottom = (int)nBottom;
if( (mpNextClipRect - (RECT*)(&mpClipRgnData->Buffer)) < (int)mpClipRgnData->rdh.nCount )
mpNextClipRect++;
}
@@ -3286,7 +3347,7 @@ void WinSalFrame::EndSetClipRegion()
}
else
{
- sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
}
delete [] (BYTE*)mpClipRgnData;
@@ -3331,8 +3392,8 @@ static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
}
SalMouseEvent aMouseEvt;
long nRet;
- sal_uInt16 nEvent = 0;
- sal_Bool bCall = TRUE;
+ USHORT nEvent = 0;
+ BOOL bCall = TRUE;
aMouseEvt.mnX = (short)LOWORD( lParam );
aMouseEvt.mnY = (short)HIWORD( lParam );
@@ -3566,9 +3627,9 @@ static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
// -----------------------------------------------------------------------
-static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
+static USHORT ImplSalGetKeyCode( WPARAM wParam )
{
- sal_uInt16 nKeyCode;
+ USHORT nKeyCode;
// convert KeyCode
if ( wParam < KEY_TAB_SIZE )
@@ -3576,7 +3637,7 @@ static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
else
{
SalData* pSalData = GetSalData();
- std::map< UINT, sal_uInt16 >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
+ std::map< UINT, USHORT >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
if( it != pSalData->maVKMap.end() )
nKeyCode = it->second;
else
@@ -3590,7 +3651,7 @@ static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
static UINT ImplStrToNum( const sal_Char* pStr )
{
- sal_uInt16 n = 0;
+ USHORT n = 0;
// Solange es sich um eine Ziffer handelt, String umwandeln
while( (*pStr >= 48) && (*pStr <= 57) )
@@ -3607,7 +3668,7 @@ static UINT ImplStrToNum( const sal_Char* pStr )
static void ImplUpdateInputLang( WinSalFrame* pFrame )
{
- sal_Bool bLanguageChange = FALSE;
+ BOOL bLanguageChange = FALSE;
UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
if ( nLang && nLang != pFrame->mnInputLang )
{
@@ -3616,10 +3677,30 @@ static void ImplUpdateInputLang( WinSalFrame* pFrame )
bLanguageChange = TRUE;
}
- // We are on Windows NT so we use Unicode FrameProcs and get
- // Unicode charcodes directly from Windows no need to set up a
- // code page
- return;
+ // If we are on Windows NT we use Unicode FrameProcs and so we
+ // get Unicode charcodes directly from Windows
+ // no need to set up a code page
+ if ( aSalShlData.mbWNT )
+ return;
+
+ if ( !nLang )
+ {
+ pFrame->mnInputLang = 0;
+ pFrame->mnInputCodePage = GetACP();
+ }
+ else if ( bLanguageChange )
+ {
+ sal_Char aBuf[10];
+ if ( GetLocaleInfoA( MAKELCID( nLang, SORT_DEFAULT ), LOCALE_IDEFAULTANSICODEPAGE,
+ aBuf, sizeof(aBuf) ) > 0 )
+ {
+ pFrame->mnInputCodePage = ImplStrToNum( aBuf );
+ if ( !pFrame->mnInputCodePage )
+ pFrame->mnInputCodePage = GetACP();
+ }
+ else
+ pFrame->mnInputCodePage = GetACP();
+ }
}
@@ -3627,9 +3708,31 @@ static sal_Unicode ImplGetCharCode( WinSalFrame* pFrame, WPARAM nCharCode )
{
ImplUpdateInputLang( pFrame );
- // We are on Windows NT so we use Unicode FrameProcs and we
+ // If we are on Windows NT we use Unicode FrameProcs and so we
// get Unicode charcodes directly from Windows
- return (sal_Unicode)nCharCode;
+ if ( aSalShlData.mbWNT )
+ return (sal_Unicode)nCharCode;
+
+ sal_Char aCharBuf[2];
+ int nCharLen;
+ WCHAR c;
+ if ( nCharCode > 0xFF )
+ {
+ aCharBuf[0] = (sal_Char)(nCharCode>>8);
+ aCharBuf[1] = (sal_Char)nCharCode;
+ nCharLen = 2;
+ }
+ else
+ {
+ aCharBuf[0] = (sal_Char)nCharCode;
+ nCharLen = 1;
+ }
+ if ( ::MultiByteToWideChar( pFrame->mnInputCodePage,
+ MB_PRECOMPOSED,
+ aCharBuf, nCharLen, &c, 1 ) )
+ return (sal_Unicode)c;
+ else
+ return (sal_Unicode)nCharCode;
}
// -----------------------------------------------------------------------
@@ -3647,9 +3750,9 @@ LanguageType WinSalFrame::GetInputLanguage()
// -----------------------------------------------------------------------
-sal_Bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
+BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
{
- sal_Bool bRet = FALSE;
+ BOOL bRet = FALSE;
HKL hkl = 0;
// just use the passed language identifier, do not try to load additional keyboard support
@@ -3689,14 +3792,14 @@ sal_Bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aL
static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT& rResult )
{
- static sal_Bool bIgnoreCharMsg = FALSE;
+ static BOOL bIgnoreCharMsg = FALSE;
static WPARAM nDeadChar = 0;
static WPARAM nLastVKChar = 0;
- static sal_uInt16 nLastChar = 0;
- static sal_uInt16 nLastModKeyCode = 0;
+ static USHORT nLastChar = 0;
+ static USHORT nLastModKeyCode = 0;
static bool bWaitForModKeyRelease = false;
- sal_uInt16 nRepeat = LOWORD( lParam )-1;
- sal_uInt16 nModCode = 0;
+ USHORT nRepeat = LOWORD( lParam )-1;
+ USHORT nModCode = 0;
// Key wurde evtl. durch SysChild an uns weitergeleitet und
// darf somit dann nicht doppelt verarbeitet werden
@@ -3756,11 +3859,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
SalKeyEvent aKeyEvt;
if ( (wParam >= '0') && (wParam <= '9') )
- aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_NUM + wParam - '0');
+ aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_NUM + wParam - '0');
else if ( (wParam >= 'A') && (wParam <= 'Z') )
- aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'A');
+ aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'A');
else if ( (wParam >= 'a') && (wParam <= 'z') )
- aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'a');
+ aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'a');
else if ( wParam == 0x0D ) // RETURN
aKeyEvt.mnCode = KEY_RETURN;
else if ( wParam == 0x1B ) // ESCAPE
@@ -3793,9 +3896,9 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
}
SalKeyEvent aKeyEvt;
- aKeyEvt.mnCode = nModCode; // Or should it be 0? - as this is always a character returned
- aKeyEvt.mnTime = GetMessageTime();
- aKeyEvt.mnRepeat = 0;
+ aKeyEvt.mnCode = nModCode; // Or should it be 0? - as this is always a character returned
+ aKeyEvt.mnTime = GetMessageTime();
+ aKeyEvt.mnRepeat = 0;
if( wParam >= Uni_SupplementaryPlanesStart )
{
@@ -3808,7 +3911,7 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
wParam = (sal_Unicode) Uni_UTF32ToSurrogate2( wParam );
}
- aKeyEvt.mnCharCode = (sal_Unicode) wParam;
+ aKeyEvt.mnCharCode = (sal_Unicode) wParam;
nLastChar = 0;
nLastVKChar = 0;
@@ -3828,7 +3931,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
- sal_uInt16 tmpCode = 0;
+ USHORT tmpCode = 0;
if( GetKeyState( VK_LSHIFT ) & 0x8000 )
tmpCode |= MODKEY_LSHIFT;
if( GetKeyState( VK_RSHIFT ) & 0x8000 )
@@ -3862,11 +3965,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
else
{
SalKeyEvent aKeyEvt;
- sal_uInt16 nEvent;
+ USHORT nEvent;
MSG aCharMsg;
- BOOL bCharPeek = FALSE;
+ WIN_BOOL bCharPeek = FALSE;
UINT nCharMsg = WM_CHAR;
- sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ 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;
@@ -3932,14 +4035,14 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
aKeyEvt.mnTime = GetMessageTime();
aKeyEvt.mnCode |= nModCode;
aKeyEvt.mnRepeat = nRepeat;
-
+
if( (nModCode & (KEY_MOD1|KEY_MOD2)) == (KEY_MOD1|KEY_MOD2) &&
aKeyEvt.mnCharCode )
{
// this is actually AltGr and should not be handled as Alt
aKeyEvt.mnCode &= ~(KEY_MOD1|KEY_MOD2);
}
-
+
bIgnoreCharMsg = bCharPeek ? TRUE : FALSE;
long nRet = pFrame->CallCallback( nEvent, &aKeyEvt );
// independent part only reacts on keyup but Windows does not send
@@ -3981,8 +4084,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( !pFrame )
return 0;
- sal_uInt16 nRepeat = LOWORD( lParam )-1;
- sal_uInt16 nModCode = 0;
+ USHORT nRepeat = LOWORD( lParam )-1;
+ USHORT nModCode = 0;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -3995,8 +4098,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( (wParam != VK_SHIFT) && (wParam != VK_CONTROL) && (wParam != VK_MENU) )
{
SalKeyEvent aKeyEvt;
- sal_uInt16 nEvent;
- sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ USHORT nEvent;
+ BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
// convert KeyCode
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
@@ -4031,9 +4134,9 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( !pFrame )
return 0;
- sal_uInt16 nRepeat = LOWORD( lParam )-1;
- sal_uInt16 nModCode = 0;
- sal_uInt16 cKeyCode = (sal_uInt16)wParam;
+ USHORT nRepeat = LOWORD( lParam )-1;
+ USHORT nModCode = 0;
+ USHORT cKeyCode = (USHORT)wParam;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -4065,7 +4168,7 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
static bool ImplHandlePaintMsg( HWND hWnd )
{
- sal_Bool bMutex = FALSE;
+ BOOL bMutex = FALSE;
if ( ImplSalYieldMutexTryToAcquire() )
bMutex = TRUE;
@@ -4421,7 +4524,7 @@ static long ImplHandleShutDownMsg( HWND hWnd )
static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
- sal_uInt16 nSalEvent = SALEVENT_SETTINGSCHANGED;
+ USHORT nSalEvent = SALEVENT_SETTINGSCHANGED;
if ( nMsg == WM_DEVMODECHANGE )
nSalEvent = SALEVENT_PRINTERCHANGED;
@@ -4435,8 +4538,16 @@ static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
{
if ( lParam )
{
- if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 )
- nSalEvent = SALEVENT_PRINTERCHANGED;
+ if ( aSalShlData.mbWNT )
+ {
+ if ( ImplSalWICompareAscii( (const wchar_t*)lParam, "devices" ) == 0 )
+ nSalEvent = SALEVENT_PRINTERCHANGED;
+ }
+ else
+ {
+ if ( stricmp( (const char*)lParam, "devices" ) == 0 )
+ nSalEvent = SALEVENT_PRINTERCHANGED;
+ }
}
}
@@ -4517,7 +4628,7 @@ static void ImplHandleForcePalette( HWND hWnd )
// -----------------------------------------------------------------------
-static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
+static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, int& rDef )
{
SalData* pSalData = GetSalData();
@@ -4535,7 +4646,7 @@ static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
return 0;
}
- sal_Bool bReleaseMutex = FALSE;
+ BOOL bReleaseMutex = FALSE;
if ( (nMsg == WM_QUERYNEWPALETTE) || (nMsg == WM_PALETTECHANGED) )
{
// Da Windows diese Messages auch sendet, muss hier auch die
@@ -4554,8 +4665,8 @@ static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
HDC hDC;
HPALETTE hOldPal;
UINT nCols;
- sal_Bool bStdDC;
- sal_Bool bUpdate;
+ BOOL bStdDC;
+ BOOL bUpdate;
pSalData->mbInPalChange = TRUE;
@@ -4748,7 +4859,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, sal_Bool bByPosition=TRUE )
+static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, BOOL bByPosition=TRUE )
{
DWORD err=0;
@@ -4821,7 +4932,7 @@ static int ImplMenuChar( HWND, WPARAM wParam, LPARAM lParam )
if( nFound == 1 )
nRet = MAKELRESULT( idxFound, MNC_EXECUTE );
else
- // duplicate mnemonics, just select the next occurrence
+ // duplicate mnemonics, just select the next occurence
nRet = MAKELRESULT( idxFound, MNC_SELECT );
return nRet;
@@ -4903,9 +5014,9 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
COLORREF clrPrevText, clrPrevBkgnd;
HFONT hfntOld;
HBRUSH hbrOld;
- 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;
+ 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;
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
@@ -4970,9 +5081,9 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
if( hDrawDIB )
{
- PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDrawDIB );
- PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
- PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
+ PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( hDrawDIB );
+ PBITMAPINFOHEADER pBIH = (PBITMAPINFOHEADER) pBI;
+ PBYTE pBits = (PBYTE) pBI + *(DWORD*) pBI +
pSalBmp->ImplGetDIBColorCount( hDrawDIB ) * sizeof( RGBQUAD );
HBITMAP hBmp = CreateDIBitmap( pDI->hDC, pBIH, CBM_INIT, pBits, pBI, DIB_RGB_COLORS );
@@ -5049,7 +5160,7 @@ static int ImplHandleMenuActivate( HWND hWnd, WPARAM wParam, LPARAM )
HMENU hMenu = (HMENU) wParam;
// WORD nPos = LOWORD (lParam);
- // sal_Bool bWindowMenu = (sal_Bool) HIWORD(lParam);
+ // BOOL bWindowMenu = (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
@@ -5084,14 +5195,14 @@ static int ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
if( !GetSalData()->IsKnownMenuHandle( hMenu ) )
return 0;
- sal_Bool bByPosition = FALSE;
+ BOOL bByPosition = FALSE;
if( nFlags & MF_POPUP )
bByPosition = TRUE;
long nRet = 0;
if ( hMenu && !pFrame->mLastActivatedhMenu )
{
- // we never activated a menu (ie, no WM_INITMENUPOPUP has occurred yet)
+ // we never activated a menu (ie, no WM_INITMENUPOPUP has occured yet)
// which means this must be the menubar -> send activation/deactivation
SalMenuEvent aMenuEvt;
WinSalMenuItem *pSalMenuItem = ImplGetSalMenuItem( hMenu, nId, bByPosition );
@@ -5184,8 +5295,8 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( pFrame->mbFullScreen )
{
- BOOL bMaximize = IsZoomed( pFrame->mhWnd );
- BOOL bMinimize = IsIconic( pFrame->mhWnd );
+ WIN_BOOL bMaximize = IsZoomed( pFrame->mhWnd );
+ WIN_BOOL bMinimize = IsIconic( pFrame->mhWnd );
if ( (nCommand == SC_SIZE) ||
(!bMinimize && (nCommand == SC_MOVE)) ||
(!bMaximize && (nCommand == SC_MAXIMIZE)) ||
@@ -5249,7 +5360,7 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( ((cKeyCode >= 48) && (cKeyCode <= 57)) ||
((cKeyCode >= 97) && (cKeyCode <= 122)) )
{
- sal_uInt16 nModCode = 0;
+ USHORT nModCode = 0;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
@@ -5338,9 +5449,9 @@ static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
// -----------------------------------------------------------------------
-static sal_Bool ImplHandleIMEStartComposition( HWND hWnd )
+static BOOL ImplHandleIMEStartComposition( HWND hWnd )
{
- sal_Bool bDef = TRUE;
+ BOOL bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5368,10 +5479,10 @@ static sal_Bool ImplHandleIMEStartComposition( HWND hWnd )
// -----------------------------------------------------------------------
-static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
+static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
HIMC hIMC, LPARAM lParam )
{
- sal_Bool bDef = TRUE;
+ BOOL bDef = TRUE;
// Init Event
SalExtTextInputEvent aEvt;
@@ -5412,7 +5523,7 @@ static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
bDef = FALSE;
- sal_uInt16* pSalAttrAry = NULL;
+ USHORT* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
@@ -5421,23 +5532,23 @@ static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
delete [] pTextBuf;
- BYTE* pAttrBuf = NULL;
+ WIN_BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
if ( nAttrLen > 0 )
{
- pAttrBuf = new BYTE[nAttrLen];
+ pAttrBuf = new WIN_BYTE[nAttrLen];
ImmGetCompositionStringW( hIMC, GCS_COMPATTR, pAttrBuf, nAttrLen );
}
if ( pAttrBuf )
{
xub_StrLen nTextLen = aEvt.maText.Len();
- pSalAttrAry = new sal_uInt16[nTextLen];
- memset( pSalAttrAry, 0, nTextLen*sizeof( sal_uInt16 ) );
+ pSalAttrAry = new USHORT[nTextLen];
+ memset( pSalAttrAry, 0, nTextLen*sizeof( USHORT ) );
for ( xub_StrLen i = 0; (i < nTextLen) && (i < nAttrLen); i++ )
{
- BYTE nWinAttr = pAttrBuf[i];
- sal_uInt16 nSalAttr;
+ WIN_BYTE nWinAttr = pAttrBuf[i];
+ USHORT nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
nSalAttr = SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
@@ -5500,9 +5611,9 @@ static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static sal_Bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
+static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
{
- sal_Bool bDef = TRUE;
+ BOOL bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
@@ -5548,9 +5659,9 @@ static sal_Bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
// -----------------------------------------------------------------------
-static sal_Bool ImplHandleIMEEndComposition( HWND hWnd )
+static BOOL ImplHandleIMEEndComposition( HWND hWnd )
{
- sal_Bool bDef = TRUE;
+ BOOL bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5573,23 +5684,23 @@ static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam )
sal_Int16 nCommand = 0;
switch( GET_APPCOMMAND_LPARAM(lParam) )
{
- case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MEDIA_COMMAND_CHANNEL_DOWN; break;
- case APPCOMMAND_MEDIA_CHANNEL_UP: nCommand = MEDIA_COMMAND_CHANNEL_UP; break;
- case APPCOMMAND_MEDIA_NEXTTRACK: nCommand = MEDIA_COMMAND_NEXTTRACK; break;
- case APPCOMMAND_MEDIA_PAUSE: nCommand = MEDIA_COMMAND_PAUSE; break;
- case APPCOMMAND_MEDIA_PLAY: nCommand = MEDIA_COMMAND_PLAY; break;
- case APPCOMMAND_MEDIA_PLAY_PAUSE: nCommand = MEDIA_COMMAND_PLAY_PAUSE; break;
- case APPCOMMAND_MEDIA_PREVIOUSTRACK: nCommand = MEDIA_COMMAND_PREVIOUSTRACK; break;
- case APPCOMMAND_MEDIA_RECORD: nCommand = MEDIA_COMMAND_RECORD; break;
- case APPCOMMAND_MEDIA_REWIND: nCommand = MEDIA_COMMAND_REWIND; break;
- case APPCOMMAND_MEDIA_STOP: nCommand = MEDIA_COMMAND_STOP; break;
- case APPCOMMAND_MIC_ON_OFF_TOGGLE: nCommand = MEDIA_COMMAND_MIC_ON_OFF_TOGGLE; break;
- case APPCOMMAND_MICROPHONE_VOLUME_DOWN: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN; break;
- case APPCOMMAND_MICROPHONE_VOLUME_MUTE: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE; break;
- case APPCOMMAND_MICROPHONE_VOLUME_UP: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_UP; break;
- case APPCOMMAND_VOLUME_DOWN: nCommand = MEDIA_COMMAND_VOLUME_DOWN; break;
- case APPCOMMAND_VOLUME_MUTE: nCommand = MEDIA_COMMAND_VOLUME_MUTE; break;
- case APPCOMMAND_VOLUME_UP: nCommand = MEDIA_COMMAND_VOLUME_UP; break;
+ case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MEDIA_COMMAND_CHANNEL_DOWN; break;
+ case APPCOMMAND_MEDIA_CHANNEL_UP: nCommand = MEDIA_COMMAND_CHANNEL_UP; break;
+ case APPCOMMAND_MEDIA_NEXTTRACK: nCommand = MEDIA_COMMAND_NEXTTRACK; break;
+ case APPCOMMAND_MEDIA_PAUSE: nCommand = MEDIA_COMMAND_PAUSE; break;
+ case APPCOMMAND_MEDIA_PLAY: nCommand = MEDIA_COMMAND_PLAY; break;
+ case APPCOMMAND_MEDIA_PLAY_PAUSE: nCommand = MEDIA_COMMAND_PLAY_PAUSE; break;
+ case APPCOMMAND_MEDIA_PREVIOUSTRACK: nCommand = MEDIA_COMMAND_PREVIOUSTRACK; break;
+ case APPCOMMAND_MEDIA_RECORD: nCommand = MEDIA_COMMAND_RECORD; break;
+ case APPCOMMAND_MEDIA_REWIND: nCommand = MEDIA_COMMAND_REWIND; break;
+ case APPCOMMAND_MEDIA_STOP: nCommand = MEDIA_COMMAND_STOP; break;
+ case APPCOMMAND_MIC_ON_OFF_TOGGLE: nCommand = MEDIA_COMMAND_MIC_ON_OFF_TOGGLE; break;
+ case APPCOMMAND_MICROPHONE_VOLUME_DOWN: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN; break;
+ case APPCOMMAND_MICROPHONE_VOLUME_MUTE: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE; break;
+ case APPCOMMAND_MICROPHONE_VOLUME_UP: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_UP; break;
+ case APPCOMMAND_VOLUME_DOWN: nCommand = MEDIA_COMMAND_VOLUME_DOWN; break;
+ case APPCOMMAND_VOLUME_MUTE: nCommand = MEDIA_COMMAND_VOLUME_MUTE; break;
+ case APPCOMMAND_VOLUME_UP: nCommand = MEDIA_COMMAND_VOLUME_UP; break;
break;
default:
return false;
@@ -5691,10 +5802,10 @@ static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam )
{
// The first call for reconversion.
pFrame->CallCallback( SALEVENT_STARTRECONVERSION, (void*)NULL );
-
+
// Retrieve the surrounding text from the focused control.
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
-
+
if( aEvt.maText.Len() == 0 )
{
return 0;
@@ -5736,8 +5847,8 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
- sal_uLong nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
- sal_uLong nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
+ ULONG nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
+ ULONG nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
{
@@ -5805,7 +5916,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
{
LRESULT nRet = 0;
static int bInWheelMsg = FALSE;
- static int bInQueryEnd = FALSE;
+ static int bInQueryEnd = FALSE;
// By WM_CRETAE we connect the frame with the window handle
if ( nMsg == WM_CREATE )
@@ -6074,7 +6185,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
if ( nRet )
{
- MSG msg;
+ MSG msg;
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
@@ -6125,11 +6236,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_TOTOP:
- ImplSalToTop( hWnd, (sal_uInt16)wParam );
+ ImplSalToTop( hWnd, (USHORT)wParam );
rDef = FALSE;
break;
case SAL_MSG_SHOW:
- ImplSalShow( hWnd, (sal_Bool)wParam, (sal_Bool)lParam );
+ ImplSalShow( hWnd, (BOOL)wParam, (BOOL)lParam );
rDef = FALSE;
break;
case SAL_MSG_SETINPUTCONTEXT:
@@ -6137,7 +6248,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_ENDEXTTEXTINPUT:
- ImplSalFrameEndExtTextInput( hWnd, (sal_uInt16)(sal_uLong)(void*)wParam );
+ ImplSalFrameEndExtTextInput( hWnd, (USHORT)(ULONG)(void*)wParam );
rDef = FALSE;
break;
@@ -6171,19 +6282,19 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
break;
case WM_APPCOMMAND:
if( ImplHandleAppCommand( hWnd, lParam ) )
- {
+ {
rDef = false;
nRet = 1;
}
break;
#if WINVER >= 0x0500
case WM_IME_REQUEST:
- if ( (sal_uIntPtr)( wParam ) == IMR_RECONVERTSTRING )
+ if ( PtrToInt( wParam ) == IMR_RECONVERTSTRING )
{
nRet = ImplHandleIMEReconvertString( hWnd, lParam );
rDef = FALSE;
}
- else if( (sal_uIntPtr)( wParam ) == IMR_CONFIRMRECONVERTSTRING )
+ else if( PtrToInt( wParam ) == IMR_CONFIRMRECONVERTSTRING )
{
nRet = ImplHandleIMEConfirmReconvertString( hWnd, lParam );
rDef = FALSE;
@@ -6304,11 +6415,11 @@ LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
// -----------------------------------------------------------------------
-sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
+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
- sal_Bool bResult = FALSE;
+ BOOL bResult = FALSE;
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
int bDef = TRUE;
@@ -6327,7 +6438,7 @@ sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam
// -----------------------------------------------------------------------
-sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
+BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
{
static int first=1;
// if VCL_LOGFILE_ENABLED is set, Win32 API error messages can be written
@@ -6335,7 +6446,7 @@ sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
static char *logEnabled = getenv("VCL_LOGFILE_ENABLED");
if( logEnabled )
{
- sal_Bool bSuccess = FALSE;
+ 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 dcdf8fb7ae2a..0a22c2c028fd 100644
--- a/vcl/win/source/window/salmenu.cxx
+++ b/vcl/win/source/window/salmenu.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <saldata.hxx>
#include <salinst.h>
@@ -48,7 +48,7 @@ static DWORD myerr=0;
// =======================================================================
-sal_Bool SalData::IsKnownMenuHandle( HMENU hMenu )
+BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
{
if( mhMenuSet.find( hMenu ) == mhMenuSet.end() )
return FALSE;
@@ -60,7 +60,7 @@ sal_Bool SalData::IsKnownMenuHandle( HMENU hMenu )
// WinSalInst factory methods
-SalMenu* WinSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* )
+SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar )
{
WinSalMenu *pSalMenu = new WinSalMenu();
@@ -108,9 +108,9 @@ SalMenuItem* WinSalInstance::CreateMenuItem( const SalItemParams* pItemData )
// 'translate' mnemonics
pSalMenuItem->mText.SearchAndReplace( '~', '&' );
-
+
pSalMenuItem->mInfo.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID | MIIM_DATA;
- pSalMenuItem->mInfo.fType = MFT_STRING;
+ pSalMenuItem->mInfo.fType = MFT_STRING;
#ifdef OWNERDRAW
if( pItemData->pMenu && !pItemData->pMenu->IsMenuBar() )
pSalMenuItem->mInfo.fType |= MFT_OWNERDRAW;
@@ -118,7 +118,7 @@ SalMenuItem* WinSalInstance::CreateMenuItem( const SalItemParams* pItemData )
#endif
pSalMenuItem->mInfo.dwTypeData = (LPWSTR) pSalMenuItem->mText.GetBuffer();
pSalMenuItem->mInfo.cch = pSalMenuItem->mText.Len();
-
+
pSalMenuItem->mInfo.wID = pItemData->nId;
pSalMenuItem->mInfo.dwItemData = (ULONG_PTR) pSalMenuItem; // user data
}
@@ -169,7 +169,7 @@ WinSalMenu::~WinSalMenu()
::DestroyMenu( mhMenu );
}
-sal_Bool WinSalMenu::VisibleMenuBar()
+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, sal_Bool bCheck )
+void WinSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
{
if( -1 != ::CheckMenuItem( mhMenu, nPos, MF_BYPOSITION|(bCheck ? MF_CHECKED : MF_UNCHECKED) ) )
ImplDrawMenuBar( this );
}
-void WinSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
+void WinSalMenu::EnableItem( unsigned nPos, 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 c0965c298f63..79cef0623469 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,18 +31,17 @@
#include <string.h>
-#include <svsys.h>
+#include <tools/svwin.h>
#include <wincomp.hxx>
#include <saldata.hxx>
#include <salinst.h>
#include <salframe.h>
#include <salobj.h>
#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
// =======================================================================
-static sal_Bool ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
+static BOOL ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
{
if ( hWndParent == hWndChild )
return TRUE;
@@ -66,7 +65,7 @@ static sal_Bool ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
WinSalObject* ImplFindSalObject( HWND hWndChild )
{
SalData* pSalData = GetSalData();
- WinSalObject* pObject = pSalData->mpFirstObject;
+ WinSalObject* pObject = pSalData->mpFirstObject;
while ( pObject )
{
if ( ImplIsSysWindowOrChild( pObject->mhWndChild, hWndChild ) )
@@ -103,46 +102,6 @@ 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
@@ -201,11 +160,11 @@ LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
// -----------------------------------------------------------------------
-sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
+BOOL ImplSalPreDispatchMsg( MSG* pMsg )
{
// Used for Unicode and none Unicode
- SalData* pSalData = GetSalData();
- WinSalObject* pObject;
+ SalData* pSalData = GetSalData();
+ WinSalObject* pObject;
if ( (pMsg->message == WM_LBUTTONDOWN) ||
(pMsg->message == WM_RBUTTONDOWN) ||
@@ -226,7 +185,7 @@ sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
// SysKeys werden als WM_SYSCOMMAND verarbeitet
// Char-Events verarbeiten wir nicht, da wir nur
// Accelerator relevante Keys verarbeiten wollen
- sal_Bool bWantedKeyCode = FALSE;
+ 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)) )
@@ -254,13 +213,13 @@ sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
{
pSalData->mnSalObjWantKeyEvt = 0;
- sal_uInt16 nKeyCode = LOWORD( pMsg->wParam );
+ USHORT nKeyCode = LOWORD( pMsg->wParam );
// Nur 0-9 und A-Z
if ( ((nKeyCode >= 48) && (nKeyCode <= 57)) ||
((nKeyCode >= 65) && (nKeyCode <= 90)) ||
((nKeyCode >= 97) && (nKeyCode <= 122)) )
{
- sal_Bool bRet = FALSE;
+ BOOL bRet = FALSE;
ImplSalYieldMutexAcquireWithWait();
pObject = ImplFindSalObject( pMsg->hwnd );
if ( pObject )
@@ -291,8 +250,8 @@ sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT /* nDispatchResult */ )
{
// Used for Unicode and none Unicode
- SalData* pSalData = GetSalData();
- WinSalFrame* pFrame;
+ SalData* pSalData = GetSalData();
+ WinSalFrame* pFrame;
if ( (pMsg->message == WM_KEYDOWN) || (pMsg->message == WM_KEYUP) )
{
@@ -317,8 +276,8 @@ void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT /* nDispatchResult */ )
LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
{
- WinSalObject* pSysObj;
- LRESULT nRet = 0;
+ WinSalObject* pSysObj;
+ LRESULT nRet = 0;
switch( nMsg )
{
@@ -377,8 +336,8 @@ LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
if ( ImplSalYieldMutexTryToAcquire() )
{
pSysObj = GetSalObjWindowPtr( hWnd );
- HWND hFocusWnd = ::GetFocus();
- sal_uInt16 nEvent;
+ HWND hFocusWnd = ::GetFocus();
+ USHORT nEvent;
if ( hFocusWnd && ImplIsSysWindowOrChild( hWnd, hFocusWnd ) )
nEvent = SALOBJ_EVENT_GETFOCUS;
else
@@ -533,10 +492,20 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
// Hook installieren, wenn es das erste SalObject ist
if ( !pSalData->mpFirstObject )
{
- pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
- SalSysMsgProc,
- pSalData->mhInst,
- pSalData->mnAppThreadId );
+ if ( aSalShlData.mbWNT )
+ {
+ pSalData->mhSalObjMsgHook = SetWindowsHookExW( WH_CALLWNDPROC,
+ SalSysMsgProc,
+ pSalData->mhInst,
+ pSalData->mnAppThreadId );
+ }
+ else
+ {
+ pSalData->mhSalObjMsgHook = SetWindowsHookExA( WH_CALLWNDPROC,
+ SalSysMsgProc,
+ pSalData->mhInst,
+ pSalData->mnAppThreadId );
+ }
}
if ( !pSalData->mbObjClassInit )
@@ -545,25 +514,25 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
if ( false )//aSalShlData.mbWNT )
{
WNDCLASSEXW aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalSysObjWndProcW;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_OBJECT_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.hCursor = LoadCursor( 0, IDC_ARROW );
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_OBJECT_CLASSNAMEW;
+ aWndClassEx.cbSize = sizeof( aWndClassEx );
+ aWndClassEx.style = 0;
+ aWndClassEx.lpfnWndProc = SalSysObjWndProcW;
+ aWndClassEx.cbClsExtra = 0;
+ aWndClassEx.cbWndExtra = SAL_OBJECT_WNDEXTRA;
+ aWndClassEx.hInstance = pSalData->mhInst;
+ aWndClassEx.hIcon = 0;
+ aWndClassEx.hIconSm = 0;
+ aWndClassEx.hCursor = LoadCursor( 0, IDC_ARROW );
+ aWndClassEx.hbrBackground = 0;
+ aWndClassEx.lpszMenuName = 0;
+ aWndClassEx.lpszClassName = SAL_OBJECT_CLASSNAMEW;
if ( RegisterClassExW( &aWndClassEx ) )
{
// Wegen PlugIn's loeschen wir erstmal den Hintergrund
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- aWndClassEx.lpfnWndProc = SalSysObjChildWndProcW;
- aWndClassEx.lpszClassName = SAL_OBJECT_CHILDCLASSNAMEW;
+ aWndClassEx.cbWndExtra = 0;
+ aWndClassEx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ aWndClassEx.lpfnWndProc = SalSysObjChildWndProcW;
+ aWndClassEx.lpszClassName = SAL_OBJECT_CHILDCLASSNAMEW;
if ( RegisterClassExW( &aWndClassEx ) )
pSalData->mbObjClassInit = TRUE;
}
@@ -571,25 +540,25 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
else
{
WNDCLASSEXA aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalSysObjWndProcA;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_OBJECT_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.hCursor = LoadCursor( 0, IDC_ARROW );
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_OBJECT_CLASSNAMEA;
+ aWndClassEx.cbSize = sizeof( aWndClassEx );
+ aWndClassEx.style = 0;
+ aWndClassEx.lpfnWndProc = SalSysObjWndProcA;
+ aWndClassEx.cbClsExtra = 0;
+ aWndClassEx.cbWndExtra = SAL_OBJECT_WNDEXTRA;
+ aWndClassEx.hInstance = pSalData->mhInst;
+ aWndClassEx.hIcon = 0;
+ aWndClassEx.hIconSm = 0;
+ aWndClassEx.hCursor = LoadCursor( 0, IDC_ARROW );
+ aWndClassEx.hbrBackground = 0;
+ aWndClassEx.lpszMenuName = 0;
+ aWndClassEx.lpszClassName = SAL_OBJECT_CLASSNAMEA;
if ( RegisterClassExA( &aWndClassEx ) )
{
// Wegen PlugIn's loeschen wir erstmal den Hintergrund
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- aWndClassEx.lpfnWndProc = SalSysObjChildWndProcA;
- aWndClassEx.lpszClassName = SAL_OBJECT_CHILDCLASSNAMEA;
+ aWndClassEx.cbWndExtra = 0;
+ aWndClassEx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ aWndClassEx.lpfnWndProc = SalSysObjChildWndProcA;
+ aWndClassEx.lpszClassName = SAL_OBJECT_CHILDCLASSNAMEA;
if ( RegisterClassExA( &aWndClassEx ) )
pSalData->mbObjClassInit = TRUE;
}
@@ -599,7 +568,7 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
if ( pSalData->mbObjClassInit )
{
WinSalObject* pObject = new WinSalObject;
-
+
// #135235# Clip siblings of this
// SystemChildWindow. Otherwise, DXCanvas (using a hidden
// SystemChildWindow) clobbers applets/plugins during
@@ -632,9 +601,9 @@ SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent )
if ( hWnd )
{
- pObject->mhWnd = hWnd;
- pObject->mhWndChild = hWndChild;
- pObject->maSysData.hWnd = hWndChild;
+ pObject->mhWnd = hWnd;
+ pObject->mhWndChild = hWndChild;
+ pObject->maSysData.hWnd = hWndChild;
return pObject;
}
}
@@ -648,12 +617,11 @@ WinSalObject::WinSalObject()
{
SalData* pSalData = GetSalData();
- mhWnd = 0;
- mhWndChild = 0;
- mhLastFocusWnd = 0;
- maSysData.nSize = sizeof( SystemEnvData );
- mpStdClipRgnData = NULL;
- mbInterceptChildWindowKeyDown = sal_False;
+ mhWnd = 0;
+ mhWndChild = 0;
+ mhLastFocusWnd = 0;
+ maSysData.nSize = sizeof( SystemEnvData );
+ mpStdClipRgnData = NULL;
// Insert object in objectlist
mpNextObject = pSalData->mpFirstObject;
@@ -713,16 +681,16 @@ void WinSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-sal_uInt16 WinSalObject::GetClipRegionType()
+USHORT WinSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void WinSalObject::BeginSetClipRegion( sal_uLong nRectCount )
+void WinSalObject::BeginSetClipRegion( ULONG nRectCount )
{
- sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
+ ULONG nRectBufSize = sizeof(RECT)*nRectCount;
if ( nRectCount < SAL_CLIPRECT_COUNT )
{
if ( !mpStdClipRgnData )
@@ -731,30 +699,30 @@ void WinSalObject::BeginSetClipRegion( sal_uLong nRectCount )
}
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.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;
+ mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ mbFirstClipRect = TRUE;
}
// -----------------------------------------------------------------------
void WinSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
- RECT* pRect = mpNextClipRect;
- RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
- long nRight = nX + nWidth;
- long nBottom = nY + nHeight;
+ RECT* pRect = mpNextClipRect;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ long nRight = nX + nWidth;
+ long nBottom = nY + nHeight;
if ( mbFirstClipRect )
{
- pBoundRect->left = nX;
- pBoundRect->top = nY;
- pBoundRect->right = nRight;
- pBoundRect->bottom = nBottom;
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
mbFirstClipRect = FALSE;
}
else
@@ -772,10 +740,10 @@ void WinSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
pBoundRect->bottom = (int)nBottom;
}
- pRect->left = (int)nX;
- pRect->top = (int)nY;
- pRect->right = (int)nRight;
- pRect->bottom = (int)nBottom;
+ pRect->left = (int)nX;
+ pRect->top = (int)nY;
+ pRect->right = (int)nRight;
+ pRect->bottom = (int)nBottom;
mpNextClipRect++;
}
@@ -794,7 +762,7 @@ void WinSalObject::EndSetClipRegion()
}
else
{
- sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
if ( mpClipRgnData != mpStdClipRgnData )
delete [] (BYTE*)mpClipRgnData;
@@ -808,8 +776,8 @@ void WinSalObject::EndSetClipRegion()
void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
{
- sal_uLong nStyle = 0;
- sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ ULONG nStyle = 0;
+ BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible )
{
ShowWindow( mhWnd, SW_HIDE );
@@ -822,7 +790,7 @@ void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalObject::Show( sal_Bool bVisible )
+void WinSalObject::Show( BOOL bVisible )
{
if ( bVisible )
ShowWindow( mhWnd, SW_SHOWNORMAL );
@@ -832,7 +800,7 @@ void WinSalObject::Show( sal_Bool bVisible )
// -----------------------------------------------------------------------
-void WinSalObject::Enable( sal_Bool bEnable )
+void WinSalObject::Enable( BOOL bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -868,11 +836,4 @@ const SystemEnvData* WinSalObject::GetSystemData() const
return &maSysData;
}
-// -----------------------------------------------------------------------
-
-void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept )
-{
- mbInterceptChildWindowKeyDown = bIntercept;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index d52737507a20..66bca942f74c 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -34,8 +34,6 @@ TARGETTYPE=GUI
ENABLE_EXCEPTIONS=TRUE
-my_components = i18npool i18nsearch
-
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -134,18 +132,16 @@ APP5STDLIBS+=-lsocket
.ENDIF
.INCLUDE : target.mk
+.IF "$(L10N_framework)"==""
-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
+ALLTAR : $(BIN)$/applicat.rdb
-$(MISC)/applicat.input :
- echo \
- '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
- > $@
-$(BIN)/types.rdb : $(SOLARBINDIR)/types.rdb
- $(COPY) $< $@
+$(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
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index e86db3ed7821..4d247dd6501f 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -74,8 +74,8 @@ namespace
class GrindApp : public Application
{
public:
- virtual int Main();
- virtual sal_uInt16 Exception( sal_uInt16 nError );
+ virtual void Main();
+ virtual USHORT Exception( USHORT nError );
};
class TestWindow : public Dialog
@@ -83,7 +83,7 @@ class TestWindow : public Dialog
public:
TestWindow() : Dialog( (Window *) NULL )
{
- SetText( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutDev grinding")) );
+ SetText( rtl::OUString::createFromAscii( "OutDev grinding" ) );
SetSizePixel( Size( 1024, 1024 ) );
EnablePaint( true );
Show();
@@ -115,7 +115,7 @@ void setupMethodStubs( functor_vector_type& res )
const Point aPt2(500,500);
const Point aPt3(0,0);
const Point aPt4(450,450);
-
+
const Rectangle aRect(aPt1,aPt2);
const Rectangle aRect2(aPt3,aPt4);
const Polygon aPoly(aRect);
@@ -154,7 +154,7 @@ void setupMethodStubs( functor_vector_type& res )
const Wallpaper aWallpaper( aWhiteColor );
GDIMetaFile aMtf;
- aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),sal_True) );
+ aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),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, (sal_uInt16)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
+// aPt1, aString, (USHORT)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, (sal_uInt16)0, aString.Len() ));
+ aPt1, aString, (const sal_Int32*)0, (USHORT)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,
- sal_uLong nHorzRount, sal_uLong nVertRound );
+ ULONG nHorzRount, ULONG nVertRound );
*/
add(res,
"DrawRect(round corners)",
boost::bind(
- (void (OutputDevice::*)( const Rectangle&, sal_uLong nHorzRount, sal_uLong nVertRound ))(
+ (void (OutputDevice::*)( const Rectangle&, ULONG nHorzRount, 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,
- sal_uInt16 nFlags = 0 );
+ USHORT nFlags = 0 );
*/
add(res,
"CopyArea",
boost::bind(
&OutputDevice::CopyArea,
_1,
- aPt1,aPt3,aRect2.GetSize(),(sal_uInt16)0 ));
+ aPt1,aPt3,aRect2.GetSize(),(USHORT)0 ));
/* void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -421,7 +421,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const Bitmap& ))(
&OutputDevice::DrawBitmap),
@@ -437,7 +437,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const Bitmap& ))(
&OutputDevice::DrawBitmap),
@@ -553,7 +553,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const BitmapEx& ))(
&OutputDevice::DrawBitmapEx),
@@ -569,7 +569,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const BitmapEx& ))(
&OutputDevice::DrawBitmapEx),
@@ -585,7 +585,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const BitmapEx& ))(
&OutputDevice::DrawBitmapEx),
@@ -601,7 +601,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const BitmapEx& ))(
&OutputDevice::DrawBitmapEx),
@@ -671,7 +671,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const Bitmap&,
const Color& ))(
@@ -688,7 +688,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Point&,
+ const Point&,
const Size&,
const Bitmap&,
const Color& ))(
@@ -697,31 +697,31 @@ void setupMethodStubs( functor_vector_type& res )
aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmap,aBlackColor ));
/* void DrawImage( const Point& rPos,
- const Image& rImage, sal_uInt16 nStyle = 0 );
+ const Image& rImage, USHORT nStyle = 0 );
*/
add(res,
"DrawImage",
boost::bind(
(void (OutputDevice::*)( const Point&,
- const Image&,
- sal_uInt16 nStyle ))(
+ const Image&,
+ USHORT nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aImage,(sal_uInt16)0 ));
+ aPt1,aImage,(USHORT)0 ));
/* void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, sal_uInt16 nStyle = 0 );
+ const Image& rImage, USHORT nStyle = 0 );
*/
add(res,
"DrawImage(scaled)",
boost::bind(
(void (OutputDevice::*)( const Point&,
const Size&,
- const Image&,
- sal_uInt16 nStyle ))(
+ const Image&,
+ USHORT nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 ));
+ aPt1,aRect.GetSize(),aImage,(USHORT)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, sal_uInt16 nStyle ); */
+ /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle ); */
add(res,
"DrawWaveLine",
boost::bind(
&OutputDevice::DrawWaveLine,
_1,
- aPt1,aPt2,(sal_uInt16)WAVE_NORMAL ));
+ aPt1,aPt2,(USHORT)WAVE_NORMAL ));
- /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
+ /* void DrawGrid( const Rectangle& rRect, const Size& rDist, 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,
- sal_uInt16 nTransparencePercent );
+ USHORT nTransparencePercent );
*/
add(res,
"DrawTransparent",
boost::bind(
- (void (OutputDevice::*)( const PolyPolygon&, sal_uInt16 ))(
+ (void (OutputDevice::*)( const PolyPolygon&, USHORT ))(
&OutputDevice::DrawTransparent),
_1,
- aPoly3,(sal_uInt16)50 ));
+ aPoly3,(USHORT)50 ));
/* void DrawTransparent( const GDIMetaFile& rMtf,
const Point& rPos, const Size& rSize,
@@ -792,7 +792,7 @@ void setupMethodStubs( functor_vector_type& res )
"DrawTransparent(metafile)",
boost::bind(
(void (OutputDevice::*)( const GDIMetaFile&,
- const Point&,
+ const Point&,
const Size&,
const Gradient& ))(
&OutputDevice::DrawTransparent),
@@ -810,9 +810,9 @@ void setupMethodStubs( functor_vector_type& res )
//----------------------------------------------------------------------------------
-void grindFunc( OutputDevice& rTarget,
+void grindFunc( OutputDevice& rTarget,
functor_vector_type::const_iterator iter,
- sal_Int32 nTurns,
+ sal_Int32 nTurns,
const char* pMsg )
{
const sal_uInt32 nStartTime( osl_getGlobalTimer() );
@@ -823,7 +823,7 @@ void grindFunc( OutputDevice& rTarget,
if( rTarget.GetOutDevType() == OUTDEV_WINDOW )
static_cast<Window&>(rTarget).Sync();
- fprintf( stdout,
+ fprintf( stdout,
"Duration: %d ms (%d repetitions)\tOperation: %s\tSetup: %s\n",
(int)(osl_getGlobalTimer() - nStartTime),
(int)(nTurns),
@@ -903,35 +903,35 @@ void TestWindow::Paint( const Rectangle& )
fflush( stdout );
}
-sal_uInt16 GrindApp::Exception( sal_uInt16 nError )
+USHORT GrindApp::Exception( USHORT nError )
{
switch( nError & EXC_MAJORTYPE )
{
case EXC_RSCNOTLOADED:
- Abort( String::CreateFromAscii(
+ Abort( String::CreateFromAscii(
"Error: could not load language resources.\nPlease check your installation.\n" ) );
break;
}
return 0;
}
-int GrindApp::Main()
+void GrindApp::Main()
{
bool bHelp = false;
- for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
+ for( USHORT i = 0; i < GetCommandLineParamCount(); i++ )
{
::rtl::OUString aParam = GetCommandLineParam( i );
- if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--help" ) ) ||
- aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ) ) )
+ if( aParam.equalsAscii( "--help" ) ||
+ aParam.equalsAscii( "-h" ) )
bHelp = true;
}
if( bHelp )
{
printf( "outdevgrind - Profile OutputDevice\n" );
- return EXIT_SUCCESS;
+ return;
}
//-------------------------------------------------
@@ -941,7 +941,7 @@ int GrindApp::Main()
try
{
uno::Reference< uno::XComponentContext > xCtx = ::cppu::defaultBootstrap_InitialComponentContext();
- xFactory = uno::Reference< lang::XMultiServiceFactory >( xCtx->getServiceManager(),
+ xFactory = uno::Reference< lang::XMultiServiceFactory >( xCtx->getServiceManager(),
uno::UNO_QUERY );
if( xFactory.is() )
::comphelper::setProcessServiceFactory( xFactory );
@@ -952,15 +952,15 @@ int GrindApp::Main()
if( !xFactory.is() )
{
- fprintf( stderr,
+ fprintf( stderr,
"Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
exit( 1 );
}
// Create UCB.
uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[ 0 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL ));
- aArgs[ 1 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE ));
+ aArgs[ 0 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
+ aArgs[ 1 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
::ucbhelper::ContentBroker::initialize( xFactory, aArgs );
TestWindow pWindow;
@@ -968,7 +968,6 @@ int GrindApp::Main()
// clean up UCB
::ucbhelper::ContentBroker::deinitialize();
- return EXIT_SUCCESS;
}
} // namespace
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 4898aed1a995..637c3c59b525 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,7 +56,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
@@ -72,13 +72,13 @@ class MyWin : public WorkWindow
public:
MyWin( Window* pParent, WinBits nWinStyle );
- void MouseMove( const MouseEvent& rMEvt );
- void MouseButtonDown( const MouseEvent& rMEvt );
- void MouseButtonUp( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
- void KeyUp( const KeyEvent& rKEvt );
- void Paint( const Rectangle& rRect );
- void Resize();
+ void MouseMove( const MouseEvent& rMEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void MouseButtonUp( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void KeyUp( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
};
// -----------------------------------------------------------------------
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 47af3aaa8e30..85a3f34244a8 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -59,17 +59,11 @@
#include <netinet/in.h>
+using namespace rtl;
using namespace cppu;
using namespace comphelper;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OUStringToOString;
-using ::rtl::OStringToOUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OStringBuffer;
// -----------------------------------------------------------------------
// Forward declaration
@@ -95,7 +89,7 @@ SAL_IMPLEMENT_MAIN()
catch( com::sun::star::uno::Exception& rExc)
{
}
-
+
if( ! xFactory.is() )
{
fprintf( stderr, "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
@@ -103,11 +97,11 @@ SAL_IMPLEMENT_MAIN()
}
/*
- * Create UCB.
+ * Create UCB.
*/
Sequence< Any > aArgs( 2 );
- aArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL ));
- aArgs[ 1 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE ));
+ aArgs[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
+ aArgs[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
#if OSL_DEBUG_LEVEL > 1
sal_Bool bSuccess =
#endif
@@ -139,19 +133,19 @@ class MyWin : public WorkWindow
public:
MyWin( Window* pParent, WinBits nWinStyle );
- void MouseMove( const MouseEvent& rMEvt );
- void MouseButtonDown( const MouseEvent& rMEvt );
- void MouseButtonUp( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
- void KeyUp( const KeyEvent& rKEvt );
- void Paint( const Rectangle& rRect );
- void Resize();
-
- sal_Bool Close();
-
+ void MouseMove( const MouseEvent& rMEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void MouseButtonUp( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void KeyUp( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
+
+ BOOL Close();
+
void parseList( const rtl::OString& rList );
rtl::OString processCommand( const rtl::OString& rCommand );
-
+
DECL_LINK( ListHdl, Button* );
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( QuitHdl, Button* );
@@ -181,24 +175,24 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
m_aListButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "List Elements" ) ) );
m_aListButton.SetClickHdl( LINK( this, MyWin, ListHdl ) );
m_aListButton.Show();
-
+
m_aSvpBitmaps.SetPosSizePixel( Point( 10, 40 ), Size( 150, 150 ) );
m_aSvpBitmaps.SetSelectHdl( LINK( this, MyWin, SelectHdl ) );
m_aSvpBitmaps.Show();
-
+
m_aImage.SetPosSizePixel( Point( 170, 10 ), Size( 400, 400 ) );
m_aImage.SetScaleMode( com::sun::star::awt::ImageScaleMode::None );
m_aImage.Show();
-
+
m_aQuitButton.SetPosSizePixel( Point( 10, 300 ), Size( 120,25 ) );
m_aQuitButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Quit SVP server" ) ) );
m_aQuitButton.SetClickHdl( LINK( this, MyWin, QuitHdl ) );
m_aQuitButton.Show();
}
-sal_Bool MyWin::Close()
+BOOL MyWin::Close()
{
- sal_Bool bRet = WorkWindow::Close();
+ BOOL bRet = WorkWindow::Close();
if( bRet )
Application::Quit();
return bRet;
@@ -214,7 +208,7 @@ void MyWin::parseList( const rtl::OString& rList )
rtl::OString aLine = rList.getToken( 0, '\n', nTokenPos );
if( ! aLine.getLength() || *aLine.getStr() == '#' )
continue;
-
+
if( aLine.compareTo( "ElementType: ", 13 ) == 0 )
aElementType = rtl::OStringToOUString( aLine.copy( 13 ), RTL_TEXTENCODING_ASCII_US );
else
@@ -279,7 +273,7 @@ IMPL_LINK( MyWin, QuitHdl, Button*, )
IMPL_LINK( MyWin, SelectHdl, ListBox*, )
{
String aEntry = m_aSvpBitmaps.GetSelectEntry();
- sal_uInt16 nPos = aEntry.SearchAscii( ": " );
+ USHORT nPos = aEntry.SearchAscii( ": " );
if( nPos != STRING_NOTFOUND )
{
OStringBuffer aCommand( 64 );
@@ -298,7 +292,7 @@ IMPL_LINK( MyWin, SelectHdl, ListBox*, )
aFixedSize.Width() += 10;
aFixedSize.Height() += 10;
m_aImage.SetSizePixel( aFixedSize );
- m_aImage.SetImage( Image( BitmapEx( aBitmap ) ) );
+ m_aImage.SetBitmap( BitmapEx( aBitmap ) );
}
return 0;
}
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index 545c2aedf6ee..4b5c40cb2439 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -47,11 +47,9 @@
#include <cppuhelper/servicefactory.hxx>
#include <cppuhelper/bootstrap.hxx>
+using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
// -----------------------------------------------------------------------
// Forward declaration
@@ -64,7 +62,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
@@ -81,13 +79,13 @@ class MyWin : public WorkWindow
public:
MyWin( Window* pParent, WinBits nWinStyle );
- void MouseMove( const MouseEvent& rMEvt );
- void MouseButtonDown( const MouseEvent& rMEvt );
- void MouseButtonUp( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
- void KeyUp( const KeyEvent& rKEvt );
- void Paint( const Rectangle& rRect );
- void Resize();
+ void MouseMove( const MouseEvent& rMEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void MouseButtonUp( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void KeyUp( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
};
// -----------------------------------------------------------------------
@@ -191,7 +189,7 @@ static Point project( const Point& rPoint )
static Color approachColor( const Color& rFrom, const Color& rTo )
{
Color aColor;
- sal_uInt8 nDiff;
+ UINT8 nDiff;
// approach red
if( rFrom.GetRed() < rTo.GetRed() )
{
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 547660fa1e1e..09e977114945 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -61,7 +61,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
@@ -77,13 +77,13 @@ class MyWin : public WorkWindow
public:
MyWin( Window* pParent, WinBits nWinStyle );
- void MouseMove( const MouseEvent& rMEvt );
- void MouseButtonDown( const MouseEvent& rMEvt );
- void MouseButtonUp( const MouseEvent& rMEvt );
- void KeyInput( const KeyEvent& rKEvt );
- void KeyUp( const KeyEvent& rKEvt );
- void Paint( const Rectangle& rRect );
- void Resize();
+ void MouseMove( const MouseEvent& rMEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void MouseButtonUp( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void KeyUp( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
};
// -----------------------------------------------------------------------
@@ -173,7 +173,7 @@ void MyWin::Paint( const Rectangle& rRect )
DrawLine( Point(r.nLeft, r.nTop+i), Point(r.nRight, r.nBottom-i) );
for(int i=0; i<aSz.Width(); i+=15)
DrawLine( Point(r.nLeft+i, r.nBottom), Point(r.nRight-i, r.nTop) );
-
+
SetTextColor( Color( COL_WHITE ) );
Font aFont( String( RTL_CONSTASCII_USTRINGPARAM( "Times" ) ), Size( 0, 25 ) );
SetFont( aFont );